@managesome/eposmatic-toolkit 0.2.593 → 0.2.595

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.
@@ -436,3 +436,63 @@ export interface IWorker_PostWarehouseActivityLogs {
436
436
  severity?: WAREHOUSE_ACTIVITY_LOG_SEVERITY_ENUM;
437
437
  }[];
438
438
  }
439
+ export interface IWorker_StartInstoreShift {
440
+ tenant_id: string;
441
+ /** The business day (tenant_day_sessions doc id). */
442
+ day_id: string;
443
+ /** The shift session doc id created by the open. */
444
+ shift_session_id: string;
445
+ /** The shift TEMPLATE id. */
446
+ shift_id: string;
447
+ }
448
+ export interface IWorker_EndInstoreShift {
449
+ tenant_id: string;
450
+ /** The business day (tenant_day_sessions doc id). */
451
+ day_id: string;
452
+ /** The shift session doc id being closed. */
453
+ shift_session_id: string;
454
+ /** The shift TEMPLATE id. */
455
+ shift_id: string;
456
+ }
457
+ export interface IWorker_ReopenInstoreShift {
458
+ tenant_id: string;
459
+ /** The business day (tenant_day_sessions doc id). */
460
+ day_id: string;
461
+ /** The shift session doc id being reopened. */
462
+ shift_session_id: string;
463
+ /** The shift TEMPLATE id. */
464
+ shift_id: string;
465
+ }
466
+ export interface IWorker_StartTenantDay {
467
+ tenant_id: string;
468
+ /** The newly opened business day (tenant_day_sessions doc id). */
469
+ day_session_id: string;
470
+ }
471
+ export interface IWorker_EndTenantDay {
472
+ tenant_id: string;
473
+ /** The business day being closed (tenant_day_sessions doc id). */
474
+ day_session_id: string;
475
+ }
476
+ export interface IWorker_ReopenTenantDay {
477
+ tenant_id: string;
478
+ /** The business day being reopened (tenant_day_sessions doc id). */
479
+ day_session_id: string;
480
+ }
481
+ export interface IWorker_OpenCashDrawerSession {
482
+ tenant_id: string;
483
+ /** The business day (tenant_day_sessions doc id). */
484
+ day_id: string;
485
+ /** The cash drawer doc id. */
486
+ drawer_id: string;
487
+ /** The drawer session doc id created/reopened by the open. */
488
+ drawer_session_id: string;
489
+ }
490
+ export interface IWorker_CloseCashDrawerSession {
491
+ tenant_id: string;
492
+ /** The business day (tenant_day_sessions doc id). */
493
+ day_id: string;
494
+ /** The cash drawer doc id. */
495
+ drawer_id: string;
496
+ /** The drawer session doc id being closed. */
497
+ drawer_session_id: string;
498
+ }
@@ -6,24 +6,24 @@
6
6
  * agree on the exact wire shape for these operations. Field semantics:
7
7
  * - `staff_id` / `staff_name` are the operator performing the action.
8
8
  * - `cash_amount` is in integer cents (POS converts decimal balances via
9
- * `convertDecimalToInt`).
9
+ * `convertDecimalToInt`). It exists ONLY on the cash-drawer open (opening
10
+ * float) and close (counted cash) requests — every other lifecycle amount is
11
+ * backend-owned and derived server-side from the cash-drawer ledger.
10
12
  * - `operational_time_zone_offset_gmt` is the tenant's UTC offset (hours) used
11
- * to stamp the local-time fields.
13
+ * to stamp the local-time fields — only where the client clock is trusted
14
+ * (shift open). Day open/reopen use the tenant's stored offset instead.
12
15
  */
13
16
  export interface IOpenTenantDayRequestBody {
14
17
  tenant_id: string;
15
18
  staff_id: string;
16
19
  staff_name: string;
17
20
  note: string;
18
- cash_amount: number;
19
- operational_time_zone_offset_gmt: number;
20
21
  }
21
22
  export interface IReopenTenantDayRequestBody {
22
23
  tenant_id: string;
23
24
  staff_id: string;
24
25
  staff_name: string;
25
26
  note: string;
26
- operational_time_zone_offset_gmt: number;
27
27
  }
28
28
  export interface ICloseTenantDayRequestBody {
29
29
  tenant_id: string;
@@ -31,9 +31,6 @@ export interface ICloseTenantDayRequestBody {
31
31
  staff_id: string;
32
32
  staff_name: string;
33
33
  note?: string;
34
- cash_amount?: number;
35
- expected_cash_amount?: number;
36
- difference?: number;
37
34
  cash_in_out_id?: string | null;
38
35
  }
39
36
  export interface IOpenInstoreShiftRequestBody {
@@ -43,7 +40,6 @@ export interface IOpenInstoreShiftRequestBody {
43
40
  staff_id: string;
44
41
  staff_name: string;
45
42
  note?: string;
46
- cash_amount?: number;
47
43
  operational_time_zone_offset_gmt: number;
48
44
  }
49
45
  export interface ICloseInstoreShiftRequestBody {
@@ -52,16 +48,6 @@ export interface ICloseInstoreShiftRequestBody {
52
48
  staff_id: string;
53
49
  staff_name: string;
54
50
  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
51
  }
66
52
  export interface IReopenInstoreShiftRequestBody {
67
53
  tenant_id: string;
@@ -69,7 +55,6 @@ export interface IReopenInstoreShiftRequestBody {
69
55
  staff_id: string;
70
56
  staff_name: string;
71
57
  note?: string;
72
- cash_amount?: number;
73
58
  }
74
59
  export interface IOpenCashDrawerSessionRequestBody {
75
60
  tenant_id: string;
@@ -79,6 +64,11 @@ export interface IOpenCashDrawerSessionRequestBody {
79
64
  staff_id: string;
80
65
  staff_name: string;
81
66
  note?: string;
67
+ /**
68
+ * The opening float counted into the drawer — one of the two places
69
+ * `cash_amount` is meaningful (the other is the drawer close count).
70
+ * The backend accumulates it into the day/shift opening totals.
71
+ */
82
72
  cash_amount?: number;
83
73
  denominations?: Record<string, number>;
84
74
  }
@@ -87,75 +77,13 @@ export interface ICloseCashDrawerSessionRequestBody {
87
77
  staff_id: string;
88
78
  staff_name: string;
89
79
  note?: string;
90
- cash_amount: number;
91
- denominations: Record<string, number>;
92
- }
93
- /**
94
- * Worker compile payloads for the business day / instore shift lifecycle.
95
- *
96
- * items-service fires these (fire-and-forget) AFTER it completes the
97
- * corresponding lifecycle write; workers-service recompiles derived aggregates
98
- * (shift totals, drawer running balances, day totals + reports) from the
99
- * ledger. The ids are the session/document ids needed to scope the recompile —
100
- * the worker does NOT create or close any lifecycle state.
101
- */
102
- export interface IStartInstoreShiftWorkerBody {
103
- tenant_id: string;
104
- /** The business day (tenant_day_sessions doc id) the shift belongs to. */
105
- day_id: string;
106
- /** The shift session doc id created by the open. */
107
- shift_session_id: string;
108
- /** The shift TEMPLATE id. */
109
- shift_id: string;
110
- }
111
- export interface IEndInstoreShiftWorkerBody {
112
- tenant_id: string;
113
- /** The business day (tenant_day_sessions doc id). */
114
- day_id: string;
115
- /** The shift session doc id being closed. */
116
- shift_session_id: string;
117
- /** The shift TEMPLATE id. */
118
- shift_id: string;
119
- }
120
- export interface IReopenInstoreShiftWorkerBody {
121
- tenant_id: string;
122
- /** The business day (tenant_day_sessions doc id). */
123
- day_id: string;
124
- /** The shift session doc id being reopened. */
125
- shift_session_id: string;
126
- /** The shift TEMPLATE id. */
127
- shift_id: string;
128
- }
129
- export interface IStartTenantDayWorkerBody {
130
- tenant_id: string;
131
- /** The newly opened business day (tenant_day_sessions doc id). */
132
- day_session_id: string;
133
- }
134
- export interface IEndTenantDayWorkerBody {
135
- tenant_id: string;
136
- /** The business day being closed (tenant_day_sessions doc id). */
137
- day_session_id: string;
138
- }
139
- export interface IReopenTenantDayWorkerBody {
140
- tenant_id: string;
141
- /** The business day being reopened (tenant_day_sessions doc id). */
142
- day_session_id: string;
143
- }
144
- export interface IOpenCashDrawerSessionWorkerBody {
145
- tenant_id: string;
146
- /** The business day (tenant_day_sessions doc id). */
147
- day_id: string;
148
- /** The cash drawer doc id. */
149
- drawer_id: string;
150
- /** The drawer session doc id created/reopened by the open. */
151
- drawer_session_id: string;
152
- }
153
- export interface ICloseCashDrawerSessionWorkerBody {
154
- tenant_id: string;
155
- /** The business day (tenant_day_sessions doc id). */
156
- day_id: string;
157
- /** The cash drawer doc id. */
158
- drawer_id: string;
159
- /** The drawer session doc id being closed. */
160
- drawer_session_id: string;
80
+ /**
81
+ * The counted closing cash — the second place `cash_amount` is meaningful.
82
+ * Optional: a drawer may close with a 0 count (backend defaults to 0).
83
+ */
84
+ cash_amount?: number;
85
+ /**
86
+ * Optional like cash_amount — an empty/zero count has no denominations.
87
+ */
88
+ denominations?: Record<string, number>;
161
89
  }
@@ -7,8 +7,11 @@
7
7
  * agree on the exact wire shape for these operations. Field semantics:
8
8
  * - `staff_id` / `staff_name` are the operator performing the action.
9
9
  * - `cash_amount` is in integer cents (POS converts decimal balances via
10
- * `convertDecimalToInt`).
10
+ * `convertDecimalToInt`). It exists ONLY on the cash-drawer open (opening
11
+ * float) and close (counted cash) requests — every other lifecycle amount is
12
+ * backend-owned and derived server-side from the cash-drawer ledger.
11
13
  * - `operational_time_zone_offset_gmt` is the tenant's UTC offset (hours) used
12
- * to stamp the local-time fields.
14
+ * to stamp the local-time fields — only where the client clock is trusted
15
+ * (shift open). Day open/reopen use the tenant's stored offset instead.
13
16
  */
14
17
  Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.2.593",
3
+ "version": "0.2.595",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",