@managesome/eposmatic-toolkit 0.2.569 → 0.2.572
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/helpers/utils/tenant-cash-drawer-sessions-helpers.js +102 -0
- package/lib/helpers/utils/tenant-day-sessions-helpers.js +82 -0
- package/lib/helpers/utils/tenant-instore-shift-sessions-helpers.js +112 -0
- package/lib/schemas/models/tenant_cash_drawer_sessions.d.ts +207 -9
- package/lib/schemas/models/tenant_cash_drawer_sessions.js +20 -4
- package/lib/schemas/models/tenant_day_sessions.d.ts +162 -9
- package/lib/schemas/models/tenant_day_sessions.js +12 -4
- package/lib/schemas/models/tenant_instore_shift_sessions.d.ts +180 -9
- package/lib/schemas/models/tenant_instore_shift_sessions.js +32 -4
- package/lib/schemas/types/index.d.ts +1 -0
- package/lib/schemas/types/index.js +1 -0
- package/lib/schemas/types/shift_day_drawer_requests.d.ts +93 -0
- package/lib/schemas/types/shift_day_drawer_requests.js +14 -0
- package/lib/schemas/types/tenant_cash_drawer_sessions.d.ts +7 -3
- package/lib/schemas/types/tenant_day_sessions.d.ts +5 -3
- package/lib/schemas/types/tenant_instore_shift_sessions.d.ts +10 -3
- package/package.json +1 -1
|
@@ -46,15 +46,66 @@ export declare const TenantDaySessionSchema: Schema<any, import("mongoose").Mode
|
|
|
46
46
|
reopened_iterations: import("mongoose").Types.DocumentArray<{
|
|
47
47
|
staff_id: string;
|
|
48
48
|
staff_name: string;
|
|
49
|
-
|
|
49
|
+
updatedAt: NativeDate;
|
|
50
|
+
opening: {
|
|
51
|
+
staff_id: string;
|
|
52
|
+
staff_name: string;
|
|
53
|
+
note: string;
|
|
54
|
+
cash_amount: number;
|
|
55
|
+
opened_at: NativeDate;
|
|
56
|
+
};
|
|
57
|
+
closing: {
|
|
58
|
+
staff_id: string;
|
|
59
|
+
staff_name: string;
|
|
60
|
+
note: string;
|
|
61
|
+
cash_amount: number;
|
|
62
|
+
expected_cash_amount: number;
|
|
63
|
+
difference: number;
|
|
64
|
+
closed_at: NativeDate;
|
|
65
|
+
cash_in_out_id: string;
|
|
66
|
+
};
|
|
50
67
|
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
51
68
|
staff_id: string;
|
|
52
69
|
staff_name: string;
|
|
53
|
-
|
|
70
|
+
updatedAt: NativeDate;
|
|
71
|
+
opening: {
|
|
72
|
+
staff_id: string;
|
|
73
|
+
staff_name: string;
|
|
74
|
+
note: string;
|
|
75
|
+
cash_amount: number;
|
|
76
|
+
opened_at: NativeDate;
|
|
77
|
+
};
|
|
78
|
+
closing: {
|
|
79
|
+
staff_id: string;
|
|
80
|
+
staff_name: string;
|
|
81
|
+
note: string;
|
|
82
|
+
cash_amount: number;
|
|
83
|
+
expected_cash_amount: number;
|
|
84
|
+
difference: number;
|
|
85
|
+
closed_at: NativeDate;
|
|
86
|
+
cash_in_out_id: string;
|
|
87
|
+
};
|
|
54
88
|
}> & {
|
|
55
89
|
staff_id: string;
|
|
56
90
|
staff_name: string;
|
|
57
|
-
|
|
91
|
+
updatedAt: NativeDate;
|
|
92
|
+
opening: {
|
|
93
|
+
staff_id: string;
|
|
94
|
+
staff_name: string;
|
|
95
|
+
note: string;
|
|
96
|
+
cash_amount: number;
|
|
97
|
+
opened_at: NativeDate;
|
|
98
|
+
};
|
|
99
|
+
closing: {
|
|
100
|
+
staff_id: string;
|
|
101
|
+
staff_name: string;
|
|
102
|
+
note: string;
|
|
103
|
+
cash_amount: number;
|
|
104
|
+
expected_cash_amount: number;
|
|
105
|
+
difference: number;
|
|
106
|
+
closed_at: NativeDate;
|
|
107
|
+
cash_in_out_id: string;
|
|
108
|
+
};
|
|
58
109
|
}>;
|
|
59
110
|
reopened_times: number;
|
|
60
111
|
total_shifts: number;
|
|
@@ -101,15 +152,66 @@ export declare const TenantDaySessionSchema: Schema<any, import("mongoose").Mode
|
|
|
101
152
|
reopened_iterations: import("mongoose").Types.DocumentArray<{
|
|
102
153
|
staff_id: string;
|
|
103
154
|
staff_name: string;
|
|
104
|
-
|
|
155
|
+
updatedAt: NativeDate;
|
|
156
|
+
opening: {
|
|
157
|
+
staff_id: string;
|
|
158
|
+
staff_name: string;
|
|
159
|
+
note: string;
|
|
160
|
+
cash_amount: number;
|
|
161
|
+
opened_at: NativeDate;
|
|
162
|
+
};
|
|
163
|
+
closing: {
|
|
164
|
+
staff_id: string;
|
|
165
|
+
staff_name: string;
|
|
166
|
+
note: string;
|
|
167
|
+
cash_amount: number;
|
|
168
|
+
expected_cash_amount: number;
|
|
169
|
+
difference: number;
|
|
170
|
+
closed_at: NativeDate;
|
|
171
|
+
cash_in_out_id: string;
|
|
172
|
+
};
|
|
105
173
|
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
106
174
|
staff_id: string;
|
|
107
175
|
staff_name: string;
|
|
108
|
-
|
|
176
|
+
updatedAt: NativeDate;
|
|
177
|
+
opening: {
|
|
178
|
+
staff_id: string;
|
|
179
|
+
staff_name: string;
|
|
180
|
+
note: string;
|
|
181
|
+
cash_amount: number;
|
|
182
|
+
opened_at: NativeDate;
|
|
183
|
+
};
|
|
184
|
+
closing: {
|
|
185
|
+
staff_id: string;
|
|
186
|
+
staff_name: string;
|
|
187
|
+
note: string;
|
|
188
|
+
cash_amount: number;
|
|
189
|
+
expected_cash_amount: number;
|
|
190
|
+
difference: number;
|
|
191
|
+
closed_at: NativeDate;
|
|
192
|
+
cash_in_out_id: string;
|
|
193
|
+
};
|
|
109
194
|
}> & {
|
|
110
195
|
staff_id: string;
|
|
111
196
|
staff_name: string;
|
|
112
|
-
|
|
197
|
+
updatedAt: NativeDate;
|
|
198
|
+
opening: {
|
|
199
|
+
staff_id: string;
|
|
200
|
+
staff_name: string;
|
|
201
|
+
note: string;
|
|
202
|
+
cash_amount: number;
|
|
203
|
+
opened_at: NativeDate;
|
|
204
|
+
};
|
|
205
|
+
closing: {
|
|
206
|
+
staff_id: string;
|
|
207
|
+
staff_name: string;
|
|
208
|
+
note: string;
|
|
209
|
+
cash_amount: number;
|
|
210
|
+
expected_cash_amount: number;
|
|
211
|
+
difference: number;
|
|
212
|
+
closed_at: NativeDate;
|
|
213
|
+
cash_in_out_id: string;
|
|
214
|
+
};
|
|
113
215
|
}>;
|
|
114
216
|
reopened_times: number;
|
|
115
217
|
total_shifts: number;
|
|
@@ -156,15 +258,66 @@ export declare const TenantDaySessionSchema: Schema<any, import("mongoose").Mode
|
|
|
156
258
|
reopened_iterations: import("mongoose").Types.DocumentArray<{
|
|
157
259
|
staff_id: string;
|
|
158
260
|
staff_name: string;
|
|
159
|
-
|
|
261
|
+
updatedAt: NativeDate;
|
|
262
|
+
opening: {
|
|
263
|
+
staff_id: string;
|
|
264
|
+
staff_name: string;
|
|
265
|
+
note: string;
|
|
266
|
+
cash_amount: number;
|
|
267
|
+
opened_at: NativeDate;
|
|
268
|
+
};
|
|
269
|
+
closing: {
|
|
270
|
+
staff_id: string;
|
|
271
|
+
staff_name: string;
|
|
272
|
+
note: string;
|
|
273
|
+
cash_amount: number;
|
|
274
|
+
expected_cash_amount: number;
|
|
275
|
+
difference: number;
|
|
276
|
+
closed_at: NativeDate;
|
|
277
|
+
cash_in_out_id: string;
|
|
278
|
+
};
|
|
160
279
|
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
161
280
|
staff_id: string;
|
|
162
281
|
staff_name: string;
|
|
163
|
-
|
|
282
|
+
updatedAt: NativeDate;
|
|
283
|
+
opening: {
|
|
284
|
+
staff_id: string;
|
|
285
|
+
staff_name: string;
|
|
286
|
+
note: string;
|
|
287
|
+
cash_amount: number;
|
|
288
|
+
opened_at: NativeDate;
|
|
289
|
+
};
|
|
290
|
+
closing: {
|
|
291
|
+
staff_id: string;
|
|
292
|
+
staff_name: string;
|
|
293
|
+
note: string;
|
|
294
|
+
cash_amount: number;
|
|
295
|
+
expected_cash_amount: number;
|
|
296
|
+
difference: number;
|
|
297
|
+
closed_at: NativeDate;
|
|
298
|
+
cash_in_out_id: string;
|
|
299
|
+
};
|
|
164
300
|
}> & {
|
|
165
301
|
staff_id: string;
|
|
166
302
|
staff_name: string;
|
|
167
|
-
|
|
303
|
+
updatedAt: NativeDate;
|
|
304
|
+
opening: {
|
|
305
|
+
staff_id: string;
|
|
306
|
+
staff_name: string;
|
|
307
|
+
note: string;
|
|
308
|
+
cash_amount: number;
|
|
309
|
+
opened_at: NativeDate;
|
|
310
|
+
};
|
|
311
|
+
closing: {
|
|
312
|
+
staff_id: string;
|
|
313
|
+
staff_name: string;
|
|
314
|
+
note: string;
|
|
315
|
+
cash_amount: number;
|
|
316
|
+
expected_cash_amount: number;
|
|
317
|
+
difference: number;
|
|
318
|
+
closed_at: NativeDate;
|
|
319
|
+
cash_in_out_id: string;
|
|
320
|
+
};
|
|
168
321
|
}>;
|
|
169
322
|
reopened_times: number;
|
|
170
323
|
total_shifts: number;
|
|
@@ -60,7 +60,7 @@ const TenantDaySessionClosingSchema = new mongoose_1.Schema({
|
|
|
60
60
|
default: null,
|
|
61
61
|
},
|
|
62
62
|
}, { _id: false, minimize: false });
|
|
63
|
-
const
|
|
63
|
+
const TenantDaySessionReopeningIterationSchema = new mongoose_1.Schema({
|
|
64
64
|
staff_id: {
|
|
65
65
|
type: String,
|
|
66
66
|
required: true,
|
|
@@ -69,8 +69,16 @@ const TenantDaySessionReopeningSchema = new mongoose_1.Schema({
|
|
|
69
69
|
type: String,
|
|
70
70
|
required: true,
|
|
71
71
|
},
|
|
72
|
-
|
|
73
|
-
type:
|
|
72
|
+
opening: {
|
|
73
|
+
type: TenantDaySessionOpeningSchema,
|
|
74
|
+
default: null,
|
|
75
|
+
},
|
|
76
|
+
closing: {
|
|
77
|
+
type: TenantDaySessionClosingSchema,
|
|
78
|
+
default: null,
|
|
79
|
+
},
|
|
80
|
+
updatedAt: {
|
|
81
|
+
type: mongoose_1.Schema.Types.Date,
|
|
74
82
|
required: true,
|
|
75
83
|
},
|
|
76
84
|
}, { _id: false, minimize: false });
|
|
@@ -105,7 +113,7 @@ exports.TenantDaySessionSchema = new mongoose_1.Schema({
|
|
|
105
113
|
default: 1,
|
|
106
114
|
},
|
|
107
115
|
reopened_iterations: {
|
|
108
|
-
type: [
|
|
116
|
+
type: [TenantDaySessionReopeningIterationSchema],
|
|
109
117
|
default: [],
|
|
110
118
|
},
|
|
111
119
|
reopened_times: {
|
|
@@ -44,15 +44,72 @@ export declare const TenantInstoreShiftSessionSchema: Schema<any, import("mongoo
|
|
|
44
44
|
reopened_iterations: import("mongoose").Types.DocumentArray<{
|
|
45
45
|
staff_id: string;
|
|
46
46
|
staff_name: string;
|
|
47
|
-
|
|
47
|
+
updatedAt: NativeDate;
|
|
48
|
+
opening: {
|
|
49
|
+
staff_id: string;
|
|
50
|
+
staff_name: string;
|
|
51
|
+
note: string;
|
|
52
|
+
cash_amount: number;
|
|
53
|
+
opened_at: NativeDate;
|
|
54
|
+
};
|
|
55
|
+
closing: {
|
|
56
|
+
staff_id: string;
|
|
57
|
+
staff_name: string;
|
|
58
|
+
note: string;
|
|
59
|
+
cash_amount: number;
|
|
60
|
+
closed_at: NativeDate;
|
|
61
|
+
};
|
|
62
|
+
difference: number;
|
|
63
|
+
cash_in_total: number;
|
|
64
|
+
cash_out_total: number;
|
|
65
|
+
expected_drawer_total: number;
|
|
66
|
+
actual_drawer_total: number;
|
|
48
67
|
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
49
68
|
staff_id: string;
|
|
50
69
|
staff_name: string;
|
|
51
|
-
|
|
70
|
+
updatedAt: NativeDate;
|
|
71
|
+
opening: {
|
|
72
|
+
staff_id: string;
|
|
73
|
+
staff_name: string;
|
|
74
|
+
note: string;
|
|
75
|
+
cash_amount: number;
|
|
76
|
+
opened_at: NativeDate;
|
|
77
|
+
};
|
|
78
|
+
closing: {
|
|
79
|
+
staff_id: string;
|
|
80
|
+
staff_name: string;
|
|
81
|
+
note: string;
|
|
82
|
+
cash_amount: number;
|
|
83
|
+
closed_at: NativeDate;
|
|
84
|
+
};
|
|
85
|
+
difference: number;
|
|
86
|
+
cash_in_total: number;
|
|
87
|
+
cash_out_total: number;
|
|
88
|
+
expected_drawer_total: number;
|
|
89
|
+
actual_drawer_total: number;
|
|
52
90
|
}> & {
|
|
53
91
|
staff_id: string;
|
|
54
92
|
staff_name: string;
|
|
55
|
-
|
|
93
|
+
updatedAt: NativeDate;
|
|
94
|
+
opening: {
|
|
95
|
+
staff_id: string;
|
|
96
|
+
staff_name: string;
|
|
97
|
+
note: string;
|
|
98
|
+
cash_amount: number;
|
|
99
|
+
opened_at: NativeDate;
|
|
100
|
+
};
|
|
101
|
+
closing: {
|
|
102
|
+
staff_id: string;
|
|
103
|
+
staff_name: string;
|
|
104
|
+
note: string;
|
|
105
|
+
cash_amount: number;
|
|
106
|
+
closed_at: NativeDate;
|
|
107
|
+
};
|
|
108
|
+
difference: number;
|
|
109
|
+
cash_in_total: number;
|
|
110
|
+
cash_out_total: number;
|
|
111
|
+
expected_drawer_total: number;
|
|
112
|
+
actual_drawer_total: number;
|
|
56
113
|
}>;
|
|
57
114
|
reopened_times: number;
|
|
58
115
|
difference: number;
|
|
@@ -103,15 +160,72 @@ export declare const TenantInstoreShiftSessionSchema: Schema<any, import("mongoo
|
|
|
103
160
|
reopened_iterations: import("mongoose").Types.DocumentArray<{
|
|
104
161
|
staff_id: string;
|
|
105
162
|
staff_name: string;
|
|
106
|
-
|
|
163
|
+
updatedAt: NativeDate;
|
|
164
|
+
opening: {
|
|
165
|
+
staff_id: string;
|
|
166
|
+
staff_name: string;
|
|
167
|
+
note: string;
|
|
168
|
+
cash_amount: number;
|
|
169
|
+
opened_at: NativeDate;
|
|
170
|
+
};
|
|
171
|
+
closing: {
|
|
172
|
+
staff_id: string;
|
|
173
|
+
staff_name: string;
|
|
174
|
+
note: string;
|
|
175
|
+
cash_amount: number;
|
|
176
|
+
closed_at: NativeDate;
|
|
177
|
+
};
|
|
178
|
+
difference: number;
|
|
179
|
+
cash_in_total: number;
|
|
180
|
+
cash_out_total: number;
|
|
181
|
+
expected_drawer_total: number;
|
|
182
|
+
actual_drawer_total: number;
|
|
107
183
|
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
108
184
|
staff_id: string;
|
|
109
185
|
staff_name: string;
|
|
110
|
-
|
|
186
|
+
updatedAt: NativeDate;
|
|
187
|
+
opening: {
|
|
188
|
+
staff_id: string;
|
|
189
|
+
staff_name: string;
|
|
190
|
+
note: string;
|
|
191
|
+
cash_amount: number;
|
|
192
|
+
opened_at: NativeDate;
|
|
193
|
+
};
|
|
194
|
+
closing: {
|
|
195
|
+
staff_id: string;
|
|
196
|
+
staff_name: string;
|
|
197
|
+
note: string;
|
|
198
|
+
cash_amount: number;
|
|
199
|
+
closed_at: NativeDate;
|
|
200
|
+
};
|
|
201
|
+
difference: number;
|
|
202
|
+
cash_in_total: number;
|
|
203
|
+
cash_out_total: number;
|
|
204
|
+
expected_drawer_total: number;
|
|
205
|
+
actual_drawer_total: number;
|
|
111
206
|
}> & {
|
|
112
207
|
staff_id: string;
|
|
113
208
|
staff_name: string;
|
|
114
|
-
|
|
209
|
+
updatedAt: NativeDate;
|
|
210
|
+
opening: {
|
|
211
|
+
staff_id: string;
|
|
212
|
+
staff_name: string;
|
|
213
|
+
note: string;
|
|
214
|
+
cash_amount: number;
|
|
215
|
+
opened_at: NativeDate;
|
|
216
|
+
};
|
|
217
|
+
closing: {
|
|
218
|
+
staff_id: string;
|
|
219
|
+
staff_name: string;
|
|
220
|
+
note: string;
|
|
221
|
+
cash_amount: number;
|
|
222
|
+
closed_at: NativeDate;
|
|
223
|
+
};
|
|
224
|
+
difference: number;
|
|
225
|
+
cash_in_total: number;
|
|
226
|
+
cash_out_total: number;
|
|
227
|
+
expected_drawer_total: number;
|
|
228
|
+
actual_drawer_total: number;
|
|
115
229
|
}>;
|
|
116
230
|
reopened_times: number;
|
|
117
231
|
difference: number;
|
|
@@ -162,15 +276,72 @@ export declare const TenantInstoreShiftSessionSchema: Schema<any, import("mongoo
|
|
|
162
276
|
reopened_iterations: import("mongoose").Types.DocumentArray<{
|
|
163
277
|
staff_id: string;
|
|
164
278
|
staff_name: string;
|
|
165
|
-
|
|
279
|
+
updatedAt: NativeDate;
|
|
280
|
+
opening: {
|
|
281
|
+
staff_id: string;
|
|
282
|
+
staff_name: string;
|
|
283
|
+
note: string;
|
|
284
|
+
cash_amount: number;
|
|
285
|
+
opened_at: NativeDate;
|
|
286
|
+
};
|
|
287
|
+
closing: {
|
|
288
|
+
staff_id: string;
|
|
289
|
+
staff_name: string;
|
|
290
|
+
note: string;
|
|
291
|
+
cash_amount: number;
|
|
292
|
+
closed_at: NativeDate;
|
|
293
|
+
};
|
|
294
|
+
difference: number;
|
|
295
|
+
cash_in_total: number;
|
|
296
|
+
cash_out_total: number;
|
|
297
|
+
expected_drawer_total: number;
|
|
298
|
+
actual_drawer_total: number;
|
|
166
299
|
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
167
300
|
staff_id: string;
|
|
168
301
|
staff_name: string;
|
|
169
|
-
|
|
302
|
+
updatedAt: NativeDate;
|
|
303
|
+
opening: {
|
|
304
|
+
staff_id: string;
|
|
305
|
+
staff_name: string;
|
|
306
|
+
note: string;
|
|
307
|
+
cash_amount: number;
|
|
308
|
+
opened_at: NativeDate;
|
|
309
|
+
};
|
|
310
|
+
closing: {
|
|
311
|
+
staff_id: string;
|
|
312
|
+
staff_name: string;
|
|
313
|
+
note: string;
|
|
314
|
+
cash_amount: number;
|
|
315
|
+
closed_at: NativeDate;
|
|
316
|
+
};
|
|
317
|
+
difference: number;
|
|
318
|
+
cash_in_total: number;
|
|
319
|
+
cash_out_total: number;
|
|
320
|
+
expected_drawer_total: number;
|
|
321
|
+
actual_drawer_total: number;
|
|
170
322
|
}> & {
|
|
171
323
|
staff_id: string;
|
|
172
324
|
staff_name: string;
|
|
173
|
-
|
|
325
|
+
updatedAt: NativeDate;
|
|
326
|
+
opening: {
|
|
327
|
+
staff_id: string;
|
|
328
|
+
staff_name: string;
|
|
329
|
+
note: string;
|
|
330
|
+
cash_amount: number;
|
|
331
|
+
opened_at: NativeDate;
|
|
332
|
+
};
|
|
333
|
+
closing: {
|
|
334
|
+
staff_id: string;
|
|
335
|
+
staff_name: string;
|
|
336
|
+
note: string;
|
|
337
|
+
cash_amount: number;
|
|
338
|
+
closed_at: NativeDate;
|
|
339
|
+
};
|
|
340
|
+
difference: number;
|
|
341
|
+
cash_in_total: number;
|
|
342
|
+
cash_out_total: number;
|
|
343
|
+
expected_drawer_total: number;
|
|
344
|
+
actual_drawer_total: number;
|
|
174
345
|
}>;
|
|
175
346
|
reopened_times: number;
|
|
176
347
|
difference: number;
|
|
@@ -48,7 +48,7 @@ const TenantInstoreShiftClosingSchema = new mongoose_1.Schema({
|
|
|
48
48
|
required: true,
|
|
49
49
|
},
|
|
50
50
|
}, { _id: false, minimize: false });
|
|
51
|
-
const
|
|
51
|
+
const TenantInstoreShiftReopeningIterationSchema = new mongoose_1.Schema({
|
|
52
52
|
staff_id: {
|
|
53
53
|
type: String,
|
|
54
54
|
required: true,
|
|
@@ -57,8 +57,36 @@ const TenantInstoreShiftReopeningSchema = new mongoose_1.Schema({
|
|
|
57
57
|
type: String,
|
|
58
58
|
required: true,
|
|
59
59
|
},
|
|
60
|
-
|
|
61
|
-
type:
|
|
60
|
+
opening: {
|
|
61
|
+
type: TenantInstoreShiftOpeningSchema,
|
|
62
|
+
default: null,
|
|
63
|
+
},
|
|
64
|
+
closing: {
|
|
65
|
+
type: TenantInstoreShiftClosingSchema,
|
|
66
|
+
default: null,
|
|
67
|
+
},
|
|
68
|
+
cash_in_total: {
|
|
69
|
+
type: Number,
|
|
70
|
+
required: true,
|
|
71
|
+
},
|
|
72
|
+
cash_out_total: {
|
|
73
|
+
type: Number,
|
|
74
|
+
required: true,
|
|
75
|
+
},
|
|
76
|
+
expected_drawer_total: {
|
|
77
|
+
type: Number,
|
|
78
|
+
required: true,
|
|
79
|
+
},
|
|
80
|
+
actual_drawer_total: {
|
|
81
|
+
type: Number,
|
|
82
|
+
required: true,
|
|
83
|
+
},
|
|
84
|
+
difference: {
|
|
85
|
+
type: Number,
|
|
86
|
+
required: true,
|
|
87
|
+
},
|
|
88
|
+
updatedAt: {
|
|
89
|
+
type: mongoose_1.Schema.Types.Date,
|
|
62
90
|
required: true,
|
|
63
91
|
},
|
|
64
92
|
}, { _id: false, minimize: false });
|
|
@@ -120,7 +148,7 @@ exports.TenantInstoreShiftSessionSchema = new mongoose_1.Schema({
|
|
|
120
148
|
required: true,
|
|
121
149
|
},
|
|
122
150
|
reopened_iterations: {
|
|
123
|
-
type: [
|
|
151
|
+
type: [TenantInstoreShiftReopeningIterationSchema],
|
|
124
152
|
default: [],
|
|
125
153
|
},
|
|
126
154
|
reopened_times: {
|
|
@@ -46,6 +46,7 @@ export * from './reservations';
|
|
|
46
46
|
export * from './reviews';
|
|
47
47
|
export * from './rewards_usage';
|
|
48
48
|
export * from './riders';
|
|
49
|
+
export * from './shift_day_drawer_requests';
|
|
49
50
|
export * from './specials';
|
|
50
51
|
export * from './staff_shifts';
|
|
51
52
|
export * from './tenant-activity-logs';
|
|
@@ -62,6 +62,7 @@ __exportStar(require("./reservations"), exports);
|
|
|
62
62
|
__exportStar(require("./reviews"), exports);
|
|
63
63
|
__exportStar(require("./rewards_usage"), exports);
|
|
64
64
|
__exportStar(require("./riders"), exports);
|
|
65
|
+
__exportStar(require("./shift_day_drawer_requests"), exports);
|
|
65
66
|
__exportStar(require("./specials"), exports);
|
|
66
67
|
__exportStar(require("./staff_shifts"), exports);
|
|
67
68
|
__exportStar(require("./tenant-activity-logs"), exports);
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request body contracts for the business day / instore shift / cash drawer
|
|
3
|
+
* lifecycle endpoints (open / reopen / close).
|
|
4
|
+
*
|
|
5
|
+
* Shared between the backend (items-service) and the POS frontend so both sides
|
|
6
|
+
* agree on the exact wire shape for these operations. Field semantics:
|
|
7
|
+
* - `staff_id` / `staff_name` are the operator performing the action.
|
|
8
|
+
* - `cash_amount` is in integer cents (POS converts decimal balances via
|
|
9
|
+
* `convertDecimalToInt`).
|
|
10
|
+
* - `operational_time_zone_offset_gmt` is the tenant's UTC offset (hours) used
|
|
11
|
+
* to stamp the local-time fields.
|
|
12
|
+
*/
|
|
13
|
+
export interface IOpenTenantDayRequestBody {
|
|
14
|
+
tenant_id: string;
|
|
15
|
+
staff_id: string;
|
|
16
|
+
staff_name: string;
|
|
17
|
+
note: string;
|
|
18
|
+
cash_amount: number;
|
|
19
|
+
operational_time_zone_offset_gmt: number;
|
|
20
|
+
}
|
|
21
|
+
export interface IReopenTenantDayRequestBody {
|
|
22
|
+
tenant_id: string;
|
|
23
|
+
staff_id: string;
|
|
24
|
+
staff_name: string;
|
|
25
|
+
note: string;
|
|
26
|
+
operational_time_zone_offset_gmt: number;
|
|
27
|
+
}
|
|
28
|
+
export interface ICloseTenantDayRequestBody {
|
|
29
|
+
tenant_id: string;
|
|
30
|
+
day_session_id: string;
|
|
31
|
+
staff_id: string;
|
|
32
|
+
staff_name: string;
|
|
33
|
+
note?: string;
|
|
34
|
+
cash_amount?: number;
|
|
35
|
+
expected_cash_amount?: number;
|
|
36
|
+
difference?: number;
|
|
37
|
+
cash_in_out_id?: string | null;
|
|
38
|
+
}
|
|
39
|
+
export interface IOpenInstoreShiftRequestBody {
|
|
40
|
+
tenant_id: string;
|
|
41
|
+
day_id: string;
|
|
42
|
+
shift_id: string;
|
|
43
|
+
staff_id: string;
|
|
44
|
+
staff_name: string;
|
|
45
|
+
note?: string;
|
|
46
|
+
cash_amount?: number;
|
|
47
|
+
operational_time_zone_offset_gmt: number;
|
|
48
|
+
}
|
|
49
|
+
export interface ICloseInstoreShiftRequestBody {
|
|
50
|
+
tenant_id: string;
|
|
51
|
+
shift_session_id: string;
|
|
52
|
+
staff_id: string;
|
|
53
|
+
staff_name: string;
|
|
54
|
+
note?: string;
|
|
55
|
+
cash_amount?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Client-computed shift totals — kept for compatibility; the backend
|
|
58
|
+
* recomputes these server-side from the ledger and ignores client values.
|
|
59
|
+
*/
|
|
60
|
+
cash_in_total?: number;
|
|
61
|
+
cash_out_total?: number;
|
|
62
|
+
expected_drawer_total?: number;
|
|
63
|
+
actual_drawer_total?: number;
|
|
64
|
+
difference?: number;
|
|
65
|
+
}
|
|
66
|
+
export interface IReopenInstoreShiftRequestBody {
|
|
67
|
+
tenant_id: string;
|
|
68
|
+
shift_session_id: string;
|
|
69
|
+
staff_id: string;
|
|
70
|
+
staff_name: string;
|
|
71
|
+
note?: string;
|
|
72
|
+
cash_amount?: number;
|
|
73
|
+
}
|
|
74
|
+
export interface IOpenCashDrawerSessionRequestBody {
|
|
75
|
+
tenant_id: string;
|
|
76
|
+
drawer_id: string;
|
|
77
|
+
drawer_name?: string;
|
|
78
|
+
day_id: string;
|
|
79
|
+
staff_id: string;
|
|
80
|
+
staff_name: string;
|
|
81
|
+
note?: string;
|
|
82
|
+
cash_amount?: number;
|
|
83
|
+
denominations?: Record<string, number>;
|
|
84
|
+
shift_id?: string | null;
|
|
85
|
+
}
|
|
86
|
+
export interface ICloseCashDrawerSessionRequestBody {
|
|
87
|
+
tenant_id: string;
|
|
88
|
+
staff_id: string;
|
|
89
|
+
staff_name: string;
|
|
90
|
+
note?: string;
|
|
91
|
+
cash_amount: number;
|
|
92
|
+
denominations: Record<string, number>;
|
|
93
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Request body contracts for the business day / instore shift / cash drawer
|
|
4
|
+
* lifecycle endpoints (open / reopen / close).
|
|
5
|
+
*
|
|
6
|
+
* Shared between the backend (items-service) and the POS frontend so both sides
|
|
7
|
+
* agree on the exact wire shape for these operations. Field semantics:
|
|
8
|
+
* - `staff_id` / `staff_name` are the operator performing the action.
|
|
9
|
+
* - `cash_amount` is in integer cents (POS converts decimal balances via
|
|
10
|
+
* `convertDecimalToInt`).
|
|
11
|
+
* - `operational_time_zone_offset_gmt` is the tenant's UTC offset (hours) used
|
|
12
|
+
* to stamp the local-time fields.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -20,10 +20,14 @@ export interface ITenantCashDrawerSessionClosing {
|
|
|
20
20
|
denominations: Record<string, number>;
|
|
21
21
|
shift_id: string | null;
|
|
22
22
|
}
|
|
23
|
-
export interface
|
|
23
|
+
export interface ITenantCashDrawerSessionReopeningIteration {
|
|
24
24
|
staff_id: string;
|
|
25
25
|
staff_name: string;
|
|
26
|
-
|
|
26
|
+
opening: ITenantCashDrawerSession['opening'];
|
|
27
|
+
closing: ITenantCashDrawerSession['closing'];
|
|
28
|
+
running_balance: ITenantCashDrawerSession['running_balance'];
|
|
29
|
+
net_movements: ITenantCashDrawerSession['net_movements'];
|
|
30
|
+
updatedAt: ITenantCashDrawerSession['updatedAt'];
|
|
27
31
|
}
|
|
28
32
|
export interface ITenantCashDrawerSession extends ILocalTimeFields {
|
|
29
33
|
_id: string;
|
|
@@ -46,7 +50,7 @@ export interface ITenantCashDrawerSession extends ILocalTimeFields {
|
|
|
46
50
|
* Stored as integer cents; POS converts via `fromCentsSession`.
|
|
47
51
|
*/
|
|
48
52
|
net_movements: number;
|
|
49
|
-
reopened_iterations:
|
|
53
|
+
reopened_iterations: ITenantCashDrawerSessionReopeningIteration[];
|
|
50
54
|
reopened_times: number;
|
|
51
55
|
createdAt: Date;
|
|
52
56
|
updatedAt: Date;
|