@autologix-engineering/shared 1.2.375 → 1.2.377

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.
Files changed (51) hide show
  1. package/package.json +1 -1
  2. package/src/lib/data-transfer-objects/src/check.vehicle.allocation.conflicts.dto.d.ts +19 -0
  3. package/src/lib/data-transfer-objects/src/check.vehicle.allocation.conflicts.dto.js +38 -0
  4. package/src/lib/data-transfer-objects/src/check.vehicle.allocation.conflicts.dto.js.map +1 -0
  5. package/src/lib/data-transfer-objects/src/index.d.ts +2 -0
  6. package/src/lib/data-transfer-objects/src/index.js +2 -0
  7. package/src/lib/data-transfer-objects/src/index.js.map +1 -1
  8. package/src/lib/data-transfer-objects/src/update.vehicle.allocation.conflict.window.dto.d.ts +15 -0
  9. package/src/lib/data-transfer-objects/src/update.vehicle.allocation.conflict.window.dto.js +29 -0
  10. package/src/lib/data-transfer-objects/src/update.vehicle.allocation.conflict.window.dto.js.map +1 -0
  11. package/src/lib/enums/src/command.type.enum.d.ts +1 -0
  12. package/src/lib/enums/src/command.type.enum.js +1 -0
  13. package/src/lib/enums/src/command.type.enum.js.map +1 -1
  14. package/src/lib/enums/src/index.d.ts +1 -0
  15. package/src/lib/enums/src/index.js +1 -0
  16. package/src/lib/enums/src/index.js.map +1 -1
  17. package/src/lib/enums/src/query.type.enum.d.ts +1 -0
  18. package/src/lib/enums/src/query.type.enum.js +1 -0
  19. package/src/lib/enums/src/query.type.enum.js.map +1 -1
  20. package/src/lib/enums/src/report.module.type.enum.d.ts +5 -1
  21. package/src/lib/enums/src/report.module.type.enum.js +4 -0
  22. package/src/lib/enums/src/report.module.type.enum.js.map +1 -1
  23. package/src/lib/enums/src/vehicle.allocation.conflict.enum.d.ts +65 -0
  24. package/src/lib/enums/src/vehicle.allocation.conflict.enum.js +71 -0
  25. package/src/lib/enums/src/vehicle.allocation.conflict.enum.js.map +1 -0
  26. package/src/lib/models/src/ba.payout.row.model.d.ts +24 -0
  27. package/src/lib/models/src/ba.payout.row.model.js.map +1 -1
  28. package/src/lib/models/src/configurations.model.d.ts +12 -0
  29. package/src/lib/models/src/configurations.model.js +11 -0
  30. package/src/lib/models/src/configurations.model.js.map +1 -1
  31. package/src/lib/routes/src/command.registry.routes.d.ts +1 -0
  32. package/src/lib/routes/src/command.registry.routes.js +1 -0
  33. package/src/lib/routes/src/command.registry.routes.js.map +1 -1
  34. package/src/lib/routes/src/query.service.routes.d.ts +1 -0
  35. package/src/lib/routes/src/query.service.routes.js +1 -0
  36. package/src/lib/routes/src/query.service.routes.js.map +1 -1
  37. package/src/lib/utilities/src/ba.payout.workshop.days.d.ts +77 -0
  38. package/src/lib/utilities/src/ba.payout.workshop.days.js +109 -0
  39. package/src/lib/utilities/src/ba.payout.workshop.days.js.map +1 -0
  40. package/src/lib/utilities/src/financial.year.d.ts +83 -0
  41. package/src/lib/utilities/src/financial.year.js +145 -0
  42. package/src/lib/utilities/src/financial.year.js.map +1 -0
  43. package/src/lib/utilities/src/index.d.ts +2 -0
  44. package/src/lib/utilities/src/index.js +2 -0
  45. package/src/lib/utilities/src/index.js.map +1 -1
  46. package/src/lib/view-models/src/index.d.ts +1 -0
  47. package/src/lib/view-models/src/index.js +1 -0
  48. package/src/lib/view-models/src/index.js.map +1 -1
  49. package/src/lib/view-models/src/vehicle.allocation.conflict.d.ts +28 -0
  50. package/src/lib/view-models/src/vehicle.allocation.conflict.js +2 -0
  51. package/src/lib/view-models/src/vehicle.allocation.conflict.js.map +1 -0
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Indian financial year helpers, in IST.
3
+ *
4
+ * A financial year runs 1 April 00:00:00.000 IST to 31 March 23:59:59.999 IST.
5
+ * Every boundary here is an IST boundary expressed as a UTC instant, because
6
+ * that is how the database stores time: TimePeriod.startDate for September 2026
7
+ * is 2026-08-31T18:30:00Z, i.e. 1 September 00:00 IST. Deriving the month with
8
+ * plain `getMonth()` on the server's local clock would put every payout period
9
+ * that starts at 18:30 UTC into the previous month on any machine running UTC —
10
+ * a whole column of the RM schedule shifted by one.
11
+ *
12
+ * Written for AD-3098 (BA Retention Money schedule) and deliberately kept free
13
+ * of anything RM-specific so AD-3097 (Security Deposit schedule), which has the
14
+ * same April–March, one-column-group-per-month shape, can use it unchanged.
15
+ */
16
+ /** 1 April 00:00:00.000 IST of `startYear`, as a UTC instant. */
17
+ export declare function financialYearStart(startYear: number): Date;
18
+ /** 31 March 23:59:59.999 IST of `startYear + 1`, as a UTC instant. */
19
+ export declare function financialYearEnd(startYear: number): Date;
20
+ /**
21
+ * The financial year's bounds as plain IST calendar dates, 'YYYY-MM-DD'.
22
+ *
23
+ * Preferred over the Date forms whenever the other side of the comparison also
24
+ * came out of Postgres as an IST calendar day, because string comparison of
25
+ * 'YYYY-MM-DD' cannot be knocked off by the process timezone. `timestamp
26
+ * without time zone` columns — which is what every contract date in this schema
27
+ * is — are parsed by node-postgres in the SERVER's local zone, so the same row
28
+ * yields a different instant on a UTC box than on an IST laptop.
29
+ */
30
+ export declare function financialYearStartDay(startYear: number): string;
31
+ export declare function financialYearEndDay(startYear: number): string;
32
+ /**
33
+ * The financial year that contains `d`, identified by its opening calendar
34
+ * year: 2026 means FY 2026-27 (Apr 2026 – Mar 2027).
35
+ *
36
+ * Takes ANY instant inside the year rather than requiring the caller to pass
37
+ * 1 April, so a report can be re-run from a stored request payload without the
38
+ * caller having to remember which end of the range was canonical.
39
+ */
40
+ export declare function resolveFinancialYearStartYear(d: Date | string): number;
41
+ /** e.g. startYear 2026 -> '2026-27'. */
42
+ export declare function financialYearLabel(startYear: number): string;
43
+ export interface FinancialYearMonth {
44
+ /** 0-based position in the financial year: 0 = April, 11 = March. */
45
+ index: number;
46
+ /** Calendar year of this month (2027 for the March of FY 2026-27). */
47
+ year: number;
48
+ /** 0-based calendar month, as `Date.getUTCMonth()` returns it. */
49
+ month: number;
50
+ /** 'Apr 26' — the label the RM/SD schedule column groups are titled with. */
51
+ label: string;
52
+ /**
53
+ * 'YYYY-MM'. Matches what `to_char(ts + interval '5 hours 30 minutes',
54
+ * 'YYYY-MM')` produces in Postgres, so a month can be bucketed in SQL and
55
+ * looked up here without either side parsing a timestamp in Node.
56
+ */
57
+ key: string;
58
+ /** First instant of the month, 00:00:00.000 IST as a UTC instant. */
59
+ startUTC: Date;
60
+ /** Last instant of the month, 23:59:59.999 IST as a UTC instant. */
61
+ endUTC: Date;
62
+ }
63
+ /**
64
+ * The twelve months of a financial year in order, April first.
65
+ */
66
+ export declare function financialYearMonths(startYear: number): FinancialYearMonth[];
67
+ /**
68
+ * Which financial-year month `d` falls in, as a 0-based index (0 = April), or
69
+ * -1 when it falls outside the year entirely.
70
+ *
71
+ * Accepts either an instant (TimePeriod.startDate, a UTC timestamp) or a plain
72
+ * 'YYYY-MM-DD' calendar date (rvRefundDate, a Postgres `date`). A calendar date
73
+ * has no timezone at all, so it is read as the IST day it names — parsing it as
74
+ * a UTC instant and then adding the IST offset would move 1 April to 1 April
75
+ * 05:30 IST, which is still 1 April, but 31 March would move to 31 March 05:30
76
+ * and stay correct too. The branch exists so the intent is not accidental.
77
+ */
78
+ export declare function financialYearMonthIndex(d: Date | string | null | undefined, startYear: number): number;
79
+ /**
80
+ * True when `d` lands strictly before 1 April 00:00 IST of the financial year —
81
+ * i.e. it belongs to the opening balance rather than to any month column.
82
+ */
83
+ export declare function isBeforeFinancialYear(d: Date | string | null | undefined, startYear: number): boolean;
@@ -0,0 +1,145 @@
1
+ import { IST_OFFSET_MS, addIstOffset } from './ist';
2
+ /**
3
+ * Indian financial year helpers, in IST.
4
+ *
5
+ * A financial year runs 1 April 00:00:00.000 IST to 31 March 23:59:59.999 IST.
6
+ * Every boundary here is an IST boundary expressed as a UTC instant, because
7
+ * that is how the database stores time: TimePeriod.startDate for September 2026
8
+ * is 2026-08-31T18:30:00Z, i.e. 1 September 00:00 IST. Deriving the month with
9
+ * plain `getMonth()` on the server's local clock would put every payout period
10
+ * that starts at 18:30 UTC into the previous month on any machine running UTC —
11
+ * a whole column of the RM schedule shifted by one.
12
+ *
13
+ * Written for AD-3098 (BA Retention Money schedule) and deliberately kept free
14
+ * of anything RM-specific so AD-3097 (Security Deposit schedule), which has the
15
+ * same April–March, one-column-group-per-month shape, can use it unchanged.
16
+ */
17
+ /** 1 April 00:00:00.000 IST of `startYear`, as a UTC instant. */
18
+ export function financialYearStart(startYear) {
19
+ return new Date(Date.UTC(startYear, 3, 1) - IST_OFFSET_MS);
20
+ }
21
+ /** 31 March 23:59:59.999 IST of `startYear + 1`, as a UTC instant. */
22
+ export function financialYearEnd(startYear) {
23
+ return new Date(Date.UTC(startYear + 1, 3, 1) - IST_OFFSET_MS - 1);
24
+ }
25
+ /**
26
+ * The financial year's bounds as plain IST calendar dates, 'YYYY-MM-DD'.
27
+ *
28
+ * Preferred over the Date forms whenever the other side of the comparison also
29
+ * came out of Postgres as an IST calendar day, because string comparison of
30
+ * 'YYYY-MM-DD' cannot be knocked off by the process timezone. `timestamp
31
+ * without time zone` columns — which is what every contract date in this schema
32
+ * is — are parsed by node-postgres in the SERVER's local zone, so the same row
33
+ * yields a different instant on a UTC box than on an IST laptop.
34
+ */
35
+ export function financialYearStartDay(startYear) {
36
+ return `${startYear}-04-01`;
37
+ }
38
+ export function financialYearEndDay(startYear) {
39
+ return `${startYear + 1}-03-31`;
40
+ }
41
+ /**
42
+ * The financial year that contains `d`, identified by its opening calendar
43
+ * year: 2026 means FY 2026-27 (Apr 2026 – Mar 2027).
44
+ *
45
+ * Takes ANY instant inside the year rather than requiring the caller to pass
46
+ * 1 April, so a report can be re-run from a stored request payload without the
47
+ * caller having to remember which end of the range was canonical.
48
+ */
49
+ export function resolveFinancialYearStartYear(d) {
50
+ const ist = addIstOffset(new Date(d));
51
+ const month = ist.getUTCMonth(); // 0 = January
52
+ const year = ist.getUTCFullYear();
53
+ // January, February and March belong to the FY that opened last April.
54
+ return month < 3 ? year - 1 : year;
55
+ }
56
+ /** e.g. startYear 2026 -> '2026-27'. */
57
+ export function financialYearLabel(startYear) {
58
+ return `${startYear}-${String((startYear + 1) % 100).padStart(2, '0')}`;
59
+ }
60
+ const MONTH_SHORT_NAMES = [
61
+ 'Jan',
62
+ 'Feb',
63
+ 'Mar',
64
+ 'Apr',
65
+ 'May',
66
+ 'Jun',
67
+ 'Jul',
68
+ 'Aug',
69
+ 'Sep',
70
+ 'Oct',
71
+ 'Nov',
72
+ 'Dec',
73
+ ];
74
+ /**
75
+ * The twelve months of a financial year in order, April first.
76
+ */
77
+ export function financialYearMonths(startYear) {
78
+ const months = [];
79
+ for (let index = 0; index < 12; index++) {
80
+ const absolute = 3 + index; // April is calendar month 3.
81
+ const year = startYear + Math.floor(absolute / 12);
82
+ const month = absolute % 12;
83
+ const startUTC = new Date(Date.UTC(year, month, 1) - IST_OFFSET_MS);
84
+ const endUTC = new Date(Date.UTC(year, month + 1, 1) - IST_OFFSET_MS - 1);
85
+ months.push({
86
+ index,
87
+ year,
88
+ month,
89
+ label: `${MONTH_SHORT_NAMES[month]} ${String(year % 100).padStart(2, '0')}`,
90
+ key: `${year}-${String(month + 1).padStart(2, '0')}`,
91
+ startUTC,
92
+ endUTC,
93
+ });
94
+ }
95
+ return months;
96
+ }
97
+ /**
98
+ * Which financial-year month `d` falls in, as a 0-based index (0 = April), or
99
+ * -1 when it falls outside the year entirely.
100
+ *
101
+ * Accepts either an instant (TimePeriod.startDate, a UTC timestamp) or a plain
102
+ * 'YYYY-MM-DD' calendar date (rvRefundDate, a Postgres `date`). A calendar date
103
+ * has no timezone at all, so it is read as the IST day it names — parsing it as
104
+ * a UTC instant and then adding the IST offset would move 1 April to 1 April
105
+ * 05:30 IST, which is still 1 April, but 31 March would move to 31 March 05:30
106
+ * and stay correct too. The branch exists so the intent is not accidental.
107
+ */
108
+ export function financialYearMonthIndex(d, startYear) {
109
+ if (d === null || d === undefined || d === '')
110
+ return -1;
111
+ let istYear;
112
+ let istMonth;
113
+ if (typeof d === 'string' && /^\d{4}-\d{2}(-\d{2})?$/.test(d)) {
114
+ istYear = Number(d.slice(0, 4));
115
+ istMonth = Number(d.slice(5, 7)) - 1;
116
+ }
117
+ else {
118
+ const parsed = new Date(d);
119
+ if (Number.isNaN(parsed.getTime()))
120
+ return -1;
121
+ const ist = addIstOffset(parsed);
122
+ istYear = ist.getUTCFullYear();
123
+ istMonth = ist.getUTCMonth();
124
+ }
125
+ const absolute = (istYear - startYear) * 12 + istMonth - 3;
126
+ return absolute >= 0 && absolute < 12 ? absolute : -1;
127
+ }
128
+ /**
129
+ * True when `d` lands strictly before 1 April 00:00 IST of the financial year —
130
+ * i.e. it belongs to the opening balance rather than to any month column.
131
+ */
132
+ export function isBeforeFinancialYear(d, startYear) {
133
+ if (d === null || d === undefined || d === '')
134
+ return false;
135
+ if (typeof d === 'string' && /^\d{4}-\d{2}(-\d{2})?$/.test(d)) {
136
+ const year = Number(d.slice(0, 4));
137
+ const month = Number(d.slice(5, 7)) - 1;
138
+ return year * 12 + month < startYear * 12 + 3;
139
+ }
140
+ const parsed = new Date(d);
141
+ if (Number.isNaN(parsed.getTime()))
142
+ return false;
143
+ return parsed.getTime() < financialYearStart(startYear).getTime();
144
+ }
145
+ //# sourceMappingURL=financial.year.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"financial.year.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/utilities/src/financial.year.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAEpD;;;;;;;;;;;;;;GAcG;AAEH,iEAAiE;AACjE,MAAM,UAAU,kBAAkB,CAAC,SAAiB;IACnD,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC;AAC5D,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,gBAAgB,CAAC,SAAiB;IACjD,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,CA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C,OAAO,IAAI,GAAG,EAAE,GAAG,KAAK,GAAG,SAAS,GAAG,EAAE,GAAG,CAAC,CAAC;IAC/C,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3B,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAAE,OAAO,KAAK,CAAC;IACjD,OAAO,MAAM,CAAC,OAAO,EAAE,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC;AACnE,CAAC"}
@@ -44,3 +44,5 @@ export * from './resolve.gst.state';
44
44
  export * from './ba.contract.lock';
45
45
  export * from './vehicle.insurance.validity';
46
46
  export * from './spot.placeholder.registration';
47
+ export * from './ba.payout.workshop.days';
48
+ export * from './financial.year';
@@ -44,4 +44,6 @@ export * from './resolve.gst.state';
44
44
  export * from './ba.contract.lock';
45
45
  export * from './vehicle.insurance.validity';
46
46
  export * from './spot.placeholder.registration';
47
+ export * from './ba.payout.workshop.days';
48
+ export * from './financial.year';
47
49
  //# sourceMappingURL=index.js.map
@@ -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;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,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;AAC7C,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC"}
@@ -27,3 +27,4 @@ export * from './process.vehicle.rates.upload.progress';
27
27
  export * from './process.ba.payout.upload.progress';
28
28
  export * from './concurrent.users';
29
29
  export * from './ext.rate.card';
30
+ export * from './vehicle.allocation.conflict';
@@ -27,4 +27,5 @@ export * from './process.vehicle.rates.upload.progress';
27
27
  export * from './process.ba.payout.upload.progress';
28
28
  export * from './concurrent.users';
29
29
  export * from './ext.rate.card';
30
+ export * from './vehicle.allocation.conflict';
30
31
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/view-models/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/view-models/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,+BAA+B,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { VehicleAllocationConflictReason } from '../../enums/src/index';
2
+ /** AD-3373 — one duty that clashes with the allocation being attempted. */
3
+ export interface IVehicleAllocationConflict {
4
+ requestId: string;
5
+ /** Booking number of the clashing duty, for the dispatcher to look up. */
6
+ bookingNumber: string | null;
7
+ /** Pickup of the clashing duty, as a UTC instant. Render it in IST. */
8
+ pickupTime: string | null;
9
+ /** Booking status of the clashing duty (Booked / Allotted / Dispatched). */
10
+ status: string | null;
11
+ /** Trip status, present when the clashing duty has a trip. */
12
+ tripStatus: string | null;
13
+ reason: VehicleAllocationConflictReason;
14
+ /** True when the clash is on the very booking the user is working from. */
15
+ isSameBooking: boolean;
16
+ }
17
+ /**
18
+ * AD-3373 — result of the allocation conflict check.
19
+ *
20
+ * `windowMinutes` is echoed back so the client can name the window in the
21
+ * warning without holding its own copy of the config, which would drift.
22
+ */
23
+ export interface IVehicleAllocationConflictResult {
24
+ windowMinutes: number;
25
+ /** Server clock at evaluation, UTC. The window is measured from here. */
26
+ evaluatedAt: string;
27
+ conflicts: IVehicleAllocationConflict[];
28
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=vehicle.allocation.conflict.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vehicle.allocation.conflict.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/view-models/src/vehicle.allocation.conflict.ts"],"names":[],"mappings":""}