@managesome/eposmatic-toolkit 0.4.36 → 0.4.38

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.
Files changed (53) hide show
  1. package/esm/constants/accounting-templates.js +431 -0
  2. package/esm/constants/index.js +1 -0
  3. package/esm/helpers/materialized-reports/materialized-prep-time-classification-helpers.js +1 -3
  4. package/esm/helpers/materialized-reports/materialized-prep-time-read-helpers.js +5 -14
  5. package/lib/constants/accounting-templates.d.ts +8 -0
  6. package/lib/constants/accounting-templates.js +434 -0
  7. package/lib/constants/index.d.ts +1 -0
  8. package/lib/constants/index.js +1 -0
  9. package/lib/helpers/materialized-reports/materialized-prep-time-classification-helpers.js +1 -3
  10. package/lib/helpers/materialized-reports/materialized-prep-time-read-helpers.js +5 -14
  11. package/lib/schemas/models/expense_categories.d.ts +3 -3
  12. package/lib/schemas/models/expense_details.d.ts +3 -3
  13. package/lib/schemas/models/gift_cards.d.ts +3 -3
  14. package/lib/schemas/models/halfhalf_setup.d.ts +3 -3
  15. package/lib/schemas/models/internal_invoices.d.ts +3 -3
  16. package/lib/schemas/models/items.d.ts +12 -12
  17. package/lib/schemas/models/marketing_fingerprints.d.ts +3 -3
  18. package/lib/schemas/models/modifier_extras.d.ts +3 -3
  19. package/lib/schemas/models/offers.d.ts +3 -3
  20. package/lib/schemas/models/public_holidays.d.ts +3 -3
  21. package/lib/schemas/models/specials.d.ts +3 -3
  22. package/lib/schemas/models/tenant_chart_of_accounts.d.ts +3 -3
  23. package/lib/schemas/models/tenant_hr_departments.d.ts +3 -3
  24. package/lib/schemas/models/tenant_hr_documents.d.ts +3 -3
  25. package/lib/schemas/models/tenant_hr_policies.d.ts +3 -3
  26. package/lib/schemas/models/tenant_hr_positions.d.ts +3 -3
  27. package/lib/schemas/models/tenant_journal_entries.d.ts +3 -3
  28. package/lib/schemas/models/void_order_items.d.ts +3 -3
  29. package/lib/schemas/models/vouchers.d.ts +3 -3
  30. package/lib/schemas/models/warehouse_communications.d.ts +3 -3
  31. package/lib/schemas/models/warehouse_items.d.ts +3 -3
  32. package/lib/schemas/models/warehouse_void_purchase_order_items.d.ts +3 -3
  33. package/lib/schemas/models/warehouse_void_sale_order_items.d.ts +3 -3
  34. package/lib/schemas/types/tenant_chart_of_accounts.d.ts +7 -0
  35. package/lib/tests/cart-helpers-edit-item-refs.test.d.ts +1 -0
  36. package/lib/tests/cart-helpers-edit-item-refs.test.js +96 -0
  37. package/lib/tests/code-redemption-helpers.test.d.ts +1 -0
  38. package/lib/tests/code-redemption-helpers.test.js +205 -0
  39. package/lib/tests/gift-card-helpers.test.d.ts +1 -0
  40. package/lib/tests/gift-card-helpers.test.js +100 -0
  41. package/lib/tests/materialized-reports/materialized-prep-time-close-day.test.js +1 -5
  42. package/lib/tests/materialized-reports/materialized-prep-time-duration-consistency.test.js +7 -5
  43. package/lib/tests/materialized-reports/materialized-prep-time-identity.test.js +2 -10
  44. package/lib/tests/materialized-reports/materialized-prep-time-read-helpers.test.js +8 -13
  45. package/lib/tests/materialized-reports/materialized-report-drilldown-rows.test.js +1 -4
  46. package/lib/tests/offer-claim-regressions.test.d.ts +1 -0
  47. package/lib/tests/offer-claim-regressions.test.js +299 -0
  48. package/lib/tests/offers-matrix.test.js +53 -14
  49. package/lib/tests/ref-exclusion-matching.test.d.ts +1 -0
  50. package/lib/tests/ref-exclusion-matching.test.js +150 -0
  51. package/lib/tests/wallet-cashback-helpers.test.d.ts +1 -0
  52. package/lib/tests/wallet-cashback-helpers.test.js +95 -0
  53. package/package.json +1 -1
@@ -0,0 +1,431 @@
1
+ import { ACCOUNT_TYPE_ENUM } from './enums/accounting';
2
+ /**
3
+ * Default restaurant chart of accounts (Pakistan-first, PKR) — the seed used by
4
+ * `POST /tenant-chart-of-accounts/seed-template` and the admin panel's
5
+ * "Load Restaurant Template" action. Entries are flat posting accounts; tenants
6
+ * nest their own sub-accounts afterwards, and seeding never overwrites existing codes.
7
+ */
8
+ export const RESTAURANT_ACCOUNTS_TEMPLATE = [
9
+ // ===================== Assets =====================
10
+ {
11
+ code: '1001',
12
+ name: 'Cash on Hand',
13
+ type: ACCOUNT_TYPE_ENUM.ASSET,
14
+ description: 'Physical cash held in cash drawers.',
15
+ },
16
+ {
17
+ code: '1011',
18
+ name: 'Bank – Main Operating Account',
19
+ type: ACCOUNT_TYPE_ENUM.ASSET,
20
+ },
21
+ {
22
+ code: '1012',
23
+ name: 'Bank – Payouts / Settlement Account',
24
+ type: ACCOUNT_TYPE_ENUM.ASSET,
25
+ },
26
+ {
27
+ code: '1021',
28
+ name: 'Card Settlement Clearing',
29
+ type: ACCOUNT_TYPE_ENUM.ASSET,
30
+ },
31
+ {
32
+ code: '1022',
33
+ name: 'JazzCash Clearing',
34
+ type: ACCOUNT_TYPE_ENUM.ASSET,
35
+ },
36
+ {
37
+ code: '1023',
38
+ name: 'EasyPaisa Clearing',
39
+ type: ACCOUNT_TYPE_ENUM.ASSET,
40
+ },
41
+ {
42
+ code: '1024',
43
+ name: 'Raast Clearing',
44
+ type: ACCOUNT_TYPE_ENUM.ASSET,
45
+ },
46
+ {
47
+ code: '1025',
48
+ name: 'Terminal Devices Clearing',
49
+ type: ACCOUNT_TYPE_ENUM.ASSET,
50
+ },
51
+ {
52
+ code: '1031',
53
+ name: 'Foodpanda Receivable',
54
+ type: ACCOUNT_TYPE_ENUM.ASSET,
55
+ },
56
+ {
57
+ code: '1032',
58
+ name: 'Own App / Web Receivable',
59
+ type: ACCOUNT_TYPE_ENUM.ASSET,
60
+ },
61
+ {
62
+ code: '1040',
63
+ name: 'Accounts Receivable – Customers',
64
+ type: ACCOUNT_TYPE_ENUM.ASSET,
65
+ description: 'Credit bills / pay-later orders and B2B clients.',
66
+ },
67
+ {
68
+ code: '1051',
69
+ name: 'Inventory – Raw Materials',
70
+ type: ACCOUNT_TYPE_ENUM.ASSET,
71
+ },
72
+ {
73
+ code: '1052',
74
+ name: 'Inventory – Packed / Retail Items',
75
+ type: ACCOUNT_TYPE_ENUM.ASSET,
76
+ },
77
+ {
78
+ code: '1053',
79
+ name: 'Inventory – Packaging & Consumables',
80
+ type: ACCOUNT_TYPE_ENUM.ASSET,
81
+ },
82
+ {
83
+ code: '1060',
84
+ name: 'Input Tax Receivable (GST)',
85
+ type: ACCOUNT_TYPE_ENUM.ASSET,
86
+ description: 'GST paid on purchases, claimable as credit.',
87
+ },
88
+ {
89
+ code: '1070',
90
+ name: 'Prepaid Expenses',
91
+ type: ACCOUNT_TYPE_ENUM.ASSET,
92
+ },
93
+ {
94
+ code: '1081',
95
+ name: 'Kitchen Equipment',
96
+ type: ACCOUNT_TYPE_ENUM.ASSET,
97
+ },
98
+ {
99
+ code: '1082',
100
+ name: 'Furniture & Fittings',
101
+ type: ACCOUNT_TYPE_ENUM.ASSET,
102
+ },
103
+ {
104
+ code: '1083',
105
+ name: 'Computers & POS Hardware',
106
+ type: ACCOUNT_TYPE_ENUM.ASSET,
107
+ },
108
+ {
109
+ code: '1085',
110
+ name: 'Accumulated Depreciation',
111
+ type: ACCOUNT_TYPE_ENUM.ASSET,
112
+ description: 'Depreciation charged to date (a contra-asset account).',
113
+ },
114
+ {
115
+ code: '1090',
116
+ name: 'Security Deposits',
117
+ type: ACCOUNT_TYPE_ENUM.ASSET,
118
+ },
119
+ // ===================== Liabilities =====================
120
+ {
121
+ code: '2001',
122
+ name: 'Accounts Payable – Vendors',
123
+ type: ACCOUNT_TYPE_ENUM.LIABILITY,
124
+ },
125
+ {
126
+ code: '2011',
127
+ name: 'Accrued Salaries & Wages',
128
+ type: ACCOUNT_TYPE_ENUM.LIABILITY,
129
+ },
130
+ {
131
+ code: '2012',
132
+ name: 'Accrued Utilities',
133
+ type: ACCOUNT_TYPE_ENUM.LIABILITY,
134
+ },
135
+ {
136
+ code: '2021',
137
+ name: 'Net Wages Payable',
138
+ type: ACCOUNT_TYPE_ENUM.LIABILITY,
139
+ },
140
+ {
141
+ code: '2022',
142
+ name: 'Salary Tax Withheld Payable',
143
+ type: ACCOUNT_TYPE_ENUM.LIABILITY,
144
+ },
145
+ {
146
+ code: '2023',
147
+ name: 'EOBI / Social Security Payable',
148
+ type: ACCOUNT_TYPE_ENUM.LIABILITY,
149
+ },
150
+ {
151
+ code: '2030',
152
+ name: 'Tips Payable',
153
+ type: ACCOUNT_TYPE_ENUM.LIABILITY,
154
+ description: 'Tips collected but not yet distributed to staff.',
155
+ },
156
+ {
157
+ code: '2041',
158
+ name: 'GST Payable – Card Sales',
159
+ type: ACCOUNT_TYPE_ENUM.LIABILITY,
160
+ },
161
+ {
162
+ code: '2042',
163
+ name: 'GST Payable – Cash Sales',
164
+ type: ACCOUNT_TYPE_ENUM.LIABILITY,
165
+ },
166
+ {
167
+ code: '2043',
168
+ name: 'Provincial Services Tax Payable',
169
+ type: ACCOUNT_TYPE_ENUM.LIABILITY,
170
+ description: 'PRA / SRB / KPRA services tax collected.',
171
+ },
172
+ {
173
+ code: '2044',
174
+ name: 'FBR POS Invoice Tax Payable',
175
+ type: ACCOUNT_TYPE_ENUM.LIABILITY,
176
+ },
177
+ {
178
+ code: '2050',
179
+ name: 'Gift Card & Voucher Liability',
180
+ type: ACCOUNT_TYPE_ENUM.LIABILITY,
181
+ description: 'Prepaid gift cards / vouchers not yet redeemed.',
182
+ },
183
+ {
184
+ code: '2060',
185
+ name: 'Customer Advances / Deposits',
186
+ type: ACCOUNT_TYPE_ENUM.LIABILITY,
187
+ },
188
+ // ===================== Equity =====================
189
+ {
190
+ code: '3001',
191
+ name: "Owner's Capital",
192
+ type: ACCOUNT_TYPE_ENUM.EQUITY,
193
+ },
194
+ {
195
+ code: '3002',
196
+ name: "Owner's Drawings",
197
+ type: ACCOUNT_TYPE_ENUM.EQUITY,
198
+ },
199
+ {
200
+ code: '3003',
201
+ name: 'Retained Earnings',
202
+ type: ACCOUNT_TYPE_ENUM.EQUITY,
203
+ },
204
+ {
205
+ code: '3099',
206
+ name: 'Opening Balance Equity',
207
+ type: ACCOUNT_TYPE_ENUM.EQUITY,
208
+ description: 'Balancing account used by opening balances entry.',
209
+ },
210
+ // ===================== Revenue =====================
211
+ {
212
+ code: '4001',
213
+ name: 'Food Sales',
214
+ type: ACCOUNT_TYPE_ENUM.INCOME,
215
+ },
216
+ {
217
+ code: '4002',
218
+ name: 'Beverage Sales',
219
+ type: ACCOUNT_TYPE_ENUM.INCOME,
220
+ },
221
+ {
222
+ code: '4003',
223
+ name: 'Delivery Sales – Own',
224
+ type: ACCOUNT_TYPE_ENUM.INCOME,
225
+ },
226
+ {
227
+ code: '4004',
228
+ name: 'Delivery Sales – Platforms',
229
+ type: ACCOUNT_TYPE_ENUM.INCOME,
230
+ },
231
+ {
232
+ code: '4005',
233
+ name: 'Catering & Events Sales',
234
+ type: ACCOUNT_TYPE_ENUM.INCOME,
235
+ },
236
+ {
237
+ code: '4010',
238
+ name: 'Service Fee Income',
239
+ type: ACCOUNT_TYPE_ENUM.INCOME,
240
+ },
241
+ {
242
+ code: '4011',
243
+ name: 'Delivery & Rider Income',
244
+ type: ACCOUNT_TYPE_ENUM.INCOME,
245
+ },
246
+ {
247
+ code: '4012',
248
+ name: 'Surcharge Income',
249
+ type: ACCOUNT_TYPE_ENUM.INCOME,
250
+ },
251
+ {
252
+ code: '4090',
253
+ name: 'Sales Discounts',
254
+ type: ACCOUNT_TYPE_ENUM.INCOME,
255
+ description: 'Discounts given — a contra-revenue account.',
256
+ },
257
+ {
258
+ code: '4091',
259
+ name: 'Complimentary / Comps',
260
+ type: ACCOUNT_TYPE_ENUM.INCOME,
261
+ description: 'Complimentary meals — a contra-revenue account.',
262
+ },
263
+ {
264
+ code: '4092',
265
+ name: 'Sales Returns & Refunds',
266
+ type: ACCOUNT_TYPE_ENUM.INCOME,
267
+ description: 'Refunds and returns — a contra-revenue account.',
268
+ },
269
+ // ===================== Cost of Sales =====================
270
+ {
271
+ code: '5001',
272
+ name: 'Food Cost',
273
+ type: ACCOUNT_TYPE_ENUM.COGS,
274
+ },
275
+ {
276
+ code: '5002',
277
+ name: 'Beverage Cost',
278
+ type: ACCOUNT_TYPE_ENUM.COGS,
279
+ },
280
+ {
281
+ code: '5003',
282
+ name: 'Packaging Cost',
283
+ type: ACCOUNT_TYPE_ENUM.COGS,
284
+ },
285
+ {
286
+ code: '5010',
287
+ name: 'Inventory Wastage & Spoilage',
288
+ type: ACCOUNT_TYPE_ENUM.COGS,
289
+ },
290
+ {
291
+ code: '5011',
292
+ name: 'Inventory Shrinkage',
293
+ type: ACCOUNT_TYPE_ENUM.COGS,
294
+ },
295
+ {
296
+ code: '5012',
297
+ name: 'Inventory Adjustment Gain / Loss',
298
+ type: ACCOUNT_TYPE_ENUM.COGS,
299
+ },
300
+ // ===================== Expenses =====================
301
+ {
302
+ code: '6001',
303
+ name: 'Salaries & Wages',
304
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
305
+ },
306
+ {
307
+ code: '6002',
308
+ name: 'Overtime',
309
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
310
+ },
311
+ {
312
+ code: '6003',
313
+ name: 'Staff Meals & Amenities',
314
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
315
+ },
316
+ {
317
+ code: '6010',
318
+ name: 'Rent & Rentals',
319
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
320
+ },
321
+ {
322
+ code: '6020',
323
+ name: 'Utilities',
324
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
325
+ description: 'Electricity, gas, water, internet.',
326
+ },
327
+ {
328
+ code: '6031',
329
+ name: 'Platform Commissions',
330
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
331
+ description: 'Commissions deducted by delivery platforms.',
332
+ },
333
+ {
334
+ code: '6032',
335
+ name: 'Ads & Social Media',
336
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
337
+ },
338
+ {
339
+ code: '6033',
340
+ name: 'Promotions & Campaigns',
341
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
342
+ },
343
+ {
344
+ code: '6034',
345
+ name: 'Loyalty & Rewards Cost',
346
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
347
+ },
348
+ {
349
+ code: '6041',
350
+ name: 'Rider Payouts',
351
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
352
+ },
353
+ {
354
+ code: '6042',
355
+ name: 'Fuel & Vehicle',
356
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
357
+ },
358
+ {
359
+ code: '6050',
360
+ name: 'Repairs & Maintenance',
361
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
362
+ },
363
+ {
364
+ code: '6060',
365
+ name: 'Cleaning & Housekeeping Supplies',
366
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
367
+ },
368
+ {
369
+ code: '6070',
370
+ name: 'Licenses, Permits & Government Fees',
371
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
372
+ },
373
+ {
374
+ code: '6080',
375
+ name: 'Insurance',
376
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
377
+ },
378
+ {
379
+ code: '6091',
380
+ name: 'Payment Processing Fees',
381
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
382
+ },
383
+ {
384
+ code: '6092',
385
+ name: 'Bank Charges',
386
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
387
+ },
388
+ {
389
+ code: '6100',
390
+ name: 'Software & Subscriptions',
391
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
392
+ },
393
+ {
394
+ code: '6110',
395
+ name: 'Professional Fees',
396
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
397
+ description: 'Accounting, legal and consultancy fees.',
398
+ },
399
+ {
400
+ code: '6120',
401
+ name: 'Training & Recruitment',
402
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
403
+ },
404
+ {
405
+ code: '6130',
406
+ name: 'Office & Miscellaneous Expenses',
407
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
408
+ },
409
+ {
410
+ code: '6140',
411
+ name: 'Depreciation Expense',
412
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
413
+ },
414
+ // ================ Other Income & Expenses ================
415
+ {
416
+ code: '7001',
417
+ name: 'Cash Over / Short',
418
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
419
+ description: 'Day-close cash drawer variances.',
420
+ },
421
+ {
422
+ code: '7002',
423
+ name: 'Interest Expense',
424
+ type: ACCOUNT_TYPE_ENUM.EXPENSE,
425
+ },
426
+ {
427
+ code: '7003',
428
+ name: 'Other Income',
429
+ type: ACCOUNT_TYPE_ENUM.INCOME,
430
+ },
431
+ ];
@@ -1,3 +1,4 @@
1
+ export * from './accounting-templates';
1
2
  export * from './ANALYTICS';
2
3
  export * from './API_ERRORS';
3
4
  export * from './COMMON';
@@ -208,9 +208,7 @@ export function accumulateOrderPrepTime({ order, context, tenantDefaultMinutes =
208
208
  // order-line id is a DIFFERENT identity and is preserved as line_id, so
209
209
  // two lines of one menu item remain two served events.
210
210
  const lineId = item?._id != null ? String(item._id) : null;
211
- const catalogueItemId = item?.item_id != null && String(item.item_id) !== ''
212
- ? String(item.item_id)
213
- : lineId;
211
+ const catalogueItemId = item?.item_id != null && String(item.item_id) !== '' ? String(item.item_id) : lineId;
214
212
  const row = {
215
213
  entry_key: buildMaterializedPrepTimeEntryKey(catalogueItemId, lineId),
216
214
  order_id: orderId,
@@ -178,9 +178,7 @@ export function matchesMaterializedPrepTimeReadFilters(row, filters) {
178
178
  if (platforms != null && platforms.length > 0 && !platforms.includes(asString(row.platform))) {
179
179
  return false;
180
180
  }
181
- if (orderStatuses != null &&
182
- orderStatuses.length > 0 &&
183
- !orderStatuses.includes(asString(row.order_status))) {
181
+ if (orderStatuses != null && orderStatuses.length > 0 && !orderStatuses.includes(asString(row.order_status))) {
184
182
  return false;
185
183
  }
186
184
  if (categoryNames != null && categoryNames.length > 0) {
@@ -420,8 +418,7 @@ export function groupMaterializedPrepTimeItemRows(rows, filters) {
420
418
  }
421
419
  /** True when `value` is one of the frozen item sort modes. */
422
420
  export function isMaterializedPrepTimeItemSort(value) {
423
- return (typeof value === 'string' &&
424
- ALL_MATERIALIZED_PREP_TIME_ITEM_SORTS.includes(value));
421
+ return typeof value === 'string' && ALL_MATERIALIZED_PREP_TIME_ITEM_SORTS.includes(value);
425
422
  }
426
423
  /** The sort value of one item row (the cursor stores it verbatim). */
427
424
  export function getMaterializedPrepTimeItemSortValue(row, sort) {
@@ -478,9 +475,7 @@ export function compareMaterializedPrepTimeItemRows(a, b, sort) {
478
475
  }
479
476
  /** Stable sort (never mutates the input array). */
480
477
  export function sortMaterializedPrepTimeItemRows(rows, sort) {
481
- const mode = isMaterializedPrepTimeItemSort(sort)
482
- ? sort
483
- : DEFAULT_MATERIALIZED_PREP_TIME_ITEM_SORT;
478
+ const mode = isMaterializedPrepTimeItemSort(sort) ? sort : DEFAULT_MATERIALIZED_PREP_TIME_ITEM_SORT;
484
479
  return (Array.isArray(rows) ? rows : []).slice().sort((a, b) => {
485
480
  const compared = compareSortValues(getMaterializedPrepTimeItemSortValue(a, mode), getMaterializedPrepTimeItemSortValue(b, mode), mode);
486
481
  if (compared !== 0)
@@ -499,9 +494,7 @@ const compareItemToCursor = (row, sort, cursor) => {
499
494
  * row can be duplicated or skipped between pages.
500
495
  */
501
496
  export function getMaterializedPrepTimeItemPage(rows, sort, cursor, limit = 25) {
502
- const mode = isMaterializedPrepTimeItemSort(sort)
503
- ? sort
504
- : DEFAULT_MATERIALIZED_PREP_TIME_ITEM_SORT;
497
+ const mode = isMaterializedPrepTimeItemSort(sort) ? sort : DEFAULT_MATERIALIZED_PREP_TIME_ITEM_SORT;
505
498
  const size = Number.isFinite(limit) && limit > 0 ? Math.floor(limit) : 0;
506
499
  const all = Array.isArray(rows) ? rows : [];
507
500
  const remaining = cursor == null ? all.slice() : all.filter((row) => compareItemToCursor(row, mode, cursor) > 0);
@@ -525,9 +518,7 @@ export function getMaterializedPrepTimeItemPage(rows, sort, cursor, limit = 25)
525
518
  export function buildMaterializedPrepTimeItemsPage(args) {
526
519
  const filtered = applyMaterializedPrepTimeReadFilters(args.rows, args.filters);
527
520
  const coverage = buildMaterializedPrepTimeCoverage(applyMaterializedPrepTimeReadFilters(args.rows, withoutMaterializedPrepTimeAnchorFilter(args.filters)));
528
- const sort = isMaterializedPrepTimeItemSort(args.sort)
529
- ? args.sort
530
- : DEFAULT_MATERIALIZED_PREP_TIME_ITEM_SORT;
521
+ const sort = isMaterializedPrepTimeItemSort(args.sort) ? args.sort : DEFAULT_MATERIALIZED_PREP_TIME_ITEM_SORT;
531
522
  const grouped = groupMaterializedPrepTimeItemRows(filtered);
532
523
  const sorted = sortMaterializedPrepTimeItemRows(grouped, sort);
533
524
  const page = getMaterializedPrepTimeItemPage(sorted, sort, args.cursor ?? null, args.limit ?? 25);
@@ -0,0 +1,8 @@
1
+ import type { IAccountTemplateEntry } from '../schemas/types/tenant_chart_of_accounts';
2
+ /**
3
+ * Default restaurant chart of accounts (Pakistan-first, PKR) — the seed used by
4
+ * `POST /tenant-chart-of-accounts/seed-template` and the admin panel's
5
+ * "Load Restaurant Template" action. Entries are flat posting accounts; tenants
6
+ * nest their own sub-accounts afterwards, and seeding never overwrites existing codes.
7
+ */
8
+ export declare const RESTAURANT_ACCOUNTS_TEMPLATE: IAccountTemplateEntry[];