@autologix-engineering/shared 1.2.372 → 1.2.374
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/lib/data-transfer-objects/src/command/process.ext.request.trip.sheet.dto.d.ts +1 -0
- package/src/lib/data-transfer-objects/src/command/process.ext.request.trip.sheet.dto.js +8 -1
- package/src/lib/data-transfer-objects/src/command/process.ext.request.trip.sheet.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/create.consolidated.invoice.dto.d.ts +4 -0
- package/src/lib/data-transfer-objects/src/create.consolidated.invoice.dto.js +21 -1
- package/src/lib/data-transfer-objects/src/create.consolidated.invoice.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/create.dispatch.dto.d.ts +4 -0
- package/src/lib/data-transfer-objects/src/create.dispatch.dto.js +21 -1
- package/src/lib/data-transfer-objects/src/create.dispatch.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/update.safety.and.compliance.config.dto.d.ts +11 -0
- package/src/lib/data-transfer-objects/src/update.safety.and.compliance.config.dto.js +7 -0
- package/src/lib/data-transfer-objects/src/update.safety.and.compliance.config.dto.js.map +1 -1
- package/src/lib/date-utils/src/zoop.date.d.ts +8 -0
- package/src/lib/date-utils/src/zoop.date.js +38 -0
- package/src/lib/date-utils/src/zoop.date.js.map +1 -1
- package/src/lib/enums/src/trip.file.type.enum.d.ts +2 -1
- package/src/lib/enums/src/trip.file.type.enum.js +1 -0
- package/src/lib/enums/src/trip.file.type.enum.js.map +1 -1
- package/src/lib/enums/src/vehicle.compliance.enum.d.ts +9 -0
- package/src/lib/enums/src/vehicle.compliance.enum.js +9 -0
- package/src/lib/enums/src/vehicle.compliance.enum.js.map +1 -1
- package/src/lib/models/src/configurations.model.d.ts +15 -0
- package/src/lib/models/src/configurations.model.js +14 -0
- package/src/lib/models/src/configurations.model.js.map +1 -1
- package/src/lib/utilities/src/index.d.ts +1 -0
- package/src/lib/utilities/src/index.js +1 -0
- package/src/lib/utilities/src/index.js.map +1 -1
- package/src/lib/utilities/src/ltr.cycle.month.index.d.ts +13 -0
- package/src/lib/utilities/src/ltr.cycle.month.index.js +15 -2
- package/src/lib/utilities/src/ltr.cycle.month.index.js.map +1 -1
- package/src/lib/utilities/src/map.compliance.from.rc.d.ts +10 -0
- package/src/lib/utilities/src/map.compliance.from.rc.js +7 -1
- package/src/lib/utilities/src/map.compliance.from.rc.js.map +1 -1
- package/src/lib/utilities/src/resolve.gst.state.js +7 -1
- package/src/lib/utilities/src/resolve.gst.state.js.map +1 -1
- package/src/lib/utilities/src/resolve.passenger.display.name.d.ts +18 -0
- package/src/lib/utilities/src/resolve.passenger.display.name.js +40 -13
- package/src/lib/utilities/src/resolve.passenger.display.name.js.map +1 -1
- package/src/lib/utilities/src/vehicle.insurance.validity.d.ts +78 -0
- package/src/lib/utilities/src/vehicle.insurance.validity.js +184 -0
- package/src/lib/utilities/src/vehicle.insurance.validity.js.map +1 -0
package/package.json
CHANGED
|
@@ -26,6 +26,7 @@ export declare class ProcessExtRequestTripSheetDTO {
|
|
|
26
26
|
dayWiseDistance?: OutstationDayWiseDistance[];
|
|
27
27
|
trackingMode?: string;
|
|
28
28
|
dutySlipFile?: string;
|
|
29
|
+
qcImages?: string[];
|
|
29
30
|
fastTagTolls?: any[];
|
|
30
31
|
dutyClosureMode?: DutyClosureMode;
|
|
31
32
|
constructor(_obj?: Partial<ProcessExtRequestTripSheetDTO>);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { IsUUID, IsDateString, IsNumber, IsOptional, IsArray, ValidateNested, IsString, IsBoolean, IsEnum, } from 'class-validator';
|
|
2
|
+
import { IsUUID, IsDateString, IsNumber, IsOptional, IsArray, ArrayMaxSize, ValidateNested, IsString, IsBoolean, IsEnum, } from 'class-validator';
|
|
3
3
|
import { DutyClosureMode } from '../../../enums/src/index';
|
|
4
4
|
export class ProcessExtRequestTripSheetDTO {
|
|
5
5
|
constructor(_obj) {
|
|
@@ -133,6 +133,13 @@ __decorate([
|
|
|
133
133
|
IsString(),
|
|
134
134
|
__metadata("design:type", String)
|
|
135
135
|
], ProcessExtRequestTripSheetDTO.prototype, "dutySlipFile", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
IsOptional(),
|
|
138
|
+
IsArray(),
|
|
139
|
+
ArrayMaxSize(10),
|
|
140
|
+
IsString({ each: true }),
|
|
141
|
+
__metadata("design:type", Array)
|
|
142
|
+
], ProcessExtRequestTripSheetDTO.prototype, "qcImages", void 0);
|
|
136
143
|
__decorate([
|
|
137
144
|
IsOptional(),
|
|
138
145
|
__metadata("design:type", Array)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process.ext.request.trip.sheet.dto.js","sourceRoot":"","sources":["../../../../../../../../libs/shared/src/lib/data-transfer-objects/src/command/process.ext.request.trip.sheet.dto.ts"],"names":[],"mappings":";AAAA,OAAO,EACN,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,OAAO,EACP,cAAc,EACd,QAAQ,EACR,SAAS,EACT,MAAM,GACN,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,MAAM,OAAO,6BAA6B;
|
|
1
|
+
{"version":3,"file":"process.ext.request.trip.sheet.dto.js","sourceRoot":"","sources":["../../../../../../../../libs/shared/src/lib/data-transfer-objects/src/command/process.ext.request.trip.sheet.dto.ts"],"names":[],"mappings":";AAAA,OAAO,EACN,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,OAAO,EACP,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,SAAS,EACT,MAAM,GACN,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,MAAM,OAAO,6BAA6B;IAoHzC,YAAY,IAA6C;QACxD,MAAM,CAAC,MAAM,CAAC,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Z,SAAS,EAAE;;oEACY;AAKxB;IAHC,UAAU,EAAE;IACZ,OAAO,EAAE;IACT,cAAc,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;sEACe;AAI9C;IAFC,UAAU,EAAE;IACZ,QAAQ,EAAE;;mEACW;AAItB;IAFC,UAAU,EAAE;IACZ,QAAQ,EAAE;;mEACW;AAMtB;IAJC,UAAU,EAAE;IACZ,OAAO,EAAE;IACT,YAAY,CAAC,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;+DACL;AAGpB;IADC,UAAU,EAAE;;mEACQ;AAIrB;IAFC,UAAU,EAAE;IACZ,MAAM,CAAC,eAAe,CAAC;;sEACU;AAOnC,MAAM,OAAO,cAAc;IAoB1B,YAAY,GAA6B;QACxC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC1B,CAAC;CACD;AApBA;IAFC,UAAU,EAAE;IACZ,QAAQ,EAAE;;oDACW;AAGtB;IADC,QAAQ,EAAE;;qDACW;AAGtB;IADC,QAAQ,EAAE;;6CACG;AAId;IAFC,UAAU,EAAE;IACZ,QAAQ,EAAE;;mDACU;AAKrB;IAHC,UAAU,EAAE;IACZ,OAAO,EAAE;IACT,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;oDACD"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { DutiesQueryDTO } from './duties.query.dto';
|
|
1
2
|
export declare class CreateConsolidatedInvoiceDto {
|
|
2
3
|
contextId: string;
|
|
3
4
|
clientPersonaId: string;
|
|
4
5
|
bookingIds: string[];
|
|
6
|
+
selectAll?: boolean;
|
|
7
|
+
excludedIds?: string[];
|
|
8
|
+
filters?: DutiesQueryDTO;
|
|
5
9
|
clientGSTIN: string;
|
|
6
10
|
companyAddress: string;
|
|
7
11
|
companyAddressId?: string;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { ArrayMinSize, IsArray, IsOptional, IsString, IsUUID, } from 'class-validator';
|
|
2
|
+
import { ArrayMinSize, IsArray, IsBoolean, IsOptional, IsString, IsUUID, ValidateIf, ValidateNested, } from 'class-validator';
|
|
3
|
+
import { Type } from 'class-transformer';
|
|
4
|
+
import { DutiesQueryDTO } from './duties.query.dto';
|
|
3
5
|
export class CreateConsolidatedInvoiceDto {
|
|
4
6
|
constructor(obj) {
|
|
5
7
|
Object.assign(this, obj);
|
|
@@ -14,11 +16,29 @@ __decorate([
|
|
|
14
16
|
__metadata("design:type", String)
|
|
15
17
|
], CreateConsolidatedInvoiceDto.prototype, "clientPersonaId", void 0);
|
|
16
18
|
__decorate([
|
|
19
|
+
ValidateIf((o) => !o.selectAll),
|
|
17
20
|
IsArray(),
|
|
18
21
|
ArrayMinSize(1),
|
|
19
22
|
IsString({ each: true }),
|
|
20
23
|
__metadata("design:type", Array)
|
|
21
24
|
], CreateConsolidatedInvoiceDto.prototype, "bookingIds", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
IsOptional(),
|
|
27
|
+
IsBoolean(),
|
|
28
|
+
__metadata("design:type", Boolean)
|
|
29
|
+
], CreateConsolidatedInvoiceDto.prototype, "selectAll", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
IsOptional(),
|
|
32
|
+
IsArray(),
|
|
33
|
+
IsString({ each: true }),
|
|
34
|
+
__metadata("design:type", Array)
|
|
35
|
+
], CreateConsolidatedInvoiceDto.prototype, "excludedIds", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
ValidateIf((o) => !!o.selectAll),
|
|
38
|
+
ValidateNested(),
|
|
39
|
+
Type(() => DutiesQueryDTO),
|
|
40
|
+
__metadata("design:type", DutiesQueryDTO)
|
|
41
|
+
], CreateConsolidatedInvoiceDto.prototype, "filters", void 0);
|
|
22
42
|
__decorate([
|
|
23
43
|
IsOptional(),
|
|
24
44
|
IsString(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.consolidated.invoice.dto.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/data-transfer-objects/src/create.consolidated.invoice.dto.ts"],"names":[],"mappings":";AAAA,OAAO,EACN,YAAY,EACZ,OAAO,EACP,UAAU,EACV,QAAQ,EACR,MAAM,
|
|
1
|
+
{"version":3,"file":"create.consolidated.invoice.dto.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/data-transfer-objects/src/create.consolidated.invoice.dto.ts"],"names":[],"mappings":";AAAA,OAAO,EACN,YAAY,EACZ,OAAO,EACP,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,UAAU,EACV,cAAc,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,OAAO,4BAA4B;IA2DxC,YAAY,GAA2C;QACtD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC1B,CAAC;CACD;AA5DA;IADC,MAAM,EAAE;;+DACS;AAGlB;IADC,MAAM,EAAE;;qEACe;AAMxB;IAJC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/B,OAAO,EAAE;IACT,YAAY,CAAC,CAAC,CAAC;IACf,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;gEACJ;AAIrB;IAFC,UAAU,EAAE;IACZ,SAAS,EAAE;;+DACQ;AAKpB;IAHC,UAAU,EAAE;IACZ,OAAO,EAAE;IACT,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;iEACF;AAKvB;IAHC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAChC,cAAc,EAAE;IAChB,IAAI,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC;8BACjB,cAAc;6DAAC;AAIzB;IAFC,UAAU,EAAE;IACZ,QAAQ,EAAE;;iEACS;AAIpB;IAFC,UAAU,EAAE;IACZ,QAAQ,EAAE;;oEACY;AAOvB;IAFC,UAAU,EAAE;IACZ,MAAM,EAAE;;sEACiB;AAI1B;IAFC,UAAU,EAAE;IACZ,QAAQ,EAAE;;0EACkB;AAI7B;IAFC,UAAU,EAAE;IACZ,MAAM,EAAE;;6DACO;AAIhB;IAFC,UAAU,EAAE;IACZ,MAAM,EAAE;;2DACM;AAKf;IAHC,UAAU,EAAE;IACZ,OAAO,EAAE;IACT,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;6DACP"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { DutiesQueryDTO } from './duties.query.dto';
|
|
1
2
|
export declare class CreateDispatchDto {
|
|
2
3
|
requestIds: string[];
|
|
4
|
+
selectAll?: boolean;
|
|
5
|
+
excludedIds?: string[];
|
|
6
|
+
filters?: DutiesQueryDTO;
|
|
3
7
|
garagePlaceId?: string;
|
|
4
8
|
dispatchDate?: string;
|
|
5
9
|
contextId: string;
|
|
@@ -1,16 +1,36 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { ArrayMinSize, IsArray, IsDateString, IsOptional, IsUUID, } from 'class-validator';
|
|
2
|
+
import { ArrayMinSize, IsArray, IsBoolean, IsDateString, IsOptional, IsString, IsUUID, ValidateIf, ValidateNested, } from 'class-validator';
|
|
3
|
+
import { Type } from 'class-transformer';
|
|
4
|
+
import { DutiesQueryDTO } from './duties.query.dto';
|
|
3
5
|
export class CreateDispatchDto {
|
|
4
6
|
constructor(obj) {
|
|
5
7
|
Object.assign(this, obj);
|
|
6
8
|
}
|
|
7
9
|
}
|
|
8
10
|
__decorate([
|
|
11
|
+
ValidateIf((o) => !o.selectAll),
|
|
9
12
|
IsArray(),
|
|
10
13
|
ArrayMinSize(1),
|
|
11
14
|
IsUUID('4', { each: true }),
|
|
12
15
|
__metadata("design:type", Array)
|
|
13
16
|
], CreateDispatchDto.prototype, "requestIds", void 0);
|
|
17
|
+
__decorate([
|
|
18
|
+
IsOptional(),
|
|
19
|
+
IsBoolean(),
|
|
20
|
+
__metadata("design:type", Boolean)
|
|
21
|
+
], CreateDispatchDto.prototype, "selectAll", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
IsOptional(),
|
|
24
|
+
IsArray(),
|
|
25
|
+
IsString({ each: true }),
|
|
26
|
+
__metadata("design:type", Array)
|
|
27
|
+
], CreateDispatchDto.prototype, "excludedIds", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
ValidateIf((o) => !!o.selectAll),
|
|
30
|
+
ValidateNested(),
|
|
31
|
+
Type(() => DutiesQueryDTO),
|
|
32
|
+
__metadata("design:type", DutiesQueryDTO)
|
|
33
|
+
], CreateDispatchDto.prototype, "filters", void 0);
|
|
14
34
|
__decorate([
|
|
15
35
|
IsUUID(),
|
|
16
36
|
__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.dispatch.dto.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/data-transfer-objects/src/create.dispatch.dto.ts"],"names":[],"mappings":";AAAA,OAAO,EACN,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,UAAU,EACV,MAAM,
|
|
1
|
+
{"version":3,"file":"create.dispatch.dto.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/data-transfer-objects/src/create.dispatch.dto.ts"],"names":[],"mappings":";AAAA,OAAO,EACN,YAAY,EACZ,OAAO,EACP,SAAS,EACT,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,MAAM,EACN,UAAU,EACV,cAAc,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,OAAO,iBAAiB;IAkC7B,YAAY,GAAgC;QAC3C,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC1B,CAAC;CACD;AAhCA;IAJC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/B,OAAO,EAAE;IACT,YAAY,CAAC,CAAC,CAAC;IACf,MAAM,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;qDACP;AAIrB;IAFC,UAAU,EAAE;IACZ,SAAS,EAAE;;oDACQ;AAKpB;IAHC,UAAU,EAAE;IACZ,OAAO,EAAE;IACT,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;sDACF;AAKvB;IAHC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAChC,cAAc,EAAE;IAChB,IAAI,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC;8BACjB,cAAc;kDAAC;AAMzB;IADC,MAAM,EAAE;;wDACc;AAIvB;IAFC,UAAU,EAAE;IACZ,YAAY,EAAE;;uDACO;AAGtB;IADC,MAAM,CAAC,GAAG,CAAC;;oDACM"}
|
|
@@ -25,5 +25,16 @@ export declare class UpdateSafetyAndComplianceConfigDTO {
|
|
|
25
25
|
* to disable overrides.
|
|
26
26
|
*/
|
|
27
27
|
complianceMaxGraceDays?: number;
|
|
28
|
+
/**
|
|
29
|
+
* AD-3140 §3.4 — only vehicles allocated within this many days are swept
|
|
30
|
+
* against ZoopOne. A cost control: every hit is billable across a 5k+
|
|
31
|
+
* fleet.
|
|
32
|
+
*
|
|
33
|
+
* Bounded at 730. Beyond two years the filter stops filtering anything and
|
|
34
|
+
* the setting reads as enabled while doing nothing, which is worse than
|
|
35
|
+
* having no setting. 0 is meaningful and means "sweep nothing" — scheduled
|
|
36
|
+
* verification off, manual re-hits only.
|
|
37
|
+
*/
|
|
38
|
+
complianceUtilisationWindowDays?: number;
|
|
28
39
|
constructor(obj?: Partial<UpdateSafetyAndComplianceConfigDTO>);
|
|
29
40
|
}
|
|
@@ -62,4 +62,11 @@ __decorate([
|
|
|
62
62
|
Max(90),
|
|
63
63
|
__metadata("design:type", Number)
|
|
64
64
|
], UpdateSafetyAndComplianceConfigDTO.prototype, "complianceMaxGraceDays", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
IsOptional(),
|
|
67
|
+
IsInt(),
|
|
68
|
+
Min(0),
|
|
69
|
+
Max(730),
|
|
70
|
+
__metadata("design:type", Number)
|
|
71
|
+
], UpdateSafetyAndComplianceConfigDTO.prototype, "complianceUtilisationWindowDays", void 0);
|
|
65
72
|
//# sourceMappingURL=update.safety.and.compliance.config.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.safety.and.compliance.config.dto.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/data-transfer-objects/src/update.safety.and.compliance.config.dto.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EACN,MAAM,EACN,MAAM,EACN,QAAQ,EACR,UAAU,EACV,KAAK,EACL,GAAG,EACH,GAAG,GACH,MAAM,iBAAiB,CAAC;AAGzB,MAAM,OAAO,iBAAiB;CAwB7B;AAtBA;IADC,MAAM,CAAC,iBAAiB,CAAC;;kEACiB;AAG3C;IADC,MAAM,CAAC,iBAAiB,CAAC;;8CACH;AAGvB;IADC,MAAM,CAAC,iBAAiB,CAAC;;sDACK;AAG/B;IADC,MAAM,CAAC,iBAAiB,CAAC;;yDACQ;AAGlC;IADC,MAAM,CAAC,iBAAiB,CAAC;;kDACC;AAG3B;IADC,MAAM,CAAC,iBAAiB,CAAC;;kDACC;AAG3B;IADC,MAAM,CAAC,iBAAiB,CAAC;;+DACc;AAGxC;IADC,MAAM,CAAC,iBAAiB,CAAC;;iDACA;AAG3B,MAAM,OAAO,kCAAkC;
|
|
1
|
+
{"version":3,"file":"update.safety.and.compliance.config.dto.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/data-transfer-objects/src/update.safety.and.compliance.config.dto.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EACN,MAAM,EACN,MAAM,EACN,QAAQ,EACR,UAAU,EACV,KAAK,EACL,GAAG,EACH,GAAG,GACH,MAAM,iBAAiB,CAAC;AAGzB,MAAM,OAAO,iBAAiB;CAwB7B;AAtBA;IADC,MAAM,CAAC,iBAAiB,CAAC;;kEACiB;AAG3C;IADC,MAAM,CAAC,iBAAiB,CAAC;;8CACH;AAGvB;IADC,MAAM,CAAC,iBAAiB,CAAC;;sDACK;AAG/B;IADC,MAAM,CAAC,iBAAiB,CAAC;;yDACQ;AAGlC;IADC,MAAM,CAAC,iBAAiB,CAAC;;kDACC;AAG3B;IADC,MAAM,CAAC,iBAAiB,CAAC;;kDACC;AAG3B;IADC,MAAM,CAAC,iBAAiB,CAAC;;+DACc;AAGxC;IADC,MAAM,CAAC,iBAAiB,CAAC;;iDACA;AAG3B,MAAM,OAAO,kCAAkC;IA6C9C,YAAY,GAAiD;QAC5D,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC1B,CAAC;CACD;AA9CA;IADC,MAAM,EAAE;;qEACS;AAGlB;IADC,QAAQ,EAAE;;4EACgD;AAW3D;IAJC,UAAU,EAAE;IACZ,KAAK,EAAE;IACP,GAAG,CAAC,CAAC,CAAC;IACN,GAAG,CAAC,GAAG,CAAC;;uFAC4B;AAWrC;IAJC,UAAU,EAAE;IACZ,KAAK,EAAE;IACP,GAAG,CAAC,CAAC,CAAC;IACN,GAAG,CAAC,EAAE,CAAC;;kFACwB;AAgBhC;IAJC,UAAU,EAAE;IACZ,KAAK,EAAE;IACP,GAAG,CAAC,CAAC,CAAC;IACN,GAAG,CAAC,GAAG,CAAC;;2FACgC"}
|
|
@@ -22,6 +22,14 @@
|
|
|
22
22
|
* "no data" stays distinguishable from "expired" all the way to the block
|
|
23
23
|
* decision.
|
|
24
24
|
*/
|
|
25
|
+
/**
|
|
26
|
+
* True when a Zoop value states the levy is paid for the life of the vehicle.
|
|
27
|
+
*
|
|
28
|
+
* Callers must treat this as VALID-forever, not as absent. `parseZoopDate`
|
|
29
|
+
* returns null for these — correctly, since there is no date — so this is the
|
|
30
|
+
* only thing that distinguishes them from a genuinely missing record.
|
|
31
|
+
*/
|
|
32
|
+
export declare const isZoopLifetimeValue: (raw: unknown) => boolean;
|
|
25
33
|
/**
|
|
26
34
|
* Normalises a raw Zoop scalar to a string, or null when it carries no data.
|
|
27
35
|
*
|
|
@@ -37,6 +37,44 @@ const NO_DATA_TOKENS = new Set([
|
|
|
37
37
|
'--',
|
|
38
38
|
'0000-00-00',
|
|
39
39
|
]);
|
|
40
|
+
/**
|
|
41
|
+
* Values Zoop uses to mean "this levy has no expiry — it was paid once, for
|
|
42
|
+
* the life of the vehicle".
|
|
43
|
+
*
|
|
44
|
+
* Seen live in `rc_tax_upto` as 'LTT' (Life Time Tax) on an ordinary private
|
|
45
|
+
* car. This is the OPPOSITE of no-data and must never be confused with it:
|
|
46
|
+
* 'NA' means the RTO has no record, 'LTT' means the RTO positively states
|
|
47
|
+
* there is nothing further to pay and no date to renew by.
|
|
48
|
+
*
|
|
49
|
+
* The distinction became load-bearing when a missing MANDATORY compliance
|
|
50
|
+
* started blocking allocation (AD-3140, QA round 2 finding G). Parsing 'LTT'
|
|
51
|
+
* to null makes Road Tax read as No Data, so any context configuring Road Tax
|
|
52
|
+
* as mandatory would permanently ground every lifetime-tax vehicle — most of a
|
|
53
|
+
* private fleet — with no way out, because the RTO will never return a date
|
|
54
|
+
* for it however many times the vehicle is re-verified.
|
|
55
|
+
*/
|
|
56
|
+
const LIFETIME_TOKENS = new Set([
|
|
57
|
+
'ltt',
|
|
58
|
+
'ott',
|
|
59
|
+
'lifetime',
|
|
60
|
+
'life time',
|
|
61
|
+
'life time tax',
|
|
62
|
+
'lifetime tax',
|
|
63
|
+
'one time tax',
|
|
64
|
+
]);
|
|
65
|
+
/**
|
|
66
|
+
* True when a Zoop value states the levy is paid for the life of the vehicle.
|
|
67
|
+
*
|
|
68
|
+
* Callers must treat this as VALID-forever, not as absent. `parseZoopDate`
|
|
69
|
+
* returns null for these — correctly, since there is no date — so this is the
|
|
70
|
+
* only thing that distinguishes them from a genuinely missing record.
|
|
71
|
+
*/
|
|
72
|
+
export const isZoopLifetimeValue = (raw) => {
|
|
73
|
+
const s = parseZoopValue(raw);
|
|
74
|
+
if (!s)
|
|
75
|
+
return false;
|
|
76
|
+
return LIFETIME_TOKENS.has(s.trim().toLowerCase().replace(/\s+/g, ' '));
|
|
77
|
+
};
|
|
40
78
|
const MONTHS = {
|
|
41
79
|
jan: 0,
|
|
42
80
|
feb: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zoop.date.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/date-utils/src/zoop.date.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C;;;GAGG;AACH,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC9B,IAAI;IACJ,KAAK;IACL,KAAK;IACL,MAAM;IACN,MAAM;IACN,GAAG;IACH,IAAI;IACJ,YAAY;CACZ,CAAC,CAAC;AAEH,MAAM,MAAM,GAA2B;IACtC,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,EAAE;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CAAC;IAEhE,4EAA4E;IAC5E,0EAA0E;IAC1E,uEAAuE;IACvE,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClE,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC;IAE1C,2DAA2D;IAC3D,IACC,OAAO,CAAC,cAAc,EAAE,KAAK,IAAI;QACjC,OAAO,CAAC,WAAW,EAAE,KAAK,KAAK;QAC/B,OAAO,CAAC,UAAU,EAAE,KAAK,GAAG,EAC3B,CAAC;QACF,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,GAAY,EAAkB,EAAE;IAC7D,MAAM,CAAC,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpB,MAAM,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;IAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IAC1D,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IAC3D,OAAO,IAAI,CAAC;AACb,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trip.file.type.enum.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/enums/src/trip.file.type.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"trip.file.type.enum.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/enums/src/trip.file.type.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACvB,mCAAmB,CAAA;IACnB,2BAAW,CAAA;IACX,uCAAuB,CAAA;IACvB,mCAAmB,CAAA;AACpB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB"}
|
|
@@ -66,6 +66,15 @@ export declare enum ComplianceStanding {
|
|
|
66
66
|
* sets the default at 30 days).
|
|
67
67
|
*/
|
|
68
68
|
export declare const DEFAULT_COMPLIANCE_WARNING_WINDOW_DAYS = 30;
|
|
69
|
+
/**
|
|
70
|
+
* AD-3140 §3.4 — default utilisation window for the scheduled ZoopOne sweep.
|
|
71
|
+
*
|
|
72
|
+
* 90 days: long enough that a seasonally idle vehicle is still refreshed before
|
|
73
|
+
* anyone tries to deploy it, short enough to keep a 5k+ fleet's provider spend
|
|
74
|
+
* bounded. Overridable per context via
|
|
75
|
+
* ConfigurationField.ComplianceUtilisationWindowDays.
|
|
76
|
+
*/
|
|
77
|
+
export declare const DEFAULT_COMPLIANCE_UTILISATION_WINDOW_DAYS = 90;
|
|
69
78
|
/** Every compliance type, in the order AD-3140 §2 lists them. */
|
|
70
79
|
export declare const VEHICLE_COMPLIANCE_KEYS: VehicleComplianceKey[];
|
|
71
80
|
/**
|
|
@@ -70,6 +70,15 @@ export var ComplianceStanding;
|
|
|
70
70
|
* sets the default at 30 days).
|
|
71
71
|
*/
|
|
72
72
|
export const DEFAULT_COMPLIANCE_WARNING_WINDOW_DAYS = 30;
|
|
73
|
+
/**
|
|
74
|
+
* AD-3140 §3.4 — default utilisation window for the scheduled ZoopOne sweep.
|
|
75
|
+
*
|
|
76
|
+
* 90 days: long enough that a seasonally idle vehicle is still refreshed before
|
|
77
|
+
* anyone tries to deploy it, short enough to keep a 5k+ fleet's provider spend
|
|
78
|
+
* bounded. Overridable per context via
|
|
79
|
+
* ConfigurationField.ComplianceUtilisationWindowDays.
|
|
80
|
+
*/
|
|
81
|
+
export const DEFAULT_COMPLIANCE_UTILISATION_WINDOW_DAYS = 90;
|
|
73
82
|
/** Every compliance type, in the order AD-3140 §2 lists them. */
|
|
74
83
|
export const VEHICLE_COMPLIANCE_KEYS = [
|
|
75
84
|
VehicleComplianceKey.RegistrationCertificate,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vehicle.compliance.enum.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/enums/src/vehicle.compliance.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAN,IAAY,oBASX;AATD,WAAY,oBAAoB;IAC/B,2EAAmD,CAAA;IACnD,mCAAW,CAAA;IACX,mDAA2B,CAAA;IAC3B,yDAAiC,CAAA;IACjC,2CAAmB,CAAA;IACnB,2CAAmB,CAAA;IACnB,qEAA6C,CAAA;IAC7C,yCAAiB,CAAA;AAClB,CAAC,EATW,oBAAoB,KAApB,oBAAoB,QAS/B;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC3B,+BAAW,CAAA;IACX,kDAA8B,CAAA;AAC/B,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B;AAED,wEAAwE;AACxE,MAAM,CAAN,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC9B,0CAAmB,CAAA;IACnB,wCAAiB,CAAA;IACjB,qDAA8B,CAAA;AAC/B,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,QAI9B;AAED;;;;;;;;GAQG;AACH,MAAM,CAAN,IAAY,kBAMX;AAND,WAAY,kBAAkB;IAC7B,qCAAe,CAAA;IACf,2CAAqB,CAAA;IACrB,yCAAmB,CAAA;IACnB,wCAAkB,CAAA;IAClB,sDAAgC,CAAA;AACjC,CAAC,EANW,kBAAkB,KAAlB,kBAAkB,QAM7B;AAED;;;GAGG;AACH,MAAM,CAAC,MA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js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/enums/src/vehicle.compliance.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAN,IAAY,oBASX;AATD,WAAY,oBAAoB;IAC/B,2EAAmD,CAAA;IACnD,mCAAW,CAAA;IACX,mDAA2B,CAAA;IAC3B,yDAAiC,CAAA;IACjC,2CAAmB,CAAA;IACnB,2CAAmB,CAAA;IACnB,qEAA6C,CAAA;IAC7C,yCAAiB,CAAA;AAClB,CAAC,EATW,oBAAoB,KAApB,oBAAoB,QAS/B;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC3B,+BAAW,CAAA;IACX,kDAA8B,CAAA;AAC/B,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B;AAED,wEAAwE;AACxE,MAAM,CAAN,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC9B,0CAAmB,CAAA;IACnB,wCAAiB,CAAA;IACjB,qDAA8B,CAAA;AAC/B,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,QAI9B;AAED;;;;;;;;GAQG;AACH,MAAM,CAAN,IAAY,kBAMX;AAND,WAAY,kBAAkB;IAC7B,qCAAe,CAAA;IACf,2CAAqB,CAAA;IACrB,yCAAmB,CAAA;IACnB,wCAAkB,CAAA;IAClB,sDAAgC,CAAA;AACjC,CAAC,EANW,kBAAkB,KAAlB,kBAAkB,QAM7B;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,EAAE,CAAC;AAEzD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,0CAA0C,GAAG,EAAE,CAAC;AAE7D,iEAAiE;AACjE,MAAM,CAAC,MAAM,uBAAuB,GAA2B;IAC9D,oBAAoB,CAAC,uBAAuB;IAC5C,oBAAoB,CAAC,GAAG;IACxB,oBAAoB,CAAC,WAAW;IAChC,oBAAoB,CAAC,cAAc;IACnC,o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AAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC;IAE7B,KAAK,MAAM,GAAG,IAAI,uBAAuB,EAAE,CAAC;QAC3C,IAAI,yBAAyB,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,KAAK,UAAU,EAAE,CAAC;YACjE,OAAO,GAAG,CAAC;QACZ,CAAC;IACF,CAAC;IACD,OAAO,+BAA+B,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC;AAC5D,CAAC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAEpC;IACH,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,EAAE,gBAAgB;IAChE,CAAC,oBAAoB,CAAC,GAAG,CAAC,EAAE,qBAAqB;IACjD,CAAC,oBAAoB,CAAC,WAAW,CAAC,EAAE,uBAAuB;IAC3D,CAAC,oBAAoB,CAAC,cAAc,CAAC,EAAE,6BAA6B;IACpE,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,aAAa;IAC7C,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,aAAa;IAC7C,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,EAAE,uBAAuB;CACpE,CAAC;AAEF,kFAAkF;AAClF,MAAM,CAAC,MAAM,uBAAuB,GAA2B;IAC9D,oBAAoB,CAAC,MAAM;CAC3B,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAA2B;IAClE,oBAAoB,CAAC,WAAW;IAChC,oBAAoB,CAAC,cAAc;IACnC,oBAAoB,CAAC,MAAM;CAC3B,CAAC"}
|
|
@@ -61,6 +61,20 @@ export declare enum ConfigurationField {
|
|
|
61
61
|
* disables the override entirely, which is the safe default.
|
|
62
62
|
*/
|
|
63
63
|
ComplianceMaxGraceDays = "cmplMaxGraceDays",
|
|
64
|
+
/**
|
|
65
|
+
* AD-3140 §3.4 — only vehicles allocated to a booking within this many days
|
|
66
|
+
* are re-verified against ZoopOne by the scheduled sweep.
|
|
67
|
+
*
|
|
68
|
+
* A cost control, not a correctness one: every provider hit is billable and
|
|
69
|
+
* the fleet is 5k+ vehicles, so a car nobody has dispatched in months is
|
|
70
|
+
* not worth re-asking about — it will be verified on demand the moment
|
|
71
|
+
* someone tries to deploy it, and the manual re-hit covers the rest.
|
|
72
|
+
*
|
|
73
|
+
* Null falls back to DEFAULT_COMPLIANCE_UTILISATION_WINDOW_DAYS. Zero is a
|
|
74
|
+
* meaningful value and means "sweep nothing" — the scheduled hit is off and
|
|
75
|
+
* only manual re-hits happen.
|
|
76
|
+
*/
|
|
77
|
+
ComplianceUtilisationWindowDays = "cmplUtilDays",
|
|
64
78
|
MarkTripAsCompletedOnPassengerDeboardingCorporate = "mrkCmpltdOnDbordCrprt",
|
|
65
79
|
MarkTripAsCompletedOnPassengerDeboardingNonCorporate = "mrkCmpltdOnDbordNnCrprt",
|
|
66
80
|
DriverSACCode = "driverSACCode",
|
|
@@ -193,6 +207,7 @@ export interface IConfigurations extends TypedModel {
|
|
|
193
207
|
[ConfigurationField.safetyAndCompliance]: Record<OwnershipType, ISafetyAndCompliance>;
|
|
194
208
|
[ConfigurationField.ComplianceWarningWindowDays]: number | null;
|
|
195
209
|
[ConfigurationField.ComplianceMaxGraceDays]: number | null;
|
|
210
|
+
[ConfigurationField.ComplianceUtilisationWindowDays]: number | null;
|
|
196
211
|
[ConfigurationField.MarkTripAsCompletedOnPassengerDeboardingCorporate]: boolean;
|
|
197
212
|
[ConfigurationField.MarkTripAsCompletedOnPassengerDeboardingNonCorporate]: boolean;
|
|
198
213
|
[ConfigurationField.DriverSACCode]: string;
|
|
@@ -52,6 +52,20 @@ export var ConfigurationField;
|
|
|
52
52
|
* disables the override entirely, which is the safe default.
|
|
53
53
|
*/
|
|
54
54
|
ConfigurationField["ComplianceMaxGraceDays"] = "cmplMaxGraceDays";
|
|
55
|
+
/**
|
|
56
|
+
* AD-3140 §3.4 — only vehicles allocated to a booking within this many days
|
|
57
|
+
* are re-verified against ZoopOne by the scheduled sweep.
|
|
58
|
+
*
|
|
59
|
+
* A cost control, not a correctness one: every provider hit is billable and
|
|
60
|
+
* the fleet is 5k+ vehicles, so a car nobody has dispatched in months is
|
|
61
|
+
* not worth re-asking about — it will be verified on demand the moment
|
|
62
|
+
* someone tries to deploy it, and the manual re-hit covers the rest.
|
|
63
|
+
*
|
|
64
|
+
* Null falls back to DEFAULT_COMPLIANCE_UTILISATION_WINDOW_DAYS. Zero is a
|
|
65
|
+
* meaningful value and means "sweep nothing" — the scheduled hit is off and
|
|
66
|
+
* only manual re-hits happen.
|
|
67
|
+
*/
|
|
68
|
+
ConfigurationField["ComplianceUtilisationWindowDays"] = "cmplUtilDays";
|
|
55
69
|
ConfigurationField["MarkTripAsCompletedOnPassengerDeboardingCorporate"] = "mrkCmpltdOnDbordCrprt";
|
|
56
70
|
ConfigurationField["MarkTripAsCompletedOnPassengerDeboardingNonCorporate"] = "mrkCmpltdOnDbordNnCrprt";
|
|
57
71
|
ConfigurationField["DriverSACCode"] = "driverSACCode";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configurations.model.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/models/src/configurations.model.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"configurations.model.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/models/src/configurations.model.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAN,IAAY,kBAiJX;AAjJD,WAAY,kBAAkB;IAC7B,yDAAmC,CAAA;IACnC,0DAAoC,CAAA;IACpC,8DAAwC,CAAA;IACxC,6DAAuC,CAAA;IACvC,8DAAwC,CAAA;IACxC,6CAAuB,CAAA;IACvB,+CAAyB,CAAA;IACzB,wCAAkB,CAAA;IAClB,yCAAmB,CAAA;IACnB,kDAA4B,CAAA;IAC5B,yDAAmC,CAAA;IACnC,qDAA+B,CAAA;IAC/B,+CAAyB,CAAA;IACzB,mEAA6C,CAAA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,kBAAkB,KAAlB,kBAAkB,QAI7B;AAED,MAAM,CAAN,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC9B,gDAAyB,CAAA;IACzB,8CAAuB,CAAA;AACxB,CAAC,EAHW,mBAAmB,KAAnB,mBAAmB,QAG9B;AAED,MAAM,CAAN,IAAY,wBASX;AATD,WAAY,wBAAwB;IACnC,gFAAoD,CAAA;IACpD,gEAAoC,CAAA;IACpC,wDAA4B,CAAA;IAC5B,8DAAkC,CAAA;IAClC,gDAAoB,CAAA;IACpB,+CAAmB,CAAA;IACnB,0EAA8C,CAAA;IAC9C,8CAAkB,CAAA;AACnB,CAAC,EATW,wBAAwB,KAAxB,wBAAwB,QASnC;AAED,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC5B,4CAAuB,CAAA;IACvB,0CAAqB,CAAA;AACtB,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAED,MAAM,CAAN,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IACnC,0DAA8B,CAAA;IAC9B,sDAA0B,CAAA;AAC3B,CAAC,EAHW,wBAAwB,KAAxB,wBAAwB,QAGnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/utilities/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,YAAY,CAAC;AAC3B,cAAc,oCAAoC,CAAC;AACnD,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wCAAwC,CAAC;AACvD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,OAAO,CAAC;AACtB,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,sBAAsB,CAAC;AACrC,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uCAAuC,CAAC;AACtD,cAAc,mBAAmB,CAAC;AAClC,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/utilities/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,YAAY,CAAC;AAC3B,cAAc,oCAAoC,CAAC;AACnD,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wCAAwC,CAAC;AACvD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,OAAO,CAAC;AACtB,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,sBAAsB,CAAC;AACrC,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uCAAuC,CAAC;AACtD,cAAc,mBAAmB,CAAC;AAClC,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC"}
|
|
@@ -1 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 1-based index of the IST calendar month `booking` falls in, counted from
|
|
3
|
+
* the IST calendar month of `anchor`. Same month → 1.
|
|
4
|
+
*
|
|
5
|
+
* The +5:30 shift moves the instant so that its UTC calendar fields read as
|
|
6
|
+
* IST wall-clock, so the components MUST be read with getUTC*. Reading the
|
|
7
|
+
* local ones (as this did originally) re-applies the host offset on top: on
|
|
8
|
+
* an IST-configured server that is +11:00, which lands on the next month for
|
|
9
|
+
* any booking picked up in the last 11 hours of a month and silently shifts
|
|
10
|
+
* that booking a whole cycle. Every sibling helper (isOnContractInMonth,
|
|
11
|
+
* monthIndexStartDate) already reads UTC fields — this is now consistent with
|
|
12
|
+
* them and independent of the host timezone.
|
|
13
|
+
*/
|
|
1
14
|
export declare function ltrCycleMonthIndex(anchor: Date, booking: Date): number;
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
import { IST_OFFSET_MS } from './ist';
|
|
2
|
+
/**
|
|
3
|
+
* 1-based index of the IST calendar month `booking` falls in, counted from
|
|
4
|
+
* the IST calendar month of `anchor`. Same month → 1.
|
|
5
|
+
*
|
|
6
|
+
* The +5:30 shift moves the instant so that its UTC calendar fields read as
|
|
7
|
+
* IST wall-clock, so the components MUST be read with getUTC*. Reading the
|
|
8
|
+
* local ones (as this did originally) re-applies the host offset on top: on
|
|
9
|
+
* an IST-configured server that is +11:00, which lands on the next month for
|
|
10
|
+
* any booking picked up in the last 11 hours of a month and silently shifts
|
|
11
|
+
* that booking a whole cycle. Every sibling helper (isOnContractInMonth,
|
|
12
|
+
* monthIndexStartDate) already reads UTC fields — this is now consistent with
|
|
13
|
+
* them and independent of the host timezone.
|
|
14
|
+
*/
|
|
2
15
|
export function ltrCycleMonthIndex(anchor, booking) {
|
|
3
16
|
const anchorIst = new Date(anchor.getTime() + IST_OFFSET_MS);
|
|
4
17
|
const bookingIst = new Date(booking.getTime() + IST_OFFSET_MS);
|
|
5
|
-
return ((bookingIst.
|
|
6
|
-
(bookingIst.
|
|
18
|
+
return ((bookingIst.getUTCFullYear() - anchorIst.getUTCFullYear()) * 12 +
|
|
19
|
+
(bookingIst.getUTCMonth() - anchorIst.getUTCMonth()) +
|
|
7
20
|
1);
|
|
8
21
|
}
|
|
9
22
|
//# sourceMappingURL=ltr.cycle.month.index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ltr.cycle.month.index.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/utilities/src/ltr.cycle.month.index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,UAAU,kBAAkB,CAAC,MAAY,EAAE,OAAa;IAC7D,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,aAAa,CAAC,CAAC;IAC7D,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,aAAa,CAAC,CAAC;IAC/D,OAAO,CACN,CAAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"ltr.cycle.month.index.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/utilities/src/ltr.cycle.month.index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAY,EAAE,OAAa;IAC7D,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,aAAa,CAAC,CAAC;IAC7D,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,aAAa,CAAC,CAAC;IAC/D,OAAO,CACN,CAAC,UAAU,CAAC,cAAc,EAAE,GAAG,SAAS,CAAC,cAAc,EAAE,CAAC,GAAG,EAAE;QAC/D,CAAC,UAAU,CAAC,WAAW,EAAE,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC;QACpD,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -3,6 +3,16 @@ import { VehicleComplianceKey } from '@autologix/shared/enums';
|
|
|
3
3
|
export interface RcComplianceMapping {
|
|
4
4
|
expiries: Partial<Record<VehicleComplianceKey, Date | null>>;
|
|
5
5
|
numbers: Partial<Record<VehicleComplianceKey, string | null>>;
|
|
6
|
+
/**
|
|
7
|
+
* Compliances the provider states are paid for the life of the vehicle and
|
|
8
|
+
* so have no expiry — `rc_tax_upto: 'LTT'` on a private car.
|
|
9
|
+
*
|
|
10
|
+
* Reported separately from `expiries` because there is no date to report,
|
|
11
|
+
* and separately from "no data" because it is the opposite claim: the RTO
|
|
12
|
+
* is telling us there is nothing left to renew. A caller that conflates the
|
|
13
|
+
* two blocks a vehicle that can never be unblocked.
|
|
14
|
+
*/
|
|
15
|
+
lifetime: Partial<Record<VehicleComplianceKey, boolean>>;
|
|
6
16
|
/** From rc_commercial_status. Null when the provider omits it. */
|
|
7
17
|
isCommercial: boolean | null;
|
|
8
18
|
/** e.g. 'Contract Carriage Permit [L TAXI]' — which permit is actually held. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseZoopDate, parseZoopFlag, parseZoopValue, } from '@autologix/shared/date-utils';
|
|
1
|
+
import { isZoopLifetimeValue, parseZoopDate, parseZoopFlag, parseZoopValue, } from '@autologix/shared/date-utils';
|
|
2
2
|
import { VehicleComplianceKey } from '@autologix/shared/enums';
|
|
3
3
|
/**
|
|
4
4
|
* Maps an RC-advance result to compliance records (AD-3140 §5).
|
|
@@ -44,6 +44,12 @@ export const mapComplianceFromRc = (raw) => {
|
|
|
44
44
|
// Form 42: no field in the payload. Left absent rather than
|
|
45
45
|
// null-mapped so the distinction stays visible here.
|
|
46
46
|
},
|
|
47
|
+
lifetime: {
|
|
48
|
+
// Road tax is the only levy the payload expresses this way. Kept as
|
|
49
|
+
// a map rather than a boolean so a provider that starts returning
|
|
50
|
+
// e.g. a lifetime permit needs no shape change here.
|
|
51
|
+
[VehicleComplianceKey.RoadTax]: isZoopLifetimeValue(r?.rc_tax_upto),
|
|
52
|
+
},
|
|
47
53
|
numbers: {
|
|
48
54
|
[VehicleComplianceKey.PUC]: parseZoopValue(r?.rc_pucc_no),
|
|
49
55
|
[VehicleComplianceKey.StatePermit]: parseZoopValue(r?.rc_permit_number),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.compliance.from.rc.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/utilities/src/map.compliance.from.rc.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,EACb,aAAa,EACb,cAAc,GACd,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"map.compliance.from.rc.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/utilities/src/map.compliance.from.rc.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,cAAc,GACd,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAgC/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,GAAQ,EAAuB,EAAE;IACpE,MAAM,CAAC,GAAG,GAAG,EAAE,MAAM,IAAI,GAAG,CAAC;IAC7B,OAAO;QACN,QAAQ,EAAE;YACT,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,EAAE,aAAa,CAC5D,CAAC,EAAE,cAAc,IAAI,CAAC,EAAE,WAAW,CACnC;YACD,CAAC,oBAAoB,CAAC,GAAG,CAAC,EAAE,aAAa,CAAC,CAAC,EAAE,mBAAmB,CAAC;YACjE,CAAC,oBAAoB,CAAC,WAAW,CAAC,EAAE,aAAa,CAChD,CAAC,EAAE,qBAAqB,IAAI,CAAC,EAAE,oBAAoB,CACnD;YACD,CAAC,oBAAoB,CAAC,cAAc,CAAC,EAAE,aAAa,CACnD,CAAC,EAAE,2BAA2B,CAC9B;YACD,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,CAAC,EAAE,WAAW,CAAC;YAC7D,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,aAAa,CAC5C,CAAC,EAAE,WAAW,IAAI,CAAC,EAAE,YAAY,CACjC;YACD,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,EAAE,aAAa,CACzD,CAAC,EAAE,SAAS,EAAE,WAAW,IAAI,CAAC,EAAE,cAAc,CAC9C;YACD,4DAA4D;YAC5D,qDAAqD;SACrD;QACD,QAAQ,EAAE;YACT,oEAAoE;YACpE,kEAAkE;YAClE,qDAAqD;YACrD,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC,CAAC,EAAE,WAAW,CAAC;SACnE;QACD,OAAO,EAAE;YACR,CAAC,oBAAoB,CAAC,GAAG,CAAC,EAAE,cAAc,CAAC,CAAC,EAAE,UAAU,CAAC;YACzD,CAAC,oBAAoB,CAAC,WAAW,CAAC,EAAE,cAAc,CACjD,CAAC,EAAE,gBAAgB,CACnB;YACD,CAAC,oBAAoB,CAAC,cAAc,CAAC,EAAE,cAAc,CACpD,CAAC,EAAE,sBAAsB,CACzB;YACD,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,EAAE,cAAc,CAC1D,CAAC,EAAE,SAAS,EAAE,aAAa,CAC3B;SACD;QACD,YAAY,EAAE,aAAa,CAAC,CAAC,EAAE,oBAAoB,CAAC;QACpD,UAAU,EAAE,cAAc,CAAC,CAAC,EAAE,cAAc,CAAC;QAC7C,UAAU,EAAE,aAAa,CAAC,CAAC,EAAE,eAAe,CAAC;QAC7C,OAAO,EAAE,cAAc,CAAC,CAAC,EAAE,IAAI,CAAC;QAChC,QAAQ,EAAE,cAAc,CAAC,CAAC,EAAE,KAAK,CAAC;QAClC,OAAO,EAAE,cAAc,CAAC,CAAC,EAAE,WAAW,CAAC;QACvC,aAAa,EAAE;YACd,gBAAgB,EAAE,aAAa,CAAC,CAAC,EAAE,iBAAiB,CAAC;YACrD,cAAc,EAAE,aAAa,CAAC,CAAC,EAAE,uBAAuB,CAAC;SACzD;KACD,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -19,7 +19,13 @@ export const resolveGstState = (explicitState, gstin, cities) => {
|
|
|
19
19
|
if (explicitState)
|
|
20
20
|
return explicitState;
|
|
21
21
|
const prefix = gstin?.trim()?.slice(0, 2);
|
|
22
|
-
|
|
22
|
+
// Typed as a possible miss on purpose: `prefix` is the first two characters
|
|
23
|
+
// of whatever GSTIN was supplied, not necessarily one of the codes the map
|
|
24
|
+
// holds, so the lookup can come back undefined — which the check below
|
|
25
|
+
// already treats as "unresolved" and falls through to the city.
|
|
26
|
+
const fromGstin = prefix
|
|
27
|
+
? GstStatemapping[prefix]
|
|
28
|
+
: undefined;
|
|
23
29
|
if (fromGstin)
|
|
24
30
|
return fromGstin;
|
|
25
31
|
// The legacy cityName/Address columns mirror cities[0] positionally, but for the state any
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.gst.state.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/utilities/src/resolve.gst.state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,gBAAgB,EAAE,eAAe,EAAS,MAAM,uBAAuB,CAAC;AAOvF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC9B,aAA4B,EAC5B,KAAqB,EACrB,MAAoC,EACrB,EAAE;IACjB,IAAI,aAAa;QAAE,OAAO,aAAa,CAAC;IAExC,MAAM,MAAM,GAAG,KAAK,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1C,MAAM,SAAS,GAAG,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"resolve.gst.state.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/utilities/src/resolve.gst.state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,gBAAgB,EAAE,eAAe,EAAS,MAAM,uBAAuB,CAAC;AAOvF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC9B,aAA4B,EAC5B,KAAqB,EACrB,MAAoC,EACrB,EAAE;IACjB,IAAI,aAAa;QAAE,OAAO,aAAa,CAAC;IAExC,MAAM,MAAM,GAAG,KAAK,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1C,4EAA4E;IAC5E,2EAA2E;IAC3E,uEAAuE;IACvE,gEAAgE;IAChE,MAAM,SAAS,GAAG,MAAM;QACvB,CAAC,CAAE,eAAqD,CAAC,MAAM,CAAC;QAChE,CAAC,CAAC,SAAS,CAAC;IACb,IAAI,SAAS;QAAE,OAAO,SAAS,CAAC;IAEhC,2FAA2F;IAC3F,6FAA6F;IAC7F,MAAM,QAAQ,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC;SAC7B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC;SACvB,IAAI,CAAC,CAAC,IAAI,EAAgB,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAE9C,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/D,CAAC,CAAC"}
|
|
@@ -1,2 +1,20 @@
|
|
|
1
1
|
import { IPassenger, IRequest } from '@autologix/shared/models';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves the name to display for a passenger — the `{{user_name}}` token in
|
|
4
|
+
* every alert template, the calendar invite title, the booking report column.
|
|
5
|
+
*
|
|
6
|
+
* `Passenger.psngrName` cannot be trusted on its own: the signup and
|
|
7
|
+
* context-lookup paths store only the first name in it while writing the full
|
|
8
|
+
* name into `firstName`/`lastName`, and a later profile edit never re-syncs it.
|
|
9
|
+
* A booking whose row had drifted that way rendered the full name for the one
|
|
10
|
+
* recipient resolved through the booking communications (that path composes
|
|
11
|
+
* `firstName + lastName`) and the first name alone for everyone else.
|
|
12
|
+
*
|
|
13
|
+
* So the composed `firstName + lastName` is used in preference to `psngrName`,
|
|
14
|
+
* but only when it contributes a name part `psngrName` is missing. That keeps
|
|
15
|
+
* the output identical for every row where `psngrName` is already complete —
|
|
16
|
+
* including the ones whose `lastName` merely repeats a word the stored name
|
|
17
|
+
* already has — and only repairs the genuinely truncated ones. The names
|
|
18
|
+
* carried on the request are used when the passenger row yields nothing.
|
|
19
|
+
*/
|
|
2
20
|
export declare function resolvePassengerDisplayName(passenger: IPassenger | null | undefined, request: IRequest | null | undefined): string;
|
|
@@ -2,20 +2,47 @@ import { PassengerField, RequestCommunicationField, RequestField, RequestPasseng
|
|
|
2
2
|
function isValidName(value) {
|
|
3
3
|
return !!value && value !== 'undefined' && value !== 'null';
|
|
4
4
|
}
|
|
5
|
+
/** Trimmed value, or '' for anything the caller must not display. */
|
|
6
|
+
function cleanName(value) {
|
|
7
|
+
return isValidName(value) ? value.trim() : '';
|
|
8
|
+
}
|
|
9
|
+
/** Lower-cased name parts — "Ravi Kumar" → ['ravi', 'kumar']. */
|
|
10
|
+
function nameParts(value) {
|
|
11
|
+
return value ? value.toLowerCase().split(/\s+/).filter(Boolean) : [];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the name to display for a passenger — the `{{user_name}}` token in
|
|
15
|
+
* every alert template, the calendar invite title, the booking report column.
|
|
16
|
+
*
|
|
17
|
+
* `Passenger.psngrName` cannot be trusted on its own: the signup and
|
|
18
|
+
* context-lookup paths store only the first name in it while writing the full
|
|
19
|
+
* name into `firstName`/`lastName`, and a later profile edit never re-syncs it.
|
|
20
|
+
* A booking whose row had drifted that way rendered the full name for the one
|
|
21
|
+
* recipient resolved through the booking communications (that path composes
|
|
22
|
+
* `firstName + lastName`) and the first name alone for everyone else.
|
|
23
|
+
*
|
|
24
|
+
* So the composed `firstName + lastName` is used in preference to `psngrName`,
|
|
25
|
+
* but only when it contributes a name part `psngrName` is missing. That keeps
|
|
26
|
+
* the output identical for every row where `psngrName` is already complete —
|
|
27
|
+
* including the ones whose `lastName` merely repeats a word the stored name
|
|
28
|
+
* already has — and only repairs the genuinely truncated ones. The names
|
|
29
|
+
* carried on the request are used when the passenger row yields nothing.
|
|
30
|
+
*/
|
|
5
31
|
export function resolvePassengerDisplayName(passenger, request) {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
32
|
+
const storedName = cleanName(passenger?.[PassengerField.PassengerName]);
|
|
33
|
+
const composedName = [
|
|
34
|
+
cleanName(passenger?.[PassengerField.FirstName]),
|
|
35
|
+
cleanName(passenger?.[PassengerField.LastName]),
|
|
36
|
+
]
|
|
37
|
+
.filter(Boolean)
|
|
38
|
+
.join(' ');
|
|
39
|
+
const storedParts = nameParts(storedName);
|
|
40
|
+
const composedAddsAName = nameParts(composedName).some((part) => !storedParts.includes(part));
|
|
41
|
+
const passengerName = composedName && composedAddsAName ? composedName : storedName;
|
|
42
|
+
if (passengerName) {
|
|
43
|
+
return passengerName;
|
|
12
44
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
(isValidName(commName) ? commName.split(' ')[0] : '');
|
|
16
|
-
const firstName = isValidName(firstNameRaw) ? firstNameRaw : '';
|
|
17
|
-
const lastNameRaw = passenger?.[PassengerField.LastName] ?? '';
|
|
18
|
-
const lastName = isValidName(lastNameRaw) ? lastNameRaw : '';
|
|
19
|
-
return [firstName, lastName].filter(Boolean).join(' ');
|
|
45
|
+
return (cleanName(request?.[RequestField.PassengerDetails]?.[0]?.[RequestPassengerField.PassengerName]) ||
|
|
46
|
+
cleanName(request?.[RequestField.Communications]?.[0]?.[RequestCommunicationField.PassengerName]));
|
|
20
47
|
}
|
|
21
48
|
//# sourceMappingURL=resolve.passenger.display.name.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.passenger.display.name.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/utilities/src/resolve.passenger.display.name.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,cAAc,EACd,yBAAyB,EACzB,YAAY,EACZ,qBAAqB,GACrB,MAAM,0BAA0B,CAAC;AAElC,SAAS,WAAW,CAAC,KAAgC;IACpD,OAAO,CAAC,CAAC,KAAK,IAAI,KAAK,KAAK,WAAW,IAAI,KAAK,KAAK,MAAM,CAAC;AAC7D,CAAC;AAED,
|
|
1
|
+
{"version":3,"file":"resolve.passenger.display.name.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/utilities/src/resolve.passenger.display.name.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,cAAc,EACd,yBAAyB,EACzB,YAAY,EACZ,qBAAqB,GACrB,MAAM,0BAA0B,CAAC;AAElC,SAAS,WAAW,CAAC,KAAgC;IACpD,OAAO,CAAC,CAAC,KAAK,IAAI,KAAK,KAAK,WAAW,IAAI,KAAK,KAAK,MAAM,CAAC;AAC7D,CAAC;AAED,qEAAqE;AACrE,SAAS,SAAS,CAAC,KAAgC;IAClD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC/C,CAAC;AAED,iEAAiE;AACjE,SAAS,SAAS,CAAC,KAAa;IAC/B,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACtE,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,2BAA2B,CAC1C,SAAwC,EACxC,OAAoC;IAEpC,MAAM,UAAU,GAAG,SAAS,CAAC,SAAS,EAAE,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IACxE,MAAM,YAAY,GAAG;QACpB,SAAS,CAAC,SAAS,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QAChD,SAAS,CAAC,SAAS,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;KAC/C;SACC,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAC;IAEZ,MAAM,WAAW,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;IAC1C,MAAM,iBAAiB,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC,IAAI,CACrD,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CACrC,CAAC;IACF,MAAM,aAAa,GAClB,YAAY,IAAI,iBAAiB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC;IAE/D,IAAI,aAAa,EAAE,CAAC;QACnB,OAAO,aAAa,CAAC;IACtB,CAAC;IAED,OAAO,CACN,SAAS,CACR,OAAO,EAAE,CAAC,YAAY,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAC9C,qBAAqB,CAAC,aAAa,CACnC,CACD;QACD,SAAS,CACR,OAAO,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAC5C,yBAAyB,CAAC,aAAa,CACvC,CACD,CACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { IVehicleInsurance } from '../../models/src/index';
|
|
2
|
+
/**
|
|
3
|
+
* "Is this vehicle insured?" — one implementation, for every gate that asks.
|
|
4
|
+
*
|
|
5
|
+
* ── Why this file exists ───────────────────────────────────────────────────
|
|
6
|
+
* The BA payout flow asked that question in two places and answered it with
|
|
7
|
+
* two copies of the same twenty lines:
|
|
8
|
+
* • get.business.associate.payout.template.controller.ts — writes
|
|
9
|
+
* "Insurance has expired" into the downloaded template's Remarks column;
|
|
10
|
+
* • process.business.associate.payout.upload.controller.ts — pushes the same
|
|
11
|
+
* text into `invalidRows`, which Iris treats as a hard stop.
|
|
12
|
+
* Both shipped on 2025-12-16. AD-3227 adds a THIRD gate, at final generate,
|
|
13
|
+
* and three copies of a money-blocking predicate is two too many — so the
|
|
14
|
+
* predicate moved here and all three call it.
|
|
15
|
+
*
|
|
16
|
+
* ── Two questions, one predicate ───────────────────────────────────────────
|
|
17
|
+
* `hasInsuranceValidOn` is the original predicate, unchanged: is any policy
|
|
18
|
+
* in force on one given instant. The template and upload gates keep passing
|
|
19
|
+
* `new Date()` and keep behaving exactly as they did.
|
|
20
|
+
*
|
|
21
|
+
* `uninsuredDaysInPeriod` is the new question, and it is built ON that
|
|
22
|
+
* predicate rather than beside it: which days of a payout period is the
|
|
23
|
+
* vehicle NOT covered for. Generate needs the period, not today — see
|
|
24
|
+
* `uninsuredDaysInPeriod` for the measurement behind that choice.
|
|
25
|
+
*/
|
|
26
|
+
/** Reused verbatim; not a new string. */
|
|
27
|
+
export declare const INSURANCE_MISSING_ERROR = "Insurance is not added";
|
|
28
|
+
/** Reused verbatim; not a new string. */
|
|
29
|
+
export declare const INSURANCE_EXPIRED_ERROR = "Insurance has expired";
|
|
30
|
+
/**
|
|
31
|
+
* Is any of these policies in force on `at`?
|
|
32
|
+
*
|
|
33
|
+
* Lifted unchanged from the two payout controllers, down to the
|
|
34
|
+
* midnight-normalisation on both sides — a policy that expires today still
|
|
35
|
+
* counts as valid today, which is why an upload at 13:34 passed 96 seconds
|
|
36
|
+
* after the end date was set to that same day (AD-3227, comment 79918).
|
|
37
|
+
*
|
|
38
|
+
* The only thing dropped is the copies' `[...insurances].sort()` by `validTo`
|
|
39
|
+
* descending. Its result was fed straight to `.some()` over a pure predicate,
|
|
40
|
+
* where order cannot change the answer: dead work, not behaviour.
|
|
41
|
+
*/
|
|
42
|
+
export declare const hasInsuranceValidOn: (insurances: IVehicleInsurance[] | null | undefined, at: Date) => boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Which IST days between `from` and `to` (both inclusive) is this vehicle NOT
|
|
45
|
+
* insured for?
|
|
46
|
+
*
|
|
47
|
+
* ── Why the period and not "today" ─────────────────────────────────────────
|
|
48
|
+
* The obvious move for the generate gate was to reuse the upload gate's rule
|
|
49
|
+
* verbatim: is the vehicle insured RIGHT NOW. Measured against staging over
|
|
50
|
+
* 342 contract-runs (every context, every 2026 period), that rule blocks 134
|
|
51
|
+
* of them — and 85 of those 134 are payouts for a month the vehicle was
|
|
52
|
+
* insured throughout, refused in a later month because the policy has since
|
|
53
|
+
* lapsed. Generating August in September for a vehicle whose policy ran all
|
|
54
|
+
* August is exactly the legitimate historical payout the money depends on. The
|
|
55
|
+
* same measurement shows "today" also UNDER-detects: 17 runs pass it while the
|
|
56
|
+
* vehicle was uninsured for the period actually being paid.
|
|
57
|
+
*
|
|
58
|
+
* So the question asked here is coverage across the payout period. Within that
|
|
59
|
+
* there was a second choice — any overlap (60 blocked) versus every day
|
|
60
|
+
* covered (66 blocked). They differ on 6 of 342, and 4 of the 6 are not
|
|
61
|
+
* rounding: contract 1013 / KA67M0017 is paid for 01–24 Feb against a policy
|
|
62
|
+
* starting 23 Feb, 22 of 24 paid days uninsured, which "any overlap" waves
|
|
63
|
+
* through. Every-day-covered is what the money depends on, so that is what
|
|
64
|
+
* this returns — the caller decides what to do with a non-empty list.
|
|
65
|
+
*
|
|
66
|
+
* Returns the uninsured days in order, so a caller can name the gap rather
|
|
67
|
+
* than just assert one exists. An empty array means fully covered.
|
|
68
|
+
*/
|
|
69
|
+
export declare const uninsuredDaysInPeriod: (insurances: IVehicleInsurance[] | null | undefined, from: Date, to: Date) => string[];
|
|
70
|
+
/**
|
|
71
|
+
* The uninsured days as a phrase a user can act on.
|
|
72
|
+
*
|
|
73
|
+
* One day is named; an unbroken run becomes `01 Aug 2026 - 31 Aug 2026`. A
|
|
74
|
+
* BROKEN run — two policies with a hole between them — is NOT collapsed into a
|
|
75
|
+
* range, because that would claim the whole span was uncovered when only part
|
|
76
|
+
* of it was, and this text is the justification for refusing to pay someone.
|
|
77
|
+
*/
|
|
78
|
+
export declare const describeUninsuredDays: (days: string[]) => string;
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { VehicleInsuranceField, } from '../../models/src/index';
|
|
2
|
+
import { IST_OFFSET_MS } from './ist';
|
|
3
|
+
/**
|
|
4
|
+
* "Is this vehicle insured?" — one implementation, for every gate that asks.
|
|
5
|
+
*
|
|
6
|
+
* ── Why this file exists ───────────────────────────────────────────────────
|
|
7
|
+
* The BA payout flow asked that question in two places and answered it with
|
|
8
|
+
* two copies of the same twenty lines:
|
|
9
|
+
* • get.business.associate.payout.template.controller.ts — writes
|
|
10
|
+
* "Insurance has expired" into the downloaded template's Remarks column;
|
|
11
|
+
* • process.business.associate.payout.upload.controller.ts — pushes the same
|
|
12
|
+
* text into `invalidRows`, which Iris treats as a hard stop.
|
|
13
|
+
* Both shipped on 2025-12-16. AD-3227 adds a THIRD gate, at final generate,
|
|
14
|
+
* and three copies of a money-blocking predicate is two too many — so the
|
|
15
|
+
* predicate moved here and all three call it.
|
|
16
|
+
*
|
|
17
|
+
* ── Two questions, one predicate ───────────────────────────────────────────
|
|
18
|
+
* `hasInsuranceValidOn` is the original predicate, unchanged: is any policy
|
|
19
|
+
* in force on one given instant. The template and upload gates keep passing
|
|
20
|
+
* `new Date()` and keep behaving exactly as they did.
|
|
21
|
+
*
|
|
22
|
+
* `uninsuredDaysInPeriod` is the new question, and it is built ON that
|
|
23
|
+
* predicate rather than beside it: which days of a payout period is the
|
|
24
|
+
* vehicle NOT covered for. Generate needs the period, not today — see
|
|
25
|
+
* `uninsuredDaysInPeriod` for the measurement behind that choice.
|
|
26
|
+
*/
|
|
27
|
+
/** Reused verbatim; not a new string. */
|
|
28
|
+
export const INSURANCE_MISSING_ERROR = 'Insurance is not added';
|
|
29
|
+
/** Reused verbatim; not a new string. */
|
|
30
|
+
export const INSURANCE_EXPIRED_ERROR = 'Insurance has expired';
|
|
31
|
+
/**
|
|
32
|
+
* A period longer than this is bad data, not a payout. Caps the day loop so a
|
|
33
|
+
* corrupt contract date cannot spin the request.
|
|
34
|
+
*/
|
|
35
|
+
const MAX_PERIOD_DAYS = 400;
|
|
36
|
+
/**
|
|
37
|
+
* Is any of these policies in force on `at`?
|
|
38
|
+
*
|
|
39
|
+
* Lifted unchanged from the two payout controllers, down to the
|
|
40
|
+
* midnight-normalisation on both sides — a policy that expires today still
|
|
41
|
+
* counts as valid today, which is why an upload at 13:34 passed 96 seconds
|
|
42
|
+
* after the end date was set to that same day (AD-3227, comment 79918).
|
|
43
|
+
*
|
|
44
|
+
* The only thing dropped is the copies' `[...insurances].sort()` by `validTo`
|
|
45
|
+
* descending. Its result was fed straight to `.some()` over a pure predicate,
|
|
46
|
+
* where order cannot change the answer: dead work, not behaviour.
|
|
47
|
+
*/
|
|
48
|
+
export const hasInsuranceValidOn = (insurances, at) => {
|
|
49
|
+
if (!insurances?.length)
|
|
50
|
+
return false;
|
|
51
|
+
const reference = new Date(at);
|
|
52
|
+
reference.setHours(0, 0, 0, 0);
|
|
53
|
+
return insurances.some((insurance) => {
|
|
54
|
+
const validFrom = insurance?.[VehicleInsuranceField.ValidFrom];
|
|
55
|
+
const validTo = insurance?.[VehicleInsuranceField.ValidTo];
|
|
56
|
+
if (!validFrom || !validTo)
|
|
57
|
+
return false;
|
|
58
|
+
const from = new Date(validFrom);
|
|
59
|
+
from.setHours(0, 0, 0, 0);
|
|
60
|
+
const to = new Date(validTo);
|
|
61
|
+
to.setHours(0, 0, 0, 0);
|
|
62
|
+
return reference >= from && reference <= to;
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
/** The IST calendar day an instant falls on, as `YYYY-MM-DD`. */
|
|
66
|
+
const istDayKey = (value) => new Date(value.getTime() + IST_OFFSET_MS).toISOString().slice(0, 10);
|
|
67
|
+
/**
|
|
68
|
+
* Midday IST on an IST calendar day — 06:30 UTC.
|
|
69
|
+
*
|
|
70
|
+
* Deliberately noon and not midnight. `hasInsuranceValidOn` normalises with
|
|
71
|
+
* `setHours(0, 0, 0, 0)`, which is the SERVER's local midnight; the staging and
|
|
72
|
+
* production boxes run UTC (verified), developers run IST. 06:30 UTC is inside
|
|
73
|
+
* the intended calendar day under BOTH — 00:00 UTC would slip to the previous
|
|
74
|
+
* day on an IST box, and 18:30 UTC to the next day on a UTC one.
|
|
75
|
+
*
|
|
76
|
+
* It is not universally timezone-proof and is not pretending to be: on a host
|
|
77
|
+
* more than 6.5 hours behind UTC the probe lands on the previous local day. The
|
|
78
|
+
* alternative was to re-normalise `hasInsuranceValidOn` itself to IST days,
|
|
79
|
+
* which would silently move the two ALREADY DEPLOYED gates (template download
|
|
80
|
+
* and template upload) by up to 5.5 hours at the boundary. Reusing the shipped
|
|
81
|
+
* predicate untouched is worth more than covering a timezone no server runs;
|
|
82
|
+
* jest.ba-payout-draft.config.js pins TZ=UTC so the specs assert what the
|
|
83
|
+
* servers do.
|
|
84
|
+
*/
|
|
85
|
+
const istNoonOf = (dayKey) => new Date(`${dayKey}T06:30:00.000Z`);
|
|
86
|
+
/**
|
|
87
|
+
* The next `YYYY-MM-DD`. Pure UTC arithmetic on the key itself — going back
|
|
88
|
+
* through `istDayKey` would shift by +5:30 and land on the SAME day, which is
|
|
89
|
+
* an infinite loop dressed up as an off-by-one.
|
|
90
|
+
*/
|
|
91
|
+
const nextDayKey = (dayKey) => new Date(new Date(`${dayKey}T00:00:00.000Z`).getTime() + 86400000)
|
|
92
|
+
.toISOString()
|
|
93
|
+
.slice(0, 10);
|
|
94
|
+
/**
|
|
95
|
+
* Which IST days between `from` and `to` (both inclusive) is this vehicle NOT
|
|
96
|
+
* insured for?
|
|
97
|
+
*
|
|
98
|
+
* ── Why the period and not "today" ─────────────────────────────────────────
|
|
99
|
+
* The obvious move for the generate gate was to reuse the upload gate's rule
|
|
100
|
+
* verbatim: is the vehicle insured RIGHT NOW. Measured against staging over
|
|
101
|
+
* 342 contract-runs (every context, every 2026 period), that rule blocks 134
|
|
102
|
+
* of them — and 85 of those 134 are payouts for a month the vehicle was
|
|
103
|
+
* insured throughout, refused in a later month because the policy has since
|
|
104
|
+
* lapsed. Generating August in September for a vehicle whose policy ran all
|
|
105
|
+
* August is exactly the legitimate historical payout the money depends on. The
|
|
106
|
+
* same measurement shows "today" also UNDER-detects: 17 runs pass it while the
|
|
107
|
+
* vehicle was uninsured for the period actually being paid.
|
|
108
|
+
*
|
|
109
|
+
* So the question asked here is coverage across the payout period. Within that
|
|
110
|
+
* there was a second choice — any overlap (60 blocked) versus every day
|
|
111
|
+
* covered (66 blocked). They differ on 6 of 342, and 4 of the 6 are not
|
|
112
|
+
* rounding: contract 1013 / KA67M0017 is paid for 01–24 Feb against a policy
|
|
113
|
+
* starting 23 Feb, 22 of 24 paid days uninsured, which "any overlap" waves
|
|
114
|
+
* through. Every-day-covered is what the money depends on, so that is what
|
|
115
|
+
* this returns — the caller decides what to do with a non-empty list.
|
|
116
|
+
*
|
|
117
|
+
* Returns the uninsured days in order, so a caller can name the gap rather
|
|
118
|
+
* than just assert one exists. An empty array means fully covered.
|
|
119
|
+
*/
|
|
120
|
+
export const uninsuredDaysInPeriod = (insurances, from, to) => {
|
|
121
|
+
if (!from || !to)
|
|
122
|
+
return [];
|
|
123
|
+
const first = istDayKey(from);
|
|
124
|
+
const last = istDayKey(to);
|
|
125
|
+
if (first > last)
|
|
126
|
+
return [];
|
|
127
|
+
const uninsured = [];
|
|
128
|
+
let day = first;
|
|
129
|
+
for (let guard = 0; guard < MAX_PERIOD_DAYS && day <= last; guard += 1) {
|
|
130
|
+
if (!hasInsuranceValidOn(insurances, istNoonOf(day))) {
|
|
131
|
+
uninsured.push(day);
|
|
132
|
+
}
|
|
133
|
+
day = nextDayKey(day);
|
|
134
|
+
}
|
|
135
|
+
return uninsured;
|
|
136
|
+
};
|
|
137
|
+
const MONTH_LABELS = [
|
|
138
|
+
'Jan',
|
|
139
|
+
'Feb',
|
|
140
|
+
'Mar',
|
|
141
|
+
'Apr',
|
|
142
|
+
'May',
|
|
143
|
+
'Jun',
|
|
144
|
+
'Jul',
|
|
145
|
+
'Aug',
|
|
146
|
+
'Sep',
|
|
147
|
+
'Oct',
|
|
148
|
+
'Nov',
|
|
149
|
+
'Dec',
|
|
150
|
+
];
|
|
151
|
+
/** `2026-08-01` -> `01 Aug 2026`. */
|
|
152
|
+
const dayLabel = (dayKey) => {
|
|
153
|
+
const [year, month, date] = dayKey.split('-');
|
|
154
|
+
return `${date} ${MONTH_LABELS[Number(month) - 1] ?? month} ${year}`;
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* The uninsured days as a phrase a user can act on.
|
|
158
|
+
*
|
|
159
|
+
* One day is named; an unbroken run becomes `01 Aug 2026 - 31 Aug 2026`. A
|
|
160
|
+
* BROKEN run — two policies with a hole between them — is NOT collapsed into a
|
|
161
|
+
* range, because that would claim the whole span was uncovered when only part
|
|
162
|
+
* of it was, and this text is the justification for refusing to pay someone.
|
|
163
|
+
*/
|
|
164
|
+
export const describeUninsuredDays = (days) => {
|
|
165
|
+
if (!days.length)
|
|
166
|
+
return '';
|
|
167
|
+
if (days.length === 1)
|
|
168
|
+
return dayLabel(days[0]);
|
|
169
|
+
const first = days[0];
|
|
170
|
+
const last = days[days.length - 1];
|
|
171
|
+
let expected = first;
|
|
172
|
+
let contiguous = true;
|
|
173
|
+
for (const day of days) {
|
|
174
|
+
if (day !== expected) {
|
|
175
|
+
contiguous = false;
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
expected = nextDayKey(expected);
|
|
179
|
+
}
|
|
180
|
+
return contiguous
|
|
181
|
+
? `${dayLabel(first)} - ${dayLabel(last)}`
|
|
182
|
+
: `${days.length} days between ${dayLabel(first)} and ${dayLabel(last)}`;
|
|
183
|
+
};
|
|
184
|
+
//# sourceMappingURL=vehicle.insurance.validity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vehicle.insurance.validity.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/utilities/src/vehicle.insurance.validity.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,qBAAqB,GACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,yCAAyC;AACzC,MAAM,CAAC,MAAM,uBAAuB,GAAG,wBAAw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