@managesome/eposmatic-toolkit 0.2.569 → 0.2.570

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.
@@ -53,6 +53,57 @@ function getTenantCashDrawerSessionFromCents(session) {
53
53
  net_movements: (0, price_conversion_1.convertPriceFromCents)(session.net_movements),
54
54
  }
55
55
  : {}),
56
+ ...(session.reopened_iterations != null
57
+ ? {
58
+ reopened_iterations: session.reopened_iterations.map((iteration) => ({
59
+ ...iteration,
60
+ ...(iteration.opening != null
61
+ ? {
62
+ opening: {
63
+ ...iteration.opening,
64
+ ...(typeof iteration.opening.cash_amount === 'number'
65
+ ? {
66
+ cash_amount: (0, price_conversion_1.convertPriceFromCents)(iteration.opening.cash_amount),
67
+ }
68
+ : {}),
69
+ },
70
+ }
71
+ : {}),
72
+ ...(iteration.closing != null
73
+ ? {
74
+ closing: {
75
+ ...iteration.closing,
76
+ ...(typeof iteration.closing.cash_amount === 'number'
77
+ ? {
78
+ cash_amount: (0, price_conversion_1.convertPriceFromCents)(iteration.closing.cash_amount),
79
+ }
80
+ : {}),
81
+ ...(typeof iteration.closing.expected_cash_amount === 'number'
82
+ ? {
83
+ expected_cash_amount: (0, price_conversion_1.convertPriceFromCents)(iteration.closing.expected_cash_amount),
84
+ }
85
+ : {}),
86
+ ...(typeof iteration.closing.difference === 'number'
87
+ ? {
88
+ difference: (0, price_conversion_1.convertPriceFromCents)(iteration.closing.difference),
89
+ }
90
+ : {}),
91
+ },
92
+ }
93
+ : {}),
94
+ ...(typeof iteration.running_balance === 'number'
95
+ ? {
96
+ running_balance: (0, price_conversion_1.convertPriceFromCents)(iteration.running_balance),
97
+ }
98
+ : {}),
99
+ ...(typeof iteration.net_movements === 'number'
100
+ ? {
101
+ net_movements: (0, price_conversion_1.convertPriceFromCents)(iteration.net_movements),
102
+ }
103
+ : {}),
104
+ })),
105
+ }
106
+ : {}),
56
107
  };
57
108
  }
58
109
  /**
@@ -105,5 +156,56 @@ function getTenantCashDrawerSessionWithCents(session) {
105
156
  net_movements: (0, price_conversion_1.convertPriceToCents)(session.net_movements),
106
157
  }
107
158
  : {}),
159
+ ...(session.reopened_iterations != null
160
+ ? {
161
+ reopened_iterations: session.reopened_iterations.map((iteration) => ({
162
+ ...iteration,
163
+ ...(iteration.opening != null
164
+ ? {
165
+ opening: {
166
+ ...iteration.opening,
167
+ ...(typeof iteration.opening.cash_amount === 'number'
168
+ ? {
169
+ cash_amount: (0, price_conversion_1.convertPriceToCents)(iteration.opening.cash_amount),
170
+ }
171
+ : {}),
172
+ },
173
+ }
174
+ : {}),
175
+ ...(iteration.closing != null
176
+ ? {
177
+ closing: {
178
+ ...iteration.closing,
179
+ ...(typeof iteration.closing.cash_amount === 'number'
180
+ ? {
181
+ cash_amount: (0, price_conversion_1.convertPriceToCents)(iteration.closing.cash_amount),
182
+ }
183
+ : {}),
184
+ ...(typeof iteration.closing.expected_cash_amount === 'number'
185
+ ? {
186
+ expected_cash_amount: (0, price_conversion_1.convertPriceToCents)(iteration.closing.expected_cash_amount),
187
+ }
188
+ : {}),
189
+ ...(typeof iteration.closing.difference === 'number'
190
+ ? {
191
+ difference: (0, price_conversion_1.convertPriceToCents)(iteration.closing.difference),
192
+ }
193
+ : {}),
194
+ },
195
+ }
196
+ : {}),
197
+ ...(typeof iteration.running_balance === 'number'
198
+ ? {
199
+ running_balance: (0, price_conversion_1.convertPriceToCents)(iteration.running_balance),
200
+ }
201
+ : {}),
202
+ ...(typeof iteration.net_movements === 'number'
203
+ ? {
204
+ net_movements: (0, price_conversion_1.convertPriceToCents)(iteration.net_movements),
205
+ }
206
+ : {}),
207
+ })),
208
+ }
209
+ : {}),
108
210
  };
109
211
  }
@@ -43,6 +43,47 @@ function getTenantDaySessionFromCents(session) {
43
43
  },
44
44
  }
45
45
  : {}),
46
+ ...(session.reopened_iterations != null
47
+ ? {
48
+ reopened_iterations: session.reopened_iterations.map((iteration) => ({
49
+ ...iteration,
50
+ ...(iteration.opening != null
51
+ ? {
52
+ opening: {
53
+ ...iteration.opening,
54
+ ...(typeof iteration.opening.cash_amount === 'number'
55
+ ? {
56
+ cash_amount: (0, price_conversion_1.convertPriceFromCents)(iteration.opening.cash_amount),
57
+ }
58
+ : {}),
59
+ },
60
+ }
61
+ : {}),
62
+ ...(iteration.closing != null
63
+ ? {
64
+ closing: {
65
+ ...iteration.closing,
66
+ ...(typeof iteration.closing.cash_amount === 'number'
67
+ ? {
68
+ cash_amount: (0, price_conversion_1.convertPriceFromCents)(iteration.closing.cash_amount),
69
+ }
70
+ : {}),
71
+ ...(typeof iteration.closing.expected_cash_amount === 'number'
72
+ ? {
73
+ expected_cash_amount: (0, price_conversion_1.convertPriceFromCents)(iteration.closing.expected_cash_amount),
74
+ }
75
+ : {}),
76
+ ...(typeof iteration.closing.difference === 'number'
77
+ ? {
78
+ difference: (0, price_conversion_1.convertPriceFromCents)(iteration.closing.difference),
79
+ }
80
+ : {}),
81
+ },
82
+ }
83
+ : {}),
84
+ })),
85
+ }
86
+ : {}),
46
87
  };
47
88
  }
48
89
  /**
@@ -85,5 +126,46 @@ function getTenantDaySessionWithCents(session) {
85
126
  },
86
127
  }
87
128
  : {}),
129
+ ...(session.reopened_iterations != null
130
+ ? {
131
+ reopened_iterations: session.reopened_iterations.map((iteration) => ({
132
+ ...iteration,
133
+ ...(iteration.opening != null
134
+ ? {
135
+ opening: {
136
+ ...iteration.opening,
137
+ ...(typeof iteration.opening.cash_amount === 'number'
138
+ ? {
139
+ cash_amount: (0, price_conversion_1.convertPriceToCents)(iteration.opening.cash_amount),
140
+ }
141
+ : {}),
142
+ },
143
+ }
144
+ : {}),
145
+ ...(iteration.closing != null
146
+ ? {
147
+ closing: {
148
+ ...iteration.closing,
149
+ ...(typeof iteration.closing.cash_amount === 'number'
150
+ ? {
151
+ cash_amount: (0, price_conversion_1.convertPriceToCents)(iteration.closing.cash_amount),
152
+ }
153
+ : {}),
154
+ ...(typeof iteration.closing.expected_cash_amount === 'number'
155
+ ? {
156
+ expected_cash_amount: (0, price_conversion_1.convertPriceToCents)(iteration.closing.expected_cash_amount),
157
+ }
158
+ : {}),
159
+ ...(typeof iteration.closing.difference === 'number'
160
+ ? {
161
+ difference: (0, price_conversion_1.convertPriceToCents)(iteration.closing.difference),
162
+ }
163
+ : {}),
164
+ },
165
+ }
166
+ : {}),
167
+ })),
168
+ }
169
+ : {}),
88
170
  };
89
171
  }
@@ -58,6 +58,62 @@ function getTenantInstoreShiftSessionFromCents(session) {
58
58
  difference: (0, price_conversion_1.convertPriceFromCents)(session.difference),
59
59
  }
60
60
  : {}),
61
+ ...(session.reopened_iterations != null
62
+ ? {
63
+ reopened_iterations: session.reopened_iterations.map((iteration) => ({
64
+ ...iteration,
65
+ ...(iteration.opening != null
66
+ ? {
67
+ opening: {
68
+ ...iteration.opening,
69
+ ...(typeof iteration.opening.cash_amount === 'number'
70
+ ? {
71
+ cash_amount: (0, price_conversion_1.convertPriceFromCents)(iteration.opening.cash_amount),
72
+ }
73
+ : {}),
74
+ },
75
+ }
76
+ : {}),
77
+ ...(iteration.closing != null
78
+ ? {
79
+ closing: {
80
+ ...iteration.closing,
81
+ ...(typeof iteration.closing.cash_amount === 'number'
82
+ ? {
83
+ cash_amount: (0, price_conversion_1.convertPriceFromCents)(iteration.closing.cash_amount),
84
+ }
85
+ : {}),
86
+ },
87
+ }
88
+ : {}),
89
+ ...(typeof iteration.cash_in_total === 'number'
90
+ ? {
91
+ cash_in_total: (0, price_conversion_1.convertPriceFromCents)(iteration.cash_in_total),
92
+ }
93
+ : {}),
94
+ ...(typeof iteration.cash_out_total === 'number'
95
+ ? {
96
+ cash_out_total: (0, price_conversion_1.convertPriceFromCents)(iteration.cash_out_total),
97
+ }
98
+ : {}),
99
+ ...(typeof iteration.expected_drawer_total === 'number'
100
+ ? {
101
+ expected_drawer_total: (0, price_conversion_1.convertPriceFromCents)(iteration.expected_drawer_total),
102
+ }
103
+ : {}),
104
+ ...(typeof iteration.actual_drawer_total === 'number'
105
+ ? {
106
+ actual_drawer_total: (0, price_conversion_1.convertPriceFromCents)(iteration.actual_drawer_total),
107
+ }
108
+ : {}),
109
+ ...(typeof iteration.difference === 'number'
110
+ ? {
111
+ difference: (0, price_conversion_1.convertPriceFromCents)(iteration.difference),
112
+ }
113
+ : {}),
114
+ })),
115
+ }
116
+ : {}),
61
117
  };
62
118
  }
63
119
  /**
@@ -115,5 +171,61 @@ function getTenantInstoreShiftSessionWithCents(session) {
115
171
  difference: (0, price_conversion_1.convertPriceToCents)(session.difference),
116
172
  }
117
173
  : {}),
174
+ ...(session.reopened_iterations != null
175
+ ? {
176
+ reopened_iterations: session.reopened_iterations.map((iteration) => ({
177
+ ...iteration,
178
+ ...(iteration.opening != null
179
+ ? {
180
+ opening: {
181
+ ...iteration.opening,
182
+ ...(typeof iteration.opening.cash_amount === 'number'
183
+ ? {
184
+ cash_amount: (0, price_conversion_1.convertPriceToCents)(iteration.opening.cash_amount),
185
+ }
186
+ : {}),
187
+ },
188
+ }
189
+ : {}),
190
+ ...(iteration.closing != null
191
+ ? {
192
+ closing: {
193
+ ...iteration.closing,
194
+ ...(typeof iteration.closing.cash_amount === 'number'
195
+ ? {
196
+ cash_amount: (0, price_conversion_1.convertPriceToCents)(iteration.closing.cash_amount),
197
+ }
198
+ : {}),
199
+ },
200
+ }
201
+ : {}),
202
+ ...(typeof iteration.cash_in_total === 'number'
203
+ ? {
204
+ cash_in_total: (0, price_conversion_1.convertPriceToCents)(iteration.cash_in_total),
205
+ }
206
+ : {}),
207
+ ...(typeof iteration.cash_out_total === 'number'
208
+ ? {
209
+ cash_out_total: (0, price_conversion_1.convertPriceToCents)(iteration.cash_out_total),
210
+ }
211
+ : {}),
212
+ ...(typeof iteration.expected_drawer_total === 'number'
213
+ ? {
214
+ expected_drawer_total: (0, price_conversion_1.convertPriceToCents)(iteration.expected_drawer_total),
215
+ }
216
+ : {}),
217
+ ...(typeof iteration.actual_drawer_total === 'number'
218
+ ? {
219
+ actual_drawer_total: (0, price_conversion_1.convertPriceToCents)(iteration.actual_drawer_total),
220
+ }
221
+ : {}),
222
+ ...(typeof iteration.difference === 'number'
223
+ ? {
224
+ difference: (0, price_conversion_1.convertPriceToCents)(iteration.difference),
225
+ }
226
+ : {}),
227
+ })),
228
+ }
229
+ : {}),
118
230
  };
119
231
  }
@@ -54,15 +54,81 @@ export declare const TenantCashDrawerSessionsSchema: Schema<any, import("mongoos
54
54
  reopened_iterations: import("mongoose").Types.DocumentArray<{
55
55
  staff_id: string;
56
56
  staff_name: string;
57
- reopened_at: NativeDate;
57
+ updatedAt: NativeDate;
58
+ opening: {
59
+ staff_id: string;
60
+ staff_name: string;
61
+ note: string;
62
+ cash_amount: number;
63
+ shift_id: import("mongoose").Types.ObjectId;
64
+ opened_at: NativeDate;
65
+ denominations: Map<string, number>;
66
+ };
67
+ closing: {
68
+ staff_id: string;
69
+ staff_name: string;
70
+ note: string;
71
+ cash_amount: number;
72
+ expected_cash_amount: number;
73
+ difference: number;
74
+ shift_id: import("mongoose").Types.ObjectId;
75
+ denominations: Map<string, number>;
76
+ closed_at: NativeDate;
77
+ };
78
+ running_balance: number;
79
+ net_movements: number;
58
80
  }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
59
81
  staff_id: string;
60
82
  staff_name: string;
61
- reopened_at: NativeDate;
83
+ updatedAt: NativeDate;
84
+ opening: {
85
+ staff_id: string;
86
+ staff_name: string;
87
+ note: string;
88
+ cash_amount: number;
89
+ shift_id: import("mongoose").Types.ObjectId;
90
+ opened_at: NativeDate;
91
+ denominations: Map<string, number>;
92
+ };
93
+ closing: {
94
+ staff_id: string;
95
+ staff_name: string;
96
+ note: string;
97
+ cash_amount: number;
98
+ expected_cash_amount: number;
99
+ difference: number;
100
+ shift_id: import("mongoose").Types.ObjectId;
101
+ denominations: Map<string, number>;
102
+ closed_at: NativeDate;
103
+ };
104
+ running_balance: number;
105
+ net_movements: number;
62
106
  }> & {
63
107
  staff_id: string;
64
108
  staff_name: string;
65
- reopened_at: NativeDate;
109
+ updatedAt: NativeDate;
110
+ opening: {
111
+ staff_id: string;
112
+ staff_name: string;
113
+ note: string;
114
+ cash_amount: number;
115
+ shift_id: import("mongoose").Types.ObjectId;
116
+ opened_at: NativeDate;
117
+ denominations: Map<string, number>;
118
+ };
119
+ closing: {
120
+ staff_id: string;
121
+ staff_name: string;
122
+ note: string;
123
+ cash_amount: number;
124
+ expected_cash_amount: number;
125
+ difference: number;
126
+ shift_id: import("mongoose").Types.ObjectId;
127
+ denominations: Map<string, number>;
128
+ closed_at: NativeDate;
129
+ };
130
+ running_balance: number;
131
+ net_movements: number;
66
132
  }>;
67
133
  reopened_times: number;
68
134
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
@@ -116,15 +182,81 @@ export declare const TenantCashDrawerSessionsSchema: Schema<any, import("mongoos
116
182
  reopened_iterations: import("mongoose").Types.DocumentArray<{
117
183
  staff_id: string;
118
184
  staff_name: string;
119
- reopened_at: NativeDate;
185
+ updatedAt: NativeDate;
186
+ opening: {
187
+ staff_id: string;
188
+ staff_name: string;
189
+ note: string;
190
+ cash_amount: number;
191
+ shift_id: import("mongoose").Types.ObjectId;
192
+ opened_at: NativeDate;
193
+ denominations: Map<string, number>;
194
+ };
195
+ closing: {
196
+ staff_id: string;
197
+ staff_name: string;
198
+ note: string;
199
+ cash_amount: number;
200
+ expected_cash_amount: number;
201
+ difference: number;
202
+ shift_id: import("mongoose").Types.ObjectId;
203
+ denominations: Map<string, number>;
204
+ closed_at: NativeDate;
205
+ };
206
+ running_balance: number;
207
+ net_movements: number;
120
208
  }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
121
209
  staff_id: string;
122
210
  staff_name: string;
123
- reopened_at: NativeDate;
211
+ updatedAt: NativeDate;
212
+ opening: {
213
+ staff_id: string;
214
+ staff_name: string;
215
+ note: string;
216
+ cash_amount: number;
217
+ shift_id: import("mongoose").Types.ObjectId;
218
+ opened_at: NativeDate;
219
+ denominations: Map<string, number>;
220
+ };
221
+ closing: {
222
+ staff_id: string;
223
+ staff_name: string;
224
+ note: string;
225
+ cash_amount: number;
226
+ expected_cash_amount: number;
227
+ difference: number;
228
+ shift_id: import("mongoose").Types.ObjectId;
229
+ denominations: Map<string, number>;
230
+ closed_at: NativeDate;
231
+ };
232
+ running_balance: number;
233
+ net_movements: number;
124
234
  }> & {
125
235
  staff_id: string;
126
236
  staff_name: string;
127
- reopened_at: NativeDate;
237
+ updatedAt: NativeDate;
238
+ opening: {
239
+ staff_id: string;
240
+ staff_name: string;
241
+ note: string;
242
+ cash_amount: number;
243
+ shift_id: import("mongoose").Types.ObjectId;
244
+ opened_at: NativeDate;
245
+ denominations: Map<string, number>;
246
+ };
247
+ closing: {
248
+ staff_id: string;
249
+ staff_name: string;
250
+ note: string;
251
+ cash_amount: number;
252
+ expected_cash_amount: number;
253
+ difference: number;
254
+ shift_id: import("mongoose").Types.ObjectId;
255
+ denominations: Map<string, number>;
256
+ closed_at: NativeDate;
257
+ };
258
+ running_balance: number;
259
+ net_movements: number;
128
260
  }>;
129
261
  reopened_times: number;
130
262
  }>> & import("mongoose").FlatRecord<{
@@ -178,15 +310,81 @@ export declare const TenantCashDrawerSessionsSchema: Schema<any, import("mongoos
178
310
  reopened_iterations: import("mongoose").Types.DocumentArray<{
179
311
  staff_id: string;
180
312
  staff_name: string;
181
- reopened_at: NativeDate;
313
+ updatedAt: NativeDate;
314
+ opening: {
315
+ staff_id: string;
316
+ staff_name: string;
317
+ note: string;
318
+ cash_amount: number;
319
+ shift_id: import("mongoose").Types.ObjectId;
320
+ opened_at: NativeDate;
321
+ denominations: Map<string, number>;
322
+ };
323
+ closing: {
324
+ staff_id: string;
325
+ staff_name: string;
326
+ note: string;
327
+ cash_amount: number;
328
+ expected_cash_amount: number;
329
+ difference: number;
330
+ shift_id: import("mongoose").Types.ObjectId;
331
+ denominations: Map<string, number>;
332
+ closed_at: NativeDate;
333
+ };
334
+ running_balance: number;
335
+ net_movements: number;
182
336
  }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
183
337
  staff_id: string;
184
338
  staff_name: string;
185
- reopened_at: NativeDate;
339
+ updatedAt: NativeDate;
340
+ opening: {
341
+ staff_id: string;
342
+ staff_name: string;
343
+ note: string;
344
+ cash_amount: number;
345
+ shift_id: import("mongoose").Types.ObjectId;
346
+ opened_at: NativeDate;
347
+ denominations: Map<string, number>;
348
+ };
349
+ closing: {
350
+ staff_id: string;
351
+ staff_name: string;
352
+ note: string;
353
+ cash_amount: number;
354
+ expected_cash_amount: number;
355
+ difference: number;
356
+ shift_id: import("mongoose").Types.ObjectId;
357
+ denominations: Map<string, number>;
358
+ closed_at: NativeDate;
359
+ };
360
+ running_balance: number;
361
+ net_movements: number;
186
362
  }> & {
187
363
  staff_id: string;
188
364
  staff_name: string;
189
- reopened_at: NativeDate;
365
+ updatedAt: NativeDate;
366
+ opening: {
367
+ staff_id: string;
368
+ staff_name: string;
369
+ note: string;
370
+ cash_amount: number;
371
+ shift_id: import("mongoose").Types.ObjectId;
372
+ opened_at: NativeDate;
373
+ denominations: Map<string, number>;
374
+ };
375
+ closing: {
376
+ staff_id: string;
377
+ staff_name: string;
378
+ note: string;
379
+ cash_amount: number;
380
+ expected_cash_amount: number;
381
+ difference: number;
382
+ shift_id: import("mongoose").Types.ObjectId;
383
+ denominations: Map<string, number>;
384
+ closed_at: NativeDate;
385
+ };
386
+ running_balance: number;
387
+ net_movements: number;
190
388
  }>;
191
389
  reopened_times: number;
192
390
  }> & Required<{
@@ -74,7 +74,7 @@ const TenantCashDrawerSessionClosingSchema = new mongoose_1.Schema({
74
74
  default: null,
75
75
  },
76
76
  }, { _id: false, minimize: false });
77
- const TenantCashDrawerSessionReopeningSchema = new mongoose_1.Schema({
77
+ const TenantCashDrawerSessionReopeningIterationSchema = new mongoose_1.Schema({
78
78
  staff_id: {
79
79
  type: String,
80
80
  required: true,
@@ -83,8 +83,24 @@ const TenantCashDrawerSessionReopeningSchema = new mongoose_1.Schema({
83
83
  type: String,
84
84
  required: true,
85
85
  },
86
- reopened_at: {
87
- type: Date,
86
+ opening: {
87
+ type: TenantCashDrawerSessionOpeningSchema,
88
+ default: null,
89
+ },
90
+ closing: {
91
+ type: TenantCashDrawerSessionClosingSchema,
92
+ default: null,
93
+ },
94
+ running_balance: {
95
+ type: Number,
96
+ default: 0,
97
+ },
98
+ net_movements: {
99
+ type: Number,
100
+ default: 0,
101
+ },
102
+ updatedAt: {
103
+ type: mongoose_1.Schema.Types.Date,
88
104
  required: true,
89
105
  },
90
106
  }, { _id: false, minimize: false });
@@ -134,7 +150,7 @@ exports.TenantCashDrawerSessionsSchema = new mongoose_1.Schema({
134
150
  default: 0,
135
151
  },
136
152
  reopened_iterations: {
137
- type: [TenantCashDrawerSessionReopeningSchema],
153
+ type: [TenantCashDrawerSessionReopeningIterationSchema],
138
154
  default: [],
139
155
  },
140
156
  reopened_times: {
@@ -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
- reopened_at: NativeDate;
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
- reopened_at: NativeDate;
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
- reopened_at: NativeDate;
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
- reopened_at: NativeDate;
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
- reopened_at: NativeDate;
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
- reopened_at: NativeDate;
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
- reopened_at: NativeDate;
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
- reopened_at: NativeDate;
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
- reopened_at: NativeDate;
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 TenantDaySessionReopeningSchema = new mongoose_1.Schema({
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
- reopened_at: {
73
- type: Date,
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: [TenantDaySessionReopeningSchema],
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
- reopened_at: NativeDate;
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
- reopened_at: NativeDate;
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
- reopened_at: NativeDate;
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
- reopened_at: NativeDate;
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
- reopened_at: NativeDate;
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
- reopened_at: NativeDate;
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
- reopened_at: NativeDate;
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
- reopened_at: NativeDate;
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
- reopened_at: NativeDate;
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 TenantInstoreShiftReopeningSchema = new mongoose_1.Schema({
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
- reopened_at: {
61
- type: Date,
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: [TenantInstoreShiftReopeningSchema],
151
+ type: [TenantInstoreShiftReopeningIterationSchema],
124
152
  default: [],
125
153
  },
126
154
  reopened_times: {
@@ -20,10 +20,14 @@ export interface ITenantCashDrawerSessionClosing {
20
20
  denominations: Record<string, number>;
21
21
  shift_id: string | null;
22
22
  }
23
- export interface ITenantCashDrawerSessionReopening {
23
+ export interface ITenantCashDrawerSessionReopeningIteration {
24
24
  staff_id: string;
25
25
  staff_name: string;
26
- reopened_at: Date;
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: ITenantCashDrawerSessionReopening[];
53
+ reopened_iterations: ITenantCashDrawerSessionReopeningIteration[];
50
54
  reopened_times: number;
51
55
  createdAt: Date;
52
56
  updatedAt: Date;
@@ -17,10 +17,12 @@ export interface ITenantDaySessionClosing {
17
17
  difference: number;
18
18
  cash_in_out_id: string | null;
19
19
  }
20
- export interface ITenantDaySessionReopening {
20
+ export interface ITenantDaySessionReopeningIteration {
21
21
  staff_id: string;
22
22
  staff_name: string;
23
- reopened_at: Date;
23
+ opening: ITenantDaySession['opening'];
24
+ closing: ITenantDaySession['closing'];
25
+ updatedAt: ITenantDaySession['updatedAt'];
24
26
  }
25
27
  export interface ITenantDaySession extends ILocalTimeFields {
26
28
  _id: string;
@@ -29,7 +31,7 @@ export interface ITenantDaySession extends ILocalTimeFields {
29
31
  opening: ITenantDaySessionOpening | null;
30
32
  closing: ITenantDaySessionClosing | null;
31
33
  total_shifts: number;
32
- reopened_iterations: ITenantDaySessionReopening[];
34
+ reopened_iterations: ITenantDaySessionReopeningIteration[];
33
35
  reopened_times: number;
34
36
  createdAt: Date;
35
37
  updatedAt: Date;
@@ -14,10 +14,17 @@ export interface ITenantInstoreShiftClosing {
14
14
  closed_at: Date;
15
15
  cash_amount: number;
16
16
  }
17
- export interface ITenantInstoreShiftReopening {
17
+ export interface ITenantInstoreShiftReopeningIteration {
18
18
  staff_id: string;
19
19
  staff_name: string;
20
- reopened_at: Date;
20
+ opening: ITenantInstoreShiftSession['opening'];
21
+ closing: ITenantInstoreShiftSession['closing'];
22
+ cash_in_total: ITenantInstoreShiftSession['cash_in_total'];
23
+ cash_out_total: ITenantInstoreShiftSession['cash_out_total'];
24
+ expected_drawer_total: ITenantInstoreShiftSession['expected_drawer_total'];
25
+ actual_drawer_total: ITenantInstoreShiftSession['actual_drawer_total'];
26
+ difference: ITenantInstoreShiftSession['difference'];
27
+ updatedAt: ITenantInstoreShiftSession['updatedAt'];
21
28
  }
22
29
  export interface ITenantInstoreShiftSession extends ILocalTimeFields {
23
30
  _id: string;
@@ -33,7 +40,7 @@ export interface ITenantInstoreShiftSession extends ILocalTimeFields {
33
40
  expected_drawer_total: number;
34
41
  actual_drawer_total: number;
35
42
  difference: number;
36
- reopened_iterations: ITenantInstoreShiftReopening[];
43
+ reopened_iterations: ITenantInstoreShiftReopeningIteration[];
37
44
  reopened_times: number;
38
45
  createdAt: Date;
39
46
  updatedAt: Date;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.2.569",
3
+ "version": "0.2.570",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",