@managesome/eposmatic-toolkit 0.2.579 → 0.2.581
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/lib/schemas/models/tenant_cash_drawer_sessions.d.ts +36 -0
- package/lib/schemas/models/tenant_cash_drawer_sessions.js +21 -1
- package/lib/schemas/models/tenant_cash_drawers.d.ts +14 -0
- package/lib/schemas/models/tenant_cash_drawers.js +13 -1
- package/lib/schemas/models/tenant_cash_in_out.d.ts +30 -0
- package/lib/schemas/models/tenant_cash_in_out.js +18 -1
- package/lib/schemas/models/tenant_day_sessions.d.ts +27 -0
- package/lib/schemas/models/tenant_day_sessions.js +17 -1
- package/lib/schemas/models/tenant_instore_shift_sessions.d.ts +30 -0
- package/lib/schemas/models/tenant_instore_shift_sessions.js +19 -1
- package/lib/schemas/models/tenant_instore_shifts.d.ts +16 -0
- package/lib/schemas/models/tenant_instore_shifts.js +12 -1
- package/package.json +1 -1
|
@@ -393,3 +393,39 @@ export declare const TenantCashDrawerSessionsSchema: Schema<any, import("mongoos
|
|
|
393
393
|
__v: number;
|
|
394
394
|
}>;
|
|
395
395
|
export declare const TENANT_CASH_DRAWER_SESSIONS_COLLECTION_NAME = "tenant_cash_drawer_sessions";
|
|
396
|
+
/**
|
|
397
|
+
* Describes the indexes for `tenant_cash_drawer_sessions`. Values are Mongo key
|
|
398
|
+
* patterns that can be passed straight to `.hint()`.
|
|
399
|
+
* - `_id`: unique primary key.
|
|
400
|
+
* - `tenant_id__localDate`: running drawer sessions per local date.
|
|
401
|
+
* - `tenant_id__drawer_id__day_id`: UNIQUE per (tenant_id, drawer_id, day_id) —
|
|
402
|
+
* one session per drawer per day.
|
|
403
|
+
* - `tenant_id__drawer_id__status`: PARTIAL index — create with
|
|
404
|
+
* `partialFilterExpression: { status: 'IN_USE' }` (only IN_USE drawer sessions
|
|
405
|
+
* are indexed; every query using this hint filters status: IN_USE). Not unique
|
|
406
|
+
* (uniqueness is enforced at the day level above).
|
|
407
|
+
* - `tenant_id__day_id`: drawer sessions per business day.
|
|
408
|
+
*/
|
|
409
|
+
export declare const TENANT_CASH_DRAWER_SESSIONS_COLLECTION_INDEXES: {
|
|
410
|
+
_id: {
|
|
411
|
+
_id: number;
|
|
412
|
+
};
|
|
413
|
+
tenant_id__localDate: {
|
|
414
|
+
tenant_id: number;
|
|
415
|
+
localDate: number;
|
|
416
|
+
};
|
|
417
|
+
tenant_id__drawer_id__day_id: {
|
|
418
|
+
tenant_id: number;
|
|
419
|
+
drawer_id: number;
|
|
420
|
+
day_id: number;
|
|
421
|
+
};
|
|
422
|
+
tenant_id__drawer_id__status: {
|
|
423
|
+
tenant_id: number;
|
|
424
|
+
drawer_id: number;
|
|
425
|
+
status: number;
|
|
426
|
+
};
|
|
427
|
+
tenant_id__day_id: {
|
|
428
|
+
tenant_id: number;
|
|
429
|
+
day_id: number;
|
|
430
|
+
};
|
|
431
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TENANT_CASH_DRAWER_SESSIONS_COLLECTION_NAME = exports.TenantCashDrawerSessionsSchema = void 0;
|
|
3
|
+
exports.TENANT_CASH_DRAWER_SESSIONS_COLLECTION_INDEXES = exports.TENANT_CASH_DRAWER_SESSIONS_COLLECTION_NAME = exports.TenantCashDrawerSessionsSchema = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
const constants_1 = require("../../constants");
|
|
6
6
|
const common_models_1 = require("./common-models");
|
|
@@ -176,3 +176,23 @@ exports.TenantCashDrawerSessionsSchema = new mongoose_1.Schema({
|
|
|
176
176
|
minimize: false,
|
|
177
177
|
});
|
|
178
178
|
exports.TENANT_CASH_DRAWER_SESSIONS_COLLECTION_NAME = 'tenant_cash_drawer_sessions';
|
|
179
|
+
/**
|
|
180
|
+
* Describes the indexes for `tenant_cash_drawer_sessions`. Values are Mongo key
|
|
181
|
+
* patterns that can be passed straight to `.hint()`.
|
|
182
|
+
* - `_id`: unique primary key.
|
|
183
|
+
* - `tenant_id__localDate`: running drawer sessions per local date.
|
|
184
|
+
* - `tenant_id__drawer_id__day_id`: UNIQUE per (tenant_id, drawer_id, day_id) —
|
|
185
|
+
* one session per drawer per day.
|
|
186
|
+
* - `tenant_id__drawer_id__status`: PARTIAL index — create with
|
|
187
|
+
* `partialFilterExpression: { status: 'IN_USE' }` (only IN_USE drawer sessions
|
|
188
|
+
* are indexed; every query using this hint filters status: IN_USE). Not unique
|
|
189
|
+
* (uniqueness is enforced at the day level above).
|
|
190
|
+
* - `tenant_id__day_id`: drawer sessions per business day.
|
|
191
|
+
*/
|
|
192
|
+
exports.TENANT_CASH_DRAWER_SESSIONS_COLLECTION_INDEXES = {
|
|
193
|
+
_id: { _id: 1 }, // Unique Index
|
|
194
|
+
tenant_id__localDate: { tenant_id: 1, localDate: 1 }, // running drawer sessions per local date
|
|
195
|
+
tenant_id__drawer_id__day_id: { tenant_id: 1, drawer_id: 1, day_id: 1 }, // UNIQUE per (tenant, drawer, day)
|
|
196
|
+
tenant_id__drawer_id__status: { tenant_id: 1, drawer_id: 1, status: 1 }, // partial index (partialFilterExpression: { status: 'IN_USE' }) — open drawer lookup (not unique)
|
|
197
|
+
tenant_id__day_id: { tenant_id: 1, day_id: 1 }, // drawer sessions per business day
|
|
198
|
+
};
|
|
@@ -42,3 +42,17 @@ export declare const TenantCashDrawerSchema: Schema<any, import("mongoose").Mode
|
|
|
42
42
|
__v: number;
|
|
43
43
|
}>;
|
|
44
44
|
export declare const TENANT_CASH_DRAWERS_COLLECTION_NAME = "tenant_cash_drawers";
|
|
45
|
+
/**
|
|
46
|
+
* Describes the indexes for `tenant_cash_drawers`. Values are Mongo key patterns
|
|
47
|
+
* that can be passed straight to `.hint()`.
|
|
48
|
+
* - `_id`: unique primary key.
|
|
49
|
+
* - `tenant_id`: per-tenant lookup (`getCashDrawers` / `deleteCashDrawer` scoping).
|
|
50
|
+
*/
|
|
51
|
+
export declare const TENANT_CASH_DRAWERS_COLLECTION_INDEXES: {
|
|
52
|
+
_id: {
|
|
53
|
+
_id: number;
|
|
54
|
+
};
|
|
55
|
+
tenant_id: {
|
|
56
|
+
tenant_id: number;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TENANT_CASH_DRAWERS_COLLECTION_NAME = exports.TenantCashDrawerSchema = void 0;
|
|
3
|
+
exports.TENANT_CASH_DRAWERS_COLLECTION_INDEXES = exports.TENANT_CASH_DRAWERS_COLLECTION_NAME = exports.TenantCashDrawerSchema = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
exports.TenantCashDrawerSchema = new mongoose_1.Schema({
|
|
6
6
|
_id: {
|
|
@@ -44,3 +44,15 @@ exports.TenantCashDrawerSchema = new mongoose_1.Schema({
|
|
|
44
44
|
minimize: false,
|
|
45
45
|
});
|
|
46
46
|
exports.TENANT_CASH_DRAWERS_COLLECTION_NAME = 'tenant_cash_drawers';
|
|
47
|
+
/**
|
|
48
|
+
* Describes the indexes for `tenant_cash_drawers`. Values are Mongo key patterns
|
|
49
|
+
* that can be passed straight to `.hint()`.
|
|
50
|
+
* - `_id`: unique primary key.
|
|
51
|
+
* - `tenant_id`: per-tenant lookup (`getCashDrawers` / `deleteCashDrawer` scoping).
|
|
52
|
+
*/
|
|
53
|
+
exports.TENANT_CASH_DRAWERS_COLLECTION_INDEXES = {
|
|
54
|
+
_id: { _id: 1 }, // Unique Index
|
|
55
|
+
tenant_id: {
|
|
56
|
+
tenant_id: 1,
|
|
57
|
+
}, // compound index
|
|
58
|
+
};
|
|
@@ -114,3 +114,33 @@ export declare const TenantCashInOutSchema: Schema<any, import("mongoose").Model
|
|
|
114
114
|
__v: number;
|
|
115
115
|
}>;
|
|
116
116
|
export declare const TENANT_CASH_IN_OUT_COLLECTION_NAME = "tenant_cash_in_out";
|
|
117
|
+
/**
|
|
118
|
+
* Describes the indexes for `tenant_cash_in_out`. Values are Mongo key patterns
|
|
119
|
+
* that can be passed straight to `.hint()`.
|
|
120
|
+
* - `_id`: unique primary key.
|
|
121
|
+
* - `tenant_id__localDate`: running movements per local date.
|
|
122
|
+
* - `tenant_id__drawer_id__createdAt`: running balance per drawer session
|
|
123
|
+
* lifetime (createdAt range + desc sort).
|
|
124
|
+
* - `tenant_id__day_id__shift_id`: movements per business day / shift (scoped by
|
|
125
|
+
* the shift template id); also covers (tenant_id, day_id) lookups via the
|
|
126
|
+
* leftmost-prefix rule.
|
|
127
|
+
*/
|
|
128
|
+
export declare const TENANT_CASH_IN_OUT_COLLECTION_INDEXES: {
|
|
129
|
+
_id: {
|
|
130
|
+
_id: number;
|
|
131
|
+
};
|
|
132
|
+
tenant_id__localDate: {
|
|
133
|
+
tenant_id: number;
|
|
134
|
+
localDate: number;
|
|
135
|
+
};
|
|
136
|
+
tenant_id__drawer_id__createdAt: {
|
|
137
|
+
tenant_id: number;
|
|
138
|
+
drawer_id: number;
|
|
139
|
+
createdAt: number;
|
|
140
|
+
};
|
|
141
|
+
tenant_id__day_id__shift_id: {
|
|
142
|
+
tenant_id: number;
|
|
143
|
+
day_id: number;
|
|
144
|
+
shift_id: number;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TENANT_CASH_IN_OUT_COLLECTION_NAME = exports.TenantCashInOutSchema = void 0;
|
|
3
|
+
exports.TENANT_CASH_IN_OUT_COLLECTION_INDEXES = exports.TENANT_CASH_IN_OUT_COLLECTION_NAME = exports.TenantCashInOutSchema = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
const constants_1 = require("../../constants");
|
|
6
6
|
const common_models_1 = require("./common-models");
|
|
@@ -88,3 +88,20 @@ exports.TenantCashInOutSchema = new mongoose_1.Schema({
|
|
|
88
88
|
minimize: false,
|
|
89
89
|
});
|
|
90
90
|
exports.TENANT_CASH_IN_OUT_COLLECTION_NAME = 'tenant_cash_in_out';
|
|
91
|
+
/**
|
|
92
|
+
* Describes the indexes for `tenant_cash_in_out`. Values are Mongo key patterns
|
|
93
|
+
* that can be passed straight to `.hint()`.
|
|
94
|
+
* - `_id`: unique primary key.
|
|
95
|
+
* - `tenant_id__localDate`: running movements per local date.
|
|
96
|
+
* - `tenant_id__drawer_id__createdAt`: running balance per drawer session
|
|
97
|
+
* lifetime (createdAt range + desc sort).
|
|
98
|
+
* - `tenant_id__day_id__shift_id`: movements per business day / shift (scoped by
|
|
99
|
+
* the shift template id); also covers (tenant_id, day_id) lookups via the
|
|
100
|
+
* leftmost-prefix rule.
|
|
101
|
+
*/
|
|
102
|
+
exports.TENANT_CASH_IN_OUT_COLLECTION_INDEXES = {
|
|
103
|
+
_id: { _id: 1 }, // Unique Index
|
|
104
|
+
tenant_id__localDate: { tenant_id: 1, localDate: 1 }, // running movements per local date
|
|
105
|
+
tenant_id__drawer_id__createdAt: { tenant_id: 1, drawer_id: 1, createdAt: -1 }, // running balance per drawer session lifetime
|
|
106
|
+
tenant_id__day_id__shift_id: { tenant_id: 1, day_id: 1, shift_id: 1 }, // movements per day / shift (by shift template id)
|
|
107
|
+
};
|
|
@@ -327,3 +327,30 @@ export declare const TenantDaySessionSchema: Schema<any, import("mongoose").Mode
|
|
|
327
327
|
__v: number;
|
|
328
328
|
}>;
|
|
329
329
|
export declare const TENANT_DAY_SESSIONS_COLLECTION_NAME = "tenant_day_sessions";
|
|
330
|
+
/**
|
|
331
|
+
* Describes the indexes for `tenant_day_sessions`. Values are Mongo key patterns
|
|
332
|
+
* that can be passed straight to `.hint()`.
|
|
333
|
+
* - `_id`: unique primary key.
|
|
334
|
+
* - `tenant_id__localDate`: unique per (tenant_id, localDate) — running-day lookups.
|
|
335
|
+
* - `tenant_id__status`: PARTIAL index — create with
|
|
336
|
+
* `partialFilterExpression: { status: 'OPEN' }` (only OPEN day sessions are
|
|
337
|
+
* indexed; every query using this hint filters status: OPEN).
|
|
338
|
+
* - `tenant_id__createdAt`: most recent day per tenant (sorted createdAt desc).
|
|
339
|
+
*/
|
|
340
|
+
export declare const TENANT_DAY_SESSIONS_COLLECTION_INDEXES: {
|
|
341
|
+
_id: {
|
|
342
|
+
_id: number;
|
|
343
|
+
};
|
|
344
|
+
tenant_id__localDate: {
|
|
345
|
+
tenant_id: number;
|
|
346
|
+
localDate: number;
|
|
347
|
+
};
|
|
348
|
+
tenant_id__status: {
|
|
349
|
+
tenant_id: number;
|
|
350
|
+
status: number;
|
|
351
|
+
};
|
|
352
|
+
tenant_id__createdAt: {
|
|
353
|
+
tenant_id: number;
|
|
354
|
+
createdAt: number;
|
|
355
|
+
};
|
|
356
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TENANT_DAY_SESSIONS_COLLECTION_NAME = exports.TenantDaySessionSchema = void 0;
|
|
3
|
+
exports.TENANT_DAY_SESSIONS_COLLECTION_INDEXES = exports.TENANT_DAY_SESSIONS_COLLECTION_NAME = exports.TenantDaySessionSchema = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
const constants_1 = require("../../constants");
|
|
6
6
|
const common_models_1 = require("./common-models");
|
|
@@ -139,3 +139,19 @@ exports.TenantDaySessionSchema = new mongoose_1.Schema({
|
|
|
139
139
|
minimize: false,
|
|
140
140
|
});
|
|
141
141
|
exports.TENANT_DAY_SESSIONS_COLLECTION_NAME = 'tenant_day_sessions';
|
|
142
|
+
/**
|
|
143
|
+
* Describes the indexes for `tenant_day_sessions`. Values are Mongo key patterns
|
|
144
|
+
* that can be passed straight to `.hint()`.
|
|
145
|
+
* - `_id`: unique primary key.
|
|
146
|
+
* - `tenant_id__localDate`: unique per (tenant_id, localDate) — running-day lookups.
|
|
147
|
+
* - `tenant_id__status`: PARTIAL index — create with
|
|
148
|
+
* `partialFilterExpression: { status: 'OPEN' }` (only OPEN day sessions are
|
|
149
|
+
* indexed; every query using this hint filters status: OPEN).
|
|
150
|
+
* - `tenant_id__createdAt`: most recent day per tenant (sorted createdAt desc).
|
|
151
|
+
*/
|
|
152
|
+
exports.TENANT_DAY_SESSIONS_COLLECTION_INDEXES = {
|
|
153
|
+
_id: { _id: 1 }, // Unique Index
|
|
154
|
+
tenant_id__localDate: { tenant_id: 1, localDate: 1 }, // unique per (tenant_id, localDate)
|
|
155
|
+
tenant_id__status: { tenant_id: 1, status: 1 }, // partial index (partialFilterExpression: { status: 'OPEN' }) — open-day guard
|
|
156
|
+
tenant_id__createdAt: { tenant_id: 1, createdAt: -1 }, // most recent day per tenant
|
|
157
|
+
};
|
|
@@ -357,3 +357,33 @@ export declare const TenantInstoreShiftSessionSchema: Schema<any, import("mongoo
|
|
|
357
357
|
__v: number;
|
|
358
358
|
}>;
|
|
359
359
|
export declare const TENANT_INSTORE_SHIFT_SESSIONS_COLLECTION_NAME = "tenant_instore_shift_sessions";
|
|
360
|
+
/**
|
|
361
|
+
* Describes the indexes for `tenant_instore_shift_sessions`. Values are Mongo key
|
|
362
|
+
* patterns that can be passed straight to `.hint()`.
|
|
363
|
+
* - `_id`: unique primary key.
|
|
364
|
+
* - `tenant_id__localDate`: running shift sessions per local date.
|
|
365
|
+
* - `tenant_id__status`: PARTIAL index — create with
|
|
366
|
+
* `partialFilterExpression: { status: 'OPEN' }` (only OPEN shift sessions are
|
|
367
|
+
* indexed; every query using this hint filters status: OPEN).
|
|
368
|
+
* - `tenant_id__day_id__shift_id`: UNIQUE per (tenant_id, day_id, shift_id) —
|
|
369
|
+
* enforces one session per shift template per day and serves shift-count
|
|
370
|
+
* lookups on (tenant_id, day_id) via the leftmost-prefix rule.
|
|
371
|
+
*/
|
|
372
|
+
export declare const TENANT_INSTORE_SHIFT_SESSIONS_COLLECTION_INDEXES: {
|
|
373
|
+
_id: {
|
|
374
|
+
_id: number;
|
|
375
|
+
};
|
|
376
|
+
tenant_id__localDate: {
|
|
377
|
+
tenant_id: number;
|
|
378
|
+
localDate: number;
|
|
379
|
+
};
|
|
380
|
+
tenant_id__status: {
|
|
381
|
+
tenant_id: number;
|
|
382
|
+
status: number;
|
|
383
|
+
};
|
|
384
|
+
tenant_id__day_id__shift_id: {
|
|
385
|
+
tenant_id: number;
|
|
386
|
+
day_id: number;
|
|
387
|
+
shift_id: number;
|
|
388
|
+
};
|
|
389
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TENANT_INSTORE_SHIFT_SESSIONS_COLLECTION_NAME = exports.TenantInstoreShiftSessionSchema = void 0;
|
|
3
|
+
exports.TENANT_INSTORE_SHIFT_SESSIONS_COLLECTION_INDEXES = exports.TENANT_INSTORE_SHIFT_SESSIONS_COLLECTION_NAME = exports.TenantInstoreShiftSessionSchema = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
const constants_1 = require("../../constants");
|
|
6
6
|
const common_models_1 = require("./common-models");
|
|
@@ -174,3 +174,21 @@ exports.TenantInstoreShiftSessionSchema = new mongoose_1.Schema({
|
|
|
174
174
|
minimize: false,
|
|
175
175
|
});
|
|
176
176
|
exports.TENANT_INSTORE_SHIFT_SESSIONS_COLLECTION_NAME = 'tenant_instore_shift_sessions';
|
|
177
|
+
/**
|
|
178
|
+
* Describes the indexes for `tenant_instore_shift_sessions`. Values are Mongo key
|
|
179
|
+
* patterns that can be passed straight to `.hint()`.
|
|
180
|
+
* - `_id`: unique primary key.
|
|
181
|
+
* - `tenant_id__localDate`: running shift sessions per local date.
|
|
182
|
+
* - `tenant_id__status`: PARTIAL index — create with
|
|
183
|
+
* `partialFilterExpression: { status: 'OPEN' }` (only OPEN shift sessions are
|
|
184
|
+
* indexed; every query using this hint filters status: OPEN).
|
|
185
|
+
* - `tenant_id__day_id__shift_id`: UNIQUE per (tenant_id, day_id, shift_id) —
|
|
186
|
+
* enforces one session per shift template per day and serves shift-count
|
|
187
|
+
* lookups on (tenant_id, day_id) via the leftmost-prefix rule.
|
|
188
|
+
*/
|
|
189
|
+
exports.TENANT_INSTORE_SHIFT_SESSIONS_COLLECTION_INDEXES = {
|
|
190
|
+
_id: { _id: 1 }, // Unique Index
|
|
191
|
+
tenant_id__localDate: { tenant_id: 1, localDate: 1 }, // running shift sessions per local date
|
|
192
|
+
tenant_id__status: { tenant_id: 1, status: 1 }, // partial index (partialFilterExpression: { status: 'OPEN' }) — running-shift guard
|
|
193
|
+
tenant_id__day_id__shift_id: { tenant_id: 1, day_id: 1, shift_id: 1 }, // UNIQUE per (tenant, day, shift template)
|
|
194
|
+
};
|
|
@@ -48,3 +48,19 @@ export declare const TenantInstoreShiftSchema: Schema<any, import("mongoose").Mo
|
|
|
48
48
|
__v: number;
|
|
49
49
|
}>;
|
|
50
50
|
export declare const TENANT_INSTORE_SHIFTS_COLLECTION_NAME = "tenant_instore_shifts";
|
|
51
|
+
/**
|
|
52
|
+
* Describes the indexes for `tenant_instore_shifts`. Values are Mongo key patterns
|
|
53
|
+
* that can be passed straight to `.hint()`.
|
|
54
|
+
* - `_id`: unique primary key.
|
|
55
|
+
* - `tenants__start_time`: per-tenant lookup + sort by start_time; also covers
|
|
56
|
+
* tenants-only lookups via the leftmost-prefix rule.
|
|
57
|
+
*/
|
|
58
|
+
export declare const TENANT_INSTORE_SHIFTS_COLLECTION_INDEXES: {
|
|
59
|
+
_id: {
|
|
60
|
+
_id: number;
|
|
61
|
+
};
|
|
62
|
+
tenants__start_time: {
|
|
63
|
+
tenants: number;
|
|
64
|
+
start_time: number;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TENANT_INSTORE_SHIFTS_COLLECTION_NAME = exports.TenantInstoreShiftSchema = void 0;
|
|
3
|
+
exports.TENANT_INSTORE_SHIFTS_COLLECTION_INDEXES = exports.TENANT_INSTORE_SHIFTS_COLLECTION_NAME = exports.TenantInstoreShiftSchema = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
const constants_1 = require("../../constants");
|
|
6
6
|
exports.TenantInstoreShiftSchema = new mongoose_1.Schema({
|
|
@@ -53,3 +53,14 @@ exports.TenantInstoreShiftSchema = new mongoose_1.Schema({
|
|
|
53
53
|
minimize: false,
|
|
54
54
|
});
|
|
55
55
|
exports.TENANT_INSTORE_SHIFTS_COLLECTION_NAME = 'tenant_instore_shifts';
|
|
56
|
+
/**
|
|
57
|
+
* Describes the indexes for `tenant_instore_shifts`. Values are Mongo key patterns
|
|
58
|
+
* that can be passed straight to `.hint()`.
|
|
59
|
+
* - `_id`: unique primary key.
|
|
60
|
+
* - `tenants__start_time`: per-tenant lookup + sort by start_time; also covers
|
|
61
|
+
* tenants-only lookups via the leftmost-prefix rule.
|
|
62
|
+
*/
|
|
63
|
+
exports.TENANT_INSTORE_SHIFTS_COLLECTION_INDEXES = {
|
|
64
|
+
_id: { _id: 1 }, // Unique Index
|
|
65
|
+
tenants__start_time: { tenants: 1, start_time: 1 }, // tenant lookup (prefix) + sort by start_time
|
|
66
|
+
};
|