@managesome/eposmatic-toolkit 0.2.791 → 0.2.793
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/constants/DIALER_ENUMS.d.ts +10 -0
- package/lib/constants/index.d.ts +1 -0
- package/lib/constants/index.js +1 -0
- package/lib/helpers/store/catalog-actions.js +43 -5
- package/lib/helpers/types/api-types.d.ts +274 -0
- package/lib/helpers/types/index.d.ts +1 -3
- package/lib/helpers/types/index.js +1 -3
- package/lib/schemas/types/index.d.ts +0 -2
- package/lib/schemas/types/index.js +0 -2
- package/package.json +1 -1
- package/lib/helpers/types/customer_wallet_assignments.d.ts +0 -45
- package/lib/helpers/types/dialer.d.ts +0 -29
- package/lib/helpers/types/google-maps.d.ts +0 -55
- package/lib/helpers/types/google-maps.js +0 -6
- package/lib/schemas/types/shift_day_drawer_requests.d.ts +0 -111
- package/lib/schemas/types/shift_day_drawer_requests.js +0 -17
- /package/lib/{helpers/types/dialer.js → constants/DIALER_ENUMS.js} +0 -0
- /package/lib/helpers/types/{customer_wallet_assignments.js → api-types.js} +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare enum DIALER_TYPES_ENUM {
|
|
2
|
+
INCOMING_CALL = "INCOMING_CALL",
|
|
3
|
+
OUTGOING_CALL = "OUTGOING_CALL",
|
|
4
|
+
MISSED_CALL = "MISSED_CALL",
|
|
5
|
+
CALL_ENDED = "CALL_ENDED",
|
|
6
|
+
CALL_DECLINED = "CALL_DECLINED",
|
|
7
|
+
CALL_ANSWERED = "CALL_ANSWERED",
|
|
8
|
+
POS_PING = "POS_PING"
|
|
9
|
+
}
|
|
10
|
+
export declare const ALL_DIALER_TYPE_EVENTS: DIALER_TYPES_ENUM[];
|
package/lib/constants/index.d.ts
CHANGED
package/lib/constants/index.js
CHANGED
|
@@ -18,6 +18,7 @@ __exportStar(require("./ANALYTICS"), exports);
|
|
|
18
18
|
__exportStar(require("./API_ERRORS"), exports);
|
|
19
19
|
__exportStar(require("./COMMON"), exports);
|
|
20
20
|
__exportStar(require("./DELIVERY"), exports);
|
|
21
|
+
__exportStar(require("./DIALER_ENUMS"), exports);
|
|
21
22
|
__exportStar(require("./ENUMS"), exports);
|
|
22
23
|
__exportStar(require("./FBR_ENUMS"), exports);
|
|
23
24
|
__exportStar(require("./HUBRISE_ENUMS"), exports);
|
|
@@ -281,11 +281,35 @@ function getSelectedVendorInventoryItems(mappedInventory, includedCategories, ca
|
|
|
281
281
|
refToId.set(c.ref_id, c._id);
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
|
-
|
|
284
|
+
// A vendor can hold BOTH a legacy ref_id-keyed entry and a synced
|
|
285
|
+
// _id-keyed entry for one category (the drawer appends the synced entry
|
|
286
|
+
// without recognizing the legacy one). Merge them by canonical category id
|
|
287
|
+
// first — otherwise the legacy entry (typically excluded_items: [])
|
|
288
|
+
// re-includes every item the synced entry excluded, leaking them into the
|
|
289
|
+
// catalog. The `_id`-keyed entry reflects the newest form save, so it wins.
|
|
290
|
+
const mergedCategories = [];
|
|
291
|
+
const mergedIndexByCanonicalId = new Map();
|
|
285
292
|
for (let i = 0; i < includedCategories.length; i++) {
|
|
286
|
-
const
|
|
287
|
-
const
|
|
288
|
-
const
|
|
293
|
+
const entry = includedCategories[i];
|
|
294
|
+
const rawCategoryId = entry.category_id ?? '';
|
|
295
|
+
const canonicalCategoryId = refToId.get(rawCategoryId) ?? rawCategoryId;
|
|
296
|
+
const mergedIndex = mergedIndexByCanonicalId.get(canonicalCategoryId);
|
|
297
|
+
const mergedEntry = {
|
|
298
|
+
category_id: canonicalCategoryId,
|
|
299
|
+
excluded_items: entry.excluded_items ?? [],
|
|
300
|
+
};
|
|
301
|
+
if (mergedIndex === undefined) {
|
|
302
|
+
mergedIndexByCanonicalId.set(canonicalCategoryId, mergedCategories.length);
|
|
303
|
+
mergedCategories.push(mergedEntry);
|
|
304
|
+
}
|
|
305
|
+
else if (rawCategoryId === canonicalCategoryId) {
|
|
306
|
+
mergedCategories[mergedIndex] = mergedEntry;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
const result = [];
|
|
310
|
+
for (let i = 0; i < mergedCategories.length; i++) {
|
|
311
|
+
const { category_id, excluded_items } = mergedCategories[i];
|
|
312
|
+
const items = mappedInventory[category_id ?? ''];
|
|
289
313
|
if (!items)
|
|
290
314
|
continue;
|
|
291
315
|
if (excluded_items.length === 0) {
|
|
@@ -334,9 +358,23 @@ function getGroupedInventoryCategories(categories, items) {
|
|
|
334
358
|
// would omit those items from the group.
|
|
335
359
|
const sortedCategories = [...categories].sort((a, b) => a.sort_id - b.sort_id);
|
|
336
360
|
for (const cat of sortedCategories) {
|
|
361
|
+
// Items can be stored under BOTH keys when legacy (ref_id) and synced
|
|
362
|
+
// (_id) data coexist — merge the two sets instead of the old `||` fallback,
|
|
363
|
+
// which silently dropped one of them. The PO container merges both, so
|
|
364
|
+
// dropped items leaked into the PO without ever being visible/selectable
|
|
365
|
+
// here. De-dupe for the legacy case ref_id === _id.
|
|
366
|
+
const refItems = cat.ref_id ? (itemsByCategory[cat.ref_id] ?? []) : [];
|
|
367
|
+
const idItems = cat._id ? (itemsByCategory[cat._id] ?? []) : [];
|
|
368
|
+
const seenItemIds = new Set();
|
|
369
|
+
const items = [...refItems, ...idItems].filter((item) => {
|
|
370
|
+
if (seenItemIds.has(item._id))
|
|
371
|
+
return false;
|
|
372
|
+
seenItemIds.add(item._id);
|
|
373
|
+
return true;
|
|
374
|
+
});
|
|
337
375
|
result.push({
|
|
338
376
|
category: cat,
|
|
339
|
-
items
|
|
377
|
+
items,
|
|
340
378
|
});
|
|
341
379
|
}
|
|
342
380
|
// Append uncategorized items as a synthetic category (ref_id: null so the API receives null, not a fake string)
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { CUSTOMER_TARGET_MODE_ENUM, DIALER_TYPES_ENUM, WALLET_ASSET_TYPE_ENUM, WALLET_ASSIGNMENT_BEHAVIOR_ENUM } from '../../constants';
|
|
2
|
+
/**
|
|
3
|
+
* Request/response contracts for backend service APIs, shared between apps and
|
|
4
|
+
* services (items-service, POS frontends, provider integrations).
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Request body for `DELETE /items/bulk-delete/:tenant_id` (items-service).
|
|
8
|
+
*
|
|
9
|
+
* `item_ids` is capped at 100 unique ids per call and validated
|
|
10
|
+
* all-or-nothing: if any id is missing for the tenant or belongs to a shared
|
|
11
|
+
* record this store cannot mutate, the whole call is rejected with a 400 that
|
|
12
|
+
* lists the offending ids.
|
|
13
|
+
*/
|
|
14
|
+
export interface IBulkDeleteItemsBody {
|
|
15
|
+
item_ids: string[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Request body for `DELETE /categories/bulk-delete/:tenant_id` (items-service).
|
|
19
|
+
*
|
|
20
|
+
* `category_ids` is capped at 100 unique ids per call and validated
|
|
21
|
+
* all-or-nothing: if any id is missing for the tenant, belongs to a shared
|
|
22
|
+
* record this store cannot mutate, or still contains items for the tenant,
|
|
23
|
+
* the whole call is rejected with a 400.
|
|
24
|
+
*/
|
|
25
|
+
export interface IBulkDeleteCategoriesBody {
|
|
26
|
+
category_ids: string[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Response shared by `DELETE /items/bulk-delete/:tenant_id` and
|
|
30
|
+
* `DELETE /categories/bulk-delete/:tenant_id` (items-service).
|
|
31
|
+
*/
|
|
32
|
+
export interface IBulkDeleteResponse {
|
|
33
|
+
/** Number of unique ids requested for deletion. */
|
|
34
|
+
requested_count: number;
|
|
35
|
+
/** Number of documents actually deleted (equals `requested_count` on success). */
|
|
36
|
+
deleted_count: number;
|
|
37
|
+
/** Canonical ids of the deleted documents. */
|
|
38
|
+
_ids: string[];
|
|
39
|
+
/** Union of tenants whose caches were invalidated by the deletion. */
|
|
40
|
+
tenants: string[];
|
|
41
|
+
}
|
|
42
|
+
/** Response of `DELETE /items/bulk-delete/:tenant_id` (items-service). */
|
|
43
|
+
export type IBulkDeleteItemsResponse = IBulkDeleteResponse;
|
|
44
|
+
/** Response of `DELETE /categories/bulk-delete/:tenant_id` (items-service). */
|
|
45
|
+
export type IBulkDeleteCategoriesResponse = IBulkDeleteResponse;
|
|
46
|
+
export interface IPreviewTargetCustomersBody {
|
|
47
|
+
mode: CUSTOMER_TARGET_MODE_ENUM;
|
|
48
|
+
search?: string;
|
|
49
|
+
limit?: number;
|
|
50
|
+
phone_numbers?: string[];
|
|
51
|
+
}
|
|
52
|
+
export interface ICustomerWalletPreview {
|
|
53
|
+
phone_number: string;
|
|
54
|
+
display_name: string | null;
|
|
55
|
+
total_orders: number;
|
|
56
|
+
total_spent: number;
|
|
57
|
+
delivery_orders: number;
|
|
58
|
+
delivery_spent: number;
|
|
59
|
+
voucher_total_count: number;
|
|
60
|
+
gift_card_total_count: number;
|
|
61
|
+
voucher_distinct_count: number;
|
|
62
|
+
gift_card_distinct_count: number;
|
|
63
|
+
exists: boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface IPreviewTargetCustomersResponse {
|
|
66
|
+
mode: CUSTOMER_TARGET_MODE_ENUM;
|
|
67
|
+
total: number;
|
|
68
|
+
customers: ICustomerWalletPreview[];
|
|
69
|
+
}
|
|
70
|
+
export interface IAssignWalletAssetsBody {
|
|
71
|
+
behavior: WALLET_ASSIGNMENT_BEHAVIOR_ENUM;
|
|
72
|
+
code_quantities: Record<string, number>;
|
|
73
|
+
phone_numbers: string[];
|
|
74
|
+
auto_create_missing?: boolean;
|
|
75
|
+
}
|
|
76
|
+
export interface IWalletAssignmentFailure {
|
|
77
|
+
phone_number: string;
|
|
78
|
+
reason: string;
|
|
79
|
+
}
|
|
80
|
+
export interface IWalletAssignmentResponse {
|
|
81
|
+
asset_type: WALLET_ASSET_TYPE_ENUM;
|
|
82
|
+
behavior: WALLET_ASSIGNMENT_BEHAVIOR_ENUM;
|
|
83
|
+
code_quantities: Record<string, number>;
|
|
84
|
+
requested_count: number;
|
|
85
|
+
updated_count: number;
|
|
86
|
+
failed_count: number;
|
|
87
|
+
updated_phone_numbers: string[];
|
|
88
|
+
failures: IWalletAssignmentFailure[];
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Request body contracts for the business day / instore shift / cash drawer
|
|
92
|
+
* lifecycle endpoints (open / reopen / close).
|
|
93
|
+
*
|
|
94
|
+
* Shared between the backend (items-service) and the POS frontend so both sides
|
|
95
|
+
* agree on the exact wire shape for these operations. Field semantics:
|
|
96
|
+
* - `staff_id` / `staff_name` are the operator performing the action.
|
|
97
|
+
* - `cash_amount` is in integer cents (POS converts decimal balances via
|
|
98
|
+
* `convertDecimalToInt`). It exists on the cash-drawer open (opening float),
|
|
99
|
+
* reopen (registered count — becomes the drawer's running balance) and close
|
|
100
|
+
* (counted cash) requests — every other lifecycle amount is backend-owned and
|
|
101
|
+
* derived server-side from the cash-drawer ledger.
|
|
102
|
+
* - `operational_time_zone_offset_gmt` is NOT part of any request — local-time
|
|
103
|
+
* fields are always stamped server-side from the tenant's stored offset.
|
|
104
|
+
*/
|
|
105
|
+
export interface IOpenTenantDayRequestBody {
|
|
106
|
+
tenant_id: string;
|
|
107
|
+
staff_id: string;
|
|
108
|
+
staff_name: string;
|
|
109
|
+
note: string;
|
|
110
|
+
}
|
|
111
|
+
export interface IReopenTenantDayRequestBody {
|
|
112
|
+
tenant_id: string;
|
|
113
|
+
staff_id: string;
|
|
114
|
+
staff_name: string;
|
|
115
|
+
note: string;
|
|
116
|
+
}
|
|
117
|
+
export interface ICloseTenantDayRequestBody {
|
|
118
|
+
tenant_id: string;
|
|
119
|
+
day_session_id: string;
|
|
120
|
+
staff_id: string;
|
|
121
|
+
staff_name: string;
|
|
122
|
+
note?: string;
|
|
123
|
+
}
|
|
124
|
+
export interface IOpenInstoreShiftRequestBody {
|
|
125
|
+
tenant_id: string;
|
|
126
|
+
day_id: string;
|
|
127
|
+
shift_id: string;
|
|
128
|
+
staff_id: string;
|
|
129
|
+
staff_name: string;
|
|
130
|
+
note?: string;
|
|
131
|
+
}
|
|
132
|
+
export interface ICloseInstoreShiftRequestBody {
|
|
133
|
+
tenant_id: string;
|
|
134
|
+
shift_session_id: string;
|
|
135
|
+
staff_id: string;
|
|
136
|
+
staff_name: string;
|
|
137
|
+
note?: string;
|
|
138
|
+
}
|
|
139
|
+
export interface IReopenInstoreShiftRequestBody {
|
|
140
|
+
tenant_id: string;
|
|
141
|
+
shift_session_id: string;
|
|
142
|
+
staff_id: string;
|
|
143
|
+
staff_name: string;
|
|
144
|
+
note?: string;
|
|
145
|
+
}
|
|
146
|
+
export interface IOpenCashDrawerSessionRequestBody {
|
|
147
|
+
tenant_id: string;
|
|
148
|
+
drawer_id: string;
|
|
149
|
+
drawer_name?: string;
|
|
150
|
+
day_id: string;
|
|
151
|
+
staff_id: string;
|
|
152
|
+
staff_name: string;
|
|
153
|
+
note?: string;
|
|
154
|
+
/**
|
|
155
|
+
* The opening float counted into the drawer — one of the two places
|
|
156
|
+
* `cash_amount` is meaningful (the other is the drawer close count).
|
|
157
|
+
* The backend accumulates it into the day/shift opening totals.
|
|
158
|
+
*/
|
|
159
|
+
cash_amount?: number;
|
|
160
|
+
denominations?: Record<string, number>;
|
|
161
|
+
}
|
|
162
|
+
export interface ICloseCashDrawerSessionRequestBody {
|
|
163
|
+
tenant_id: string;
|
|
164
|
+
/**
|
|
165
|
+
* The drawer session to close — carried in the body (the route is
|
|
166
|
+
* `PUT /close-drawer`, mirroring `day_session_id` on close-day).
|
|
167
|
+
*/
|
|
168
|
+
drawer_session_id: string;
|
|
169
|
+
staff_id: string;
|
|
170
|
+
staff_name: string;
|
|
171
|
+
note?: string;
|
|
172
|
+
/**
|
|
173
|
+
* The counted closing cash — the second place `cash_amount` is meaningful.
|
|
174
|
+
* Optional: a drawer may close with a 0 count (backend defaults to 0).
|
|
175
|
+
*/
|
|
176
|
+
cash_amount?: number;
|
|
177
|
+
/**
|
|
178
|
+
* Optional like cash_amount — an empty/zero count has no denominations.
|
|
179
|
+
*/
|
|
180
|
+
denominations?: Record<string, number>;
|
|
181
|
+
}
|
|
182
|
+
export interface IReopenCashDrawerSessionRequestBody {
|
|
183
|
+
tenant_id: string;
|
|
184
|
+
/**
|
|
185
|
+
* The drawer session to reopen — carried in the body (the route is
|
|
186
|
+
* `PUT /reopen-drawer`, mirroring `drawer_session_id` on close-drawer).
|
|
187
|
+
*/
|
|
188
|
+
drawer_session_id: string;
|
|
189
|
+
staff_id: string;
|
|
190
|
+
staff_name: string;
|
|
191
|
+
note?: string;
|
|
192
|
+
/**
|
|
193
|
+
* The registered count at reopen — the balance the drawer resumes with.
|
|
194
|
+
* The backend adds it to the cash in/out ledger as a CASH_IN (like a drawer
|
|
195
|
+
* open) and sets it as the session's `running_balance`; the original opening
|
|
196
|
+
* float is preserved and is NOT added to the day/shift opening totals.
|
|
197
|
+
* Optional: if omitted, the backend falls back to the close's expected cash.
|
|
198
|
+
*/
|
|
199
|
+
cash_amount?: number;
|
|
200
|
+
}
|
|
201
|
+
export interface IDialerRequest {
|
|
202
|
+
request_id: string;
|
|
203
|
+
tenant_id: string;
|
|
204
|
+
phone_number: string;
|
|
205
|
+
pos_id: string;
|
|
206
|
+
staff_id: string | null;
|
|
207
|
+
staff_phone: string | null;
|
|
208
|
+
action: DIALER_TYPES_ENUM;
|
|
209
|
+
}
|
|
210
|
+
export interface IDialerResponse {
|
|
211
|
+
request_id: string;
|
|
212
|
+
tenant_id: string;
|
|
213
|
+
phone_number: string;
|
|
214
|
+
pos_id: string;
|
|
215
|
+
staff_id: string | null;
|
|
216
|
+
staff_phone: string | null;
|
|
217
|
+
action: DIALER_TYPES_ENUM;
|
|
218
|
+
timestamp: number;
|
|
219
|
+
}
|
|
220
|
+
export interface IGoogleMapsAutocompleteRequest {
|
|
221
|
+
input: string;
|
|
222
|
+
sessionToken?: string;
|
|
223
|
+
locationBias?: {
|
|
224
|
+
center: {
|
|
225
|
+
lat: number;
|
|
226
|
+
lng: number;
|
|
227
|
+
};
|
|
228
|
+
radius: number;
|
|
229
|
+
};
|
|
230
|
+
region?: string;
|
|
231
|
+
}
|
|
232
|
+
export interface IGoogleMapsAutocompleteSuggestion {
|
|
233
|
+
place_id: string;
|
|
234
|
+
description: string;
|
|
235
|
+
secondary_text: string;
|
|
236
|
+
distance_meters: number;
|
|
237
|
+
}
|
|
238
|
+
export interface IGoogleMapsAutocompleteResponse {
|
|
239
|
+
suggestions: IGoogleMapsAutocompleteSuggestion[];
|
|
240
|
+
sessionToken: string;
|
|
241
|
+
}
|
|
242
|
+
export interface IGoogleMapsPlaceDetailsResponse {
|
|
243
|
+
place_id: string;
|
|
244
|
+
formatted_address: string;
|
|
245
|
+
lat: number;
|
|
246
|
+
lng: number;
|
|
247
|
+
city: string;
|
|
248
|
+
state: string;
|
|
249
|
+
country: string;
|
|
250
|
+
postal_code: string;
|
|
251
|
+
}
|
|
252
|
+
export interface IGoogleMapsGeocodeResponse {
|
|
253
|
+
formatted_address: string;
|
|
254
|
+
place_id: string;
|
|
255
|
+
city: string;
|
|
256
|
+
state: string;
|
|
257
|
+
country: string;
|
|
258
|
+
postal_code: string;
|
|
259
|
+
}
|
|
260
|
+
export interface IGoogleMapsRouteRequest {
|
|
261
|
+
origin: {
|
|
262
|
+
lat: number;
|
|
263
|
+
lng: number;
|
|
264
|
+
};
|
|
265
|
+
destination: {
|
|
266
|
+
lat: number;
|
|
267
|
+
lng: number;
|
|
268
|
+
};
|
|
269
|
+
travelMode?: 'DRIVE' | 'TWO_WHEELER';
|
|
270
|
+
}
|
|
271
|
+
export interface IGoogleMapsRouteResponse {
|
|
272
|
+
polyline?: [number, number][];
|
|
273
|
+
distanceMeters: number;
|
|
274
|
+
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
+
export * from './api-types';
|
|
1
2
|
export * from './cart-actions';
|
|
2
3
|
export * from './cart-helpers';
|
|
3
4
|
export * from './catalog';
|
|
4
5
|
export * from './common';
|
|
5
|
-
export * from './customer_wallet_assignments';
|
|
6
|
-
export * from './dialer';
|
|
7
6
|
export * from './email-templates';
|
|
8
7
|
export * from './fbr-generate-invoice';
|
|
9
|
-
export * from './google-maps';
|
|
10
8
|
export * from './halfhalf';
|
|
11
9
|
export * from './hubrise_catalog';
|
|
12
10
|
export * from './hubrise_customers';
|
|
@@ -14,15 +14,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./api-types"), exports);
|
|
17
18
|
__exportStar(require("./cart-actions"), exports);
|
|
18
19
|
__exportStar(require("./cart-helpers"), exports);
|
|
19
20
|
__exportStar(require("./catalog"), exports);
|
|
20
21
|
__exportStar(require("./common"), exports);
|
|
21
|
-
__exportStar(require("./customer_wallet_assignments"), exports);
|
|
22
|
-
__exportStar(require("./dialer"), exports);
|
|
23
22
|
__exportStar(require("./email-templates"), exports);
|
|
24
23
|
__exportStar(require("./fbr-generate-invoice"), exports);
|
|
25
|
-
__exportStar(require("./google-maps"), exports);
|
|
26
24
|
__exportStar(require("./halfhalf"), exports);
|
|
27
25
|
__exportStar(require("./hubrise_catalog"), exports);
|
|
28
26
|
__exportStar(require("./hubrise_customers"), exports);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from '../../helpers/types/customer_wallet_assignments';
|
|
2
1
|
export * from './app_configs';
|
|
3
2
|
export * from './applied_order_discounts';
|
|
4
3
|
export * from './brands';
|
|
@@ -46,7 +45,6 @@ export * from './reservations';
|
|
|
46
45
|
export * from './reviews';
|
|
47
46
|
export * from './rewards_usage';
|
|
48
47
|
export * from './riders';
|
|
49
|
-
export * from './shift_day_drawer_requests';
|
|
50
48
|
export * from './specials';
|
|
51
49
|
export * from './staff_shifts';
|
|
52
50
|
export * from './tenant-activity-logs';
|
|
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("../../helpers/types/customer_wallet_assignments"), exports);
|
|
18
17
|
__exportStar(require("./app_configs"), exports);
|
|
19
18
|
__exportStar(require("./applied_order_discounts"), exports);
|
|
20
19
|
__exportStar(require("./brands"), exports);
|
|
@@ -62,7 +61,6 @@ __exportStar(require("./reservations"), exports);
|
|
|
62
61
|
__exportStar(require("./reviews"), exports);
|
|
63
62
|
__exportStar(require("./rewards_usage"), exports);
|
|
64
63
|
__exportStar(require("./riders"), exports);
|
|
65
|
-
__exportStar(require("./shift_day_drawer_requests"), exports);
|
|
66
64
|
__exportStar(require("./specials"), exports);
|
|
67
65
|
__exportStar(require("./staff_shifts"), exports);
|
|
68
66
|
__exportStar(require("./tenant-activity-logs"), exports);
|
package/package.json
CHANGED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { CUSTOMER_TARGET_MODE_ENUM, WALLET_ASSET_TYPE_ENUM, WALLET_ASSIGNMENT_BEHAVIOR_ENUM } from '../../constants';
|
|
2
|
-
export interface IPreviewTargetCustomersBody {
|
|
3
|
-
mode: CUSTOMER_TARGET_MODE_ENUM;
|
|
4
|
-
search?: string;
|
|
5
|
-
limit?: number;
|
|
6
|
-
phone_numbers?: string[];
|
|
7
|
-
}
|
|
8
|
-
export interface ICustomerWalletPreview {
|
|
9
|
-
phone_number: string;
|
|
10
|
-
display_name: string | null;
|
|
11
|
-
total_orders: number;
|
|
12
|
-
total_spent: number;
|
|
13
|
-
delivery_orders: number;
|
|
14
|
-
delivery_spent: number;
|
|
15
|
-
voucher_total_count: number;
|
|
16
|
-
gift_card_total_count: number;
|
|
17
|
-
voucher_distinct_count: number;
|
|
18
|
-
gift_card_distinct_count: number;
|
|
19
|
-
exists: boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface IPreviewTargetCustomersResponse {
|
|
22
|
-
mode: CUSTOMER_TARGET_MODE_ENUM;
|
|
23
|
-
total: number;
|
|
24
|
-
customers: ICustomerWalletPreview[];
|
|
25
|
-
}
|
|
26
|
-
export interface IAssignWalletAssetsBody {
|
|
27
|
-
behavior: WALLET_ASSIGNMENT_BEHAVIOR_ENUM;
|
|
28
|
-
code_quantities: Record<string, number>;
|
|
29
|
-
phone_numbers: string[];
|
|
30
|
-
auto_create_missing?: boolean;
|
|
31
|
-
}
|
|
32
|
-
export interface IWalletAssignmentFailure {
|
|
33
|
-
phone_number: string;
|
|
34
|
-
reason: string;
|
|
35
|
-
}
|
|
36
|
-
export interface IWalletAssignmentResponse {
|
|
37
|
-
asset_type: WALLET_ASSET_TYPE_ENUM;
|
|
38
|
-
behavior: WALLET_ASSIGNMENT_BEHAVIOR_ENUM;
|
|
39
|
-
code_quantities: Record<string, number>;
|
|
40
|
-
requested_count: number;
|
|
41
|
-
updated_count: number;
|
|
42
|
-
failed_count: number;
|
|
43
|
-
updated_phone_numbers: string[];
|
|
44
|
-
failures: IWalletAssignmentFailure[];
|
|
45
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export declare enum DIALER_TYPES_ENUM {
|
|
2
|
-
INCOMING_CALL = "INCOMING_CALL",
|
|
3
|
-
OUTGOING_CALL = "OUTGOING_CALL",
|
|
4
|
-
MISSED_CALL = "MISSED_CALL",
|
|
5
|
-
CALL_ENDED = "CALL_ENDED",
|
|
6
|
-
CALL_DECLINED = "CALL_DECLINED",
|
|
7
|
-
CALL_ANSWERED = "CALL_ANSWERED",
|
|
8
|
-
POS_PING = "POS_PING"
|
|
9
|
-
}
|
|
10
|
-
export declare const ALL_DIALER_TYPE_EVENTS: DIALER_TYPES_ENUM[];
|
|
11
|
-
export interface IDialerRequest {
|
|
12
|
-
request_id: string;
|
|
13
|
-
tenant_id: string;
|
|
14
|
-
phone_number: string;
|
|
15
|
-
pos_id: string;
|
|
16
|
-
staff_id: string | null;
|
|
17
|
-
staff_phone: string | null;
|
|
18
|
-
action: DIALER_TYPES_ENUM;
|
|
19
|
-
}
|
|
20
|
-
export interface IDialerResponse {
|
|
21
|
-
request_id: string;
|
|
22
|
-
tenant_id: string;
|
|
23
|
-
phone_number: string;
|
|
24
|
-
pos_id: string;
|
|
25
|
-
staff_id: string | null;
|
|
26
|
-
staff_phone: string | null;
|
|
27
|
-
action: DIALER_TYPES_ENUM;
|
|
28
|
-
timestamp: number;
|
|
29
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export interface IGoogleMapsAutocompleteRequest {
|
|
2
|
-
input: string;
|
|
3
|
-
sessionToken?: string;
|
|
4
|
-
locationBias?: {
|
|
5
|
-
center: {
|
|
6
|
-
lat: number;
|
|
7
|
-
lng: number;
|
|
8
|
-
};
|
|
9
|
-
radius: number;
|
|
10
|
-
};
|
|
11
|
-
region?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface IGoogleMapsAutocompleteSuggestion {
|
|
14
|
-
place_id: string;
|
|
15
|
-
description: string;
|
|
16
|
-
secondary_text: string;
|
|
17
|
-
distance_meters: number;
|
|
18
|
-
}
|
|
19
|
-
export interface IGoogleMapsAutocompleteResponse {
|
|
20
|
-
suggestions: IGoogleMapsAutocompleteSuggestion[];
|
|
21
|
-
sessionToken: string;
|
|
22
|
-
}
|
|
23
|
-
export interface IGoogleMapsPlaceDetailsResponse {
|
|
24
|
-
place_id: string;
|
|
25
|
-
formatted_address: string;
|
|
26
|
-
lat: number;
|
|
27
|
-
lng: number;
|
|
28
|
-
city: string;
|
|
29
|
-
state: string;
|
|
30
|
-
country: string;
|
|
31
|
-
postal_code: string;
|
|
32
|
-
}
|
|
33
|
-
export interface IGoogleMapsGeocodeResponse {
|
|
34
|
-
formatted_address: string;
|
|
35
|
-
place_id: string;
|
|
36
|
-
city: string;
|
|
37
|
-
state: string;
|
|
38
|
-
country: string;
|
|
39
|
-
postal_code: string;
|
|
40
|
-
}
|
|
41
|
-
export interface IGoogleMapsRouteRequest {
|
|
42
|
-
origin: {
|
|
43
|
-
lat: number;
|
|
44
|
-
lng: number;
|
|
45
|
-
};
|
|
46
|
-
destination: {
|
|
47
|
-
lat: number;
|
|
48
|
-
lng: number;
|
|
49
|
-
};
|
|
50
|
-
travelMode?: 'DRIVE' | 'TWO_WHEELER';
|
|
51
|
-
}
|
|
52
|
-
export interface IGoogleMapsRouteResponse {
|
|
53
|
-
polyline?: [number, number][];
|
|
54
|
-
distanceMeters: number;
|
|
55
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// ============================================================
|
|
3
|
-
// Google Maps Proxy API — Shared Contracts
|
|
4
|
-
// Used by: items-service (backend), pos-web / customer-website (frontend)
|
|
5
|
-
// ============================================================
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,111 +0,0 @@
|
|
|
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`). It exists on the cash-drawer open (opening float),
|
|
10
|
-
* reopen (registered count — becomes the drawer's running balance) and close
|
|
11
|
-
* (counted cash) requests — every other lifecycle amount is backend-owned and
|
|
12
|
-
* derived server-side from the cash-drawer ledger.
|
|
13
|
-
* - `operational_time_zone_offset_gmt` is NOT part of any request — local-time
|
|
14
|
-
* fields are always stamped server-side from the tenant's stored offset.
|
|
15
|
-
*/
|
|
16
|
-
export interface IOpenTenantDayRequestBody {
|
|
17
|
-
tenant_id: string;
|
|
18
|
-
staff_id: string;
|
|
19
|
-
staff_name: string;
|
|
20
|
-
note: string;
|
|
21
|
-
}
|
|
22
|
-
export interface IReopenTenantDayRequestBody {
|
|
23
|
-
tenant_id: string;
|
|
24
|
-
staff_id: string;
|
|
25
|
-
staff_name: string;
|
|
26
|
-
note: string;
|
|
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
|
-
}
|
|
35
|
-
export interface IOpenInstoreShiftRequestBody {
|
|
36
|
-
tenant_id: string;
|
|
37
|
-
day_id: string;
|
|
38
|
-
shift_id: string;
|
|
39
|
-
staff_id: string;
|
|
40
|
-
staff_name: string;
|
|
41
|
-
note?: string;
|
|
42
|
-
}
|
|
43
|
-
export interface ICloseInstoreShiftRequestBody {
|
|
44
|
-
tenant_id: string;
|
|
45
|
-
shift_session_id: string;
|
|
46
|
-
staff_id: string;
|
|
47
|
-
staff_name: string;
|
|
48
|
-
note?: string;
|
|
49
|
-
}
|
|
50
|
-
export interface IReopenInstoreShiftRequestBody {
|
|
51
|
-
tenant_id: string;
|
|
52
|
-
shift_session_id: string;
|
|
53
|
-
staff_id: string;
|
|
54
|
-
staff_name: string;
|
|
55
|
-
note?: string;
|
|
56
|
-
}
|
|
57
|
-
export interface IOpenCashDrawerSessionRequestBody {
|
|
58
|
-
tenant_id: string;
|
|
59
|
-
drawer_id: string;
|
|
60
|
-
drawer_name?: string;
|
|
61
|
-
day_id: string;
|
|
62
|
-
staff_id: string;
|
|
63
|
-
staff_name: string;
|
|
64
|
-
note?: string;
|
|
65
|
-
/**
|
|
66
|
-
* The opening float counted into the drawer — one of the two places
|
|
67
|
-
* `cash_amount` is meaningful (the other is the drawer close count).
|
|
68
|
-
* The backend accumulates it into the day/shift opening totals.
|
|
69
|
-
*/
|
|
70
|
-
cash_amount?: number;
|
|
71
|
-
denominations?: Record<string, number>;
|
|
72
|
-
}
|
|
73
|
-
export interface ICloseCashDrawerSessionRequestBody {
|
|
74
|
-
tenant_id: string;
|
|
75
|
-
/**
|
|
76
|
-
* The drawer session to close — carried in the body (the route is
|
|
77
|
-
* `PUT /close-drawer`, mirroring `day_session_id` on close-day).
|
|
78
|
-
*/
|
|
79
|
-
drawer_session_id: string;
|
|
80
|
-
staff_id: string;
|
|
81
|
-
staff_name: string;
|
|
82
|
-
note?: string;
|
|
83
|
-
/**
|
|
84
|
-
* The counted closing cash — the second place `cash_amount` is meaningful.
|
|
85
|
-
* Optional: a drawer may close with a 0 count (backend defaults to 0).
|
|
86
|
-
*/
|
|
87
|
-
cash_amount?: number;
|
|
88
|
-
/**
|
|
89
|
-
* Optional like cash_amount — an empty/zero count has no denominations.
|
|
90
|
-
*/
|
|
91
|
-
denominations?: Record<string, number>;
|
|
92
|
-
}
|
|
93
|
-
export interface IReopenCashDrawerSessionRequestBody {
|
|
94
|
-
tenant_id: string;
|
|
95
|
-
/**
|
|
96
|
-
* The drawer session to reopen — carried in the body (the route is
|
|
97
|
-
* `PUT /reopen-drawer`, mirroring `drawer_session_id` on close-drawer).
|
|
98
|
-
*/
|
|
99
|
-
drawer_session_id: string;
|
|
100
|
-
staff_id: string;
|
|
101
|
-
staff_name: string;
|
|
102
|
-
note?: string;
|
|
103
|
-
/**
|
|
104
|
-
* The registered count at reopen — the balance the drawer resumes with.
|
|
105
|
-
* The backend adds it to the cash in/out ledger as a CASH_IN (like a drawer
|
|
106
|
-
* open) and sets it as the session's `running_balance`; the original opening
|
|
107
|
-
* float is preserved and is NOT added to the day/shift opening totals.
|
|
108
|
-
* Optional: if omitted, the backend falls back to the close's expected cash.
|
|
109
|
-
*/
|
|
110
|
-
cash_amount?: number;
|
|
111
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
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`). It exists on the cash-drawer open (opening float),
|
|
11
|
-
* reopen (registered count — becomes the drawer's running balance) and close
|
|
12
|
-
* (counted cash) requests — every other lifecycle amount is backend-owned and
|
|
13
|
-
* derived server-side from the cash-drawer ledger.
|
|
14
|
-
* - `operational_time_zone_offset_gmt` is NOT part of any request — local-time
|
|
15
|
-
* fields are always stamped server-side from the tenant's stored offset.
|
|
16
|
-
*/
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
File without changes
|
|
File without changes
|