@managesome/eposmatic-toolkit 0.4.61 → 0.4.63
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 +77 -0
- package/esm/constants/MATERIALIZED_SCHEMA_VERSIONS.js +17 -0
- package/esm/constants/TENANT_ENUMS.js +15 -0
- package/esm/constants/WORKER_ENDPOINTS.js +14 -2
- package/esm/helpers/materialized-reports/index.js +4 -0
- package/esm/helpers/materialized-reports/materialized-credit-bills-helpers.js +3 -3
- package/esm/helpers/materialized-reports/materialized-delivery-close-day-helpers.js +5 -5
- package/esm/helpers/materialized-reports/materialized-delivery-compile-helpers.js +2 -2
- package/esm/helpers/materialized-reports/materialized-dialer-close-day-helpers.js +5 -5
- package/esm/helpers/materialized-reports/materialized-dialer-compile-helpers.js +2 -2
- package/esm/helpers/materialized-reports/materialized-dinein-close-day-helpers.js +5 -5
- package/esm/helpers/materialized-reports/materialized-dinein-compile-helpers.js +2 -2
- package/esm/helpers/materialized-reports/materialized-discount-compile-helpers.js +3 -3
- package/esm/helpers/materialized-reports/materialized-document-size.js +2 -2
- package/esm/helpers/materialized-reports/materialized-index-bootstrap.js +3 -1
- package/esm/helpers/materialized-reports/materialized-prep-time-close-day-helpers.js +3 -3
- package/esm/helpers/materialized-reports/materialized-prep-time-compile-helpers.js +3 -3
- package/esm/helpers/materialized-reports/materialized-report-runs.js +143 -0
- package/esm/helpers/materialized-reports/report-compile.js +38 -0
- package/esm/helpers/materialized-reports/tenant-sales-overview-bson.js +27 -0
- package/esm/helpers/materialized-reports/tenant-sales-overview-helpers.js +3 -22
- package/esm/schemas/models/index.js +1 -0
- package/esm/schemas/models/materialized_credit_bills.js +2 -1
- package/esm/schemas/models/materialized_tenant_delivery_entries.js +2 -1
- package/esm/schemas/models/materialized_tenant_delivery_reports.js +2 -1
- package/esm/schemas/models/materialized_tenant_dialer_entries.js +2 -1
- package/esm/schemas/models/materialized_tenant_dialer_reports.js +2 -1
- package/esm/schemas/models/materialized_tenant_dinein_entries.js +2 -1
- package/esm/schemas/models/materialized_tenant_dinein_reports.js +2 -1
- package/esm/schemas/models/materialized_tenant_report_runs.js +105 -0
- package/esm/schemas/models/materialized_tenant_sales_overview_reports.js +2 -1
- package/esm/schemas/models/tenant_active_jobs.js +19 -1
- package/esm/schemas/types/index.js +1 -0
- package/lib/constants/MATERIALIZED_REPORTS.d.ts +69 -0
- package/lib/constants/MATERIALIZED_REPORTS.js +78 -1
- package/lib/constants/MATERIALIZED_SCHEMA_VERSIONS.d.ts +17 -0
- package/lib/constants/MATERIALIZED_SCHEMA_VERSIONS.js +20 -0
- 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 -2
- package/lib/constants/WORKER_ENDPOINTS.js +14 -2
- package/lib/helpers/materialized-reports/index.d.ts +3 -0
- package/lib/helpers/materialized-reports/index.js +27 -0
- package/lib/helpers/materialized-reports/materialized-credit-bills-helpers.js +4 -4
- package/lib/helpers/materialized-reports/materialized-delivery-close-day-helpers.js +6 -6
- package/lib/helpers/materialized-reports/materialized-delivery-compile-helpers.js +4 -4
- package/lib/helpers/materialized-reports/materialized-dialer-close-day-helpers.js +6 -6
- package/lib/helpers/materialized-reports/materialized-dialer-compile-helpers.js +6 -6
- package/lib/helpers/materialized-reports/materialized-dinein-close-day-helpers.js +6 -6
- package/lib/helpers/materialized-reports/materialized-dinein-compile-helpers.js +6 -6
- package/lib/helpers/materialized-reports/materialized-discount-compile-helpers.js +3 -3
- package/lib/helpers/materialized-reports/materialized-document-size.js +2 -5
- package/lib/helpers/materialized-reports/materialized-index-bootstrap.js +2 -0
- package/lib/helpers/materialized-reports/materialized-prep-time-close-day-helpers.js +3 -3
- package/lib/helpers/materialized-reports/materialized-prep-time-compile-helpers.js +3 -3
- 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-compile.d.ts +38 -0
- package/lib/helpers/materialized-reports/report-compile.js +87 -0
- package/lib/helpers/materialized-reports/tenant-sales-overview-bson.d.ts +12 -0
- package/lib/helpers/materialized-reports/tenant-sales-overview-bson.js +33 -0
- package/lib/helpers/materialized-reports/tenant-sales-overview-helpers.d.ts +1 -12
- package/lib/helpers/materialized-reports/tenant-sales-overview-helpers.js +4 -24
- package/lib/helpers/types/workers.d.ts +65 -0
- package/lib/schemas/models/index.d.ts +1 -0
- package/lib/schemas/models/index.js +1 -0
- package/lib/schemas/models/materialized_credit_bills.d.ts +29 -46
- package/lib/schemas/models/materialized_credit_bills.js +3 -2
- package/lib/schemas/models/materialized_tenant_cash_entries.d.ts +9 -9
- package/lib/schemas/models/materialized_tenant_cash_reports.d.ts +9 -9
- package/lib/schemas/models/materialized_tenant_delivery_entries.d.ts +11 -10
- package/lib/schemas/models/materialized_tenant_delivery_entries.js +3 -2
- package/lib/schemas/models/materialized_tenant_delivery_geo_cells.d.ts +9 -9
- package/lib/schemas/models/materialized_tenant_delivery_geo_scopes.d.ts +6 -6
- package/lib/schemas/models/materialized_tenant_delivery_reports.d.ts +11 -10
- package/lib/schemas/models/materialized_tenant_delivery_reports.js +3 -2
- package/lib/schemas/models/materialized_tenant_dialer_entries.d.ts +8 -7
- package/lib/schemas/models/materialized_tenant_dialer_entries.js +3 -2
- package/lib/schemas/models/materialized_tenant_dialer_reports.d.ts +11 -10
- package/lib/schemas/models/materialized_tenant_dialer_reports.js +3 -2
- package/lib/schemas/models/materialized_tenant_dinein_entries.d.ts +8 -7
- package/lib/schemas/models/materialized_tenant_dinein_entries.js +3 -2
- package/lib/schemas/models/materialized_tenant_dinein_reports.d.ts +11 -10
- package/lib/schemas/models/materialized_tenant_dinein_reports.js +3 -2
- package/lib/schemas/models/materialized_tenant_discount_entries.d.ts +9 -9
- package/lib/schemas/models/materialized_tenant_discount_reports.d.ts +9 -9
- package/lib/schemas/models/materialized_tenant_discount_sources.d.ts +9 -9
- package/lib/schemas/models/materialized_tenant_hourly_comparison_entries.d.ts +9 -9
- package/lib/schemas/models/materialized_tenant_hourly_comparison_reports.d.ts +9 -9
- package/lib/schemas/models/materialized_tenant_payments_comparison_entries.d.ts +9 -9
- package/lib/schemas/models/materialized_tenant_payments_comparison_reports.d.ts +9 -9
- package/lib/schemas/models/materialized_tenant_prep_time_entries.d.ts +9 -9
- package/lib/schemas/models/materialized_tenant_prep_time_reports.d.ts +9 -9
- 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/materialized_tenant_sales_comparison_entries.d.ts +9 -9
- package/lib/schemas/models/materialized_tenant_sales_comparison_reports.d.ts +9 -9
- package/lib/schemas/models/materialized_tenant_sales_overview_reports.d.ts +11 -35
- package/lib/schemas/models/materialized_tenant_sales_overview_reports.js +3 -2
- 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 +1 -0
- package/lib/schemas/types/index.js +1 -0
- package/lib/schemas/types/materialized_tenant_report_runs.d.ts +55 -0
- package/lib/schemas/types/tenant_active_jobs.d.ts +15 -1
- package/lib/tests/materialized-reports/materialized-report-runs.test.js +116 -0
- package/lib/tests/materialized-reports/tenant-dinein-formatter.test.js +159 -0
- package/lib/tests/materialized-reports/tenant-sales-overview-close-day-helpers.test.js +2 -1
- package/lib/tests/materialized-reports/tenant-sales-overview-helpers.test.js +5 -4
- package/lib/tests/reporting-contract/no-live-transport.test.js +106 -0
- package/package.json +2 -1
- package/lib/helpers/order/payment-collection.d.ts +0 -25
- package/lib/helpers/order/payment-collection.js +0 -51
- package/lib/schemas/models/applied_order_discounts.d.ts +0 -80
- package/lib/schemas/models/applied_order_discounts.js +0 -106
- package/lib/schemas/types/applied_order_discounts.d.ts +0 -22
- package/lib/tests/payment-collection-timestamps.test.d.ts +0 -1
- package/lib/tests/payment-collection-timestamps.test.js +0 -71
- /package/{lib/tests/materialized-reports/analytics-growth-helpers.test.d.ts → esm/schemas/types/materialized_tenant_report_runs.js} +0 -0
- /package/lib/schemas/types/{applied_order_discounts.js → materialized_tenant_report_runs.js} +0 -0
- /package/lib/tests/materialized-reports/{analytics-overview-helpers.test.d.ts → materialized-report-runs.test.d.ts} +0 -0
- /package/lib/tests/{materialized-reports/analytics-performance-helpers.test.d.ts → reporting-contract/no-live-transport.test.d.ts} +0 -0
|
@@ -1,23 +1,6 @@
|
|
|
1
|
+
import { MATERIALIZED_CREDIT_BILLS_SCHEMA_VERSION } from '../../constants/MATERIALIZED_SCHEMA_VERSIONS';
|
|
2
|
+
export { MATERIALIZED_CREDIT_BILLS_SCHEMA_VERSION };
|
|
1
3
|
import { Schema } from 'mongoose';
|
|
2
|
-
/**
|
|
3
|
-
* Mongoose schema for `materialized_tenant_credit_bills` — the SHARED
|
|
4
|
-
* credit-bill ledger of the materialized reports (see `MATERIALIZED_REPORTS.md`).
|
|
5
|
-
*
|
|
6
|
-
* ONE document per (tenant, scope context, scope value), scopes CAPPED AT
|
|
7
|
-
* `LOCAL_MONTH` (`MATERIALIZED_CREDIT_BILLS_SCOPES`) so a document can never
|
|
8
|
-
* grow unboundedly: a month bounds its bill volume by construction. Each
|
|
9
|
-
* document carries a per-key `credit_bills` map of slim `issued` / `received`
|
|
10
|
-
* entries (ids + credit facts — the order document stays the single source of
|
|
11
|
-
* the sale). See the type module `schemas/types/materialized_credit_bills.ts`
|
|
12
|
-
* for the entry contract. Amounts are CENTS; reads pin `schema_version`.
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* Version of the credit-entry rules of this collection. Bump when entry
|
|
16
|
-
* semantics change (e.g. signed REFUND / WRITE_OFF deltas) — historical
|
|
17
|
-
* documents must then be re-materialized. PRE-RELEASE: the collection has no
|
|
18
|
-
* live tenants/consumers yet, so every change so far folds into version `1`.
|
|
19
|
-
*/
|
|
20
|
-
export declare const MATERIALIZED_CREDIT_BILLS_SCHEMA_VERSION = 1;
|
|
21
4
|
export declare const MaterializedTenantCreditBillsReportSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
22
5
|
timestamps: true;
|
|
23
6
|
versionKey: false;
|
|
@@ -33,42 +16,39 @@ export declare const MaterializedTenantCreditBillsReportSchema: Schema<any, impo
|
|
|
33
16
|
tenant_id: string;
|
|
34
17
|
day_index: import("../../constants/ENUMS").DAY_INDEX_ENUM | null;
|
|
35
18
|
iteration: number;
|
|
36
|
-
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
37
|
-
scope_field: string;
|
|
38
|
-
sale_type_key_filters: string[];
|
|
39
19
|
credit_bills: Map<string, {
|
|
40
20
|
issued: import("mongoose").Types.DocumentArray<{
|
|
41
21
|
payment_id: string;
|
|
42
22
|
order_id: string;
|
|
43
23
|
amount: number;
|
|
24
|
+
settled_at: NativeDate;
|
|
25
|
+
settled_local_date: string;
|
|
44
26
|
issued_at: NativeDate;
|
|
45
27
|
issued_local_hour: string;
|
|
46
28
|
received_at_issue: number;
|
|
47
29
|
received_amount: number;
|
|
48
|
-
settled_at: NativeDate;
|
|
49
|
-
settled_local_date: string;
|
|
50
30
|
credit_note: string;
|
|
51
31
|
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
52
32
|
payment_id: string;
|
|
53
33
|
order_id: string;
|
|
54
34
|
amount: number;
|
|
35
|
+
settled_at: NativeDate;
|
|
36
|
+
settled_local_date: string;
|
|
55
37
|
issued_at: NativeDate;
|
|
56
38
|
issued_local_hour: string;
|
|
57
39
|
received_at_issue: number;
|
|
58
40
|
received_amount: number;
|
|
59
|
-
settled_at: NativeDate;
|
|
60
|
-
settled_local_date: string;
|
|
61
41
|
credit_note: string;
|
|
62
42
|
}> & {
|
|
63
43
|
payment_id: string;
|
|
64
44
|
order_id: string;
|
|
65
45
|
amount: number;
|
|
46
|
+
settled_at: NativeDate;
|
|
47
|
+
settled_local_date: string;
|
|
66
48
|
issued_at: NativeDate;
|
|
67
49
|
issued_local_hour: string;
|
|
68
50
|
received_at_issue: number;
|
|
69
51
|
received_amount: number;
|
|
70
|
-
settled_at: NativeDate;
|
|
71
|
-
settled_local_date: string;
|
|
72
52
|
credit_note: string;
|
|
73
53
|
}>;
|
|
74
54
|
received: import("mongoose").Types.DocumentArray<{
|
|
@@ -109,6 +89,9 @@ export declare const MaterializedTenantCreditBillsReportSchema: Schema<any, impo
|
|
|
109
89
|
schema_version: number;
|
|
110
90
|
source_watermark: NativeDate;
|
|
111
91
|
computed_at: NativeDate;
|
|
92
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
93
|
+
scope_field: string;
|
|
94
|
+
sale_type_key_filters: string[];
|
|
112
95
|
source_input_signature?: string | null | undefined;
|
|
113
96
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
114
97
|
createdAt: NativeDate;
|
|
@@ -121,42 +104,39 @@ export declare const MaterializedTenantCreditBillsReportSchema: Schema<any, impo
|
|
|
121
104
|
tenant_id: string;
|
|
122
105
|
day_index: import("../../constants/ENUMS").DAY_INDEX_ENUM | null;
|
|
123
106
|
iteration: number;
|
|
124
|
-
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
125
|
-
scope_field: string;
|
|
126
|
-
sale_type_key_filters: string[];
|
|
127
107
|
credit_bills: Map<string, {
|
|
128
108
|
issued: import("mongoose").Types.DocumentArray<{
|
|
129
109
|
payment_id: string;
|
|
130
110
|
order_id: string;
|
|
131
111
|
amount: number;
|
|
112
|
+
settled_at: NativeDate;
|
|
113
|
+
settled_local_date: string;
|
|
132
114
|
issued_at: NativeDate;
|
|
133
115
|
issued_local_hour: string;
|
|
134
116
|
received_at_issue: number;
|
|
135
117
|
received_amount: number;
|
|
136
|
-
settled_at: NativeDate;
|
|
137
|
-
settled_local_date: string;
|
|
138
118
|
credit_note: string;
|
|
139
119
|
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
140
120
|
payment_id: string;
|
|
141
121
|
order_id: string;
|
|
142
122
|
amount: number;
|
|
123
|
+
settled_at: NativeDate;
|
|
124
|
+
settled_local_date: string;
|
|
143
125
|
issued_at: NativeDate;
|
|
144
126
|
issued_local_hour: string;
|
|
145
127
|
received_at_issue: number;
|
|
146
128
|
received_amount: number;
|
|
147
|
-
settled_at: NativeDate;
|
|
148
|
-
settled_local_date: string;
|
|
149
129
|
credit_note: string;
|
|
150
130
|
}> & {
|
|
151
131
|
payment_id: string;
|
|
152
132
|
order_id: string;
|
|
153
133
|
amount: number;
|
|
134
|
+
settled_at: NativeDate;
|
|
135
|
+
settled_local_date: string;
|
|
154
136
|
issued_at: NativeDate;
|
|
155
137
|
issued_local_hour: string;
|
|
156
138
|
received_at_issue: number;
|
|
157
139
|
received_amount: number;
|
|
158
|
-
settled_at: NativeDate;
|
|
159
|
-
settled_local_date: string;
|
|
160
140
|
credit_note: string;
|
|
161
141
|
}>;
|
|
162
142
|
received: import("mongoose").Types.DocumentArray<{
|
|
@@ -197,6 +177,9 @@ export declare const MaterializedTenantCreditBillsReportSchema: Schema<any, impo
|
|
|
197
177
|
schema_version: number;
|
|
198
178
|
source_watermark: NativeDate;
|
|
199
179
|
computed_at: NativeDate;
|
|
180
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
181
|
+
scope_field: string;
|
|
182
|
+
sale_type_key_filters: string[];
|
|
200
183
|
source_input_signature?: string | null | undefined;
|
|
201
184
|
}>> & import("mongoose").FlatRecord<{
|
|
202
185
|
createdAt: NativeDate;
|
|
@@ -209,42 +192,39 @@ export declare const MaterializedTenantCreditBillsReportSchema: Schema<any, impo
|
|
|
209
192
|
tenant_id: string;
|
|
210
193
|
day_index: import("../../constants/ENUMS").DAY_INDEX_ENUM | null;
|
|
211
194
|
iteration: number;
|
|
212
|
-
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
213
|
-
scope_field: string;
|
|
214
|
-
sale_type_key_filters: string[];
|
|
215
195
|
credit_bills: Map<string, {
|
|
216
196
|
issued: import("mongoose").Types.DocumentArray<{
|
|
217
197
|
payment_id: string;
|
|
218
198
|
order_id: string;
|
|
219
199
|
amount: number;
|
|
200
|
+
settled_at: NativeDate;
|
|
201
|
+
settled_local_date: string;
|
|
220
202
|
issued_at: NativeDate;
|
|
221
203
|
issued_local_hour: string;
|
|
222
204
|
received_at_issue: number;
|
|
223
205
|
received_amount: number;
|
|
224
|
-
settled_at: NativeDate;
|
|
225
|
-
settled_local_date: string;
|
|
226
206
|
credit_note: string;
|
|
227
207
|
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
228
208
|
payment_id: string;
|
|
229
209
|
order_id: string;
|
|
230
210
|
amount: number;
|
|
211
|
+
settled_at: NativeDate;
|
|
212
|
+
settled_local_date: string;
|
|
231
213
|
issued_at: NativeDate;
|
|
232
214
|
issued_local_hour: string;
|
|
233
215
|
received_at_issue: number;
|
|
234
216
|
received_amount: number;
|
|
235
|
-
settled_at: NativeDate;
|
|
236
|
-
settled_local_date: string;
|
|
237
217
|
credit_note: string;
|
|
238
218
|
}> & {
|
|
239
219
|
payment_id: string;
|
|
240
220
|
order_id: string;
|
|
241
221
|
amount: number;
|
|
222
|
+
settled_at: NativeDate;
|
|
223
|
+
settled_local_date: string;
|
|
242
224
|
issued_at: NativeDate;
|
|
243
225
|
issued_local_hour: string;
|
|
244
226
|
received_at_issue: number;
|
|
245
227
|
received_amount: number;
|
|
246
|
-
settled_at: NativeDate;
|
|
247
|
-
settled_local_date: string;
|
|
248
228
|
credit_note: string;
|
|
249
229
|
}>;
|
|
250
230
|
received: import("mongoose").Types.DocumentArray<{
|
|
@@ -285,6 +265,9 @@ export declare const MaterializedTenantCreditBillsReportSchema: Schema<any, impo
|
|
|
285
265
|
schema_version: number;
|
|
286
266
|
source_watermark: NativeDate;
|
|
287
267
|
computed_at: NativeDate;
|
|
268
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
269
|
+
scope_field: string;
|
|
270
|
+
sale_type_key_filters: string[];
|
|
288
271
|
source_input_signature?: string | null | undefined;
|
|
289
272
|
}> & Required<{
|
|
290
273
|
_id: import("mongoose").Types.ObjectId;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MATERIALIZED_TENANT_CREDIT_BILLS_INDEX_OPTIONS = exports.MATERIALIZED_TENANT_CREDIT_BILLS_COLLECTION_INDEXES = exports.MATERIALIZED_TENANT_CREDIT_BILLS_COLLECTION_NAME = exports.MaterializedTenantCreditBillsReportSchema = exports.MATERIALIZED_CREDIT_BILLS_SCHEMA_VERSION = void 0;
|
|
4
|
+
const MATERIALIZED_SCHEMA_VERSIONS_1 = require("../../constants/MATERIALIZED_SCHEMA_VERSIONS");
|
|
5
|
+
Object.defineProperty(exports, "MATERIALIZED_CREDIT_BILLS_SCHEMA_VERSION", { enumerable: true, get: function () { return MATERIALIZED_SCHEMA_VERSIONS_1.MATERIALIZED_CREDIT_BILLS_SCHEMA_VERSION; } });
|
|
4
6
|
const mongoose_1 = require("mongoose");
|
|
5
7
|
const ENUMS_1 = require("../../constants/ENUMS");
|
|
6
8
|
const MATERIALIZED_REPORTS_1 = require("../../constants/MATERIALIZED_REPORTS");
|
|
@@ -22,7 +24,6 @@ const MATERIALIZED_REPORTS_1 = require("../../constants/MATERIALIZED_REPORTS");
|
|
|
22
24
|
* documents must then be re-materialized. PRE-RELEASE: the collection has no
|
|
23
25
|
* live tenants/consumers yet, so every change so far folds into version `1`.
|
|
24
26
|
*/
|
|
25
|
-
exports.MATERIALIZED_CREDIT_BILLS_SCHEMA_VERSION = 1;
|
|
26
27
|
const CreditBillIssuedEntrySchema = new mongoose_1.Schema({
|
|
27
28
|
order_id: {
|
|
28
29
|
type: String,
|
|
@@ -198,7 +199,7 @@ exports.MaterializedTenantCreditBillsReportSchema = new mongoose_1.Schema({
|
|
|
198
199
|
type: Number,
|
|
199
200
|
required: true,
|
|
200
201
|
immutable: true,
|
|
201
|
-
default:
|
|
202
|
+
default: MATERIALIZED_SCHEMA_VERSIONS_1.MATERIALIZED_CREDIT_BILLS_SCHEMA_VERSION,
|
|
202
203
|
},
|
|
203
204
|
source_watermark: {
|
|
204
205
|
type: mongoose_1.Schema.Types.Date,
|
|
@@ -106,12 +106,12 @@ export declare const MaterializedTenantCashEntriesSchema: Schema<any, import("mo
|
|
|
106
106
|
tenant_id: string;
|
|
107
107
|
day_index: import("../../constants/ENUMS").DAY_INDEX_ENUM | null;
|
|
108
108
|
iteration: number;
|
|
109
|
-
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
110
|
-
scope_field: string;
|
|
111
|
-
sale_type_key_filters: string[];
|
|
112
109
|
schema_version: number;
|
|
113
110
|
source_watermark: NativeDate;
|
|
114
111
|
computed_at: NativeDate;
|
|
112
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
113
|
+
scope_field: string;
|
|
114
|
+
sale_type_key_filters: string[];
|
|
115
115
|
cash_entries: any;
|
|
116
116
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
117
117
|
createdAt: NativeDate;
|
|
@@ -123,12 +123,12 @@ export declare const MaterializedTenantCashEntriesSchema: Schema<any, import("mo
|
|
|
123
123
|
tenant_id: string;
|
|
124
124
|
day_index: import("../../constants/ENUMS").DAY_INDEX_ENUM | null;
|
|
125
125
|
iteration: number;
|
|
126
|
-
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
127
|
-
scope_field: string;
|
|
128
|
-
sale_type_key_filters: string[];
|
|
129
126
|
schema_version: number;
|
|
130
127
|
source_watermark: NativeDate;
|
|
131
128
|
computed_at: NativeDate;
|
|
129
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
130
|
+
scope_field: string;
|
|
131
|
+
sale_type_key_filters: string[];
|
|
132
132
|
cash_entries: any;
|
|
133
133
|
}>> & import("mongoose").FlatRecord<{
|
|
134
134
|
createdAt: NativeDate;
|
|
@@ -140,12 +140,12 @@ export declare const MaterializedTenantCashEntriesSchema: Schema<any, import("mo
|
|
|
140
140
|
tenant_id: string;
|
|
141
141
|
day_index: import("../../constants/ENUMS").DAY_INDEX_ENUM | null;
|
|
142
142
|
iteration: number;
|
|
143
|
-
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
144
|
-
scope_field: string;
|
|
145
|
-
sale_type_key_filters: string[];
|
|
146
143
|
schema_version: number;
|
|
147
144
|
source_watermark: NativeDate;
|
|
148
145
|
computed_at: NativeDate;
|
|
146
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
147
|
+
scope_field: string;
|
|
148
|
+
sale_type_key_filters: string[];
|
|
149
149
|
cash_entries: any;
|
|
150
150
|
}> & {
|
|
151
151
|
_id: import("mongoose").Types.ObjectId;
|
|
@@ -33,12 +33,12 @@ export declare const MaterializedTenantCashReportSchema: Schema<any, import("mon
|
|
|
33
33
|
tenant_id: string;
|
|
34
34
|
day_index: import("../../constants/ENUMS").DAY_INDEX_ENUM | null;
|
|
35
35
|
iteration: number;
|
|
36
|
-
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
37
|
-
scope_field: string;
|
|
38
|
-
sale_type_key_filters: string[];
|
|
39
36
|
schema_version: number;
|
|
40
37
|
source_watermark: NativeDate;
|
|
41
38
|
computed_at: NativeDate;
|
|
39
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
40
|
+
scope_field: string;
|
|
41
|
+
sale_type_key_filters: string[];
|
|
42
42
|
cash_counters: any;
|
|
43
43
|
cash_counter_rows: any;
|
|
44
44
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
@@ -51,12 +51,12 @@ export declare const MaterializedTenantCashReportSchema: Schema<any, import("mon
|
|
|
51
51
|
tenant_id: string;
|
|
52
52
|
day_index: import("../../constants/ENUMS").DAY_INDEX_ENUM | null;
|
|
53
53
|
iteration: number;
|
|
54
|
-
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
55
|
-
scope_field: string;
|
|
56
|
-
sale_type_key_filters: string[];
|
|
57
54
|
schema_version: number;
|
|
58
55
|
source_watermark: NativeDate;
|
|
59
56
|
computed_at: NativeDate;
|
|
57
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
58
|
+
scope_field: string;
|
|
59
|
+
sale_type_key_filters: string[];
|
|
60
60
|
cash_counters: any;
|
|
61
61
|
cash_counter_rows: any;
|
|
62
62
|
}>> & import("mongoose").FlatRecord<{
|
|
@@ -69,12 +69,12 @@ export declare const MaterializedTenantCashReportSchema: Schema<any, import("mon
|
|
|
69
69
|
tenant_id: string;
|
|
70
70
|
day_index: import("../../constants/ENUMS").DAY_INDEX_ENUM | null;
|
|
71
71
|
iteration: number;
|
|
72
|
-
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
73
|
-
scope_field: string;
|
|
74
|
-
sale_type_key_filters: string[];
|
|
75
72
|
schema_version: number;
|
|
76
73
|
source_watermark: NativeDate;
|
|
77
74
|
computed_at: NativeDate;
|
|
75
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
76
|
+
scope_field: string;
|
|
77
|
+
sale_type_key_filters: string[];
|
|
78
78
|
cash_counters: any;
|
|
79
79
|
cash_counter_rows: any;
|
|
80
80
|
}> & {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { MATERIALIZED_TENANT_DELIVERY_ENTRIES_SCHEMA_VERSION } from '../../constants/MATERIALIZED_SCHEMA_VERSIONS';
|
|
2
|
+
export { MATERIALIZED_TENANT_DELIVERY_ENTRIES_SCHEMA_VERSION };
|
|
1
3
|
import { Schema } from 'mongoose';
|
|
2
4
|
/**
|
|
3
5
|
* Mongoose schema for `materialized_tenant_delivery_entries` (M4).
|
|
@@ -17,7 +19,6 @@ import { Schema } from 'mongoose';
|
|
|
17
19
|
* pre-launch contract. Schema versioning will be reintroduced only when a
|
|
18
20
|
* future stored-shape change requires an explicit migration.
|
|
19
21
|
*/
|
|
20
|
-
export declare const MATERIALIZED_TENANT_DELIVERY_ENTRIES_SCHEMA_VERSION = 1;
|
|
21
22
|
export declare const MaterializedTenantDeliveryEntriesSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
22
23
|
timestamps: true;
|
|
23
24
|
versionKey: false;
|
|
@@ -32,12 +33,12 @@ export declare const MaterializedTenantDeliveryEntriesSchema: Schema<any, import
|
|
|
32
33
|
tenant_id: string;
|
|
33
34
|
day_index: import("../../constants/ENUMS").DAY_INDEX_ENUM | null;
|
|
34
35
|
iteration: number;
|
|
35
|
-
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
36
|
-
scope_field: string;
|
|
37
|
-
sale_type_key_filters: string[];
|
|
38
36
|
schema_version: number;
|
|
39
37
|
source_watermark: NativeDate;
|
|
40
38
|
computed_at: NativeDate;
|
|
39
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
40
|
+
scope_field: string;
|
|
41
|
+
sale_type_key_filters: string[];
|
|
41
42
|
off_app_order_count: number;
|
|
42
43
|
page: string;
|
|
43
44
|
delivery_entries?: any;
|
|
@@ -51,12 +52,12 @@ export declare const MaterializedTenantDeliveryEntriesSchema: Schema<any, import
|
|
|
51
52
|
tenant_id: string;
|
|
52
53
|
day_index: import("../../constants/ENUMS").DAY_INDEX_ENUM | null;
|
|
53
54
|
iteration: number;
|
|
54
|
-
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
55
|
-
scope_field: string;
|
|
56
|
-
sale_type_key_filters: string[];
|
|
57
55
|
schema_version: number;
|
|
58
56
|
source_watermark: NativeDate;
|
|
59
57
|
computed_at: NativeDate;
|
|
58
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
59
|
+
scope_field: string;
|
|
60
|
+
sale_type_key_filters: string[];
|
|
60
61
|
off_app_order_count: number;
|
|
61
62
|
page: string;
|
|
62
63
|
delivery_entries?: any;
|
|
@@ -70,12 +71,12 @@ export declare const MaterializedTenantDeliveryEntriesSchema: Schema<any, import
|
|
|
70
71
|
tenant_id: string;
|
|
71
72
|
day_index: import("../../constants/ENUMS").DAY_INDEX_ENUM | null;
|
|
72
73
|
iteration: number;
|
|
73
|
-
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
74
|
-
scope_field: string;
|
|
75
|
-
sale_type_key_filters: string[];
|
|
76
74
|
schema_version: number;
|
|
77
75
|
source_watermark: NativeDate;
|
|
78
76
|
computed_at: NativeDate;
|
|
77
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
78
|
+
scope_field: string;
|
|
79
|
+
sale_type_key_filters: string[];
|
|
79
80
|
off_app_order_count: number;
|
|
80
81
|
page: string;
|
|
81
82
|
delivery_entries?: any;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MATERIALIZED_TENANT_DELIVERY_ENTRIES_INDEX_OPTIONS = exports.MATERIALIZED_TENANT_DELIVERY_ENTRIES_COLLECTION_INDEXES = exports.MATERIALIZED_TENANT_DELIVERY_ENTRIES_COLLECTION_NAME = exports.MaterializedTenantDeliveryEntriesSchema = exports.MATERIALIZED_TENANT_DELIVERY_ENTRIES_SCHEMA_VERSION = void 0;
|
|
4
|
+
const MATERIALIZED_SCHEMA_VERSIONS_1 = require("../../constants/MATERIALIZED_SCHEMA_VERSIONS");
|
|
5
|
+
Object.defineProperty(exports, "MATERIALIZED_TENANT_DELIVERY_ENTRIES_SCHEMA_VERSION", { enumerable: true, get: function () { return MATERIALIZED_SCHEMA_VERSIONS_1.MATERIALIZED_TENANT_DELIVERY_ENTRIES_SCHEMA_VERSION; } });
|
|
4
6
|
const mongoose_1 = require("mongoose");
|
|
5
7
|
const ENUMS_1 = require("../../constants/ENUMS");
|
|
6
8
|
const MATERIALIZED_REPORTS_1 = require("../../constants/MATERIALIZED_REPORTS");
|
|
@@ -22,7 +24,6 @@ const MATERIALIZED_REPORTS_1 = require("../../constants/MATERIALIZED_REPORTS");
|
|
|
22
24
|
* pre-launch contract. Schema versioning will be reintroduced only when a
|
|
23
25
|
* future stored-shape change requires an explicit migration.
|
|
24
26
|
*/
|
|
25
|
-
exports.MATERIALIZED_TENANT_DELIVERY_ENTRIES_SCHEMA_VERSION = 1;
|
|
26
27
|
exports.MaterializedTenantDeliveryEntriesSchema = new mongoose_1.Schema({
|
|
27
28
|
tenant_id: { type: String, required: true },
|
|
28
29
|
brand_id: { type: String, required: true },
|
|
@@ -49,7 +50,7 @@ exports.MaterializedTenantDeliveryEntriesSchema = new mongoose_1.Schema({
|
|
|
49
50
|
type: Number,
|
|
50
51
|
required: true,
|
|
51
52
|
immutable: true,
|
|
52
|
-
default:
|
|
53
|
+
default: MATERIALIZED_SCHEMA_VERSIONS_1.MATERIALIZED_TENANT_DELIVERY_ENTRIES_SCHEMA_VERSION,
|
|
53
54
|
},
|
|
54
55
|
source_watermark: { type: mongoose_1.Schema.Types.Date, required: true },
|
|
55
56
|
computed_at: { type: mongoose_1.Schema.Types.Date, required: true },
|
|
@@ -24,11 +24,11 @@ export declare const MaterializedTenantDeliveryGeoCellSchema: Schema<any, import
|
|
|
24
24
|
tenant_id: string;
|
|
25
25
|
city: string;
|
|
26
26
|
orders: number;
|
|
27
|
-
|
|
28
|
-
scope_field: string;
|
|
27
|
+
resolution: number;
|
|
29
28
|
schema_version: number;
|
|
30
29
|
computed_at: NativeDate;
|
|
31
|
-
|
|
30
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
31
|
+
scope_field: string;
|
|
32
32
|
h3_cell: string;
|
|
33
33
|
app_orders: number;
|
|
34
34
|
delivery_records: number;
|
|
@@ -49,11 +49,11 @@ export declare const MaterializedTenantDeliveryGeoCellSchema: Schema<any, import
|
|
|
49
49
|
tenant_id: string;
|
|
50
50
|
city: string;
|
|
51
51
|
orders: number;
|
|
52
|
-
|
|
53
|
-
scope_field: string;
|
|
52
|
+
resolution: number;
|
|
54
53
|
schema_version: number;
|
|
55
54
|
computed_at: NativeDate;
|
|
56
|
-
|
|
55
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
56
|
+
scope_field: string;
|
|
57
57
|
h3_cell: string;
|
|
58
58
|
app_orders: number;
|
|
59
59
|
delivery_records: number;
|
|
@@ -74,11 +74,11 @@ export declare const MaterializedTenantDeliveryGeoCellSchema: Schema<any, import
|
|
|
74
74
|
tenant_id: string;
|
|
75
75
|
city: string;
|
|
76
76
|
orders: number;
|
|
77
|
-
|
|
78
|
-
scope_field: string;
|
|
77
|
+
resolution: number;
|
|
79
78
|
schema_version: number;
|
|
80
79
|
computed_at: NativeDate;
|
|
81
|
-
|
|
80
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
81
|
+
scope_field: string;
|
|
82
82
|
h3_cell: string;
|
|
83
83
|
app_orders: number;
|
|
84
84
|
delivery_records: number;
|
|
@@ -11,10 +11,10 @@ export declare const MaterializedTenantDeliveryGeoScopeSchema: Schema<any, impor
|
|
|
11
11
|
updatedAt: NativeDate;
|
|
12
12
|
brand_id: string;
|
|
13
13
|
tenant_id: string;
|
|
14
|
-
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
15
|
-
scope_field: string;
|
|
16
14
|
schema_version: number;
|
|
17
15
|
computed_at: NativeDate;
|
|
16
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
17
|
+
scope_field: string;
|
|
18
18
|
capped_cell_count: number;
|
|
19
19
|
capped_order_count: number;
|
|
20
20
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
@@ -25,10 +25,10 @@ export declare const MaterializedTenantDeliveryGeoScopeSchema: Schema<any, impor
|
|
|
25
25
|
updatedAt: NativeDate;
|
|
26
26
|
brand_id: string;
|
|
27
27
|
tenant_id: string;
|
|
28
|
-
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
29
|
-
scope_field: string;
|
|
30
28
|
schema_version: number;
|
|
31
29
|
computed_at: NativeDate;
|
|
30
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
31
|
+
scope_field: string;
|
|
32
32
|
capped_cell_count: number;
|
|
33
33
|
capped_order_count: number;
|
|
34
34
|
}>> & import("mongoose").FlatRecord<{
|
|
@@ -39,10 +39,10 @@ export declare const MaterializedTenantDeliveryGeoScopeSchema: Schema<any, impor
|
|
|
39
39
|
updatedAt: NativeDate;
|
|
40
40
|
brand_id: string;
|
|
41
41
|
tenant_id: string;
|
|
42
|
-
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
43
|
-
scope_field: string;
|
|
44
42
|
schema_version: number;
|
|
45
43
|
computed_at: NativeDate;
|
|
44
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
45
|
+
scope_field: string;
|
|
46
46
|
capped_cell_count: number;
|
|
47
47
|
capped_order_count: number;
|
|
48
48
|
}> & {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { MATERIALIZED_TENANT_DELIVERY_REPORTS_SCHEMA_VERSION } from '../../constants/MATERIALIZED_SCHEMA_VERSIONS';
|
|
2
|
+
export { MATERIALIZED_TENANT_DELIVERY_REPORTS_SCHEMA_VERSION };
|
|
1
3
|
import { Schema } from 'mongoose';
|
|
2
4
|
/**
|
|
3
5
|
* Mongoose schema for `materialized_tenant_delivery_reports` (M4).
|
|
@@ -15,7 +17,6 @@ import { Schema } from 'mongoose';
|
|
|
15
17
|
* rows as the refund source. Schema versioning is reset to 1 across all
|
|
16
18
|
* materialized collections for this pre-launch contract.
|
|
17
19
|
*/
|
|
18
|
-
export declare const MATERIALIZED_TENANT_DELIVERY_REPORTS_SCHEMA_VERSION = 1;
|
|
19
20
|
export declare const MaterializedTenantDeliveryReportSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
20
21
|
timestamps: true;
|
|
21
22
|
versionKey: false;
|
|
@@ -30,12 +31,12 @@ export declare const MaterializedTenantDeliveryReportSchema: Schema<any, import(
|
|
|
30
31
|
tenant_id: string;
|
|
31
32
|
day_index: import("../../constants/ENUMS").DAY_INDEX_ENUM | null;
|
|
32
33
|
iteration: number;
|
|
33
|
-
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
34
|
-
scope_field: string;
|
|
35
|
-
sale_type_key_filters: string[];
|
|
36
34
|
schema_version: number;
|
|
37
35
|
source_watermark: NativeDate;
|
|
38
36
|
computed_at: NativeDate;
|
|
37
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
38
|
+
scope_field: string;
|
|
39
|
+
sale_type_key_filters: string[];
|
|
39
40
|
delivery_counters: any;
|
|
40
41
|
delivery_counter_rows: any;
|
|
41
42
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
@@ -48,12 +49,12 @@ export declare const MaterializedTenantDeliveryReportSchema: Schema<any, import(
|
|
|
48
49
|
tenant_id: string;
|
|
49
50
|
day_index: import("../../constants/ENUMS").DAY_INDEX_ENUM | null;
|
|
50
51
|
iteration: number;
|
|
51
|
-
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
52
|
-
scope_field: string;
|
|
53
|
-
sale_type_key_filters: string[];
|
|
54
52
|
schema_version: number;
|
|
55
53
|
source_watermark: NativeDate;
|
|
56
54
|
computed_at: NativeDate;
|
|
55
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
56
|
+
scope_field: string;
|
|
57
|
+
sale_type_key_filters: string[];
|
|
57
58
|
delivery_counters: any;
|
|
58
59
|
delivery_counter_rows: any;
|
|
59
60
|
}>> & import("mongoose").FlatRecord<{
|
|
@@ -66,12 +67,12 @@ export declare const MaterializedTenantDeliveryReportSchema: Schema<any, import(
|
|
|
66
67
|
tenant_id: string;
|
|
67
68
|
day_index: import("../../constants/ENUMS").DAY_INDEX_ENUM | null;
|
|
68
69
|
iteration: number;
|
|
69
|
-
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
70
|
-
scope_field: string;
|
|
71
|
-
sale_type_key_filters: string[];
|
|
72
70
|
schema_version: number;
|
|
73
71
|
source_watermark: NativeDate;
|
|
74
72
|
computed_at: NativeDate;
|
|
73
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
74
|
+
scope_field: string;
|
|
75
|
+
sale_type_key_filters: string[];
|
|
75
76
|
delivery_counters: any;
|
|
76
77
|
delivery_counter_rows: any;
|
|
77
78
|
}> & {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MATERIALIZED_TENANT_DELIVERY_REPORTS_INDEX_OPTIONS = exports.MATERIALIZED_TENANT_DELIVERY_REPORTS_COLLECTION_INDEXES = exports.MATERIALIZED_TENANT_DELIVERY_REPORTS_COLLECTION_NAME = exports.MaterializedTenantDeliveryReportSchema = exports.MATERIALIZED_TENANT_DELIVERY_REPORTS_SCHEMA_VERSION = void 0;
|
|
4
|
+
const MATERIALIZED_SCHEMA_VERSIONS_1 = require("../../constants/MATERIALIZED_SCHEMA_VERSIONS");
|
|
5
|
+
Object.defineProperty(exports, "MATERIALIZED_TENANT_DELIVERY_REPORTS_SCHEMA_VERSION", { enumerable: true, get: function () { return MATERIALIZED_SCHEMA_VERSIONS_1.MATERIALIZED_TENANT_DELIVERY_REPORTS_SCHEMA_VERSION; } });
|
|
4
6
|
const mongoose_1 = require("mongoose");
|
|
5
7
|
const ENUMS_1 = require("../../constants/ENUMS");
|
|
6
8
|
const MATERIALIZED_REPORTS_1 = require("../../constants/MATERIALIZED_REPORTS");
|
|
@@ -20,7 +22,6 @@ const MATERIALIZED_REPORTS_1 = require("../../constants/MATERIALIZED_REPORTS");
|
|
|
20
22
|
* rows as the refund source. Schema versioning is reset to 1 across all
|
|
21
23
|
* materialized collections for this pre-launch contract.
|
|
22
24
|
*/
|
|
23
|
-
exports.MATERIALIZED_TENANT_DELIVERY_REPORTS_SCHEMA_VERSION = 1;
|
|
24
25
|
exports.MaterializedTenantDeliveryReportSchema = new mongoose_1.Schema({
|
|
25
26
|
tenant_id: { type: String, required: true },
|
|
26
27
|
brand_id: { type: String, required: true },
|
|
@@ -45,7 +46,7 @@ exports.MaterializedTenantDeliveryReportSchema = new mongoose_1.Schema({
|
|
|
45
46
|
type: Number,
|
|
46
47
|
required: true,
|
|
47
48
|
immutable: true,
|
|
48
|
-
default:
|
|
49
|
+
default: MATERIALIZED_SCHEMA_VERSIONS_1.MATERIALIZED_TENANT_DELIVERY_REPORTS_SCHEMA_VERSION,
|
|
49
50
|
},
|
|
50
51
|
source_watermark: { type: mongoose_1.Schema.Types.Date, required: true },
|
|
51
52
|
computed_at: { type: mongoose_1.Schema.Types.Date, required: true },
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { MATERIALIZED_TENANT_DIALER_ENTRIES_SCHEMA_VERSION } from '../../constants/MATERIALIZED_SCHEMA_VERSIONS';
|
|
2
|
+
export { MATERIALIZED_TENANT_DIALER_ENTRIES_SCHEMA_VERSION };
|
|
1
3
|
import { Schema } from 'mongoose';
|
|
2
4
|
/**
|
|
3
5
|
* Mongoose schema for `materialized_tenant_dialer_entries`.
|
|
@@ -11,7 +13,6 @@ import { Schema } from 'mongoose';
|
|
|
11
13
|
* sections whose keys are the report's `<ACTION>:<POS_ID>:<STAFF_ID>` grammar.
|
|
12
14
|
*/
|
|
13
15
|
/** Document shape version. Bump with a migration for already-stored pages. */
|
|
14
|
-
export declare const MATERIALIZED_TENANT_DIALER_ENTRIES_SCHEMA_VERSION = 1;
|
|
15
16
|
export declare const MaterializedTenantDialerEntriesSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
16
17
|
timestamps: true;
|
|
17
18
|
versionKey: false;
|
|
@@ -26,11 +27,11 @@ export declare const MaterializedTenantDialerEntriesSchema: Schema<any, import("
|
|
|
26
27
|
tenant_id: string;
|
|
27
28
|
day_index: import("../../constants/ENUMS").DAY_INDEX_ENUM | null;
|
|
28
29
|
iteration: number;
|
|
29
|
-
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
30
|
-
scope_field: string;
|
|
31
30
|
schema_version: number;
|
|
32
31
|
source_watermark: NativeDate;
|
|
33
32
|
computed_at: NativeDate;
|
|
33
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
34
|
+
scope_field: string;
|
|
34
35
|
page: string;
|
|
35
36
|
dialer_entries?: any;
|
|
36
37
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
@@ -43,11 +44,11 @@ export declare const MaterializedTenantDialerEntriesSchema: Schema<any, import("
|
|
|
43
44
|
tenant_id: string;
|
|
44
45
|
day_index: import("../../constants/ENUMS").DAY_INDEX_ENUM | null;
|
|
45
46
|
iteration: number;
|
|
46
|
-
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
47
|
-
scope_field: string;
|
|
48
47
|
schema_version: number;
|
|
49
48
|
source_watermark: NativeDate;
|
|
50
49
|
computed_at: NativeDate;
|
|
50
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
51
|
+
scope_field: string;
|
|
51
52
|
page: string;
|
|
52
53
|
dialer_entries?: any;
|
|
53
54
|
}>> & import("mongoose").FlatRecord<{
|
|
@@ -60,11 +61,11 @@ export declare const MaterializedTenantDialerEntriesSchema: Schema<any, import("
|
|
|
60
61
|
tenant_id: string;
|
|
61
62
|
day_index: import("../../constants/ENUMS").DAY_INDEX_ENUM | null;
|
|
62
63
|
iteration: number;
|
|
63
|
-
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
64
|
-
scope_field: string;
|
|
65
64
|
schema_version: number;
|
|
66
65
|
source_watermark: NativeDate;
|
|
67
66
|
computed_at: NativeDate;
|
|
67
|
+
scope_context: import("../../constants/MATERIALIZED_REPORTS").MATERIALIZED_REPORT_SCOPE_ENUM;
|
|
68
|
+
scope_field: string;
|
|
68
69
|
page: string;
|
|
69
70
|
dialer_entries?: any;
|
|
70
71
|
}> & {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MATERIALIZED_TENANT_DIALER_ENTRIES_INDEX_OPTIONS = exports.MATERIALIZED_TENANT_DIALER_ENTRIES_COLLECTION_INDEXES = exports.MATERIALIZED_TENANT_DIALER_ENTRIES_COLLECTION_NAME = exports.MaterializedTenantDialerEntriesSchema = exports.MATERIALIZED_TENANT_DIALER_ENTRIES_SCHEMA_VERSION = void 0;
|
|
4
|
+
const MATERIALIZED_SCHEMA_VERSIONS_1 = require("../../constants/MATERIALIZED_SCHEMA_VERSIONS");
|
|
5
|
+
Object.defineProperty(exports, "MATERIALIZED_TENANT_DIALER_ENTRIES_SCHEMA_VERSION", { enumerable: true, get: function () { return MATERIALIZED_SCHEMA_VERSIONS_1.MATERIALIZED_TENANT_DIALER_ENTRIES_SCHEMA_VERSION; } });
|
|
4
6
|
const mongoose_1 = require("mongoose");
|
|
5
7
|
const ENUMS_1 = require("../../constants/ENUMS");
|
|
6
8
|
const MATERIALIZED_REPORTS_1 = require("../../constants/MATERIALIZED_REPORTS");
|
|
@@ -16,7 +18,6 @@ const MATERIALIZED_REPORTS_1 = require("../../constants/MATERIALIZED_REPORTS");
|
|
|
16
18
|
* sections whose keys are the report's `<ACTION>:<POS_ID>:<STAFF_ID>` grammar.
|
|
17
19
|
*/
|
|
18
20
|
/** Document shape version. Bump with a migration for already-stored pages. */
|
|
19
|
-
exports.MATERIALIZED_TENANT_DIALER_ENTRIES_SCHEMA_VERSION = 1;
|
|
20
21
|
exports.MaterializedTenantDialerEntriesSchema = new mongoose_1.Schema({
|
|
21
22
|
tenant_id: { type: String, required: true },
|
|
22
23
|
brand_id: { type: String, required: true },
|
|
@@ -31,7 +32,7 @@ exports.MaterializedTenantDialerEntriesSchema = new mongoose_1.Schema({
|
|
|
31
32
|
type: Number,
|
|
32
33
|
required: true,
|
|
33
34
|
immutable: true,
|
|
34
|
-
default:
|
|
35
|
+
default: MATERIALIZED_SCHEMA_VERSIONS_1.MATERIALIZED_TENANT_DIALER_ENTRIES_SCHEMA_VERSION,
|
|
35
36
|
},
|
|
36
37
|
source_watermark: { type: mongoose_1.Schema.Types.Date, required: true },
|
|
37
38
|
computed_at: { type: mongoose_1.Schema.Types.Date, required: true },
|