@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const MATERIALIZED_REPORTS_1 = require("../../constants/MATERIALIZED_REPORTS");
|
|
4
|
+
const materialized_dinein_close_day_helpers_1 = require("../../helpers/materialized-reports/materialized-dinein-close-day-helpers");
|
|
5
|
+
const dinein_fixtures_1 = require("./dinein-fixtures");
|
|
6
|
+
/**
|
|
7
|
+
* Dinein close-day plan — day write, period re-fold, page replacement, stale
|
|
8
|
+
* deletion, watermark guard and the deterministic overflow row.
|
|
9
|
+
*/
|
|
10
|
+
const dayOf = (day, amountEarned) => (0, dinein_fixtures_1.dineinOrder)({
|
|
11
|
+
_id: 'order-' + day,
|
|
12
|
+
localDate: day,
|
|
13
|
+
amount_earned: amountEarned,
|
|
14
|
+
// A later source edit is what advances the watermark; two identical
|
|
15
|
+
// watermarks must skip the rewrite (see the guard test).
|
|
16
|
+
updatedAt: day + 'T13:35:00.000Z',
|
|
17
|
+
});
|
|
18
|
+
const reportFor = (result, scope, field) => result.reports.find((doc) => String(doc.scope_context) === scope && doc.scope_field === field);
|
|
19
|
+
describe('dinein close-day plan', () => {
|
|
20
|
+
it('writes the day document plus one row per touched period', () => {
|
|
21
|
+
const result = (0, dinein_fixtures_1.compileDay)({ orders: [dayOf(dinein_fixtures_1.DINEIN_DAY, 10000)] });
|
|
22
|
+
const plan = (0, materialized_dinein_close_day_helpers_1.buildTenantDineinCloseDayPlan)({
|
|
23
|
+
tenantId: dinein_fixtures_1.DINEIN_TENANT,
|
|
24
|
+
localDate: dinein_fixtures_1.DINEIN_DAY,
|
|
25
|
+
reports: result.reports,
|
|
26
|
+
entries: result.entries,
|
|
27
|
+
reason: 'NEW_DAY',
|
|
28
|
+
computedAt: new Date('2026-10-01T23:30:00.000Z'),
|
|
29
|
+
});
|
|
30
|
+
expect(plan).not.toBeNull();
|
|
31
|
+
const scopes = plan.writes.map((write) => String(write.report.scope_context)).sort();
|
|
32
|
+
expect(scopes).toEqual([...materialized_dinein_close_day_helpers_1.MATERIALIZED_DINEIN_PERIOD_SCOPES, MATERIALIZED_REPORTS_1.MATERIALIZED_REPORT_SCOPE_ENUM.LOCAL_DATE].sort());
|
|
33
|
+
// day + week + ISO week + month + quarter + semester + year
|
|
34
|
+
expect(plan.writes).toHaveLength(7);
|
|
35
|
+
expect(plan.entryWrites).toHaveLength(4);
|
|
36
|
+
expect(plan.writes.every((write) => write.iteration != null)).toBe(true);
|
|
37
|
+
expect(plan.writes.every((write) => write.report.iteration === 1)).toBe(true);
|
|
38
|
+
expect(plan.entryWrites.every((write) => write.iteration != null)).toBe(true);
|
|
39
|
+
});
|
|
40
|
+
it('re-folds a period from its whole day set (close -> read parity)', () => {
|
|
41
|
+
const dayOne = '2026-10-01';
|
|
42
|
+
const dayTwo = '2026-10-02';
|
|
43
|
+
const first = (0, dinein_fixtures_1.compileDay)({ localDate: dayOne, orders: [dayOf(dayOne, 10000)] });
|
|
44
|
+
const firstPlan = (0, materialized_dinein_close_day_helpers_1.buildTenantDineinCloseDayPlan)({
|
|
45
|
+
tenantId: dinein_fixtures_1.DINEIN_TENANT,
|
|
46
|
+
localDate: dayOne,
|
|
47
|
+
reports: first.reports,
|
|
48
|
+
entries: first.entries,
|
|
49
|
+
reason: 'NEW_DAY',
|
|
50
|
+
});
|
|
51
|
+
const storedReports = firstPlan.writes.map((write) => write.report);
|
|
52
|
+
const second = (0, dinein_fixtures_1.compileDay)({ localDate: dayTwo, orders: [dayOf(dayTwo, 25000)] });
|
|
53
|
+
const secondPlan = (0, materialized_dinein_close_day_helpers_1.buildTenantDineinCloseDayPlan)({
|
|
54
|
+
tenantId: dinein_fixtures_1.DINEIN_TENANT,
|
|
55
|
+
localDate: dayTwo,
|
|
56
|
+
reports: second.reports,
|
|
57
|
+
entries: second.entries,
|
|
58
|
+
existing: storedReports,
|
|
59
|
+
reason: 'NEW_DAY',
|
|
60
|
+
});
|
|
61
|
+
const month = secondPlan.writes.find((write) => write.report.scope_context === MATERIALIZED_REPORTS_1.MATERIALIZED_REPORT_SCOPE_ENUM.LOCAL_MONTH &&
|
|
62
|
+
write.report.scope_field === '2026-10');
|
|
63
|
+
const monthCounters = month.report.dinein_counters['COMPLETED:POS_DINE-IN'];
|
|
64
|
+
expect(monthCounters.orders).toBe(2);
|
|
65
|
+
expect(monthCounters.sales).toBe(35000);
|
|
66
|
+
// the day documents are the source of the fold
|
|
67
|
+
expect(monthCounters.by_hour['18'].sales).toBe(35000);
|
|
68
|
+
});
|
|
69
|
+
it('re-folds reservation counters at the period level', () => {
|
|
70
|
+
const dayOne = '2026-10-01';
|
|
71
|
+
const dayTwo = '2026-10-02';
|
|
72
|
+
const first = (0, dinein_fixtures_1.compileDay)({ localDate: dayOne, orders: [], reservations: [(0, dinein_fixtures_1.dineinReservation)()] });
|
|
73
|
+
const firstPlan = (0, materialized_dinein_close_day_helpers_1.buildTenantDineinCloseDayPlan)({
|
|
74
|
+
tenantId: dinein_fixtures_1.DINEIN_TENANT,
|
|
75
|
+
localDate: dayOne,
|
|
76
|
+
reports: first.reports,
|
|
77
|
+
entries: first.entries,
|
|
78
|
+
reason: 'NEW_DAY',
|
|
79
|
+
});
|
|
80
|
+
const second = (0, dinein_fixtures_1.compileDay)({
|
|
81
|
+
localDate: dayTwo,
|
|
82
|
+
orders: [],
|
|
83
|
+
reservations: [
|
|
84
|
+
(0, dinein_fixtures_1.dineinReservation)({
|
|
85
|
+
reservation_time: '2026-10-02T19:00:00.000Z',
|
|
86
|
+
source_local_date: dayTwo,
|
|
87
|
+
updatedAt: '2026-10-02T09:00:00.000Z',
|
|
88
|
+
}),
|
|
89
|
+
],
|
|
90
|
+
});
|
|
91
|
+
const plan = (0, materialized_dinein_close_day_helpers_1.buildTenantDineinCloseDayPlan)({
|
|
92
|
+
tenantId: dinein_fixtures_1.DINEIN_TENANT,
|
|
93
|
+
localDate: dayTwo,
|
|
94
|
+
reports: second.reports,
|
|
95
|
+
entries: second.entries,
|
|
96
|
+
existing: firstPlan.writes.map((write) => write.report),
|
|
97
|
+
reason: 'NEW_DAY',
|
|
98
|
+
});
|
|
99
|
+
const month = plan.writes.find((write) => write.report.scope_context === MATERIALIZED_REPORTS_1.MATERIALIZED_REPORT_SCOPE_ENUM.LOCAL_MONTH &&
|
|
100
|
+
write.report.scope_field === '2026-10');
|
|
101
|
+
expect(month.report.reservation_counters.reservations).toBe(2);
|
|
102
|
+
expect(month.report.reservation_counters.reservation_confirmed).toBe(2);
|
|
103
|
+
expect(month.report.dinein_counters).toEqual({});
|
|
104
|
+
});
|
|
105
|
+
it('deletes the day documents and pages an emptied day used to own', () => {
|
|
106
|
+
const result = (0, dinein_fixtures_1.compileDay)({ orders: [dayOf(dinein_fixtures_1.DINEIN_DAY, 10000)] });
|
|
107
|
+
const firstPlan = (0, materialized_dinein_close_day_helpers_1.buildTenantDineinCloseDayPlan)({
|
|
108
|
+
tenantId: dinein_fixtures_1.DINEIN_TENANT,
|
|
109
|
+
localDate: dinein_fixtures_1.DINEIN_DAY,
|
|
110
|
+
reports: result.reports,
|
|
111
|
+
entries: result.entries,
|
|
112
|
+
reason: 'NEW_DAY',
|
|
113
|
+
});
|
|
114
|
+
const storedReports = firstPlan.writes.map((write) => write.report);
|
|
115
|
+
const storedEntries = firstPlan.entryWrites.map((write) => write.report);
|
|
116
|
+
const emptied = (0, materialized_dinein_close_day_helpers_1.buildTenantDineinCloseDayPlan)({
|
|
117
|
+
tenantId: dinein_fixtures_1.DINEIN_TENANT,
|
|
118
|
+
localDate: dinein_fixtures_1.DINEIN_DAY,
|
|
119
|
+
reports: [],
|
|
120
|
+
entries: [],
|
|
121
|
+
existing: storedReports,
|
|
122
|
+
existingEntries: storedEntries,
|
|
123
|
+
reason: 'RECLOSE',
|
|
124
|
+
force: true,
|
|
125
|
+
});
|
|
126
|
+
// the day document is stale; the periods it was alone in are deleted too
|
|
127
|
+
expect(emptied.staleDocuments.some((doc) => String(doc.scope_context) === 'localDate')).toBe(true);
|
|
128
|
+
expect(emptied.staleEntryDocuments).toHaveLength(4);
|
|
129
|
+
expect(emptied.writes).toHaveLength(0);
|
|
130
|
+
});
|
|
131
|
+
it('skips an unchanged document unless the plan is forced', () => {
|
|
132
|
+
const result = (0, dinein_fixtures_1.compileDay)({ orders: [dayOf(dinein_fixtures_1.DINEIN_DAY, 10000)] });
|
|
133
|
+
const firstPlan = (0, materialized_dinein_close_day_helpers_1.buildTenantDineinCloseDayPlan)({
|
|
134
|
+
tenantId: dinein_fixtures_1.DINEIN_TENANT,
|
|
135
|
+
localDate: dinein_fixtures_1.DINEIN_DAY,
|
|
136
|
+
reports: result.reports,
|
|
137
|
+
entries: result.entries,
|
|
138
|
+
reason: 'NEW_DAY',
|
|
139
|
+
computedAt: new Date('2026-10-01T23:30:00.000Z'),
|
|
140
|
+
});
|
|
141
|
+
const storedReports = firstPlan.writes.map((write) => write.report);
|
|
142
|
+
const storedEntries = firstPlan.entryWrites.map((write) => write.report);
|
|
143
|
+
const unchanged = (0, materialized_dinein_close_day_helpers_1.buildTenantDineinCloseDayPlan)({
|
|
144
|
+
tenantId: dinein_fixtures_1.DINEIN_TENANT,
|
|
145
|
+
localDate: dinein_fixtures_1.DINEIN_DAY,
|
|
146
|
+
reports: result.reports,
|
|
147
|
+
entries: result.entries,
|
|
148
|
+
existing: storedReports,
|
|
149
|
+
existingEntries: storedEntries,
|
|
150
|
+
reason: 'RECLOSE',
|
|
151
|
+
computedAt: new Date('2026-10-01T23:45:00.000Z'),
|
|
152
|
+
});
|
|
153
|
+
// Same watermark: the day + period counters are skipped, not rewritten.
|
|
154
|
+
expect(unchanged.writes).toHaveLength(0);
|
|
155
|
+
expect(unchanged.skippedDocuments.length).toBeGreaterThan(0);
|
|
156
|
+
const forced = (0, materialized_dinein_close_day_helpers_1.buildTenantDineinCloseDayPlan)({
|
|
157
|
+
tenantId: dinein_fixtures_1.DINEIN_TENANT,
|
|
158
|
+
localDate: dinein_fixtures_1.DINEIN_DAY,
|
|
159
|
+
reports: result.reports,
|
|
160
|
+
entries: result.entries,
|
|
161
|
+
existing: storedReports,
|
|
162
|
+
existingEntries: storedEntries,
|
|
163
|
+
reason: 'RECLOSE',
|
|
164
|
+
force: true,
|
|
165
|
+
});
|
|
166
|
+
expect(forced.writes.length).toBe(7);
|
|
167
|
+
expect(forced.entryWrites).toHaveLength(4);
|
|
168
|
+
});
|
|
169
|
+
it('keeps the period documents out of the day scope and stamps the right scope fields', () => {
|
|
170
|
+
const result = (0, dinein_fixtures_1.compileDay)({ orders: [dayOf(dinein_fixtures_1.DINEIN_DAY, 10000)] });
|
|
171
|
+
const plan = (0, materialized_dinein_close_day_helpers_1.buildTenantDineinCloseDayPlan)({
|
|
172
|
+
tenantId: dinein_fixtures_1.DINEIN_TENANT,
|
|
173
|
+
localDate: dinein_fixtures_1.DINEIN_DAY,
|
|
174
|
+
reports: result.reports,
|
|
175
|
+
entries: result.entries,
|
|
176
|
+
reason: 'NEW_DAY',
|
|
177
|
+
});
|
|
178
|
+
for (const write of plan.writes) {
|
|
179
|
+
if (String(write.report.scope_context) === 'localDate') {
|
|
180
|
+
expect(write.report.day_index).toBe('THU');
|
|
181
|
+
expect(write.report.scope_field).toBe(dinein_fixtures_1.DINEIN_DAY);
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
expect(write.report.day_index).toBeNull();
|
|
185
|
+
}
|
|
186
|
+
expect(write.report.sale_type_key_filters).toEqual(['ORDER_STATUS', 'PLATFORM']);
|
|
187
|
+
}
|
|
188
|
+
expect(plan.writes.every((write) => write.report.schema_version === 1)).toBe(true);
|
|
189
|
+
});
|
|
190
|
+
it('re-bounds a folded period map with a deterministic overflow row', () => {
|
|
191
|
+
const orders = [];
|
|
192
|
+
for (let index = 0; index < 260; index += 1) {
|
|
193
|
+
orders.push((0, dinein_fixtures_1.dineinOrder)({
|
|
194
|
+
_id: 't-' + String(index).padStart(4, '0'),
|
|
195
|
+
localDate: dinein_fixtures_1.DINEIN_DAY,
|
|
196
|
+
dinein_details: {
|
|
197
|
+
table_id: 't-' + String(index).padStart(4, '0'),
|
|
198
|
+
table_name: 'T-' + String(index),
|
|
199
|
+
floor_id: 'floor-main',
|
|
200
|
+
start_time: '2026-10-01T13:00:00.000Z',
|
|
201
|
+
courses: null,
|
|
202
|
+
},
|
|
203
|
+
}));
|
|
204
|
+
}
|
|
205
|
+
const compiled = (0, dinein_fixtures_1.compileDay)({ orders });
|
|
206
|
+
const plan = (0, materialized_dinein_close_day_helpers_1.buildTenantDineinCloseDayPlan)({
|
|
207
|
+
tenantId: dinein_fixtures_1.DINEIN_TENANT,
|
|
208
|
+
localDate: dinein_fixtures_1.DINEIN_DAY,
|
|
209
|
+
reports: compiled.reports,
|
|
210
|
+
entries: compiled.entries,
|
|
211
|
+
reason: 'NEW_DAY',
|
|
212
|
+
});
|
|
213
|
+
const day = plan.writes.find((write) => String(write.report.scope_context) === 'localDate');
|
|
214
|
+
const counters = day.report.dinein_counters['COMPLETED:POS_DINE-IN'];
|
|
215
|
+
expect(Object.keys(counters.by_table).length).toBeLessThanOrEqual(201);
|
|
216
|
+
expect(counters.by_table.__OTHER__).toBeDefined();
|
|
217
|
+
expect(counters.orders).toBe(260);
|
|
218
|
+
// deterministic across two plan builds of the same input
|
|
219
|
+
const again = (0, materialized_dinein_close_day_helpers_1.buildTenantDineinCloseDayPlan)({
|
|
220
|
+
tenantId: dinein_fixtures_1.DINEIN_TENANT,
|
|
221
|
+
localDate: dinein_fixtures_1.DINEIN_DAY,
|
|
222
|
+
reports: compiled.reports,
|
|
223
|
+
entries: compiled.entries,
|
|
224
|
+
reason: 'NEW_DAY',
|
|
225
|
+
});
|
|
226
|
+
const againDay = again.writes.find((write) => String(write.report.scope_context) === 'localDate');
|
|
227
|
+
expect(JSON.stringify(againDay.report.dinein_counters)).toBe(JSON.stringify(day.report.dinein_counters));
|
|
228
|
+
});
|
|
229
|
+
it('merges the bounded snapshots across the period day documents', () => {
|
|
230
|
+
const reservations = [];
|
|
231
|
+
for (let index = 0; index < 8; index += 1) {
|
|
232
|
+
reservations.push((0, dinein_fixtures_1.dineinReservation)({
|
|
233
|
+
_id: 'day1-r-' + index,
|
|
234
|
+
reservation_time: new Date(`2026-10-01T${String(10 + index).padStart(2, '0')}:00:00.000Z`),
|
|
235
|
+
}));
|
|
236
|
+
}
|
|
237
|
+
const dayOne = (0, dinein_fixtures_1.compileDay)({
|
|
238
|
+
localDate: '2026-10-01',
|
|
239
|
+
orders: [
|
|
240
|
+
(0, dinein_fixtures_1.dineinOrder)({
|
|
241
|
+
_id: 'day1-edit',
|
|
242
|
+
localDate: '2026-10-01',
|
|
243
|
+
iterations: [
|
|
244
|
+
{ categories: [{ items: [{ _id: 'l', quantity: 1 }] }] },
|
|
245
|
+
{ categories: [{ items: [{ _id: 'l', quantity: 1 }] }] },
|
|
246
|
+
{ categories: [{ items: [{ _id: 'l', quantity: 1 }] }] },
|
|
247
|
+
],
|
|
248
|
+
categories: [{ items: [{ _id: 'l', quantity: 2 }] }],
|
|
249
|
+
}),
|
|
250
|
+
],
|
|
251
|
+
reservations,
|
|
252
|
+
});
|
|
253
|
+
const dayTwo = '2026-10-02';
|
|
254
|
+
const second = (0, dinein_fixtures_1.compileDay)({
|
|
255
|
+
localDate: dayTwo,
|
|
256
|
+
orders: [
|
|
257
|
+
(0, dinein_fixtures_1.dineinOrder)({
|
|
258
|
+
_id: 'day2-edit',
|
|
259
|
+
localDate: dayTwo,
|
|
260
|
+
updatedAt: dayTwo + 'T13:35:00.000Z',
|
|
261
|
+
iterations: [{ categories: [{ items: [{ _id: 'l', quantity: 1 }] }] }],
|
|
262
|
+
categories: [{ items: [{ _id: 'l', quantity: 3 }] }],
|
|
263
|
+
}),
|
|
264
|
+
],
|
|
265
|
+
reservations: [
|
|
266
|
+
(0, dinein_fixtures_1.dineinReservation)({
|
|
267
|
+
_id: 'day2-r',
|
|
268
|
+
reservation_time: new Date('2026-10-02T09:00:00.000Z'),
|
|
269
|
+
updatedAt: dayTwo + 'T08:00:00.000Z',
|
|
270
|
+
source_local_date: dayTwo,
|
|
271
|
+
}),
|
|
272
|
+
],
|
|
273
|
+
});
|
|
274
|
+
const firstPlan = (0, materialized_dinein_close_day_helpers_1.buildTenantDineinCloseDayPlan)({
|
|
275
|
+
tenantId: dinein_fixtures_1.DINEIN_TENANT,
|
|
276
|
+
localDate: '2026-10-01',
|
|
277
|
+
reports: dayOne.reports,
|
|
278
|
+
entries: dayOne.entries,
|
|
279
|
+
reason: 'NEW_DAY',
|
|
280
|
+
});
|
|
281
|
+
const plan = (0, materialized_dinein_close_day_helpers_1.buildTenantDineinCloseDayPlan)({
|
|
282
|
+
tenantId: dinein_fixtures_1.DINEIN_TENANT,
|
|
283
|
+
localDate: dayTwo,
|
|
284
|
+
reports: second.reports,
|
|
285
|
+
entries: second.entries,
|
|
286
|
+
existing: firstPlan.writes.map((write) => write.report),
|
|
287
|
+
reason: 'NEW_DAY',
|
|
288
|
+
});
|
|
289
|
+
const month = plan.writes.find((write) => write.report.scope_context === MATERIALIZED_REPORTS_1.MATERIALIZED_REPORT_SCOPE_ENUM.LOCAL_MONTH &&
|
|
290
|
+
write.report.scope_field === '2026-10');
|
|
291
|
+
// Bounded to the top 10 and deduped across both days.
|
|
292
|
+
expect(month.report.upcoming_reservations).toHaveLength(9);
|
|
293
|
+
expect(new Set(month.report.upcoming_reservations.map((row) => row.reservation_id)).size).toBe(9);
|
|
294
|
+
// Soonest first across the whole period.
|
|
295
|
+
expect(month.report.upcoming_reservations[0].reservation_time).toBe('2026-10-01T10:00:00.000Z');
|
|
296
|
+
// Ranked by edits across days: day 1 has 3 edits, day 2 has 1.
|
|
297
|
+
expect(month.report.top_edited_checks.map((row) => row.order_id)).toEqual(['day1-edit', 'day2-edit']);
|
|
298
|
+
expect(month.report.top_edited_checks[0].edits).toBe(3);
|
|
299
|
+
// Reservation hours fold additively into the period block.
|
|
300
|
+
expect(month.report.reservation_counters.reservations).toBe(9);
|
|
301
|
+
expect(month.report.reservation_counters.by_hour['10']).toEqual({
|
|
302
|
+
reservations: 1,
|
|
303
|
+
reservation_covers: 4,
|
|
304
|
+
});
|
|
305
|
+
});
|
|
306
|
+
it('exposes exactly the period day scope fields a fold needs', () => {
|
|
307
|
+
const days = (0, materialized_dinein_close_day_helpers_1.getMaterializedDineinReportPeriodDayScopeFields)(dinein_fixtures_1.DINEIN_DAY);
|
|
308
|
+
expect(days).not.toBeNull();
|
|
309
|
+
expect(days).toContain(dinein_fixtures_1.DINEIN_DAY);
|
|
310
|
+
expect(days.length).toBeGreaterThanOrEqual(365);
|
|
311
|
+
expect((0, materialized_dinein_close_day_helpers_1.getMaterializedDineinReportPeriodDayScopeFields)('2026-13-01')).toBeNull();
|
|
312
|
+
});
|
|
313
|
+
it('returns null for invalid input and for a legacy page without identity', () => {
|
|
314
|
+
expect((0, materialized_dinein_close_day_helpers_1.buildTenantDineinCloseDayPlan)(null)).toBeNull();
|
|
315
|
+
const result = (0, dinein_fixtures_1.compileDay)({ orders: [dayOf(dinein_fixtures_1.DINEIN_DAY, 10000)] });
|
|
316
|
+
expect((0, materialized_dinein_close_day_helpers_1.buildTenantDineinCloseDayPlan)({
|
|
317
|
+
tenantId: dinein_fixtures_1.DINEIN_TENANT,
|
|
318
|
+
reports: result.reports,
|
|
319
|
+
entries: [],
|
|
320
|
+
reason: 'NEW_DAY',
|
|
321
|
+
existingEntries: [{ ...result.entries[0], page: '' }],
|
|
322
|
+
})).toBeNull();
|
|
323
|
+
});
|
|
324
|
+
it('folds the reservation block additively without touching the keyed counters', () => {
|
|
325
|
+
const result = (0, dinein_fixtures_1.compileDay)({
|
|
326
|
+
orders: [dayOf(dinein_fixtures_1.DINEIN_DAY, 5000)],
|
|
327
|
+
reservations: [(0, dinein_fixtures_1.dineinReservation)()],
|
|
328
|
+
});
|
|
329
|
+
const plan = (0, materialized_dinein_close_day_helpers_1.buildTenantDineinCloseDayPlan)({
|
|
330
|
+
tenantId: dinein_fixtures_1.DINEIN_TENANT,
|
|
331
|
+
localDate: dinein_fixtures_1.DINEIN_DAY,
|
|
332
|
+
reports: result.reports,
|
|
333
|
+
entries: result.entries,
|
|
334
|
+
reason: 'NEW_DAY',
|
|
335
|
+
});
|
|
336
|
+
const quarter = plan.writes.find((write) => String(write.report.scope_context) === 'localQuarter');
|
|
337
|
+
expect(quarter.report.reservation_counters.reservations).toBe(1);
|
|
338
|
+
expect(quarter.report.dinein_counters['COMPLETED:POS_DINE-IN'].sales).toBe(5000);
|
|
339
|
+
});
|
|
340
|
+
it('does not fabricate a session for a check with no fingerprint at plan time', () => {
|
|
341
|
+
const result = (0, dinein_fixtures_1.compileDay)({ orders: [dayOf(dinein_fixtures_1.DINEIN_DAY, 5000)] });
|
|
342
|
+
const plan = (0, materialized_dinein_close_day_helpers_1.buildTenantDineinCloseDayPlan)({
|
|
343
|
+
tenantId: dinein_fixtures_1.DINEIN_TENANT,
|
|
344
|
+
localDate: dinein_fixtures_1.DINEIN_DAY,
|
|
345
|
+
reports: result.reports,
|
|
346
|
+
entries: result.entries,
|
|
347
|
+
reason: 'NEW_DAY',
|
|
348
|
+
});
|
|
349
|
+
const day = plan.writes.find((write) => String(write.report.scope_context) === 'localDate');
|
|
350
|
+
const counters = day.report.dinein_counters['COMPLETED:POS_DINE-IN'];
|
|
351
|
+
expect(counters.table_sessions).toBe(0);
|
|
352
|
+
expect(counters.covers).toBe(0);
|
|
353
|
+
expect(counters.occupancy_minutes_sum).toBe(0);
|
|
354
|
+
});
|
|
355
|
+
it('attributes a late fingerprint to the order day, not to the close day', () => {
|
|
356
|
+
const lateOrder = (0, dinein_fixtures_1.dineinOrder)({
|
|
357
|
+
_id: 'late',
|
|
358
|
+
createdAt: '2026-10-01T22:00:00.000Z',
|
|
359
|
+
dinein_details: {
|
|
360
|
+
table_id: 'table-t04',
|
|
361
|
+
table_name: 'T-04',
|
|
362
|
+
floor_id: 'floor-main',
|
|
363
|
+
start_time: '2026-10-01T22:00:00.000Z',
|
|
364
|
+
courses: null,
|
|
365
|
+
},
|
|
366
|
+
});
|
|
367
|
+
const result = (0, dinein_fixtures_1.compileDay)({
|
|
368
|
+
orders: [lateOrder],
|
|
369
|
+
// the table closed after midnight
|
|
370
|
+
fingerprints: [(0, dinein_fixtures_1.dineinFingerprint)('late', { createdAt: '2026-10-02T00:30:00.000Z' })],
|
|
371
|
+
});
|
|
372
|
+
const counters = result.reports[0].dinein_counters['COMPLETED:POS_DINE-IN'];
|
|
373
|
+
expect(counters.table_sessions).toBe(1);
|
|
374
|
+
expect(counters.occupancy_minutes_sum).toBe(150);
|
|
375
|
+
expect(result.reports[0].scope_field).toBe(dinein_fixtures_1.DINEIN_DAY);
|
|
376
|
+
});
|
|
377
|
+
it('reports a period document only when it still has a day or a reservation', () => {
|
|
378
|
+
const result = (0, dinein_fixtures_1.compileDay)({ orders: [dayOf(dinein_fixtures_1.DINEIN_DAY, 5000)] });
|
|
379
|
+
const firstPlan = (0, materialized_dinein_close_day_helpers_1.buildTenantDineinCloseDayPlan)({
|
|
380
|
+
tenantId: dinein_fixtures_1.DINEIN_TENANT,
|
|
381
|
+
localDate: dinein_fixtures_1.DINEIN_DAY,
|
|
382
|
+
reports: result.reports,
|
|
383
|
+
entries: result.entries,
|
|
384
|
+
reason: 'NEW_DAY',
|
|
385
|
+
});
|
|
386
|
+
// Only the day document + pages are fetched as "existing" here, so every
|
|
387
|
+
// period the day touches is (re)created from that single day.
|
|
388
|
+
const stored = firstPlan.writes.filter((write) => String(write.report.scope_context) === 'localDate');
|
|
389
|
+
const plan = (0, materialized_dinein_close_day_helpers_1.buildTenantDineinCloseDayPlan)({
|
|
390
|
+
tenantId: dinein_fixtures_1.DINEIN_TENANT,
|
|
391
|
+
localDate: dinein_fixtures_1.DINEIN_DAY,
|
|
392
|
+
reports: result.reports,
|
|
393
|
+
entries: result.entries,
|
|
394
|
+
existing: stored.map((write) => write.report),
|
|
395
|
+
reason: 'NEW_DAY',
|
|
396
|
+
force: true,
|
|
397
|
+
});
|
|
398
|
+
const year = plan.writes.find((write) => String(write.report.scope_context) === MATERIALIZED_REPORTS_1.MATERIALIZED_REPORT_SCOPE_ENUM.LOCAL_YEAR);
|
|
399
|
+
expect(year.report.scope_field).toBe('2026');
|
|
400
|
+
expect(year.report.dinein_counters['COMPLETED:POS_DINE-IN'].orders).toBe(1);
|
|
401
|
+
});
|
|
402
|
+
it('keeps a period document invisible to the schema gate with the declared key filters', () => {
|
|
403
|
+
const result = (0, dinein_fixtures_1.compileDay)({ orders: [dayOf(dinein_fixtures_1.DINEIN_DAY, 5000)] });
|
|
404
|
+
const plan = (0, materialized_dinein_close_day_helpers_1.buildTenantDineinCloseDayPlan)({
|
|
405
|
+
tenantId: dinein_fixtures_1.DINEIN_TENANT,
|
|
406
|
+
localDate: dinein_fixtures_1.DINEIN_DAY,
|
|
407
|
+
reports: result.reports,
|
|
408
|
+
entries: result.entries,
|
|
409
|
+
reason: 'NEW_DAY',
|
|
410
|
+
});
|
|
411
|
+
for (const write of plan.writes) {
|
|
412
|
+
expect(write.report.sale_type_key_filters).toEqual(['ORDER_STATUS', 'PLATFORM']);
|
|
413
|
+
expect(write.report.tenant_id).toBe(dinein_fixtures_1.DINEIN_TENANT);
|
|
414
|
+
expect(write.report.source_watermark).toBeInstanceOf(Date);
|
|
415
|
+
}
|
|
416
|
+
expect(reportFor(result, 'localDate', dinein_fixtures_1.DINEIN_DAY)).toBeDefined();
|
|
417
|
+
expect(plan.entryWrites.every((write) => write.report.dinein_entries != null)).toBe(true);
|
|
418
|
+
});
|
|
419
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const MATERIALIZED_REPORTS_1 = require("../../constants/MATERIALIZED_REPORTS");
|
|
4
|
+
const materialized_report_runs_1 = require("../../helpers/materialized-reports/materialized-report-runs");
|
|
5
|
+
const materialized_tenant_report_runs_1 = require("../../schemas/models/materialized_tenant_report_runs");
|
|
6
|
+
const report_contract_1 = require("../../helpers/reporting-contract/report-contract");
|
|
7
|
+
/**
|
|
8
|
+
* Report run ledger contract (Phase 1 of END_TENANT_DAY).
|
|
9
|
+
*
|
|
10
|
+
* The ledger is the OPERATIONAL record of one report execution and is separate
|
|
11
|
+
* from readiness: FAILED never appears in readiness.
|
|
12
|
+
*/
|
|
13
|
+
describe('materialized report run ledger contract', () => {
|
|
14
|
+
const identity = {
|
|
15
|
+
tenantId: 'tenant-a',
|
|
16
|
+
localDate: '2026-09-14',
|
|
17
|
+
reportKey: report_contract_1.REPORT_KEY_ENUM.OVERVIEW,
|
|
18
|
+
};
|
|
19
|
+
it('pins the operational collection + schema version', () => {
|
|
20
|
+
expect(MATERIALIZED_REPORTS_1.MATERIALIZED_TENANT_REPORT_RUNS_COLLECTION_NAME).toBe('materialized_tenant_report_runs');
|
|
21
|
+
expect(MATERIALIZED_REPORTS_1.MATERIALIZED_TENANT_REPORT_RUNS_SCHEMA_VERSION).toBe(1);
|
|
22
|
+
expect(MATERIALIZED_REPORTS_1.MATERIALIZED_TENANT_REPORT_RUN_MAX_ATTEMPTS).toBe(2);
|
|
23
|
+
});
|
|
24
|
+
it('has exactly the five operational statuses and no FAILED readiness leak', () => {
|
|
25
|
+
expect(Object.values(MATERIALIZED_REPORTS_1.MATERIALIZED_TENANT_REPORT_RUN_STATUS_ENUM).sort()).toEqual(['COMMITTED', 'FAILED', 'PENDING', 'RETRYING', 'RUNNING'].sort());
|
|
26
|
+
// Readiness never gains FAILED: it is the read gate, not the ledger.
|
|
27
|
+
expect(Object.values(MATERIALIZED_REPORTS_1.MATERIALIZED_REPORT_READINESS_STATUS_ENUM)).not.toContain('FAILED');
|
|
28
|
+
});
|
|
29
|
+
it('builds ONE stable identity key/filter per report', () => {
|
|
30
|
+
expect((0, materialized_report_runs_1.materializedReportRunKey)(identity)).toBe('tenant-a|2026-09-14|OVERVIEW|1');
|
|
31
|
+
expect((0, materialized_report_runs_1.buildMaterializedReportRunFilter)(identity)).toEqual({
|
|
32
|
+
tenant_id: 'tenant-a',
|
|
33
|
+
localDate: '2026-09-14',
|
|
34
|
+
report_key: 'OVERVIEW',
|
|
35
|
+
schema_version: 1,
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
it('allows retry only for FAILED or a MISSING run', () => {
|
|
39
|
+
expect((0, materialized_report_runs_1.canRetryMaterializedReportRun)(null)).toBe(true);
|
|
40
|
+
expect((0, materialized_report_runs_1.canRetryMaterializedReportRun)(undefined)).toBe(true);
|
|
41
|
+
expect((0, materialized_report_runs_1.canRetryMaterializedReportRun)('FAILED')).toBe(true);
|
|
42
|
+
for (const blocked of ['PENDING', 'RUNNING', 'RETRYING', 'COMMITTED']) {
|
|
43
|
+
expect((0, materialized_report_runs_1.canRetryMaterializedReportRun)(blocked)).toBe(false);
|
|
44
|
+
expect((0, materialized_report_runs_1.isMaterializedReportRunInFlight)(blocked)).toBe(blocked !== 'COMMITTED');
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
it('detects terminal states and only ages IN-FLIGHT runs as stale', () => {
|
|
48
|
+
expect((0, materialized_report_runs_1.isMaterializedReportRunTerminal)('COMMITTED')).toBe(true);
|
|
49
|
+
expect((0, materialized_report_runs_1.isMaterializedReportRunTerminal)('FAILED')).toBe(true);
|
|
50
|
+
for (const live of ['PENDING', 'RUNNING', 'RETRYING']) {
|
|
51
|
+
expect((0, materialized_report_runs_1.isMaterializedReportRunTerminal)(live)).toBe(false);
|
|
52
|
+
}
|
|
53
|
+
const now = new Date('2026-09-15T12:00:00.000Z');
|
|
54
|
+
const startedAt = new Date(now.getTime() - MATERIALIZED_REPORTS_1.MATERIALIZED_TENANT_REPORT_RUN_STALE_MS);
|
|
55
|
+
expect((0, materialized_report_runs_1.isMaterializedReportRunStale)({ run: { status: 'RUNNING', started_at: startedAt }, now })).toBe(true);
|
|
56
|
+
expect((0, materialized_report_runs_1.isMaterializedReportRunStale)({
|
|
57
|
+
run: { status: 'RUNNING', started_at: new Date(now.getTime() - 1000) },
|
|
58
|
+
now,
|
|
59
|
+
})).toBe(false);
|
|
60
|
+
// Terminal rows are never "stale": they are final.
|
|
61
|
+
expect((0, materialized_report_runs_1.isMaterializedReportRunStale)({ run: { status: 'COMMITTED', started_at: startedAt }, now })).toBe(false);
|
|
62
|
+
// A legacy row without started_at falls back to updatedAt.
|
|
63
|
+
expect((0, materialized_report_runs_1.isMaterializedReportRunStale)({
|
|
64
|
+
run: { status: 'RETRYING', updatedAt: startedAt },
|
|
65
|
+
now,
|
|
66
|
+
})).toBe(true);
|
|
67
|
+
});
|
|
68
|
+
it('proves readiness ownership by RUN id, never by status alone', () => {
|
|
69
|
+
// Same run -> the readiness row is proof.
|
|
70
|
+
expect((0, materialized_report_runs_1.isMaterializedReadinessOwnedByRun)({
|
|
71
|
+
readiness: { run_id: 'lease-B' },
|
|
72
|
+
run: { run_id: 'lease-B' },
|
|
73
|
+
})).toBe(true);
|
|
74
|
+
// An OLDER close's row proves nothing about the current run.
|
|
75
|
+
expect((0, materialized_report_runs_1.isMaterializedReadinessOwnedByRun)({
|
|
76
|
+
readiness: { run_id: 'lease-A' },
|
|
77
|
+
run: { run_id: 'lease-B' },
|
|
78
|
+
})).toBe(false);
|
|
79
|
+
expect((0, materialized_report_runs_1.isMaterializedReadinessOwnedByRun)({
|
|
80
|
+
readiness: null,
|
|
81
|
+
run: { run_id: 'lease-B' },
|
|
82
|
+
})).toBe(false);
|
|
83
|
+
// A run without an identity can never be proven by readiness.
|
|
84
|
+
expect((0, materialized_report_runs_1.isMaterializedReadinessOwnedByRun)({
|
|
85
|
+
readiness: { run_id: 'lease-B' },
|
|
86
|
+
run: { run_id: null },
|
|
87
|
+
})).toBe(false);
|
|
88
|
+
});
|
|
89
|
+
it('detects the UNKNOWN-COMMIT marker', () => {
|
|
90
|
+
expect((0, materialized_report_runs_1.isMaterializedReportRunCommitOutcomeUnknown)({
|
|
91
|
+
last_error: 'COMMIT_OUTCOME_UNKNOWN',
|
|
92
|
+
})).toBe(true);
|
|
93
|
+
expect((0, materialized_report_runs_1.isMaterializedReportRunCommitOutcomeUnknown)({
|
|
94
|
+
last_error: 'INTERRUPTED_RUN',
|
|
95
|
+
})).toBe(false);
|
|
96
|
+
expect((0, materialized_report_runs_1.isMaterializedReportRunCommitOutcomeUnknown)(null)).toBe(false);
|
|
97
|
+
});
|
|
98
|
+
it('declares (never applies) the unique per-report identity index', () => {
|
|
99
|
+
const unique = materialized_tenant_report_runs_1.MATERIALIZED_TENANT_REPORT_RUNS_INDEX_OPTIONS.filter((index) => index.unique === true);
|
|
100
|
+
expect(unique).toHaveLength(1);
|
|
101
|
+
expect(unique[0].key).toEqual({
|
|
102
|
+
tenant_id: 1,
|
|
103
|
+
localDate: 1,
|
|
104
|
+
report_key: 1,
|
|
105
|
+
schema_version: 1,
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
it('sanitizes durable errors: no PII, single line, bounded', () => {
|
|
109
|
+
const sanitized = (0, materialized_report_runs_1.sanitizeMaterializedReportRunError)(new Error('dialer failed for jane.doe@example.com phone +92 300 1234567\nsecond line ' + 'x'.repeat(2000)));
|
|
110
|
+
expect(sanitized).not.toContain('jane.doe@example.com');
|
|
111
|
+
expect(sanitized).not.toContain('1234567');
|
|
112
|
+
expect(sanitized).toContain('[redacted-email]');
|
|
113
|
+
expect(sanitized).not.toContain('\n');
|
|
114
|
+
expect(sanitized.length).toBeLessThanOrEqual(500);
|
|
115
|
+
});
|
|
116
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|