fix(tactical): resolve DTO types and TS1272 build error for isolatedModules

This commit is contained in:
Hamza-Ayed
2026-08-18 09:46:04 +03:00
parent bd287d155b
commit 941420f5c0
86 changed files with 3614 additions and 1556 deletions
+12 -2
View File
@@ -72,8 +72,13 @@ let AdministrativeLinkingService = AdministrativeLinkingService_1 = class Admini
this.logger.log(`Found ${elements.length} points in OSM.`);
let detectedCountry = country;
if (!detectedCountry) {
const firstLat = parseFloat(bbox.split(',')[0]);
if (firstLat > 32.3)
const parts = bbox.split(',').map(parseFloat);
const firstLat = parts[0];
const lngs = [parts[1], parts[3]].filter(n => !isNaN(n));
const maxLng = lngs.length ? Math.max(...lngs) : undefined;
if (maxLng !== undefined && maxLng > 42.5)
detectedCountry = 'iraq';
else if (firstLat > 32.3)
detectedCountry = 'syria';
else if (firstLat < 31.0)
detectedCountry = 'egypt';
@@ -106,8 +111,13 @@ let AdministrativeLinkingService = AdministrativeLinkingService_1 = class Admini
LIMIT 1
),
(
-- حدّ 50كم إلزامي: بدونه تُسنَد نقطة لا تقع داخل أي حدود إلى أقرب
-- مقاطعة في الجدول كله مهما بَعُدت. حين استوردنا العراق قبل حدوده
-- الإدارية، رُبطت أحياء بغداد الـ185 بمقاطعات سورية/أردنية على بعد
-- ~700كم. عدم الربط أفضل من ربط خاطئ صامت.
SELECT id FROM admin_boundaries ab
WHERE ab.admin_level IN (6, 8)
AND ST_DWithin(ab.geom::geography, np.geometry::geography, 50000)
ORDER BY ab.geom::geometry <-> np.geometry::geometry
LIMIT 1
)