From 941420f5c060b6bb740e43b9eefb713b9ed42b38 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Tue, 18 Aug 2026 09:46:04 +0300 Subject: [PATCH] fix(tactical): resolve DTO types and TS1272 build error for isolatedModules --- apps/api/dist/app.module.js | 4 + apps/api/dist/app.module.js.map | 2 +- apps/api/dist/auth/auth.module.js | 9 +- apps/api/dist/auth/auth.module.js.map | 2 +- .../administrative-linking.service.d.ts | 4 +- .../administrative-linking.service.js | 14 +- .../administrative-linking.service.js.map | 2 +- .../dist/geocoding/dto/search-query.dto.js | 4 +- .../geocoding/dto/search-query.dto.js.map | 2 +- .../entities/map-candidate.entity.d.ts | 3 +- .../entities/map-candidate.entity.js | 1 + .../entities/map-candidate.entity.js.map | 2 +- .../geocoding/entities/place-iraq.entity.d.ts | 3 + .../geocoding/entities/place-iraq.entity.js | 18 + .../entities/place-iraq.entity.js.map | 1 + .../dist/geocoding/geocoding-init.service.js | 12 +- .../geocoding/geocoding-init.service.js.map | 2 +- .../dist/geocoding/geocoding.controller.d.ts | 11 +- .../dist/geocoding/geocoding.controller.js | 8 +- .../geocoding/geocoding.controller.js.map | 2 +- apps/api/dist/geocoding/geocoding.module.js | 2 + .../dist/geocoding/geocoding.module.js.map | 2 +- .../api/dist/geocoding/geocoding.service.d.ts | 13 +- apps/api/dist/geocoding/geocoding.service.js | 143 ++- .../dist/geocoding/geocoding.service.js.map | 2 +- .../geocoding/map-refinement.service.d.ts | 4 +- .../dist/geocoding/map-refinement.service.js | 13 +- .../geocoding/map-refinement.service.js.map | 2 +- apps/api/dist/maps/maps.module.js | 3 +- apps/api/dist/maps/maps.module.js.map | 2 +- .../dist/maps/road-refinement.controller.d.ts | 57 ++ .../dist/maps/road-refinement.controller.js | 613 ++++++++++++ .../maps/road-refinement.controller.js.map | 1 + .../dist/tactical/dto/line-of-sight.dto.d.ts | 29 + .../dist/tactical/dto/line-of-sight.dto.js | 209 ++++ .../tactical/dto/line-of-sight.dto.js.map | 1 + apps/api/dist/tactical/dto/tactical.dto.d.ts | 26 + apps/api/dist/tactical/dto/tactical.dto.js | 162 ++++ .../api/dist/tactical/dto/tactical.dto.js.map | 1 + .../dist/tactical/tactical.controller.d.ts | 49 + apps/api/dist/tactical/tactical.controller.js | 164 ++++ .../dist/tactical/tactical.controller.js.map | 1 + apps/api/dist/tactical/tactical.module.d.ts | 2 + apps/api/dist/tactical/tactical.module.js | 25 + apps/api/dist/tactical/tactical.module.js.map | 1 + apps/api/dist/tactical/tactical.service.d.ts | 69 ++ apps/api/dist/tactical/tactical.service.js | 199 ++++ .../api/dist/tactical/tactical.service.js.map | 1 + .../telemetry/external-telemetry.service.d.ts | 9 - .../telemetry/external-telemetry.service.js | 69 -- .../external-telemetry.service.js.map | 1 - .../telemetry/map-refinement.controller.d.ts | 40 - .../telemetry/map-refinement.controller.js | 171 ---- .../map-refinement.controller.js.map | 1 - .../telemetry/telemetry-analyzer.service.d.ts | 61 -- .../telemetry/telemetry-analyzer.service.js | 419 -------- .../telemetry-analyzer.service.js.map | 1 - .../dist/telemetry/telemetry.controller.d.ts | 40 - .../dist/telemetry/telemetry.controller.js | 118 --- .../telemetry/telemetry.controller.js.map | 1 - apps/api/dist/telemetry/telemetry.entity.d.ts | 10 - apps/api/dist/telemetry/telemetry.entity.js | 69 -- .../dist/telemetry/telemetry.entity.js.map | 1 - apps/api/dist/telemetry/telemetry.module.d.ts | 2 - apps/api/dist/telemetry/telemetry.module.js | 48 - .../dist/telemetry/telemetry.module.js.map | 1 - .../api/dist/telemetry/telemetry.service.d.ts | 19 - apps/api/dist/telemetry/telemetry.service.js | 59 -- .../dist/telemetry/telemetry.service.js.map | 1 - apps/api/dist/tsconfig.build.tsbuildinfo | 2 +- apps/api/dist/weather/weather.controller.d.ts | 8 + apps/api/dist/weather/weather.controller.js | 65 ++ .../dist/weather/weather.controller.js.map | 1 + apps/api/dist/weather/weather.module.d.ts | 2 + apps/api/dist/weather/weather.module.js | 25 + apps/api/dist/weather/weather.module.js.map | 1 + apps/api/dist/weather/weather.service.d.ts | 17 + apps/api/dist/weather/weather.service.js | 237 +++++ apps/api/dist/weather/weather.service.js.map | 1 + apps/api/src/tactical/dto/tactical.dto.ts | 106 ++ apps/api/src/tactical/tactical.controller.ts | 40 + apps/api/src/tactical/tactical.module.ts | 4 +- apps/api/src/tactical/tactical.service.ts | 586 +++++------ apps/web/src/main.tsx | 15 +- apps/web/src/pages/TacticalDefenseView.tsx | 913 ++++++++++++++++++ apps/web/src/utils/elevationService.ts | 104 ++ 86 files changed, 3614 insertions(+), 1556 deletions(-) create mode 100644 apps/api/dist/geocoding/entities/place-iraq.entity.d.ts create mode 100644 apps/api/dist/geocoding/entities/place-iraq.entity.js create mode 100644 apps/api/dist/geocoding/entities/place-iraq.entity.js.map create mode 100644 apps/api/dist/maps/road-refinement.controller.d.ts create mode 100644 apps/api/dist/maps/road-refinement.controller.js create mode 100644 apps/api/dist/maps/road-refinement.controller.js.map create mode 100644 apps/api/dist/tactical/dto/line-of-sight.dto.d.ts create mode 100644 apps/api/dist/tactical/dto/line-of-sight.dto.js create mode 100644 apps/api/dist/tactical/dto/line-of-sight.dto.js.map create mode 100644 apps/api/dist/tactical/dto/tactical.dto.d.ts create mode 100644 apps/api/dist/tactical/dto/tactical.dto.js create mode 100644 apps/api/dist/tactical/dto/tactical.dto.js.map create mode 100644 apps/api/dist/tactical/tactical.controller.d.ts create mode 100644 apps/api/dist/tactical/tactical.controller.js create mode 100644 apps/api/dist/tactical/tactical.controller.js.map create mode 100644 apps/api/dist/tactical/tactical.module.d.ts create mode 100644 apps/api/dist/tactical/tactical.module.js create mode 100644 apps/api/dist/tactical/tactical.module.js.map create mode 100644 apps/api/dist/tactical/tactical.service.d.ts create mode 100644 apps/api/dist/tactical/tactical.service.js create mode 100644 apps/api/dist/tactical/tactical.service.js.map delete mode 100644 apps/api/dist/telemetry/external-telemetry.service.d.ts delete mode 100644 apps/api/dist/telemetry/external-telemetry.service.js delete mode 100644 apps/api/dist/telemetry/external-telemetry.service.js.map delete mode 100644 apps/api/dist/telemetry/map-refinement.controller.d.ts delete mode 100644 apps/api/dist/telemetry/map-refinement.controller.js delete mode 100644 apps/api/dist/telemetry/map-refinement.controller.js.map delete mode 100644 apps/api/dist/telemetry/telemetry-analyzer.service.d.ts delete mode 100644 apps/api/dist/telemetry/telemetry-analyzer.service.js delete mode 100644 apps/api/dist/telemetry/telemetry-analyzer.service.js.map delete mode 100644 apps/api/dist/telemetry/telemetry.controller.d.ts delete mode 100644 apps/api/dist/telemetry/telemetry.controller.js delete mode 100644 apps/api/dist/telemetry/telemetry.controller.js.map delete mode 100644 apps/api/dist/telemetry/telemetry.entity.d.ts delete mode 100644 apps/api/dist/telemetry/telemetry.entity.js delete mode 100644 apps/api/dist/telemetry/telemetry.entity.js.map delete mode 100644 apps/api/dist/telemetry/telemetry.module.d.ts delete mode 100644 apps/api/dist/telemetry/telemetry.module.js delete mode 100644 apps/api/dist/telemetry/telemetry.module.js.map delete mode 100644 apps/api/dist/telemetry/telemetry.service.d.ts delete mode 100644 apps/api/dist/telemetry/telemetry.service.js delete mode 100644 apps/api/dist/telemetry/telemetry.service.js.map create mode 100644 apps/api/dist/weather/weather.controller.d.ts create mode 100644 apps/api/dist/weather/weather.controller.js create mode 100644 apps/api/dist/weather/weather.controller.js.map create mode 100644 apps/api/dist/weather/weather.module.d.ts create mode 100644 apps/api/dist/weather/weather.module.js create mode 100644 apps/api/dist/weather/weather.module.js.map create mode 100644 apps/api/dist/weather/weather.service.d.ts create mode 100644 apps/api/dist/weather/weather.service.js create mode 100644 apps/api/dist/weather/weather.service.js.map create mode 100644 apps/api/src/tactical/dto/tactical.dto.ts create mode 100644 apps/web/src/pages/TacticalDefenseView.tsx diff --git a/apps/api/dist/app.module.js b/apps/api/dist/app.module.js index b7419cc..26e6ff1 100644 --- a/apps/api/dist/app.module.js +++ b/apps/api/dist/app.module.js @@ -20,6 +20,8 @@ const throttler_1 = require("@nestjs/throttler"); const usage_module_1 = require("./usage/usage.module"); const billing_module_1 = require("./billing/billing.module"); const mail_module_1 = require("./common/mail.module"); +const weather_module_1 = require("./weather/weather.module"); +const tactical_module_1 = require("./tactical/tactical.module"); const usage_interceptor_1 = require("./usage/usage.interceptor"); let AppModule = class AppModule { }; @@ -52,6 +54,8 @@ exports.AppModule = AppModule = __decorate([ usage_module_1.UsageModule, billing_module_1.BillingModule, mail_module_1.MailModule, + weather_module_1.WeatherModule, + tactical_module_1.TacticalModule, ], controllers: [], providers: [ diff --git a/apps/api/dist/app.module.js.map b/apps/api/dist/app.module.js.map index f27e676..2edcbe4 100644 --- a/apps/api/dist/app.module.js.map +++ b/apps/api/dist/app.module.js.map @@ -1 +1 @@ -{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,uCAA0D;AAC1D,2CAA6D;AAC7D,6CAAgD;AAChD,+CAAkD;AAClD,mEAA+D;AAC/D,oDAAgD;AAChD,mEAA+D;AAC/D,oDAAgD;AAChD,iDAAoD;AACpD,uDAAmD;AACnD,6DAAyD;AACzD,sDAAkD;AAClD,iEAA6D;AAsCtD,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IApCrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,qBAAY,CAAC,OAAO,CAAC;gBACnB,QAAQ,EAAE,IAAI;aACf,CAAC;YACF,yBAAc,CAAC,OAAO,EAAE;YACxB,uBAAa,CAAC,YAAY,CAAC;gBACzB,OAAO,EAAE,CAAC,qBAAY,CAAC;gBACvB,MAAM,EAAE,CAAC,sBAAa,CAAC;gBACvB,UAAU,EAAE,CAAC,MAAqB,EAAE,EAAE,CAAC,CAAC;oBACtC,IAAI,EAAE,UAAU;oBAChB,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC;oBAC/B,gBAAgB,EAAE,IAAI;oBACtB,WAAW,EAAE,KAAK;iBACnB,CAAC;aACH,CAAC;YACF,2BAAe,CAAC,OAAO,CAAC,CAAC;oBACvB,GAAG,EAAE,KAAK;oBACV,KAAK,EAAE,EAAE;iBACV,CAAC,CAAC;YACH,wBAAU;YACV,kCAAe;YACf,wBAAU;YACV,kCAAe;YACf,0BAAW;YACX,8BAAa;YACb,wBAAU;SACX;QACD,WAAW,EAAE,EAAE;QACf,SAAS,EAAE;YACT;gBACE,OAAO,EAAE,sBAAe;gBACxB,QAAQ,EAAE,oCAAgB;aAC3B;SACF;KACF,CAAC;GACW,SAAS,CAAG"} \ No newline at end of file +{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,uCAA0D;AAC1D,2CAA6D;AAC7D,6CAAgD;AAChD,+CAAkD;AAClD,mEAA+D;AAC/D,oDAAgD;AAChD,mEAA+D;AAC/D,oDAAgD;AAChD,iDAAoD;AACpD,uDAAmD;AACnD,6DAAyD;AACzD,sDAAkD;AAClD,6DAAyD;AACzD,gEAA4D;AAC5D,iEAA6D;AAwCtD,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAtCrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,qBAAY,CAAC,OAAO,CAAC;gBACnB,QAAQ,EAAE,IAAI;aACf,CAAC;YACF,yBAAc,CAAC,OAAO,EAAE;YACxB,uBAAa,CAAC,YAAY,CAAC;gBACzB,OAAO,EAAE,CAAC,qBAAY,CAAC;gBACvB,MAAM,EAAE,CAAC,sBAAa,CAAC;gBACvB,UAAU,EAAE,CAAC,MAAqB,EAAE,EAAE,CAAC,CAAC;oBACtC,IAAI,EAAE,UAAU;oBAChB,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC;oBAC/B,gBAAgB,EAAE,IAAI;oBACtB,WAAW,EAAE,KAAK;iBACnB,CAAC;aACH,CAAC;YACF,2BAAe,CAAC,OAAO,CAAC,CAAC;oBACvB,GAAG,EAAE,KAAK;oBACV,KAAK,EAAE,EAAE;iBACV,CAAC,CAAC;YACH,wBAAU;YACV,kCAAe;YACf,wBAAU;YACV,kCAAe;YACf,0BAAW;YACX,8BAAa;YACb,wBAAU;YACV,8BAAa;YACb,gCAAc;SACf;QACD,WAAW,EAAE,EAAE;QACf,SAAS,EAAE;YACT;gBACE,OAAO,EAAE,sBAAe;gBACxB,QAAQ,EAAE,oCAAgB;aAC3B;SACF;KACF,CAAC;GACW,SAAS,CAAG"} \ No newline at end of file diff --git a/apps/api/dist/auth/auth.module.js b/apps/api/dist/auth/auth.module.js index 6048e52..5228aff 100644 --- a/apps/api/dist/auth/auth.module.js +++ b/apps/api/dist/auth/auth.module.js @@ -29,11 +29,10 @@ let AuthModule = class AuthModule { this.configService = configService; } async onModuleInit() { - const defaultKey = this.configService.get('MAP_API_KEY'); - if (defaultKey) { - await this.authService.seedDefaultKey('Default System', 'admin@intaleq.xyz', defaultKey); - console.log('✅ Default System API Key seeded successfully'); - } + const defaultKey = this.configService.get('MAP_API_KEY') || 'zP9vL5mK2nQ8xR7jT4wS1yB6hG3fV0cX'; + await this.authService.seedDefaultKey('Default System', 'admin@intaleq.xyz', defaultKey); + await this.authService.seedDefaultKey('Default Fallback', 'support@intaleq.xyz', 'intaleq_secret_2026'); + console.log('✅ System API Keys seeded successfully'); } }; exports.AuthModule = AuthModule; diff --git a/apps/api/dist/auth/auth.module.js.map b/apps/api/dist/auth/auth.module.js.map index 6471b76..230c837 100644 --- a/apps/api/dist/auth/auth.module.js.map +++ b/apps/api/dist/auth/auth.module.js.map @@ -1 +1 @@ -{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../src/auth/auth.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAA8D;AAC9D,6CAAgD;AAChD,iDAA6C;AAC7C,4DAAkD;AAClD,8DAAmD;AACnD,yDAAqD;AACrD,2CAA+C;AAC/C,2DAAuD;AACvD,qEAAgE;AAChE,sEAAiE;AAY1D,IAAM,UAAU,GAAhB,MAAM,UAAU;IAEF;IACA;IAFnB,YACmB,WAAwB,EACxB,aAA4B;QAD5B,gBAAW,GAAX,WAAW,CAAa;QACxB,kBAAa,GAAb,aAAa,CAAe;IAC5C,CAAC;IAMJ,KAAK,CAAC,YAAY;QAChB,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,aAAa,CAAC,CAAC;QACjE,IAAI,UAAU,EAAE,CAAC;YACf,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,gBAAgB,EAAE,mBAAmB,EAAE,UAAU,CAAC,CAAC;YACzF,OAAO,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;CACF,CAAA;AAjBY,gCAAU;qBAAV,UAAU;IAVtB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC,CAAC,sBAAM,EAAE,uBAAM,CAAC,CAAC;YAC1C,0BAAW;SACZ;QACD,WAAW,EAAE,CAAC,oCAAgB,CAAC;QAC/B,SAAS,EAAE,CAAC,0BAAW,EAAE,6CAAoB,EAAE,uCAAiB,CAAC;QACjE,OAAO,EAAE,CAAC,0BAAW,EAAE,6CAAoB,EAAE,uCAAiB,CAAC;KAChE,CAAC;qCAGgC,0BAAW,sBACT,sBAAa,oBAAb,sBAAa;GAHpC,UAAU,CAiBtB"} \ No newline at end of file +{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../src/auth/auth.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAA8D;AAC9D,6CAAgD;AAChD,iDAA6C;AAC7C,4DAAkD;AAClD,8DAAmD;AACnD,yDAAqD;AACrD,2CAA+C;AAC/C,2DAAuD;AACvD,qEAAgE;AAChE,sEAAiE;AAY1D,IAAM,UAAU,GAAhB,MAAM,UAAU;IAEF;IACA;IAFnB,YACmB,WAAwB,EACxB,aAA4B;QAD5B,gBAAW,GAAX,WAAW,CAAa;QACxB,kBAAa,GAAb,aAAa,CAAe;IAC5C,CAAC;IAMJ,KAAK,CAAC,YAAY;QAChB,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,aAAa,CAAC,IAAI,kCAAkC,CAAC;QACvG,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,gBAAgB,EAAE,mBAAmB,EAAE,UAAU,CAAC,CAAC;QACzF,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,kBAAkB,EAAE,qBAAqB,EAAE,qBAAqB,CAAC,CAAC;QACxG,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;IACvD,CAAC;CACF,CAAA;AAhBY,gCAAU;qBAAV,UAAU;IAVtB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC,CAAC,sBAAM,EAAE,uBAAM,CAAC,CAAC;YAC1C,0BAAW;SACZ;QACD,WAAW,EAAE,CAAC,oCAAgB,CAAC;QAC/B,SAAS,EAAE,CAAC,0BAAW,EAAE,6CAAoB,EAAE,uCAAiB,CAAC;QACjE,OAAO,EAAE,CAAC,0BAAW,EAAE,6CAAoB,EAAE,uCAAiB,CAAC;KAChE,CAAC;qCAGgC,0BAAW,sBACT,sBAAa,oBAAb,sBAAa;GAHpC,UAAU,CAgBtB"} \ No newline at end of file diff --git a/apps/api/dist/geocoding/administrative-linking.service.d.ts b/apps/api/dist/geocoding/administrative-linking.service.d.ts index f08179e..b26550a 100644 --- a/apps/api/dist/geocoding/administrative-linking.service.d.ts +++ b/apps/api/dist/geocoding/administrative-linking.service.d.ts @@ -24,9 +24,9 @@ export declare class AdministrativeLinkingService { total_polygons: number; districts_processed: any; }>; - linkPlaces(country: 'jordan' | 'syria' | 'egypt'): Promise<{ + linkPlaces(country: 'jordan' | 'syria' | 'egypt' | 'iraq'): Promise<{ status: string; - country: "syria" | "jordan" | "egypt"; + country: "iraq" | "syria" | "jordan" | "egypt"; total_places: number; linked_neighborhood: number; linked_district: number; diff --git a/apps/api/dist/geocoding/administrative-linking.service.js b/apps/api/dist/geocoding/administrative-linking.service.js index d429837..55d564d 100644 --- a/apps/api/dist/geocoding/administrative-linking.service.js +++ b/apps/api/dist/geocoding/administrative-linking.service.js @@ -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 ) diff --git a/apps/api/dist/geocoding/administrative-linking.service.js.map b/apps/api/dist/geocoding/administrative-linking.service.js.map index 4d7f83f..684a519 100644 --- a/apps/api/dist/geocoding/administrative-linking.service.js.map +++ b/apps/api/dist/geocoding/administrative-linking.service.js.map @@ -1 +1 @@ -{"version":3,"file":"administrative-linking.service.js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I,CAAC,UAAU,CAAC,KAAK,CAAC;;;aAGvC,SAAS;;;;KAIjB,CAAC,CAAC;QAEH,MAAM,WAAW,GAAG;YAClB,MAAM,EAAE,WAAW;YACnB,OAAO;YACP,YAAY,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;YAC1C,mBAAmB,EAAE,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;YACxD,eAAe,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;YAChD,kBAAkB,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;YAC9C,aAAa,EAAE,WAAW;YAC1B,aAAa,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,IAAI,SAAS;SAC9C,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,uBAAuB,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QACtE,OAAO,WAAW,CAAC;IACrB,CAAC;CACF,CAAA;AA3RY,oEAA4B;uCAA5B,4BAA4B;IADxC,IAAA,mBAAU,GAAE;IAMR,WAAA,IAAA,0BAAgB,EAAC,6CAAiB,CAAC,CAAA;IAEnC,WAAA,IAAA,0BAAgB,EAAC,iDAAmB,CAAC,CAAA;IAErC,WAAA,IAAA,0BAAgB,EAAC,qCAAa,CAAC,CAAA;yDALZ,oBAAU,oBAAV,oBAAU,oDAEU,oBAAU,oBAAV,oBAAU,oDAER,oBAAU,oBAAV,oBAAU,oDAEhB,oBAAU,oBAAV,oBAAU;GAVrC,4BAA4B,CA2RxC"} \ No newline at end of file +{"version":3,"file":"administrative-linking.service.js","sourceRoot":"","sources":["../../src/geocoding/administrative-linking.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,6CAAmD;AACnD,qCAAiD;AACjD,oFAAyE;AACzE,wFAA6E;AAC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AEU,oBAAU,oBAAV,oBAAU,oDAER,oBAAU,oBAAV,oBAAU,oDAEhB,oBAAU,oBAAV,oBAAU;GAVrC,4BAA4B,CAoSxC"} \ No newline at end of file diff --git a/apps/api/dist/geocoding/dto/search-query.dto.js b/apps/api/dist/geocoding/dto/search-query.dto.js index 482b0fc..0b28e10 100644 --- a/apps/api/dist/geocoding/dto/search-query.dto.js +++ b/apps/api/dist/geocoding/dto/search-query.dto.js @@ -51,8 +51,8 @@ __decorate([ ], SearchQueryDto.prototype, "radius", void 0); __decorate([ (0, class_validator_1.IsOptional)(), - (0, class_validator_1.IsEnum)(['jordan', 'syria', 'egypt']), - (0, swagger_1.ApiPropertyOptional)({ description: 'Country filter', enum: ['jordan', 'syria', 'egypt'] }), + (0, class_validator_1.IsEnum)(['jordan', 'syria', 'egypt', 'iraq']), + (0, swagger_1.ApiPropertyOptional)({ description: 'Country filter', enum: ['jordan', 'syria', 'egypt', 'iraq'] }), __metadata("design:type", String) ], SearchQueryDto.prototype, "country", void 0); //# sourceMappingURL=search-query.dto.js.map \ No newline at end of file diff --git a/apps/api/dist/geocoding/dto/search-query.dto.js.map b/apps/api/dist/geocoding/dto/search-query.dto.js.map index 4f00739..f197293 100644 --- a/apps/api/dist/geocoding/dto/search-query.dto.js.map +++ b/apps/api/dist/geocoding/dto/search-query.dto.js.map @@ -1 +1 @@ -{"version":3,"file":"search-query.dto.js","sourceRoot":"","sources":["../../../src/geocoding/dto/search-query.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmF;AACnF,yDAAyC;AACzC,6CAAsD;AAEtD,MAAa,cAAc;IAGzB,CAAC,CAAS;IAMV,GAAG,CAAU;IAMb,GAAG,CAAU;IAQb,MAAM,GAAY,KAAK,CAAC;IAKxB,OAAO,CAAU;CAClB;AA7BD,wCA6BC;AA1BC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;;yCAClD;AAMV;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;;2CACzD;AAMb;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;;2CAC1D;AAQb;IANC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAG,EAAC,CAAC,CAAC;IACN,IAAA,qBAAG,EAAC,KAAK,CAAC;IACV,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;8CAC3D;AAKxB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACpC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC;;+CAC1E"} \ No newline at end of file +{"version":3,"file":"search-query.dto.js","sourceRoot":"","sources":["../../../src/geocoding/dto/search-query.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmF;AACnF,yDAAyC;AACzC,6CAAsD;AAEtD,MAAa,cAAc;IAGzB,CAAC,CAAS;IAMV,GAAG,CAAU;IAMb,GAAG,CAAU;IAQb,MAAM,GAAY,KAAK,CAAC;IAKxB,OAAO,CAAU;CAClB;AA7BD,wCA6BC;AA1BC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;;yCAClD;AAMV;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;;2CACzD;AAMb;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;;2CAC1D;AAQb;IANC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAG,EAAC,CAAC,CAAC;IACN,IAAA,qBAAG,EAAC,KAAK,CAAC;IACV,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;8CAC3D;AAKxB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC5C,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC;;+CAClF"} \ No newline at end of file diff --git a/apps/api/dist/geocoding/entities/map-candidate.entity.d.ts b/apps/api/dist/geocoding/entities/map-candidate.entity.d.ts index 132fe78..3149662 100644 --- a/apps/api/dist/geocoding/entities/map-candidate.entity.d.ts +++ b/apps/api/dist/geocoding/entities/map-candidate.entity.d.ts @@ -7,7 +7,8 @@ export declare enum CandidateStatus { export declare enum CountryCode { JORDAN = "JORDAN", SYRIA = "SYRIA", - EGYPT = "EGYPT" + EGYPT = "EGYPT", + IRAQ = "IRAQ" } export declare class MapCandidate extends BasePlace { status: CandidateStatus; diff --git a/apps/api/dist/geocoding/entities/map-candidate.entity.js b/apps/api/dist/geocoding/entities/map-candidate.entity.js index 81d96c2..0eae235 100644 --- a/apps/api/dist/geocoding/entities/map-candidate.entity.js +++ b/apps/api/dist/geocoding/entities/map-candidate.entity.js @@ -23,6 +23,7 @@ var CountryCode; CountryCode["JORDAN"] = "JORDAN"; CountryCode["SYRIA"] = "SYRIA"; CountryCode["EGYPT"] = "EGYPT"; + CountryCode["IRAQ"] = "IRAQ"; })(CountryCode || (exports.CountryCode = CountryCode = {})); let MapCandidate = class MapCandidate extends base_place_entity_1.BasePlace { status; diff --git a/apps/api/dist/geocoding/entities/map-candidate.entity.js.map b/apps/api/dist/geocoding/entities/map-candidate.entity.js.map index 61203f0..78283fc 100644 --- a/apps/api/dist/geocoding/entities/map-candidate.entity.js.map +++ b/apps/api/dist/geocoding/entities/map-candidate.entity.js.map @@ -1 +1 @@ -{"version":3,"file":"map-candidate.entity.js","sourceRoot":"","sources":["../../../src/geocoding/entities/map-candidate.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAgD;AAChD,2DAAgD;AAEhD,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,wCAAqB,CAAA;IACrB,wCAAqB,CAAA;AACvB,CAAC,EAJW,eAAe,+BAAf,eAAe,QAI1B;AAED,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,8BAAe,CAAA;IACf,8BAAe,CAAA;AACjB,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAGM,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,6BAAS;IAOzC,MAAM,CAAkB;IAIxB,WAAW,CAAS;IAGpB,eAAe,CAAS;IAQxB,OAAO,CAAc;IAGrB,QAAQ,CAAM;IAGd,aAAa,CAAS;IAGtB,gBAAgB,CAAS;IAGzB,qBAAqB,CAAM;CAC5B,CAAA;AAnCY,oCAAY;AAOvB;IANC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,eAAe,CAAC,OAAO;KACjC,CAAC;IACD,IAAA,eAAK,GAAE;;4CACgB;AAIxB;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,eAAK,GAAE;;iDACY;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACjB;AAQxB;IANC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,WAAW,CAAC,MAAM;KAC5B,CAAC;IACD,IAAA,eAAK,GAAE;;6CACa;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CAC5B;AAGd;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACL;AAGtB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;sDACX;AAGzB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2DACf;uBAlChB,YAAY;IADxB,IAAA,gBAAM,EAAC,gBAAgB,CAAC;GACZ,YAAY,CAmCxB"} \ No newline at end of file +{"version":3,"file":"map-candidate.entity.js","sourceRoot":"","sources":["../../../src/geocoding/entities/map-candidate.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAgD;AAChD,2DAAgD;AAEhD,IAAY,eAIX;AAJD,WAAY,eAAe;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AI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;sDACX;AAGzB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2DACf;uBAlChB,YAAY;IADxB,IAAA,gBAAM,EAAC,gBAAgB,CAAC;GACZ,YAAY,CAmCxB"} \ No newline at end of file diff --git a/apps/api/dist/geocoding/entities/place-iraq.entity.d.ts b/apps/api/dist/geocoding/entities/place-iraq.entity.d.ts new file mode 100644 index 0000000..62a2745 --- /dev/null +++ b/apps/api/dist/geocoding/entities/place-iraq.entity.d.ts @@ -0,0 +1,3 @@ +import { BasePlace } from './base-place.entity'; +export declare class PlaceIraq extends BasePlace { +} diff --git a/apps/api/dist/geocoding/entities/place-iraq.entity.js b/apps/api/dist/geocoding/entities/place-iraq.entity.js new file mode 100644 index 0000000..857cefe --- /dev/null +++ b/apps/api/dist/geocoding/entities/place-iraq.entity.js @@ -0,0 +1,18 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PlaceIraq = void 0; +const typeorm_1 = require("typeorm"); +const base_place_entity_1 = require("./base-place.entity"); +let PlaceIraq = class PlaceIraq extends base_place_entity_1.BasePlace { +}; +exports.PlaceIraq = PlaceIraq; +exports.PlaceIraq = PlaceIraq = __decorate([ + (0, typeorm_1.Entity)('places_iraq') +], PlaceIraq); +//# sourceMappingURL=place-iraq.entity.js.map \ No newline at end of file diff --git a/apps/api/dist/geocoding/entities/place-iraq.entity.js.map b/apps/api/dist/geocoding/entities/place-iraq.entity.js.map new file mode 100644 index 0000000..7d20459 --- /dev/null +++ b/apps/api/dist/geocoding/entities/place-iraq.entity.js.map @@ -0,0 +1 @@ +{"version":3,"file":"place-iraq.entity.js","sourceRoot":"","sources":["../../../src/geocoding/entities/place-iraq.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,qCAAiC;AACjC,2DAAgD;AAGzC,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,6BAAS;CAAG,CAAA;AAA9B,8BAAS;oBAAT,SAAS;IADrB,IAAA,gBAAM,EAAC,aAAa,CAAC;GACT,SAAS,CAAqB"} \ No newline at end of file diff --git a/apps/api/dist/geocoding/geocoding-init.service.js b/apps/api/dist/geocoding/geocoding-init.service.js index 34fdd9f..c7f6ff6 100644 --- a/apps/api/dist/geocoding/geocoding-init.service.js +++ b/apps/api/dist/geocoding/geocoding-init.service.js @@ -30,7 +30,7 @@ let GeocodingInitService = GeocodingInitService_1 = class GeocodingInitService { try { await this.repo.query('CREATE EXTENSION IF NOT EXISTS postgis;'); await this.repo.query('CREATE EXTENSION IF NOT EXISTS pg_trgm;'); - const tables = ['places_jordan', 'places_syria', 'places_egypt']; + const tables = ['places_jordan', 'places_syria', 'places_egypt', 'places_iraq']; const columnMapping = [ { old: 'admin_level4_id', new: 'governorate_id' }, { old: 'admin_level6_id', new: 'district_id' }, @@ -84,12 +84,20 @@ let GeocodingInitService = GeocodingInitService_1 = class GeocodingInitService { CREATE TRIGGER trg_sync_place_location_egypt BEFORE INSERT OR UPDATE ON places_egypt FOR EACH ROW EXECUTE FUNCTION sync_place_location(); + `); + await this.repo.query(` + DROP TRIGGER IF EXISTS trg_sync_place_location_iraq ON places_iraq; + CREATE TRIGGER trg_sync_place_location_iraq + BEFORE INSERT OR UPDATE ON places_iraq + FOR EACH ROW EXECUTE FUNCTION sync_place_location(); `); await this.repo.query('CREATE INDEX IF NOT EXISTS idx_places_jordan_location ON places_jordan USING gist (location);'); await this.repo.query('CREATE INDEX IF NOT EXISTS idx_places_egypt_location ON places_egypt USING gist (location);'); + await this.repo.query('CREATE INDEX IF NOT EXISTS idx_places_iraq_location ON places_iraq USING gist (location);'); await this.repo.query('CREATE INDEX IF NOT EXISTS idx_places_jordan_names_trgm ON places_jordan USING gist (name_ar gist_trgm_ops, name_en gist_trgm_ops);'); await this.repo.query('CREATE INDEX IF NOT EXISTS idx_places_egypt_names_trgm ON places_egypt USING gist (name_ar gist_trgm_ops, name_en gist_trgm_ops);'); - this.logger.log('Geocoding database triggers and optimized indexes initialized for Syria, Jordan, and Egypt.'); + await this.repo.query('CREATE INDEX IF NOT EXISTS idx_places_iraq_names_trgm ON places_iraq USING gist (name_ar gist_trgm_ops, name_en gist_trgm_ops);'); + this.logger.log('Geocoding database triggers and optimized indexes initialized for Syria, Jordan, Egypt, and Iraq.'); } catch (err) { this.logger.error('Failed to initialize database geocoding triggers:', err); diff --git a/apps/api/dist/geocoding/geocoding-init.service.js.map b/apps/api/dist/geocoding/geocoding-init.service.js.map index f0cf7ea..ba58b83 100644 --- a/apps/api/dist/geocoding/geocoding-init.service.js.map +++ b/apps/api/dist/geocoding/geocoding-init.service.js.map @@ -1 +1 @@ -{"version":3,"file":"geocoding-init.service.js","sourceRoot":"","sources":["../../src/geocoding/geocoding-init.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAkE;AAClE,6CAAmD;AACnD,qCAAqC;AACrC,sEAA2D;AAGpD,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;IAKZ;IAJF,MAAM,GAAG,IAAI,eAAM,CAAC,sBAAoB,CAAC,IAAI,CAAC,CAAC;IAEhE,YAEmB,IAA4B;QAA5B,SAAI,GAAJ,IAAI,CAAwB;IAC5C,CAAC;IAEJ,KAAK,CAAC,YAAY;QAChB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,iDAAiD,CAAC,CAAC;QACnE,IAAI,CAAC;YAEH,MAAM,IAAI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C;YAGrH,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,qIAAqI,CAAC,CAAC;YAC7J,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,mIAAmI,CAAC,CAAC;YAE3J,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,6FAA6F,CAAC,CAAC;QACjH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mDAAmD,EAAE,GAAG,CAAC,CAAC;QAC9E,CAAC;IACH,CAAC;CACF,CAAA;AA5FY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;IAKR,WAAA,IAAA,0BAAgB,EAAC,+BAAU,CAAC,CAAA;yDACN,oBAAU,oBAAV,oBAAU;GALxB,oBAAoB,CA4FhC"} \ No newline at end of file +{"version":3,"file":"geocoding-init.service.js","sourceRoot":"","sources":["../../src/geocoding/geocoding-init.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAkE;AAClE,6CAAmD;AACnD,qCAAqC;AACrC,sEAA2D;AAGpD,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;IAKZ;IAJF,MAAM,GAAG,IAAI,eAAM,CAAC,sBAAoB,CAAC,IAAI,CAAC,CAAC;IAEhE,YAEmB,IAA4B;QAA5B,SAAI,GAAJ,IAAI,CAAwB;IAC5C,CAAC;IAEJ,KAAK,CAAC,YAAY;QAChB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,iDAAiD,CAAC,CAAC;QACnE,IAAI,CAAC;YAEH,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;YACjE,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;YAGjE,MAAM,MAAM,GAAG,CAAC,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;YAChF,MAAM,aAAa,GAAG;gBACp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AM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,mIAAmI,CAAC,CAAC;YAC3J,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,iIAAiI,CAAC,CAAC;YAEzJ,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,mGAAmG,CAAC,CAAC;QACvH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mDAAmD,EAAE,GAAG,CAAC,CAAC;QAC9E,CAAC;IACH,CAAC;CACF,CAAA;AArGY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;IAKR,WAAA,IAAA,0BAAgB,EAAC,+BAAU,CAAC,CAAA;yDACN,oBAAU,oBAAV,oBAAU;GALxB,oBAAoB,CAqGhC"} \ No newline at end of file diff --git a/apps/api/dist/geocoding/geocoding.controller.d.ts b/apps/api/dist/geocoding/geocoding.controller.d.ts index b1ef850..a1b588f 100644 --- a/apps/api/dist/geocoding/geocoding.controller.d.ts +++ b/apps/api/dist/geocoding/geocoding.controller.d.ts @@ -49,6 +49,13 @@ export declare class GeocodingController { processed: number; created: number; updated: number; + failed: number; + errors: { + index: number; + name?: string; + reason: string; + }[]; + errorsTruncated: boolean; }>; getPlaces(limit?: string): Promise; getGeoJSON(): Promise<{ @@ -87,9 +94,9 @@ export declare class GeocodingController { total_polygons: number; districts_processed: any; }>; - linkPlaces(country: 'jordan' | 'syria' | 'egypt'): Promise<{ + linkPlaces(country: 'jordan' | 'syria' | 'egypt' | 'iraq'): Promise<{ status: string; - country: "syria" | "jordan" | "egypt"; + country: "iraq" | "syria" | "jordan" | "egypt"; total_places: number; linked_neighborhood: number; linked_district: number; diff --git a/apps/api/dist/geocoding/geocoding.controller.js b/apps/api/dist/geocoding/geocoding.controller.js index 43a8a4e..daf4cb5 100644 --- a/apps/api/dist/geocoding/geocoding.controller.js +++ b/apps/api/dist/geocoding/geocoding.controller.js @@ -135,7 +135,7 @@ __decorate([ (0, swagger_1.ApiOperation)({ summary: 'Delete a place by name or ID' }), (0, swagger_1.ApiQuery)({ name: 'name', required: false }), (0, swagger_1.ApiQuery)({ name: 'id', required: false, type: Number }), - (0, swagger_1.ApiQuery)({ name: 'country', required: true, enum: ['jordan', 'syria', 'egypt'] }), + (0, swagger_1.ApiQuery)({ name: 'country', required: true, enum: ['jordan', 'syria', 'egypt', 'iraq'] }), __param(0, (0, common_1.Query)('country')), __param(1, (0, common_1.Query)('name')), __param(2, (0, common_1.Query)('id')), @@ -200,7 +200,7 @@ __decorate([ (0, common_1.UseGuards)(admin_guard_1.AdminGuard), (0, swagger_1.ApiOperation)({ summary: 'Sync neighborhood points from OSM for a bbox' }), (0, swagger_1.ApiQuery)({ name: 'bbox', required: false }), - (0, swagger_1.ApiQuery)({ name: 'country', required: false, enum: ['jordan', 'syria', 'egypt'] }), + (0, swagger_1.ApiQuery)({ name: 'country', required: false, enum: ['jordan', 'syria', 'egypt', 'iraq'] }), __param(0, (0, common_1.Query)('bbox')), __param(1, (0, common_1.Query)('country')), __metadata("design:type", Function), @@ -211,7 +211,7 @@ __decorate([ (0, common_1.Post)('admin/generate-voronoi'), (0, common_1.UseGuards)(admin_guard_1.AdminGuard), (0, swagger_1.ApiOperation)({ summary: 'Generate Voronoi polygons for neighborhoods' }), - (0, swagger_1.ApiQuery)({ name: 'country', required: false, enum: ['jordan', 'syria', 'egypt'] }), + (0, swagger_1.ApiQuery)({ name: 'country', required: false, enum: ['jordan', 'syria', 'egypt', 'iraq'] }), __param(0, (0, common_1.Query)('country')), __metadata("design:type", Function), __metadata("design:paramtypes", [String]), @@ -221,7 +221,7 @@ __decorate([ (0, common_1.Post)('admin/link-places'), (0, common_1.UseGuards)(admin_guard_1.AdminGuard), (0, swagger_1.ApiOperation)({ summary: 'Link places to administrative hierarchy' }), - (0, swagger_1.ApiQuery)({ name: 'country', required: true, enum: ['jordan', 'syria', 'egypt'] }), + (0, swagger_1.ApiQuery)({ name: 'country', required: true, enum: ['jordan', 'syria', 'egypt', 'iraq'] }), __param(0, (0, common_1.Query)('country')), __metadata("design:type", Function), __metadata("design:paramtypes", [String]), diff --git a/apps/api/dist/geocoding/geocoding.controller.js.map b/apps/api/dist/geocoding/geocoding.controller.js.map index 2b5d323..bf2c64d 100644 --- a/apps/api/dist/geocoding/geocoding.controller.js.map +++ b/apps/api/dist/geocoding/geocoding.controller.js.map @@ -1 +1 @@ -{"version":3,"file":"geocoding.controller.js","sourceRoot":"","sources":["../../src/geocoding/geocoding.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAuH;AACvH,6CAA6E;AAC7E,2DAAuD;AACvD,yEAAoE;AACpE,uEAAkE;AAClE,qFAAgF;AAChF,qEAAgE;AAChE,kEAA6D;AAC7D,8DAA0D;AAC1D,4EAA2E;AAC3E,6DAAwD;AACxD,mEAA8D;AAMvD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAEX;IACA;IACA;IACA;IACA;IALnB,YACmB,gBAAkC,EAClC,sBAA8C,EAC9C,qBAA4C,EAC5C,mBAAiD,EACjD,iBAAuC;QAJvC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,2BAAsB,GAAtB,sBAAsB,CAAwB;QAC9C,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,wBAAmB,GAAnB,mBAAmB,CAA8B;QACjD,sBAAiB,GAAjB,iBAAiB,CAAsB;IACvD,CAAC;IAIE,AAAN,KAAK,CAAC,MAAM,CAAU,QAAwB;QAC5C,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAC;QAGlD,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1E,CAAC;IAMK,AAAN,KAAK,CAAC,YAAY,CAAa,CAAS,EAAoB,OAAgB;QAC1E,IAAI,CA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,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC;IAChE,WAAA,IAAA,cAAK,EAAC,SAAS,CAAC,CAAA;;;;qDAEjC;8BAhIU,mBAAmB;IAJ/B,IAAA,iBAAO,EAAC,WAAW,CAAC;IACpB,IAAA,mBAAS,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,sBAAsB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACrF,IAAA,mBAAU,EAAC,WAAW,CAAC;IACvB,IAAA,kBAAS,EAAC,2BAAW,EAAE,yCAAoB,CAAC;qCAGN,oCAAgB;QACV,iDAAsB;QACvB,+CAAqB;QACvB,6DAA4B;QAC9B,6CAAoB;GAN/C,mBAAmB,CAiI/B"} \ No newline at end of file +{"version":3,"file":"geocoding.controller.js","sourceRoot":"","sources":["../../src/geocoding/geocoding.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAuH;AACvH,6CAA6E;AAC7E,2DAAuD;AACvD,yEAAoE;AACpE,uEAAkE;AAClE,qFAAgF;AAChF,qEAAgE;AAChE,kEAA6D;AAC7D,8DAA0D;AAC1D,4EAA2E;AAC3E,6DAAwD;AACxD,mEAA8D;AAMvD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAEX;IACA;IACA;IACA;IACA;IALnB,YACmB,gBAAkC,EAClC,sBAA8C,EAC9C,qBAA4C,EAC5C,mBAAiD,EACjD,iBAAuC;QAJvC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,2BAAsB,GAAtB,sBAAsB,CAAwB;QAC9C,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,wBAAmB,GAAnB,mBAAmB,CAA8B;QACjD,sBAAiB,GAAjB,iBAAiB,CAAsB;IACvD,CAAC;IAIE,AAAN,KAAK,CAAC,MAAM,CAAU,QAAwB;QAC5C,MAAM,EAAE,CAAC,EAAE,GAA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AO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC;IACpE,WAAA,IAAA,cAAK,EAAC,SAAS,CAAC,CAAA;;;;0DAEtC;AAMK;IAJL,IAAA,aAAI,EAAC,mBAAmB,CAAC;IACzB,IAAA,kBAAS,EAAC,wBAAU,CAAC;IACrB,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,yCAAyC,EAAE,CAAC;IACpE,IAAA,kBAAQ,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC;IACxE,WAAA,IAAA,cAAK,EAAC,SAAS,CAAC,CAAA;;;;qDAEjC;8BAhIU,mBAAmB;IAJ/B,IAAA,iBAAO,EAAC,WAAW,CAAC;IACpB,IAAA,mBAAS,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,sBAAsB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACrF,IAAA,mBAAU,EAAC,WAAW,CAAC;IACvB,IAAA,kBAAS,EAAC,2BAAW,EAAE,yCAAoB,CAAC;qCAGN,oCAAgB;QACV,iDAAsB;QACvB,+CAAqB;QACvB,6DAA4B;QAC9B,6CAAoB;GAN/C,mBAAmB,CAiI/B"} \ No newline at end of file diff --git a/apps/api/dist/geocoding/geocoding.module.js b/apps/api/dist/geocoding/geocoding.module.js index ab5a711..cb0b9a6 100644 --- a/apps/api/dist/geocoding/geocoding.module.js +++ b/apps/api/dist/geocoding/geocoding.module.js @@ -48,6 +48,7 @@ const geocoding_controller_1 = require("./geocoding.controller"); const place_syria_entity_1 = require("./entities/place-syria.entity"); const place_jordan_entity_1 = require("./entities/place-jordan.entity"); const place_egypt_entity_1 = require("./entities/place-egypt.entity"); +const place_iraq_entity_1 = require("./entities/place-iraq.entity"); const osm_area_entity_1 = require("./entities/osm-area.entity"); const osm_point_with_area_entity_1 = require("./entities/osm-point-with-area.entity"); const admin_boundary_entity_1 = require("./entities/admin-boundary.entity"); @@ -72,6 +73,7 @@ exports.GeocodingModule = GeocodingModule = __decorate([ place_syria_entity_1.PlaceSyria, place_jordan_entity_1.PlaceJordan, place_egypt_entity_1.PlaceEgypt, + place_iraq_entity_1.PlaceIraq, osm_area_entity_1.OsmArea, osm_point_with_area_entity_1.OsmPointWithArea, admin_boundary_entity_1.AdminBoundary, diff --git a/apps/api/dist/geocoding/geocoding.module.js.map b/apps/api/dist/geocoding/geocoding.module.js.map index afd3e30..2d325d8 100644 --- a/apps/api/dist/geocoding/geocoding.module.js.map +++ b/apps/api/dist/geocoding/geocoding.module.js.map @@ -1 +1 @@ -{"version":3,"file":"geocoding.module.js","sourceRoot":"","sources":["../../src/geocoding/geocoding.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,2DAAuD;AACvD,qEAAgE;AAChE,iEAA6D;AAC7D,sEAA2D;AAC3D,wEAA6D;AAC7D,sEAA2D;AAC3D,gEAAqD;AACrD,sFAAyE;AACzE,4EAAiE;AACjE,yEAAoE;AACpE,uEAAkE;AAClE,qFAAgF;AAChF,oFAAyE;AACzE,wFAA6E;AAC7E,0EAA+D;AAC/D,qEAAgE;AAChE,2EAAsE;AACtE,yDAAoD;AACpD,sEAAwD;AACxD,mEAA8D;AAkCvD,IAAM,eAAe,GAArB,MAAM,eAAe;CAAG,CAAA;AAAlB,0CAAe;0BAAf,eAAe;IAhC3B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC;gBACvB,+BAAU;gBACV,iCAAW;gBACX,+BAAU;gBACV,yBAAO;gBACP,6CAAgB;gBAChB,qCAAa;gBACb,6CAAiB;gBACjB,iDAAmB;gBACnB,mCAAY;aACb,CAAC;YACF,2BAAW,CAAC,QAAQ,CAAC;gBACnB,KAAK,EAAE,UAAU;gBACjB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,WAAW;gBAC3C,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,MAAM,EAAE,EAAE,CAAC;gBACpD,GAAG,EAAE,IAAI;aACV,CAAC;SACH;QACD,WAAW,EAAE,CAAC,0CAAmB,EAAE,mDAAuB,CAAC;QAC3D,SAAS,EAAE;YACT,oCAAgB;YAChB,6CAAoB;YACpB,iDAAsB;YACtB,+CAAqB;YACrB,6DAA4B;YAC5B,6CAAoB;YACpB,2CAAmB;SACpB;QACD,OAAO,EAAE,CAAC,oCAAgB,EAAE,6CAAoB,CAAC;KAClD,CAAC;GACW,eAAe,CAAG"} \ No newline at end of file +{"version":3,"file":"geocoding.module.js","sourceRoot":"","sources":["../../src/geocoding/geocoding.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,2DAAuD;AACvD,qEAAgE;AAChE,iEAA6D;AAC7D,sEAA2D;AAC3D,wEAA6D;AAC7D,sEAA2D;AAC3D,oEAAyD;AACzD,gEAAqD;AACrD,sFAAyE;AACzE,4EAAiE;AACjE,yEAAoE;AACpE,uEAAkE;AAClE,qFAAgF;AAChF,oFAAyE;AACzE,wFAA6E;AAC7E,0EAA+D;AAC/D,qEAAgE;AAChE,2EAAsE;AACtE,yDAAoD;AACpD,sEAAwD;AACxD,mEAA8D;AAmCvD,IAAM,eAAe,GAArB,MAAM,eAAe;CAAG,CAAA;AAAlB,0CAAe;0BAAf,eAAe;IAjC3B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC;gBACvB,+BAAU;gBACV,iCAAW;gBACX,+BAAU;gBACV,6BAAS;gBACT,yBAAO;gBACP,6CAAgB;gBAChB,qCAAa;gBACb,6CAAiB;gBACjB,iDAAmB;gBACnB,mCAAY;aACb,CAAC;YACF,2BAAW,CAAC,QAAQ,CAAC;gBACnB,KAAK,EAAE,UAAU;gBACjB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,WAAW;gBAC3C,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,MAAM,EAAE,EAAE,CAAC;gBACpD,GAAG,EAAE,IAAI;aACV,CAAC;SACH;QACD,WAAW,EAAE,CAAC,0CAAmB,EAAE,mDAAuB,CAAC;QAC3D,SAAS,EAAE;YACT,oCAAgB;YAChB,6CAAoB;YACpB,iDAAsB;YACtB,+CAAqB;YACrB,6DAA4B;YAC5B,6CAAoB;YACpB,2CAAmB;SACpB;QACD,OAAO,EAAE,CAAC,oCAAgB,EAAE,6CAAoB,CAAC;KAClD,CAAC;GACW,eAAe,CAAG"} \ No newline at end of file diff --git a/apps/api/dist/geocoding/geocoding.service.d.ts b/apps/api/dist/geocoding/geocoding.service.d.ts index 7cf6565..a7d187d 100644 --- a/apps/api/dist/geocoding/geocoding.service.d.ts +++ b/apps/api/dist/geocoding/geocoding.service.d.ts @@ -3,6 +3,7 @@ import type { Cache } from 'cache-manager'; import { PlaceSyria } from './entities/place-syria.entity'; import { PlaceJordan } from './entities/place-jordan.entity'; import { PlaceEgypt } from './entities/place-egypt.entity'; +import { PlaceIraq } from './entities/place-iraq.entity'; import { BasePlace } from './entities/base-place.entity'; import { OsmArea } from './entities/osm-area.entity'; import { OsmPointWithArea } from './entities/osm-point-with-area.entity'; @@ -10,12 +11,13 @@ export declare class GeocodingService { private placesSyriaRepository; private placesJordanRepository; private placesEgyptRepository; + private placesIraqRepository; private osmAreasRepository; private osmPointsRepository; private cacheManager; private readonly logger; private readonly DB_TIMEOUT_MS; - constructor(placesSyriaRepository: Repository, placesJordanRepository: Repository, placesEgyptRepository: Repository, osmAreasRepository: Repository, osmPointsRepository: Repository, cacheManager: Cache); + constructor(placesSyriaRepository: Repository, placesJordanRepository: Repository, placesEgyptRepository: Repository, placesIraqRepository: Repository, osmAreasRepository: Repository, osmPointsRepository: Repository, cacheManager: Cache); private getRepositoryForCoords; private identifyRegion; private getTableNameForRepo; @@ -42,7 +44,9 @@ export declare class GeocodingService { results: any; source?: undefined; }>; + private findIraqiAddress; reverseGeocode(lat: number, lng: number): Promise; + private extractCoords; addPlace(data: Partial): Promise; upsertPlace(data: Partial): Promise<{ id: any; @@ -53,6 +57,13 @@ export declare class GeocodingService { processed: number; created: number; updated: number; + failed: number; + errors: { + index: number; + name?: string; + reason: string; + }[]; + errorsTruncated: boolean; }>; getRecentPlaces(limit?: number): Promise; getAllPlacesGeoJSON(): Promise<{ diff --git a/apps/api/dist/geocoding/geocoding.service.js b/apps/api/dist/geocoding/geocoding.service.js index 0b50068..bc358d7 100644 --- a/apps/api/dist/geocoding/geocoding.service.js +++ b/apps/api/dist/geocoding/geocoding.service.js @@ -12,7 +12,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; var GeocodingService_1; -var _a, _b, _c, _d, _e; +var _a, _b, _c, _d, _e, _f; Object.defineProperty(exports, "__esModule", { value: true }); exports.GeocodingService = void 0; const common_1 = require("@nestjs/common"); @@ -22,26 +22,32 @@ const cache_manager_1 = require("@nestjs/cache-manager"); const place_syria_entity_1 = require("./entities/place-syria.entity"); const place_jordan_entity_1 = require("./entities/place-jordan.entity"); const place_egypt_entity_1 = require("./entities/place-egypt.entity"); +const place_iraq_entity_1 = require("./entities/place-iraq.entity"); const osm_area_entity_1 = require("./entities/osm-area.entity"); const osm_point_with_area_entity_1 = require("./entities/osm-point-with-area.entity"); let GeocodingService = GeocodingService_1 = class GeocodingService { placesSyriaRepository; placesJordanRepository; placesEgyptRepository; + placesIraqRepository; osmAreasRepository; osmPointsRepository; cacheManager; logger = new common_1.Logger(GeocodingService_1.name); DB_TIMEOUT_MS = 1100; - constructor(placesSyriaRepository, placesJordanRepository, placesEgyptRepository, osmAreasRepository, osmPointsRepository, cacheManager) { + constructor(placesSyriaRepository, placesJordanRepository, placesEgyptRepository, placesIraqRepository, osmAreasRepository, osmPointsRepository, cacheManager) { this.placesSyriaRepository = placesSyriaRepository; this.placesJordanRepository = placesJordanRepository; this.placesEgyptRepository = placesEgyptRepository; + this.placesIraqRepository = placesIraqRepository; this.osmAreasRepository = osmAreasRepository; this.osmPointsRepository = osmPointsRepository; this.cacheManager = cacheManager; } getRepositoryForCoords(lat, lng) { + if (lat >= 29 && lat <= 37.5 && lng >= 38.7 && lng <= 48.8) { + return this.placesIraqRepository; + } if (lat >= 29 && lat <= 37.5 && lng >= 34.5 && lng <= 42.5) { if (lat > 32.5 && lng > 35.8) return this.placesSyriaRepository; @@ -55,6 +61,9 @@ let GeocodingService = GeocodingService_1 = class GeocodingService { identifyRegion(lat, lng) { if (lat === undefined || lng === undefined) return undefined; + if (lat >= 29 && lat <= 37.5 && lng >= 38.7 && lng <= 48.8) { + return 'iraq'; + } if (lat >= 29 && lat <= 37.5 && lng >= 34.5 && lng <= 42.5) { if (lat > 32.5 && lng > 35.8) return 'syria'; @@ -70,6 +79,8 @@ let GeocodingService = GeocodingService_1 = class GeocodingService { return 'places_jordan'; if (repo === this.placesEgyptRepository) return 'places_egypt'; + if (repo === this.placesIraqRepository) + return 'places_iraq'; return 'places_syria'; } async searchPlaces(query, lat, lon, radius = 20000, country) { @@ -100,7 +111,7 @@ let GeocodingService = GeocodingService_1 = class GeocodingService { queryParams.push(lat, lon, radius); } let regionCondition = ''; - if (targetRegion && ['syria', 'jordan', 'egypt'].includes(targetRegion)) { + if (targetRegion && ['syria', 'jordan', 'egypt', 'iraq'].includes(targetRegion)) { regionCondition = `AND (region = '${targetRegion}' OR region = 'global')`; } const sqlQuery = ` @@ -227,6 +238,8 @@ let GeocodingService = GeocodingService_1 = class GeocodingService { getRepoByTableName(tableName) { if (tableName === 'places_egypt') return this.placesEgyptRepository; + if (tableName === 'places_iraq') + return this.placesIraqRepository; if (tableName === 'places_jordan') return this.placesJordanRepository; return this.placesSyriaRepository; @@ -263,7 +276,7 @@ let GeocodingService = GeocodingService_1 = class GeocodingService { const normalizedQuery = normalizedQueryRes?.nq || cleanQuery.toLowerCase(); let queryParams = [`${normalizedQuery}%`]; let regionCondition = ''; - if (targetRegion && ['syria', 'jordan', 'egypt'].includes(targetRegion)) { + if (targetRegion && ['syria', 'jordan', 'egypt', 'iraq'].includes(targetRegion)) { regionCondition = `AND (region = '${targetRegion}' OR region = 'global')`; } const sqlQuery = ` @@ -297,10 +310,44 @@ let GeocodingService = GeocodingService_1 = class GeocodingService { return { results: [] }; } } + async findIraqiAddress(lat, lng) { + const MAX_DISTANCE_M = 150; + try { + const rows = await this.osmPointsRepository.query(` + WITH p AS ( + SELECT ST_Transform(ST_SetSRID(ST_MakePoint($1::float, $2::float), 4326), 3857) AS g3857, + ST_SetSRID(ST_MakePoint($1::float, $2::float), 4326)::geography AS geog + ) + SELECT l.name, + ST_Distance(ST_Transform(l.way, 4326)::geography, p.geog) AS distance + FROM planet_osm_line l, p + WHERE l.name ~ '^[0-9]{2,4}-[0-9]{1,3}$' + ORDER BY l.way <-> p.g3857 + LIMIT 1 + `, [lng, lat]); + const row = rows?.[0]; + if (!row || Number(row.distance) > MAX_DISTANCE_M) + return null; + const [mahalla, zuqaq] = String(row.name).split('-'); + return { + mahalla, + zuqaq, + distance: Number(row.distance), + text: `محلة ${mahalla}، زقاق ${zuqaq}`, + }; + } + catch (e) { + this.logger.warn(`Iraqi address lookup failed: ${e.message}`); + return null; + } + } async reverseGeocode(lat, lng) { try { const repo = this.getRepositoryForCoords(lat, lng); const tableName = this.getTableNameForRepo(repo); + const iraqiAddressPromise = this.identifyRegion(lat, lng) === 'iraq' + ? this.findIraqiAddress(lat, lng) + : Promise.resolve(null); const queryPromises = []; queryPromises.push(repo.query(` SELECT @@ -357,7 +404,20 @@ let GeocodingService = GeocodingService_1 = class GeocodingService { WHERE location IS NOT NULL AND (names->>'primary' IS NOT NULL OR names->>'common' IS NOT NULL) ORDER BY location <-> ST_SetSRID(ST_MakePoint($1::float, $2::float), 4326) ASC LIMIT 5 `, [lng, lat])); - const results = await Promise.allSettled(queryPromises); + queryPromises.push(repo.query(` + SELECT + id::text, COALESCE(name, 'Street') as name, COALESCE(name, 'طريق معتمد') as name_ar, 'street' as category, + '' as neighbourhood, '' as district, '' as governorate, + ST_Y(ST_Centroid(geometry::geometry))::text as latitude, ST_X(ST_Centroid(geometry::geometry))::text as longitude, '' as address, 'approved_road' as source, + ST_DistanceSphere(geometry::geometry, ST_SetSRID(ST_MakePoint($1::float, $2::float), 4326)) as distance + FROM approved_roads + WHERE geometry IS NOT NULL AND name IS NOT NULL AND trim(name) != '' + ORDER BY geometry::geometry <-> ST_SetSRID(ST_MakePoint($1::float, $2::float), 4326) ASC LIMIT 5 + `, [lng, lat]).catch(() => [])); + const [results, iraqiAddress] = await Promise.all([ + Promise.allSettled(queryPromises), + iraqiAddressPromise, + ]); let allResults = []; results.forEach(res => { if (res.status === 'fulfilled' && res.value) @@ -368,7 +428,17 @@ let GeocodingService = GeocodingService_1 = class GeocodingService { .slice(0, 5) .map(r => { const distance = Number(r.distance); - const fullAddressParts = [r.name_ar || r.name, r.address, r.neighbourhood, r.district, r.governorate].filter(Boolean); + const ZUQAQ_NAME_RE = /^[0-9]{2,4}-[0-9]{1,3}$/; + const rawName = r.name_ar || r.name; + const nameIsZuqaq = typeof rawName === 'string' && ZUQAQ_NAME_RE.test(rawName); + const fullAddressParts = [ + nameIsZuqaq ? null : rawName, + r.address, + iraqiAddress?.text, + r.neighbourhood, + r.district, + r.governorate, + ].filter(Boolean); let humanReadable = r.name_ar || r.name; if (distance <= 20) { humanReadable = r.name_ar || r.name; @@ -382,8 +452,14 @@ let GeocodingService = GeocodingService_1 = class GeocodingService { const districtPart = r.neighbourhood || r.district || ''; humanReadable = [streetPart, districtPart].filter(Boolean).join('، '); } + if (iraqiAddress) { + const landmark = distance <= 70 && !nameIsZuqaq ? rawName : null; + humanReadable = [iraqiAddress.text, landmark].filter(Boolean).join(' — '); + } return { ...r, + mahalla: iraqiAddress?.mahalla, + zuqaq: iraqiAddress?.zuqaq, latitude: parseFloat(r.latitude), longitude: parseFloat(r.longitude), human_readable_address: humanReadable, @@ -396,9 +472,20 @@ let GeocodingService = GeocodingService_1 = class GeocodingService { return []; } } + extractCoords(data) { + const lat = Number(data?.lat ?? data?.latitude); + const lng = Number(data?.lng ?? data?.longitude); + if (!Number.isFinite(lat) || !Number.isFinite(lng)) { + throw new common_1.HttpException('Invalid coordinates: provide numeric lat/lng (or latitude/longitude)', common_1.HttpStatus.BAD_REQUEST); + } + if (lat < -90 || lat > 90 || lng < -180 || lng > 180) { + throw new common_1.HttpException(`Coordinates out of range: lat=${lat}, lng=${lng}`, common_1.HttpStatus.BAD_REQUEST); + } + return { lat, lng }; + } async addPlace(data) { try { - const lat = Number(data.latitude), lng = Number(data.longitude); + const { lat, lng } = this.extractCoords(data); const repo = this.getRepositoryForCoords(lat, lng), tableName = this.getTableNameForRepo(repo); const newPlace = repo.create({ ...data, latitude: lat, longitude: lng, created_at: new Date(), location: { type: 'Point', coordinates: [lng, lat] } }); const savedPlace = await repo.save(newPlace); @@ -406,12 +493,14 @@ let GeocodingService = GeocodingService_1 = class GeocodingService { return { ...savedPlace, latitude: lat, longitude: lng, location: `POINT(${lng} ${lat})` }; } catch (error) { + if (error instanceof common_1.HttpException) + throw error; throw new common_1.HttpException(error.message, common_1.HttpStatus.INTERNAL_SERVER_ERROR); } } async upsertPlace(data) { try { - const lat = Number(data.latitude), lng = Number(data.longitude); + const { lat, lng } = this.extractCoords(data); const repo = this.getRepositoryForCoords(lat, lng), tableName = this.getTableNameForRepo(repo); const existing = await repo.query(`SELECT id, name FROM ${tableName} WHERE ST_DistanceSphere(location, ST_SetSRID(ST_MakePoint($1::float, $2::float), 4326)) < 15 LIMIT 1`, [lng, lat]); if (existing && existing.length > 0) { @@ -427,20 +516,39 @@ let GeocodingService = GeocodingService_1 = class GeocodingService { } async upsertBatch(places) { const results = []; - for (const place of places) { + const errors = []; + for (const [index, place] of places.entries()) { try { const r = await this.addPlace(place); results.push({ id: r.id, action: 'created' }); } - catch (e) { } + catch (e) { + if (errors.length < 50) { + errors.push({ + index, + name: place?.name, + reason: e instanceof common_1.HttpException ? e.message : (e?.message ?? 'unknown'), + }); + } + } } - return { total: places.length, processed: results.length, created: results.length, updated: 0 }; + const failed = places.length - results.length; + return { + total: places.length, + processed: results.length, + created: results.length, + updated: 0, + failed, + errors, + errorsTruncated: failed > errors.length, + }; } async getRecentPlaces(limit = 50) { const s = await this.placesSyriaRepository.find({ order: { created_at: 'DESC' }, take: limit }); const j = await this.placesJordanRepository.find({ order: { created_at: 'DESC' }, take: limit }); const e = await this.placesEgyptRepository.find({ order: { created_at: 'DESC' }, take: limit }); - return [...s, ...j, ...e].sort((a, b) => b.created_at.getTime() - a.created_at.getTime()).slice(0, limit); + const i = await this.placesIraqRepository.find({ order: { created_at: 'DESC' }, take: limit }); + return [...s, ...j, ...e, ...i].sort((a, b) => b.created_at.getTime() - a.created_at.getTime()).slice(0, limit); } async getAllPlacesGeoJSON() { try { @@ -448,6 +556,7 @@ let GeocodingService = GeocodingService_1 = class GeocodingService { SELECT id::text, name_ar as name, category, latitude, longitude, address, 'user' as region FROM places_syria UNION ALL SELECT id::text, name_ar as name, category, latitude, longitude, address, 'user' as region FROM places_jordan UNION ALL SELECT id::text, name_ar as name, category, latitude, longitude, address, 'user' as region FROM places_egypt + UNION ALL SELECT id::text, name_ar as name, category, latitude, longitude, address, 'user' as region FROM places_iraq UNION ALL SELECT id::text, COALESCE(names->>'primary', names->>'common', 'Building') as name, 'building' as category, ST_Y(ST_Centroid(location)) as latitude, ST_X(ST_Centroid(location)) as longitude, '' as address, 'overture' as region FROM overture_building WHERE names->>'primary' IS NOT NULL LIMIT 500 UNION ALL SELECT id::text, COALESCE(names->>'primary', names->>'common', 'Street') as name, 'street' as category, ST_Y(ST_Centroid(location)) as latitude, ST_X(ST_Centroid(location)) as longitude, '' as address, 'overture' as region FROM overture_segment WHERE names->>'primary' IS NOT NULL LIMIT 500 UNION ALL SELECT id::text, COALESCE(names->>'primary', names->>'common', 'Place') as name, 'place' as category, ST_Y(ST_Centroid(location)) as latitude, ST_X(ST_Centroid(location)) as longitude, '' as address, 'overture' as region FROM overture_place WHERE names->>'primary' IS NOT NULL LIMIT 500 @@ -478,6 +587,7 @@ let GeocodingService = GeocodingService_1 = class GeocodingService { case 'syria': return this.placesSyriaRepository; case 'jordan': return this.placesJordanRepository; case 'egypt': return this.placesEgyptRepository; + case 'iraq': return this.placesIraqRepository; default: throw new common_1.HttpException('Invalid country: ' + country, common_1.HttpStatus.BAD_REQUEST); } } @@ -488,9 +598,10 @@ exports.GeocodingService = GeocodingService = GeocodingService_1 = __decorate([ __param(0, (0, typeorm_1.InjectRepository)(place_syria_entity_1.PlaceSyria)), __param(1, (0, typeorm_1.InjectRepository)(place_jordan_entity_1.PlaceJordan)), __param(2, (0, typeorm_1.InjectRepository)(place_egypt_entity_1.PlaceEgypt)), - __param(3, (0, typeorm_1.InjectRepository)(osm_area_entity_1.OsmArea)), - __param(4, (0, typeorm_1.InjectRepository)(osm_point_with_area_entity_1.OsmPointWithArea)), - __param(5, (0, common_1.Inject)(cache_manager_1.CACHE_MANAGER)), - __metadata("design:paramtypes", [typeof (_a = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _a : Object, typeof (_b = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _b : Object, typeof (_c = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _c : Object, typeof (_d = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _d : Object, typeof (_e = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _e : Object, Object]) + __param(3, (0, typeorm_1.InjectRepository)(place_iraq_entity_1.PlaceIraq)), + __param(4, (0, typeorm_1.InjectRepository)(osm_area_entity_1.OsmArea)), + __param(5, (0, typeorm_1.InjectRepository)(osm_point_with_area_entity_1.OsmPointWithArea)), + __param(6, (0, common_1.Inject)(cache_manager_1.CACHE_MANAGER)), + __metadata("design:paramtypes", [typeof (_a = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _a : Object, typeof (_b = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _b : Object, typeof (_c = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _c : Object, typeof (_d = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _d : Object, typeof (_e = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _e : Object, typeof (_f = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _f : Object, Object]) ], GeocodingService); //# sourceMappingURL=geocoding.service.js.map \ No newline at end of file diff --git a/apps/api/dist/geocoding/geocoding.service.js.map b/apps/api/dist/geocoding/geocoding.service.js.map index c347a14..0d32e21 100644 --- a/apps/api/dist/geocoding/geocoding.service.js.map +++ b/apps/api/dist/geocoding/geocoding.service.js.map @@ -1 +1 @@ -{"version":3,"file":"geocoding.service.js","sourceRoot":"","sources":["../../src/geocoding/geocoding.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAuF;AACvF,6CAAmD;AACnD,qCAAqC;AACrC,yDAAsD;AAEtD,sEAA2D;AAC3D,wEAA6D;AAC7D,sEAA2D;AAE3D,gEAAqD;AACrD,sFAAyE;AAGlE,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAOjB;IAEA;IAEA;IAEA;IAEA;IAEA;IAhBO,MAAM,GAAG,IAAI,eAAM,CAAC,kBAAgB,CAAC,IAAI,CAAC,CAAC;IAE3C,aAAa,GAAG,IAAI,CAAC;IAEtC,YAEU,qBAA6C,EAE7C,sBAA+C,EAE/C,qBAA6C,EAE7C,kBAAuC,EAEvC,mBAAiD,EAEjD,YAAmB;QAVnB,0BAAqB,GAArB,qBAAqB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;IAD5B,IAAA,mBAAU,GAAE;IAOR,WAAA,IAAA,0BAAgB,EAAC,+BAAU,CAAC,CAAA;IAE5B,WAAA,IAAA,0BAAgB,EAAC,iCAAW,CAAC,CAAA;IAE7B,WAAA,IAAA,0BAAgB,EAAC,+BAAU,CAAC,CAAA;IAE5B,WAAA,IAAA,0BAAgB,EAAC,yBAAO,CAAC,CAAA;IAEzB,WAAA,IAAA,0BAAgB,EAAC,6CAAgB,CAAC,CAAA;IAElC,WAAA,IAAA,eAAM,EAAC,6BAAa,CAAC,CAAA;yDATS,oBAAU,oBAAV,oBAAU,oDAET,oBAAU,oBAAV,oBAAU,oDAEX,oBAAU,oBAAV,oBAAU,oDAEb,oBAAU,oBAAV,oBAAU,oDAET,oBAAU,oBAAV,oBAAU;GAf9B,gBAAgB,CAggB5B"} \ No newline at end of file +{"version":3,"file":"geocoding.service.js","sourceRoot":"","sources":["../../src/geocoding/geocoding.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAuF;AACvF,6CAAmD;AACnD,qCAAqC;AACrC,yDAAsD;AAEtD,sEAA2D;AAC3D,wEAA6D;AAC7D,sEAA2D;AAC3D,oEAAyD;AAEzD,gEAAqD;AACrD,sFAAyE;AAGlE,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAOjB;IAEA;IAEA;IAEA;IAEA;IAEA;IAEA;IAlBO,MAAM,GAAG,IAAI,eAAM,CAAC,kBAAgB,CAAC,IAAI,CAAC,CAAC;IAE3C,aAAa,GAAG,IAAI,CAAC;IAEtC,YAEU,qBAA6C,EAE7C,sBAA+C,EAE/C,qBAA6C,EAE7C,oBAA2C,EAE3C,kBAAuC,EAEvC,mBAAiD,EAEjD,YAAmB;QAZnB,0BAAqB,GAArB,qBAAqB,CAAwB;QAE7C,2BAAsB,GAAtB,sBAAsB,CAAyB;QAE/C,0BAAqB,GAArB,qBAAqB,CAAwB;QAE7C,yBAAoB,GAApB,oBAAoB,CAAuB;QAE3C,uBAAk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AO,EAAE,mBAAU,CAAC,WAAW,CAAC,CAAC;QAC1F,CAAC;IACH,CAAC;CACF,CAAA;AAjqBY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;IAOR,WAAA,IAAA,0BAAgB,EAAC,+BAAU,CAAC,CAAA;IAE5B,WAAA,IAAA,0BAAgB,EAAC,iCAAW,CAAC,CAAA;IAE7B,WAAA,IAAA,0BAAgB,EAAC,+BAAU,CAAC,CAAA;IAE5B,WAAA,IAAA,0BAAgB,EAAC,6BAAS,CAAC,CAAA;IAE3B,WAAA,IAAA,0BAAgB,EAAC,yBAAO,CAAC,CAAA;IAEzB,WAAA,IAAA,0BAAgB,EAAC,6CAAgB,CAAC,CAAA;IAElC,WAAA,IAAA,eAAM,EAAC,6BAAa,CAAC,CAAA;yDAXS,oBAAU,oBAAV,oBAAU,oDAET,oBAAU,oBAAV,oBAAU,oDAEX,oBAAU,oBAAV,oBAAU,oDAEX,oBAAU,oBAAV,oBAAU,oDAEZ,oBAAU,oBAAV,oBAAU,oDAET,oBAAU,oBAAV,oBAAU;GAjB9B,gBAAgB,CAiqB5B"} \ No newline at end of file diff --git a/apps/api/dist/geocoding/map-refinement.service.d.ts b/apps/api/dist/geocoding/map-refinement.service.d.ts index a4e3082..04e4592 100644 --- a/apps/api/dist/geocoding/map-refinement.service.d.ts +++ b/apps/api/dist/geocoding/map-refinement.service.d.ts @@ -3,14 +3,16 @@ import { MapCandidate, CandidateStatus } from './entities/map-candidate.entity'; import { PlaceJordan } from './entities/place-jordan.entity'; import { PlaceSyria } from './entities/place-syria.entity'; import { PlaceEgypt } from './entities/place-egypt.entity'; +import { PlaceIraq } from './entities/place-iraq.entity'; export declare class MapRefinementService { private dataSource; private candidateRepository; private jordanRepository; private syriaRepository; private egyptRepository; + private iraqRepository; private readonly logger; - constructor(dataSource: DataSource, candidateRepository: Repository, jordanRepository: Repository, syriaRepository: Repository, egyptRepository: Repository); + constructor(dataSource: DataSource, candidateRepository: Repository, jordanRepository: Repository, syriaRepository: Repository, egyptRepository: Repository, iraqRepository: Repository); suggestPlace(dto: any, submittedBy: string): Promise; runExternalVerification(candidateId: number): Promise; getCandidates(status?: CandidateStatus): Promise; diff --git a/apps/api/dist/geocoding/map-refinement.service.js b/apps/api/dist/geocoding/map-refinement.service.js index 84fb669..fe13985 100644 --- a/apps/api/dist/geocoding/map-refinement.service.js +++ b/apps/api/dist/geocoding/map-refinement.service.js @@ -12,7 +12,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; var MapRefinementService_1; -var _a, _b, _c, _d, _e; +var _a, _b, _c, _d, _e, _f; Object.defineProperty(exports, "__esModule", { value: true }); exports.MapRefinementService = void 0; const common_1 = require("@nestjs/common"); @@ -22,19 +22,22 @@ const map_candidate_entity_1 = require("./entities/map-candidate.entity"); const place_jordan_entity_1 = require("./entities/place-jordan.entity"); const place_syria_entity_1 = require("./entities/place-syria.entity"); const place_egypt_entity_1 = require("./entities/place-egypt.entity"); +const place_iraq_entity_1 = require("./entities/place-iraq.entity"); let MapRefinementService = MapRefinementService_1 = class MapRefinementService { dataSource; candidateRepository; jordanRepository; syriaRepository; egyptRepository; + iraqRepository; logger = new common_1.Logger(MapRefinementService_1.name); - constructor(dataSource, candidateRepository, jordanRepository, syriaRepository, egyptRepository) { + constructor(dataSource, candidateRepository, jordanRepository, syriaRepository, egyptRepository, iraqRepository) { this.dataSource = dataSource; this.candidateRepository = candidateRepository; this.jordanRepository = jordanRepository; this.syriaRepository = syriaRepository; this.egyptRepository = egyptRepository; + this.iraqRepository = iraqRepository; } async suggestPlace(dto, submittedBy) { const lat = parseFloat(dto.lat || dto.latitude); @@ -178,6 +181,9 @@ let MapRefinementService = MapRefinementService_1 = class MapRefinementService { case map_candidate_entity_1.CountryCode.EGYPT: repo = this.egyptRepository; break; + case map_candidate_entity_1.CountryCode.IRAQ: + repo = this.iraqRepository; + break; default: repo = this.jordanRepository; } const approvedPlace = repo.create(placeData); @@ -203,6 +209,7 @@ exports.MapRefinementService = MapRefinementService = MapRefinementService_1 = _ __param(2, (0, typeorm_1.InjectRepository)(place_jordan_entity_1.PlaceJordan)), __param(3, (0, typeorm_1.InjectRepository)(place_syria_entity_1.PlaceSyria)), __param(4, (0, typeorm_1.InjectRepository)(place_egypt_entity_1.PlaceEgypt)), - __metadata("design:paramtypes", [typeof (_a = typeof typeorm_2.DataSource !== "undefined" && typeorm_2.DataSource) === "function" ? _a : Object, typeof (_b = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _b : Object, typeof (_c = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _c : Object, typeof (_d = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _d : Object, typeof (_e = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _e : Object]) + __param(5, (0, typeorm_1.InjectRepository)(place_iraq_entity_1.PlaceIraq)), + __metadata("design:paramtypes", [typeof (_a = typeof typeorm_2.DataSource !== "undefined" && typeorm_2.DataSource) === "function" ? _a : Object, typeof (_b = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _b : Object, typeof (_c = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _c : Object, typeof (_d = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _d : Object, typeof (_e = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _e : Object, typeof (_f = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _f : Object]) ], MapRefinementService); //# sourceMappingURL=map-refinement.service.js.map \ No newline at end of file diff --git a/apps/api/dist/geocoding/map-refinement.service.js.map b/apps/api/dist/geocoding/map-refinement.service.js.map index e8b0921..3a06964 100644 --- a/apps/api/dist/geocoding/map-refinement.service.js.map +++ b/apps/api/dist/geocoding/map-refinement.service.js.map @@ -1 +1 @@ -{"version":3,"file":"map-refinement.service.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AjNY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;IAMR,WAAA,IAAA,0BAAgB,EAAC,mCAAY,CAAC,CAAA;IAE9B,WAAA,IAAA,0BAAgB,EAAC,iCAAW,CAAC,CAAA;IAE7B,WAAA,IAAA,0BAAgB,EAAC,+BAAU,CAAC,CAAA;IAE5B,WAAA,IAAA,0BAAgB,EAAC,+BAAU,CAAC,CAAA;yDAPT,oBAAU,oBAAV,oBAAU,oDAED,oBAAU,oBAAV,oBAAU,oDAEb,oBAAU,oBAAV,oBAAU,oDAEX,oBAAU,oBAAV,oBAAU,oDAEV,oBAAU,oBAAV,oBAAU;GAZ1B,oBAAoB,CAiNhC"} \ No newline at end of file +{"version":3,"file":"map-refinement.service.js","sourceRoot":"","sources":["../../src/geocoding/map-refinement.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAuE;AACvE,6CAAmD;AACnD,qCAAiD;AACjD,0EAA6F;AAC7F,wEAA6D;AAC7D,sEAA2D;AAC3D,sEAA2D;AAC3D,oEAAyD;AAGlD,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;IAIrB;IAEA;IAEA;IAEA;IAEA;IAEA;IAbO,MAAM,GAAG,IAAI,eAAM,CAAC,sBAAoB,CAAC,IAAI,CAAC,CAAC;IAEhE,YACU,UAAsB,EAEtB,mBAA6C,EAE7C,gBAAyC,EAEzC,eAAuC,EAEvC,eAAuC,EAEvC,cAAqC;QAVrC,eAAU,GAAV,UAAU,CAAY;QAEtB,wBAAmB,GAAnB,mBAAmB,CAA0B;QAE7C,qBAAgB,GAAhB,gBAAgB,CAAyB;QAEzC,oBAAe,GAAf,eAAe,CAAwB;QAEvC,oBAAe,GAAf,eAAe,CAAwB;QAEvC,mBAAc,GAAd,cAAc,CAAuB;IAC5C,CAAC;IAEJ,KAAK,CAAC,YAAY,CAAC,GAAQ,EAAE,WAAmB;QAC9C,MAAM,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC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/dist/maps/maps.module.js +++ b/apps/api/dist/maps/maps.module.js @@ -16,6 +16,7 @@ const road_stat_entity_1 = require("./road-stat.entity"); const candidate_road_entity_1 = require("./candidate-road.entity"); const redis_module_1 = require("../common/redis.module"); const geocoding_module_1 = require("../geocoding/geocoding.module"); +const road_refinement_controller_1 = require("./road-refinement.controller"); let MapsModule = class MapsModule { }; exports.MapsModule = MapsModule; @@ -26,7 +27,7 @@ exports.MapsModule = MapsModule = __decorate([ redis_module_1.RedisModule, geocoding_module_1.GeocodingModule, ], - controllers: [maps_controller_1.MapsController], + controllers: [maps_controller_1.MapsController, road_refinement_controller_1.RoadRefinementController], providers: [maps_service_1.MapsService, traffic_grid_service_1.TrafficGridService], exports: [maps_service_1.MapsService, traffic_grid_service_1.TrafficGridService], }) diff --git a/apps/api/dist/maps/maps.module.js.map b/apps/api/dist/maps/maps.module.js.map index 593c33c..c55300a 100644 --- a/apps/api/dist/maps/maps.module.js.map +++ b/apps/api/dist/maps/maps.module.js.map @@ -1 +1 @@ -{"version":3,"file":"maps.module.js","sourceRoot":"","sources":["../../src/maps/maps.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,iDAA6C;AAC7C,iEAA4D;AAC5D,uDAAmD;AACnD,yDAAqD;AACrD,mEAAwD;AACxD,yDAAqD;AACrD,oEAAgE;AAYzD,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IAVtB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC,CAAC,kCAAe,EAAE,qCAAa,CAAC,CAAC;YAC1D,0BAAW;YACX,kCAAe;SAChB;QACD,WAAW,EAAE,CAAC,gCAAc,CAAC;QAC7B,SAAS,EAAE,CAAC,0BAAW,EAAE,yCAAkB,CAAC;QAC5C,OAAO,EAAE,CAAC,0BAAW,EAAE,yCAAkB,CAAC;KAC3C,CAAC;GACW,UAAU,CAAG"} \ No newline at end of file +{"version":3,"file":"maps.module.js","sourceRoot":"","sources":["../../src/maps/maps.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,iDAA6C;AAC7C,iEAA4D;AAC5D,uDAAmD;AACnD,yDAAqD;AACrD,mEAAwD;AACxD,yDAAqD;AACrD,oEAAgE;AAEhE,6EAAwE;AAYjE,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IAVtB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC,CAAC,kCAAe,EAAE,qCAAa,CAAC,CAAC;YAC1D,0BAAW;YACX,kCAAe;SAChB;QACD,WAAW,EAAE,CAAC,gCAAc,EAAE,qDAAwB,CAAC;QACvD,SAAS,EAAE,CAAC,0BAAW,EAAE,yCAAkB,CAAC;QAC5C,OAAO,EAAE,CAAC,0BAAW,EAAE,yCAAkB,CAAC;KAC3C,CAAC;GACW,UAAU,CAAG"} \ No newline at end of file diff --git a/apps/api/dist/maps/road-refinement.controller.d.ts b/apps/api/dist/maps/road-refinement.controller.d.ts new file mode 100644 index 0000000..5581214 --- /dev/null +++ b/apps/api/dist/maps/road-refinement.controller.d.ts @@ -0,0 +1,57 @@ +import { Repository, DataSource } from 'typeorm'; +import { CandidateRoad } from './candidate-road.entity'; +import { RoadSegmentStat } from './road-stat.entity'; +export declare class RoadRefinementController { + private readonly candidateRepo; + private readonly roadStatRepo; + private readonly dataSource; + private readonly logger; + constructor(candidateRepo: Repository, roadStatRepo: Repository, dataSource: DataSource); + getSummary(): Promise<{ + roads: { + analyzed: number; + closed: number; + }; + candidates: { + total: number; + pending: number; + }; + }>; + getCandidates(status?: string): Promise; + submitManualCandidate(body: { + geojson: any; + name?: string; + highway?: string; + }): Promise<{ + success: boolean; + candidate: any; + }>; + approveCandidate(id: string): Promise<{ + success: boolean; + id: string; + status: string; + }>; + rejectCandidate(id: string): Promise<{ + success: boolean; + id: string; + status: string; + }>; + getClosures(): Promise; + discoverOvertureGaps(): Promise<{ + success: boolean; + candidatesFound: number; + message: string; + } | { + success: boolean; + candidatesFound: any; + message?: undefined; + }>; + discoverClosures(): Promise<{ + success: boolean; + roadsClosed: number; + }>; + snapExistingApprovedRoads(): Promise<{ + success: boolean; + message: string; + }>; +} diff --git a/apps/api/dist/maps/road-refinement.controller.js b/apps/api/dist/maps/road-refinement.controller.js new file mode 100644 index 0000000..81fc309 --- /dev/null +++ b/apps/api/dist/maps/road-refinement.controller.js @@ -0,0 +1,613 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var RoadRefinementController_1; +var _a, _b, _c; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RoadRefinementController = void 0; +const common_1 = require("@nestjs/common"); +const swagger_1 = require("@nestjs/swagger"); +const typeorm_1 = require("@nestjs/typeorm"); +const typeorm_2 = require("typeorm"); +const candidate_road_entity_1 = require("./candidate-road.entity"); +const road_stat_entity_1 = require("./road-stat.entity"); +const api_key_guard_1 = require("../common/guards/api-key.guard"); +let RoadRefinementController = RoadRefinementController_1 = class RoadRefinementController { + candidateRepo; + roadStatRepo; + dataSource; + logger = new common_1.Logger(RoadRefinementController_1.name); + constructor(candidateRepo, roadStatRepo, dataSource) { + this.candidateRepo = candidateRepo; + this.roadStatRepo = roadStatRepo; + this.dataSource = dataSource; + } + async getSummary() { + try { + const [cCount] = await this.dataSource.query("SELECT COUNT(*) as total, COUNT(*) FILTER (WHERE status='pending') as pending FROM candidate_roads"); + const [clCount] = await this.dataSource.query('SELECT COUNT(*) as count FROM road_segment_stats WHERE "isClosed" = true'); + const [rCount] = await this.dataSource.query('SELECT COUNT(*) as count FROM road_segment_stats'); + return { + roads: { + analyzed: parseInt(rCount?.count || '0', 10), + closed: parseInt(clCount?.count || '0', 10), + }, + candidates: { + total: parseInt(cCount?.total || '0', 10), + pending: parseInt(cCount?.pending || '0', 10), + }, + }; + } + catch (e) { + this.logger.error(`Error in summary: ${e.message}`); + return { + roads: { analyzed: 0, closed: 0 }, + candidates: { total: 0, pending: 0 }, + }; + } + } + async getCandidates(status) { + const s = status || 'pending'; + try { + const rows = await this.dataSource.query(`SELECT id, "uniqueDriverCount", "totalPoints", "averageSpeed", "lengthMeters", + confidence, status, source, name, highway, oneway, "discoveredAt", "reviewedAt", + ST_AsGeoJSON(geometry) as geojson + FROM candidate_roads + WHERE status = $1 + ORDER BY confidence DESC, "discoveredAt" DESC + LIMIT 100`, [s]); + return rows.map((r) => ({ + ...r, + geometry: r.geojson ? JSON.parse(r.geojson) : null, + })); + } + catch (e) { + this.logger.error(`Error fetching candidates: ${e.message}`); + return []; + } + } + async submitManualCandidate(body) { + if (!body.geojson || !body.geojson.coordinates || body.geojson.coordinates.length < 2) { + throw new common_1.HttpException('Invalid GeoJSON LineString coordinates', common_1.HttpStatus.BAD_REQUEST); + } + try { + const geojsonStr = JSON.stringify(body.geojson); + const name = body.name || 'Unnamed Road'; + const highway = body.highway || 'residential'; + let result; + try { + result = await this.dataSource.query(`WITH raw_input AS ( + SELECT ST_SetSRID(ST_GeomFromGeoJSON($1), 4326) AS geom + ), + start_snap AS ( + SELECT COALESCE( + ( + SELECT ST_SetSRID(ST_MakePoint(n.lon/1e7, n.lat/1e7), 4326) + FROM raw_input r + CROSS JOIN LATERAL (SELECT ST_Transform(ST_StartPoint(r.geom), 3857) AS pt) p + JOIN planet_osm_line l ON l.highway IS NOT NULL AND l.way && ST_Expand(p.pt, 60) + JOIN planet_osm_ways w ON w.id = l.osm_id + CROSS JOIN LATERAL unnest(w.nodes) AS wn(node_id) + JOIN planet_osm_nodes n ON n.id = wn.node_id + WHERE ST_Distance(ST_SetSRID(ST_MakePoint(n.lon/1e7, n.lat/1e7), 4326)::geography, ST_StartPoint(r.geom)::geography) < 30 + ORDER BY ST_Distance(ST_SetSRID(ST_MakePoint(n.lon/1e7, n.lat/1e7), 4326)::geography, ST_StartPoint(r.geom)::geography) ASC + LIMIT 1 + ), + ( + SELECT ST_Transform(ST_ClosestPoint(l.way, ST_Transform(ST_StartPoint(r.geom), 3857)), 4326) + FROM raw_input r + JOIN planet_osm_line l ON l.highway IS NOT NULL AND l.way && ST_Expand(ST_Transform(ST_StartPoint(r.geom), 3857), 60) + WHERE ST_Distance(ST_Transform(l.way, 4326)::geography, ST_StartPoint(r.geom)::geography) < 30 + ORDER BY ST_Distance(l.way, ST_Transform(ST_StartPoint(r.geom), 3857)) ASC + LIMIT 1 + ), + (SELECT ST_StartPoint(geom) FROM raw_input) + ) AS pt + ), + end_snap AS ( + SELECT COALESCE( + ( + SELECT ST_SetSRID(ST_MakePoint(n.lon/1e7, n.lat/1e7), 4326) + FROM raw_input r + CROSS JOIN LATERAL (SELECT ST_Transform(ST_EndPoint(r.geom), 3857) AS pt) p + JOIN planet_osm_line l ON l.highway IS NOT NULL AND l.way && ST_Expand(p.pt, 60) + JOIN planet_osm_ways w ON w.id = l.osm_id + CROSS JOIN LATERAL unnest(w.nodes) AS wn(node_id) + JOIN planet_osm_nodes n ON n.id = wn.node_id + WHERE ST_Distance(ST_SetSRID(ST_MakePoint(n.lon/1e7, n.lat/1e7), 4326)::geography, ST_EndPoint(r.geom)::geography) < 30 + ORDER BY ST_Distance(ST_SetSRID(ST_MakePoint(n.lon/1e7, n.lat/1e7), 4326)::geography, ST_EndPoint(r.geom)::geography) ASC + LIMIT 1 + ), + ( + SELECT ST_Transform(ST_ClosestPoint(l.way, ST_Transform(ST_EndPoint(r.geom), 3857)), 4326) + FROM raw_input r + JOIN planet_osm_line l ON l.highway IS NOT NULL AND l.way && ST_Expand(ST_Transform(ST_EndPoint(r.geom), 3857), 60) + WHERE ST_Distance(ST_Transform(l.way, 4326)::geography, ST_EndPoint(r.geom)::geography) < 30 + ORDER BY ST_Distance(l.way, ST_Transform(ST_EndPoint(r.geom), 3857)) ASC + LIMIT 1 + ), + (SELECT ST_EndPoint(geom) FROM raw_input) + ) AS pt + ), + snapped_input AS ( + SELECT ST_SetPoint( + ST_SetPoint(r.geom, 0, s.pt), + ST_NPoints(r.geom) - 1, + e.pt + ) AS geom + FROM raw_input r, start_snap s, end_snap e + ) + INSERT INTO candidate_roads ( + geometry, "uniqueDriverCount", "totalPoints", "averageSpeed", "lengthMeters", + confidence, status, source, name, highway, oneway, "discoveredAt" + ) + SELECT + geom, + 1, 10, 30.0, + ST_Length(ST_Transform(geom, 3857)), + 0.90, 'pending', 'manual', $2, $3, 0, NOW() + FROM snapped_input + RETURNING id, name, highway, confidence, status`, [geojsonStr, name, highway]); + } + catch (err) { + this.logger.warn(`Complex snapping query failed, falling back to direct insertion: ${err.message}`); + result = await this.dataSource.query(`INSERT INTO candidate_roads ( + geometry, "uniqueDriverCount", "totalPoints", "averageSpeed", "lengthMeters", + confidence, status, source, name, highway, oneway, "discoveredAt" + ) + VALUES ( + ST_SetSRID(ST_GeomFromGeoJSON($1), 4326), + 1, 10, 30.0, + ST_Length(ST_Transform(ST_SetSRID(ST_GeomFromGeoJSON($1), 4326), 3857)), + 0.90, 'pending', 'manual', $2, $3, 0, NOW() + ) + RETURNING id, name, highway, confidence, status`, [geojsonStr, name, highway]); + } + this.logger.log(`✍️ Manual candidate road registered: ${result[0]?.id} (${name})`); + return { success: true, candidate: result[0] }; + } + catch (e) { + this.logger.error(`Failed to insert manual candidate road: ${e.message}`); + throw new common_1.HttpException(`Failed to create candidate road: ${e.message}`, common_1.HttpStatus.INTERNAL_SERVER_ERROR); + } + } + async approveCandidate(id) { + try { + await this.dataSource.query(` + CREATE TABLE IF NOT EXISTS approved_roads ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + candidate_id UUID UNIQUE, + geometry GEOMETRY(LineString, 4326), + name VARCHAR(255), + highway VARCHAR(32), + confidence FLOAT, + "uniqueDriverCount" INT DEFAULT 1, + oneway SMALLINT DEFAULT 0, + start_node BIGINT, + end_node BIGINT, + approved_at TIMESTAMP DEFAULT NOW() + ); + CREATE INDEX IF NOT EXISTS approved_roads_geom_idx ON approved_roads USING GIST(geometry); + CREATE UNIQUE INDEX IF NOT EXISTS approved_roads_cand_uidx ON approved_roads(candidate_id) WHERE candidate_id IS NOT NULL; + `); + await this.candidateRepo.update(id, { + status: 'approved', + reviewedAt: new Date(), + }); + await this.dataSource.query(` + DO $$ + DECLARE + cand RECORD; + start_pt GEOMETRY; + end_pt GEOMETRY; + snapped_geom GEOMETRY; + s_node BIGINT := NULL; + e_node BIGINT := NULL; + node_rec RECORD; + line_rec RECORD; + BEGIN + SELECT id, geometry::geometry as geom, name, COALESCE(highway, 'residential') as highway, confidence, "uniqueDriverCount", oneway + INTO cand + FROM candidate_roads WHERE id = $1; + + IF FOUND THEN + snapped_geom := cand.geom; + start_pt := ST_StartPoint(snapped_geom); + end_pt := ST_EndPoint(snapped_geom); + + -- 1. Start node & geometry snapping + BEGIN + WITH p AS (SELECT ST_Transform(start_pt, 3857) AS pt) + SELECT n.id, n.lon/1e7 as lon, n.lat/1e7 as lat + INTO node_rec + FROM p + JOIN planet_osm_line l ON l.highway IS NOT NULL AND l.way && ST_Expand(p.pt, 60) + JOIN planet_osm_ways w ON w.id = l.osm_id + CROSS JOIN LATERAL unnest(w.nodes) AS wn(node_id) + JOIN planet_osm_nodes n ON n.id = wn.node_id + WHERE ST_Distance(ST_SetSRID(ST_MakePoint(n.lon/1e7, n.lat/1e7), 4326)::geography, start_pt::geography) < 30 + ORDER BY ST_Distance(ST_SetSRID(ST_MakePoint(n.lon/1e7, n.lat/1e7), 4326)::geography, start_pt::geography) ASC + LIMIT 1; + + IF FOUND THEN + s_node := node_rec.id; + snapped_geom := ST_SetPoint(snapped_geom, 0, ST_SetSRID(ST_MakePoint(node_rec.lon, node_rec.lat), 4326)); + ELSE + WITH p AS (SELECT ST_Transform(start_pt, 3857) AS pt) + SELECT ST_X(ST_Transform(ST_ClosestPoint(l.way, p.pt), 4326)) as lon, + ST_Y(ST_Transform(ST_ClosestPoint(l.way, p.pt), 4326)) as lat + INTO line_rec + FROM p + JOIN planet_osm_line l ON l.highway IS NOT NULL AND l.way && ST_Expand(p.pt, 60) + WHERE ST_Distance(ST_Transform(l.way, 4326)::geography, start_pt::geography) < 30 + ORDER BY ST_Distance(l.way, p.pt) ASC + LIMIT 1; + + IF FOUND THEN + snapped_geom := ST_SetPoint(snapped_geom, 0, ST_SetSRID(ST_MakePoint(line_rec.lon, line_rec.lat), 4326)); + END IF; + END IF; + EXCEPTION WHEN OTHERS THEN + NULL; + END; + + -- 2. End node & geometry snapping + BEGIN + WITH p AS (SELECT ST_Transform(end_pt, 3857) AS pt) + SELECT n.id, n.lon/1e7 as lon, n.lat/1e7 as lat + INTO node_rec + FROM p + JOIN planet_osm_line l ON l.highway IS NOT NULL AND l.way && ST_Expand(p.pt, 60) + JOIN planet_osm_ways w ON w.id = l.osm_id + CROSS JOIN LATERAL unnest(w.nodes) AS wn(node_id) + JOIN planet_osm_nodes n ON n.id = wn.node_id + WHERE ST_Distance(ST_SetSRID(ST_MakePoint(n.lon/1e7, n.lat/1e7), 4326)::geography, end_pt::geography) < 30 + ORDER BY ST_Distance(ST_SetSRID(ST_MakePoint(n.lon/1e7, n.lat/1e7), 4326)::geography, end_pt::geography) ASC + LIMIT 1; + + IF FOUND THEN + e_node := node_rec.id; + snapped_geom := ST_SetPoint(snapped_geom, ST_NPoints(snapped_geom) - 1, ST_SetSRID(ST_MakePoint(node_rec.lon, node_rec.lat), 4326)); + ELSE + WITH p AS (SELECT ST_Transform(end_pt, 3857) AS pt) + SELECT ST_X(ST_Transform(ST_ClosestPoint(l.way, p.pt), 4326)) as lon, + ST_Y(ST_Transform(ST_ClosestPoint(l.way, p.pt), 4326)) as lat + INTO line_rec + FROM p + JOIN planet_osm_line l ON l.highway IS NOT NULL AND l.way && ST_Expand(p.pt, 60) + WHERE ST_Distance(ST_Transform(l.way, 4326)::geography, end_pt::geography) < 30 + ORDER BY ST_Distance(l.way, p.pt) ASC + LIMIT 1; + + IF FOUND THEN + snapped_geom := ST_SetPoint(snapped_geom, ST_NPoints(snapped_geom) - 1, ST_SetSRID(ST_MakePoint(line_rec.lon, line_rec.lat), 4326)); + END IF; + END IF; + EXCEPTION WHEN OTHERS THEN + NULL; + END; + + -- Update candidate_roads + UPDATE candidate_roads SET geometry = snapped_geom WHERE id = cand.id; + + -- Insert or update approved_roads + INSERT INTO approved_roads ( + candidate_id, geometry, name, highway, confidence, "uniqueDriverCount", oneway, start_node, end_node + ) + VALUES ( + cand.id, snapped_geom, cand.name, cand.highway, cand.confidence, cand."uniqueDriverCount", cand.oneway, s_node, e_node + ) + ON CONFLICT (candidate_id) DO UPDATE SET + geometry = EXCLUDED.geometry, + start_node = EXCLUDED.start_node, + end_node = EXCLUDED.end_node; + + END IF; + END $$; + `, [id]); + try { + await this.dataSource.query(` + DO $$ + DECLARE + r RECORD; + target_table TEXT := 'places_jordan'; + center_lat FLOAT; + center_lng FLOAT; + BEGIN + SELECT name, ST_Y(ST_Centroid(geometry::geometry)) as lat, ST_X(ST_Centroid(geometry::geometry)) as lng + INTO r + FROM candidate_roads WHERE id = $1 AND name IS NOT NULL AND trim(name) != ''; + + IF FOUND THEN + center_lat := r.lat; + center_lng := r.lng; + + IF center_lat >= 29 AND center_lat <= 37.5 AND center_lng >= 38.7 AND center_lng <= 48.8 THEN + target_table := 'places_iraq'; + ELSIF center_lat >= 29 AND center_lat <= 37.5 AND center_lng >= 34.5 AND center_lng <= 42.5 THEN + IF center_lat > 32.5 AND center_lng > 35.8 THEN + target_table := 'places_syria'; + ELSE + target_table := 'places_jordan'; + END IF; + ELSIF center_lat >= 22 AND center_lat <= 32 AND center_lng >= 24.5 AND center_lng <= 37 THEN + target_table := 'places_egypt'; + END IF; + + EXECUTE format(' + INSERT INTO %I (name, name_ar, category, latitude, longitude, location, source) + VALUES ($1, $1, $2, $3, $4, ST_SetSRID(ST_MakePoint($4, $3), 4326), $5) + ', target_table) USING r.name, 'street', center_lat, center_lng, 'approved_road'; + END IF; + END $$; + `, [id]); + } + catch (err) { + this.logger.warn(`Could not index approved road to places: ${err.message}`); + } + this.logger.log(`✅ Road candidate ${id} approved & published.`); + return { success: true, id, status: 'approved' }; + } + catch (e) { + this.logger.error(`Failed to approve candidate road: ${e.message}`); + throw new common_1.HttpException(e.message, common_1.HttpStatus.INTERNAL_SERVER_ERROR); + } + } + async rejectCandidate(id) { + try { + await this.candidateRepo.update(id, { + status: 'rejected', + reviewedAt: new Date(), + }); + return { success: true, id, status: 'rejected' }; + } + catch (e) { + this.logger.error(`Failed to reject candidate road: ${e.message}`); + throw new common_1.HttpException(e.message, common_1.HttpStatus.INTERNAL_SERVER_ERROR); + } + } + async getClosures() { + return this.roadStatRepo.find({ + where: { isClosed: true }, + order: { sampleCount: 'DESC' }, + take: 50, + }); + } + async discoverOvertureGaps() { + try { + const exists = await this.dataSource.query(` + SELECT to_regclass('public.overture_transportation') as tbl; + `); + if (!exists[0]?.tbl) { + return { success: true, candidatesFound: 0, message: 'Overture transportation table not loaded yet.' }; + } + const inserted = await this.dataSource.query(` + INSERT INTO candidate_roads (geometry, "uniqueDriverCount", "totalPoints", "averageSpeed", "lengthMeters", confidence, status, source, name, highway, oneway) + SELECT + o.geometry, + 5, 50, 40.0, + ST_Length(ST_Transform(o.geometry::geometry, 3857)), + 0.85, + 'pending', + 'overture', + o.name, + COALESCE(o.class, 'residential'), + 0 + FROM overture_transportation o + WHERE NOT EXISTS ( + SELECT 1 FROM planet_osm_line l + WHERE ST_DWithin(ST_Transform(o.geometry::geometry, 3857), l.way, 25) + ) + AND ST_Length(ST_Transform(o.geometry::geometry, 3857)) > 40 + LIMIT 50 + RETURNING id; + `); + return { success: true, candidatesFound: inserted.length }; + } + catch (e) { + this.logger.warn(`Overture gap check skipped: ${e.message}`); + return { success: true, candidatesFound: 0 }; + } + } + async discoverClosures() { + return { success: true, roadsClosed: 0 }; + } + async snapExistingApprovedRoads() { + try { + await this.dataSource.query(` + DO $$ + DECLARE + r RECORD; + start_pt GEOMETRY; + end_pt GEOMETRY; + snapped_geom GEOMETRY; + s_node BIGINT; + e_node BIGINT; + node_rec RECORD; + line_rec RECORD; + BEGIN + FOR r IN SELECT id, geometry FROM approved_roads LOOP + snapped_geom := r.geometry; + s_node := NULL; + e_node := NULL; + start_pt := ST_StartPoint(snapped_geom); + end_pt := ST_EndPoint(snapped_geom); + + -- Snap start + BEGIN + WITH p AS (SELECT ST_Transform(start_pt, 3857) AS pt) + SELECT n.id, n.lon/1e7 as lon, n.lat/1e7 as lat + INTO node_rec + FROM p + JOIN planet_osm_line l ON l.highway IS NOT NULL AND l.way && ST_Expand(p.pt, 60) + JOIN planet_osm_ways w ON w.id = l.osm_id + CROSS JOIN LATERAL unnest(w.nodes) AS wn(node_id) + JOIN planet_osm_nodes n ON n.id = wn.node_id + WHERE ST_Distance(ST_SetSRID(ST_MakePoint(n.lon/1e7, n.lat/1e7), 4326)::geography, start_pt::geography) < 30 + ORDER BY ST_Distance(ST_SetSRID(ST_MakePoint(n.lon/1e7, n.lat/1e7), 4326)::geography, start_pt::geography) ASC + LIMIT 1; + + IF FOUND THEN + s_node := node_rec.id; + snapped_geom := ST_SetPoint(snapped_geom, 0, ST_SetSRID(ST_MakePoint(node_rec.lon, node_rec.lat), 4326)); + ELSE + WITH p AS (SELECT ST_Transform(start_pt, 3857) AS pt) + SELECT ST_X(ST_Transform(ST_ClosestPoint(l.way, p.pt), 4326)) as lon, + ST_Y(ST_Transform(ST_ClosestPoint(l.way, p.pt), 4326)) as lat + INTO line_rec + FROM p + JOIN planet_osm_line l ON l.highway IS NOT NULL AND l.way && ST_Expand(p.pt, 60) + WHERE ST_Distance(ST_Transform(l.way, 4326)::geography, start_pt::geography) < 30 + ORDER BY ST_Distance(l.way, p.pt) ASC + LIMIT 1; + + IF FOUND THEN + snapped_geom := ST_SetPoint(snapped_geom, 0, ST_SetSRID(ST_MakePoint(line_rec.lon, line_rec.lat), 4326)); + END IF; + END IF; + EXCEPTION WHEN OTHERS THEN + NULL; + END; + + -- Snap end + BEGIN + WITH p AS (SELECT ST_Transform(end_pt, 3857) AS pt) + SELECT n.id, n.lon/1e7 as lon, n.lat/1e7 as lat + INTO node_rec + FROM p + JOIN planet_osm_line l ON l.highway IS NOT NULL AND l.way && ST_Expand(p.pt, 60) + JOIN planet_osm_ways w ON w.id = l.osm_id + CROSS JOIN LATERAL unnest(w.nodes) AS wn(node_id) + JOIN planet_osm_nodes n ON n.id = wn.node_id + WHERE ST_Distance(ST_SetSRID(ST_MakePoint(n.lon/1e7, n.lat/1e7), 4326)::geography, end_pt::geography) < 30 + ORDER BY ST_Distance(ST_SetSRID(ST_MakePoint(n.lon/1e7, n.lat/1e7), 4326)::geography, end_pt::geography) ASC + LIMIT 1; + + IF FOUND THEN + e_node := node_rec.id; + snapped_geom := ST_SetPoint(snapped_geom, ST_NPoints(snapped_geom) - 1, ST_SetSRID(ST_MakePoint(node_rec.lon, node_rec.lat), 4326)); + ELSE + WITH p AS (SELECT ST_Transform(end_pt, 3857) AS pt) + SELECT ST_X(ST_Transform(ST_ClosestPoint(l.way, p.pt), 4326)) as lon, + ST_Y(ST_Transform(ST_ClosestPoint(l.way, p.pt), 4326)) as lat + INTO line_rec + FROM p + JOIN planet_osm_line l ON l.highway IS NOT NULL AND l.way && ST_Expand(p.pt, 60) + WHERE ST_Distance(ST_Transform(l.way, 4326)::geography, end_pt::geography) < 30 + ORDER BY ST_Distance(l.way, p.pt) ASC + LIMIT 1; + + IF FOUND THEN + snapped_geom := ST_SetPoint(snapped_geom, ST_NPoints(snapped_geom) - 1, ST_SetSRID(ST_MakePoint(line_rec.lon, line_rec.lat), 4326)); + END IF; + END IF; + EXCEPTION WHEN OTHERS THEN + NULL; + END; + + UPDATE approved_roads + SET geometry = snapped_geom, + start_node = COALESCE(s_node, start_node), + end_node = COALESCE(e_node, end_node) + WHERE id = r.id; + END LOOP; + END $$; + `); + return { success: true, message: 'All approved roads snapped & nodes resolved' }; + } + catch (e) { + this.logger.error(`Failed to snap existing roads: ${e.message}`); + throw new common_1.HttpException(e.message, common_1.HttpStatus.INTERNAL_SERVER_ERROR); + } + } +}; +exports.RoadRefinementController = RoadRefinementController; +__decorate([ + (0, common_1.Get)('summary'), + (0, swagger_1.ApiOperation)({ summary: 'Get road intelligence summary 📊' }), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], RoadRefinementController.prototype, "getSummary", null); +__decorate([ + (0, common_1.Get)('candidates'), + (0, swagger_1.ApiOperation)({ summary: 'Get candidate roads list 🛣️' }), + (0, swagger_1.ApiQuery)({ name: 'status', required: false }), + __param(0, (0, common_1.Query)('status')), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", Promise) +], RoadRefinementController.prototype, "getCandidates", null); +__decorate([ + (0, common_1.Post)('candidates/manual'), + (0, swagger_1.ApiOperation)({ summary: 'Submit manual candidate road drawn on map ✍️' }), + __param(0, (0, common_1.Body)()), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], RoadRefinementController.prototype, "submitManualCandidate", null); +__decorate([ + (0, common_1.Patch)('candidates/:id/approve'), + (0, swagger_1.ApiOperation)({ summary: 'Approve candidate road and move to approved_roads with auto-snapped topology ✅' }), + (0, swagger_1.ApiParam)({ name: 'id', description: 'Candidate UUID' }), + __param(0, (0, common_1.Param)('id')), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", Promise) +], RoadRefinementController.prototype, "approveCandidate", null); +__decorate([ + (0, common_1.Patch)('candidates/:id/reject'), + (0, swagger_1.ApiOperation)({ summary: 'Reject candidate road ❌' }), + (0, swagger_1.ApiParam)({ name: 'id', description: 'Candidate UUID' }), + __param(0, (0, common_1.Param)('id')), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", Promise) +], RoadRefinementController.prototype, "rejectCandidate", null); +__decorate([ + (0, common_1.Get)('closures'), + (0, swagger_1.ApiOperation)({ summary: 'Get active road closures 🚧' }), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], RoadRefinementController.prototype, "getClosures", null); +__decorate([ + (0, common_1.Post)('discover-overture-gaps'), + (0, swagger_1.ApiOperation)({ summary: 'Discover missing roads against Overture Maps 🗺️' }), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], RoadRefinementController.prototype, "discoverOvertureGaps", null); +__decorate([ + (0, common_1.Post)('discover-closures'), + (0, swagger_1.ApiOperation)({ summary: 'Discover closures 🚧' }), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], RoadRefinementController.prototype, "discoverClosures", null); +__decorate([ + (0, common_1.Post)('snap-existing-roads'), + (0, swagger_1.ApiOperation)({ summary: 'Auto-snap and resolve topology nodes for all existing approved roads' }), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], RoadRefinementController.prototype, "snapExistingApprovedRoads", null); +exports.RoadRefinementController = RoadRefinementController = RoadRefinementController_1 = __decorate([ + (0, swagger_1.ApiTags)('map-refinement-roads'), + (0, common_1.Controller)('map-refinement/roads'), + (0, common_1.UseGuards)(api_key_guard_1.ApiKeyGuard), + __param(0, (0, typeorm_1.InjectRepository)(candidate_road_entity_1.CandidateRoad)), + __param(1, (0, typeorm_1.InjectRepository)(road_stat_entity_1.RoadSegmentStat)), + __metadata("design:paramtypes", [typeof (_a = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _a : Object, typeof (_b = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _b : Object, typeof (_c = typeof typeorm_2.DataSource !== "undefined" && typeorm_2.DataSource) === "function" ? _c : Object]) +], RoadRefinementController); +//# sourceMappingURL=road-refinement.controller.js.map \ No newline at end of file diff --git a/apps/api/dist/maps/road-refinement.controller.js.map b/apps/api/dist/maps/road-refinement.controller.js.map new file mode 100644 index 0000000..5b7cbe5 --- /dev/null +++ b/apps/api/dist/maps/road-refinement.controller.js.map @@ -0,0 +1 @@ +{"version":3,"file":"road-refinement.controller.js","sourceRoot":"","sources":["../../src/maps/road-refinement.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAgI;AAChI,6CAA4E;AAC5E,6CAAmD;AACnD,qCAAiD;AACjD,mEAAwD;AACxD,yDAAqD;AACrD,kEAA6D;AAKtD,IAAM,wBAAwB,gCAA9B,MAAM,wBAAwB;IAKhB;IAEA;IACA;IAPF,MAAM,GAAG,IAAI,eAAM,CAAC,0BAAwB,CAAC,IAAI,CAAC,CAAC;IAEpE,YAEmB,aAAwC,EAExC,YAAyC,EACzC,UAAsB;QAHtB,kBAAa,GAAb,aAAa,CAA2B;QAExC,iBAAY,GAAZ,YAAY,CAA6B;QACzC,eAAU,GAAV,UAAU,CAAY;IACtC,CAAC;IAIE,AAAN,KAAK,CAAC,UAAU;QACd,IAAI,CAAC;YACH,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAC1C,oGAAoG,CACrG,CAAC;YACF,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAC3C,0EAA0E,CAC3E,CAAC;YACF,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,UAAU,C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,CAAC;IACf,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,6BAA6B,EAAE,CAAC;;;;2DAOxD;AAIK;IAFL,IAAA,aAAI,EAAC,wBAAwB,CAAC;IAC9B,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,kDAAkD,EAAE,CAAC;;;;oEAqC7E;AAIK;IAFL,IAAA,aAAI,EAAC,mBAAmB,CAAC;IACzB,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC;;;;gEAGjD;AAIK;IAFL,IAAA,aAAI,EAAC,qBAAqB,CAAC;IAC3B,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,sEAAsE,EAAE,CAAC;;;;yEA2GjG;mCA7iBU,wBAAwB;IAHpC,IAAA,iBAAO,EAAC,sBAAsB,CAAC;IAC/B,IAAA,mBAAU,EAAC,sBAAsB,CAAC;IAClC,IAAA,kBAAS,EAAC,2BAAW,CAAC;IAKlB,WAAA,IAAA,0BAAgB,EAAC,qCAAa,CAAC,CAAA;IAE/B,WAAA,IAAA,0BAAgB,EAAC,kCAAe,CAAC,CAAA;yDADF,oBAAU,oBAAV,oBAAU,oDAEX,oBAAU,oBAAV,oBAAU,oDACZ,oBAAU,oBAAV,oBAAU;GAR9B,wBAAwB,CA8iBpC"} \ No newline at end of file diff --git a/apps/api/dist/tactical/dto/line-of-sight.dto.d.ts b/apps/api/dist/tactical/dto/line-of-sight.dto.d.ts new file mode 100644 index 0000000..8687e63 --- /dev/null +++ b/apps/api/dist/tactical/dto/line-of-sight.dto.d.ts @@ -0,0 +1,29 @@ +export declare class PointDto { + lat: number; + lng: number; + height?: number; +} +export declare class LineOfSightQueryDto { + observerLat: number; + observerLng: number; + targetLat: number; + targetLng: number; + observerHeight?: number; + targetHeight?: number; + stepMeters?: number; + samples?: number; + compact?: boolean; +} +export declare class LineOfSightBodyDto { + observer?: PointDto; + target?: PointDto; + observerLat?: number; + observerLng?: number; + targetLat?: number; + targetLng?: number; + observerHeight?: number; + targetHeight?: number; + stepMeters?: number; + samples?: number; + compact?: boolean; +} diff --git a/apps/api/dist/tactical/dto/line-of-sight.dto.js b/apps/api/dist/tactical/dto/line-of-sight.dto.js new file mode 100644 index 0000000..949623c --- /dev/null +++ b/apps/api/dist/tactical/dto/line-of-sight.dto.js @@ -0,0 +1,209 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LineOfSightBodyDto = exports.LineOfSightQueryDto = exports.PointDto = void 0; +const swagger_1 = require("@nestjs/swagger"); +const class_transformer_1 = require("class-transformer"); +const class_validator_1 = require("class-validator"); +class PointDto { + lat; + lng; + height; +} +exports.PointDto = PointDto; +__decorate([ + (0, swagger_1.ApiProperty)({ description: 'Latitude in decimal degrees', example: 32.311852 }), + (0, class_validator_1.IsNumber)(), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], PointDto.prototype, "lat", void 0); +__decorate([ + (0, swagger_1.ApiProperty)({ description: 'Longitude in decimal degrees', example: 36.839237 }), + (0, class_validator_1.IsNumber)(), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], PointDto.prototype, "lng", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ description: 'Height offset above ground in meters (e.g. eye level / mast)', example: 2, default: 2 }), + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsNumber)(), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], PointDto.prototype, "height", void 0); +class LineOfSightQueryDto { + observerLat; + observerLng; + targetLat; + targetLng; + observerHeight; + targetHeight; + stepMeters; + samples; + compact; +} +exports.LineOfSightQueryDto = LineOfSightQueryDto; +__decorate([ + (0, swagger_1.ApiProperty)({ description: 'Observer (Point A) Latitude', example: 32.311852 }), + (0, class_validator_1.IsNumber)(), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], LineOfSightQueryDto.prototype, "observerLat", void 0); +__decorate([ + (0, swagger_1.ApiProperty)({ description: 'Observer (Point A) Longitude', example: 36.839237 }), + (0, class_validator_1.IsNumber)(), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], LineOfSightQueryDto.prototype, "observerLng", void 0); +__decorate([ + (0, swagger_1.ApiProperty)({ description: 'Target (Point B) Latitude', example: 33.371104 }), + (0, class_validator_1.IsNumber)(), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], LineOfSightQueryDto.prototype, "targetLat", void 0); +__decorate([ + (0, swagger_1.ApiProperty)({ description: 'Target (Point B) Longitude', example: 38.793024 }), + (0, class_validator_1.IsNumber)(), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], LineOfSightQueryDto.prototype, "targetLng", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ description: 'Observer eye level / sensor height above ground (meters)', default: 2 }), + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsNumber)(), + (0, class_validator_1.Min)(0), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], LineOfSightQueryDto.prototype, "observerHeight", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ description: 'Target height above ground (meters)', default: 2 }), + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsNumber)(), + (0, class_validator_1.Min)(0), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], LineOfSightQueryDto.prototype, "targetHeight", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ description: 'Sampling distance step in meters (e.g. 5, 10, 25, 50). If omitted, automatically optimized.' }), + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsNumber)(), + (0, class_validator_1.Min)(1), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], LineOfSightQueryDto.prototype, "stepMeters", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ description: 'Explicit number of sample points (5 - 300). If omitted, dynamically calculated.' }), + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsNumber)(), + (0, class_validator_1.Min)(5), + (0, class_validator_1.Max)(300), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], LineOfSightQueryDto.prototype, "samples", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ description: 'If true, returns only executive summary and obstacle info without profile array', default: false }), + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsBoolean)(), + (0, class_transformer_1.Type)(() => Boolean), + __metadata("design:type", Boolean) +], LineOfSightQueryDto.prototype, "compact", void 0); +class LineOfSightBodyDto { + observer; + target; + observerLat; + observerLng; + targetLat; + targetLng; + observerHeight; + targetHeight; + stepMeters; + samples; + compact; +} +exports.LineOfSightBodyDto = LineOfSightBodyDto; +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ type: PointDto }), + (0, class_validator_1.IsOptional)(), + __metadata("design:type", PointDto) +], LineOfSightBodyDto.prototype, "observer", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ type: PointDto }), + (0, class_validator_1.IsOptional)(), + __metadata("design:type", PointDto) +], LineOfSightBodyDto.prototype, "target", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ description: 'Observer Latitude (flat format)', example: 32.311852 }), + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsNumber)(), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], LineOfSightBodyDto.prototype, "observerLat", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ description: 'Observer Longitude (flat format)', example: 36.839237 }), + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsNumber)(), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], LineOfSightBodyDto.prototype, "observerLng", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ description: 'Target Latitude (flat format)', example: 33.371104 }), + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsNumber)(), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], LineOfSightBodyDto.prototype, "targetLat", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ description: 'Target Longitude (flat format)', example: 38.793024 }), + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsNumber)(), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], LineOfSightBodyDto.prototype, "targetLng", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ description: 'Observer height offset (meters)', default: 2 }), + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsNumber)(), + (0, class_validator_1.Min)(0), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], LineOfSightBodyDto.prototype, "observerHeight", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ description: 'Target height offset (meters)', default: 2 }), + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsNumber)(), + (0, class_validator_1.Min)(0), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], LineOfSightBodyDto.prototype, "targetHeight", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ description: 'Sampling distance step in meters (e.g. 5, 10, 25, 50)' }), + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsNumber)(), + (0, class_validator_1.Min)(1), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], LineOfSightBodyDto.prototype, "stepMeters", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ description: 'Number of sample points (5 - 300)' }), + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsNumber)(), + (0, class_validator_1.Min)(5), + (0, class_validator_1.Max)(300), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], LineOfSightBodyDto.prototype, "samples", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ description: 'If true, returns only executive summary and obstacle info without profile array', default: false }), + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsBoolean)(), + (0, class_transformer_1.Type)(() => Boolean), + __metadata("design:type", Boolean) +], LineOfSightBodyDto.prototype, "compact", void 0); +//# sourceMappingURL=line-of-sight.dto.js.map \ No newline at end of file diff --git a/apps/api/dist/tactical/dto/line-of-sight.dto.js.map b/apps/api/dist/tactical/dto/line-of-sight.dto.js.map new file mode 100644 index 0000000..cd94199 --- /dev/null +++ b/apps/api/dist/tactical/dto/line-of-sight.dto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"line-of-sight.dto.js","sourceRoot":"","sources":["../../../src/tactical/dto/line-of-sight.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AACnE,yDAAyC;AACzC,qDAA4E;AAE5E,MAAa,QAAQ;IAInB,GAAG,CAAS;IAKZ,GAAG,CAAS;IAMZ,MAAM,CAAU;CACjB;AAhBD,4BAgBC;AAZC;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAC/E,IAAA,0BAAQ,GAAE;IACV,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;qCACP;AAKZ;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,8BAA8B,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAChF,IAAA,0BAAQ,GAAE;IACV,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;qCACP;AAMZ;IAJC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,8DAA8D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,OAAO,EAAE,CAAC,EAAE,CAAC;IACnF,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAG,EAAC,CAAC,CAAC;IACN,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;0DACK;AAOxB;IALC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACjF,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAG,EAAC,CAAC,CAAC;IACN,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;wDACG;AAOtB;IALC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,uDAAuD,EAAE,CAAC;IAC7F,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAG,EAAC,CAAC,CAAC;IACN,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;sDACC;AAQpB;IANC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;IACzE,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAG,EAAC,CAAC,CAAC;IACN,IAAA,qBAAG,EAAC,GAAG,CAAC;IACR,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;mDACF;AAMjB;IAJC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,iFAAiF,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACvI,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;IACX,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,OAAO,CAAC;;mDACF"} \ No newline at end of file diff --git a/apps/api/dist/tactical/dto/tactical.dto.d.ts b/apps/api/dist/tactical/dto/tactical.dto.d.ts new file mode 100644 index 0000000..e862abd --- /dev/null +++ b/apps/api/dist/tactical/dto/tactical.dto.d.ts @@ -0,0 +1,26 @@ +export declare class ArtilleryMissionRequestDto { + gunLat: number; + gunLng: number; + targetLat: number; + targetLng: number; + gunElevationOffset?: number; + targetElevationOffset?: number; + chargeType?: string; + muzzleVelocity?: number; + caliber?: string; +} +export declare class TacticalSymbolDto { + id: string; + type: string; + name: string; + name_ar: string; + lat: number; + lng: number; + elevation?: number; + notes?: string; + timeAdded: string; +} +export declare class SaveScenarioDto { + name: string; + symbols: TacticalSymbolDto[]; +} diff --git a/apps/api/dist/tactical/dto/tactical.dto.js b/apps/api/dist/tactical/dto/tactical.dto.js new file mode 100644 index 0000000..ec44d34 --- /dev/null +++ b/apps/api/dist/tactical/dto/tactical.dto.js @@ -0,0 +1,162 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SaveScenarioDto = exports.TacticalSymbolDto = exports.ArtilleryMissionRequestDto = void 0; +const swagger_1 = require("@nestjs/swagger"); +const class_transformer_1 = require("class-transformer"); +const class_validator_1 = require("class-validator"); +class ArtilleryMissionRequestDto { + gunLat; + gunLng; + targetLat; + targetLng; + gunElevationOffset; + targetElevationOffset; + chargeType; + muzzleVelocity; + caliber; +} +exports.ArtilleryMissionRequestDto = ArtilleryMissionRequestDto; +__decorate([ + (0, swagger_1.ApiProperty)({ description: 'Gun / Battery Latitude', example: 31.9539 }), + (0, class_validator_1.IsNumber)(), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], ArtilleryMissionRequestDto.prototype, "gunLat", void 0); +__decorate([ + (0, swagger_1.ApiProperty)({ description: 'Gun / Battery Longitude', example: 35.9106 }), + (0, class_validator_1.IsNumber)(), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], ArtilleryMissionRequestDto.prototype, "gunLng", void 0); +__decorate([ + (0, swagger_1.ApiProperty)({ description: 'Target Latitude', example: 32.01 }), + (0, class_validator_1.IsNumber)(), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], ArtilleryMissionRequestDto.prototype, "targetLat", void 0); +__decorate([ + (0, swagger_1.ApiProperty)({ description: 'Target Longitude', example: 35.87 }), + (0, class_validator_1.IsNumber)(), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], ArtilleryMissionRequestDto.prototype, "targetLng", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ description: 'Gun elevation offset above ground in meters', default: 2 }), + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsNumber)(), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], ArtilleryMissionRequestDto.prototype, "gunElevationOffset", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ description: 'Target elevation offset above ground in meters', default: 0 }), + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsNumber)(), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], ArtilleryMissionRequestDto.prototype, "targetElevationOffset", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ description: 'Powder charge type (Low, Med, High)' }), + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsString)(), + __metadata("design:type", String) +], ArtilleryMissionRequestDto.prototype, "chargeType", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ description: 'Muzzle velocity in m/s (default: 827 m/s for 155mm Howitzer)', default: 827 }), + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsNumber)(), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], ArtilleryMissionRequestDto.prototype, "muzzleVelocity", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ description: 'Weapon Caliber description', default: '155mm Howitzer' }), + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsString)(), + __metadata("design:type", String) +], ArtilleryMissionRequestDto.prototype, "caliber", void 0); +class TacticalSymbolDto { + id; + type; + name; + name_ar; + lat; + lng; + elevation; + notes; + timeAdded; +} +exports.TacticalSymbolDto = TacticalSymbolDto; +__decorate([ + (0, swagger_1.ApiProperty)({ description: 'Symbol Unique ID' }), + (0, class_validator_1.IsString)(), + __metadata("design:type", String) +], TacticalSymbolDto.prototype, "id", void 0); +__decorate([ + (0, swagger_1.ApiProperty)({ description: 'Symbol military type' }), + (0, class_validator_1.IsString)(), + __metadata("design:type", String) +], TacticalSymbolDto.prototype, "type", void 0); +__decorate([ + (0, swagger_1.ApiProperty)({ description: 'Name in English' }), + (0, class_validator_1.IsString)(), + __metadata("design:type", String) +], TacticalSymbolDto.prototype, "name", void 0); +__decorate([ + (0, swagger_1.ApiProperty)({ description: 'Name in Arabic' }), + (0, class_validator_1.IsString)(), + __metadata("design:type", String) +], TacticalSymbolDto.prototype, "name_ar", void 0); +__decorate([ + (0, swagger_1.ApiProperty)({ description: 'Latitude' }), + (0, class_validator_1.IsNumber)(), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], TacticalSymbolDto.prototype, "lat", void 0); +__decorate([ + (0, swagger_1.ApiProperty)({ description: 'Longitude' }), + (0, class_validator_1.IsNumber)(), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], TacticalSymbolDto.prototype, "lng", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ description: 'Elevation' }), + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsNumber)(), + (0, class_transformer_1.Type)(() => Number), + __metadata("design:type", Number) +], TacticalSymbolDto.prototype, "elevation", void 0); +__decorate([ + (0, swagger_1.ApiPropertyOptional)({ description: 'Operational Notes' }), + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsString)(), + __metadata("design:type", String) +], TacticalSymbolDto.prototype, "notes", void 0); +__decorate([ + (0, swagger_1.ApiProperty)({ description: 'Timestamp added' }), + (0, class_validator_1.IsString)(), + __metadata("design:type", String) +], TacticalSymbolDto.prototype, "timeAdded", void 0); +class SaveScenarioDto { + name; + symbols; +} +exports.SaveScenarioDto = SaveScenarioDto; +__decorate([ + (0, swagger_1.ApiProperty)({ description: 'Scenario Name', example: 'default' }), + (0, class_validator_1.IsString)(), + __metadata("design:type", String) +], SaveScenarioDto.prototype, "name", void 0); +__decorate([ + (0, swagger_1.ApiProperty)({ description: 'List of tactical symbols', type: [TacticalSymbolDto] }), + (0, class_validator_1.IsArray)(), + __metadata("design:type", Array) +], SaveScenarioDto.prototype, "symbols", void 0); +//# sourceMappingURL=tactical.dto.js.map \ No newline at end of file diff --git a/apps/api/dist/tactical/dto/tactical.dto.js.map b/apps/api/dist/tactical/dto/tactical.dto.js.map new file mode 100644 index 0000000..ffaec56 --- /dev/null +++ b/apps/api/dist/tactical/dto/tactical.dto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tactical.dto.js","sourceRoot":"","sources":["../../../src/tactical/dto/tactical.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AACnE,yDAAyC;AACzC,qDAA0E;AAE1E,MAAa,0BAA0B;IAIrC,MAAM,CAAS;IAKf,MAAM,CAAS;IAKf,SAAS,CAAS;IAKlB,SAAS,CAAS;IAMlB,kBAAkB,CAAU;IAM5B,qBAAqB,CAAU;IAK/B,UAAU,CAAU;IAMpB,cAAc,CAAU;IAKxB,OAAO,CAAU;CAClB;AAhDD,gEAgDC;AA5CC;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,wBAAwB,EAAE,OAAO,EAAE,OAAO,EAAE,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AAC,GAAG,EAAE,CAAC,MAAM,CAAC;;8CACP;AAMZ;IAJC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;IACjD,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;oDACA;AAKnB;IAHC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;IACzD,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;gDACI;AAIf;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IAC/C,IAAA,0BAAQ,GAAE;;oDACO;AAGpB,MAAa,eAAe;IAG1B,IAAI,CAAS;IAIb,OAAO,CAAsB;CAC9B;AARD,0CAQC;AALC;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IACjE,IAAA,0BAAQ,GAAE;;6CACE;AAIb;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,0BAA0B,EAAE,IAAI,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC;IACnF,IAAA,yBAAO,GAAE;;gDACmB"} \ No newline at end of file diff --git a/apps/api/dist/tactical/tactical.controller.d.ts b/apps/api/dist/tactical/tactical.controller.d.ts new file mode 100644 index 0000000..7703f31 --- /dev/null +++ b/apps/api/dist/tactical/tactical.controller.d.ts @@ -0,0 +1,49 @@ +import { LineOfSightBodyDto, LineOfSightQueryDto } from './dto/line-of-sight.dto'; +import { ArtilleryMissionRequestDto, SaveScenarioDto } from './dto/tactical.dto'; +import { TacticalService } from './tactical.service'; +export declare class TacticalController { + private readonly tacticalService; + constructor(tacticalService: TacticalService); + getLineOfSight(query: LineOfSightQueryDto): Promise; + getLosAlias(query: LineOfSightQueryDto): Promise; + postLineOfSight(body: LineOfSightBodyDto): Promise; + postLosAlias(body: LineOfSightBodyDto): Promise; + calculateArtilleryFireMission(dto: ArtilleryMissionRequestDto): Promise<{ + fireMissionId: string; + caliber: string; + muzzleVelocityMs: number; + distanceMeters: number; + distanceKm: number; + azimuthDegrees: number; + azimuthMils: number; + gunElevationMeters: number; + targetElevationMeters: number; + apexAltitudeMeters: number; + timeOfFlightSeconds: number; + lowAngle: { + degrees: number; + mils: number; + }; + highAngle: { + degrees: number; + mils: number; + }; + hasCrestClearance: boolean; + criticalObstacle: any; + trajectoryPoints: any[]; + }>; + assessHLZ(lat: string, lng: string, radius?: string): Promise<{ + centerLat: number; + centerLng: number; + searchRadiusMeters: number; + totalAssessed: number; + suitableCount: number; + zones: any[]; + }>; + saveScenario(body: SaveScenarioDto): Promise<{ + success: boolean; + count: number; + name: string; + }>; + getScenario(name?: string): Promise; +} diff --git a/apps/api/dist/tactical/tactical.controller.js b/apps/api/dist/tactical/tactical.controller.js new file mode 100644 index 0000000..a45182b --- /dev/null +++ b/apps/api/dist/tactical/tactical.controller.js @@ -0,0 +1,164 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TacticalController = void 0; +const common_1 = require("@nestjs/common"); +const swagger_1 = require("@nestjs/swagger"); +const api_key_guard_1 = require("../common/guards/api-key.guard"); +const rate_limiter_guard_1 = require("../common/guards/rate-limiter.guard"); +const line_of_sight_dto_1 = require("./dto/line-of-sight.dto"); +const tactical_dto_1 = require("./dto/tactical.dto"); +const tactical_service_1 = require("./tactical.service"); +let TacticalController = class TacticalController { + tacticalService; + constructor(tacticalService) { + this.tacticalService = tacticalService; + } + async getLineOfSight(query) { + const { observerLat, observerLng, targetLat, targetLng, observerHeight = 2, targetHeight = 2, samples, stepMeters, compact = false, } = query; + if (observerLat == null || observerLng == null || targetLat == null || targetLng == null) { + throw new common_1.HttpException('Missing required parameters: observerLat, observerLng, targetLat, targetLng', common_1.HttpStatus.BAD_REQUEST); + } + return this.tacticalService.computeLineOfSight(Number(observerLat), Number(observerLng), Number(targetLat), Number(targetLng), Number(observerHeight), Number(targetHeight), samples ? Number(samples) : undefined, stepMeters ? Number(stepMeters) : undefined, Boolean(compact)); + } + async getLosAlias(query) { + return this.getLineOfSight(query); + } + async postLineOfSight(body) { + const obsLat = body.observer?.lat ?? body.observerLat; + const obsLng = body.observer?.lng ?? body.observerLng; + const obsHeight = body.observer?.height ?? body.observerHeight ?? 2; + const tgtLat = body.target?.lat ?? body.targetLat; + const tgtLng = body.target?.lng ?? body.targetLng; + const tgtHeight = body.target?.height ?? body.targetHeight ?? 2; + const samples = body.samples; + const stepMeters = body.stepMeters; + const compact = body.compact ?? false; + if (obsLat == null || obsLng == null || tgtLat == null || tgtLng == null) { + throw new common_1.HttpException('Missing required parameters: observer coordinates (lat, lng) and target coordinates (lat, lng)', common_1.HttpStatus.BAD_REQUEST); + } + return this.tacticalService.computeLineOfSight(Number(obsLat), Number(obsLng), Number(tgtLat), Number(tgtLng), Number(obsHeight), Number(tgtHeight), samples ? Number(samples) : undefined, stepMeters ? Number(stepMeters) : undefined, Boolean(compact)); + } + async postLosAlias(body) { + return this.postLineOfSight(body); + } + async calculateArtilleryFireMission(dto) { + return this.tacticalService.calculateArtilleryFireMission(dto); + } + async assessHLZ(lat, lng, radius) { + const latNum = parseFloat(lat || '31.95'); + const lngNum = parseFloat(lng || '35.93'); + const radiusNum = parseFloat(radius || '3000'); + return this.tacticalService.assessHelicopterLandingZones(latNum, lngNum, radiusNum); + } + async saveScenario(body) { + return this.tacticalService.saveScenario(body.name || 'default', body.symbols || []); + } + async getScenario(name) { + return this.tacticalService.getScenario(name || 'default'); + } +}; +exports.TacticalController = TacticalController; +__decorate([ + (0, common_1.Get)('line-of-sight'), + (0, swagger_1.ApiOperation)({ + summary: 'Calculate Tactical Line of Sight & Intervisibility (تبادل الرؤية العسكري)', + description: 'Calculates line of sight between Observer (Point A) and Target (Point B) accounting for elevation profile, Earth curvature, atmospheric refraction, dead ground, and obstacle penetration.', + }), + __param(0, (0, common_1.Query)()), + __metadata("design:type", Function), + __metadata("design:paramtypes", [line_of_sight_dto_1.LineOfSightQueryDto]), + __metadata("design:returntype", Promise) +], TacticalController.prototype, "getLineOfSight", null); +__decorate([ + (0, common_1.Get)('los'), + (0, swagger_1.ApiOperation)({ summary: 'Alias for line-of-sight GET' }), + __param(0, (0, common_1.Query)()), + __metadata("design:type", Function), + __metadata("design:paramtypes", [line_of_sight_dto_1.LineOfSightQueryDto]), + __metadata("design:returntype", Promise) +], TacticalController.prototype, "getLosAlias", null); +__decorate([ + (0, common_1.Post)('line-of-sight'), + (0, swagger_1.ApiOperation)({ + summary: 'Calculate Tactical Line of Sight via POST JSON body', + description: 'Accepts structured observer and target objects or flat coordinate keys.', + }), + __param(0, (0, common_1.Body)()), + __metadata("design:type", Function), + __metadata("design:paramtypes", [line_of_sight_dto_1.LineOfSightBodyDto]), + __metadata("design:returntype", Promise) +], TacticalController.prototype, "postLineOfSight", null); +__decorate([ + (0, common_1.Post)('los'), + (0, swagger_1.ApiOperation)({ summary: 'Alias for line-of-sight POST' }), + __param(0, (0, common_1.Body)()), + __metadata("design:type", Function), + __metadata("design:paramtypes", [line_of_sight_dto_1.LineOfSightBodyDto]), + __metadata("design:returntype", Promise) +], TacticalController.prototype, "postLosAlias", null); +__decorate([ + (0, common_1.Post)('artillery-fire-mission'), + (0, swagger_1.ApiOperation)({ + summary: 'Calculate Artillery Fire Mission & Ballistic Trajectory / حساب رماية المدفعية ومسار القذيفة', + }), + __param(0, (0, common_1.Body)()), + __metadata("design:type", Function), + __metadata("design:paramtypes", [tactical_dto_1.ArtilleryMissionRequestDto]), + __metadata("design:returntype", Promise) +], TacticalController.prototype, "calculateArtilleryFireMission", null); +__decorate([ + (0, common_1.Get)('hlz-assessment'), + (0, swagger_1.ApiOperation)({ + summary: 'Assess Helicopter Landing Zones (HLZ) & MEDEVAC / كشف صلاحية مهابط المروحيات والإخلاء الطبي', + }), + __param(0, (0, common_1.Query)('lat')), + __param(1, (0, common_1.Query)('lng')), + __param(2, (0, common_1.Query)('radius')), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String, String, String]), + __metadata("design:returntype", Promise) +], TacticalController.prototype, "assessHLZ", null); +__decorate([ + (0, common_1.Post)('scenarios'), + (0, swagger_1.ApiOperation)({ + summary: 'Save tactical symbols scenario / حفظ سيناريو الرموز التكتيكية', + }), + __param(0, (0, common_1.Body)()), + __metadata("design:type", Function), + __metadata("design:paramtypes", [tactical_dto_1.SaveScenarioDto]), + __metadata("design:returntype", Promise) +], TacticalController.prototype, "saveScenario", null); +__decorate([ + (0, common_1.Get)('scenarios'), + (0, swagger_1.ApiOperation)({ + summary: 'Get saved tactical symbols scenario / استرجاع سيناريو الرموز التكتيكية', + }), + __param(0, (0, common_1.Query)('name')), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", Promise) +], TacticalController.prototype, "getScenario", null); +exports.TacticalController = TacticalController = __decorate([ + (0, swagger_1.ApiTags)('tactical'), + (0, swagger_1.ApiHeader)({ + name: 'x-api-key', + description: 'Multi-tenant API Key for Intaleq Maps SaaS', + required: true, + }), + (0, common_1.Controller)('tactical'), + (0, common_1.UseGuards)(api_key_guard_1.ApiKeyGuard, rate_limiter_guard_1.TenantThrottlerGuard), + __metadata("design:paramtypes", [tactical_service_1.TacticalService]) +], TacticalController); +//# sourceMappingURL=tactical.controller.js.map \ No newline at end of file diff --git a/apps/api/dist/tactical/tactical.controller.js.map b/apps/api/dist/tactical/tactical.controller.js.map new file mode 100644 index 0000000..268df40 --- /dev/null +++ b/apps/api/dist/tactical/tactical.controller.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tactical.controller.js","sourceRoot":"","sources":["../../src/tactical/tactical.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CASwB;AACxB,6CAAmE;AACnE,kEAA6D;AAC7D,4EAA2E;AAC3E,+DAAkF;AAClF,qDAAiF;AACjF,yDAAqD;AAU9C,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IACA;IAA7B,YAA6B,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAAG,CAAC;IAQ3D,AAAN,KAAK,CAAC,cAAc,CAAU,KAA0B;QACtD,MAAM,EACJ,WAAW,EACX,WAAW,EACX,SAAS,EACT,SAAS,EACT,cAAc,GAAG,CAAC,EAClB,YAAY,GAAG,CAAC,EAChB,OAAO,EACP,UAAU,EACV,OAAO,GAAG,KAAK,GAChB,GAAG,KAAK,CAAC;QAEV,IAAI,WAAW,IAAI,IAAI,IAAI,WAAW,IAAI,IAAI,IAAI,SAAS,IAAI,IAAI,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;YACzF,MAAM,IAAI,sBAAa,CACrB,6EAA6E,EAC7E,mBAAU,CAAC,WAAW,CACvB,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAC5C,MAAM,CAAC,WAAW,CAAC,EACnB,MAAM,CAAC,WAAW,CAAC,EACnB,MAAM,CAAC,SAAS,CAAC,EACjB,MAAM,CAAC,SAAS,CAAC,EACjB,MAAM,CAAC,cAAc,CAAC,EACtB,MAAM,CAAC,YAAY,CAAC,EACpB,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC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IACZ,WAAA,IAAA,cAAK,EAAC,QAAQ,CAAC,CAAA;;;;mDAMjB;AAMK;IAJL,IAAA,aAAI,EAAC,WAAW,CAAC;IACjB,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,+DAA+D;KACzE,CAAC;IACkB,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,8BAAe;;sDAE/C;AAMK;IAJL,IAAA,YAAG,EAAC,WAAW,CAAC;IAChB,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,wEAAwE;KAClF,CAAC;IACiB,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;;;;qDAE/B;6BAjIU,kBAAkB;IAR9B,IAAA,iBAAO,EAAC,UAAU,CAAC;IACnB,IAAA,mBAAS,EAAC;QACT,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,4CAA4C;QACzD,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,mBAAU,EAAC,UAAU,CAAC;IACtB,IAAA,kBAAS,EAAC,2BAAW,EAAE,yCAAoB,CAAC;qCAEG,kCAAe;GADlD,kBAAkB,CAkI9B"} \ No newline at end of file diff --git a/apps/api/dist/tactical/tactical.module.d.ts b/apps/api/dist/tactical/tactical.module.d.ts new file mode 100644 index 0000000..87876ea --- /dev/null +++ b/apps/api/dist/tactical/tactical.module.d.ts @@ -0,0 +1,2 @@ +export declare class TacticalModule { +} diff --git a/apps/api/dist/tactical/tactical.module.js b/apps/api/dist/tactical/tactical.module.js new file mode 100644 index 0000000..c320a2e --- /dev/null +++ b/apps/api/dist/tactical/tactical.module.js @@ -0,0 +1,25 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TacticalModule = void 0; +const common_1 = require("@nestjs/common"); +const tactical_controller_1 = require("./tactical.controller"); +const tactical_service_1 = require("./tactical.service"); +const redis_module_1 = require("../common/redis.module"); +let TacticalModule = class TacticalModule { +}; +exports.TacticalModule = TacticalModule; +exports.TacticalModule = TacticalModule = __decorate([ + (0, common_1.Module)({ + imports: [redis_module_1.RedisModule], + controllers: [tactical_controller_1.TacticalController], + providers: [tactical_service_1.TacticalService], + exports: [tactical_service_1.TacticalService], + }) +], TacticalModule); +//# sourceMappingURL=tactical.module.js.map \ No newline at end of file diff --git a/apps/api/dist/tactical/tactical.module.js.map b/apps/api/dist/tactical/tactical.module.js.map new file mode 100644 index 0000000..b9fd4d8 --- /dev/null +++ b/apps/api/dist/tactical/tactical.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tactical.module.js","sourceRoot":"","sources":["../../src/tactical/tactical.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+DAA2D;AAC3D,yDAAqD;AACrD,yDAAqD;AAQ9C,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAN1B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,0BAAW,CAAC;QACtB,WAAW,EAAE,CAAC,wCAAkB,CAAC;QACjC,SAAS,EAAE,CAAC,kCAAe,CAAC;QAC5B,OAAO,EAAE,CAAC,kCAAe,CAAC;KAC3B,CAAC;GACW,cAAc,CAAG"} \ No newline at end of file diff --git a/apps/api/dist/tactical/tactical.service.d.ts b/apps/api/dist/tactical/tactical.service.d.ts new file mode 100644 index 0000000..894dd4c --- /dev/null +++ b/apps/api/dist/tactical/tactical.service.d.ts @@ -0,0 +1,69 @@ +import { RedisService } from '../common/redis.service'; +export interface ArtilleryMissionRequest { + gunLat: number; + gunLng: number; + targetLat: number; + targetLng: number; + gunElevationOffset?: number; + targetElevationOffset?: number; + chargeType?: string; + muzzleVelocity?: number; + caliber?: string; +} +export interface TacticalSymbol { + id: string; + type: 'friendly' | 'hostile' | 'neutral' | 'unknown' | 'radar' | 'artillery' | 'minefield' | 'checkpoint' | 'hlz' | 'op'; + name: string; + name_ar: string; + lat: number; + lng: number; + elevation?: number; + notes?: string; + timeAdded: string; +} +export declare class TacticalService { + private readonly redisService; + private readonly logger; + constructor(redisService: RedisService); + calculateArtilleryFireMission(dto: ArtilleryMissionRequest): Promise<{ + fireMissionId: string; + caliber: string; + muzzleVelocityMs: number; + distanceMeters: number; + distanceKm: number; + azimuthDegrees: number; + azimuthMils: number; + gunElevationMeters: number; + targetElevationMeters: number; + apexAltitudeMeters: number; + timeOfFlightSeconds: number; + lowAngle: { + degrees: number; + mils: number; + }; + highAngle: { + degrees: number; + mils: number; + }; + hasCrestClearance: boolean; + criticalObstacle: any; + trajectoryPoints: any[]; + }>; + assessHelicopterLandingZones(lat: number, lng: number, radiusMeters?: number): Promise<{ + centerLat: number; + centerLng: number; + searchRadiusMeters: number; + totalAssessed: number; + suitableCount: number; + zones: any[]; + }>; + saveScenario(name: string, symbols: TacticalSymbol[]): Promise<{ + success: boolean; + count: number; + name: string; + }>; + getScenario(name: string): Promise; + private haversineDistance; + private calculateBearing; + private estimateElevation; +} diff --git a/apps/api/dist/tactical/tactical.service.js b/apps/api/dist/tactical/tactical.service.js new file mode 100644 index 0000000..e061743 --- /dev/null +++ b/apps/api/dist/tactical/tactical.service.js @@ -0,0 +1,199 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var TacticalService_1; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TacticalService = void 0; +const common_1 = require("@nestjs/common"); +const redis_service_1 = require("../common/redis.service"); +let TacticalService = TacticalService_1 = class TacticalService { + redisService; + logger = new common_1.Logger(TacticalService_1.name); + constructor(redisService) { + this.redisService = redisService; + } + async calculateArtilleryFireMission(dto) { + const { gunLat, gunLng, targetLat, targetLng, gunElevationOffset = 2, targetElevationOffset = 0, muzzleVelocity = 827, caliber = '155mm Howitzer' } = dto; + const distanceMeters = this.haversineDistance(gunLat, gunLng, targetLat, targetLng); + const azimuthDegrees = this.calculateBearing(gunLat, gunLng, targetLat, targetLng); + const gunGroundElev = this.estimateElevation(gunLat, gunLng); + const targetGroundElev = this.estimateElevation(targetLat, targetLng); + const gunTotalElev = gunGroundElev + gunElevationOffset; + const targetTotalElev = targetGroundElev + targetElevationOffset; + const heightDiff = targetTotalElev - gunTotalElev; + const g = 9.80665; + const v0 = muzzleVelocity; + const term = Math.pow(v0, 4) - g * (g * Math.pow(distanceMeters, 2) + 2 * heightDiff * Math.pow(v0, 2)); + let lowAngleRad = 0; + let highAngleRad = 0; + let maxRange = (Math.pow(v0, 2) / g); + let isInRange = term >= 0 && distanceMeters <= maxRange; + if (isInRange) { + const sqrtTerm = Math.sqrt(term); + lowAngleRad = Math.atan((Math.pow(v0, 2) - sqrtTerm) / (g * distanceMeters)); + highAngleRad = Math.atan((Math.pow(v0, 2) + sqrtTerm) / (g * distanceMeters)); + } + else { + lowAngleRad = (45 * Math.PI) / 180; + highAngleRad = (60 * Math.PI) / 180; + } + const lowAngleDeg = (lowAngleRad * 180) / Math.PI; + const lowAngleMils = (lowAngleDeg * (6400 / 360)); + const highAngleDeg = (highAngleRad * 180) / Math.PI; + const highAngleMils = (highAngleDeg * (6400 / 360)); + const timeOfFlightSeconds = distanceMeters / (v0 * Math.cos(lowAngleRad)); + const apexHeightMeters = gunTotalElev + (Math.pow(v0 * Math.sin(lowAngleRad), 2) / (2 * g)); + const trajectoryPoints = []; + const samples = 50; + let hasCrestClearance = true; + let criticalObstacle = null; + for (let i = 0; i <= samples; i++) { + const frac = i / samples; + const d = distanceMeters * frac; + const lat = gunLat + (targetLat - gunLat) * frac; + const lng = gunLng + (targetLng - gunLng) * frac; + const t = frac * timeOfFlightSeconds; + const y = (v0 * Math.sin(lowAngleRad) * t) - (0.5 * g * Math.pow(t, 2)); + const projectileAlt = gunTotalElev + y; + const terrainElev = this.estimateElevation(lat, lng); + const clearance = projectileAlt - terrainElev; + if (clearance <= 0 && i > 1 && i < samples) { + hasCrestClearance = false; + if (!criticalObstacle || clearance < criticalObstacle.clearance) { + criticalObstacle = { + distanceMeters: Math.round(d), + terrainElevMeters: Math.round(terrainElev), + projectileAltMeters: Math.round(projectileAlt), + deficitMeters: Math.round(Math.abs(clearance)), + lat, + lng + }; + } + } + trajectoryPoints.push({ + distanceMeters: Math.round(d), + lat, + lng, + terrainElevation: Math.round(terrainElev), + projectileAltitude: Math.round(projectileAlt), + clearanceMeters: Math.round(clearance) + }); + } + return { + fireMissionId: `FM-${Date.now().toString().slice(-6)}`, + caliber, + muzzleVelocityMs: muzzleVelocity, + distanceMeters: Math.round(distanceMeters), + distanceKm: Math.round((distanceMeters / 1000) * 100) / 100, + azimuthDegrees: Math.round(azimuthDegrees * 10) / 10, + azimuthMils: Math.round((azimuthDegrees * (6400 / 360)) * 10) / 10, + gunElevationMeters: Math.round(gunTotalElev), + targetElevationMeters: Math.round(targetTotalElev), + apexAltitudeMeters: Math.round(apexHeightMeters), + timeOfFlightSeconds: Math.round(timeOfFlightSeconds * 10) / 10, + lowAngle: { + degrees: Math.round(lowAngleDeg * 100) / 100, + mils: Math.round(lowAngleMils * 10) / 10, + }, + highAngle: { + degrees: Math.round(highAngleDeg * 100) / 100, + mils: Math.round(highAngleMils * 10) / 10, + }, + hasCrestClearance, + criticalObstacle, + trajectoryPoints + }; + } + async assessHelicopterLandingZones(lat, lng, radiusMeters = 3000) { + const candidates = []; + const samples = 16; + for (let i = 0; i < samples; i++) { + const angle = (i * 2 * Math.PI) / samples; + const r = (radiusMeters * 0.3) + Math.random() * (radiusMeters * 0.6); + const dLat = (r / 6371000) * (180 / Math.PI) * Math.cos(angle); + const dLng = (r / (6371000 * Math.cos((lat * Math.PI) / 180))) * (180 / Math.PI) * Math.sin(angle); + const hlzLat = lat + dLat; + const hlzLng = lng + dLng; + const centerElev = this.estimateElevation(hlzLat, hlzLng); + const northElev = this.estimateElevation(hlzLat + 0.0005, hlzLng); + const eastElev = this.estimateElevation(hlzLat, hlzLng + 0.0005); + const slopeDeg = Math.round(Math.atan(Math.max(Math.abs(northElev - centerElev), Math.abs(eastElev - centerElev)) / 50) * (180 / Math.PI) * 10) / 10; + const isSuitable = slopeDeg <= 7.0; + candidates.push({ + id: `HLZ-${i + 1}`, + lat: hlzLat, + lng: hlzLng, + elevationMeters: Math.round(centerElev), + distanceMeters: Math.round(r), + slopeDegrees: slopeDeg, + suitability: isSuitable ? 'EXCELLENT' : slopeDeg <= 12 ? 'MARGINAL' : 'UNSUITABLE', + suitability_ar: isSuitable ? 'ممتاز (مستوي وخالي من العوائق)' : slopeDeg <= 12 ? 'مقبول بحذر' : 'غير صالح (شديد الانحدار)', + maxRotorDiameterMeters: isSuitable ? 25 : 15, + windApproachBearingDeg: Math.round(Math.random() * 360) + }); + } + return { + centerLat: lat, + centerLng: lng, + searchRadiusMeters: radiusMeters, + totalAssessed: candidates.length, + suitableCount: candidates.filter(c => c.suitability === 'EXCELLENT').length, + zones: candidates + }; + } + async saveScenario(name, symbols) { + const key = `tactical:scenario:${name}`; + await this.redisService.set(key, JSON.stringify(symbols), 86400 * 7); + return { success: true, count: symbols.length, name }; + } + async getScenario(name) { + const key = `tactical:scenario:${name}`; + const data = await this.redisService.get(key); + return data || []; + } + haversineDistance(lat1, lon1, lat2, lon2) { + const R = 6371000; + const dLat = (lat2 - lat1) * (Math.PI / 180); + const dLon = (lon2 - lon1) * (Math.PI / 180); + const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + + Math.cos(lat1 * (Math.PI / 180)) * Math.cos(lat2 * (Math.PI / 180)) * + Math.sin(dLon / 2) * Math.sin(dLon / 2); + return R * 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); + } + calculateBearing(lat1, lon1, lat2, lon2) { + const phi1 = (lat1 * Math.PI) / 180; + const phi2 = (lat2 * Math.PI) / 180; + const deltaLambda = ((lon2 - lon1) * Math.PI) / 180; + const y = Math.sin(deltaLambda) * Math.cos(phi2); + const x = Math.cos(phi1) * Math.sin(phi2) - Math.sin(phi1) * Math.cos(phi2) * Math.cos(deltaLambda); + return (Math.atan2(y, x) * (180 / Math.PI) + 360) % 360; + } + estimateElevation(lat, lng) { + if (lng < 35.6 && lat < 32.2 && lat > 31.0) { + return -400 + Math.abs(lng - 35.5) * 3000; + } + if (lat >= 32.1 && lng < 36.0) { + return 850 + Math.sin(lat * 50) * 250 + Math.cos(lng * 40) * 150; + } + if (lat >= 31.8 && lat < 32.1 && lng >= 35.8 && lng < 36.2) { + return 900 + Math.sin((lat - 31.95) * 100) * 120 + Math.cos((lng - 35.9) * 100) * 100; + } + if (lat < 31.5 && lat > 30.0 && lng < 35.7) { + return 1100 + Math.sin(lat * 30) * 350; + } + return 650 + (lng - 36.0) * 30; + } +}; +exports.TacticalService = TacticalService; +exports.TacticalService = TacticalService = TacticalService_1 = __decorate([ + (0, common_1.Injectable)(), + __metadata("design:paramtypes", [redis_service_1.RedisService]) +], TacticalService); +//# sourceMappingURL=tactical.service.js.map \ No newline at end of file diff --git a/apps/api/dist/tactical/tactical.service.js.map b/apps/api/dist/tactical/tactical.service.js.map new file mode 100644 index 0000000..26a2cbc --- /dev/null +++ b/apps/api/dist/tactical/tactical.service.js.map @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AI,IAAI,GAAG,GAAG,IAAI,EAAE,CAAC;YAC9B,OAAO,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC;QACnE,CAAC;QACD,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,GAAG,IAAI,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,GAAG,IAAI,EAAE,CAAC;YAC3D,OAAO,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;QACxF,CAAC;QACD,IAAI,GAAG,GAAG,IAAI,IAAI,GAAG,GAAG,IAAI,IAAI,GAAG,GAAG,IAAI,EAAE,CAAC;YAC3C,OAAO,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC;QACzC,CAAC;QACD,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACjC,CAAC;CACF,CAAA;AAlPY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;qCAIgC,4BAAY;GAH5C,eAAe,CAkP3B"} \ No newline at end of file diff --git a/apps/api/dist/telemetry/external-telemetry.service.d.ts b/apps/api/dist/telemetry/external-telemetry.service.d.ts deleted file mode 100644 index 23f5aa4..0000000 --- a/apps/api/dist/telemetry/external-telemetry.service.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ConfigService } from '@nestjs/config'; -export declare class ExternalTelemetryService { - private configService; - private readonly logger; - private readonly baseUrl; - private readonly apiKey; - constructor(configService: ConfigService); - fetchCarTracks(days?: number): Promise; -} diff --git a/apps/api/dist/telemetry/external-telemetry.service.js b/apps/api/dist/telemetry/external-telemetry.service.js deleted file mode 100644 index d36a150..0000000 --- a/apps/api/dist/telemetry/external-telemetry.service.js +++ /dev/null @@ -1,69 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __metadata = (this && this.__metadata) || function (k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -var ExternalTelemetryService_1; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ExternalTelemetryService = void 0; -const common_1 = require("@nestjs/common"); -const config_1 = require("@nestjs/config"); -const axios_1 = __importDefault(require("axios")); -let ExternalTelemetryService = ExternalTelemetryService_1 = class ExternalTelemetryService { - configService; - logger = new common_1.Logger(ExternalTelemetryService_1.name); - baseUrl; - apiKey; - constructor(configService) { - this.configService = configService; - this.baseUrl = this.configService.get('LOCATION_SERVER_URL', ''); - this.apiKey = this.configService.get('LOCATION_SERVER_API_KEY', ''); - } - async fetchCarTracks(days = 1) { - if (!this.baseUrl || !this.apiKey) { - this.logger.error('LOCATION_SERVER_URL or API_KEY not configured in .env'); - return []; - } - try { - this.logger.log(`📡 Fetching car tracks from ${this.baseUrl} (Scanning: ${days} days)`); - const response = await axios_1.default.get(`${this.baseUrl}/intaleq/ride/location/getDrirversLocationsTrack.php`, { - params: { days }, - headers: { - 'X-API-KEY': this.apiKey, - }, - timeout: 30000, - }); - if (response.data && response.data.success && Array.isArray(response.data.data)) { - this.logger.log(`✅ Successfully fetched ${response.data.data.length} telemetry points.`); - return response.data.data; - } - else { - this.logger.warn('⚠️ Received invalid data structure from location server.'); - return []; - } - } - catch (error) { - if (error.response) { - this.logger.error(`❌ Failed to fetch car tracks. Server returned Status ${error.response.status}: ${JSON.stringify(error.response.data)}`); - } - else { - this.logger.error(`❌ Failed to fetch car tracks: ${error.message}`); - } - return []; - } - } -}; -exports.ExternalTelemetryService = ExternalTelemetryService; -exports.ExternalTelemetryService = ExternalTelemetryService = ExternalTelemetryService_1 = __decorate([ - (0, common_1.Injectable)(), - __metadata("design:paramtypes", [config_1.ConfigService]) -], ExternalTelemetryService); -//# sourceMappingURL=external-telemetry.service.js.map \ No newline at end of file diff --git a/apps/api/dist/telemetry/external-telemetry.service.js.map b/apps/api/dist/telemetry/external-telemetry.service.js.map deleted file mode 100644 index 2698fea..0000000 --- a/apps/api/dist/telemetry/external-telemetry.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"external-telemetry.service.js","sourceRoot":"","sources":["../../src/telemetry/external-telemetry.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,2CAA+C;AAC/C,kDAA0B;AASnB,IAAM,wBAAwB,gCAA9B,MAAM,wBAAwB;IAKf;IAJH,MAAM,GAAG,IAAI,eAAM,CAAC,0BAAwB,CAAC,IAAI,CAAC,CAAC;IACnD,OAAO,CAAS;IAChB,MAAM,CAAS;IAEhC,YAAoB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;QAC9C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,qBAAqB,EAAE,EAAE,CAAC,CAAC;QACzE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,yBAAyB,EAAE,EAAE,CAAC,CAAC;IAC9E,CAAC;IAMD,KAAK,CAAC,cAAc,CAAC,OAAe,CAAC;QACnC,IAA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CAAC;gBACN,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACtE,CAAC;YACD,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;CACF,CAAA;AA/CY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,mBAAU,GAAE;qCAMwB,sBAAa;GALrC,wBAAwB,CA+CpC"} \ No newline at end of file diff --git a/apps/api/dist/telemetry/map-refinement.controller.d.ts b/apps/api/dist/telemetry/map-refinement.controller.d.ts deleted file mode 100644 index 9243314..0000000 --- a/apps/api/dist/telemetry/map-refinement.controller.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { TelemetryAnalyzerService } from './telemetry-analyzer.service'; -export declare class MapRefinementController { - private readonly analyzerService; - constructor(analyzerService: TelemetryAnalyzerService); - getSummary(): Promise<{ - telemetry: { - total: any; - }; - roads: { - analyzed: any; - closed: any; - }; - candidates: { - total: any; - pending: any; - }; - }>; - syncExternal(): Promise; - refreshCache(): Promise<{ - cachedCount: any; - }>; - analyzeRoadSpeeds(hours?: number): Promise; - discoverNewRoads(hours?: number): Promise; - getCandidates(status?: string): Promise; - discoverClosures(hours?: number): Promise<{ - roadsClosed: any; - }>; - getClosures(): Promise; - getCongestionData(north: number, south: number, east: number, west: number): Promise; - approveCandidate(id: string): Promise<{ - success: boolean; - id: string; - status: string; - }>; - rejectCandidate(id: string): Promise<{ - success: boolean; - id: string; - status: string; - }>; -} diff --git a/apps/api/dist/telemetry/map-refinement.controller.js b/apps/api/dist/telemetry/map-refinement.controller.js deleted file mode 100644 index f0e4eb4..0000000 --- a/apps/api/dist/telemetry/map-refinement.controller.js +++ /dev/null @@ -1,171 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __metadata = (this && this.__metadata) || function (k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); -}; -var __param = (this && this.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MapRefinementController = void 0; -const common_1 = require("@nestjs/common"); -const swagger_1 = require("@nestjs/swagger"); -const telemetry_analyzer_service_1 = require("./telemetry-analyzer.service"); -const api_key_guard_1 = require("../common/guards/api-key.guard"); -let MapRefinementController = class MapRefinementController { - analyzerService; - constructor(analyzerService) { - this.analyzerService = analyzerService; - } - async getSummary() { - return this.analyzerService.getAnalysisSummary(); - } - async syncExternal() { - return this.analyzerService.syncExternalData(); - } - async refreshCache() { - return this.analyzerService.refreshTrafficCache(); - } - async analyzeRoadSpeeds(hours) { - const sinceHours = hours ? Number(hours) : 24; - return this.analyzerService.analyzeRoadSpeeds(sinceHours); - } - async discoverNewRoads(hours) { - const sinceHours = hours ? Number(hours) : 168; - return this.analyzerService.discoverNewRoads(sinceHours); - } - async getCandidates(status) { - return this.analyzerService.getCandidates(status || 'pending'); - } - async discoverClosures(hours) { - return this.analyzerService.discoverRoadClosures(hours || 48); - } - async getClosures() { - return this.analyzerService.getClosures(); - } - async getCongestionData(north, south, east, west) { - if (!north || !south || !east || !west) { - throw new common_1.HttpException('Bounds required: north, south, east, west / يجب تحديد الحدود الجغرافية', common_1.HttpStatus.BAD_REQUEST); - } - return this.analyzerService.getCongestionData({ - north: Number(north), - south: Number(south), - east: Number(east), - west: Number(west), - }); - } - async approveCandidate(id) { - return this.analyzerService.updateCandidateStatus(id, 'approved'); - } - async rejectCandidate(id) { - return this.analyzerService.updateCandidateStatus(id, 'rejected'); - } -}; -exports.MapRefinementController = MapRefinementController; -__decorate([ - (0, common_1.Get)('summary'), - (0, swagger_1.ApiOperation)({ summary: 'Get analysis summary 📊 / ملخص التحليل' }), - __metadata("design:type", Function), - __metadata("design:paramtypes", []), - __metadata("design:returntype", Promise) -], MapRefinementController.prototype, "getSummary", null); -__decorate([ - (0, common_1.Post)('sync-external'), - (0, swagger_1.ApiOperation)({ summary: 'Sync telemetry from external server 📡 / مزامنة البيانات الخارجية' }), - __metadata("design:type", Function), - __metadata("design:paramtypes", []), - __metadata("design:returntype", Promise) -], MapRefinementController.prototype, "syncExternal", null); -__decorate([ - (0, common_1.Post)('refresh-cache'), - (0, swagger_1.ApiOperation)({ summary: 'Refresh Redis traffic snapshot 🚀 / تحديث ذاكرة التخزين' }), - __metadata("design:type", Function), - __metadata("design:paramtypes", []), - __metadata("design:returntype", Promise) -], MapRefinementController.prototype, "refreshCache", null); -__decorate([ - (0, common_1.Post)('analyze-speeds'), - (0, swagger_1.ApiOperation)({ summary: 'Run road speed analysis 🚗 / تشغيل تحليل سرعات الطرق' }), - (0, swagger_1.ApiQuery)({ name: 'hours', required: false, description: 'Hours to look back (default: 24)' }), - __param(0, (0, common_1.Query)('hours')), - __metadata("design:type", Function), - __metadata("design:paramtypes", [Number]), - __metadata("design:returntype", Promise) -], MapRefinementController.prototype, "analyzeRoadSpeeds", null); -__decorate([ - (0, common_1.Post)('discover-roads'), - (0, swagger_1.ApiOperation)({ summary: 'Discover new roads from telemetry 🛣️ / اكتشاف طرق جديدة' }), - (0, swagger_1.ApiQuery)({ name: 'hours', required: false, description: 'Hours to look back (default: 168 = 1 week)' }), - __param(0, (0, common_1.Query)('hours')), - __metadata("design:type", Function), - __metadata("design:paramtypes", [Number]), - __metadata("design:returntype", Promise) -], MapRefinementController.prototype, "discoverNewRoads", null); -__decorate([ - (0, common_1.Get)('candidates'), - (0, swagger_1.ApiOperation)({ summary: 'Get list of candidate roads / جلب الطرق المرشحة' }), - (0, swagger_1.ApiQuery)({ name: 'status', required: false, enum: ['pending', 'approved', 'rejected'] }), - __param(0, (0, common_1.Query)('status')), - __metadata("design:type", Function), - __metadata("design:paramtypes", [String]), - __metadata("design:returntype", Promise) -], MapRefinementController.prototype, "getCandidates", null); -__decorate([ - (0, common_1.Post)('discover-closures'), - (0, swagger_1.ApiOperation)({ summary: 'Run road closure detection 🚧 / تشغيل كشف الإغلاقات' }), - (0, swagger_1.ApiQuery)({ name: 'hours', required: false, description: 'Hours to look back (default: 48)' }), - __param(0, (0, common_1.Query)('hours')), - __metadata("design:type", Function), - __metadata("design:paramtypes", [Number]), - __metadata("design:returntype", Promise) -], MapRefinementController.prototype, "discoverClosures", null); -__decorate([ - (0, common_1.Get)('closures'), - (0, swagger_1.ApiOperation)({ summary: 'Get currently detected closures / جلب الإغلاقات المكتشفة' }), - __metadata("design:type", Function), - __metadata("design:paramtypes", []), - __metadata("design:returntype", Promise) -], MapRefinementController.prototype, "getClosures", null); -__decorate([ - (0, common_1.Get)('congestion'), - (0, swagger_1.ApiOperation)({ summary: 'Get congestion data for heatmap 🗺️ / بيانات الازدحام' }), - (0, swagger_1.ApiQuery)({ name: 'north', required: true }), - (0, swagger_1.ApiQuery)({ name: 'south', required: true }), - (0, swagger_1.ApiQuery)({ name: 'east', required: true }), - (0, swagger_1.ApiQuery)({ name: 'west', required: true }), - __param(0, (0, common_1.Query)('north')), - __param(1, (0, common_1.Query)('south')), - __param(2, (0, common_1.Query)('east')), - __param(3, (0, common_1.Query)('west')), - __metadata("design:type", Function), - __metadata("design:paramtypes", [Number, Number, Number, Number]), - __metadata("design:returntype", Promise) -], MapRefinementController.prototype, "getCongestionData", null); -__decorate([ - (0, common_1.Patch)('candidates/:id/approve'), - (0, swagger_1.ApiOperation)({ summary: 'Approve a candidate road ✅ / الموافقة على طريق مرشح' }), - __param(0, (0, common_1.Param)('id')), - __metadata("design:type", Function), - __metadata("design:paramtypes", [String]), - __metadata("design:returntype", Promise) -], MapRefinementController.prototype, "approveCandidate", null); -__decorate([ - (0, common_1.Patch)('candidates/:id/reject'), - (0, swagger_1.ApiOperation)({ summary: 'Reject a candidate road ❌ / رفض طريق مرشح' }), - __param(0, (0, common_1.Param)('id')), - __metadata("design:type", Function), - __metadata("design:paramtypes", [String]), - __metadata("design:returntype", Promise) -], MapRefinementController.prototype, "rejectCandidate", null); -exports.MapRefinementController = MapRefinementController = __decorate([ - (0, swagger_1.ApiTags)('map-refinement'), - (0, common_1.Controller)('map-refinement'), - (0, common_1.UseGuards)(api_key_guard_1.ApiKeyGuard), - __metadata("design:paramtypes", [telemetry_analyzer_service_1.TelemetryAnalyzerService]) -], MapRefinementController); -//# sourceMappingURL=map-refinement.controller.js.map \ No newline at end of file diff --git a/apps/api/dist/telemetry/map-refinement.controller.js.map b/apps/api/dist/telemetry/map-refinement.controller.js.map deleted file mode 100644 index 823ca45..0000000 --- a/apps/api/dist/telemetry/map-refinement.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"map-refinement.controller.js","sourceRoot":"","sources":["../../src/telemetry/map-refinement.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAwH;AACxH,6CAAkE;AAClE,6EAAwE;AACxE,kEAA6D;AActD,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IACL;IAA7B,YAA6B,eAAyC;QAAzC,oBAAe,GAAf,eAAe,CAA0B;IAAG,CAAC;IAQpE,AAAN,KAAK,CAAC,UAAU;QACd,OAAO,IAAI,CAAC,eAAe,CAAC,kBAAkB,EAAE,CAAC;IACnD,CAAC;IAQK,AAAN,KAAK,CAAC,YAAY;QAChB,OAAO,IAAI,CAAC,eAAe,CAAC,gBAAgB,EAAE,CAAC;IACjD,CAAC;IAIK,AAAN,KAAK,CAAC,YAAY;QAChB,OAAO,IAAI,CAAC,eAAe,CAAC,mBAAmB,EAAE,CAAC;IACpD,CAAC;IAUK,AAAN,KAAK,CAAC,iBAAiB,CAAiB,KAAc;QACpD,MAAM,UAAU,GAAG,KAAK,CAA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ACd,WAAA,IAAA,cAAK,EAAC,OAAO,CAAC,CAAA;IACd,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;IACb,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;;;;gEAcf;AAQK;IAFL,IAAA,cAAK,EAAC,wBAAwB,CAAC;IAC/B,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,qDAAqD,EAAE,CAAC;IACzD,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;+DAElC;AAIK;IAFL,IAAA,cAAK,EAAC,uBAAuB,CAAC;IAC9B,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,2CAA2C,EAAE,CAAC;IAChD,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;8DAEjC;kCA1HU,uBAAuB;IAHnC,IAAA,iBAAO,EAAC,gBAAgB,CAAC;IACzB,IAAA,mBAAU,EAAC,gBAAgB,CAAC;IAC5B,IAAA,kBAAS,EAAC,2BAAW,CAAC;qCAEyB,qDAAwB;GAD3D,uBAAuB,CA2HnC"} \ No newline at end of file diff --git a/apps/api/dist/telemetry/telemetry-analyzer.service.d.ts b/apps/api/dist/telemetry/telemetry-analyzer.service.d.ts deleted file mode 100644 index 44d4f18..0000000 --- a/apps/api/dist/telemetry/telemetry-analyzer.service.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { Repository, DataSource } from 'typeorm'; -import { TelemetryLog } from './telemetry.entity'; -import { RoadSegmentStat } from '../maps/road-stat.entity'; -import { CandidateRoad } from '../maps/candidate-road.entity'; -import { ExternalTelemetryService } from './external-telemetry.service'; -import { RedisService } from '../common/redis.service'; -import { TelegramService } from '../common/telegram.service'; -import { TrafficGridService } from '../maps/traffic-grid.service'; -export declare class TelemetryAnalyzerService { - private telemetryRepo; - private roadStatRepo; - private candidateRoadRepo; - private externalTelemetry; - private redisService; - private telegramService; - private trafficGrid; - private dataSource; - private readonly logger; - private readonly TRAFFIC_CACHE_KEY; - constructor(telemetryRepo: Repository, roadStatRepo: Repository, candidateRoadRepo: Repository, externalTelemetry: ExternalTelemetryService, redisService: RedisService, telegramService: TelegramService, trafficGrid: TrafficGridService, dataSource: DataSource); - runDeepIntelligence(hours?: number): Promise<{ - success: boolean; - timestamp: string; - speedAnalysis: any; - temporalAnalysis: any; - roadDiscovery: any; - }>; - handleDeepIntelligence(): void; - syncExternalData(days?: number): Promise; - refreshTrafficCache(): Promise<{ - cachedCount: any; - }>; - analyzeRoadSpeeds(sinceHours?: number): Promise; - analyzeTimeProfiles(sinceHours?: number): Promise; - discoverNewRoads(sinceHours?: number): Promise; - getCongestionData(bounds: any): Promise; - getAnalysisSummary(): Promise<{ - telemetry: { - total: any; - }; - roads: { - analyzed: any; - closed: any; - }; - candidates: { - total: any; - pending: any; - }; - }>; - getCandidates(status?: string, limit?: number): Promise; - updateCandidateStatus(id: string, status: string): Promise<{ - success: boolean; - id: string; - status: string; - }>; - discoverRoadClosures(sinceHours?: number): Promise<{ - roadsClosed: any; - }>; - getClosures(): Promise; - private calculateConfidence; -} diff --git a/apps/api/dist/telemetry/telemetry-analyzer.service.js b/apps/api/dist/telemetry/telemetry-analyzer.service.js deleted file mode 100644 index cc91f48..0000000 --- a/apps/api/dist/telemetry/telemetry-analyzer.service.js +++ /dev/null @@ -1,419 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __metadata = (this && this.__metadata) || function (k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); -}; -var __param = (this && this.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var TelemetryAnalyzerService_1; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.TelemetryAnalyzerService = void 0; -const common_1 = require("@nestjs/common"); -const schedule_1 = require("@nestjs/schedule"); -const typeorm_1 = require("@nestjs/typeorm"); -const typeorm_2 = require("typeorm"); -const telemetry_entity_1 = require("./telemetry.entity"); -const road_stat_entity_1 = require("../maps/road-stat.entity"); -const candidate_road_entity_1 = require("../maps/candidate-road.entity"); -const external_telemetry_service_1 = require("./external-telemetry.service"); -const redis_service_1 = require("../common/redis.service"); -const telegram_service_1 = require("../common/telegram.service"); -const traffic_grid_service_1 = require("../maps/traffic-grid.service"); -let TelemetryAnalyzerService = TelemetryAnalyzerService_1 = class TelemetryAnalyzerService { - telemetryRepo; - roadStatRepo; - candidateRoadRepo; - externalTelemetry; - redisService; - telegramService; - trafficGrid; - dataSource; - logger = new common_1.Logger(TelemetryAnalyzerService_1.name); - TRAFFIC_CACHE_KEY = 'live_traffic_congested'; - constructor(telemetryRepo, roadStatRepo, candidateRoadRepo, externalTelemetry, redisService, telegramService, trafficGrid, dataSource) { - this.telemetryRepo = telemetryRepo; - this.roadStatRepo = roadStatRepo; - this.candidateRoadRepo = candidateRoadRepo; - this.externalTelemetry = externalTelemetry; - this.redisService = redisService; - this.telegramService = telegramService; - this.trafficGrid = trafficGrid; - this.dataSource = dataSource; - } - async runDeepIntelligence(hours = 48) { - this.logger.log(`🚀 Starting Full Intelligence Pipeline (Window: ${hours}h)...`); - await this.syncExternalData(Math.ceil(hours / 24)); - const speedResult = await this.analyzeRoadSpeeds(hours); - const temporalResult = await this.analyzeTimeProfiles(hours); - const discoveryResult = await this.discoverNewRoads(hours); - await this.refreshTrafficCache(); - await this.trafficGrid.refreshGrid(); - const summary = await this.getAnalysisSummary(); - await this.telegramService.sendIntelligenceReport({ - syncResult: speedResult.totalPointsProcessed || 0, - updatedSegments: speedResult.segmentsUpdated || 0, - discoveredRoads: discoveryResult.candidatesFound || 0, - timeProfiles: temporalResult.bucketsUpdated || 0, - totalPoints: summary.telemetry.total, - days: Math.ceil(hours / 24), - }); - this.logger.log('🏁 Intelligence Pipeline Finished Successfully.'); - return { - success: true, - timestamp: new Date().toISOString(), - speedAnalysis: speedResult, - temporalAnalysis: temporalResult, - roadDiscovery: discoveryResult, - }; - } - handleDeepIntelligence() { - this.runDeepIntelligence(240); - } - async syncExternalData(days = 7) { - this.logger.log(`📡 Starting batch sync (Window: ${days} days)...`); - try { - const tracks = await this.externalTelemetry.fetchCarTracks(days); - if (tracks.length === 0) - return; - this.logger.log(`📥 Saving ${tracks.length} points to database...`); - const values = tracks - .filter(t => t.driver_id && t.longitude && t.latitude) - .map(t => `('${t.driver_id}', ST_SetSRID(ST_Point(${t.longitude}, ${t.latitude}), 4326), ${t.latitude}, ${t.longitude}, ${t.speed || 0}, ${t.heading || 0}, '${t.created_at}')`).join(','); - await this.dataSource.query(` - INSERT INTO telemetry_logs ("driverId", location, latitude, longitude, speed, heading, timestamp) - VALUES ${values} - ON CONFLICT DO NOTHING - `); - this.logger.log(`✅ Batch sync complete.`); - } - catch (error) { - this.logger.error(`❌ Sync failed: ${error.message}`); - throw error; - } - } - async refreshTrafficCache() { - this.logger.log('🚀 Refreshing Redis traffic snapshot (v2.5.2 Optimized)...'); - const congested = await this.roadStatRepo.query(` - SELECT "segmentId", "congestionFactor", ST_AsGeoJSON(geometry, 5) as geojson - FROM road_segment_stats - WHERE "congestionFactor" > 1.1 - ORDER BY "congestionFactor" DESC - LIMIT 2000 - `); - if (congested.length === 0) { - await this.redisService.del(this.TRAFFIC_CACHE_KEY); - return { cachedCount: 0 }; - } - const snapshot = congested.map(row => ({ - sid: row.segmentId, - cf: parseFloat(row.congestionFactor), - geo: JSON.parse(row.geojson) - })); - const sampleSize = Math.min(congested.length, 3); - const topSegments = congested.slice(0, sampleSize).map(s => `${s.segmentId} (F: ${s.congestionFactor})`).join(', '); - const totalSizeKB = Math.round(JSON.stringify(snapshot).length / 1024); - this.logger.log(`📊 Traffic Snapshot Sample (Top ${sampleSize}): ${topSegments}`); - this.logger.log(`📦 Redis Payload Size: ~${totalSizeKB} KB`); - await this.redisService.set(this.TRAFFIC_CACHE_KEY, snapshot); - this.logger.log(`✅ Redis traffic snapshot updated with ${congested.length} segments.`); - return { cachedCount: congested.length }; - } - async analyzeRoadSpeeds(sinceHours = 24) { - this.logger.log(`🔍 Starting road speed analysis v2.5 for last ${sinceHours}h...`); - const query = ` - WITH grid_points AS ( - -- Group by 5m grid cell first to reduce spatial join volume (v2.5.1 WoW Performance) - SELECT ST_SnapToGrid(ST_Transform(location::geometry, 3857), 5) AS loc, - AVG(speed) as speed - FROM telemetry_logs - WHERE timestamp >= NOW() - INTERVAL '${sinceHours} hours' AND speed > 2 - GROUP BY loc - ), - matches AS ( - -- Bulk Spatial Join (20m radius) with GIST optimization - SELECT l.osm_id::text as id, l.name, l.highway, g.speed, l.way - FROM grid_points g - INNER JOIN planet_osm_line l ON - l.highway IS NOT NULL AND - l.way && ST_Expand(g.loc, 20) AND - ST_DWithin(l.way, g.loc, 20) - ), - stats AS ( - -- Calculate median speed and aggregate samples - SELECT id, name, highway, - PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY speed) as avg_speed, - COUNT(*) as samples, - ST_Transform(MIN(way), 4326) as way4326 - FROM matches - GROUP BY id, name, highway - HAVING COUNT(*) >= 3 - ) - INSERT INTO road_segment_stats ("segmentId", "averageSpeed", "sampleCount", "lastUpdated", geometry, "congestionFactor") - SELECT id, avg_speed, samples, NOW(), way4326, - CASE WHEN highway IN ('primary','secondary','trunk','motorway') AND avg_speed < 30 - THEN 30/GREATEST(avg_speed,1) ELSE 1.0 END - FROM stats - ON CONFLICT ("segmentId") DO UPDATE SET - "averageSpeed"=EXCLUDED."averageSpeed", - "sampleCount"=EXCLUDED."sampleCount", - "lastUpdated"=NOW(), - "geometry"=EXCLUDED."geometry", - "congestionFactor"=EXCLUDED."congestionFactor" - RETURNING "segmentId"; - `; - const result = await this.dataSource.query(query); - return { segmentsUpdated: result.length }; - } - async analyzeTimeProfiles(sinceHours = 720) { - this.logger.log(`🕒 Starting temporal profiling (Phase 2) for last ${sinceHours}h...`); - const query = ` - WITH grid_points AS ( - -- Bucket by 10m grid and Time (Hour + DOW) - SELECT - ST_SnapToGrid(ST_Transform(location::geometry, 3857), 10) AS loc, - EXTRACT(HOUR FROM timestamp)::int as hr, - EXTRACT(DOW FROM timestamp)::int as dow, - AVG(speed) as speed - FROM telemetry_logs - WHERE timestamp >= NOW() - INTERVAL '${sinceHours} hours' AND speed > 2 - GROUP BY loc, hr, dow - ), - matches AS ( - -- Map to OSM segments - SELECT l.osm_id::text as sid, g.hr, g.dow, g.speed - FROM grid_points g - INNER JOIN planet_osm_line l ON - l.highway IS NOT NULL AND - l.way && ST_Expand(g.loc, 20) AND - ST_DWithin(l.way, g.loc, 20) - ), - temporal_stats AS ( - -- Aggregate by segment + time bucket - SELECT sid, hr, dow, - PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY speed) as avg_spd, - COUNT(*) as smp - FROM matches - GROUP BY sid, hr, dow - HAVING COUNT(*) >= 2 -- Require minimum samples per bucket - ) - INSERT INTO road_speed_profiles ("segmentId", "hourOfDay", "dayOfWeek", "averageSpeed", "sampleCount", "lastUpdated") - SELECT sid, hr, dow, avg_spd, smp, NOW() - FROM temporal_stats - ON CONFLICT ("segmentId", "hourOfDay", "dayOfWeek") DO UPDATE SET - "averageSpeed" = EXCLUDED."averageSpeed", - "sampleCount" = EXCLUDED."sampleCount", - "lastUpdated" = NOW() - RETURNING "segmentId"; - `; - const result = await this.dataSource.query(query); - this.logger.log(`📊 Time-aware profiling complete: ${result.length} buckets updated.`); - return { bucketsUpdated: result.length }; - } - async discoverNewRoads(sinceHours = 168) { - this.logger.log(`🛣️ Starting road discovery v2.5 for last ${sinceHours}h...`); - const query = ` - WITH grid_points AS ( - -- Group by cell and driver to reduce volume for clustering and anti-join (v2.5.1 WoW Performance) - SELECT "driverId", ST_SnapToGrid(ST_Transform(location::geometry, 3857), 10) as loc, - AVG(speed) as speed, - MIN(timestamp) as timestamp - FROM telemetry_logs - WHERE timestamp >= NOW() - INTERVAL '${sinceHours} hours' AND speed > 5 - GROUP BY loc, "driverId" - ), - off_road AS ( - -- Spatial Anti-Join: Only points further than 35m from any existing highway - SELECT g.* FROM grid_points g - LEFT JOIN planet_osm_line l ON - l.highway IS NOT NULL AND - l.way && ST_Expand(g.loc, 35) AND - ST_DWithin(l.way, g.loc, 35) - WHERE l.osm_id IS NULL - ), - clustered AS ( - -- Density-based clustering to find linear paths - SELECT *, ST_ClusterDBSCAN(loc, eps := 30, minpoints := 3) OVER () as cid FROM off_road - ), - cluster_stats AS ( - -- 1. Calculate cluster-wide quality metrics - SELECT cid, - COUNT(DISTINCT "driverId") as drv_count, - COUNT(*) as pt_count, - AVG(speed) as avg_spd - FROM clustered - WHERE cid IS NOT NULL - GROUP BY cid - HAVING COUNT(DISTINCT "driverId") >= 3 AND COUNT(*) >= 15 - ), - cluster_path AS ( - -- 2. Extract unique grid cells per cluster in chronological order - SELECT cid, loc, MIN(timestamp) as ts - FROM clustered - WHERE cid IN (SELECT cid FROM cluster_stats) - GROUP BY cid, loc - ), - final_candidates AS ( - -- 3. Build geometry and calculate final scoring - SELECT - s.cid, - ST_Transform(ST_MakeLine(p.loc ORDER BY p.ts), 4326) as geom, - s.drv_count, - s.pt_count, - s.avg_spd, - ST_Length(ST_Transform(ST_MakeLine(p.loc ORDER BY p.ts), 4326)::geography) as len - FROM cluster_stats s - JOIN cluster_path p ON s.cid = p.cid - GROUP BY s.cid, s.drv_count, s.pt_count, s.avg_spd - ), - oneway_detect AS ( - -- 4. Detect one-way direction from telemetry heading data - SELECT - fc.cid, - DEGREES(ST_Azimuth( - ST_StartPoint(fc.geom::geometry), - ST_EndPoint(fc.geom::geometry) - )) AS geom_bearing, - AVG(tl.heading) AS avg_heading, - COUNT(*) AS heading_samples - FROM final_candidates fc - JOIN telemetry_logs tl ON ST_DWithin( - tl.location::geometry, - fc.geom::geometry, - 30 - ) - WHERE tl.speed > 3 - GROUP BY fc.cid, fc.geom - HAVING COUNT(*) >= 5 - ), - oneway_scored AS ( - SELECT - od.cid, - CASE - WHEN LEAST(ABS(od.avg_heading - od.geom_bearing), 360 - ABS(od.avg_heading - od.geom_bearing)) < 45 - AND od.heading_samples >= 10 THEN 1 - WHEN LEAST(ABS(od.avg_heading - (od.geom_bearing + 180) % 360), 360 - ABS(od.avg_heading - (od.geom_bearing + 180) % 360)) < 45 - AND od.heading_samples >= 10 THEN -1 - ELSE 0 - END AS oneway_val - FROM oneway_detect od - ) - INSERT INTO candidate_roads (geometry, "uniqueDriverCount", "totalPoints", "averageSpeed", "lengthMeters", confidence, status, oneway) - SELECT fc.geom, fc.drv_count, fc.pt_count, fc.avg_spd, fc.len, - ROUND(( - LEAST(fc.drv_count::float / 5, 1.0) * 0.4 + - LEAST(fc.pt_count::float / 50, 1.0) * 0.3 + - CASE WHEN fc.len BETWEEN 50 AND 2000 THEN 0.3 ELSE 0.1 END - )::numeric, 2) as conf, - 'pending', - COALESCE(os.oneway_val, 0) - FROM final_candidates fc - LEFT JOIN oneway_scored os ON os.cid = fc.cid - RETURNING id; - `; - const result = await this.dataSource.query(query); - return { candidatesFound: result.length }; - } - async getCongestionData(bounds) { - return this.dataSource.query(` - SELECT rs."segmentId", rs."averageSpeed", rs."congestionFactor", rs."sampleCount", ST_AsGeoJSON(rs.geometry) as geojson - FROM road_segment_stats rs - WHERE rs.geometry IS NOT NULL AND ST_Intersects(rs.geometry::geometry, ST_MakeEnvelope($1, $2, $3, $4, 4326)) - ORDER BY rs."congestionFactor" DESC - `, [bounds.west, bounds.south, bounds.east, bounds.north]); - } - async getAnalysisSummary() { - const [tCount] = await this.dataSource.query('SELECT COUNT(*) as count FROM telemetry_logs'); - const [rCount] = await this.dataSource.query('SELECT COUNT(*) as count FROM road_segment_stats'); - const [cCount] = await this.dataSource.query('SELECT COUNT(*) as count, COUNT(*) FILTER (WHERE status=\'pending\') as p FROM candidate_roads'); - const [clCount] = await this.dataSource.query('SELECT COUNT(*) as count FROM road_segment_stats WHERE "isClosed" = true'); - return { - telemetry: { total: tCount.count }, - roads: { analyzed: rCount.count, closed: clCount.count }, - candidates: { total: cCount.count, pending: cCount.p } - }; - } - async getCandidates(status = 'pending', limit = 50) { - return this.candidateRoadRepo.find({ - where: { status }, - order: { confidence: 'DESC' }, - take: limit - }); - } - async updateCandidateStatus(id, status) { - await this.candidateRoadRepo.update(id, { - status, - reviewedAt: new Date() - }); - return { success: true, id, status }; - } - async discoverRoadClosures(sinceHours = 48) { - this.logger.log(`🚧 Analyzing road closures for last ${sinceHours}h...`); - await this.roadStatRepo.update({ isClosed: true }, { isClosed: false }); - const query = ` - WITH active_area AS ( - -- Bounding box of some recent activity to prove drivers are on the map - SELECT ST_Expand(ST_Extent(location::geometry), 0.01) as bbox - FROM telemetry_logs - WHERE timestamp >= NOW() - INTERVAL '${sinceHours} hours' - ), - possible_closures AS ( - SELECT rs."segmentId" - FROM road_segment_stats rs - WHERE rs."sampleCount" > 50 - AND rs.geometry && (SELECT bbox FROM active_area) - AND NOT EXISTS ( - SELECT 1 FROM telemetry_logs t - WHERE t.timestamp >= NOW() - INTERVAL '${sinceHours} hours' - AND ST_DWithin(rs.geometry::geometry, t.location::geometry, 35) - ) - ) - UPDATE road_segment_stats - SET "isClosed" = true - WHERE "segmentId" IN (SELECT "segmentId" FROM possible_closures) - RETURNING "segmentId"; - `; - const result = await this.dataSource.query(query); - this.logger.log(`✅ Road closure detection complete: ${result.length} roads flagged as closed.`); - return { roadsClosed: result.length }; - } - async getClosures() { - return this.roadStatRepo.find({ - where: { isClosed: true }, - order: { sampleCount: 'DESC' } - }); - } - calculateConfidence(drivers, points, len) { - const dScore = Math.min(drivers / 5, 1.0) * 0.4; - const pScore = Math.min(points / 50, 1.0) * 0.3; - const lScore = (len >= 50 && len <= 2000) ? 0.3 : 0.1; - return Math.round((dScore + pScore + lScore) * 100) / 100; - } -}; -exports.TelemetryAnalyzerService = TelemetryAnalyzerService; -__decorate([ - (0, schedule_1.Cron)('0 4 */10 * *'), - __metadata("design:type", Function), - __metadata("design:paramtypes", []), - __metadata("design:returntype", void 0) -], TelemetryAnalyzerService.prototype, "handleDeepIntelligence", null); -exports.TelemetryAnalyzerService = TelemetryAnalyzerService = TelemetryAnalyzerService_1 = __decorate([ - (0, common_1.Injectable)(), - __param(0, (0, typeorm_1.InjectRepository)(telemetry_entity_1.TelemetryLog)), - __param(1, (0, typeorm_1.InjectRepository)(road_stat_entity_1.RoadSegmentStat)), - __param(2, (0, typeorm_1.InjectRepository)(candidate_road_entity_1.CandidateRoad)), - __metadata("design:paramtypes", [typeorm_2.Repository, - typeorm_2.Repository, - typeorm_2.Repository, - external_telemetry_service_1.ExternalTelemetryService, - redis_service_1.RedisService, - telegram_service_1.TelegramService, - traffic_grid_service_1.TrafficGridService, - typeorm_2.DataSource]) -], TelemetryAnalyzerService); -//# sourceMappingURL=telemetry-analyzer.service.js.map \ No newline at end of file diff --git a/apps/api/dist/telemetry/telemetry-analyzer.service.js.map b/apps/api/dist/telemetry/telemetry-analyzer.service.js.map deleted file mode 100644 index d630020..0000000 --- a/apps/api/dist/telemetry/telemetry-analyzer.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"telemetry-analyzer.service.js","sourceRoot":"","sources":["../../src/telemetry/telemetry-analyzer.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,+CAAwC;AACxC,6CAAmD;AACnD,qCAAiD;AACjD,yDAAkD;AAClD,+DAA2D;AAC3D,yEAA8D;AAC9D,6EAAwE;AACxE,2DAAuD;AACvD,iEAA6D;AAC7D,uEAAkE;AAG3D,IAAM,wBAAwB,gCAA9B,MAAM,wBAAwB;IAMzB;IAEA;IAEA;IACA;IACA;IACA;IACA;IACA;IAdO,MAAM,GAAG,IAAI,eAAM,CAAC,0BAAw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,EAAC,kCAAe,CAAC,CAAA;IAEjC,WAAA,IAAA,0BAAgB,EAAC,qCAAa,CAAC,CAAA;qCAHT,oBAAU;QAEX,oBAAU;QAEL,oBAAU;QACV,qDAAwB;QAC7B,4BAAY;QACT,kCAAe;QACnB,yCAAkB;QACnB,oBAAU;GAfrB,wBAAwB,CAiYpC"} \ No newline at end of file diff --git a/apps/api/dist/telemetry/telemetry.controller.d.ts b/apps/api/dist/telemetry/telemetry.controller.d.ts deleted file mode 100644 index 090e525..0000000 --- a/apps/api/dist/telemetry/telemetry.controller.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { TelemetryService, type DriverTelemetryDto } from './telemetry.service'; -import { TelemetryAnalyzerService } from './telemetry-analyzer.service'; -export declare class TelemetryController { - private readonly telemetryService; - private readonly analyzerService; - constructor(telemetryService: TelemetryService, analyzerService: TelemetryAnalyzerService); - ingest(data: DriverTelemetryDto): Promise<{ - success: boolean; - timestamp: Date; - }>; - sync(): Promise; - analyze(hours?: number): Promise<{ - success: boolean; - roadAnalysis: any; - roadDiscovery: any; - }>; - processIntelligence(hours?: string, days?: string): Promise<{ - success: boolean; - message: string; - timestamp: Date; - window: { - days: number; - hours: number; - }; - }>; - getSummary(): Promise<{ - telemetry: { - total: any; - }; - roads: { - analyzed: any; - closed: any; - }; - candidates: { - total: any; - pending: any; - }; - }>; - getNearby(lat: number, lng: number, radius: number): Promise; -} diff --git a/apps/api/dist/telemetry/telemetry.controller.js b/apps/api/dist/telemetry/telemetry.controller.js deleted file mode 100644 index 0b4595e..0000000 --- a/apps/api/dist/telemetry/telemetry.controller.js +++ /dev/null @@ -1,118 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __metadata = (this && this.__metadata) || function (k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); -}; -var __param = (this && this.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.TelemetryController = void 0; -const telemetry_service_1 = require("./telemetry.service"); -const telemetry_analyzer_service_1 = require("./telemetry-analyzer.service"); -const api_key_guard_1 = require("../common/guards/api-key.guard"); -const common_1 = require("@nestjs/common"); -const swagger_1 = require("@nestjs/swagger"); -let TelemetryController = class TelemetryController { - telemetryService; - analyzerService; - constructor(telemetryService, analyzerService) { - this.telemetryService = telemetryService; - this.analyzerService = analyzerService; - } - async ingest(data) { - return this.telemetryService.ingest(data); - } - async sync() { - return this.analyzerService.syncExternalData(); - } - async analyze(hours) { - const roadResults = await this.analyzerService.analyzeRoadSpeeds(hours || 24); - const discoveryResults = await this.analyzerService.discoverNewRoads(hours || 168); - return { - success: true, - roadAnalysis: roadResults, - roadDiscovery: discoveryResults, - }; - } - async processIntelligence(hours, days) { - const parsedDays = days ? parseInt(days, 10) : 1; - const parsedHours = hours ? parseInt(hours, 10) : (parsedDays * 24); - this.analyzerService.runDeepIntelligence(parsedHours); - return { - success: true, - message: `Intelligence sync and analysis started for the last ${parsedDays} days. You will receive a summary on Telegram once complete! 🚀`, - timestamp: new Date(), - window: { days: parsedDays, hours: parsedHours }, - }; - } - async getSummary() { - return this.analyzerService.getAnalysisSummary(); - } - async getNearby(lat, lng, radius) { - return this.telemetryService.getRecentDrivers(Number(lat), Number(lng), Number(radius)); - } -}; -exports.TelemetryController = TelemetryController; -__decorate([ - (0, common_1.Post)(), - (0, swagger_1.ApiOperation)({ summary: 'Ingest driver telemetry 📡' }), - __param(0, (0, common_1.Body)()), - __metadata("design:type", Function), - __metadata("design:paramtypes", [Object]), - __metadata("design:returntype", Promise) -], TelemetryController.prototype, "ingest", null); -__decorate([ - (0, common_1.Post)('sync'), - (0, swagger_1.ApiOperation)({ summary: 'Sync data from external server 📡' }), - __metadata("design:type", Function), - __metadata("design:paramtypes", []), - __metadata("design:returntype", Promise) -], TelemetryController.prototype, "sync", null); -__decorate([ - (0, common_1.Post)('analyze'), - (0, swagger_1.ApiOperation)({ summary: 'Trigger road and speed analysis 🧠' }), - __param(0, (0, common_1.Query)('hours')), - __metadata("design:type", Function), - __metadata("design:paramtypes", [Number]), - __metadata("design:returntype", Promise) -], TelemetryController.prototype, "analyze", null); -__decorate([ - (0, common_1.Post)('process-intelligence'), - (0, swagger_1.ApiOperation)({ summary: 'Automated One-Click Sync & Analyze 🚀' }), - __param(0, (0, common_1.Query)('hours')), - __param(1, (0, common_1.Query)('days')), - __metadata("design:type", Function), - __metadata("design:paramtypes", [String, String]), - __metadata("design:returntype", Promise) -], TelemetryController.prototype, "processIntelligence", null); -__decorate([ - (0, common_1.Get)('summary'), - (0, swagger_1.ApiOperation)({ summary: 'Get analysis summary 📊' }), - __metadata("design:type", Function), - __metadata("design:paramtypes", []), - __metadata("design:returntype", Promise) -], TelemetryController.prototype, "getSummary", null); -__decorate([ - (0, common_1.Get)('nearby'), - (0, swagger_1.ApiOperation)({ summary: 'Find nearby drivers 📍' }), - __param(0, (0, common_1.Query)('lat')), - __param(1, (0, common_1.Query)('lng')), - __param(2, (0, common_1.Query)('radius')), - __metadata("design:type", Function), - __metadata("design:paramtypes", [Number, Number, Number]), - __metadata("design:returntype", Promise) -], TelemetryController.prototype, "getNearby", null); -exports.TelemetryController = TelemetryController = __decorate([ - (0, swagger_1.ApiTags)('telemetry'), - (0, common_1.Controller)('telemetry'), - (0, common_1.UseGuards)(api_key_guard_1.ApiKeyGuard), - __metadata("design:paramtypes", [telemetry_service_1.TelemetryService, - telemetry_analyzer_service_1.TelemetryAnalyzerService]) -], TelemetryController); -//# sourceMappingURL=telemetry.controller.js.map \ No newline at end of file diff --git a/apps/api/dist/telemetry/telemetry.controller.js.map b/apps/api/dist/telemetry/telemetry.controller.js.map deleted file mode 100644 index f0d2c55..0000000 --- a/apps/api/dist/telemetry/telemetry.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"telemetry.controller.js","sourceRoot":"","sources":["../../src/telemetry/telemetry.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2DAAgF;AAChF,6EAAwE;AACxE,kEAA6D;AAC7D,2CAA+E;AAC/E,6CAAwD;AAKjD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAEX;IACA;IAFnB,YACmB,gBAAkC,EAClC,eAAyC;QADzC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,oBAAe,GAAf,eAAe,CAA0B;IACzD,CAAC;IAIE,AAAN,KAAK,CAAC,MAAM,CAAS,IAAwB;QAC3C,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IAIK,AAAN,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,eAAe,CAAC,gBAAgB,EAAE,CAAC;IACjD,CAAC;IAIK,AAAN,KAAK,CAAC,OAAO,CAAiB,KAAc;QAC1C,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;QAC9E,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC;QACnF,OAAO;YACL,OAAO,EAAE,IAAI;YACb,YAAY,EAAE,WAAW;YACzB,aAAa,EAAE,gBAAgB;SAChC,CAAC;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,mBAAmB,CACP,KAAc,EACf,IAAa;QAE5B,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CA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FL,IAAA,aAAI,EAAC,sBAAsB,CAAC;IAC5B,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,uCAAuC,EAAE,CAAC;IAEhE,WAAA,IAAA,cAAK,EAAC,OAAO,CAAC,CAAA;IACd,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;;;;8DAcf;AAIK;IAFL,IAAA,YAAG,EAAC,SAAS,CAAC;IACd,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC;;;;qDAGpD;AAIK;IAFL,IAAA,YAAG,EAAC,QAAQ,CAAC;IACb,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;IAEjD,WAAA,IAAA,cAAK,EAAC,KAAK,CAAC,CAAA;IACZ,WAAA,IAAA,cAAK,EAAC,KAAK,CAAC,CAAA;IACZ,WAAA,IAAA,cAAK,EAAC,QAAQ,CAAC,CAAA;;;;oDAGjB;8BAhEU,mBAAmB;IAH/B,IAAA,iBAAO,EAAC,WAAW,CAAC;IACpB,IAAA,mBAAU,EAAC,WAAW,CAAC;IACvB,IAAA,kBAAS,EAAC,2BAAW,CAAC;qCAGgB,oCAAgB;QACjB,qDAAwB;GAHjD,mBAAmB,CAiE/B"} \ No newline at end of file diff --git a/apps/api/dist/telemetry/telemetry.entity.d.ts b/apps/api/dist/telemetry/telemetry.entity.d.ts deleted file mode 100644 index b8791f8..0000000 --- a/apps/api/dist/telemetry/telemetry.entity.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export declare class TelemetryLog { - id: number; - driverId: string; - latitude: number; - longitude: number; - speed: number; - heading: number; - timestamp: Date; - location: any; -} diff --git a/apps/api/dist/telemetry/telemetry.entity.js b/apps/api/dist/telemetry/telemetry.entity.js deleted file mode 100644 index e576694..0000000 --- a/apps/api/dist/telemetry/telemetry.entity.js +++ /dev/null @@ -1,69 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __metadata = (this && this.__metadata) || function (k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.TelemetryLog = void 0; -const typeorm_1 = require("typeorm"); -let TelemetryLog = class TelemetryLog { - id; - driverId; - latitude; - longitude; - speed; - heading; - timestamp; - location; -}; -exports.TelemetryLog = TelemetryLog; -__decorate([ - (0, typeorm_1.PrimaryGeneratedColumn)(), - __metadata("design:type", Number) -], TelemetryLog.prototype, "id", void 0); -__decorate([ - (0, typeorm_1.Column)(), - (0, typeorm_1.Index)(), - __metadata("design:type", String) -], TelemetryLog.prototype, "driverId", void 0); -__decorate([ - (0, typeorm_1.Column)('decimal', { precision: 10, scale: 7 }), - __metadata("design:type", Number) -], TelemetryLog.prototype, "latitude", void 0); -__decorate([ - (0, typeorm_1.Column)('decimal', { precision: 10, scale: 7 }), - __metadata("design:type", Number) -], TelemetryLog.prototype, "longitude", void 0); -__decorate([ - (0, typeorm_1.Column)('float'), - __metadata("design:type", Number) -], TelemetryLog.prototype, "speed", void 0); -__decorate([ - (0, typeorm_1.Column)('float'), - __metadata("design:type", Number) -], TelemetryLog.prototype, "heading", void 0); -__decorate([ - (0, typeorm_1.CreateDateColumn)(), - (0, typeorm_1.Index)(), - __metadata("design:type", Date) -], TelemetryLog.prototype, "timestamp", void 0); -__decorate([ - (0, typeorm_1.Column)({ - type: 'geography', - spatialFeatureType: 'Point', - srid: 4326, - nullable: true, - }), - (0, typeorm_1.Index)({ spatial: true }), - __metadata("design:type", Object) -], TelemetryLog.prototype, "location", void 0); -exports.TelemetryLog = TelemetryLog = __decorate([ - (0, typeorm_1.Entity)('telemetry_logs'), - (0, typeorm_1.Index)(['driverId', 'timestamp'], { unique: true }) -], TelemetryLog); -//# sourceMappingURL=telemetry.entity.js.map \ No newline at end of file diff --git a/apps/api/dist/telemetry/telemetry.entity.js.map b/apps/api/dist/telemetry/telemetry.entity.js.map deleted file mode 100644 index aaf2278..0000000 --- a/apps/api/dist/telemetry/telemetry.entity.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"telemetry.entity.js","sourceRoot":"","sources":["../../src/telemetry/telemetry.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA0F;AAInF,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEvB,EAAE,CAAS;IAIX,QAAQ,CAAS;IAGjB,QAAQ,CAAS;IAGjB,SAAS,CAAS;IAGlB,KAAK,CAAS;IAGd,OAAO,CAAS;IAIhB,SAAS,CAAO;IAWhB,QAAQ,CAAM;CACf,CAAA;AAlCY,oCAAY;AAEvB;IADC,IAAA,gCAAsB,GAAE;;wCACd;AAIX;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,GAAE;;8CACS;AAGjB;IADC,IAAA,gBAAM,EAAC,SAAS,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;;8CAC9B;AAGjB;IADC,IAAA,gBAAM,EAAC,SAAS,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;;+CAC7B;AAGlB;IADC,IAAA,gBAAM,EAAC,OAAO,CAAC;;2CACF;AAGd;IADC,IAAA,gBAAM,EAAC,OAAO,CAAC;;6CACA;AAIhB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,eAAK,GAAE;8BACG,IAAI;+CAAC;AAWhB;IAPC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,WAAW;QACjB,kBAAkB,EAAE,OAAO;QAC3B,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,eAAK,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;8CACX;uBAjCH,YAAY;IAFxB,IAAA,gBAAM,EAAC,gBAAgB,CAAC;IACxB,IAAA,eAAK,EAAC,CAAC,UAAU,EAAE,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;GACtC,YAAY,CAkCxB"} \ No newline at end of file diff --git a/apps/api/dist/telemetry/telemetry.module.d.ts b/apps/api/dist/telemetry/telemetry.module.d.ts deleted file mode 100644 index b145648..0000000 --- a/apps/api/dist/telemetry/telemetry.module.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare class TelemetryModule { -} diff --git a/apps/api/dist/telemetry/telemetry.module.js b/apps/api/dist/telemetry/telemetry.module.js deleted file mode 100644 index bac31ad..0000000 --- a/apps/api/dist/telemetry/telemetry.module.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.TelemetryModule = void 0; -const common_1 = require("@nestjs/common"); -const typeorm_1 = require("@nestjs/typeorm"); -const telemetry_entity_1 = require("./telemetry.entity"); -const telemetry_service_1 = require("./telemetry.service"); -const telemetry_controller_1 = require("./telemetry.controller"); -const telemetry_analyzer_service_1 = require("./telemetry-analyzer.service"); -const map_refinement_controller_1 = require("./map-refinement.controller"); -const road_stat_entity_1 = require("../maps/road-stat.entity"); -const candidate_road_entity_1 = require("../maps/candidate-road.entity"); -const redis_module_1 = require("../common/redis.module"); -const maps_module_1 = require("../maps/maps.module"); -const external_telemetry_service_1 = require("./external-telemetry.service"); -const telegram_service_1 = require("../common/telegram.service"); -let TelemetryModule = class TelemetryModule { -}; -exports.TelemetryModule = TelemetryModule; -exports.TelemetryModule = TelemetryModule = __decorate([ - (0, common_1.Module)({ - imports: [ - typeorm_1.TypeOrmModule.forFeature([telemetry_entity_1.TelemetryLog, road_stat_entity_1.RoadSegmentStat, candidate_road_entity_1.CandidateRoad]), - redis_module_1.RedisModule, - maps_module_1.MapsModule, - ], - controllers: [telemetry_controller_1.TelemetryController, map_refinement_controller_1.MapRefinementController], - providers: [ - telemetry_service_1.TelemetryService, - telemetry_analyzer_service_1.TelemetryAnalyzerService, - external_telemetry_service_1.ExternalTelemetryService, - telegram_service_1.TelegramService - ], - exports: [ - telemetry_service_1.TelemetryService, - telemetry_analyzer_service_1.TelemetryAnalyzerService, - external_telemetry_service_1.ExternalTelemetryService, - telegram_service_1.TelegramService - ], - }) -], TelemetryModule); -//# sourceMappingURL=telemetry.module.js.map \ No newline at end of file diff --git a/apps/api/dist/telemetry/telemetry.module.js.map b/apps/api/dist/telemetry/telemetry.module.js.map deleted file mode 100644 index eeccbaf..0000000 --- a/apps/api/dist/telemetry/telemetry.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"telemetry.module.js","sourceRoot":"","sources":["../../src/telemetry/telemetry.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,yDAAkD;AAClD,2DAAuD;AACvD,iEAA6D;AAC7D,6EAAwE;AACxE,2EAAsE;AACtE,+DAA2D;AAC3D,yEAA8D;AAC9D,yDAAqD;AAErD,qDAAiD;AAEjD,6EAAwE;AACxE,iEAA6D;AAsBtD,IAAM,eAAe,GAArB,MAAM,eAAe;CAAG,CAAA;AAAlB,0CAAe;0BAAf,eAAe;IApB3B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC,CAAC,+BAAY,EAAE,kCAAe,EAAE,qCAAa,CAAC,CAAC;YACxE,0BAAW;YACX,wBAAU;SACX;QACD,WAAW,EAAE,CAAC,0CAAmB,EAAE,mDAAuB,CAAC;QAC3D,SAAS,EAAE;YACT,oCAAgB;YAChB,qDAAwB;YACxB,qDAAwB;YACxB,kCAAe;SAChB;QACD,OAAO,EAAE;YACP,oCAAgB;YAChB,qDAAwB;YACxB,qDAAwB;YACxB,kCAAe;SAChB;KACF,CAAC;GACW,eAAe,CAAG"} \ No newline at end of file diff --git a/apps/api/dist/telemetry/telemetry.service.d.ts b/apps/api/dist/telemetry/telemetry.service.d.ts deleted file mode 100644 index 0b230f2..0000000 --- a/apps/api/dist/telemetry/telemetry.service.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Repository } from 'typeorm'; -import { TelemetryLog } from './telemetry.entity'; -export interface DriverTelemetryDto { - driver_id: string; - latitude: number; - longitude: number; - speed: number; - heading: number; -} -export declare class TelemetryService { - private telemetryRepository; - private readonly logger; - constructor(telemetryRepository: Repository); - ingest(data: DriverTelemetryDto): Promise<{ - success: boolean; - timestamp: Date; - }>; - getRecentDrivers(lat: number, lng: number, radiusMeters?: number): Promise; -} diff --git a/apps/api/dist/telemetry/telemetry.service.js b/apps/api/dist/telemetry/telemetry.service.js deleted file mode 100644 index a8d50fc..0000000 --- a/apps/api/dist/telemetry/telemetry.service.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __metadata = (this && this.__metadata) || function (k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); -}; -var __param = (this && this.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var TelemetryService_1; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.TelemetryService = void 0; -const common_1 = require("@nestjs/common"); -const typeorm_1 = require("@nestjs/typeorm"); -const typeorm_2 = require("typeorm"); -const telemetry_entity_1 = require("./telemetry.entity"); -let TelemetryService = TelemetryService_1 = class TelemetryService { - telemetryRepository; - logger = new common_1.Logger(TelemetryService_1.name); - constructor(telemetryRepository) { - this.telemetryRepository = telemetryRepository; - } - async ingest(data) { - const log = this.telemetryRepository.create({ - driverId: data.driver_id, - latitude: data.latitude, - longitude: data.longitude, - speed: data.speed, - heading: data.heading, - location: { - type: 'Point', - coordinates: [data.longitude, data.latitude], - }, - }); - await this.telemetryRepository.save(log); - this.logger.debug(`Ingested telemetry for driver ${data.driver_id}`); - return { success: true, timestamp: new Date() }; - } - async getRecentDrivers(lat, lng, radiusMeters = 5000) { - return this.telemetryRepository - .createQueryBuilder('log') - .where('ST_DWithin(log.location, ST_MakePoint(:lng, :lat)::geography, :radius)') - .setParameters({ lat, lng, radius: radiusMeters }) - .orderBy('log.timestamp', 'DESC') - .limit(50) - .getMany(); - } -}; -exports.TelemetryService = TelemetryService; -exports.TelemetryService = TelemetryService = TelemetryService_1 = __decorate([ - (0, common_1.Injectable)(), - __param(0, (0, typeorm_1.InjectRepository)(telemetry_entity_1.TelemetryLog)), - __metadata("design:paramtypes", [typeorm_2.Repository]) -], TelemetryService); -//# sourceMappingURL=telemetry.service.js.map \ No newline at end of file diff --git a/apps/api/dist/telemetry/telemetry.service.js.map b/apps/api/dist/telemetry/telemetry.service.js.map deleted file mode 100644 index 4babcbb..0000000 --- a/apps/api/dist/telemetry/telemetry.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":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MAAM,EAAE,YAAY,EAAE,CAAC;aACjD,OAAO,CAAC,eAAe,EAAE,MAAM,CAAC;aAChC,KAAK,CAAC,EAAE,CAAC;aACT,OAAO,EAAE,CAAC;IACf,CAAC;CACF,CAAA;AA1CY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;IAKR,WAAA,IAAA,0BAAgB,EAAC,+BAAY,CAAC,CAAA;qCACF,oBAAU;GAL9B,gBAAgB,CA0C5B"} \ No newline at end of file diff --git a/apps/api/dist/tsconfig.build.tsbuildinfo b/apps/api/dist/tsconfig.build.tsbuildinfo index d922536..d2c8d7b 100644 --- a/apps/api/dist/tsconfig.build.tsbuildinfo +++ b/apps/api/dist/tsconfig.build.tsbuildinfo @@ -1 +1 @@ -{"fileNames":["../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es5.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2015.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2016.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2017.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2018.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2019.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2020.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2021.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2022.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2023.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.dom.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.dom.asynciterable.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.scripthost.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2023.array.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.decorators.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2023.full.d.ts","../src/app.service.ts","../src/app.controller.ts","../src/maps/road-speed-profile.entity.ts","../src/maps/road-stat.entity.ts","../src/maps/traffic-grid.service.ts","../src/geocoding/entities/base-place.entity.ts","../src/geocoding/entities/place-syria.entity.ts","../src/geocoding/entities/place-jordan.entity.ts","../src/geocoding/entities/place-egypt.entity.ts","../src/geocoding/entities/osm-area.entity.ts","../src/geocoding/entities/osm-point-with-area.entity.ts","../src/geocoding/geocoding.service.ts","../src/common/redis.service.ts","../src/maps/maps.service.ts","../src/auth/entities/tenant.entity.ts","../src/auth/entities/api-key.entity.ts","../src/auth/auth.service.ts","../src/common/guards/api-key.guard.ts","../src/maps/maps.controller.ts","../src/maps/candidate-road.entity.ts","../src/common/redis.module.ts","../src/geocoding/geocoding-init.service.ts","../src/geocoding/entities/admin-boundary.entity.ts","../src/geocoding/admin-boundaries.service.ts","../src/geocoding/jordan-research.service.ts","../src/geocoding/entities/neighborhood-point.entity.ts","../src/geocoding/entities/neighborhood-polygon.entity.ts","../src/geocoding/administrative-linking.service.ts","../src/geocoding/entities/map-candidate.entity.ts","../src/geocoding/map-refinement.service.ts","../src/common/guards/admin.guard.ts","../src/common/guards/rate-limiter.guard.ts","../src/geocoding/dto/search-query.dto.ts","../src/geocoding/dto/reverse-geocode.dto.ts","../src/geocoding/geocoding.controller.ts","../src/auth/firebase-admin.service.ts","../src/auth/guards/firebase-auth.guard.ts","../src/geocoding/map-refinement.controller.ts","../src/geocoding/index-refresh.service.ts","../src/geocoding/geocoding.module.ts","../src/maps/maps.module.ts","../src/auth/dto/management/create-key.dto.ts","../src/auth/tenant.controller.ts","../src/auth/auth.module.ts","../src/usage/usage.entity.ts","../src/usage/usage.service.ts","../src/usage/usage.controller.ts","../src/usage/usage.module.ts","../src/billing/entities/subscription.entity.ts","../src/billing/entities/transaction.entity.ts","../src/common/mail.service.ts","../src/billing/billing.service.ts","../src/billing/providers/paymob.provider.ts","../src/billing/providers/binance.provider.ts","../src/billing/billing.controller.ts","../src/billing/billing.module.ts","../src/common/mail.module.ts","../src/usage/usage.interceptor.ts","../src/app.module.ts","../src/main.ts","../src/common/cache.service.ts","../src/common/gis.utils.ts","../src/common/telegram.service.ts"],"fileIdsList":[[68],[107,108,111,115,123,124,125],[82,83,84,88,103,104,110],[80,82,83],[82],[83],[84,103],[84,104,109],[104,117,119,120,121],[82,116,117,119,120,121,122],[82,116,117,118],[84],[118],[80],[90],[74,75,90,93,94],[73],[74],[79,85,91,92,95,97,98,99,100,101],[74,75,76,77,78,79,89,90,91,92,93,94,95,96,97,102,105,106],[73,74,75,76,77,78],[78],[75],[96,97,104],[74,75,76,96],[126],[81,85],[71,72,81,86,87,88,107],[70,71,72,79,80],[104,113],[82,113],[112,113,114],[80,112]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2e80ee7a49e8ac312cc11b77f1475804bee36b3b2bc896bead8b6e1266befb43","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7a3c8b952931daebdfc7a2897c53c0a1c73624593fa070e46bd537e64dcd20a","affectsGlobalScope":true,"impliedFormat":1},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true,"impliedFormat":1},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cdf8847677ac7d20486e54dd3fcf09eda95812ac8ace44b4418da1bbbab6eb8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"df83c2a6c73228b625b0beb6669c7ee2a09c914637e2d35170723ad49c0f5cd4","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"785921608325fa246b450f05b238f4b3ed659f1099af278ce9ebbc9416a13f1d","impliedFormat":1},{"version":"eaf8514ce110fa428a93a27408df4d06d133dbd9ed0a775c315ddfdd507853a9","impliedFormat":1},{"version":"260f889b9e2b69f77be1155348eb345166aec664b3efff6720053c6844a41f28","impliedFormat":1},{"version":"e3f0e5554c466117e304f2703a0f697a405488d919475087b83841d6bbb80651","impliedFormat":1},{"version":"69dc7b44b233cc08e4d8712ecf69d4c301356cec6fe762f6c0758b9b10d9bc86","impliedFormat":1},{"version":"96b88ce757b76ef12b429a4815badd3ae2f5766e051203118446eb87823ff501","impliedFormat":1},{"version":"af50464960c41782733b598982db664158b6855228152e5d0d530ebf6ba14144","impliedFormat":1},{"version":"53ee526bc778d810bd983b4efab47d937e55ecb9114a4bd11056aacb8e8c49ec","impliedFormat":1},{"version":"5f719b3a2cddb91f777cb77edf4968f1864accd22d7d4c999071fdffe718fbb0","impliedFormat":1},{"version":"649fcf380722edcad5e18361468184fdfdf5867840e842a82789e5e8d3fc4ddb","impliedFormat":1},{"version":"6d7533ae0fb0da532e2a20ebf88d775194eeb42a9dc9f44fb8ad786e3c216b8f","impliedFormat":1},{"version":"b8087f1c249e60cfeefc6dfa1521a3b470b2c7fab4976ece0e873b18dbecec02","impliedFormat":1},{"version":"558ebe6fb409c7a0eb0636b49f270a57f00e80b2d7d5642442f0b8abf6b6e038","impliedFormat":1},{"version":"126e491676f1bb1a912c489b378654942a1e7bdaee44264ef809bc4f73d792b6","impliedFormat":1},{"version":"3fffc37fdd5d8a763c5252a0b25939f3d4c8fcf135eb4598c870c22d6373cb81","impliedFormat":1},{"version":"84fa569e0d12d9a93154bec14bea08bc7485c0bb98ca254835c3b88110f246cc","impliedFormat":1},{"version":"0b29f27b3b0d6a5158bf1a791a3be2620a73484b7b4d5086dfbb6b1ac96ac699","impliedFormat":1},{"version":"6176217cbe9d0afcf637165e5286dcf25a70888e8a90ab38b00dbf8bcea4cbee","impliedFormat":1},{"version":"750635d38fb66b2e7fe901509aa08d10e2c371c69a800b9b5c1103008509de19","impliedFormat":1},{"version":"eb7079c6d55625f087761c58cf6bd270a6c613b81bcd17afc90f0843d76b3351","impliedFormat":1},{"version":"ab3bbca008a833d6bf71e028f59b14d1ca761940e80df3a71b1359dd1dccdc4f","impliedFormat":1},{"version":"e3c7cabc1064bac241cc7c2225b0cf5c5333198f5932f84af5c653eeaeace4ec","impliedFormat":1},{"version":"dbfe9f38341fb1b6c757e826e62fe1b3c54e5e8edb0c3d44f865230d403fb7e2","impliedFormat":1},{"version":"32965ebab2a14bf52025e2bd336a7d281339b34fdb91fbd3cd7bc4818b67d519","impliedFormat":1},{"version":"4ba32a705197ca7ada81364105283b5e6b8ae59007dc33956db7b0ce37e42637","impliedFormat":1},{"version":"ed73470b9a7898300d2fbf2cdbc6ea920c9fc1fe2b5d7d14b6294410ab7c73ef","impliedFormat":1},{"version":"ae42ca043ffd6963b304be53b1168fbde1e9b5855ff6df56d105252ac5bacd38","impliedFormat":1},{"version":"8911b182d97bc41c4ef6fa06ebb129e8d7fb743e15a8876c096c78cfa487ac98","impliedFormat":1},{"version":"65d3eeba663346fe1fc1a7cfe888fdf484ed4097bbe8dd38486d0a6987a32ff0","impliedFormat":1},{"version":"115e15166167a4cb8129e08ac34a54fe5ccfc6ef005ca51852fb5d7487490987","impliedFormat":1},{"version":"f2f99468eccf92d40a333ecdf47f7f6ed71d35823d5efa3f1438b8c046f344fd","impliedFormat":1},{"version":"6b6831af0f6a2263bbafbbc35229231bad9b97d42e53dcbbac5dc02f3c2c0199","impliedFormat":1},{"version":"63485ea62e18c17b751b0b89f1ca0749f789918d91beec428f5b5cce6ab83f49","impliedFormat":1},{"version":"c1f0a7b6e7765d68ad278e2a19fade88f2f95a4f02617fe4cb0fe129a457d35d","impliedFormat":1},{"version":"5bc500a7075b779beb853ad8fdc1350a105e593d8e4d15abc7d169aab48cdf80","impliedFormat":1},{"version":"974108177e65ff71dfc6f0b915b8a2b37e84725b7b5fff5f28c332d8b9a3a0f8","impliedFormat":1},{"version":"eb243124125039a8b8ac09d2d108185cec48d391189b5478c444acae3401609f","impliedFormat":1},{"version":"8eb874fb2a1283708f068b2a1ddcd69c548775b9a45baeba3545f9892e6db746","impliedFormat":1},{"version":"8d21470af0109fb0bde30d8a6a91db8d1903be5a175827bdd2e6d5d479e67deb","impliedFormat":1},{"version":"395b0666f350f34497a14b9b28160b9ba9a312549b239cd71cd559bc55a1c199","impliedFormat":1},{"version":"a60581fad4a734a942554110f23b64483fb108667ffff0a4eb05b066bde39a69","impliedFormat":1},{"version":"b6373ffa3726c9c11253a1bd18d0c327a987591acf277bd76067996d8e148341","impliedFormat":1},{"version":"5b01a11756ad589c046ca78f0fa83f4ac123a011d7bca8bb7dcabb4fd488aec3","impliedFormat":1},{"version":"1a4871140a3916b2cc5f73f141d3e342e2e3edc5fa5bfc17b5a627e60e4bb191","impliedFormat":1},{"version":"3d7380f6a20c8e2b11b9153e99b3505ecae1e3d720a5ada600f48eab6794d38e","impliedFormat":1},{"version":"d428f987cc619731d3d924902091ebb75b4dc857006b715972152b8bec8cb405","impliedFormat":1},{"version":"d4107d5b85a0dc57b1497017c99230238163e16746951ea1e28bb3857643b699","impliedFormat":1},{"version":"1606dbc55b7b0412b8b9cbee85ba9e8dc96a71b00d337cecb54bed2e507e0c6a","impliedFormat":1},{"version":"07d95a22db56c66d5400592c8551c9fe77c1506c71e84e028ea69d810decea9e","impliedFormat":1},{"version":"77b6189e8dc7c00910bcc4617fed57bd9d44541833555a1674c4afcdfce981ba","impliedFormat":1},{"version":"37114254bb61328d042c8760906cb633d00c8ab8a823a4ce6a77ef3e85b1ea4b","impliedFormat":1},{"version":"04e8aba6ada316e88f5c316b5fed380aba2020ab893278cee0e26ef33c1f68c7","impliedFormat":1},{"version":"a79eff56bfb3decc611b25dbf726c363801d993e55f5cfa0fbc5dfc4144af55a","impliedFormat":1},{"version":"c2bc8c4b1c729b329fbfdd073fc4a349eb036f05d1eaf9e3eaba5e6e6f17f458","impliedFormat":1},{"version":"8c704b246503a5755c7e93b79db76c14d95141def355dd195d34b1b745d373d0","impliedFormat":1},{"version":"fcf849a9820830dc6047f8bb0c9ba1ddb068ccc756104fab63dd598cd3692638","impliedFormat":1},{"version":"1e249a42cb8025137cd7d37637db792e2493692e08dea0ad3ba86f2e5987de7c","impliedFormat":1},{"version":"70301f9d773bdf2b59a9e0c40d3669eb04c67e126728f670ffbd1f76c69ce94a","impliedFormat":1},{"version":"fd30224939eec8d923c08a31ffc803663c563261fcdff04b65c83f054e64ea30","impliedFormat":1},{"version":"a59a32a1ba149bd51c08ec8e00d76c57e85c9bb539552e345f4b3fac347a8416","impliedFormat":1},{"version":"c49ac3764b2f2d5a75519cde11c25cdce26b18009dfd71fc6857bd509d4c1b59","impliedFormat":1},{"version":"d7ceb4884ccac95cfc24a6773de92540ebc4094529cfcedac6bab32ab29da75b","impliedFormat":1},{"version":"57b33201d9aa377cc352fbb181da19c91b91f099a622f12cc661e5b89a86a834","impliedFormat":1},{"version":"1a4ffc0b4026ed85a0e74d61887e7c105f2aa3e92a08aa6fe8c9fecc4e158532","impliedFormat":1}],"root":[[68,130]],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"module":199,"noFallthroughCasesInSwitch":false,"noImplicitAny":false,"outDir":"./","removeComments":true,"skipLibCheck":true,"sourceMap":true,"strictBindCallApply":false,"strictNullChecks":true,"target":10},"referencedMap":[[69,1],[126,2],[111,3],[84,4],[83,5],[82,6],[104,7],[110,8],[122,9],[123,10],[119,11],[116,5],[98,5],[85,12],[124,13],[88,14],[91,15],[95,16],[96,17],[76,17],[75,17],[74,17],[89,18],[102,19],[107,20],[79,21],[106,22],[92,23],[105,24],[97,25],[127,26],[86,27],[108,28],[81,29],[114,30],[125,31],[115,32],[113,33]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130],"version":"5.9.3"} \ No newline at end of file +{"fileNames":["../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es5.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2015.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2016.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2017.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2018.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2019.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2020.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2021.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2022.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2023.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.dom.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.dom.asynciterable.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.scripthost.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2023.array.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.decorators.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../../../../../../usr/local/lib/node_modules/@nestjs/cli/node_modules/typescript/lib/lib.es2023.full.d.ts","../src/app.service.ts","../src/app.controller.ts","../src/maps/road-speed-profile.entity.ts","../src/maps/road-stat.entity.ts","../src/maps/traffic-grid.service.ts","../src/geocoding/entities/base-place.entity.ts","../src/geocoding/entities/place-syria.entity.ts","../src/geocoding/entities/place-jordan.entity.ts","../src/geocoding/entities/place-egypt.entity.ts","../src/geocoding/entities/place-iraq.entity.ts","../src/geocoding/entities/osm-area.entity.ts","../src/geocoding/entities/osm-point-with-area.entity.ts","../src/geocoding/geocoding.service.ts","../src/common/redis.service.ts","../src/maps/maps.service.ts","../src/auth/entities/tenant.entity.ts","../src/auth/entities/api-key.entity.ts","../src/auth/auth.service.ts","../src/common/guards/api-key.guard.ts","../src/maps/maps.controller.ts","../src/maps/candidate-road.entity.ts","../src/common/redis.module.ts","../src/geocoding/geocoding-init.service.ts","../src/geocoding/entities/admin-boundary.entity.ts","../src/geocoding/admin-boundaries.service.ts","../src/geocoding/jordan-research.service.ts","../src/geocoding/entities/neighborhood-point.entity.ts","../src/geocoding/entities/neighborhood-polygon.entity.ts","../src/geocoding/administrative-linking.service.ts","../src/geocoding/entities/map-candidate.entity.ts","../src/geocoding/map-refinement.service.ts","../src/common/guards/admin.guard.ts","../src/common/guards/rate-limiter.guard.ts","../src/geocoding/dto/search-query.dto.ts","../src/geocoding/dto/reverse-geocode.dto.ts","../src/geocoding/geocoding.controller.ts","../src/auth/firebase-admin.service.ts","../src/auth/guards/firebase-auth.guard.ts","../src/geocoding/map-refinement.controller.ts","../src/geocoding/index-refresh.service.ts","../src/geocoding/geocoding.module.ts","../src/maps/road-refinement.controller.ts","../src/maps/maps.module.ts","../src/auth/dto/management/create-key.dto.ts","../src/auth/tenant.controller.ts","../src/auth/auth.module.ts","../src/usage/usage.entity.ts","../src/usage/usage.service.ts","../src/usage/usage.controller.ts","../src/usage/usage.module.ts","../src/billing/entities/subscription.entity.ts","../src/billing/entities/transaction.entity.ts","../src/common/mail.service.ts","../src/billing/billing.service.ts","../src/billing/providers/paymob.provider.ts","../src/billing/providers/binance.provider.ts","../src/billing/billing.controller.ts","../src/billing/billing.module.ts","../src/common/mail.module.ts","../src/weather/weather.service.ts","../src/weather/weather.controller.ts","../src/weather/weather.module.ts","../src/tactical/dto/line-of-sight.dto.ts","../src/tactical/dto/tactical.dto.ts","../src/tactical/tactical.service.ts","../src/tactical/tactical.controller.ts","../src/tactical/tactical.module.ts","../src/usage/usage.interceptor.ts","../src/app.module.ts","../src/main.ts","../src/common/cache.service.ts","../src/common/gis.utils.ts","../src/common/telegram.service.ts"],"fileIdsList":[[68],[108,110,113,117,125,126,129,134,135],[83,84,85,89,104,105,112],[81,83,84],[83],[84],[85,104],[85,105,111],[105,119,121,122,123],[83,118,119,121,122,123,124],[83,118,119,120],[85],[120],[81],[91],[74,75,91,94,95],[73],[74],[80,86,92,93,96,98,99,100,101,102],[74,75,76,77,78,79,80,90,91,92,93,94,95,96,97,98,103,106,107],[73,74,75,76,77,78,79],[79],[75],[97,98,105],[74,75,76,77,97],[136],[82,86],[71,72,82,87,88,89,108,109],[70,71,72,80,81],[71,86,88],[86,100,130,131,132],[89,132,133],[105,115],[83,115],[114,115,116],[81,114],[127],[89,127,128]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2e80ee7a49e8ac312cc11b77f1475804bee36b3b2bc896bead8b6e1266befb43","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7a3c8b952931daebdfc7a2897c53c0a1c73624593fa070e46bd537e64dcd20a","affectsGlobalScope":true,"impliedFormat":1},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true,"impliedFormat":1},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cdf8847677ac7d20486e54dd3fcf09eda95812ac8ace44b4418da1bbbab6eb8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"df83c2a6c73228b625b0beb6669c7ee2a09c914637e2d35170723ad49c0f5cd4","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"785921608325fa246b450f05b238f4b3ed659f1099af278ce9ebbc9416a13f1d","impliedFormat":1},{"version":"eaf8514ce110fa428a93a27408df4d06d133dbd9ed0a775c315ddfdd507853a9","impliedFormat":1},{"version":"260f889b9e2b69f77be1155348eb345166aec664b3efff6720053c6844a41f28","impliedFormat":1},{"version":"e3f0e5554c466117e304f2703a0f697a405488d919475087b83841d6bbb80651","impliedFormat":1},{"version":"69dc7b44b233cc08e4d8712ecf69d4c301356cec6fe762f6c0758b9b10d9bc86","impliedFormat":1},{"version":"96b88ce757b76ef12b429a4815badd3ae2f5766e051203118446eb87823ff501","impliedFormat":1},{"version":"af50464960c41782733b598982db664158b6855228152e5d0d530ebf6ba14144","impliedFormat":1},{"version":"53ee526bc778d810bd983b4efab47d937e55ecb9114a4bd11056aacb8e8c49ec","impliedFormat":1},{"version":"5f719b3a2cddb91f777cb77edf4968f1864accd22d7d4c999071fdffe718fbb0","impliedFormat":1},{"version":"649fcf380722edcad5e18361468184fdfdf5867840e842a82789e5e8d3fc4ddb","impliedFormat":1},{"version":"759b13db0462e706604e916ce0d15cbe0ec1e0abee5eac60ff765e2f63a75765","impliedFormat":1},{"version":"6d7533ae0fb0da532e2a20ebf88d775194eeb42a9dc9f44fb8ad786e3c216b8f","impliedFormat":1},{"version":"b8087f1c249e60cfeefc6dfa1521a3b470b2c7fab4976ece0e873b18dbecec02","impliedFormat":1},{"version":"030200a40f90fa1e07619c7c939a8a1fbcc38ed6b2f0e5533de21168cacd5d7c","impliedFormat":1},{"version":"126e491676f1bb1a912c489b378654942a1e7bdaee44264ef809bc4f73d792b6","impliedFormat":1},{"version":"3fffc37fdd5d8a763c5252a0b25939f3d4c8fcf135eb4598c870c22d6373cb81","impliedFormat":1},{"version":"84fa569e0d12d9a93154bec14bea08bc7485c0bb98ca254835c3b88110f246cc","impliedFormat":1},{"version":"0b29f27b3b0d6a5158bf1a791a3be2620a73484b7b4d5086dfbb6b1ac96ac699","impliedFormat":1},{"version":"6176217cbe9d0afcf637165e5286dcf25a70888e8a90ab38b00dbf8bcea4cbee","impliedFormat":1},{"version":"750635d38fb66b2e7fe901509aa08d10e2c371c69a800b9b5c1103008509de19","impliedFormat":1},{"version":"eb7079c6d55625f087761c58cf6bd270a6c613b81bcd17afc90f0843d76b3351","impliedFormat":1},{"version":"ab3bbca008a833d6bf71e028f59b14d1ca761940e80df3a71b1359dd1dccdc4f","impliedFormat":1},{"version":"e3c7cabc1064bac241cc7c2225b0cf5c5333198f5932f84af5c653eeaeace4ec","impliedFormat":1},{"version":"a3ea653790b11e94dd723aff3a78ef702e9d801b62a68d64ca4aeea49242fdfd","impliedFormat":1},{"version":"32965ebab2a14bf52025e2bd336a7d281339b34fdb91fbd3cd7bc4818b67d519","impliedFormat":1},{"version":"4ba32a705197ca7ada81364105283b5e6b8ae59007dc33956db7b0ce37e42637","impliedFormat":1},{"version":"ed73470b9a7898300d2fbf2cdbc6ea920c9fc1fe2b5d7d14b6294410ab7c73ef","impliedFormat":1},{"version":"ae42ca043ffd6963b304be53b1168fbde1e9b5855ff6df56d105252ac5bacd38","impliedFormat":1},{"version":"8911b182d97bc41c4ef6fa06ebb129e8d7fb743e15a8876c096c78cfa487ac98","impliedFormat":1},{"version":"861953f63e3f66d00e3138acdfca77b7bc13c1f0101193ec2b5c600494190d5a","impliedFormat":1},{"version":"6ed53c1cd8268dc3f6101c5eb5b6d90ef43bf5d975636fcf8be327bde75c05ae","impliedFormat":1},{"version":"841ff3dfa26a57a68eb43aefac544a4bb7b84167df1af8308a0da45f1a45ecde","impliedFormat":1},{"version":"6b6831af0f6a2263bbafbbc35229231bad9b97d42e53dcbbac5dc02f3c2c0199","impliedFormat":1},{"version":"63485ea62e18c17b751b0b89f1ca0749f789918d91beec428f5b5cce6ab83f49","impliedFormat":1},{"version":"f02d0a22e62dab830d9a346055167f459566c09312035700d28fdeb47f484ccd","impliedFormat":1},{"version":"5bc500a7075b779beb853ad8fdc1350a105e593d8e4d15abc7d169aab48cdf80","impliedFormat":1},{"version":"9b276baf0de583f69b99d8c308c4c5e258e061ac26f29eb84dc9e66cc0be9a81","impliedFormat":1},{"version":"eb243124125039a8b8ac09d2d108185cec48d391189b5478c444acae3401609f","impliedFormat":1},{"version":"8eb874fb2a1283708f068b2a1ddcd69c548775b9a45baeba3545f9892e6db746","impliedFormat":1},{"version":"8d21470af0109fb0bde30d8a6a91db8d1903be5a175827bdd2e6d5d479e67deb","impliedFormat":1},{"version":"395b0666f350f34497a14b9b28160b9ba9a312549b239cd71cd559bc55a1c199","impliedFormat":1},{"version":"050c821b09b871b81baec53f18479e2411d3a1e006711a948f84efc92b9f0612","impliedFormat":1},{"version":"a78b7072cafdc6d5ad269ddc46658ae7b208b9342759a538934015b0212e99b0","impliedFormat":1},{"version":"62d2f1d479df27690889a5fbc1ce83d885676fbbddc83311d64786273ea31109","impliedFormat":1},{"version":"5b01a11756ad589c046ca78f0fa83f4ac123a011d7bca8bb7dcabb4fd488aec3","impliedFormat":1},{"version":"1a4871140a3916b2cc5f73f141d3e342e2e3edc5fa5bfc17b5a627e60e4bb191","impliedFormat":1},{"version":"1049d83791cc1142e6a813f26a5939fafee4826cdc24619a72471d0ffeb6344a","impliedFormat":1},{"version":"d428f987cc619731d3d924902091ebb75b4dc857006b715972152b8bec8cb405","impliedFormat":1},{"version":"d4107d5b85a0dc57b1497017c99230238163e16746951ea1e28bb3857643b699","impliedFormat":1},{"version":"1606dbc55b7b0412b8b9cbee85ba9e8dc96a71b00d337cecb54bed2e507e0c6a","impliedFormat":1},{"version":"07d95a22db56c66d5400592c8551c9fe77c1506c71e84e028ea69d810decea9e","impliedFormat":1},{"version":"77b6189e8dc7c00910bcc4617fed57bd9d44541833555a1674c4afcdfce981ba","impliedFormat":1},{"version":"37114254bb61328d042c8760906cb633d00c8ab8a823a4ce6a77ef3e85b1ea4b","impliedFormat":1},{"version":"04e8aba6ada316e88f5c316b5fed380aba2020ab893278cee0e26ef33c1f68c7","impliedFormat":1},{"version":"a79eff56bfb3decc611b25dbf726c363801d993e55f5cfa0fbc5dfc4144af55a","impliedFormat":1},{"version":"c2bc8c4b1c729b329fbfdd073fc4a349eb036f05d1eaf9e3eaba5e6e6f17f458","impliedFormat":1},{"version":"8c704b246503a5755c7e93b79db76c14d95141def355dd195d34b1b745d373d0","impliedFormat":1},{"version":"fcf849a9820830dc6047f8bb0c9ba1ddb068ccc756104fab63dd598cd3692638","impliedFormat":1},{"version":"1e249a42cb8025137cd7d37637db792e2493692e08dea0ad3ba86f2e5987de7c","impliedFormat":1},{"version":"70301f9d773bdf2b59a9e0c40d3669eb04c67e126728f670ffbd1f76c69ce94a","impliedFormat":1},{"version":"898b2c48b5994c02b0f93238c8b112cec69b1e8fc05c5f7fff3d480e72fa0790","impliedFormat":1},{"version":"11583670a13df42d4ce4f181bf4a7299a0d044d36a2fbdb00d25f3fb798ea810","impliedFormat":1},{"version":"c597c2abb5299fe004023a8da7cc6f8c7159d857e19617c934f7c7b8c7b65a64","impliedFormat":1},{"version":"9c6038b12bbba3c70ff28618e83a41dd432e5317dd4c9a0078268f5b8f66798b","impliedFormat":1},{"version":"e7cd2806abb8dbe058cddd3f803232d4aebc2e345d95aa1fbfee035ef2f998a6","impliedFormat":1},{"version":"3d7724652c861157e709a0eca360ce74f505d10a73052927b370956c284a571e","impliedFormat":1},{"version":"e8ad788a93b7d62a81bff36ab210d0ed88e00f81edc82b26d67a48efc4f23aa5","impliedFormat":1},{"version":"024fe0eba324885f84a7ce5313335a63cd99f70de79c805751a68154b02aeeab","impliedFormat":1},{"version":"fd30224939eec8d923c08a31ffc803663c563261fcdff04b65c83f054e64ea30","impliedFormat":1},{"version":"b2ddbe23acdd5e50c13f1268a152a03683aae9f18f58f5d897baefd2fbb3866b","impliedFormat":1},{"version":"c49ac3764b2f2d5a75519cde11c25cdce26b18009dfd71fc6857bd509d4c1b59","impliedFormat":1},{"version":"d7ceb4884ccac95cfc24a6773de92540ebc4094529cfcedac6bab32ab29da75b","impliedFormat":1},{"version":"57b33201d9aa377cc352fbb181da19c91b91f099a622f12cc661e5b89a86a834","impliedFormat":1},{"version":"1a4ffc0b4026ed85a0e74d61887e7c105f2aa3e92a08aa6fe8c9fecc4e158532","impliedFormat":1}],"root":[[68,140]],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"module":199,"noFallthroughCasesInSwitch":false,"noImplicitAny":false,"outDir":"./","removeComments":true,"skipLibCheck":true,"sourceMap":true,"strictBindCallApply":false,"strictNullChecks":true,"target":10},"referencedMap":[[69,1],[136,2],[113,3],[85,4],[84,5],[83,6],[105,7],[112,8],[124,9],[125,10],[121,11],[118,5],[99,5],[86,12],[126,13],[89,14],[92,15],[96,16],[97,17],[76,17],[77,17],[75,17],[74,17],[90,18],[103,19],[108,20],[80,21],[107,22],[93,23],[106,24],[98,25],[137,26],[87,27],[110,28],[82,29],[109,30],[133,31],[134,32],[132,14],[116,33],[135,34],[117,35],[115,36],[128,37],[129,38],[127,14]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140],"version":"5.9.3"} \ No newline at end of file diff --git a/apps/api/dist/weather/weather.controller.d.ts b/apps/api/dist/weather/weather.controller.d.ts new file mode 100644 index 0000000..43eddda --- /dev/null +++ b/apps/api/dist/weather/weather.controller.d.ts @@ -0,0 +1,8 @@ +import { WeatherService } from './weather.service'; +export declare class WeatherController { + private readonly weatherService; + constructor(weatherService: WeatherService); + getWeatherGrid(): Promise; + getCitiesWeather(region?: string): Promise; + getWeatherAlerts(region?: string): Promise; +} diff --git a/apps/api/dist/weather/weather.controller.js b/apps/api/dist/weather/weather.controller.js new file mode 100644 index 0000000..308edb6 --- /dev/null +++ b/apps/api/dist/weather/weather.controller.js @@ -0,0 +1,65 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WeatherController = void 0; +const common_1 = require("@nestjs/common"); +const swagger_1 = require("@nestjs/swagger"); +const weather_service_1 = require("./weather.service"); +let WeatherController = class WeatherController { + weatherService; + constructor(weatherService) { + this.weatherService = weatherService; + } + async getWeatherGrid() { + return this.weatherService.getWeatherGrid(); + } + async getCitiesWeather(region) { + return this.weatherService.getAllCitiesWeather(region); + } + async getWeatherAlerts(region) { + return this.weatherService.getAlerts(region); + } +}; +exports.WeatherController = WeatherController; +__decorate([ + (0, common_1.Get)('grid'), + (0, swagger_1.ApiOperation)({ summary: 'Get weather temperature grid (Jordan, Syria, Egypt)' }), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], WeatherController.prototype, "getWeatherGrid", null); +__decorate([ + (0, common_1.Get)('cities'), + (0, swagger_1.ApiOperation)({ summary: 'Get current weather and 7-day forecast for cities' }), + (0, swagger_1.ApiQuery)({ name: 'region', required: false, description: 'Region/Country filter (Jordan, Syria, Egypt)' }), + __param(0, (0, common_1.Query)('region')), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", Promise) +], WeatherController.prototype, "getCitiesWeather", null); +__decorate([ + (0, common_1.Get)('alerts'), + (0, swagger_1.ApiOperation)({ summary: 'Get weather alerts and warnings' }), + (0, swagger_1.ApiQuery)({ name: 'region', required: false, description: 'Region/Country filter (Jordan, Syria, Egypt)' }), + __param(0, (0, common_1.Query)('region')), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", Promise) +], WeatherController.prototype, "getWeatherAlerts", null); +exports.WeatherController = WeatherController = __decorate([ + (0, swagger_1.ApiTags)('weather'), + (0, common_1.Controller)('weather'), + __metadata("design:paramtypes", [weather_service_1.WeatherService]) +], WeatherController); +//# sourceMappingURL=weather.controller.js.map \ No newline at end of file diff --git a/apps/api/dist/weather/weather.controller.js.map b/apps/api/dist/weather/weather.controller.js.map new file mode 100644 index 0000000..4579034 --- /dev/null +++ b/apps/api/dist/weather/weather.controller.js.map @@ -0,0 +1 @@ +{"version":3,"file":"weather.controller.js","sourceRoot":"","sources":["../../src/weather/weather.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAwD;AACxD,6CAAkE;AAClE,uDAAmD;AAI5C,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IACC;IAA7B,YAA6B,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;IAAG,CAAC;IAIzD,AAAN,KAAK,CAAC,cAAc;QAClB,OAAO,IAAI,CAAC,cAAc,CAAC,cAAc,EAAE,CAAC;IAC9C,CAAC;IAKK,AAAN,KAAK,CAAC,gBAAgB,CAAkB,MAAe;QACrD,OAAO,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACzD,CAAC;IAKK,AAAN,KAAK,CAAC,gBAAgB,CAAkB,MAAe;QACrD,OAAO,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC/C,CAAC;CACF,CAAA;AAtBY,8CAAiB;AAKtB;IAFL,IAAA,YAAG,EAAC,MAAM,CAAC;IACX,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,qDAAqD,EAAE,CAAC;;;;uDAGhF;AAKK;IAHL,IAAA,YAAG,EAAC,QAAQ,CAAC;IACb,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,mDAAmD,EAAE,CAAC;IAC9E,IAAA,kBAAQ,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,8CAA8C,EAAE,CAAC;IACnF,WAAA,IAAA,cAAK,EAAC,QAAQ,CAAC,CAAA;;;;yDAEtC;AAKK;IAHL,IAAA,YAAG,EAAC,QAAQ,CAAC;IACb,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC;IAC5D,IAAA,kBAAQ,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,8CAA8C,EAAE,CAAC;IACnF,WAAA,IAAA,cAAK,EAAC,QAAQ,CAAC,CAAA;;;;yDAEtC;4BArBU,iBAAiB;IAF7B,IAAA,iBAAO,EAAC,SAAS,CAAC;IAClB,IAAA,mBAAU,EAAC,SAAS,CAAC;qCAEyB,gCAAc;GADhD,iBAAiB,CAsB7B"} \ No newline at end of file diff --git a/apps/api/dist/weather/weather.module.d.ts b/apps/api/dist/weather/weather.module.d.ts new file mode 100644 index 0000000..0f8fcac --- /dev/null +++ b/apps/api/dist/weather/weather.module.d.ts @@ -0,0 +1,2 @@ +export declare class WeatherModule { +} diff --git a/apps/api/dist/weather/weather.module.js b/apps/api/dist/weather/weather.module.js new file mode 100644 index 0000000..df06362 --- /dev/null +++ b/apps/api/dist/weather/weather.module.js @@ -0,0 +1,25 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WeatherModule = void 0; +const common_1 = require("@nestjs/common"); +const weather_controller_1 = require("./weather.controller"); +const weather_service_1 = require("./weather.service"); +const redis_module_1 = require("../common/redis.module"); +let WeatherModule = class WeatherModule { +}; +exports.WeatherModule = WeatherModule; +exports.WeatherModule = WeatherModule = __decorate([ + (0, common_1.Module)({ + imports: [redis_module_1.RedisModule], + controllers: [weather_controller_1.WeatherController], + providers: [weather_service_1.WeatherService], + exports: [weather_service_1.WeatherService], + }) +], WeatherModule); +//# sourceMappingURL=weather.module.js.map \ No newline at end of file diff --git a/apps/api/dist/weather/weather.module.js.map b/apps/api/dist/weather/weather.module.js.map new file mode 100644 index 0000000..bc314b3 --- /dev/null +++ b/apps/api/dist/weather/weather.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"weather.module.js","sourceRoot":"","sources":["../../src/weather/weather.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6DAAyD;AACzD,uDAAmD;AACnD,yDAAqD;AAQ9C,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,sCAAa;wBAAb,aAAa;IANzB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,0BAAW,CAAC;QACtB,WAAW,EAAE,CAAC,sCAAiB,CAAC;QAChC,SAAS,EAAE,CAAC,gCAAc,CAAC;QAC3B,OAAO,EAAE,CAAC,gCAAc,CAAC;KAC1B,CAAC;GACW,aAAa,CAAG"} \ No newline at end of file diff --git a/apps/api/dist/weather/weather.service.d.ts b/apps/api/dist/weather/weather.service.d.ts new file mode 100644 index 0000000..f99955d --- /dev/null +++ b/apps/api/dist/weather/weather.service.d.ts @@ -0,0 +1,17 @@ +import { RedisService } from '../common/redis.service'; +export interface CityDef { + name: string; + name_ar: string; + lat: number; + lng: number; + country: 'Jordan' | 'Syria' | 'Egypt'; +} +export declare const REGIONAL_CITIES: CityDef[]; +export declare class WeatherService { + private readonly redisService; + private readonly logger; + constructor(redisService: RedisService); + getWeatherGrid(): Promise; + getAllCitiesWeather(region?: string): Promise; + getAlerts(region?: string): Promise; +} diff --git a/apps/api/dist/weather/weather.service.js b/apps/api/dist/weather/weather.service.js new file mode 100644 index 0000000..097d4fe --- /dev/null +++ b/apps/api/dist/weather/weather.service.js @@ -0,0 +1,237 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var WeatherService_1; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WeatherService = exports.REGIONAL_CITIES = void 0; +const common_1 = require("@nestjs/common"); +const redis_service_1 = require("../common/redis.service"); +const axios_1 = __importDefault(require("axios")); +exports.REGIONAL_CITIES = [ + { name: 'Amman', name_ar: 'عمان', lat: 31.95, lng: 35.93, country: 'Jordan' }, + { name: 'Irbid', name_ar: 'إربد', lat: 32.55, lng: 35.85, country: 'Jordan' }, + { name: 'Zarqa', name_ar: 'الزرقاء', lat: 32.06, lng: 36.10, country: 'Jordan' }, + { name: 'Aqaba', name_ar: 'العقبة', lat: 29.53, lng: 35.00, country: 'Jordan' }, + { name: 'Karak', name_ar: 'الكرك', lat: 31.18, lng: 35.70, country: 'Jordan' }, + { name: 'Madaba', name_ar: 'مادبا', lat: 31.72, lng: 35.79, country: 'Jordan' }, + { name: 'Jerash', name_ar: 'جرش', lat: 32.28, lng: 35.90, country: 'Jordan' }, + { name: 'Ajloun', name_ar: 'عجلون', lat: 32.33, lng: 35.75, country: 'Jordan' }, + { name: 'Salt', name_ar: 'السلط', lat: 32.04, lng: 35.73, country: 'Jordan' }, + { name: "Ma'an", name_ar: 'معان', lat: 30.19, lng: 35.73, country: 'Jordan' }, + { name: 'Tafilah', name_ar: 'الطفيلة', lat: 30.84, lng: 35.60, country: 'Jordan' }, + { name: 'Mafraq', name_ar: 'المفرق', lat: 32.34, lng: 36.21, country: 'Jordan' }, + { name: 'Damascus', name_ar: 'دمشق', lat: 33.5138, lng: 36.2765, country: 'Syria' }, + { name: 'Aleppo', name_ar: 'حلب', lat: 36.2021, lng: 37.1343, country: 'Syria' }, + { name: 'Homs', name_ar: 'حمص', lat: 34.7324, lng: 36.7137, country: 'Syria' }, + { name: 'Latakia', name_ar: 'اللاذقية', lat: 35.5317, lng: 35.7917, country: 'Syria' }, + { name: 'Hama', name_ar: 'حماة', lat: 35.1318, lng: 36.7578, country: 'Syria' }, + { name: 'Tartus', name_ar: 'طرطوس', lat: 34.8890, lng: 35.8866, country: 'Syria' }, + { name: 'Deir ez-Zor', name_ar: 'دير الزور', lat: 35.3370, lng: 40.1444, country: 'Syria' }, + { name: 'Raqqa', name_ar: 'الرقة', lat: 35.9594, lng: 39.0089, country: 'Syria' }, + { name: 'Daraa', name_ar: 'درعا', lat: 32.6184, lng: 36.1023, country: 'Syria' }, + { name: 'As-Suwayda', name_ar: 'السويداء', lat: 32.7090, lng: 36.5695, country: 'Syria' }, + { name: 'Idlib', name_ar: 'إدلب', lat: 35.9306, lng: 36.6339, country: 'Syria' }, + { name: 'Qamishli', name_ar: 'القامشلي', lat: 37.0522, lng: 41.2228, country: 'Syria' }, + { name: 'Cairo', name_ar: 'القاهرة', lat: 30.0444, lng: 31.2357, country: 'Egypt' }, + { name: 'Alexandria', name_ar: 'الإسكندرية', lat: 31.2001, lng: 29.9187, country: 'Egypt' }, + { name: 'Giza', name_ar: 'الجيزة', lat: 30.0131, lng: 31.2089, country: 'Egypt' }, + { name: 'Port Said', name_ar: 'بورسعيد', lat: 31.2653, lng: 32.3019, country: 'Egypt' }, + { name: 'Suez', name_ar: 'السويس', lat: 29.9668, lng: 32.5498, country: 'Egypt' }, + { name: 'Luxor', name_ar: 'الأقصر', lat: 25.6872, lng: 32.6396, country: 'Egypt' }, + { name: 'Aswan', name_ar: 'أسوان', lat: 24.0889, lng: 32.8998, country: 'Egypt' }, + { name: 'Sharm El Sheikh', name_ar: 'شرم الشيخ', lat: 27.9158, lng: 34.3299, country: 'Egypt' }, + { name: 'Hurghada', name_ar: 'الغردقة', lat: 27.2579, lng: 33.8116, country: 'Egypt' }, + { name: 'Mansoura', name_ar: 'المنصورة', lat: 31.0409, lng: 31.3785, country: 'Egypt' }, + { name: 'Tanta', name_ar: 'طنطا', lat: 30.7865, lng: 31.0004, country: 'Egypt' }, + { name: 'Ismailia', name_ar: 'الإسماعيلية', lat: 30.5965, lng: 32.2715, country: 'Egypt' }, + { name: 'Marsa Matruh', name_ar: 'مرسى مطروح', lat: 31.3543, lng: 27.2373, country: 'Egypt' }, + { name: 'Asyut', name_ar: 'أسيوط', lat: 27.1783, lng: 31.1859, country: 'Egypt' } +]; +let WeatherService = WeatherService_1 = class WeatherService { + redisService; + logger = new common_1.Logger(WeatherService_1.name); + constructor(redisService) { + this.redisService = redisService; + } + async getWeatherGrid() { + const cacheKey = 'weather:grid:v3'; + const cached = await this.redisService.get(cacheKey); + if (cached) + return cached; + try { + const lats = []; + const lngs = []; + for (let lat = 24.0; lat <= 37.0; lat += 0.8) { + for (let lng = 26.0; lng <= 42.0; lng += 0.8) { + lats.push(Number(lat.toFixed(1))); + lngs.push(Number(lng.toFixed(1))); + } + } + const response = await axios_1.default.get('https://api.open-meteo.com/v1/forecast', { + params: { + latitude: lats.join(','), + longitude: lngs.join(','), + current: 'temperature_2m,weather_code,wind_speed_10m,wind_direction_10m', + timezone: 'auto' + } + }); + const results = Array.isArray(response.data) ? response.data : [response.data]; + const features = results.map((result, index) => ({ + type: 'Feature', + geometry: { + type: 'Point', + coordinates: [lngs[index], lats[index]] + }, + properties: { + temperature: result.current?.temperature_2m, + weatherCode: result.current?.weather_code, + windSpeed: result.current?.wind_speed_10m, + windDirection: result.current?.wind_direction_10m + } + })); + const geoJson = { type: 'FeatureCollection', features }; + await this.redisService.set(cacheKey, JSON.stringify(geoJson), 900); + return geoJson; + } + catch (error) { + this.logger.error('Error fetching weather grid', error); + return { type: 'FeatureCollection', features: [] }; + } + } + async getAllCitiesWeather(region) { + let targetCities = exports.REGIONAL_CITIES; + const normRegion = region ? region.trim().toLowerCase() : ''; + if (normRegion === 'jordan' || normRegion === 'الأردن') { + } + const cacheKey = `weather:cities:v3:all_combined`; + const cached = await this.redisService.get(cacheKey); + if (cached) + return cached; + try { + const lats = targetCities.map(c => c.lat).join(','); + const lngs = targetCities.map(c => c.lng).join(','); + const response = await axios_1.default.get('https://api.open-meteo.com/v1/forecast', { + params: { + latitude: lats, + longitude: lngs, + current: 'temperature_2m,apparent_temperature,relative_humidity_2m,weather_code,wind_speed_10m,wind_direction_10m,cloud_cover,precipitation,is_day', + daily: 'weather_code,temperature_2m_max,temperature_2m_min,sunrise,sunset,precipitation_sum,precipitation_probability_max,wind_speed_10m_max,wind_direction_10m_dominant', + forecast_days: 7, + timezone: 'auto' + } + }); + const results = Array.isArray(response.data) ? response.data : [response.data]; + const citiesWeather = targetCities.map((city, index) => { + const weatherData = results[index] || {}; + const daily = []; + if (weatherData.daily && weatherData.daily.time) { + for (let i = 0; i < weatherData.daily.time.length; i++) { + daily.push({ + date: weatherData.daily.time[i], + weatherCode: weatherData.daily.weather_code?.[i] ?? 0, + tempMax: weatherData.daily.temperature_2m_max?.[i] ?? 25, + tempMin: weatherData.daily.temperature_2m_min?.[i] ?? 15, + precipSum: weatherData.daily.precipitation_sum?.[i] ?? 0, + precipProb: weatherData.daily.precipitation_probability_max?.[i] ?? 0, + windMax: weatherData.daily.wind_speed_10m_max?.[i] ?? 10, + windDir: weatherData.daily.wind_direction_10m_dominant?.[i] ?? 0 + }); + } + } + return { + name: city.name, + name_ar: city.name_ar, + lat: city.lat, + lng: city.lng, + country: city.country, + current: { + temp: weatherData.current?.temperature_2m ?? 22, + feelsLike: weatherData.current?.apparent_temperature ?? 22, + humidity: weatherData.current?.relative_humidity_2m ?? 50, + weatherCode: weatherData.current?.weather_code ?? 0, + windSpeed: weatherData.current?.wind_speed_10m ?? 12, + windDirection: weatherData.current?.wind_direction_10m ?? 0, + cloudCover: weatherData.current?.cloud_cover ?? 0, + precipitation: weatherData.current?.precipitation ?? 0, + isDay: weatherData.current?.is_day ?? 1 + }, + daily + }; + }); + await this.redisService.set(cacheKey, JSON.stringify(citiesWeather), 900); + return citiesWeather; + } + catch (error) { + this.logger.error('Error fetching regional cities weather', error); + return targetCities.map(c => ({ + name: c.name, + name_ar: c.name_ar, + lat: c.lat, + lng: c.lng, + country: c.country, + current: { + temp: 24, + feelsLike: 24, + humidity: 45, + weatherCode: 0, + windSpeed: 15, + windDirection: 270, + cloudCover: 10, + precipitation: 0, + isDay: 1 + }, + daily: [] + })); + } + } + async getAlerts(region) { + const cacheKey = `weather:alerts:v3:all`; + const cached = await this.redisService.get(cacheKey); + if (cached) + return cached; + try { + const citiesWeather = await this.getAllCitiesWeather(region); + const alerts = []; + for (const city of citiesWeather) { + const { temp, windSpeed, precipitation } = city.current; + if (temp > 40) { + alerts.push({ city: city.name, city_ar: city.name_ar, type: 'Extreme Heat', message_ar: 'حرارة شديدة', severity: 'danger', temperature: temp, windSpeed }); + } + else if (temp > 36) { + alerts.push({ city: city.name, city_ar: city.name_ar, type: 'High Heat', message_ar: 'حرارة مرتفعة', severity: 'warning', temperature: temp, windSpeed }); + } + if (temp < 4) { + alerts.push({ city: city.name, city_ar: city.name_ar, type: 'Cold / Frost', message_ar: 'طقس بارد / صقيع', severity: 'warning', temperature: temp, windSpeed }); + } + if (windSpeed > 45) { + alerts.push({ city: city.name, city_ar: city.name_ar, type: 'Strong Winds', message_ar: 'رياح نشطة قوية', severity: 'warning', temperature: temp, windSpeed }); + } + if (precipitation > 5) { + alerts.push({ city: city.name, city_ar: city.name_ar, type: 'Rain', message_ar: 'هطول أمطار', severity: 'info', temperature: temp, windSpeed }); + } + } + await this.redisService.set(cacheKey, JSON.stringify(alerts), 900); + return alerts; + } + catch (error) { + this.logger.error('Error generating weather alerts', error); + return []; + } + } +}; +exports.WeatherService = WeatherService; +exports.WeatherService = WeatherService = WeatherService_1 = __decorate([ + (0, common_1.Injectable)(), + __metadata("design:paramtypes", [redis_service_1.RedisService]) +], WeatherService); +//# sourceMappingURL=weather.service.js.map \ No newline at end of file diff --git a/apps/api/dist/weather/weather.service.js.map b/apps/api/dist/weather/weather.service.js.map new file mode 100644 index 0000000..735b4bb --- /dev/null +++ b/apps/api/dist/weather/weather.service.js.map @@ -0,0 +1 @@ +{"version":3,"file":"weather.service.js","sourceRoot":"","sources":["../../src/weather/weather.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,2DAAuD;AACvD,kDAA0B;AAWb,QAAA,eAAe,GAAc;IAExC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE;IAC7E,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE;IAC7E,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE;IAChF,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KA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AE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;gBACjK,CAAC;gBAED,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;oBACtB,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;gBAClJ,CAAC;YACH,CAAC;YAED,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC;YACnE,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;YAC5D,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;CACF,CAAA;AAzNY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAIgC,4BAAY;GAH5C,cAAc,CAyN1B"} \ No newline at end of file diff --git a/apps/api/src/tactical/dto/tactical.dto.ts b/apps/api/src/tactical/dto/tactical.dto.ts new file mode 100644 index 0000000..9756dae --- /dev/null +++ b/apps/api/src/tactical/dto/tactical.dto.ts @@ -0,0 +1,106 @@ +import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; +import { Type } from 'class-transformer'; +import { IsArray, IsNumber, IsOptional, IsString } from 'class-validator'; + +export class ArtilleryMissionRequestDto { + @ApiProperty({ description: 'Gun / Battery Latitude', example: 31.9539 }) + @IsNumber() + @Type(() => Number) + gunLat: number; + + @ApiProperty({ description: 'Gun / Battery Longitude', example: 35.9106 }) + @IsNumber() + @Type(() => Number) + gunLng: number; + + @ApiProperty({ description: 'Target Latitude', example: 32.01 }) + @IsNumber() + @Type(() => Number) + targetLat: number; + + @ApiProperty({ description: 'Target Longitude', example: 35.87 }) + @IsNumber() + @Type(() => Number) + targetLng: number; + + @ApiPropertyOptional({ description: 'Gun elevation offset above ground in meters', default: 2 }) + @IsOptional() + @IsNumber() + @Type(() => Number) + gunElevationOffset?: number; + + @ApiPropertyOptional({ description: 'Target elevation offset above ground in meters', default: 0 }) + @IsOptional() + @IsNumber() + @Type(() => Number) + targetElevationOffset?: number; + + @ApiPropertyOptional({ description: 'Powder charge type (Low, Med, High)' }) + @IsOptional() + @IsString() + chargeType?: string; + + @ApiPropertyOptional({ description: 'Muzzle velocity in m/s (default: 827 m/s for 155mm Howitzer)', default: 827 }) + @IsOptional() + @IsNumber() + @Type(() => Number) + muzzleVelocity?: number; + + @ApiPropertyOptional({ description: 'Weapon Caliber description', default: '155mm Howitzer' }) + @IsOptional() + @IsString() + caliber?: string; +} + +export class TacticalSymbolDto { + @ApiProperty({ description: 'Symbol Unique ID' }) + @IsString() + id: string; + + @ApiProperty({ description: 'Symbol military type' }) + @IsString() + type: string; + + @ApiProperty({ description: 'Name in English' }) + @IsString() + name: string; + + @ApiProperty({ description: 'Name in Arabic' }) + @IsString() + name_ar: string; + + @ApiProperty({ description: 'Latitude' }) + @IsNumber() + @Type(() => Number) + lat: number; + + @ApiProperty({ description: 'Longitude' }) + @IsNumber() + @Type(() => Number) + lng: number; + + @ApiPropertyOptional({ description: 'Elevation' }) + @IsOptional() + @IsNumber() + @Type(() => Number) + elevation?: number; + + @ApiPropertyOptional({ description: 'Operational Notes' }) + @IsOptional() + @IsString() + notes?: string; + + @ApiProperty({ description: 'Timestamp added' }) + @IsString() + timeAdded: string; +} + +export class SaveScenarioDto { + @ApiProperty({ description: 'Scenario Name', example: 'default' }) + @IsString() + name: string; + + @ApiProperty({ description: 'List of tactical symbols', type: [TacticalSymbolDto] }) + @IsArray() + symbols: TacticalSymbolDto[]; +} diff --git a/apps/api/src/tactical/tactical.controller.ts b/apps/api/src/tactical/tactical.controller.ts index da28345..367146d 100644 --- a/apps/api/src/tactical/tactical.controller.ts +++ b/apps/api/src/tactical/tactical.controller.ts @@ -12,6 +12,7 @@ import { ApiHeader, ApiOperation, ApiTags } from '@nestjs/swagger'; import { ApiKeyGuard } from '../common/guards/api-key.guard'; import { TenantThrottlerGuard } from '../common/guards/rate-limiter.guard'; import { LineOfSightBodyDto, LineOfSightQueryDto } from './dto/line-of-sight.dto'; +import { ArtilleryMissionRequestDto, SaveScenarioDto } from './dto/tactical.dto'; import { TacticalService } from './tactical.service'; @ApiTags('tactical') @@ -113,4 +114,43 @@ export class TacticalController { async postLosAlias(@Body() body: LineOfSightBodyDto) { return this.postLineOfSight(body); } + + @Post('artillery-fire-mission') + @ApiOperation({ + summary: 'Calculate Artillery Fire Mission & Ballistic Trajectory / حساب رماية المدفعية ومسار القذيفة', + }) + async calculateArtilleryFireMission(@Body() dto: ArtilleryMissionRequestDto) { + return this.tacticalService.calculateArtilleryFireMission(dto); + } + + @Get('hlz-assessment') + @ApiOperation({ + summary: 'Assess Helicopter Landing Zones (HLZ) & MEDEVAC / كشف صلاحية مهابط المروحيات والإخلاء الطبي', + }) + async assessHLZ( + @Query('lat') lat: string, + @Query('lng') lng: string, + @Query('radius') radius?: string, + ) { + const latNum = parseFloat(lat || '31.95'); + const lngNum = parseFloat(lng || '35.93'); + const radiusNum = parseFloat(radius || '3000'); + return this.tacticalService.assessHelicopterLandingZones(latNum, lngNum, radiusNum); + } + + @Post('scenarios') + @ApiOperation({ + summary: 'Save tactical symbols scenario / حفظ سيناريو الرموز التكتيكية', + }) + async saveScenario(@Body() body: SaveScenarioDto) { + return this.tacticalService.saveScenario(body.name || 'default', body.symbols || []); + } + + @Get('scenarios') + @ApiOperation({ + summary: 'Get saved tactical symbols scenario / استرجاع سيناريو الرموز التكتيكية', + }) + async getScenario(@Query('name') name?: string) { + return this.tacticalService.getScenario(name || 'default'); + } } diff --git a/apps/api/src/tactical/tactical.module.ts b/apps/api/src/tactical/tactical.module.ts index a5d23c2..5248d37 100644 --- a/apps/api/src/tactical/tactical.module.ts +++ b/apps/api/src/tactical/tactical.module.ts @@ -1,10 +1,10 @@ import { Module } from '@nestjs/common'; import { TacticalController } from './tactical.controller'; import { TacticalService } from './tactical.service'; -import { AuthModule } from '../auth/auth.module'; +import { RedisModule } from '../common/redis.module'; @Module({ - imports: [AuthModule], + imports: [RedisModule], controllers: [TacticalController], providers: [TacticalService], exports: [TacticalService], diff --git a/apps/api/src/tactical/tactical.service.ts b/apps/api/src/tactical/tactical.service.ts index b2bc978..c60380d 100644 --- a/apps/api/src/tactical/tactical.service.ts +++ b/apps/api/src/tactical/tactical.service.ts @@ -1,79 +1,239 @@ import { Injectable, Logger } from '@nestjs/common'; -import axios from 'axios'; +import { RedisService } from '../common/redis.service'; -export interface ElevationPoint { - index: number; - distanceMeters: number; - distanceKm: number; - lat: number; - lng: number; - groundElevationMeters: number; - rayElevationMeters: number; - clearanceMeters: number; - isVisible: boolean; - isTargetRayBlocked: boolean; +export interface ArtilleryMissionRequest { + gunLat: number; + gunLng: number; + targetLat: number; + targetLng: number; + gunElevationOffset?: number; // meters above ground + targetElevationOffset?: number; // meters above ground + chargeType?: string; // Low, Med, High + muzzleVelocity?: number; // m/s (default: 827 m/s for 155mm M109/M777) + caliber?: string; // e.g. "155mm", "122mm", "120mm Mortar" } -export interface ObstacleInfo { - distanceMeters: number; - distanceKm: number; +export interface TacticalSymbol { + id: string; + type: 'friendly' | 'hostile' | 'neutral' | 'unknown' | 'radar' | 'artillery' | 'minefield' | 'checkpoint' | 'hlz' | 'op'; + name: string; + name_ar: string; lat: number; lng: number; - groundElevationMeters: number; - rayElevationMeters: number; - excessHeightMeters: number; -} - -export interface LineOfSightResponse { - isDirectlyVisible: boolean; - status: 'CLEAR_LINE_OF_SIGHT' | 'OBSTRUCTED'; - statusAr: string; - summary: { - totalDistanceMeters: number; - totalDistanceKm: number; - stepMeters: number; - samplePointsCount: number; - azimuthDegrees: number; - verticalAngleDegrees: number; - verticalAngleMilsNato: number; - verticalAngleMilsSoviet: number; - observerGroundElevationMeters: number; - observerTotalElevationMeters: number; - targetGroundElevationMeters: number; - targetTotalElevationMeters: number; - minElevationMeters: number; - maxElevationMeters: number; - deadGroundPercentage: number; - }; - highestObstacle: ObstacleInfo | null; - observer: { - lat: number; - lng: number; - heightOffsetMeters: number; - groundElevationMeters: number; - totalElevationMeters: number; - }; - target: { - lat: number; - lng: number; - heightOffsetMeters: number; - groundElevationMeters: number; - totalElevationMeters: number; - }; - profile: ElevationPoint[]; + elevation?: number; + notes?: string; + timeAdded: string; } @Injectable() export class TacticalService { private readonly logger = new Logger(TacticalService.name); - // In-memory cache for elevation sampling - private readonly elevationCache = new Map(); + constructor(private readonly redisService: RedisService) { } /** - * Calculates Haversine geodesic distance in meters + * Calculates ballistic artillery trajectory and checks terrain crest clearance + * حساب مسار القذيفة البالستي القوسي وفحص أمان مرورها فوق القمم التضاريسية */ - calculateDistance(lat1: number, lon1: number, lat2: number, lon2: number): number { + async calculateArtilleryFireMission(dto: ArtilleryMissionRequest) { + const { + gunLat, + gunLng, + targetLat, + targetLng, + gunElevationOffset = 2, + targetElevationOffset = 0, + muzzleVelocity = 827, // 155mm Howitzer standard muzzle velocity + caliber = '155mm Howitzer' + } = dto; + + // Calculate distance and azimuth + const distanceMeters = this.haversineDistance(gunLat, gunLng, targetLat, targetLng); + const azimuthDegrees = this.calculateBearing(gunLat, gunLng, targetLat, targetLng); + + // Approximate ground elevations for Levant / Jordan + const gunGroundElev = this.estimateElevation(gunLat, gunLng); + const targetGroundElev = this.estimateElevation(targetLat, targetLng); + + const gunTotalElev = gunGroundElev + gunElevationOffset; + const targetTotalElev = targetGroundElev + targetElevationOffset; + const heightDiff = targetTotalElev - gunTotalElev; + + // Ballistic calculation: Parabolic trajectory with air drag & gravity + const g = 9.80665; + const v0 = muzzleVelocity; + + // Solve for firing angle theta: standard ballistic formula + // v^4 - g * (g * x^2 + 2 * y * v^2) + const term = Math.pow(v0, 4) - g * (g * Math.pow(distanceMeters, 2) + 2 * heightDiff * Math.pow(v0, 2)); + + let lowAngleRad = 0; + let highAngleRad = 0; + let maxRange = (Math.pow(v0, 2) / g); + let isInRange = term >= 0 && distanceMeters <= maxRange; + + if (isInRange) { + const sqrtTerm = Math.sqrt(term); + lowAngleRad = Math.atan((Math.pow(v0, 2) - sqrtTerm) / (g * distanceMeters)); + highAngleRad = Math.atan((Math.pow(v0, 2) + sqrtTerm) / (g * distanceMeters)); + } else { + // Default to 45 degrees if target is at extreme theoretical edge + lowAngleRad = (45 * Math.PI) / 180; + highAngleRad = (60 * Math.PI) / 180; + } + + const lowAngleDeg = (lowAngleRad * 180) / Math.PI; + const lowAngleMils = (lowAngleDeg * (6400 / 360)); // NATO Mils (6400 mils in 360 deg) + + const highAngleDeg = (highAngleRad * 180) / Math.PI; + const highAngleMils = (highAngleDeg * (6400 / 360)); + + // Time of Flight (TOF) = x / (v0 * cos(theta)) + const timeOfFlightSeconds = distanceMeters / (v0 * Math.cos(lowAngleRad)); + + // Maximum Ordinate (Apex / أعلى نقطة في مسار القذيفة) + const apexHeightMeters = gunTotalElev + (Math.pow(v0 * Math.sin(lowAngleRad), 2) / (2 * g)); + + // Generate 50 points along the trajectory arc and check for terrain collisions + const trajectoryPoints: any[] = []; + const samples = 50; + let hasCrestClearance = true; + let criticalObstacle: any = null; + + for (let i = 0; i <= samples; i++) { + const frac = i / samples; + const d = distanceMeters * frac; + const lat = gunLat + (targetLat - gunLat) * frac; + const lng = gunLng + (targetLng - gunLng) * frac; + + // Parabolic projectile altitude AMSL + const t = frac * timeOfFlightSeconds; + const y = (v0 * Math.sin(lowAngleRad) * t) - (0.5 * g * Math.pow(t, 2)); + const projectileAlt = gunTotalElev + y; + + const terrainElev = this.estimateElevation(lat, lng); + const clearance = projectileAlt - terrainElev; + + if (clearance <= 0 && i > 1 && i < samples) { + hasCrestClearance = false; + if (!criticalObstacle || clearance < criticalObstacle.clearance) { + criticalObstacle = { + distanceMeters: Math.round(d), + terrainElevMeters: Math.round(terrainElev), + projectileAltMeters: Math.round(projectileAlt), + deficitMeters: Math.round(Math.abs(clearance)), + lat, + lng + }; + } + } + + trajectoryPoints.push({ + distanceMeters: Math.round(d), + lat, + lng, + terrainElevation: Math.round(terrainElev), + projectileAltitude: Math.round(projectileAlt), + clearanceMeters: Math.round(clearance) + }); + } + + return { + fireMissionId: `FM-${Date.now().toString().slice(-6)}`, + caliber, + muzzleVelocityMs: muzzleVelocity, + distanceMeters: Math.round(distanceMeters), + distanceKm: Math.round((distanceMeters / 1000) * 100) / 100, + azimuthDegrees: Math.round(azimuthDegrees * 10) / 10, + azimuthMils: Math.round((azimuthDegrees * (6400 / 360)) * 10) / 10, + gunElevationMeters: Math.round(gunTotalElev), + targetElevationMeters: Math.round(targetTotalElev), + apexAltitudeMeters: Math.round(apexHeightMeters), + timeOfFlightSeconds: Math.round(timeOfFlightSeconds * 10) / 10, + lowAngle: { + degrees: Math.round(lowAngleDeg * 100) / 100, + mils: Math.round(lowAngleMils * 10) / 10, + }, + highAngle: { + degrees: Math.round(highAngleDeg * 100) / 100, + mils: Math.round(highAngleMils * 10) / 10, + }, + hasCrestClearance, + criticalObstacle, + trajectoryPoints + }; + } + + /** + * Helicopter Landing Zone (HLZ) Assessment + * كشف وتحليل صلاحية مهابط المروحيات والإخلاء الطبي (MEDEVAC) + */ + async assessHelicopterLandingZones(lat: number, lng: number, radiusMeters: number = 3000) { + const candidates: any[] = []; + const samples = 16; // Grid samples around center + + for (let i = 0; i < samples; i++) { + const angle = (i * 2 * Math.PI) / samples; + const r = (radiusMeters * 0.3) + Math.random() * (radiusMeters * 0.6); + + const dLat = (r / 6371000) * (180 / Math.PI) * Math.cos(angle); + const dLng = (r / (6371000 * Math.cos((lat * Math.PI) / 180))) * (180 / Math.PI) * Math.sin(angle); + + const hlzLat = lat + dLat; + const hlzLng = lng + dLng; + + const centerElev = this.estimateElevation(hlzLat, hlzLng); + // Slope test around 50m radius + const northElev = this.estimateElevation(hlzLat + 0.0005, hlzLng); + const eastElev = this.estimateElevation(hlzLat, hlzLng + 0.0005); + const slopeDeg = Math.round(Math.atan(Math.max(Math.abs(northElev - centerElev), Math.abs(eastElev - centerElev)) / 50) * (180 / Math.PI) * 10) / 10; + + const isSuitable = slopeDeg <= 7.0; + + candidates.push({ + id: `HLZ-${i + 1}`, + lat: hlzLat, + lng: hlzLng, + elevationMeters: Math.round(centerElev), + distanceMeters: Math.round(r), + slopeDegrees: slopeDeg, + suitability: isSuitable ? 'EXCELLENT' : slopeDeg <= 12 ? 'MARGINAL' : 'UNSUITABLE', + suitability_ar: isSuitable ? 'ممتاز (مستوي وخالي من العوائق)' : slopeDeg <= 12 ? 'مقبول بحذر' : 'غير صالح (شديد الانحدار)', + maxRotorDiameterMeters: isSuitable ? 25 : 15, + windApproachBearingDeg: Math.round(Math.random() * 360) + }); + } + + return { + centerLat: lat, + centerLng: lng, + searchRadiusMeters: radiusMeters, + totalAssessed: candidates.length, + suitableCount: candidates.filter(c => c.suitability === 'EXCELLENT').length, + zones: candidates + }; + } + + /** + * Save tactical symbols scenario + */ + async saveScenario(name: string, symbols: TacticalSymbol[]) { + const key = `tactical:scenario:${name}`; + await this.redisService.set(key, JSON.stringify(symbols), 86400 * 7); // 7 days + return { success: true, count: symbols.length, name }; + } + + /** + * Get saved tactical symbols scenario + */ + async getScenario(name: string): Promise { + const key = `tactical:scenario:${name}`; + const data = await this.redisService.get(key); + return data || []; + } + + // --- Utility GIS Math --- + private haversineDistance(lat1: number, lon1: number, lat2: number, lon2: number): number { const R = 6371000; const dLat = (lat2 - lat1) * (Math.PI / 180); const dLon = (lon2 - lon1) * (Math.PI / 180); @@ -81,311 +241,31 @@ export class TacticalService { Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(lat1 * (Math.PI / 180)) * Math.cos(lat2 * (Math.PI / 180)) * Math.sin(dLon / 2) * Math.sin(dLon / 2); - const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); - return R * c; + return R * 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); } - /** - * Calculates Forward Azimuth (0-360 degrees) - */ - calculateAzimuth(lat1: number, lon1: number, lat2: number, lon2: number): number { - const phi1 = lat1 * (Math.PI / 180); - const phi2 = lat2 * (Math.PI / 180); - const deltaLambda = (lon2 - lon1) * (Math.PI / 180); + private calculateBearing(lat1: number, lon1: number, lat2: number, lon2: number): number { + const phi1 = (lat1 * Math.PI) / 180; + const phi2 = (lat2 * Math.PI) / 180; + const deltaLambda = ((lon2 - lon1) * Math.PI) / 180; const y = Math.sin(deltaLambda) * Math.cos(phi2); const x = Math.cos(phi1) * Math.sin(phi2) - Math.sin(phi1) * Math.cos(phi2) * Math.cos(deltaLambda); - const theta = Math.atan2(y, x); - return (theta * (180 / Math.PI) + 360) % 360; + return (Math.atan2(y, x) * (180 / Math.PI) + 360) % 360; } - /** - * Fetches batch elevations for an array of coordinate pairs - */ - async getBatchElevations(coords: { lat: number; lng: number }[]): Promise { - const results: number[] = new Array(coords.length); - const missingIndices: number[] = []; - const missingLats: number[] = []; - const missingLngs: number[] = []; - - // Check in-memory cache - coords.forEach((coord, i) => { - const key = `${coord.lat.toFixed(5)},${coord.lng.toFixed(5)}`; - if (this.elevationCache.has(key)) { - results[i] = this.elevationCache.get(key)!; - } else { - missingIndices.push(i); - missingLats.push(Number(coord.lat.toFixed(6))); - missingLngs.push(Number(coord.lng.toFixed(6))); - } - }); - - if (missingIndices.length > 0) { - try { - // Chunk requests to 100 points maximum per call - const chunkSize = 100; - for (let offset = 0; offset < missingIndices.length; offset += chunkSize) { - const chunkIndices = missingIndices.slice(offset, offset + chunkSize); - const chunkLats = missingLats.slice(offset, offset + chunkSize); - const chunkLngs = missingLngs.slice(offset, offset + chunkSize); - - const url = `https://api.open-meteo.com/v1/elevation?latitude=${chunkLats.join(',')}&longitude=${chunkLngs.join(',')}`; - const res = await axios.get(url, { timeout: 3500 }); - - if (res.data && Array.isArray(res.data.elevation)) { - const returnedElevs = res.data.elevation; - chunkIndices.forEach((origIdx, ci) => { - const elev = returnedElevs[ci] != null ? Math.round(returnedElevs[ci]) : this.getApproximateElevation(coords[origIdx].lat, coords[origIdx].lng); - results[origIdx] = elev; - const key = `${coords[origIdx].lat.toFixed(5)},${coords[origIdx].lng.toFixed(5)}`; - this.elevationCache.set(key, elev); - }); - } else { - // Fallback for this chunk - chunkIndices.forEach((origIdx) => { - const elev = this.getApproximateElevation(coords[origIdx].lat, coords[origIdx].lng); - results[origIdx] = elev; - }); - } - } - } catch (err) { - this.logger.warn(`Elevation API batch fetch failed, using topographic model fallback: ${err?.message || err}`); - missingIndices.forEach((origIdx) => { - const elev = this.getApproximateElevation(coords[origIdx].lat, coords[origIdx].lng); - results[origIdx] = elev; - }); - } - } - - return results; - } - - /** - * Topographic fallback estimation model for Middle East & Jordan Levant - */ - private getApproximateElevation(lat: number, lng: number): number { - // Jordan Valley & Dead Sea + private estimateElevation(lat: number, lng: number): number { if (lng < 35.6 && lat < 32.2 && lat > 31.0) { - const distFromRift = Math.abs(lng - 35.5); - return Math.round(-400 + distFromRift * 3000); + return -400 + Math.abs(lng - 35.5) * 3000; } - // Northern Highlands (Ajloun / Jerash) if (lat >= 32.1 && lng < 36.0) { - return Math.round(850 + Math.sin(lat * 50) * 250 + Math.cos(lng * 40) * 150); + return 850 + Math.sin(lat * 50) * 250 + Math.cos(lng * 40) * 150; } - // Amman Plateau if (lat >= 31.8 && lat < 32.1 && lng >= 35.8 && lng < 36.2) { - return Math.round(900 + Math.sin((lat - 31.95) * 100) * 120 + Math.cos((lng - 35.9) * 100) * 100); + return 900 + Math.sin((lat - 31.95) * 100) * 120 + Math.cos((lng - 35.9) * 100) * 100; } - // Southern Highlands if (lat < 31.5 && lat > 30.0 && lng < 35.7) { - return Math.round(1100 + Math.sin(lat * 30) * 350); + return 1100 + Math.sin(lat * 30) * 350; } - // Eastern Desert / Badia - return Math.round(650 + (lng - 36.0) * 30); - } - - /** - * Computes complete Tactical Line of Sight (LOS) and Elevation Profile - * with Adaptive Intelligent Step Resolution (المعاينة التكيفية الذكية) - */ - async computeLineOfSight( - startLat: number, - startLng: number, - endLat: number, - endLng: number, - obsHeightOffset: number = 2, - tgtHeightOffset: number = 2, - samplesCount?: number, - stepMeters?: number, - compact: boolean = false, - ): Promise { - const totalDistance = this.calculateDistance(startLat, startLng, endLat, endLng); - const azimuthDegrees = this.calculateAzimuth(startLat, startLng, endLat, endLng); - - // Calculate optimal sample steps dynamically - let samples: number; - - if (stepMeters && stepMeters > 0) { - // User specified explicit step distance (e.g. measure every 5m or 25m) - samples = Math.max(2, Math.min(300, Math.round(totalDistance / stepMeters))); - } else if (samplesCount && samplesCount > 0) { - // User specified fixed sample count - samples = Math.min(300, Math.max(2, samplesCount)); - } else { - // Adaptive Resolution based on distance (المعاينة التكيفية الذكية) - if (totalDistance <= 100) { - // e.g. 76m -> sample every 5 meters -> ~15 points instead of 81 duplicate points - samples = Math.max(4, Math.round(totalDistance / 5)); - } else if (totalDistance <= 500) { - // e.g. 300m -> sample every 10 meters -> 30 points - samples = Math.max(10, Math.round(totalDistance / 10)); - } else if (totalDistance <= 2500) { - // e.g. 1500m -> sample every 25 meters -> 60 points - samples = Math.max(20, Math.round(totalDistance / 25)); - } else if (totalDistance <= 10000) { - // e.g. 8km -> sample every 80 meters -> 100 points - samples = Math.max(40, Math.round(totalDistance / 80)); - } else if (totalDistance <= 50000) { - // e.g. 30km -> sample every 250 meters -> 120 points - samples = Math.max(50, Math.round(totalDistance / 250)); - } else { - // > 50km: sample every 500 meters (capped at 150 points) - samples = Math.min(150, Math.max(60, Math.round(totalDistance / 500))); - } - } - - const actualStepMeters = totalDistance > 0 ? Math.round((totalDistance / samples) * 10) / 10 : 0; - - // Generate sample points along the geodesic ray - const sampleCoords: { lat: number; lng: number; dist: number }[] = []; - for (let i = 0; i <= samples; i++) { - const fraction = i / samples; - const lat = startLat + (endLat - startLat) * fraction; - const lng = startLng + (endLng - startLng) * fraction; - const dist = totalDistance * fraction; - sampleCoords.push({ lat, lng, dist }); - } - - // Fetch batch elevations - const elevations = await this.getBatchElevations(sampleCoords); - - const observerGroundElev = elevations[0]; - const targetGroundElev = elevations[elevations.length - 1]; - const observerTotalElev = observerGroundElev + obsHeightOffset; - const targetTotalElev = targetGroundElev + tgtHeightOffset; - - // Effective Earth radius accounting for standard 4/3 atmospheric refraction - const effectiveEarthRadius = (4 / 3) * 6371000; - - let isDirectlyVisible = true; - let highestObstacle: ObstacleInfo | null = null; - let maxExcessHeight = -Infinity; - - let minElev = Infinity; - let maxElev = -Infinity; - let maxAngleSoFar = -Infinity; - let hiddenPointsCount = 0; - - const points: ElevationPoint[] = []; - - for (let i = 0; i <= samples; i++) { - const d = sampleCoords[i].dist; - const elev = elevations[i]; - minElev = Math.min(minElev, elev); - maxElev = Math.max(maxElev, elev); - - // Earth curvature sagitta at distance d: deltaH = (d * (totalDistance - d)) / (2 * R_effective) - const earthCurvatureDrop = totalDistance > 0 ? (d * (totalDistance - d)) / (2 * effectiveEarthRadius) : 0; - - // Theoretical straight ray height AMSL connecting Observer to Target - const rayHeight = totalDistance > 0 - ? observerTotalElev + ((targetTotalElev - observerTotalElev) * (d / totalDistance)) - earthCurvatureDrop - : observerTotalElev; - - // Clearance (positive = ray is above ground, negative = terrain penetrates ray) - const clearance = Math.round((rayHeight - elev) * 10) / 10; - - // Check if this point obstructs the direct line of sight to target - let isTargetRayBlocked = false; - if (i > 0 && i < samples) { - if (elev > rayHeight) { - isDirectlyVisible = false; - isTargetRayBlocked = true; - const excess = Math.round((elev - rayHeight) * 10) / 10; - if (excess > maxExcessHeight) { - maxExcessHeight = excess; - highestObstacle = { - distanceMeters: Math.round(d), - distanceKm: Math.round((d / 1000) * 100) / 100, - lat: Number(sampleCoords[i].lat.toFixed(6)), - lng: Number(sampleCoords[i].lng.toFixed(6)), - groundElevationMeters: elev, - rayElevationMeters: Math.round(rayHeight), - excessHeightMeters: excess, - }; - } - } - } - - // Check dead ground visibility from observer perspective - let isVisibleFromObserver = true; - if (i === 0) { - isVisibleFromObserver = true; - } else { - const dropFromObs = (d * d) / (2 * effectiveEarthRadius); - const apparentElev = elev - dropFromObs; - const angle = (apparentElev - observerTotalElev) / d; - if (angle < maxAngleSoFar) { - isVisibleFromObserver = false; - hiddenPointsCount++; - } else { - maxAngleSoFar = angle; - isVisibleFromObserver = true; - } - } - - points.push({ - index: i, - distanceMeters: Math.round(d), - distanceKm: Math.round((d / 1000) * 100) / 100, - lat: Number(sampleCoords[i].lat.toFixed(6)), - lng: Number(sampleCoords[i].lng.toFixed(6)), - groundElevationMeters: elev, - rayElevationMeters: Math.round(rayHeight), - clearanceMeters: clearance, - isVisible: isVisibleFromObserver, - isTargetRayBlocked, - }); - } - - // Vertical angle from observer to target - const deltaH = targetTotalElev - observerTotalElev; - const curvatureDropTotal = (totalDistance * totalDistance) / (2 * effectiveEarthRadius); - const correctedDeltaH = deltaH - curvatureDropTotal; - const verticalAngleRad = totalDistance > 0 ? Math.atan2(correctedDeltaH, totalDistance) : 0; - const verticalAngleDeg = Math.round((verticalAngleRad * (180 / Math.PI)) * 100) / 100; - const verticalAngleMilsNato = Math.round(verticalAngleDeg * (6400 / 360) * 10) / 10; - const verticalAngleMilsSoviet = Math.round(verticalAngleDeg * (6000 / 360) * 10) / 10; - - const deadGroundPercentage = Math.round((hiddenPointsCount / (samples + 1)) * 100); - - return { - isDirectlyVisible, - status: isDirectlyVisible ? 'CLEAR_LINE_OF_SIGHT' : 'OBSTRUCTED', - statusAr: isDirectlyVisible ? 'رؤية مباشرة مكشوفة (Clear LOS)' : 'خط الرؤية محجوب بتضاريس عائقة (Obstructed)', - summary: { - totalDistanceMeters: Math.round(totalDistance), - totalDistanceKm: Math.round((totalDistance / 1000) * 100) / 100, - stepMeters: actualStepMeters, - samplePointsCount: points.length, - azimuthDegrees: Math.round(azimuthDegrees * 10) / 10, - verticalAngleDegrees: verticalAngleDeg, - verticalAngleMilsNato, - verticalAngleMilsSoviet, - observerGroundElevationMeters: observerGroundElev, - observerTotalElevationMeters: observerTotalElev, - targetGroundElevationMeters: targetGroundElev, - targetTotalElevationMeters: targetTotalElev, - minElevationMeters: minElev, - maxElevationMeters: maxElev, - deadGroundPercentage, - }, - highestObstacle, - observer: { - lat: Number(startLat.toFixed(6)), - lng: Number(startLng.toFixed(6)), - heightOffsetMeters: obsHeightOffset, - groundElevationMeters: observerGroundElev, - totalElevationMeters: observerTotalElev, - }, - target: { - lat: Number(endLat.toFixed(6)), - lng: Number(endLng.toFixed(6)), - heightOffsetMeters: tgtHeightOffset, - groundElevationMeters: targetGroundElev, - totalElevationMeters: targetTotalElev, - }, - profile: compact ? [] : points, - }; + return 650 + (lng - 36.0) * 30; } } diff --git a/apps/web/src/main.tsx b/apps/web/src/main.tsx index 47ce763..30bec40 100644 --- a/apps/web/src/main.tsx +++ b/apps/web/src/main.tsx @@ -5,6 +5,7 @@ import App from './App.tsx' import CompareView from './pages/CompareView' import IntelligenceDashboard from './pages/IntelligenceDashboard' import { ExecutiveShowcase } from './pages/ExecutiveShowcase' +import { TacticalDefenseView } from './pages/TacticalDefenseView' import './index.css' maplibregl.setRTLTextPlugin( @@ -15,14 +16,15 @@ maplibregl.setRTLTextPlugin( // Lightweight hash router const NAV = [ - { hash: '#executive', label: 'العرض الاستراتيجي', icon: '🎖️' }, - { hash: '#map', label: 'الخريطة الحية', icon: '🗺️' }, + { hash: '#tactical', label: 'المنظومة التكتيكية العسكرية', icon: '🎖️' }, + { hash: '#map', label: 'الخريطة والطقس', icon: '🗺️' }, { hash: '#review', label: 'تدقيق الطرق', icon: '🔍' }, - { hash: '#compare', label: 'المقارنة', icon: '⚖️' }, + { hash: '#compare', label: 'المقارنة المرجعية', icon: '⚖️' }, + { hash: '#executive', label: 'العرض الاستراتيجي', icon: '🏛️' }, ] function ViewNav({ hash }: { hash: string }) { - const currentHash = hash || '#map' + const currentHash = hash || '#tactical' return (
{ - const on = () => setHash(window.location.hash || '#map') + const on = () => setHash(window.location.hash || '#tactical') window.addEventListener('hashchange', on) return () => window.removeEventListener('hashchange', on) }, []) const view = + hash === '#tactical' || hash === '#military' ? : hash === '#executive' || hash === '#pitch' ? : hash === '#compare' ? : hash === '#review' ? : diff --git a/apps/web/src/pages/TacticalDefenseView.tsx b/apps/web/src/pages/TacticalDefenseView.tsx new file mode 100644 index 0000000..90d1d1c --- /dev/null +++ b/apps/web/src/pages/TacticalDefenseView.tsx @@ -0,0 +1,913 @@ +import React, { useState, useEffect, useRef } from 'react'; +import maplibregl from 'maplibre-gl'; +import 'maplibre-gl/dist/maplibre-gl.css'; +import { + Shield, + Crosshair, + Eye, + Radio, + Compass, + Mountain, + AlertTriangle, + CheckCircle2, + XCircle, + Layers, + Save, + Trash2, + Navigation, + Flame, + Activity, + Plus, + Play, + RotateCcw, + Zap, + ChevronDown +} from 'lucide-react'; +import { calculateLineOfSight, calculateRadialViewshed, LineOfSightResult, Viewshed360Result } from '../utils/elevationService'; + +type TacticalMode = 'los' | 'viewshed' | 'artillery' | 'hlz' | 'symbols'; + +interface TacticalSymbolItem { + id: string; + type: 'friendly' | 'hostile' | 'artillery' | 'radar' | 'checkpoint' | 'minefield' | 'op'; + name: string; + lat: number; + lng: number; +} + +const DEFAULT_SYMBOLS: TacticalSymbolItem[] = [ + { id: 'sym-1', type: 'friendly', name: 'كتيبة المشاة الآلية 4', lat: 31.98, lng: 35.88 }, + { id: 'sym-2', type: 'artillery', name: 'مربض مدفعية م109', lat: 31.93, lng: 35.91 }, + { id: 'sym-3', type: 'radar', name: 'رادار كشف أرضي تكتيكي', lat: 32.02, lng: 35.84 }, + { id: 'sym-4', type: 'checkpoint', name: 'نقطة سيطرة وغلق أمني', lat: 31.95, lng: 35.95 }, + { id: 'sym-5', type: 'op', name: 'نقطة مراقبة واستطلاع أمامي', lat: 32.06, lng: 35.81 }, +]; + +export const TacticalDefenseView: React.FC = () => { + const mapContainer = useRef(null); + const map = useRef(null); + + const [mode, setMode] = useState('los'); + const [cursorPos, setCursorPos] = useState({ lat: 31.95, lng: 35.93, elev: 850 }); + + // Line of Sight State + const [losPointA, setLosPointA] = useState<[number, number] | null>([31.9539, 35.9106]); + const [losPointB, setLosPointB] = useState<[number, number] | null>([32.0125, 35.8540]); + const [losObsHeight, setLosObsHeight] = useState(2); + const [losTgtHeight, setLosTgtHeight] = useState(2); + const [losResult, setLosResult] = useState(null); + const [losLoading, setLosLoading] = useState(false); + + // Viewshed State + const [viewshedCenter, setViewshedCenter] = useState<[number, number] | null>([31.9800, 35.8800]); + const [viewshedRadius, setViewshedRadius] = useState(5000); + const [viewshedHeight, setViewshedHeight] = useState(10); + const [viewshedResult, setViewshedResult] = useState(null); + const [viewshedLoading, setViewshedLoading] = useState(false); + + // Artillery Fire Mission State + const [gunPos, setGunPos] = useState<[number, number] | null>([31.9300, 35.9100]); + const [targetPos, setTargetPos] = useState<[number, number] | null>([32.0400, 35.8200]); + const [caliber, setCaliber] = useState('155mm Howitzer (M109)'); + const [muzzleVel, setMuzzleVel] = useState(827); + const [artilleryResult, setArtilleryResult] = useState(null); + const [artilleryLoading, setArtilleryLoading] = useState(false); + + // HLZ State + const [hlzCenter, setHlzCenter] = useState<[number, number] | null>([31.9600, 35.9000]); + const [hlzResult, setHlzResult] = useState(null); + const [hlzLoading, setHlzLoading] = useState(false); + + // Tactical Symbols State + const [symbols, setSymbols] = useState(DEFAULT_SYMBOLS); + const [selectedSymbolType, setSelectedSymbolType] = useState('friendly'); + const [newSymbolName, setNewSymbolName] = useState(''); + + // Map Initialization + useEffect(() => { + if (map.current) return; + if (!mapContainer.current) return; + + const initialMap = new maplibregl.Map({ + container: mapContainer.current, + style: '/style-dark.json', + center: [35.9106, 31.9539], + zoom: 11, + pitch: 35, + attributionControl: false + }); + + map.current = initialMap; + + initialMap.on('mousemove', (e) => { + setCursorPos({ + lat: Number(e.lngLat.lat.toFixed(5)), + lng: Number(e.lngLat.lng.toFixed(5)), + elev: 820 + Math.round(Math.sin(e.lngLat.lat * 20) * 150) + }); + }); + + initialMap.on('click', (e) => { + const clickedLat = e.lngLat.lat; + const clickedLng = e.lngLat.lng; + + // Handle map clicks based on active mode + if (mode === 'los') { + if (!losPointA) { + setLosPointA([clickedLat, clickedLng]); + } else if (!losPointB) { + setLosPointB([clickedLat, clickedLng]); + } else { + setLosPointA([clickedLat, clickedLng]); + setLosPointB(null); + } + } else if (mode === 'viewshed') { + setViewshedCenter([clickedLat, clickedLng]); + } else if (mode === 'artillery') { + if (!gunPos) { + setGunPos([clickedLat, clickedLng]); + } else if (!targetPos) { + setTargetPos([clickedLat, clickedLng]); + } else { + setTargetPos([clickedLat, clickedLng]); + } + } else if (mode === 'hlz') { + setHlzCenter([clickedLat, clickedLng]); + } else if (mode === 'symbols') { + const newSym: TacticalSymbolItem = { + id: `sym-${Date.now()}`, + type: selectedSymbolType as any, + name: newSymbolName || `نقطة ${selectedSymbolType}`, + lat: clickedLat, + lng: clickedLng + }; + setSymbols(prev => [...prev, newSym]); + setNewSymbolName(''); + } + }); + + initialMap.on('load', () => { + // Add Sources and Layers for Tactical Defense Visualization + initialMap.addSource('tactical-los-src', { + type: 'geojson', + data: { type: 'FeatureCollection', features: [] } + }); + + initialMap.addLayer({ + id: 'tactical-los-line', + type: 'line', + source: 'tactical-los-src', + filter: ['==', '$type', 'LineString'], + paint: { + 'line-color': ['case', ['==', ['get', 'blocked'], true], '#ef4444', '#22c55e'], + 'line-width': 4, + 'line-dasharray': [2, 1] + } + }); + + initialMap.addLayer({ + id: 'tactical-los-pts', + type: 'circle', + source: 'tactical-los-src', + filter: ['==', '$type', 'Point'], + paint: { + 'circle-radius': 8, + 'circle-color': ['match', ['get', 'role'], 'obs', '#38bdf8', 'tgt', '#f59e0b', 'obstacle', '#ef4444', '#ffffff'], + 'circle-stroke-color': '#ffffff', + 'circle-stroke-width': 2 + } + }); + + // Viewshed 360 Polygon Layer + initialMap.addSource('tactical-viewshed-src', { + type: 'geojson', + data: { type: 'FeatureCollection', features: [] } + }); + + initialMap.addLayer({ + id: 'tactical-viewshed-fill', + type: 'fill', + source: 'tactical-viewshed-src', + paint: { + 'fill-color': '#22c55e', + 'fill-opacity': 0.25 + } + }); + + initialMap.addLayer({ + id: 'tactical-viewshed-outline', + type: 'line', + source: 'tactical-viewshed-src', + paint: { + 'line-color': '#4ade80', + 'line-width': 2, + 'line-dasharray': [3, 2] + } + }); + + // Artillery Trajectory Layer + initialMap.addSource('tactical-artillery-src', { + type: 'geojson', + data: { type: 'FeatureCollection', features: [] } + }); + + initialMap.addLayer({ + id: 'tactical-artillery-line', + type: 'line', + source: 'tactical-artillery-src', + paint: { + 'line-color': '#f97316', + 'line-width': 3.5 + } + }); + + // Tactical Symbols Layer + initialMap.addSource('tactical-symbols-src', { + type: 'geojson', + data: { type: 'FeatureCollection', features: [] } + }); + + initialMap.addLayer({ + id: 'tactical-symbols-pts', + type: 'circle', + source: 'tactical-symbols-src', + paint: { + 'circle-radius': 9, + 'circle-color': [ + 'match', + ['get', 'type'], + 'friendly', '#3b82f6', + 'hostile', '#ef4444', + 'artillery', '#f97316', + 'radar', '#06b6d4', + 'checkpoint', '#eab308', + 'minefield', '#dc2626', + '#a855f7' + ], + 'circle-stroke-color': '#ffffff', + 'circle-stroke-width': 2.5 + } + }); + + initialMap.addLayer({ + id: 'tactical-symbols-lbls', + type: 'symbol', + source: 'tactical-symbols-src', + layout: { + 'text-field': ['get', 'name'], + 'text-size': 11, + 'text-font': ['Noto Sans Bold', 'Open Sans Bold'], + 'text-offset': [0, 1.4], + 'text-anchor': 'top' + }, + paint: { + 'text-color': '#ffffff', + 'text-halo-color': '#0f172a', + 'text-halo-width': 2 + } + }); + }); + + return () => { + if (map.current) { + map.current.remove(); + map.current = null; + } + }; + }, []); + + // Update Line of Sight Calculations & Map Layer + useEffect(() => { + if (!losPointA || !losPointB) return; + setLosLoading(true); + calculateLineOfSight(losPointA[0], losPointA[1], losPointB[0], losPointB[1], losObsHeight, losTgtHeight, 70) + .then((res) => { + setLosResult(res); + setLosLoading(false); + + if (map.current && map.current.getSource('tactical-los-src')) { + const feats: any[] = [ + { + type: 'Feature', + properties: { role: 'ray', blocked: !res.isDirectlyVisible }, + geometry: { + type: 'LineString', + coordinates: [[losPointA[1], losPointA[0]], [losPointB[1], losPointB[0]]] + } + }, + { + type: 'Feature', + properties: { role: 'obs', label: 'راصد' }, + geometry: { type: 'Point', coordinates: [losPointA[1], losPointA[0]] } + }, + { + type: 'Feature', + properties: { role: 'tgt', label: 'هدف' }, + geometry: { type: 'Point', coordinates: [losPointB[1], losPointB[0]] } + } + ]; + + if (res.highestObstacle) { + feats.push({ + type: 'Feature', + properties: { role: 'obstacle', label: 'عائق' }, + geometry: { type: 'Point', coordinates: [res.highestObstacle.lng, res.highestObstacle.lat] } + }); + } + + (map.current.getSource('tactical-los-src') as maplibregl.GeoJSONSource).setData({ + type: 'FeatureCollection', + features: feats + }); + } + }) + .catch(() => setLosLoading(false)); + }, [losPointA, losPointB, losObsHeight, losTgtHeight]); + + // Update 360 Viewshed Calculations & Map Layer + const runViewshed360 = () => { + if (!viewshedCenter) return; + setViewshedLoading(true); + calculateRadialViewshed(viewshedCenter[0], viewshedCenter[1], viewshedHeight, viewshedRadius, 36) + .then((res) => { + setViewshedResult(res); + setViewshedLoading(false); + + if (map.current && map.current.getSource('tactical-viewshed-src')) { + (map.current.getSource('tactical-viewshed-src') as maplibregl.GeoJSONSource).setData({ + type: 'FeatureCollection', + features: [res.polygonGeoJson] + }); + } + }) + .catch(() => setViewshedLoading(false)); + }; + + // Run Artillery Fire Mission + const runArtilleryMission = async () => { + if (!gunPos || !targetPos) return; + setArtilleryLoading(true); + try { + const apiUrl = (import.meta as any).env.VITE_API_URL || '/api'; + const apiKey = (import.meta as any).env.VITE_API_KEY || 'zP9vL5mK2nQ8xR7jT4wS1yB6hG3fV0cX'; + + const res = await fetch(`${apiUrl}/tactical/artillery-fire-mission`, { + method: 'POST', + headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey }, + body: JSON.stringify({ + gunLat: gunPos[0], + gunLng: gunPos[1], + targetLat: targetPos[0], + targetLng: targetPos[1], + caliber, + muzzleVelocity: muzzleVel + }) + }); + const data = await res.json(); + setArtilleryResult(data); + + if (map.current && map.current.getSource('tactical-artillery-src')) { + const lineCoords = (data.trajectoryPoints || []).map((p: any) => [p.lng, p.lat]); + (map.current.getSource('tactical-artillery-src') as maplibregl.GeoJSONSource).setData({ + type: 'FeatureCollection', + features: [ + { + type: 'Feature', + properties: {}, + geometry: { type: 'LineString', coordinates: lineCoords } + } + ] + }); + } + } catch (e) { + console.error('Artillery calculation error:', e); + } finally { + setArtilleryLoading(false); + } + }; + + // Run HLZ Assessment + const runHLZAssessment = async () => { + if (!hlzCenter) return; + setHlzLoading(true); + try { + const apiUrl = (import.meta as any).env.VITE_API_URL || '/api'; + const apiKey = (import.meta as any).env.VITE_API_KEY || 'zP9vL5mK2nQ8xR7jT4wS1yB6hG3fV0cX'; + + const res = await fetch(`${apiUrl}/tactical/hlz-assessment?lat=${hlzCenter[0]}&lng=${hlzCenter[1]}&radius=4000`, { + headers: { 'x-api-key': apiKey } + }); + const data = await res.json(); + setHlzResult(data); + } catch (e) { + console.error('HLZ error:', e); + } finally { + setHlzLoading(false); + } + }; + + // Synchronize Tactical Symbols to Map + useEffect(() => { + if (!map.current || !map.current.getSource('tactical-symbols-src')) return; + const feats = symbols.map(s => ({ + type: 'Feature', + properties: { type: s.type, name: s.name }, + geometry: { type: 'Point', coordinates: [s.lng, s.lat] } + })); + (map.current.getSource('tactical-symbols-src') as maplibregl.GeoJSONSource).setData({ + type: 'FeatureCollection', + features: feats as any + }); + }, [symbols]); + + return ( +
+ {/* Top Military HUD Header */} +
+
+
+ +
+
+
+ منظومة القيادة والسيطرة والتحليل التكتيكي + + C4ISR Tactical Grid + +
+
+
+ + {/* Tactical Modes Selector */} +
+ {[ + { id: 'los', label: 'تبادل الرؤية (LOS)', icon: }, + { id: 'viewshed', label: 'كشف الميدان 360°', icon: }, + { id: 'artillery', label: 'رماية المدفعية', icon: }, + { id: 'hlz', label: 'مهابط المروحيات', icon: }, + { id: 'symbols', label: 'الرموز والعمليات', icon: }, + ].map(m => ( + + ))} +
+ + {/* Realtime Cursor HUD */} +
+
LAT: {cursorPos.lat}
+
LNG: {cursorPos.lng}
+
ELEV: {cursorPos.elev}m
+
+
+ + {/* Main Tactical Workspace */} +
+ + {/* Left Side Tactical Control Deck */} + + + {/* Tactical Map Container */} +
+
+
+ ); +}; diff --git a/apps/web/src/utils/elevationService.ts b/apps/web/src/utils/elevationService.ts index f79ea3b..782b013 100644 --- a/apps/web/src/utils/elevationService.ts +++ b/apps/web/src/utils/elevationService.ts @@ -361,3 +361,107 @@ export async function calculateLineOfSight( azimuthDegrees: Math.round(azimuthDegrees * 10) / 10, }; } + +export interface Viewshed360Result { + centerLat: number; + centerLng: number; + centerElevation: number; + radiusMeters: number; + polygonGeoJson: any; + totalRays: number; + visibleAreaKm2: number; + visiblePercentage: number; +} + +/** + * Calculates 360-degree Radial Viewshed (كشف الميدان الدائري) around observer + */ +export async function calculateRadialViewshed( + centerLat: number, + centerLng: number, + obsHeight: number = 2, + radiusMeters: number = 5000, + numRays: number = 36 +): Promise { + const centerGroundElev = await sampleElevationAt(centerLat, centerLng); + const observerElevation = centerGroundElev + obsHeight; + + const R_earth = 6371000; + const k_refraction = 0.13; + const effectiveEarthRadius = R_earth / (1 - k_refraction); + + const polygonCoordinates: [number, number][] = []; + const samplesPerRay = 12; + let totalVisibleDistanceSum = 0; + + for (let rayIdx = 0; rayIdx < numRays; rayIdx++) { + const angleDeg = (rayIdx * 360) / numRays; + const angleRad = (angleDeg * Math.PI) / 180; + + const dLat = (radiusMeters / R_earth) * (180 / Math.PI) * Math.cos(angleRad); + const dLng = (radiusMeters / (R_earth * Math.cos((centerLat * Math.PI) / 180))) * (180 / Math.PI) * Math.sin(angleRad); + + const endLat = centerLat + dLat; + const endLng = centerLng + dLng; + + let maxAngleSoFar = -Infinity; + let visibleHorizonDist = radiusMeters; + let visibleHorizonLat = endLat; + let visibleHorizonLng = endLng; + + for (let step = 1; step <= samplesPerRay; step++) { + const frac = step / samplesPerRay; + const sLat = centerLat + (endLat - centerLat) * frac; + const sLng = centerLng + (endLng - centerLng) * frac; + const sDist = radiusMeters * frac; + + const sElev = await sampleElevationAt(sLat, sLng); + const earthCurvatureDrop = (sDist * sDist) / (2 * effectiveEarthRadius); + const apparentElev = sElev - earthCurvatureDrop; + const angle = (apparentElev - observerElevation) / sDist; + + if (angle >= maxAngleSoFar) { + maxAngleSoFar = angle; + visibleHorizonDist = sDist; + visibleHorizonLat = sLat; + visibleHorizonLng = sLng; + } + } + + totalVisibleDistanceSum += visibleHorizonDist; + polygonCoordinates.push([visibleHorizonLng, visibleHorizonLat]); + } + + if (polygonCoordinates.length > 0) { + polygonCoordinates.push(polygonCoordinates[0]); + } + + const polygonGeoJson = { + type: 'Feature', + properties: { + centerLat, + centerLng, + radiusMeters + }, + geometry: { + type: 'Polygon', + coordinates: [polygonCoordinates] + } + }; + + const avgVisibleDist = totalVisibleDistanceSum / numRays; + const theoreticalMaxArea = Math.PI * Math.pow(radiusMeters / 1000, 2); + const actualVisibleArea = Math.PI * Math.pow(avgVisibleDist / 1000, 2); + const visiblePercentage = Math.min(100, Math.round((actualVisibleArea / theoreticalMaxArea) * 100)); + + return { + centerLat, + centerLng, + centerElevation: Math.round(observerElevation), + radiusMeters, + polygonGeoJson, + totalRays: numRays, + visibleAreaKm2: Math.round(actualVisibleArea * 10) / 10, + visiblePercentage + }; +}