@managesome/eposmatic-toolkit 0.4.60 → 0.4.62
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/esm/constants/MATERIALIZED_REPORTS.js +254 -4
- package/esm/constants/TENANT_ENUMS.js +15 -0
- package/esm/constants/WORKER_ENDPOINTS.js +12 -0
- package/esm/helpers/materialized-reports/index.js +8 -0
- package/esm/helpers/materialized-reports/materialized-day-readiness.js +2 -2
- package/esm/helpers/materialized-reports/materialized-dinein-accumulator-helpers.js +557 -0
- package/esm/helpers/materialized-reports/materialized-dinein-classification-helpers.js +447 -0
- package/esm/helpers/materialized-reports/materialized-dinein-close-day-helpers.js +372 -0
- package/esm/helpers/materialized-reports/materialized-dinein-compile-helpers.js +500 -0
- package/esm/helpers/materialized-reports/materialized-dinein-entry-pages.js +218 -0
- package/esm/helpers/materialized-reports/materialized-dinein-key-helpers.js +87 -0
- package/esm/helpers/materialized-reports/materialized-index-bootstrap.js +7 -1
- package/esm/helpers/materialized-reports/materialized-report-drilldown-rows.js +8 -0
- package/esm/helpers/materialized-reports/materialized-report-runs.js +143 -0
- package/esm/helpers/materialized-reports/report-platform/definition.js +93 -1
- package/esm/helpers/materialized-reports/tenant-dinein-formatter.js +240 -0
- package/esm/helpers/reporting-contract/report-contract.js +3 -0
- package/esm/schemas/models/index.js +3 -0
- package/esm/schemas/models/materialized_tenant_dinein_entries.js +57 -0
- package/esm/schemas/models/materialized_tenant_dinein_reports.js +73 -0
- package/esm/schemas/models/materialized_tenant_report_runs.js +105 -0
- package/esm/schemas/models/tenant_active_jobs.js +19 -1
- package/esm/schemas/types/index.js +3 -0
- package/esm/schemas/types/materialized_report_drilldown_rows.js +1 -0
- package/esm/schemas/types/materialized_tenant_dinein_entries.js +1 -0
- package/esm/schemas/types/materialized_tenant_dinein_reports.js +6 -0
- package/esm/schemas/types/materialized_tenant_report_runs.js +1 -0
- package/lib/constants/MATERIALIZED_REPORTS.d.ts +229 -4
- package/lib/constants/MATERIALIZED_REPORTS.js +255 -5
- package/lib/constants/TENANT_ENUMS.d.ts +14 -0
- package/lib/constants/TENANT_ENUMS.js +16 -1
- package/lib/constants/WORKER_ENDPOINTS.d.ts +12 -0
- package/lib/constants/WORKER_ENDPOINTS.js +12 -0
- package/lib/helpers/materialized-reports/index.d.ts +8 -0
- package/lib/helpers/materialized-reports/index.js +8 -0
- package/lib/helpers/materialized-reports/materialized-day-readiness.d.ts +1 -1
- package/lib/helpers/materialized-reports/materialized-day-readiness.js +2 -2
- package/lib/helpers/materialized-reports/materialized-dinein-accumulator-helpers.d.ts +67 -0
- package/lib/helpers/materialized-reports/materialized-dinein-accumulator-helpers.js +582 -0
- package/lib/helpers/materialized-reports/materialized-dinein-classification-helpers.d.ts +245 -0
- package/lib/helpers/materialized-reports/materialized-dinein-classification-helpers.js +469 -0
- package/lib/helpers/materialized-reports/materialized-dinein-close-day-helpers.d.ts +110 -0
- package/lib/helpers/materialized-reports/materialized-dinein-close-day-helpers.js +384 -0
- package/lib/helpers/materialized-reports/materialized-dinein-compile-helpers.d.ts +73 -0
- package/lib/helpers/materialized-reports/materialized-dinein-compile-helpers.js +504 -0
- package/lib/helpers/materialized-reports/materialized-dinein-entry-pages.d.ts +69 -0
- package/lib/helpers/materialized-reports/materialized-dinein-entry-pages.js +231 -0
- package/lib/helpers/materialized-reports/materialized-dinein-key-helpers.d.ts +44 -0
- package/lib/helpers/materialized-reports/materialized-dinein-key-helpers.js +96 -0
- package/lib/helpers/materialized-reports/materialized-index-bootstrap.js +6 -0
- package/lib/helpers/materialized-reports/materialized-report-drilldown-rows.js +8 -0
- package/lib/helpers/materialized-reports/materialized-report-runs.d.ts +105 -0
- package/lib/helpers/materialized-reports/materialized-report-runs.js +156 -0
- package/lib/helpers/materialized-reports/report-platform/definition.js +92 -0
- package/lib/helpers/materialized-reports/tenant-dinein-formatter.d.ts +225 -0
- package/lib/helpers/materialized-reports/tenant-dinein-formatter.js +243 -0
- package/lib/helpers/reporting-contract/report-contract.d.ts +1 -0
- package/lib/helpers/reporting-contract/report-contract.js +3 -0
- package/lib/helpers/types/workers.d.ts +65 -0
- package/lib/schemas/models/index.d.ts +3 -0
- package/lib/schemas/models/index.js +3 -0
- package/lib/schemas/models/materialized_tenant_day_readiness.d.ts +3 -3
- package/lib/schemas/models/materialized_tenant_dinein_entries.d.ts +100 -0
- package/lib/schemas/models/materialized_tenant_dinein_entries.js +60 -0
- package/lib/schemas/models/materialized_tenant_dinein_reports.d.ts +111 -0
- package/lib/schemas/models/materialized_tenant_dinein_reports.js +76 -0
- package/lib/schemas/models/materialized_tenant_report_runs.d.ts +97 -0
- package/lib/schemas/models/materialized_tenant_report_runs.js +108 -0
- package/lib/schemas/models/tenant_active_jobs.d.ts +12 -3
- package/lib/schemas/models/tenant_active_jobs.js +18 -0
- package/lib/schemas/types/index.d.ts +3 -0
- package/lib/schemas/types/index.js +3 -0
- package/lib/schemas/types/materialized_report_drilldown_rows.d.ts +1 -1
- package/lib/schemas/types/materialized_report_drilldown_rows.js +1 -0
- package/lib/schemas/types/materialized_tenant_dinein_entries.d.ts +127 -0
- package/lib/schemas/types/materialized_tenant_dinein_entries.js +2 -0
- package/lib/schemas/types/materialized_tenant_dinein_reports.d.ts +326 -0
- package/lib/schemas/types/materialized_tenant_dinein_reports.js +9 -0
- package/lib/schemas/types/materialized_tenant_report_runs.d.ts +55 -0
- package/lib/schemas/types/materialized_tenant_report_runs.js +2 -0
- package/lib/schemas/types/tenant_active_jobs.d.ts +15 -1
- package/lib/tests/materialized-reports/dinein-fixtures.d.ts +29 -0
- package/lib/tests/materialized-reports/dinein-fixtures.js +130 -0
- package/lib/tests/materialized-reports/materialized-day-readiness.test.js +3 -2
- package/lib/tests/materialized-reports/materialized-dinein-compile.test.d.ts +1 -0
- package/lib/tests/materialized-reports/materialized-dinein-compile.test.js +807 -0
- package/lib/tests/materialized-reports/materialized-dinein-plan.test.d.ts +1 -0
- package/lib/tests/materialized-reports/materialized-dinein-plan.test.js +419 -0
- package/lib/tests/materialized-reports/materialized-report-runs.test.d.ts +1 -0
- package/lib/tests/materialized-reports/materialized-report-runs.test.js +116 -0
- package/lib/tests/materialized-reports/materialized-tenant-dinein-schema.test.d.ts +1 -0
- package/lib/tests/materialized-reports/materialized-tenant-dinein-schema.test.js +185 -0
- package/lib/tests/materialized-reports/report-platform/registry-conformance.test.js +15 -2
- package/lib/tests/materialized-reports/tenant-dinein-formatter.test.d.ts +1 -0
- package/lib/tests/materialized-reports/tenant-dinein-formatter.test.js +458 -0
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './key-helpers';
|
|
2
2
|
export * from './materialized-credit-bills-helpers';
|
|
3
3
|
export * from './materialized-day-readiness';
|
|
4
|
+
export * from './materialized-report-runs';
|
|
4
5
|
export * from './materialized-index-bootstrap';
|
|
5
6
|
export * from './materialized-integer-contract';
|
|
6
7
|
export * from './materialized-discount-accumulator-helpers';
|
|
@@ -31,6 +32,12 @@ export * from './materialized-dialer-compile-helpers';
|
|
|
31
32
|
export * from './materialized-dialer-entry-pages';
|
|
32
33
|
export * from './materialized-dialer-key-helpers';
|
|
33
34
|
export * from './materialized-dialer-masking';
|
|
35
|
+
export * from './materialized-dinein-accumulator-helpers';
|
|
36
|
+
export * from './materialized-dinein-classification-helpers';
|
|
37
|
+
export * from './materialized-dinein-close-day-helpers';
|
|
38
|
+
export * from './materialized-dinein-compile-helpers';
|
|
39
|
+
export * from './materialized-dinein-entry-pages';
|
|
40
|
+
export * from './materialized-dinein-key-helpers';
|
|
34
41
|
export * from './materialized-day-input-signature';
|
|
35
42
|
export * from './materialized-cash-classification-helpers';
|
|
36
43
|
export * from './materialized-cash-close-day-helpers';
|
|
@@ -58,6 +65,7 @@ export * from './tenant-discount-source-formatter';
|
|
|
58
65
|
export * from './tenant-cash-in-out-formatter';
|
|
59
66
|
export * from './tenant-delivery-formatter';
|
|
60
67
|
export * from './tenant-dialer-formatter';
|
|
68
|
+
export * from './tenant-dinein-formatter';
|
|
61
69
|
export * from './tenant-prep-time-formatter';
|
|
62
70
|
export * from './tenant-sales-overview-formatter';
|
|
63
71
|
export * from './tenant-sales-overview-helpers';
|
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./key-helpers"), exports);
|
|
18
18
|
__exportStar(require("./materialized-credit-bills-helpers"), exports);
|
|
19
19
|
__exportStar(require("./materialized-day-readiness"), exports);
|
|
20
|
+
__exportStar(require("./materialized-report-runs"), exports);
|
|
20
21
|
__exportStar(require("./materialized-index-bootstrap"), exports);
|
|
21
22
|
__exportStar(require("./materialized-integer-contract"), exports);
|
|
22
23
|
__exportStar(require("./materialized-discount-accumulator-helpers"), exports);
|
|
@@ -47,6 +48,12 @@ __exportStar(require("./materialized-dialer-compile-helpers"), exports);
|
|
|
47
48
|
__exportStar(require("./materialized-dialer-entry-pages"), exports);
|
|
48
49
|
__exportStar(require("./materialized-dialer-key-helpers"), exports);
|
|
49
50
|
__exportStar(require("./materialized-dialer-masking"), exports);
|
|
51
|
+
__exportStar(require("./materialized-dinein-accumulator-helpers"), exports);
|
|
52
|
+
__exportStar(require("./materialized-dinein-classification-helpers"), exports);
|
|
53
|
+
__exportStar(require("./materialized-dinein-close-day-helpers"), exports);
|
|
54
|
+
__exportStar(require("./materialized-dinein-compile-helpers"), exports);
|
|
55
|
+
__exportStar(require("./materialized-dinein-entry-pages"), exports);
|
|
56
|
+
__exportStar(require("./materialized-dinein-key-helpers"), exports);
|
|
50
57
|
__exportStar(require("./materialized-day-input-signature"), exports);
|
|
51
58
|
__exportStar(require("./materialized-cash-classification-helpers"), exports);
|
|
52
59
|
__exportStar(require("./materialized-cash-close-day-helpers"), exports);
|
|
@@ -74,6 +81,7 @@ __exportStar(require("./tenant-discount-source-formatter"), exports);
|
|
|
74
81
|
__exportStar(require("./tenant-cash-in-out-formatter"), exports);
|
|
75
82
|
__exportStar(require("./tenant-delivery-formatter"), exports);
|
|
76
83
|
__exportStar(require("./tenant-dialer-formatter"), exports);
|
|
84
|
+
__exportStar(require("./tenant-dinein-formatter"), exports);
|
|
77
85
|
__exportStar(require("./tenant-prep-time-formatter"), exports);
|
|
78
86
|
__exportStar(require("./tenant-sales-overview-formatter"), exports);
|
|
79
87
|
__exportStar(require("./tenant-sales-overview-helpers"), exports);
|
|
@@ -33,7 +33,7 @@ export interface IMaterializedDayReadinessGaps {
|
|
|
33
33
|
/** Exact pairs awaiting reconciliation (for logs / diagnostics). */
|
|
34
34
|
needs_reconciliation_pairs: IMaterializedDayReadinessPair[];
|
|
35
35
|
}
|
|
36
|
-
/** Whether `report` is one of the
|
|
36
|
+
/** Whether `report` is one of the SIX reports that own readiness rows. */
|
|
37
37
|
export declare function isMaterializedReadinessReportKey(report: string): boolean;
|
|
38
38
|
/**
|
|
39
39
|
* The readiness doc identity key. Kept as a string so the same helper can index
|
|
@@ -6,7 +6,7 @@ exports.summarizeMaterializedDayReadiness = summarizeMaterializedDayReadiness;
|
|
|
6
6
|
exports.buildMaterializedDayReadinessDocument = buildMaterializedDayReadinessDocument;
|
|
7
7
|
const MATERIALIZED_REPORTS_1 = require("../../constants/MATERIALIZED_REPORTS");
|
|
8
8
|
const uniqueSorted = (values) => [...new Set(values)].sort();
|
|
9
|
-
/** Whether `report` is one of the
|
|
9
|
+
/** Whether `report` is one of the SIX reports that own readiness rows. */
|
|
10
10
|
function isMaterializedReadinessReportKey(report) {
|
|
11
11
|
return MATERIALIZED_REPORTS_1.MATERIALIZED_READINESS_REPORT_KEYS.includes(report);
|
|
12
12
|
}
|
|
@@ -86,7 +86,7 @@ function buildMaterializedDayReadinessDocument(input) {
|
|
|
86
86
|
if (!isMaterializedReadinessReportKey(String(input.reportKey))) {
|
|
87
87
|
throw new Error('buildMaterializedDayReadinessDocument: report ' +
|
|
88
88
|
String(input.reportKey) +
|
|
89
|
-
' is outside the
|
|
89
|
+
' is outside the six report readiness contract');
|
|
90
90
|
}
|
|
91
91
|
return {
|
|
92
92
|
tenant_id: String(input.tenantId),
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { IMaterializedDineinBreakdownRow, IMaterializedDineinCounters, IMaterializedDineinCourseRow, IMaterializedDineinFloorRow, IMaterializedDineinHourRow, IMaterializedDineinOriginRow, IMaterializedDineinPaymentRow, IMaterializedDineinReservationCounters, IMaterializedDineinReservationHourRow, IMaterializedDineinTableRow, IMaterializedDineinTopEditedCheck, IMaterializedDineinUpcomingReservation } from '../../schemas/types/materialized_tenant_dinein_reports';
|
|
2
|
+
/** A zeroed hour row. */
|
|
3
|
+
export declare function emptyMaterializedDineinHourRow(): IMaterializedDineinHourRow;
|
|
4
|
+
/** Merges one hour row into another. */
|
|
5
|
+
export declare function mergeMaterializedDineinHourRow(target: IMaterializedDineinHourRow, source: IMaterializedDineinHourRow): void;
|
|
6
|
+
/** A zeroed table row. */
|
|
7
|
+
export declare function emptyMaterializedDineinTableRow(tableId?: string, tableName?: string, floorId?: string): IMaterializedDineinTableRow;
|
|
8
|
+
/** A zeroed floor row. */
|
|
9
|
+
export declare function emptyMaterializedDineinFloorRow(floorId?: string): IMaterializedDineinFloorRow;
|
|
10
|
+
/** A zeroed course row. */
|
|
11
|
+
export declare function emptyMaterializedDineinCourseRow(courseId: string, name: string): IMaterializedDineinCourseRow;
|
|
12
|
+
/** A zeroed origin row. */
|
|
13
|
+
export declare function emptyMaterializedDineinOriginRow(): IMaterializedDineinOriginRow;
|
|
14
|
+
/** A zeroed `by_status` / `by_platform` row. */
|
|
15
|
+
export declare function emptyMaterializedDineinBreakdownRow(): IMaterializedDineinBreakdownRow;
|
|
16
|
+
/** Merges one rich breakdown row into another. */
|
|
17
|
+
export declare function mergeMaterializedDineinBreakdownRow(target: IMaterializedDineinBreakdownRow, source: IMaterializedDineinBreakdownRow): void;
|
|
18
|
+
/** A zeroed reservation-hour row. */
|
|
19
|
+
export declare function emptyMaterializedDineinReservationHourRow(): IMaterializedDineinReservationHourRow;
|
|
20
|
+
/** Merges one reservation-hour row into another. */
|
|
21
|
+
export declare function mergeMaterializedDineinReservationHourRow(target: IMaterializedDineinReservationHourRow, source: IMaterializedDineinReservationHourRow): void;
|
|
22
|
+
/** A zeroed payment-type row. */
|
|
23
|
+
export declare function emptyMaterializedDineinPaymentRow(): IMaterializedDineinPaymentRow;
|
|
24
|
+
/** A zeroed reservation block. */
|
|
25
|
+
export declare function freshMaterializedDineinReservationCounters(): IMaterializedDineinReservationCounters;
|
|
26
|
+
/** A zeroed counter block, with every bounded map present. */
|
|
27
|
+
export declare function freshMaterializedDineinCounters(): IMaterializedDineinCounters;
|
|
28
|
+
/** Merges one table row into another (all counters additive). */
|
|
29
|
+
export declare function mergeMaterializedDineinTableRow(target: IMaterializedDineinTableRow, source: IMaterializedDineinTableRow): void;
|
|
30
|
+
/** Merges one floor row into another. */
|
|
31
|
+
export declare function mergeMaterializedDineinFloorRow(target: IMaterializedDineinFloorRow, source: IMaterializedDineinFloorRow): void;
|
|
32
|
+
/** Merges one course row into another. */
|
|
33
|
+
export declare function mergeMaterializedDineinCourseRow(target: IMaterializedDineinCourseRow, source: IMaterializedDineinCourseRow): void;
|
|
34
|
+
/** Merges one origin row into another. */
|
|
35
|
+
export declare function mergeMaterializedDineinOriginRow(target: IMaterializedDineinOriginRow, source: IMaterializedDineinOriginRow): void;
|
|
36
|
+
/** Merges one payment-type row into another. */
|
|
37
|
+
export declare function mergeMaterializedDineinPaymentRow(target: IMaterializedDineinPaymentRow, source: IMaterializedDineinPaymentRow): void;
|
|
38
|
+
/**
|
|
39
|
+
* Merges `source` into `target`, IN PLACE. Null-safe: a missing sub-map is
|
|
40
|
+
* treated as empty rather than throwing, so one malformed historical document
|
|
41
|
+
* cannot break a whole period fold.
|
|
42
|
+
*/
|
|
43
|
+
export declare function mergeMaterializedDineinCounters(target: IMaterializedDineinCounters, source: IMaterializedDineinCounters): IMaterializedDineinCounters;
|
|
44
|
+
/** Merges one reservation block into another (all counters additive). */
|
|
45
|
+
export declare function mergeMaterializedDineinReservationCounters(target: IMaterializedDineinReservationCounters, source: IMaterializedDineinReservationCounters): IMaterializedDineinReservationCounters;
|
|
46
|
+
/** Applies every document-level bound to one counter map (in place). */
|
|
47
|
+
export declare function pruneDocumentDineinMaps(countersByKey: Record<string, IMaterializedDineinCounters> | Map<string, IMaterializedDineinCounters>, limits?: {
|
|
48
|
+
tables?: number;
|
|
49
|
+
floors?: number;
|
|
50
|
+
courses?: number;
|
|
51
|
+
serviceChargeRates?: number;
|
|
52
|
+
}): void;
|
|
53
|
+
/**
|
|
54
|
+
* Merges the UPCOMING RESERVATION snapshots of several day documents.
|
|
55
|
+
*
|
|
56
|
+
* Dedupe by `reservation_id` (the same booking can be re-closed), then keep the
|
|
57
|
+
* SOONEST `limit` rows. Ordering is `reservation_time ASC, reservation_id ASC`
|
|
58
|
+
* so two folds of the same days produce the same array.
|
|
59
|
+
*/
|
|
60
|
+
export declare function mergeMaterializedDineinUpcomingReservations(lists: readonly (readonly IMaterializedDineinUpcomingReservation[] | null | undefined)[], limit?: number): IMaterializedDineinUpcomingReservation[];
|
|
61
|
+
/**
|
|
62
|
+
* Merges the MOST-EDITED-CHECK snapshots of several day documents.
|
|
63
|
+
*
|
|
64
|
+
* Dedupe by `order_id`, rank `edits DESC, item_additions DESC, order_id ASC`
|
|
65
|
+
* and keep `limit` rows. Deterministic, so a period re-fold is stable.
|
|
66
|
+
*/
|
|
67
|
+
export declare function mergeMaterializedDineinTopEditedChecks(lists: readonly (readonly IMaterializedDineinTopEditedCheck[] | null | undefined)[], limit?: number): IMaterializedDineinTopEditedCheck[];
|