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

This commit is contained in:
Hamza-Ayed
2026-08-18 09:46:04 +03:00
parent bd287d155b
commit 941420f5c0
86 changed files with 3614 additions and 1556 deletions
+29
View File
@@ -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;
}
+209
View File
@@ -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
+1
View File
@@ -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,CA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ryMissionRequestDto {
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[];
}
+162
View File
@@ -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
+1
View File
@@ -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,CAAC;IACxE,IAAA,0BAAQ,GAAE;IACV,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;0DACJ;AAKf;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IACzE,IAAA,0BAAQ,GAAE;IACV,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;0DACJ;AAKf;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,OAAO,EAAE,KAAK,E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;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"}
+49
View File
@@ -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<any>;
getLosAlias(query: LineOfSightQueryDto): Promise<any>;
postLineOfSight(body: LineOfSightBodyDto): Promise<any>;
postLosAlias(body: LineOfSightBodyDto): Promise<any>;
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<import("./tactical.service").TacticalSymbol[]>;
}
+164
View File
@@ -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
+1
View File
@@ -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;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+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
+1
View File
@@ -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"}
+69
View File
@@ -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<TacticalSymbol[]>;
private haversineDistance;
private calculateBearing;
private estimateElevation;
}
+199
View File
@@ -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
File diff suppressed because one or more lines are too long