@managesome/eposmatic-toolkit 0.4.53 → 0.4.55
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/helpers/materialized-reports/index.js +1 -0
- package/esm/helpers/materialized-reports/materialized-delivery-wipe-targets.js +18 -0
- package/esm/helpers/materialized-reports/report-platform/definition.js +508 -0
- package/esm/helpers/materialized-reports/report-platform/index.js +4 -0
- package/esm/helpers/materialized-reports/report-platform/lifecycle/budget.js +27 -0
- package/esm/helpers/materialized-reports/report-platform/lifecycle/cap-metadata.js +12 -0
- package/esm/helpers/materialized-reports/report-platform/lifecycle/entry-pages.js +121 -0
- package/esm/helpers/materialized-reports/report-platform/lifecycle/flat-projection.js +14 -0
- package/esm/helpers/materialized-reports/report-platform/lifecycle/index.js +8 -0
- package/esm/helpers/materialized-reports/report-platform/lifecycle/iteration-row.js +10 -0
- package/esm/helpers/materialized-reports/report-platform/lifecycle/run-stats.js +42 -0
- package/esm/helpers/materialized-reports/report-platform/lifecycle/scope-refs.js +28 -0
- package/esm/helpers/materialized-reports/report-platform/lifecycle/top-n.js +24 -0
- package/esm/helpers/materialized-reports/report-platform/registry.js +23 -0
- package/esm/helpers/materialized-reports/report-platform/validate-report-registry.js +214 -0
- package/esm/schemas/models/index.js +1 -0
- package/esm/schemas/models/tenant_dialer_events.js +133 -0
- package/esm/schemas/types/index.js +1 -0
- package/esm/schemas/types/tenant_dialer_events.js +1 -0
- package/lib/helpers/materialized-reports/index.d.ts +1 -0
- package/lib/helpers/materialized-reports/index.js +1 -0
- package/lib/helpers/materialized-reports/materialized-delivery-wipe-targets.d.ts +1 -0
- package/lib/helpers/materialized-reports/materialized-delivery-wipe-targets.js +19 -0
- package/lib/helpers/materialized-reports/report-platform/definition.d.ts +133 -0
- package/lib/helpers/materialized-reports/report-platform/definition.js +511 -0
- package/lib/helpers/materialized-reports/report-platform/index.d.ts +4 -0
- package/lib/helpers/materialized-reports/report-platform/index.js +20 -0
- package/lib/helpers/materialized-reports/report-platform/lifecycle/budget.d.ts +8 -0
- package/lib/helpers/materialized-reports/report-platform/lifecycle/budget.js +31 -0
- package/lib/helpers/materialized-reports/report-platform/lifecycle/cap-metadata.d.ts +8 -0
- package/lib/helpers/materialized-reports/report-platform/lifecycle/cap-metadata.js +16 -0
- package/lib/helpers/materialized-reports/report-platform/lifecycle/entry-pages.d.ts +40 -0
- package/lib/helpers/materialized-reports/report-platform/lifecycle/entry-pages.js +130 -0
- package/lib/helpers/materialized-reports/report-platform/lifecycle/flat-projection.d.ts +22 -0
- package/lib/helpers/materialized-reports/report-platform/lifecycle/flat-projection.js +17 -0
- package/lib/helpers/materialized-reports/report-platform/lifecycle/index.d.ts +8 -0
- package/lib/helpers/materialized-reports/report-platform/lifecycle/index.js +24 -0
- package/lib/helpers/materialized-reports/report-platform/lifecycle/iteration-row.d.ts +13 -0
- package/lib/helpers/materialized-reports/report-platform/lifecycle/iteration-row.js +13 -0
- package/lib/helpers/materialized-reports/report-platform/lifecycle/run-stats.d.ts +20 -0
- package/lib/helpers/materialized-reports/report-platform/lifecycle/run-stats.js +47 -0
- package/lib/helpers/materialized-reports/report-platform/lifecycle/scope-refs.d.ts +13 -0
- package/lib/helpers/materialized-reports/report-platform/lifecycle/scope-refs.js +31 -0
- package/lib/helpers/materialized-reports/report-platform/lifecycle/top-n.d.ts +16 -0
- package/lib/helpers/materialized-reports/report-platform/lifecycle/top-n.js +29 -0
- package/lib/helpers/materialized-reports/report-platform/registry.d.ts +13 -0
- package/lib/helpers/materialized-reports/report-platform/registry.js +31 -0
- package/lib/helpers/materialized-reports/report-platform/validate-report-registry.d.ts +20 -0
- package/lib/helpers/materialized-reports/report-platform/validate-report-registry.js +218 -0
- package/lib/schemas/models/index.d.ts +1 -0
- package/lib/schemas/models/index.js +1 -0
- package/lib/schemas/models/tenant-activity-logs.d.ts +3 -3
- package/lib/schemas/models/tenant_dialer_events.d.ts +130 -0
- package/lib/schemas/models/tenant_dialer_events.js +136 -0
- package/lib/schemas/models/warehouse-activity-logs.d.ts +3 -3
- package/lib/schemas/types/index.d.ts +1 -0
- package/lib/schemas/types/index.js +1 -0
- package/lib/schemas/types/tenant_dialer_events.d.ts +35 -0
- package/lib/schemas/types/tenant_dialer_events.js +2 -0
- package/lib/tests/materialized-reports/characterization/delivery.characterization.test.d.ts +1 -0
- package/lib/tests/materialized-reports/characterization/delivery.characterization.test.js +229 -0
- package/lib/tests/materialized-reports/characterization/discount.characterization.test.d.ts +1 -0
- package/lib/tests/materialized-reports/characterization/discount.characterization.test.js +99 -0
- package/lib/tests/materialized-reports/characterization/fixtures.d.ts +30 -0
- package/lib/tests/materialized-reports/characterization/fixtures.js +402 -0
- package/lib/tests/materialized-reports/characterization/golden.d.ts +18 -0
- package/lib/tests/materialized-reports/characterization/golden.js +127 -0
- package/lib/tests/materialized-reports/characterization/overview.characterization.test.d.ts +1 -0
- package/lib/tests/materialized-reports/characterization/overview.characterization.test.js +69 -0
- package/lib/tests/materialized-reports/characterization/prep-time.characterization.test.d.ts +1 -0
- package/lib/tests/materialized-reports/characterization/prep-time.characterization.test.js +102 -0
- package/lib/tests/materialized-reports/materialized-wipe-tooling.test.d.ts +1 -0
- package/lib/tests/materialized-reports/materialized-wipe-tooling.test.js +37 -0
- package/lib/tests/materialized-reports/report-platform/lifecycle-primitives.test.d.ts +1 -0
- package/lib/tests/materialized-reports/report-platform/lifecycle-primitives.test.js +177 -0
- package/lib/tests/materialized-reports/report-platform/registry-conformance.test.d.ts +1 -0
- package/lib/tests/materialized-reports/report-platform/registry-conformance.test.js +214 -0
- package/lib/tests/materialized-reports/report-platform/registry-validation.test.d.ts +1 -0
- package/lib/tests/materialized-reports/report-platform/registry-validation.test.js +103 -0
- package/lib/tests/tenant-dialer-events-schema.test.d.ts +1 -0
- package/lib/tests/tenant-dialer-events-schema.test.js +191 -0
- package/package.json +4 -2
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { MATERIALIZED_REPORT_SCOPE_ENUM } from '../../../../constants/MATERIALIZED_REPORTS';
|
|
2
|
+
import { materializedDocumentBsonBytes } from '../../materialized-document-size';
|
|
3
|
+
import { REPORT_ENTRY_STORAGE } from '../definition';
|
|
4
|
+
/**
|
|
5
|
+
* PHASE 2 — generic entry page identity + deterministic #N splitter.
|
|
6
|
+
*
|
|
7
|
+
* The splitter is a generic transcription of the CURRENT Delivery splitter. It
|
|
8
|
+
* is not wired into any writer; the equivalence test runs both implementations
|
|
9
|
+
* over the same compiled Delivery page and requires byte-identical output.
|
|
10
|
+
*/
|
|
11
|
+
export const ENTRY_PAGE_ALL = 'all';
|
|
12
|
+
const SUB_PAGE_PATTERN = /^(.*)#(\d+)$/;
|
|
13
|
+
export function isEntryPageScope(scope) {
|
|
14
|
+
return (String(scope) === MATERIALIZED_REPORT_SCOPE_ENUM.LOCAL_HOUR ||
|
|
15
|
+
String(scope) === MATERIALIZED_REPORT_SCOPE_ENUM.LOCAL_DATE ||
|
|
16
|
+
String(scope) === MATERIALIZED_REPORT_SCOPE_ENUM.LOCAL_WEEK ||
|
|
17
|
+
String(scope) === MATERIALIZED_REPORT_SCOPE_ENUM.LOCAL_WEEK_OF_YEAR ||
|
|
18
|
+
String(scope) === MATERIALIZED_REPORT_SCOPE_ENUM.LOCAL_MONTH);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* `page` value for one entry scope, matching Discounts and Delivery:
|
|
22
|
+
* day/hour scopes are already one day -> `all`; period scopes use the SOURCE day.
|
|
23
|
+
* Reports with `ONE_PER_SCOPE` or `NONE` return null.
|
|
24
|
+
*/
|
|
25
|
+
export function resolveEntryPageForScope(definition, scopeContext, sourceLocalDate) {
|
|
26
|
+
if (definition.entryStorage !== REPORT_ENTRY_STORAGE.PAGE_PER_SOURCE_DAY) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
if (!isEntryPageScope(scopeContext))
|
|
30
|
+
return null;
|
|
31
|
+
const scope = String(scopeContext);
|
|
32
|
+
if (scope === MATERIALIZED_REPORT_SCOPE_ENUM.LOCAL_HOUR || scope === MATERIALIZED_REPORT_SCOPE_ENUM.LOCAL_DATE) {
|
|
33
|
+
return ENTRY_PAGE_ALL;
|
|
34
|
+
}
|
|
35
|
+
return typeof sourceLocalDate === 'string' && sourceLocalDate !== '' ? sourceLocalDate : null;
|
|
36
|
+
}
|
|
37
|
+
export function entryPageBase(page) {
|
|
38
|
+
const text = String(page ?? '');
|
|
39
|
+
const match = SUB_PAGE_PATTERN.exec(text);
|
|
40
|
+
return match == null ? text : match[1];
|
|
41
|
+
}
|
|
42
|
+
export function isEntryPageForSourceDay(definition, scopeContext, page, sourceLocalDate) {
|
|
43
|
+
const base = resolveEntryPageForScope(definition, scopeContext, sourceLocalDate);
|
|
44
|
+
return base != null && entryPageBase(page) === base;
|
|
45
|
+
}
|
|
46
|
+
export function buildEntrySubPage(basePage, index) {
|
|
47
|
+
return `${basePage}#${Math.max(0, Math.floor(index))}`;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Splits one oversized entry page into deterministic `page#0`, `page#1`, ...
|
|
51
|
+
* chunks. A page that fits keeps its original identity.
|
|
52
|
+
*/
|
|
53
|
+
export function splitEntryPage(spec) {
|
|
54
|
+
const { document, maxBytes } = spec;
|
|
55
|
+
if (document == null)
|
|
56
|
+
return [];
|
|
57
|
+
if (materializedDocumentBsonBytes(document) <= maxBytes)
|
|
58
|
+
return [document];
|
|
59
|
+
const sections = spec.sectionsOf(document);
|
|
60
|
+
if (sections == null)
|
|
61
|
+
return [document];
|
|
62
|
+
const basePage = entryPageBase(spec.pageOf(document));
|
|
63
|
+
const baseDoc = spec.rebuild(document, basePage, {});
|
|
64
|
+
const envelopeBytes = materializedDocumentBsonBytes(baseDoc);
|
|
65
|
+
const chunks = [];
|
|
66
|
+
let current = {};
|
|
67
|
+
let currentBytes = envelopeBytes;
|
|
68
|
+
let currentRows = 0;
|
|
69
|
+
const flush = () => {
|
|
70
|
+
if (currentRows > 0)
|
|
71
|
+
chunks.push(current);
|
|
72
|
+
current = {};
|
|
73
|
+
currentBytes = envelopeBytes;
|
|
74
|
+
currentRows = 0;
|
|
75
|
+
};
|
|
76
|
+
for (const key of Object.keys(sections)) {
|
|
77
|
+
for (const row of sections[key]?.rows ?? []) {
|
|
78
|
+
const rowBytes = materializedDocumentBsonBytes(row) + key.length + 24;
|
|
79
|
+
if (currentRows > 0 && currentBytes + rowBytes > maxBytes - 512)
|
|
80
|
+
flush();
|
|
81
|
+
if (current[key] == null)
|
|
82
|
+
current[key] = { rows: [] };
|
|
83
|
+
current[key].rows.push(row);
|
|
84
|
+
currentBytes += rowBytes;
|
|
85
|
+
currentRows += 1;
|
|
86
|
+
if (currentBytes > maxBytes) {
|
|
87
|
+
throw new Error(`Entry page ${spec.scopeLabel?.(document) ?? ''}:${basePage} ` +
|
|
88
|
+
'cannot split below the budget (one row is too large)');
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
flush();
|
|
93
|
+
if (chunks.length <= 1) {
|
|
94
|
+
const allRows = [];
|
|
95
|
+
for (const key of Object.keys(sections)) {
|
|
96
|
+
for (const row of sections[key]?.rows ?? [])
|
|
97
|
+
allRows.push({ key, row });
|
|
98
|
+
}
|
|
99
|
+
if (allRows.length < 2) {
|
|
100
|
+
throw new Error(`Entry page ${spec.scopeLabel?.(document) ?? ''}:${basePage} ` + 'is over budget and has no splittable row');
|
|
101
|
+
}
|
|
102
|
+
const mid = Math.ceil(allRows.length / 2);
|
|
103
|
+
const toChunk = (rows) => {
|
|
104
|
+
const chunk = {};
|
|
105
|
+
for (const { key, row } of rows) {
|
|
106
|
+
if (chunk[key] == null)
|
|
107
|
+
chunk[key] = { rows: [] };
|
|
108
|
+
chunk[key].rows.push(row);
|
|
109
|
+
}
|
|
110
|
+
return chunk;
|
|
111
|
+
};
|
|
112
|
+
chunks.push(toChunk(allRows.slice(0, mid)), toChunk(allRows.slice(mid)));
|
|
113
|
+
}
|
|
114
|
+
return chunks.map((chunk, index) => {
|
|
115
|
+
const page = spec.rebuild(document, buildEntrySubPage(basePage, index), chunk);
|
|
116
|
+
if (materializedDocumentBsonBytes(page) > maxBytes) {
|
|
117
|
+
throw new Error(`Entry sub-page ${spec.scopeLabel?.(document) ?? ''}:${spec.pageOf(page)} ` + 'exceeds the entry-page budget');
|
|
118
|
+
}
|
|
119
|
+
return page;
|
|
120
|
+
});
|
|
121
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { buildMaterializedDrilldownRows, buildMaterializedDrilldownScope, } from '../../materialized-report-drilldown-rows';
|
|
2
|
+
export function buildReportFlatProjectionPlan(input) {
|
|
3
|
+
if (input.entryDocument == null)
|
|
4
|
+
return null;
|
|
5
|
+
const retargeted = {
|
|
6
|
+
...input.entryDocument,
|
|
7
|
+
scope_context: input.scopeContext,
|
|
8
|
+
scope_field: input.scopeField,
|
|
9
|
+
day_index: input.dayIndex ?? null,
|
|
10
|
+
};
|
|
11
|
+
const flattened = buildMaterializedDrilldownRows(input.reportType, retargeted, input.sourceLocalDate ?? null);
|
|
12
|
+
const scope = buildMaterializedDrilldownScope(input.reportType, retargeted, flattened.rows, input.sourceLocalDate ?? null);
|
|
13
|
+
return { rows: flattened.rows, scope };
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { buildMaterializedTenantReportIteration } from '../../materialized-tenant-reports-iterations-helpers';
|
|
2
|
+
/**
|
|
3
|
+
* PHASE 2 — generic iteration-row builder.
|
|
4
|
+
*
|
|
5
|
+
* Thin composition over the existing builder so later phases have one place to
|
|
6
|
+
* pass a registry report type. The existing builder remains the source of truth.
|
|
7
|
+
*/
|
|
8
|
+
export function buildReportIterationRow(report, options) {
|
|
9
|
+
return buildMaterializedTenantReportIteration(report, options);
|
|
10
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export const EMPTY_REPORT_RUN_STATS = {
|
|
2
|
+
reportKey: '',
|
|
3
|
+
localDate: '',
|
|
4
|
+
documents: 0,
|
|
5
|
+
entryDocuments: 0,
|
|
6
|
+
entryPages: 0,
|
|
7
|
+
flatRows: 0,
|
|
8
|
+
flatScopes: 0,
|
|
9
|
+
geoCells: 0,
|
|
10
|
+
iterationRows: 0,
|
|
11
|
+
deletes: 0,
|
|
12
|
+
cappedCells: 0,
|
|
13
|
+
cappedOrders: 0,
|
|
14
|
+
skipped: 0,
|
|
15
|
+
warnings: [],
|
|
16
|
+
};
|
|
17
|
+
export function buildReportRunStats(input) {
|
|
18
|
+
return {
|
|
19
|
+
...EMPTY_REPORT_RUN_STATS,
|
|
20
|
+
...input,
|
|
21
|
+
warnings: [...(input.warnings ?? [])],
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export function mergeReportRunStats(left, right) {
|
|
25
|
+
const sum = (key) => Number(left[key] ?? 0) + Number(right[key] ?? 0);
|
|
26
|
+
return {
|
|
27
|
+
reportKey: left.reportKey === right.reportKey ? left.reportKey : `${left.reportKey}+${right.reportKey}`,
|
|
28
|
+
localDate: left.localDate === right.localDate ? left.localDate : `${left.localDate}+${right.localDate}`,
|
|
29
|
+
documents: sum('documents'),
|
|
30
|
+
entryDocuments: sum('entryDocuments'),
|
|
31
|
+
entryPages: sum('entryPages'),
|
|
32
|
+
flatRows: sum('flatRows'),
|
|
33
|
+
flatScopes: sum('flatScopes'),
|
|
34
|
+
geoCells: sum('geoCells'),
|
|
35
|
+
iterationRows: sum('iterationRows'),
|
|
36
|
+
deletes: sum('deletes'),
|
|
37
|
+
cappedCells: sum('cappedCells'),
|
|
38
|
+
cappedOrders: sum('cappedOrders'),
|
|
39
|
+
skipped: sum('skipped'),
|
|
40
|
+
warnings: [...left.warnings, ...right.warnings],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { MATERIALIZED_REPORT_SCOPE_ENUM } from '../../../../constants/MATERIALIZED_REPORTS';
|
|
2
|
+
import { getMaterializedHourScopeField, getMaterializedPeriodScopeFields } from '../../scope-helpers';
|
|
3
|
+
export function resolveReportScopeRefsForDay(definition, localDate) {
|
|
4
|
+
const periodFields = getMaterializedPeriodScopeFields(localDate);
|
|
5
|
+
if (periodFields == null)
|
|
6
|
+
return null;
|
|
7
|
+
const refs = [];
|
|
8
|
+
for (const [scopeContext, scopeField] of Object.entries(periodFields)) {
|
|
9
|
+
if (definition.reportScopes.includes(scopeContext)) {
|
|
10
|
+
refs.push({
|
|
11
|
+
scope_context: scopeContext,
|
|
12
|
+
scope_field: scopeField,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
if (definition.reportScopes.includes(MATERIALIZED_REPORT_SCOPE_ENUM.LOCAL_HOUR)) {
|
|
17
|
+
for (let hour = 0; hour < 24; hour += 1) {
|
|
18
|
+
const scopeField = getMaterializedHourScopeField(localDate, hour);
|
|
19
|
+
if (scopeField == null)
|
|
20
|
+
return null;
|
|
21
|
+
refs.push({
|
|
22
|
+
scope_context: MATERIALIZED_REPORT_SCOPE_ENUM.LOCAL_HOUR,
|
|
23
|
+
scope_field: scopeField,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return refs;
|
|
28
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** PHASE 2 — deterministic top-N + reserved overflow token. */
|
|
2
|
+
export const REPORT_OTHER_TOKEN = '__OTHER__';
|
|
3
|
+
/**
|
|
4
|
+
* Selects the top-N keys by `count DESC, key ASC` and folds the rest into the
|
|
5
|
+
* reserved `__OTHER__` token. Generic; report-specific mapping stays report-owned.
|
|
6
|
+
*/
|
|
7
|
+
export function selectReportTopN(entries, limit, otherToken = REPORT_OTHER_TOKEN) {
|
|
8
|
+
const counts = new Map();
|
|
9
|
+
for (const entry of entries ?? []) {
|
|
10
|
+
if (entry == null || typeof entry.key !== 'string' || entry.key === '')
|
|
11
|
+
continue;
|
|
12
|
+
counts.set(entry.key, (counts.get(entry.key) ?? 0) + (Number(entry.count) || 0));
|
|
13
|
+
}
|
|
14
|
+
const ranked = [...counts.entries()].sort((a, b) => b[1] - a[1] || (a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0));
|
|
15
|
+
if (ranked.length <= Math.max(1, limit)) {
|
|
16
|
+
return { kept: ranked.map(([key]) => key), dropped: [], other: null };
|
|
17
|
+
}
|
|
18
|
+
const kept = ranked.slice(0, Math.max(1, limit)).map(([key]) => key);
|
|
19
|
+
const dropped = ranked.slice(Math.max(1, limit)).map(([key]) => key);
|
|
20
|
+
return { kept, dropped, other: otherToken };
|
|
21
|
+
}
|
|
22
|
+
export function resolveReportTopNKey(selection, key) {
|
|
23
|
+
return selection.other != null && selection.dropped.includes(key) ? selection.other : key;
|
|
24
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ALL_REPORT_KEYS } from '../../reporting-contract/report-contract';
|
|
2
|
+
import { PRODUCTION_REPORT_DEFINITIONS, REPORT_DEFINITIONS, REPORT_DEFINITION_STATUS, REPORT_REGISTRY_EXEMPTIONS, } from './definition';
|
|
3
|
+
/**
|
|
4
|
+
* PHASE 2 — the metadata registry lookup surface.
|
|
5
|
+
*
|
|
6
|
+
* Pure lookups only; no side effects and no service imports.
|
|
7
|
+
*/
|
|
8
|
+
export const REPORT_REGISTRY_KEYS = ALL_REPORT_KEYS;
|
|
9
|
+
export function getReportDefinition(key) {
|
|
10
|
+
return REPORT_DEFINITIONS[String(key)] ?? null;
|
|
11
|
+
}
|
|
12
|
+
export function getReportExemption(key) {
|
|
13
|
+
return REPORT_REGISTRY_EXEMPTIONS[String(key)] ?? null;
|
|
14
|
+
}
|
|
15
|
+
export function isProductionReportKey(key) {
|
|
16
|
+
return getReportDefinition(key)?.status === REPORT_DEFINITION_STATUS.PRODUCTION;
|
|
17
|
+
}
|
|
18
|
+
export function getProductionReportDefinitions() {
|
|
19
|
+
return [...PRODUCTION_REPORT_DEFINITIONS];
|
|
20
|
+
}
|
|
21
|
+
export function getReportDefinitionBySegment(segment) {
|
|
22
|
+
return PRODUCTION_REPORT_DEFINITIONS.find((definition) => definition.segment === segment) ?? null;
|
|
23
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { ALL_MATERIALIZED_REPORT_SCOPES, ALL_MATERIALIZED_REPORT_TYPES, } from '../../../constants/MATERIALIZED_REPORTS';
|
|
2
|
+
import { ALL_REPORT_KEYS, REPORT_CAPABILITIES, REPORT_ROUTE_SEGMENTS } from '../../reporting-contract/report-contract';
|
|
3
|
+
import { REPORT_DEFINITIONS, REPORT_DEFINITION_STATUS, REPORT_ENTRY_SPLIT, REPORT_ENTRY_STORAGE, REPORT_PROJECTION, REPORT_REGISTRY_EXEMPTIONS, } from './definition';
|
|
4
|
+
const MATERIALIZED_PREFIX = 'materialized_';
|
|
5
|
+
const isPositiveInteger = (value) => typeof value === 'number' && Number.isInteger(value) && value > 0;
|
|
6
|
+
const isNonEmptyString = (value) => typeof value === 'string' && value.trim() !== '';
|
|
7
|
+
function validateCollection(definition, label, collection, errors, warnings) {
|
|
8
|
+
if (!isNonEmptyString(collection.name)) {
|
|
9
|
+
errors.push(`${definition.key}: ${label} has no collection name`);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (!collection.name.startsWith(MATERIALIZED_PREFIX)) {
|
|
13
|
+
errors.push(`${definition.key}: ${label} collection "${collection.name}" is not a materialized_* collection`);
|
|
14
|
+
}
|
|
15
|
+
if (!isPositiveInteger(collection.schemaVersion)) {
|
|
16
|
+
errors.push(`${definition.key}: ${label} has no positive schema version`);
|
|
17
|
+
}
|
|
18
|
+
if (!isPositiveInteger(collection.budgetBytes)) {
|
|
19
|
+
errors.push(`${definition.key}: ${label} has no positive budget`);
|
|
20
|
+
}
|
|
21
|
+
if (!isNonEmptyString(collection.indexOwner)) {
|
|
22
|
+
errors.push(`${definition.key}: ${label} has no index ownership`);
|
|
23
|
+
}
|
|
24
|
+
if (collection.validatorFile == null && !isNonEmptyString(collection.validatorDebt)) {
|
|
25
|
+
errors.push(`${definition.key}: ${label} has neither a validator file nor a declared validator debt`);
|
|
26
|
+
}
|
|
27
|
+
if (collection.validatorFile == null && isNonEmptyString(collection.validatorDebt)) {
|
|
28
|
+
warnings.push(`${definition.key}: ${label} validator debt: ${collection.validatorDebt}`);
|
|
29
|
+
}
|
|
30
|
+
if (definition.budgets[collection.name] == null || !isPositiveInteger(definition.budgets[collection.name])) {
|
|
31
|
+
errors.push(`${definition.key}: collection "${collection.name}" has no budget declaration in budgets`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function validateScopes(definition, label, scopes, errors) {
|
|
35
|
+
if (scopes.length === 0) {
|
|
36
|
+
errors.push(`${definition.key}: ${label} has no scopes`);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const seen = new Set();
|
|
40
|
+
for (const scope of scopes) {
|
|
41
|
+
if (!ALL_MATERIALIZED_REPORT_SCOPES.includes(scope)) {
|
|
42
|
+
errors.push(`${definition.key}: ${label} has unknown scope "${String(scope)}"`);
|
|
43
|
+
}
|
|
44
|
+
if (seen.has(String(scope))) {
|
|
45
|
+
errors.push(`${definition.key}: ${label} repeats scope "${String(scope)}"`);
|
|
46
|
+
}
|
|
47
|
+
seen.add(String(scope));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export function validateReportRegistry(input = {}) {
|
|
51
|
+
const definitions = input.definitions ?? REPORT_DEFINITIONS;
|
|
52
|
+
const exemptions = input.exemptions ?? REPORT_REGISTRY_EXEMPTIONS;
|
|
53
|
+
const keys = input.keys ?? ALL_REPORT_KEYS;
|
|
54
|
+
const errors = [];
|
|
55
|
+
const warnings = [];
|
|
56
|
+
for (const key of keys) {
|
|
57
|
+
const definition = definitions[key];
|
|
58
|
+
const exemption = exemptions[key];
|
|
59
|
+
if (definition == null && exemption == null) {
|
|
60
|
+
errors.push(`${key}: no report definition and no explicit exemption`);
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
if (definition != null && exemption != null) {
|
|
64
|
+
errors.push(`${key}: both a report definition and an exemption exist`);
|
|
65
|
+
}
|
|
66
|
+
if (definition == null)
|
|
67
|
+
continue;
|
|
68
|
+
if (definition.key !== key) {
|
|
69
|
+
errors.push(`${key}: definition key is "${definition.key}"`);
|
|
70
|
+
}
|
|
71
|
+
if (definition.status !== REPORT_DEFINITION_STATUS.PRODUCTION &&
|
|
72
|
+
definition.status !== REPORT_DEFINITION_STATUS.READ_ONLY) {
|
|
73
|
+
errors.push(`${key}: a concrete definition must be PRODUCTION or READ_ONLY`);
|
|
74
|
+
}
|
|
75
|
+
if (!isNonEmptyString(definition.owner))
|
|
76
|
+
errors.push(`${key}: no owner`);
|
|
77
|
+
if (!ALL_MATERIALIZED_REPORT_TYPES.includes(definition.reportType)) {
|
|
78
|
+
errors.push(`${key}: unknown report type "${String(definition.reportType)}"`);
|
|
79
|
+
}
|
|
80
|
+
if (definition.segment !== REPORT_ROUTE_SEGMENTS[definition.key]) {
|
|
81
|
+
errors.push(`${key}: segment "${definition.segment}" disagrees with REPORT_ROUTE_SEGMENTS`);
|
|
82
|
+
}
|
|
83
|
+
const expectedCapabilities = REPORT_CAPABILITIES[definition.key];
|
|
84
|
+
if (expectedCapabilities == null ||
|
|
85
|
+
expectedCapabilities.live !== definition.capabilities.live ||
|
|
86
|
+
expectedCapabilities.historical !== definition.capabilities.historical ||
|
|
87
|
+
expectedCapabilities.details !== definition.capabilities.details) {
|
|
88
|
+
errors.push(`${key}: capabilities disagree with REPORT_CAPABILITIES`);
|
|
89
|
+
}
|
|
90
|
+
validateCollection(definition, 'report', definition.report, errors, warnings);
|
|
91
|
+
if (definition.entries != null) {
|
|
92
|
+
validateCollection(definition, 'entries', definition.entries, errors, warnings);
|
|
93
|
+
}
|
|
94
|
+
for (const side of definition.sideCollections) {
|
|
95
|
+
validateCollection(definition, 'side', side, errors, warnings);
|
|
96
|
+
}
|
|
97
|
+
const allCollections = [
|
|
98
|
+
definition.report,
|
|
99
|
+
...(definition.entries == null ? [] : [definition.entries]),
|
|
100
|
+
...definition.sideCollections,
|
|
101
|
+
].map((collection) => collection.name);
|
|
102
|
+
for (const collectionName of Object.keys(definition.budgets)) {
|
|
103
|
+
if (!allCollections.includes(collectionName)) {
|
|
104
|
+
warnings.push(`${key}: budget declared for unknown collection "${collectionName}"`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
validateScopes(definition, 'reportScopes', definition.reportScopes, errors);
|
|
108
|
+
if (definition.entryScopes.length > 0 || definition.entryStorage !== REPORT_ENTRY_STORAGE.NONE) {
|
|
109
|
+
validateScopes(definition, 'entryScopes', definition.entryScopes, errors);
|
|
110
|
+
}
|
|
111
|
+
if (!definition.reportScopes.includes(definition.maxReportScope)) {
|
|
112
|
+
errors.push(`${key}: maxReportScope is not a declared report scope`);
|
|
113
|
+
}
|
|
114
|
+
if (definition.maxEntryScope != null && !definition.entryScopes.includes(definition.maxEntryScope)) {
|
|
115
|
+
errors.push(`${key}: maxEntryScope is not a declared entry scope`);
|
|
116
|
+
}
|
|
117
|
+
for (const scope of definition.entryScopes) {
|
|
118
|
+
if (!definition.reportScopes.includes(scope)) {
|
|
119
|
+
errors.push(`${key}: entry scope "${scope}" is outside reportScopes`);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (definition.entryStorage === REPORT_ENTRY_STORAGE.NONE) {
|
|
123
|
+
if (definition.entries != null) {
|
|
124
|
+
errors.push(`${key}: entryStorage NONE must not declare an entry collection`);
|
|
125
|
+
}
|
|
126
|
+
if (definition.entryScopes.length !== 0) {
|
|
127
|
+
errors.push(`${key}: entryStorage NONE must not declare entry scopes`);
|
|
128
|
+
}
|
|
129
|
+
if (definition.entrySplit !== REPORT_ENTRY_SPLIT.NONE) {
|
|
130
|
+
errors.push(`${key}: entryStorage NONE must not split pages`);
|
|
131
|
+
}
|
|
132
|
+
if (definition.maxEntryScope != null) {
|
|
133
|
+
errors.push(`${key}: entryStorage NONE must not declare maxEntryScope`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
if (definition.entries == null) {
|
|
138
|
+
errors.push(`${key}: entry storage requires an entry collection`);
|
|
139
|
+
}
|
|
140
|
+
if (definition.entryScopes.length === 0) {
|
|
141
|
+
errors.push(`${key}: entry storage requires entry scopes`);
|
|
142
|
+
}
|
|
143
|
+
if (definition.maxEntryScope == null) {
|
|
144
|
+
errors.push(`${key}: entry storage requires maxEntryScope`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (definition.entrySplit === REPORT_ENTRY_SPLIT.DETERMINISTIC_SUBPAGES &&
|
|
148
|
+
definition.entryStorage !== REPORT_ENTRY_STORAGE.PAGE_PER_SOURCE_DAY) {
|
|
149
|
+
errors.push(`${key}: #N splitting requires page-per-source-day entries`);
|
|
150
|
+
}
|
|
151
|
+
if (definition.projections.includes(REPORT_PROJECTION.FLAT_DRILLDOWN)) {
|
|
152
|
+
const names = definition.sideCollections.map((collection) => collection.name);
|
|
153
|
+
if (!names.includes('materialized_report_drilldown_rows') ||
|
|
154
|
+
!names.includes('materialized_report_drilldown_scopes')) {
|
|
155
|
+
errors.push(`${key}: FLAT_DRILLDOWN requires both flat collections`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if (definition.projections.includes(REPORT_PROJECTION.DISCOUNT_SOURCES) &&
|
|
159
|
+
!definition.sideCollections.some((collection) => collection.name === 'materialized_tenant_discount_sources')) {
|
|
160
|
+
errors.push(`${key}: DISCOUNT_SOURCES requires the source collection`);
|
|
161
|
+
}
|
|
162
|
+
if (definition.projections.includes(REPORT_PROJECTION.DELIVERY_GEO)) {
|
|
163
|
+
const names = definition.sideCollections.map((collection) => collection.name);
|
|
164
|
+
if (!names.includes('materialized_tenant_delivery_geo_cells') ||
|
|
165
|
+
!names.includes('materialized_tenant_delivery_geo_scopes')) {
|
|
166
|
+
errors.push(`${key}: DELIVERY_GEO requires cells + cap metadata`);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (definition.capabilities.details &&
|
|
170
|
+
(definition.adapters.details == null || !isNonEmptyString(definition.adapters.details))) {
|
|
171
|
+
errors.push(`${key}: capabilities.details is true but no details adapter is declared`);
|
|
172
|
+
}
|
|
173
|
+
if (!definition.capabilities.details && definition.adapters.details != null) {
|
|
174
|
+
errors.push(`${key}: details adapter declared without details capability`);
|
|
175
|
+
}
|
|
176
|
+
if (!isNonEmptyString(definition.adapters.writer))
|
|
177
|
+
errors.push(`${key}: no writer adapter`);
|
|
178
|
+
if (!isNonEmptyString(definition.adapters.live))
|
|
179
|
+
errors.push(`${key}: no live adapter`);
|
|
180
|
+
if (!isNonEmptyString(definition.adapters.historical)) {
|
|
181
|
+
errors.push(`${key}: no historical adapter`);
|
|
182
|
+
}
|
|
183
|
+
if (definition.completeness.details === 'FLAT_PROJECTION' &&
|
|
184
|
+
!definition.projections.includes(REPORT_PROJECTION.FLAT_DRILLDOWN)) {
|
|
185
|
+
errors.push(`${key}: details completeness requires the flat projection`);
|
|
186
|
+
}
|
|
187
|
+
if (definition.filters.length === 0) {
|
|
188
|
+
errors.push(`${key}: no filter definitions`);
|
|
189
|
+
}
|
|
190
|
+
for (const filter of definition.filters) {
|
|
191
|
+
if (!isNonEmptyString(filter.id))
|
|
192
|
+
errors.push(`${key}: filter without an id`);
|
|
193
|
+
if (filter.mode !== 'CLIENT' && filter.mode !== 'SERVER') {
|
|
194
|
+
errors.push(`${key}: filter "${filter.id}" has an invalid mode`);
|
|
195
|
+
}
|
|
196
|
+
if (!['SUMMARY', 'DETAILS', 'BOTH'].includes(filter.appliesTo)) {
|
|
197
|
+
errors.push(`${key}: filter "${filter.id}" has an invalid appliesTo`);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
if (definition.capabilities.details && definition.cursor === 'NONE') {
|
|
201
|
+
warnings.push(`${key}: details capability but cursor NONE`);
|
|
202
|
+
}
|
|
203
|
+
for (const rule of definition.retention) {
|
|
204
|
+
if (!allCollections.includes(rule.collection)) {
|
|
205
|
+
errors.push(`${key}: retention targets an unknown collection "${rule.collection}"`);
|
|
206
|
+
}
|
|
207
|
+
if (!isPositiveInteger(rule.amount)) {
|
|
208
|
+
errors.push(`${key}: retention amount must be a positive integer`);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return { ok: errors.length === 0, errors, warnings };
|
|
213
|
+
}
|
|
214
|
+
export const REPORT_REGISTRY_VALIDATION = validateReportRegistry();
|
|
@@ -72,6 +72,7 @@ export * from './tenant_cash_in_out';
|
|
|
72
72
|
export * from './tenant_chart_of_accounts';
|
|
73
73
|
export * from './tenant_clients';
|
|
74
74
|
export * from './tenant_day_sessions';
|
|
75
|
+
export * from './tenant_dialer_events';
|
|
75
76
|
export * from './tenant_hr_attendance_records';
|
|
76
77
|
export * from './tenant_hr_biometric_enrollments';
|
|
77
78
|
export * from './tenant_hr_departments';
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
import { ALL_DIALER_TYPE_EVENTS } from '../../constants';
|
|
3
|
+
import { LocalTimeFieldsSchema } from './common-models';
|
|
4
|
+
/**
|
|
5
|
+
* Shape version of a `tenant_dialer_events` row. Bump only with a migration
|
|
6
|
+
* for already-stored source events.
|
|
7
|
+
*/
|
|
8
|
+
export const TENANT_DIALER_EVENTS_SCHEMA_VERSION = 1;
|
|
9
|
+
/**
|
|
10
|
+
* The shared `LocalTimeFieldsSchema` is required for every other model. The
|
|
11
|
+
* dialer source stream is the one place local fields are OPTIONAL: when the
|
|
12
|
+
* running business day is unavailable the event is still stored, un-attributed
|
|
13
|
+
* and WITHOUT any local-time field. Derive an optional copy locally instead of
|
|
14
|
+
* weakening the shared schema.
|
|
15
|
+
*/
|
|
16
|
+
const OptionalLocalTimeFieldsSchema = Object.fromEntries(Object.entries(LocalTimeFieldsSchema).map(([field, definition]) => [field, { ...definition, required: false }]));
|
|
17
|
+
/**
|
|
18
|
+
* APPEND-ONLY source event stream for the future Dialer materialized report.
|
|
19
|
+
* Rows are written by items-service with
|
|
20
|
+
* `findOneAndUpdate({ tenant_id, request_id }, { $setOnInsert }, { upsert: true })`,
|
|
21
|
+
* so a retried request returns the ORIGINAL row and never rewrites
|
|
22
|
+
* `createdAt`, the local-time fields or any other stored value. No report
|
|
23
|
+
* fields (for example duration) live here.
|
|
24
|
+
*/
|
|
25
|
+
export const TenantDialerEventSchema = new Schema({
|
|
26
|
+
_id: {
|
|
27
|
+
type: Schema.Types.ObjectId,
|
|
28
|
+
required: true,
|
|
29
|
+
immutable: true,
|
|
30
|
+
},
|
|
31
|
+
tenant_id: {
|
|
32
|
+
type: String,
|
|
33
|
+
required: true,
|
|
34
|
+
immutable: true,
|
|
35
|
+
ref: 'tenants',
|
|
36
|
+
},
|
|
37
|
+
request_id: {
|
|
38
|
+
type: String,
|
|
39
|
+
required: true,
|
|
40
|
+
immutable: true,
|
|
41
|
+
},
|
|
42
|
+
action: {
|
|
43
|
+
type: String,
|
|
44
|
+
enum: ALL_DIALER_TYPE_EVENTS,
|
|
45
|
+
required: true,
|
|
46
|
+
immutable: true,
|
|
47
|
+
},
|
|
48
|
+
phone_number: {
|
|
49
|
+
type: String,
|
|
50
|
+
required: true,
|
|
51
|
+
immutable: true,
|
|
52
|
+
},
|
|
53
|
+
pos_id: {
|
|
54
|
+
type: String,
|
|
55
|
+
required: true,
|
|
56
|
+
immutable: true,
|
|
57
|
+
},
|
|
58
|
+
staff_id: {
|
|
59
|
+
type: String,
|
|
60
|
+
required: false,
|
|
61
|
+
default: null,
|
|
62
|
+
immutable: true,
|
|
63
|
+
},
|
|
64
|
+
staff_phone: {
|
|
65
|
+
type: String,
|
|
66
|
+
required: false,
|
|
67
|
+
default: null,
|
|
68
|
+
immutable: true,
|
|
69
|
+
},
|
|
70
|
+
schema_version: {
|
|
71
|
+
type: Number,
|
|
72
|
+
required: true,
|
|
73
|
+
enum: [TENANT_DIALER_EVENTS_SCHEMA_VERSION],
|
|
74
|
+
default: TENANT_DIALER_EVENTS_SCHEMA_VERSION,
|
|
75
|
+
immutable: true,
|
|
76
|
+
},
|
|
77
|
+
...OptionalLocalTimeFieldsSchema,
|
|
78
|
+
createdAt: {
|
|
79
|
+
type: Schema.Types.Date,
|
|
80
|
+
required: true,
|
|
81
|
+
default: () => new Date(),
|
|
82
|
+
immutable: true,
|
|
83
|
+
},
|
|
84
|
+
updatedAt: {
|
|
85
|
+
type: Schema.Types.Date,
|
|
86
|
+
required: true,
|
|
87
|
+
default: () => new Date(),
|
|
88
|
+
},
|
|
89
|
+
}, {
|
|
90
|
+
timestamps: true,
|
|
91
|
+
versionKey: false,
|
|
92
|
+
minimize: false,
|
|
93
|
+
});
|
|
94
|
+
export const TENANT_DIALER_EVENTS_COLLECTION_NAME = 'tenant_dialer_events';
|
|
95
|
+
/**
|
|
96
|
+
* Describes the indexes for `tenant_dialer_events`. Values are Mongo key
|
|
97
|
+
* patterns that can be passed straight to `.hint()`.
|
|
98
|
+
* - `_id`: unique primary key.
|
|
99
|
+
* - `tenant_id__request_id`: UNIQUE idempotency key — one source event per
|
|
100
|
+
* tenant + request (native: `callId:action`, JS: UUID reused on retry).
|
|
101
|
+
* - `tenant_id__localDate__action`: future report reads per business day and
|
|
102
|
+
* action. Local fields may be absent for un-attributed events, so reads must
|
|
103
|
+
* tolerate a missing `localDate` (sparse-aware querying, not a partial
|
|
104
|
+
* index requirement).
|
|
105
|
+
* - `tenant_id__phone_number__createdAt`: future pairing/attribution reads for
|
|
106
|
+
* one caller phone ordered by the canonical receipt time.
|
|
107
|
+
*/
|
|
108
|
+
export const TENANT_DIALER_EVENTS_COLLECTION_INDEXES = {
|
|
109
|
+
_id: { _id: 1 }, // Unique Index
|
|
110
|
+
tenant_id__request_id: { tenant_id: 1, request_id: 1 }, // Unique Index — ingestion idempotency
|
|
111
|
+
tenant_id__localDate__action: { tenant_id: 1, localDate: 1, action: 1 }, // per business day + action
|
|
112
|
+
tenant_id__phone_number__createdAt: { tenant_id: 1, phone_number: 1, createdAt: 1 }, // per caller phone over time
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Index OPTIONS to DECLARE (never created at application startup). The
|
|
116
|
+
* materializer/ops path owns creation; `tenant_id__request_id` MUST be created
|
|
117
|
+
* with `unique: true` or concurrent retries could insert a second event.
|
|
118
|
+
*/
|
|
119
|
+
export const TENANT_DIALER_EVENTS_INDEX_OPTIONS = [
|
|
120
|
+
{
|
|
121
|
+
key: TENANT_DIALER_EVENTS_COLLECTION_INDEXES.tenant_id__request_id,
|
|
122
|
+
name: 'tenant_id__request_id',
|
|
123
|
+
unique: true,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
key: TENANT_DIALER_EVENTS_COLLECTION_INDEXES.tenant_id__localDate__action,
|
|
127
|
+
name: 'tenant_id__localDate__action',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
key: TENANT_DIALER_EVENTS_COLLECTION_INDEXES.tenant_id__phone_number__createdAt,
|
|
131
|
+
name: 'tenant_id__phone_number__createdAt',
|
|
132
|
+
},
|
|
133
|
+
];
|
|
@@ -77,6 +77,7 @@ export * from './tenant_cash_in_out';
|
|
|
77
77
|
export * from './tenant_chart_of_accounts';
|
|
78
78
|
export * from './tenant_clients';
|
|
79
79
|
export * from './tenant_day_sessions';
|
|
80
|
+
export * from './tenant_dialer_events';
|
|
80
81
|
export * from './tenant_hr_attendance_records';
|
|
81
82
|
export * from './tenant_hr_biometric_enrollments';
|
|
82
83
|
export * from './tenant_hr_departments';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -69,3 +69,4 @@ __exportStar(require("./tenant-delivery-formatter"), exports);
|
|
|
69
69
|
__exportStar(require("./tenant-prep-time-formatter"), exports);
|
|
70
70
|
__exportStar(require("./tenant-sales-overview-formatter"), exports);
|
|
71
71
|
__exportStar(require("./tenant-sales-overview-helpers"), exports);
|
|
72
|
+
__exportStar(require("./report-platform"), exports);
|
|
@@ -15,3 +15,4 @@ export interface IDeliveryMaterializationWipeTarget {
|
|
|
15
15
|
filter: Record<string, unknown>;
|
|
16
16
|
}
|
|
17
17
|
export declare function buildDeliveryMaterializationWipeTargets(tenantId?: string | null): IDeliveryMaterializationWipeTarget[];
|
|
18
|
+
export declare function assertMaterializedWipeTargets(targets: readonly IDeliveryMaterializationWipeTarget[]): void;
|