@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.
@@ -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: {