@managesome/eposmatic-toolkit 0.4.9 → 0.4.11

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 (351) hide show
  1. package/esm/constants/MATERIALIZED_REPORTS.js +455 -0
  2. package/esm/constants/enums/delivery.js +8 -0
  3. package/esm/helpers/index.js +3 -0
  4. package/esm/helpers/materialized-reports/index.js +32 -0
  5. package/esm/helpers/materialized-reports/materialized-cash-accumulator-helpers.js +114 -0
  6. package/esm/helpers/materialized-reports/materialized-cash-classification-helpers.js +248 -0
  7. package/esm/helpers/materialized-reports/materialized-cash-close-day-helpers.js +396 -0
  8. package/esm/helpers/materialized-reports/materialized-cash-compile-helpers.js +245 -0
  9. package/esm/helpers/materialized-reports/materialized-delivery-accumulator-helpers.js +170 -0
  10. package/esm/helpers/materialized-reports/materialized-delivery-classification-helpers.js +430 -0
  11. package/esm/helpers/materialized-reports/materialized-delivery-close-day-helpers.js +373 -0
  12. package/esm/helpers/materialized-reports/materialized-delivery-compile-helpers.js +216 -0
  13. package/esm/helpers/materialized-reports/materialized-discount-accumulator-helpers.js +319 -0
  14. package/esm/helpers/materialized-reports/materialized-discount-classification-helpers.js +213 -0
  15. package/esm/helpers/materialized-reports/materialized-discount-close-day-helpers.js +604 -0
  16. package/esm/helpers/materialized-reports/materialized-discount-compile-helpers.js +186 -0
  17. package/esm/helpers/materialized-reports/materialized-hourly-comparison-close-day-helpers.js +155 -0
  18. package/esm/helpers/materialized-reports/materialized-hourly-comparison-compile-helpers.js +199 -0
  19. package/esm/helpers/materialized-reports/materialized-hourly-comparison-selection-helpers.js +115 -0
  20. package/esm/helpers/materialized-reports/materialized-payments-comparison-accumulator-helpers.js +89 -0
  21. package/esm/helpers/materialized-reports/materialized-payments-comparison-close-day-helpers.js +394 -0
  22. package/esm/helpers/materialized-reports/materialized-payments-comparison-compile-helpers.js +167 -0
  23. package/esm/helpers/materialized-reports/materialized-prep-time-classification-helpers.js +215 -0
  24. package/esm/helpers/materialized-reports/materialized-prep-time-close-day-helpers.js +477 -0
  25. package/esm/helpers/materialized-reports/materialized-prep-time-compile-helpers.js +201 -0
  26. package/esm/helpers/materialized-reports/materialized-reports-scope-group-helpers.js +9 -6
  27. package/esm/helpers/materialized-reports/materialized-reports-selection-helpers.js +11 -4
  28. package/esm/helpers/materialized-reports/materialized-sales-comparison-accumulator-helpers.js +189 -0
  29. package/esm/helpers/materialized-reports/materialized-sales-comparison-baseline-helpers.js +156 -0
  30. package/esm/helpers/materialized-reports/materialized-sales-comparison-close-day-helpers.js +588 -0
  31. package/esm/helpers/materialized-reports/materialized-sales-comparison-compile-helpers.js +175 -0
  32. package/esm/helpers/materialized-reports/tenant-cash-in-out-formatter.js +157 -0
  33. package/esm/helpers/materialized-reports/tenant-delivery-formatter.js +230 -0
  34. package/esm/helpers/materialized-reports/tenant-discount-formatter.js +427 -0
  35. package/esm/helpers/materialized-reports/tenant-hourly-comparison-formatter.js +238 -0
  36. package/esm/helpers/materialized-reports/tenant-payments-comparison-formatter.js +282 -0
  37. package/esm/helpers/materialized-reports/tenant-prep-time-formatter.js +228 -0
  38. package/esm/helpers/materialized-reports/tenant-sales-comparison-formatter.js +346 -0
  39. package/esm/helpers/reporting-contract/index.js +2 -0
  40. package/esm/helpers/reporting-contract/overview-contract.js +123 -0
  41. package/esm/helpers/reporting-contract/report-contract.js +228 -0
  42. package/esm/helpers/rider-earnings/index.js +1 -0
  43. package/esm/helpers/rider-earnings/rider-earnings.js +53 -0
  44. package/esm/helpers/rider-reports/index.js +2 -0
  45. package/esm/helpers/rider-reports/rider-daily-report.js +90 -0
  46. package/esm/helpers/rider-reports/rider-report.js +67 -0
  47. package/esm/helpers/store/common-order-actions.js +3 -2
  48. package/esm/schemas/models/deliveries.js +82 -1
  49. package/esm/schemas/models/index.js +15 -0
  50. package/esm/schemas/models/materialized_credit_bills.js +1 -1
  51. package/esm/schemas/models/materialized_rider_daily_reports.js +39 -0
  52. package/esm/schemas/models/materialized_tenant_cash_entries.js +95 -0
  53. package/esm/schemas/models/materialized_tenant_cash_reports.js +77 -0
  54. package/esm/schemas/models/materialized_tenant_delivery_entries.js +63 -0
  55. package/esm/schemas/models/materialized_tenant_delivery_reports.js +63 -0
  56. package/esm/schemas/models/materialized_tenant_discount_entries.js +156 -0
  57. package/esm/schemas/models/materialized_tenant_discount_reports.js +333 -0
  58. package/esm/schemas/models/materialized_tenant_hourly_comparison_entries.js +87 -0
  59. package/esm/schemas/models/materialized_tenant_hourly_comparison_reports.js +99 -0
  60. package/esm/schemas/models/materialized_tenant_payments_comparison_entries.js +71 -0
  61. package/esm/schemas/models/materialized_tenant_payments_comparison_reports.js +76 -0
  62. package/esm/schemas/models/materialized_tenant_prep_time_entries.js +130 -0
  63. package/esm/schemas/models/materialized_tenant_prep_time_reports.js +109 -0
  64. package/esm/schemas/models/materialized_tenant_sales_comparison_entries.js +130 -0
  65. package/esm/schemas/models/materialized_tenant_sales_comparison_reports.js +154 -0
  66. package/esm/schemas/models/materialized_tenant_sales_overview_reports.js +1 -1
  67. package/esm/schemas/types/index.js +15 -0
  68. package/esm/schemas/types/materialized_rider_daily_reports.js +1 -0
  69. package/esm/schemas/types/materialized_tenant_cash_entries.js +1 -0
  70. package/esm/schemas/types/materialized_tenant_cash_reports.js +1 -0
  71. package/esm/schemas/types/materialized_tenant_delivery_entries.js +1 -0
  72. package/esm/schemas/types/materialized_tenant_delivery_reports.js +1 -0
  73. package/esm/schemas/types/materialized_tenant_discount_entries.js +1 -0
  74. package/esm/schemas/types/materialized_tenant_discount_reports.js +2 -0
  75. package/esm/schemas/types/materialized_tenant_hourly_comparison_entries.js +1 -0
  76. package/esm/schemas/types/materialized_tenant_hourly_comparison_reports.js +1 -0
  77. package/esm/schemas/types/materialized_tenant_payments_comparison_entries.js +1 -0
  78. package/esm/schemas/types/materialized_tenant_payments_comparison_reports.js +11 -0
  79. package/esm/schemas/types/materialized_tenant_prep_time_entries.js +1 -0
  80. package/esm/schemas/types/materialized_tenant_prep_time_reports.js +1 -0
  81. package/esm/schemas/types/materialized_tenant_sales_comparison_entries.js +1 -0
  82. package/esm/schemas/types/materialized_tenant_sales_comparison_reports.js +14 -0
  83. package/lib/constants/MATERIALIZED_REPORTS.d.ts +345 -2
  84. package/lib/constants/MATERIALIZED_REPORTS.js +457 -1
  85. package/lib/constants/enums/delivery.d.ts +7 -0
  86. package/lib/constants/enums/delivery.js +9 -1
  87. package/lib/helpers/index.d.ts +3 -0
  88. package/lib/helpers/index.js +3 -0
  89. package/lib/helpers/materialized-reports/index.d.ts +32 -0
  90. package/lib/helpers/materialized-reports/index.js +32 -0
  91. package/lib/helpers/materialized-reports/materialized-cash-accumulator-helpers.d.ts +18 -0
  92. package/lib/helpers/materialized-reports/materialized-cash-accumulator-helpers.js +118 -0
  93. package/lib/helpers/materialized-reports/materialized-cash-classification-helpers.d.ts +142 -0
  94. package/lib/helpers/materialized-reports/materialized-cash-classification-helpers.js +257 -0
  95. package/lib/helpers/materialized-reports/materialized-cash-close-day-helpers.d.ts +103 -0
  96. package/lib/helpers/materialized-reports/materialized-cash-close-day-helpers.js +409 -0
  97. package/lib/helpers/materialized-reports/materialized-cash-compile-helpers.d.ts +73 -0
  98. package/lib/helpers/materialized-reports/materialized-cash-compile-helpers.js +252 -0
  99. package/lib/helpers/materialized-reports/materialized-delivery-accumulator-helpers.d.ts +7 -0
  100. package/lib/helpers/materialized-reports/materialized-delivery-accumulator-helpers.js +173 -0
  101. package/lib/helpers/materialized-reports/materialized-delivery-classification-helpers.d.ts +113 -0
  102. package/lib/helpers/materialized-reports/materialized-delivery-classification-helpers.js +442 -0
  103. package/lib/helpers/materialized-reports/materialized-delivery-close-day-helpers.d.ts +98 -0
  104. package/lib/helpers/materialized-reports/materialized-delivery-close-day-helpers.js +386 -0
  105. package/lib/helpers/materialized-reports/materialized-delivery-compile-helpers.d.ts +41 -0
  106. package/lib/helpers/materialized-reports/materialized-delivery-compile-helpers.js +220 -0
  107. package/lib/helpers/materialized-reports/materialized-discount-accumulator-helpers.d.ts +52 -0
  108. package/lib/helpers/materialized-reports/materialized-discount-accumulator-helpers.js +325 -0
  109. package/lib/helpers/materialized-reports/materialized-discount-classification-helpers.d.ts +50 -0
  110. package/lib/helpers/materialized-reports/materialized-discount-classification-helpers.js +222 -0
  111. package/lib/helpers/materialized-reports/materialized-discount-close-day-helpers.d.ts +182 -0
  112. package/lib/helpers/materialized-reports/materialized-discount-close-day-helpers.js +615 -0
  113. package/lib/helpers/materialized-reports/materialized-discount-compile-helpers.d.ts +47 -0
  114. package/lib/helpers/materialized-reports/materialized-discount-compile-helpers.js +193 -0
  115. package/lib/helpers/materialized-reports/materialized-hourly-comparison-close-day-helpers.d.ts +64 -0
  116. package/lib/helpers/materialized-reports/materialized-hourly-comparison-close-day-helpers.js +163 -0
  117. package/lib/helpers/materialized-reports/materialized-hourly-comparison-compile-helpers.d.ts +61 -0
  118. package/lib/helpers/materialized-reports/materialized-hourly-comparison-compile-helpers.js +207 -0
  119. package/lib/helpers/materialized-reports/materialized-hourly-comparison-selection-helpers.d.ts +23 -0
  120. package/lib/helpers/materialized-reports/materialized-hourly-comparison-selection-helpers.js +120 -0
  121. package/lib/helpers/materialized-reports/materialized-payments-comparison-accumulator-helpers.d.ts +25 -0
  122. package/lib/helpers/materialized-reports/materialized-payments-comparison-accumulator-helpers.js +99 -0
  123. package/lib/helpers/materialized-reports/materialized-payments-comparison-close-day-helpers.d.ts +79 -0
  124. package/lib/helpers/materialized-reports/materialized-payments-comparison-close-day-helpers.js +407 -0
  125. package/lib/helpers/materialized-reports/materialized-payments-comparison-compile-helpers.d.ts +35 -0
  126. package/lib/helpers/materialized-reports/materialized-payments-comparison-compile-helpers.js +173 -0
  127. package/lib/helpers/materialized-reports/materialized-prep-time-classification-helpers.d.ts +98 -0
  128. package/lib/helpers/materialized-reports/materialized-prep-time-classification-helpers.js +224 -0
  129. package/lib/helpers/materialized-reports/materialized-prep-time-close-day-helpers.d.ts +130 -0
  130. package/lib/helpers/materialized-reports/materialized-prep-time-close-day-helpers.js +491 -0
  131. package/lib/helpers/materialized-reports/materialized-prep-time-compile-helpers.d.ts +47 -0
  132. package/lib/helpers/materialized-reports/materialized-prep-time-compile-helpers.js +208 -0
  133. package/lib/helpers/materialized-reports/materialized-reports-scope-group-helpers.d.ts +6 -3
  134. package/lib/helpers/materialized-reports/materialized-reports-scope-group-helpers.js +8 -5
  135. package/lib/helpers/materialized-reports/materialized-reports-selection-helpers.d.ts +8 -0
  136. package/lib/helpers/materialized-reports/materialized-reports-selection-helpers.js +10 -3
  137. package/lib/helpers/materialized-reports/materialized-sales-comparison-accumulator-helpers.d.ts +48 -0
  138. package/lib/helpers/materialized-reports/materialized-sales-comparison-accumulator-helpers.js +204 -0
  139. package/lib/helpers/materialized-reports/materialized-sales-comparison-baseline-helpers.d.ts +22 -0
  140. package/lib/helpers/materialized-reports/materialized-sales-comparison-baseline-helpers.js +160 -0
  141. package/lib/helpers/materialized-reports/materialized-sales-comparison-close-day-helpers.d.ts +163 -0
  142. package/lib/helpers/materialized-reports/materialized-sales-comparison-close-day-helpers.js +603 -0
  143. package/lib/helpers/materialized-reports/materialized-sales-comparison-compile-helpers.d.ts +68 -0
  144. package/lib/helpers/materialized-reports/materialized-sales-comparison-compile-helpers.js +182 -0
  145. package/lib/helpers/materialized-reports/tenant-cash-in-out-formatter.d.ts +98 -0
  146. package/lib/helpers/materialized-reports/tenant-cash-in-out-formatter.js +160 -0
  147. package/lib/helpers/materialized-reports/tenant-delivery-formatter.d.ts +133 -0
  148. package/lib/helpers/materialized-reports/tenant-delivery-formatter.js +233 -0
  149. package/lib/helpers/materialized-reports/tenant-discount-formatter.d.ts +114 -0
  150. package/lib/helpers/materialized-reports/tenant-discount-formatter.js +431 -0
  151. package/lib/helpers/materialized-reports/tenant-hourly-comparison-formatter.d.ts +60 -0
  152. package/lib/helpers/materialized-reports/tenant-hourly-comparison-formatter.js +244 -0
  153. package/lib/helpers/materialized-reports/tenant-payments-comparison-formatter.d.ts +75 -0
  154. package/lib/helpers/materialized-reports/tenant-payments-comparison-formatter.js +289 -0
  155. package/lib/helpers/materialized-reports/tenant-prep-time-formatter.d.ts +98 -0
  156. package/lib/helpers/materialized-reports/tenant-prep-time-formatter.js +232 -0
  157. package/lib/helpers/materialized-reports/tenant-sales-comparison-formatter.d.ts +105 -0
  158. package/lib/helpers/materialized-reports/tenant-sales-comparison-formatter.js +352 -0
  159. package/lib/helpers/reporting-contract/index.d.ts +2 -0
  160. package/lib/helpers/reporting-contract/index.js +18 -0
  161. package/lib/helpers/reporting-contract/overview-contract.d.ts +55 -0
  162. package/lib/helpers/reporting-contract/overview-contract.js +127 -0
  163. package/lib/helpers/reporting-contract/report-contract.d.ts +159 -0
  164. package/lib/helpers/reporting-contract/report-contract.js +239 -0
  165. package/lib/helpers/rider-earnings/index.d.ts +1 -0
  166. package/lib/helpers/rider-earnings/index.js +17 -0
  167. package/lib/helpers/rider-earnings/rider-earnings.d.ts +51 -0
  168. package/lib/helpers/rider-earnings/rider-earnings.js +57 -0
  169. package/lib/helpers/rider-reports/index.d.ts +2 -0
  170. package/lib/helpers/rider-reports/index.js +18 -0
  171. package/lib/helpers/rider-reports/rider-daily-report.d.ts +28 -0
  172. package/lib/helpers/rider-reports/rider-daily-report.js +93 -0
  173. package/lib/helpers/rider-reports/rider-report.d.ts +49 -0
  174. package/lib/helpers/rider-reports/rider-report.js +70 -0
  175. package/lib/helpers/store/common-order-actions.js +3 -2
  176. package/lib/helpers/types/materialized-reports-apis.d.ts +300 -1
  177. package/lib/schemas/models/deliveries.d.ts +58 -1
  178. package/lib/schemas/models/deliveries.js +81 -0
  179. package/lib/schemas/models/expense_details.d.ts +3 -3
  180. package/lib/schemas/models/index.d.ts +15 -0
  181. package/lib/schemas/models/index.js +15 -0
  182. package/lib/schemas/models/materialized_credit_bills.d.ts +3 -3
  183. package/lib/schemas/models/materialized_credit_bills.js +1 -1
  184. package/lib/schemas/models/materialized_rider_daily_reports.d.ts +27 -0
  185. package/lib/schemas/models/materialized_rider_daily_reports.js +42 -0
  186. package/lib/schemas/models/materialized_tenant_cash_entries.d.ts +181 -0
  187. package/lib/schemas/models/materialized_tenant_cash_entries.js +98 -0
  188. package/lib/schemas/models/materialized_tenant_cash_reports.d.ts +111 -0
  189. package/lib/schemas/models/materialized_tenant_cash_reports.js +80 -0
  190. package/lib/schemas/models/materialized_tenant_delivery_entries.d.ts +98 -0
  191. package/lib/schemas/models/materialized_tenant_delivery_entries.js +66 -0
  192. package/lib/schemas/models/materialized_tenant_delivery_reports.d.ts +98 -0
  193. package/lib/schemas/models/materialized_tenant_delivery_reports.js +66 -0
  194. package/lib/schemas/models/materialized_tenant_discount_entries.d.ts +199 -0
  195. package/lib/schemas/models/materialized_tenant_discount_entries.js +159 -0
  196. package/lib/schemas/models/materialized_tenant_discount_reports.d.ts +216 -0
  197. package/lib/schemas/models/materialized_tenant_discount_reports.js +336 -0
  198. package/lib/schemas/models/materialized_tenant_hourly_comparison_entries.d.ts +95 -0
  199. package/lib/schemas/models/materialized_tenant_hourly_comparison_entries.js +82 -0
  200. package/lib/schemas/models/materialized_tenant_hourly_comparison_reports.d.ts +105 -0
  201. package/lib/schemas/models/materialized_tenant_hourly_comparison_reports.js +91 -0
  202. package/lib/schemas/models/materialized_tenant_payments_comparison_entries.d.ts +91 -0
  203. package/lib/schemas/models/materialized_tenant_payments_comparison_entries.js +70 -0
  204. package/lib/schemas/models/materialized_tenant_payments_comparison_reports.d.ts +98 -0
  205. package/lib/schemas/models/materialized_tenant_payments_comparison_reports.js +71 -0
  206. package/lib/schemas/models/materialized_tenant_prep_time_entries.d.ts +181 -0
  207. package/lib/schemas/models/materialized_tenant_prep_time_entries.js +133 -0
  208. package/lib/schemas/models/materialized_tenant_prep_time_reports.d.ts +118 -0
  209. package/lib/schemas/models/materialized_tenant_prep_time_reports.js +112 -0
  210. package/lib/schemas/models/materialized_tenant_sales_comparison_entries.d.ts +139 -0
  211. package/lib/schemas/models/materialized_tenant_sales_comparison_entries.js +120 -0
  212. package/lib/schemas/models/materialized_tenant_sales_comparison_reports.d.ts +167 -0
  213. package/lib/schemas/models/materialized_tenant_sales_comparison_reports.js +137 -0
  214. package/lib/schemas/models/materialized_tenant_sales_overview_reports.d.ts +3 -3
  215. package/lib/schemas/models/materialized_tenant_sales_overview_reports.js +1 -1
  216. package/lib/schemas/models/tenant_purchase_order_vendor_returns.d.ts +3 -3
  217. package/lib/schemas/models/warehouse_internal_movements.d.ts +6 -6
  218. package/lib/schemas/models/warehouse_purchase_order_receipts.d.ts +3 -3
  219. package/lib/schemas/models/warehouse_purchase_order_vendor_returns.d.ts +3 -3
  220. package/lib/schemas/models/warehouse_sale_deliveries.d.ts +6 -6
  221. package/lib/schemas/models/warehouse_sale_invoices.d.ts +3 -3
  222. package/lib/schemas/types/deliveries.d.ts +40 -1
  223. package/lib/schemas/types/index.d.ts +15 -0
  224. package/lib/schemas/types/index.js +15 -0
  225. package/lib/schemas/types/materialized_rider_daily_reports.d.ts +37 -0
  226. package/lib/schemas/types/materialized_rider_daily_reports.js +2 -0
  227. package/lib/schemas/types/materialized_tenant_cash_entries.d.ts +87 -0
  228. package/lib/schemas/types/materialized_tenant_cash_entries.js +2 -0
  229. package/lib/schemas/types/materialized_tenant_cash_reports.d.ts +144 -0
  230. package/lib/schemas/types/materialized_tenant_cash_reports.js +2 -0
  231. package/lib/schemas/types/materialized_tenant_delivery_entries.d.ts +98 -0
  232. package/lib/schemas/types/materialized_tenant_delivery_entries.js +2 -0
  233. package/lib/schemas/types/materialized_tenant_delivery_reports.d.ts +179 -0
  234. package/lib/schemas/types/materialized_tenant_delivery_reports.js +2 -0
  235. package/lib/schemas/types/materialized_tenant_discount_entries.d.ts +81 -0
  236. package/lib/schemas/types/materialized_tenant_discount_entries.js +2 -0
  237. package/lib/schemas/types/materialized_tenant_discount_reports.d.ts +209 -0
  238. package/lib/schemas/types/materialized_tenant_discount_reports.js +3 -0
  239. package/lib/schemas/types/materialized_tenant_hourly_comparison_entries.d.ts +33 -0
  240. package/lib/schemas/types/materialized_tenant_hourly_comparison_entries.js +2 -0
  241. package/lib/schemas/types/materialized_tenant_hourly_comparison_reports.d.ts +40 -0
  242. package/lib/schemas/types/materialized_tenant_hourly_comparison_reports.js +2 -0
  243. package/lib/schemas/types/materialized_tenant_payments_comparison_entries.d.ts +48 -0
  244. package/lib/schemas/types/materialized_tenant_payments_comparison_entries.js +2 -0
  245. package/lib/schemas/types/materialized_tenant_payments_comparison_reports.d.ts +51 -0
  246. package/lib/schemas/types/materialized_tenant_payments_comparison_reports.js +14 -0
  247. package/lib/schemas/types/materialized_tenant_prep_time_entries.d.ts +88 -0
  248. package/lib/schemas/types/materialized_tenant_prep_time_entries.js +2 -0
  249. package/lib/schemas/types/materialized_tenant_prep_time_reports.d.ts +132 -0
  250. package/lib/schemas/types/materialized_tenant_prep_time_reports.js +2 -0
  251. package/lib/schemas/types/materialized_tenant_sales_comparison_entries.d.ts +43 -0
  252. package/lib/schemas/types/materialized_tenant_sales_comparison_entries.js +2 -0
  253. package/lib/schemas/types/materialized_tenant_sales_comparison_reports.d.ts +74 -0
  254. package/lib/schemas/types/materialized_tenant_sales_comparison_reports.js +17 -0
  255. package/lib/schemas/types/materialized_tenant_sales_overview_reports.d.ts +7 -0
  256. package/lib/tests/deliveries-schema.test.d.ts +1 -0
  257. package/lib/tests/deliveries-schema.test.js +70 -0
  258. package/lib/tests/materialized-reports/analytics-growth-helpers.test.d.ts +1 -0
  259. package/lib/tests/materialized-reports/analytics-overview-helpers.test.d.ts +1 -0
  260. package/lib/tests/materialized-reports/analytics-performance-helpers.test.d.ts +1 -0
  261. package/lib/tests/materialized-reports/fixtures.d.ts +15 -1
  262. package/lib/tests/materialized-reports/fixtures.js +1 -0
  263. package/lib/tests/materialized-reports/materialized-cash-compile.test.d.ts +1 -0
  264. package/lib/tests/materialized-reports/materialized-cash-compile.test.js +197 -0
  265. package/lib/tests/materialized-reports/materialized-cash-fold.test.d.ts +1 -0
  266. package/lib/tests/materialized-reports/materialized-cash-fold.test.js +116 -0
  267. package/lib/tests/materialized-reports/materialized-cash-formatter.test.d.ts +1 -0
  268. package/lib/tests/materialized-reports/materialized-cash-formatter.test.js +153 -0
  269. package/lib/tests/materialized-reports/materialized-cash-plan.test.d.ts +1 -0
  270. package/lib/tests/materialized-reports/materialized-cash-plan.test.js +168 -0
  271. package/lib/tests/materialized-reports/materialized-cash-reconciliation.test.d.ts +1 -0
  272. package/lib/tests/materialized-reports/materialized-cash-reconciliation.test.js +267 -0
  273. package/lib/tests/materialized-reports/materialized-delivery-accumulation.test.d.ts +1 -0
  274. package/lib/tests/materialized-reports/materialized-delivery-accumulation.test.js +147 -0
  275. package/lib/tests/materialized-reports/materialized-delivery-compile.test.d.ts +1 -0
  276. package/lib/tests/materialized-reports/materialized-delivery-compile.test.js +242 -0
  277. package/lib/tests/materialized-reports/materialized-delivery-fold.test.d.ts +1 -0
  278. package/lib/tests/materialized-reports/materialized-delivery-fold.test.js +109 -0
  279. package/lib/tests/materialized-reports/materialized-delivery-formatter.test.d.ts +1 -0
  280. package/lib/tests/materialized-reports/materialized-delivery-formatter.test.js +142 -0
  281. package/lib/tests/materialized-reports/materialized-delivery-plan.test.d.ts +1 -0
  282. package/lib/tests/materialized-reports/materialized-delivery-plan.test.js +198 -0
  283. package/lib/tests/materialized-reports/materialized-discount-aggregated-formatter.test.d.ts +1 -0
  284. package/lib/tests/materialized-reports/materialized-discount-aggregated-formatter.test.js +173 -0
  285. package/lib/tests/materialized-reports/materialized-discount-classification.test.d.ts +1 -0
  286. package/lib/tests/materialized-reports/materialized-discount-classification.test.js +339 -0
  287. package/lib/tests/materialized-reports/materialized-discount-close-day.test.d.ts +1 -0
  288. package/lib/tests/materialized-reports/materialized-discount-close-day.test.js +506 -0
  289. package/lib/tests/materialized-reports/materialized-discount-compile.test.d.ts +1 -0
  290. package/lib/tests/materialized-reports/materialized-discount-compile.test.js +161 -0
  291. package/lib/tests/materialized-reports/materialized-discount-counter-rows.test.d.ts +1 -0
  292. package/lib/tests/materialized-reports/materialized-discount-counter-rows.test.js +107 -0
  293. package/lib/tests/materialized-reports/materialized-discount-entries-accumulation.test.d.ts +1 -0
  294. package/lib/tests/materialized-reports/materialized-discount-entries-accumulation.test.js +125 -0
  295. package/lib/tests/materialized-reports/materialized-hourly-comparison-compile.test.d.ts +1 -0
  296. package/lib/tests/materialized-reports/materialized-hourly-comparison-compile.test.js +146 -0
  297. package/lib/tests/materialized-reports/materialized-hourly-comparison-formatter.test.d.ts +1 -0
  298. package/lib/tests/materialized-reports/materialized-hourly-comparison-formatter.test.js +127 -0
  299. package/lib/tests/materialized-reports/materialized-hourly-comparison-plan.test.d.ts +1 -0
  300. package/lib/tests/materialized-reports/materialized-hourly-comparison-plan.test.js +138 -0
  301. package/lib/tests/materialized-reports/materialized-hourly-comparison-selection.test.d.ts +1 -0
  302. package/lib/tests/materialized-reports/materialized-hourly-comparison-selection.test.js +90 -0
  303. package/lib/tests/materialized-reports/materialized-payments-comparison-compile.test.d.ts +1 -0
  304. package/lib/tests/materialized-reports/materialized-payments-comparison-compile.test.js +164 -0
  305. package/lib/tests/materialized-reports/materialized-payments-comparison-formatter.test.d.ts +1 -0
  306. package/lib/tests/materialized-reports/materialized-payments-comparison-formatter.test.js +117 -0
  307. package/lib/tests/materialized-reports/materialized-payments-comparison-plan.test.d.ts +1 -0
  308. package/lib/tests/materialized-reports/materialized-payments-comparison-plan.test.js +149 -0
  309. package/lib/tests/materialized-reports/materialized-prep-time-classification.test.d.ts +1 -0
  310. package/lib/tests/materialized-reports/materialized-prep-time-classification.test.js +273 -0
  311. package/lib/tests/materialized-reports/materialized-prep-time-close-day.test.d.ts +1 -0
  312. package/lib/tests/materialized-reports/materialized-prep-time-close-day.test.js +271 -0
  313. package/lib/tests/materialized-reports/materialized-prep-time-compile.test.d.ts +1 -0
  314. package/lib/tests/materialized-reports/materialized-prep-time-compile.test.js +217 -0
  315. package/lib/tests/materialized-reports/materialized-prep-time-constants.test.d.ts +1 -0
  316. package/lib/tests/materialized-reports/materialized-prep-time-constants.test.js +84 -0
  317. package/lib/tests/materialized-reports/materialized-prep-time-plan.test.d.ts +1 -0
  318. package/lib/tests/materialized-reports/materialized-prep-time-plan.test.js +176 -0
  319. package/lib/tests/materialized-reports/materialized-reports-scope-group-helpers.test.js +13 -13
  320. package/lib/tests/materialized-reports/materialized-sales-comparison-baseline.test.d.ts +1 -0
  321. package/lib/tests/materialized-reports/materialized-sales-comparison-baseline.test.js +126 -0
  322. package/lib/tests/materialized-reports/materialized-sales-comparison-compile.test.d.ts +1 -0
  323. package/lib/tests/materialized-reports/materialized-sales-comparison-compile.test.js +207 -0
  324. package/lib/tests/materialized-reports/materialized-sales-comparison-formatter.test.d.ts +1 -0
  325. package/lib/tests/materialized-reports/materialized-sales-comparison-formatter.test.js +179 -0
  326. package/lib/tests/materialized-reports/materialized-sales-comparison-parity.test.d.ts +1 -0
  327. package/lib/tests/materialized-reports/materialized-sales-comparison-parity.test.js +196 -0
  328. package/lib/tests/materialized-reports/materialized-sales-comparison-plan.test.d.ts +1 -0
  329. package/lib/tests/materialized-reports/materialized-sales-comparison-plan.test.js +241 -0
  330. package/lib/tests/materialized-reports/materialized-tenant-hourly-comparison-schema.test.d.ts +1 -0
  331. package/lib/tests/materialized-reports/materialized-tenant-hourly-comparison-schema.test.js +96 -0
  332. package/lib/tests/materialized-reports/materialized-tenant-payments-comparison-schema.test.d.ts +1 -0
  333. package/lib/tests/materialized-reports/materialized-tenant-payments-comparison-schema.test.js +112 -0
  334. package/lib/tests/materialized-reports/materialized-tenant-sales-comparison-schema.test.d.ts +1 -0
  335. package/lib/tests/materialized-reports/materialized-tenant-sales-comparison-schema.test.js +142 -0
  336. package/lib/tests/materialized-reports/materialized-tenant-sales-overview-reports-schema.test.js +8 -1
  337. package/lib/tests/materialized-reports/sales-comparison-reference.d.ts +55 -0
  338. package/lib/tests/materialized-reports/sales-comparison-reference.js +86 -0
  339. package/lib/tests/materialized-reports/tenant-discount-formatter.test.d.ts +1 -0
  340. package/lib/tests/materialized-reports/tenant-discount-formatter.test.js +289 -0
  341. package/lib/tests/materialized-reports/tenant-prep-time-formatter.test.d.ts +1 -0
  342. package/lib/tests/materialized-reports/tenant-prep-time-formatter.test.js +354 -0
  343. package/lib/tests/reporting-contract.test.d.ts +1 -0
  344. package/lib/tests/reporting-contract.test.js +267 -0
  345. package/lib/tests/rider-daily-report.test.d.ts +1 -0
  346. package/lib/tests/rider-daily-report.test.js +86 -0
  347. package/lib/tests/rider-earnings.test.d.ts +1 -0
  348. package/lib/tests/rider-earnings.test.js +65 -0
  349. package/lib/tests/rider-report.test.d.ts +1 -0
  350. package/lib/tests/rider-report.test.js +98 -0
  351. package/package.json +10 -1
@@ -51,6 +51,12 @@ export declare enum MATERIALIZED_REPORT_SCOPE_ENUM {
51
51
  LOCAL_YEAR = "localYear"
52
52
  }
53
53
  export declare const ALL_MATERIALIZED_REPORT_SCOPES: MATERIALIZED_REPORT_SCOPE_ENUM[];
54
+ /** Time-window refinement used when compiling/reading a report scope. */
55
+ export declare enum MATERIALIZED_REPORT_WINDOW_KIND_ENUM {
56
+ RECURRING = "RECURRING",
57
+ SPAN = "SPAN"
58
+ }
59
+ export declare const ALL_MATERIALIZED_REPORT_WINDOW_KINDS: MATERIALIZED_REPORT_WINDOW_KIND_ENUM[];
54
60
  /**
55
61
  * Scopes whose documents carry the denormalized `day_index` weekday field
56
62
  * (derived from `scope_field` by the materializer, `DAY_INDEX_ENUM`). All
@@ -77,11 +83,102 @@ export declare const MATERIALIZED_CREDIT_BILLS_SCOPES: MATERIALIZED_REPORT_SCOPE
77
83
  */
78
84
  export declare enum MATERIALIZED_REPORT_KEY_FILTER_ENUM {
79
85
  ORDER_STATUS = "ORDER_STATUS",
80
- PLATFORM = "PLATFORM"
86
+ PLATFORM = "PLATFORM",
87
+ DRAWER_ID = "DRAWER_ID",
88
+ REF_TYPE = "REF_TYPE",
89
+ CITY = "CITY",
90
+ PAYMENT_METHOD = "PAYMENT_METHOD"
81
91
  }
82
92
  export declare const ALL_MATERIALIZED_REPORT_KEY_FILTERS: MATERIALIZED_REPORT_KEY_FILTER_ENUM[];
83
93
  /** Ordered key filters of the tenant sales overview report (`PLACED:POS_WALK-IN`). */
84
94
  export declare const SALES_OVERVIEW_KEY_FILTERS: MATERIALIZED_REPORT_KEY_FILTER_ENUM[];
95
+ /**
96
+ * Scopes materialized by `materialized_tenant_discount_reports` — the same
97
+ * month-capped set as the credit ledger, for the same reason: the itemized
98
+ * discount rows live in the SIBLING entries collection
99
+ * (`materialized_tenant_discount_entries`), capped at `LOCAL_MONTH` so a
100
+ * document can never grow unboundedly.
101
+ *
102
+ * The report documents themselves are COUNTERS ONLY (see
103
+ * `schemas/types/materialized_tenant_discount_reports.ts`).
104
+ */
105
+ export declare const MATERIALIZED_DISCOUNT_REPORT_SCOPES: MATERIALIZED_REPORT_SCOPE_ENUM[];
106
+ /** Ordered key filters of the discounts report (`COMPLETED:POS_WALK-IN`). */
107
+ export declare const DISCOUNTS_KEY_FILTERS: MATERIALIZED_REPORT_KEY_FILTER_ENUM[];
108
+ /**
109
+ * Discount SLOT of one row — mirrors the three slots of the order/item
110
+ * `IDiscountDetails` (`special_`, `loyalty_`, `voucher_`).
111
+ */
112
+ export declare enum MATERIALIZED_DISCOUNT_SLOT_ENUM {
113
+ SPECIAL = "SPECIAL",
114
+ LOYALTY = "LOYALTY",
115
+ VOUCHER = "VOUCHER"
116
+ }
117
+ export declare const ALL_MATERIALIZED_DISCOUNT_SLOTS: MATERIALIZED_DISCOUNT_SLOT_ENUM[];
118
+ /**
119
+ * Sub-kind of a discount row, derived from the slot's ID SHAPE (the only
120
+ * discriminator the write path stores — verified against live fixtures):
121
+ *
122
+ * - `COLLECTION` — `special_discount_id` is a 24-hex ObjectId (a
123
+ * `discounts` collection document).
124
+ * - `MANUAL` — id starts `MANUAL_` (quick % / custom amount /
125
+ * payment-type discounts). NOT `MANUAL_SINGLE_`.
126
+ * - `PRICE_OVERRIDE` — id starts `MANUAL_SINGLE_` (item price override).
127
+ * - `CATALOG_ITEM` — id is an item id or `SPECIAL_DISCOUNT` (a catalog
128
+ * item's own configured discount).
129
+ * - `OFFER` — loyalty/voucher slot whose id is an offer ObjectId.
130
+ * - `GIFT_CARD` — loyalty slot whose id is a gift-card ObjectId (the
131
+ * reference number carries the code).
132
+ * - `WALLET_CASHBACK` — the sentinel id `wallet_cashback_redemption`.
133
+ * - `UNATTRIBUTED` — no usable slot id, or order-level money the slots
134
+ * cannot explain (see the counter type).
135
+ */
136
+ export declare enum MATERIALIZED_DISCOUNT_SUB_KIND_ENUM {
137
+ COLLECTION = "COLLECTION",
138
+ MANUAL = "MANUAL",
139
+ PRICE_OVERRIDE = "PRICE_OVERRIDE",
140
+ CATALOG_ITEM = "CATALOG_ITEM",
141
+ OFFER = "OFFER",
142
+ GIFT_CARD = "GIFT_CARD",
143
+ WALLET_CASHBACK = "WALLET_CASHBACK",
144
+ UNATTRIBUTED = "UNATTRIBUTED"
145
+ }
146
+ export declare const ALL_MATERIALIZED_DISCOUNT_SUB_KINDS: MATERIALIZED_DISCOUNT_SUB_KIND_ENUM[];
147
+ /**
148
+ * Kind of one itemized discount row in
149
+ * `materialized_tenant_discount_entries`.
150
+ *
151
+ * - `DISCOUNT` — a slot on the order or on one item.
152
+ * - `FREE_ITEM` — a 100 % item row (also present as a `DISCOUNT` row; the
153
+ * drill-down decides which view lists it).
154
+ * - `COMPLIMENTARY` — a `COMPLIMENTARY` payment (no discount slot required).
155
+ */
156
+ export declare enum MATERIALIZED_DISCOUNT_ENTRY_KIND_ENUM {
157
+ DISCOUNT = "DISCOUNT",
158
+ FREE_ITEM = "FREE_ITEM",
159
+ COMPLIMENTARY = "COMPLIMENTARY"
160
+ }
161
+ export declare const ALL_MATERIALIZED_DISCOUNT_ENTRY_KINDS: MATERIALIZED_DISCOUNT_ENTRY_KIND_ENUM[];
162
+ /** Level a discount applies at — the order, one item, or a payment. */
163
+ export declare enum MATERIALIZED_DISCOUNT_LEVEL_ENUM {
164
+ ORDER = "ORDER",
165
+ ITEM = "ITEM",
166
+ PAYMENT = "PAYMENT"
167
+ }
168
+ export declare const ALL_MATERIALIZED_DISCOUNT_LEVELS: MATERIALIZED_DISCOUNT_LEVEL_ENUM[];
169
+ /**
170
+ * Cap of a discount report document's `top_sources` leaderboard. Display-only:
171
+ * every number in that list is also derivable from `discount_counters`, so a
172
+ * truncated list can never change a total.
173
+ */
174
+ export declare const MATERIALIZED_DISCOUNT_SOURCE_LIMIT = 12;
175
+ /**
176
+ * The gift-card / wallet sentinel ids the toolkit writes into discount slots.
177
+ * Kept here so the classifier and the writers cannot drift apart.
178
+ */
179
+ export declare const MATERIALIZED_DISCOUNT_SPECIAL_DISCOUNT_ID = "SPECIAL_DISCOUNT";
180
+ export declare const MATERIALIZED_DISCOUNT_MANUAL_PREFIX = "MANUAL_";
181
+ export declare const MATERIALIZED_DISCOUNT_PRICE_OVERRIDE_PREFIX = "MANUAL_SINGLE_";
85
182
  /**
86
183
  * Payment-type label used by the frontend report formatter for the derived
87
184
  * credit-settlement line in a collection day's payments breakdown (a
@@ -107,6 +204,138 @@ export declare enum MATERIALIZED_REPORT_CREDIT_BILL_EVENT_TYPE_ENUM {
107
204
  WRITE_OFF = "WRITE_OFF"
108
205
  }
109
206
  export declare const ALL_MATERIALIZED_REPORT_CREDIT_BILL_EVENT_TYPES: MATERIALIZED_REPORT_CREDIT_BILL_EVENT_TYPE_ENUM[];
207
+ /**
208
+ * Scopes materialized by `materialized_tenant_cash_in_out_reports`.
209
+ *
210
+ * NO `localHour`: cash is a close-of-shift concern, the same reasoning that keeps
211
+ * the hour scope out of the prep time report. Day + periods, capped at
212
+ * `LOCAL_MONTH` because the statement rows live in the SIBLING entries collection
213
+ * (`materialized_tenant_cash_in_out_entries`).
214
+ */
215
+ export declare const MATERIALIZED_CASH_REPORT_SCOPES: MATERIALIZED_REPORT_SCOPE_ENUM[];
216
+ /**
217
+ * Ordered key filters of the cash report - `<DRAWER_ID>:<REF_TYPE>` (decision
218
+ * (b3)). Shift ids are deliberately NOT a key dimension: they are
219
+ * high-cardinality and belong in a breakdown table, not in the key.
220
+ */
221
+ export declare const CASH_KEY_FILTERS: MATERIALIZED_REPORT_KEY_FILTER_ENUM[];
222
+ /** Cap of the per-document drawer leaderboard (bounded, display-only). */
223
+ export declare const MATERIALIZED_CASH_SOURCE_LIMIT = 12;
224
+ /**
225
+ * Scopes materialized by `materialized_tenant_delivery_reports`.
226
+ *
227
+ * NO `localHour`: the hour dimension appears as an AREA HEAT MAP inside the document
228
+ * (`areas[city].by_hour`), which is the shape the page actually renders. Materializing
229
+ * a full hour scope as well would multiply documents for a view nobody opens.
230
+ */
231
+ export declare const MATERIALIZED_DELIVERY_REPORT_SCOPES: MATERIALIZED_REPORT_SCOPE_ENUM[];
232
+ /**
233
+ * Ordered key filters of the delivery report - `<PLATFORM>:<CITY>` (decision (b4)).
234
+ *
235
+ * Rider is deliberately NOT a key dimension: rider ids are high-cardinality, so rider
236
+ * analysis is a bounded `riders` map INSIDE each document rather than a partition of
237
+ * the key space.
238
+ */
239
+ export declare const DELIVERY_KEY_FILTERS: MATERIALIZED_REPORT_KEY_FILTER_ENUM[];
240
+ /**
241
+ * Distance histogram of the delivery report, in METRES: inclusive lower, EXCLUSIVE
242
+ * upper, with an open-ended top bucket.
243
+ *
244
+ * Fixed buckets rather than a raw array, for the same reason as the prep time report: a
245
+ * bounded shape keeps a document small and makes a period fold exact.
246
+ */
247
+ export declare const MATERIALIZED_DELIVERY_DISTANCE_BUCKETS: {
248
+ key: string;
249
+ min: number;
250
+ max: number | null;
251
+ }[];
252
+ /** Cap of the per-document rider leaderboard (bounded, display-only). */
253
+ export declare const MATERIALIZED_DELIVERY_RIDER_LIMIT = 50;
254
+ /** Cap of the per-document area leaderboard (bounded, display-only). */
255
+ export declare const MATERIALIZED_DELIVERY_AREA_LIMIT = 50;
256
+ /**
257
+ * Scopes materialized by `materialized_tenant_prep_time_reports`.
258
+ *
259
+ * NO `localHour` (decision h2): the tracked population per hour is 2-3 items in
260
+ * the dev stores, so an hourly prep time would be noise. Day + periods only,
261
+ * capped at `LOCAL_MONTH` because the itemized rows live in the SIBLING entries
262
+ * collection (`materialized_tenant_prep_time_entries`).
263
+ */
264
+ export declare const MATERIALIZED_PREP_TIME_REPORT_SCOPES: MATERIALIZED_REPORT_SCOPE_ENUM[];
265
+ /** Ordered key filters of the prep time report (`COMPLETED:POS_WALK-IN`). */
266
+ export declare const PREP_TIME_KEY_FILTERS: MATERIALIZED_REPORT_KEY_FILTER_ENUM[];
267
+ /**
268
+ * ANCHOR PROVENANCE of one tracked item - the split that makes this report
269
+ * correct (decision b2, section 3.2.1 of the concept doc).
270
+ *
271
+ * `ready_minutes` is written from the chain
272
+ * `prep_started_at ?? order_status_updated_at ?? createdAt`, and the two
273
+ * populations behave completely differently:
274
+ *
275
+ * - MEASURED - `prep_started_at` AND `ready_minutes` both present. The item owns
276
+ * its prep clock, so the ready instant is reconstructible
277
+ * (`prep_started_at + ready_minutes`). Two independent stores AGREE here
278
+ * (avg ~9.3 min, median 5-8, p90 23, ~30% instant).
279
+ * - UNMEASURED - everything else, including `ready_minutes` with NO
280
+ * `prep_started_at`: the anchor fell back to the order stage and the value is
281
+ * degenerate (bruzo: avg 0.0, 99.8% zeros). Counted in COVERAGE only.
282
+ *
283
+ * Blending them under-reports the average by ~13x in the store with the MOST
284
+ * data (0.7 vs 9.2 min) - the single mistake this design exists to prevent.
285
+ */
286
+ export declare enum MATERIALIZED_PREP_TIME_ANCHOR_ENUM {
287
+ MEASURED = "MEASURED",
288
+ UNMEASURED = "UNMEASURED"
289
+ }
290
+ export declare const ALL_MATERIALIZED_PREP_TIME_ANCHORS: MATERIALIZED_PREP_TIME_ANCHOR_ENUM[];
291
+ /**
292
+ * Fixed duration histogram of the MEASURED bucket, in minutes.
293
+ *
294
+ * A fixed histogram (decision d2) keeps documents small and is exactly what the
295
+ * UI renders; `median` / `p90` are derived from it and are therefore
296
+ * BUCKET-APPROXIMATE (the exact `avg` comes from `sum / count`). Storing every
297
+ * duration to get exact percentiles is the expensive option this avoids.
298
+ */
299
+ export declare const MATERIALIZED_PREP_TIME_BUCKETS: {
300
+ label: string;
301
+ min: number;
302
+ max: number | null;
303
+ }[];
304
+ export declare const ALL_MATERIALIZED_PREP_TIME_BUCKET_LABELS: string[];
305
+ /**
306
+ * Longest prep duration (minutes) trusted as a real prep time. A stored
307
+ * `ready_minutes` beyond this is a clock/backfill artefact rather than a prep
308
+ * time, so it still lands in the top bucket (the counts stay honest) but is kept
309
+ * out of `sum` / `min` / `max` - the same defensive posture the other reports
310
+ * take with outlier inputs.
311
+ */
312
+ export declare const MATERIALIZED_PREP_TIME_MAX_MINUTES: number;
313
+ /** Label of the top histogram bucket (everything at or above its `min`). */
314
+ export declare const MATERIALIZED_PREP_TIME_TOP_BUCKET = "60+";
315
+ /**
316
+ * On-time tolerance (decision f2): ready instant <= target counts as ON TIME
317
+ * (`delta <= 0`) for v1. The signed `delta_sum` is kept so a grace window can be
318
+ * applied later WITHOUT re-materializing.
319
+ */
320
+ export declare const MATERIALIZED_PREP_TIME_ON_TIME_MAX_DELTA = 0;
321
+ /**
322
+ * WHERE an item's on-time target came from (decision e2).
323
+ *
324
+ * Promise-only grading would leave 63-97% of items ungraded (measured: only
325
+ * 2.7% / 36.2% of orders carry an explicit estimate), so an item with no promise
326
+ * is graded against the TENANT DEFAULT - the documented
327
+ * `getDeliveryExpectedTime` fallback chain. The baseline is labelled per row so
328
+ * a reader can always tell the two apart.
329
+ */
330
+ export declare enum MATERIALIZED_PREP_TIME_TARGET_ENUM {
331
+ /** The order carried an explicit estimate. */
332
+ PROMISE = "PROMISE",
333
+ /** The order was ASAP and is graded against the tenant default. */
334
+ TENANT_DEFAULT = "TENANT_DEFAULT",
335
+ /** Neither exists - the row cannot be graded. */
336
+ NONE = "NONE"
337
+ }
338
+ export declare const ALL_MATERIALIZED_PREP_TIME_TARGETS: MATERIALIZED_PREP_TIME_TARGET_ENUM[];
110
339
  /**
111
340
  * Materialized report kinds — the discriminator stored on
112
341
  * `materialized_tenant_reports_iterations` rows. A single shared history collection records
@@ -117,6 +346,120 @@ export declare const ALL_MATERIALIZED_REPORT_CREDIT_BILL_EVENT_TYPES: MATERIALIZ
117
346
  */
118
347
  export declare enum MATERIALIZED_REPORT_TYPE_ENUM {
119
348
  TENANT_SALES_OVERVIEW = "TENANT_SALES_OVERVIEW",
120
- TENANT_CREDIT_BILLS = "TENANT_CREDIT_BILLS"
349
+ TENANT_CREDIT_BILLS = "TENANT_CREDIT_BILLS",
350
+ TENANT_DISCOUNT_REPORTS = "TENANT_DISCOUNT_REPORTS",
351
+ TENANT_DISCOUNT_ENTRIES = "TENANT_DISCOUNT_ENTRIES",
352
+ TENANT_PREP_TIME_REPORTS = "TENANT_PREP_TIME_REPORTS",
353
+ TENANT_PREP_TIME_ENTRIES = "TENANT_PREP_TIME_ENTRIES",
354
+ TENANT_CASH_REPORTS = "TENANT_CASH_REPORTS",
355
+ TENANT_CASH_ENTRIES = "TENANT_CASH_ENTRIES",
356
+ TENANT_DELIVERY_REPORTS = "TENANT_DELIVERY_REPORTS",
357
+ TENANT_DELIVERY_ENTRIES = "TENANT_DELIVERY_ENTRIES",
358
+ TENANT_SALES_COMPARISON_REPORTS = "TENANT_SALES_COMPARISON_REPORTS",
359
+ TENANT_SALES_COMPARISON_ENTRIES = "TENANT_SALES_COMPARISON_ENTRIES",
360
+ TENANT_HOURLY_COMPARISON_REPORTS = "TENANT_HOURLY_COMPARISON_REPORTS",
361
+ TENANT_HOURLY_COMPARISON_ENTRIES = "TENANT_HOURLY_COMPARISON_ENTRIES",
362
+ TENANT_PAYMENTS_COMPARISON_REPORTS = "TENANT_PAYMENTS_COMPARISON_REPORTS",
363
+ TENANT_PAYMENTS_COMPARISON_ENTRIES = "TENANT_PAYMENTS_COMPARISON_ENTRIES"
121
364
  }
122
365
  export declare const ALL_MATERIALIZED_REPORT_TYPES: MATERIALIZED_REPORT_TYPE_ENUM[];
366
+ /**
367
+ * Sales Comparison (see console/admin-panel/docs/report-sales-comparison-concept.md).
368
+ *
369
+ * A REPORT, not Analytics: it lives under Reports - New -> Comparisons and its numbers are
370
+ * decimal-exact. The comparison itself is never stored - `current` and `comparison` are two
371
+ * ordinary reads, subtracted in the formatter.
372
+ *
373
+ * Fixes no time bias: a complete business day (localDate) is the anchor, because the day
374
+ * close defines it. A range-based bias is meaningless once the business day exists.
375
+ */
376
+ export declare const MATERIALIZED_TENANT_SALES_COMPARISON_REPORTS_COLLECTION_NAME = "materialized_tenant_sales_comparison_reports";
377
+ export declare const MATERIALIZED_TENANT_SALES_COMPARISON_ENTRIES_COLLECTION_NAME = "materialized_tenant_sales_comparison_entries";
378
+ /** Six grains. NO ISO week (owner decision) and NO hour - this is not the hourly report. */
379
+ export declare const MATERIALIZED_SALES_COMPARISON_REPORT_SCOPES: MATERIALIZED_REPORT_SCOPE_ENUM[];
380
+ /** Key grammar: `COMPLETED:POS_DINE-IN`. No sale-type dimension (owner decision). */
381
+ export declare const SALES_COMPARISON_KEY_FILTERS: MATERIALIZED_REPORT_KEY_FILTER_ENUM[];
382
+ export declare const MATERIALIZED_TENANT_SALES_COMPARISON_REPORTS_SCHEMA_VERSION = 1;
383
+ export declare const MATERIALIZED_TENANT_SALES_COMPARISON_ENTRIES_SCHEMA_VERSION = 1;
384
+ /**
385
+ * The baseline a Sales Comparison read is compared against (owner decision:
386
+ * Toast/Square behaviour). The user picks ONE range; the comparison range is
387
+ * DERIVED server-side:
388
+ * - `NONE` — no comparison series;
389
+ * - `PREVIOUS_PERIOD` — an EQUAL-LENGTH range immediately preceding the primary
390
+ * range (never "the previous calendar month" — that is the classic
391
+ * off-by-one-day bug);
392
+ * - `PREVIOUS_YEAR` — the primary range shifted back 12 months, same length.
393
+ */
394
+ export declare enum SALES_COMPARISON_BASELINE_ENUM {
395
+ NONE = "NONE",
396
+ PREVIOUS_PERIOD = "PREVIOUS_PERIOD",
397
+ PREVIOUS_YEAR = "PREVIOUS_YEAR"
398
+ }
399
+ export declare const ALL_SALES_COMPARISON_BASELINES: SALES_COMPARISON_BASELINE_ENUM[];
400
+ /**
401
+ * The metric the page charts / headlines (concept §9, `Select Field`).
402
+ *
403
+ * CLIENT-SIDE ONLY: the document already carries every additive counter, so
404
+ * changing this selection must NOT refetch. `AVERAGE_TICKET` is DERIVED
405
+ * (`net_amount / order_count`) and is never stored.
406
+ */
407
+ export declare enum SALES_COMPARISON_METRIC_ENUM {
408
+ NET_SALES = "NET_SALES",
409
+ GROSS_SALES = "GROSS_SALES",
410
+ DISCOUNTS = "DISCOUNTS",
411
+ ORDER_COUNT = "ORDER_COUNT",
412
+ AVERAGE_TICKET = "AVERAGE_TICKET",
413
+ ITEMS_SOLD = "ITEMS_SOLD"
414
+ }
415
+ export declare const ALL_SALES_COMPARISON_METRICS: SALES_COMPARISON_METRIC_ENUM[];
416
+ /**
417
+ * Hourly Comparison (see console/admin-panel/docs/report-hourly-comparison-concept.md).
418
+ *
419
+ * ONE hourly PROFILE compared against the same profile in a derived baseline range
420
+ * (decision A: one profile pair, not a per-day matrix). The comparison is never stored -
421
+ * `current` and `comparison` are two ordinary reads of HOUR documents, aligned and
422
+ * subtracted in the formatter.
423
+ *
424
+ * Anchor: `order_settled_at` -> the tenant-local settled day AND hour. No time bias.
425
+ *
426
+ * No period documents are written: the profile read only needs hour buckets. The period
427
+ * comparison report already owns the day/period materialization.
428
+ */
429
+ export declare const MATERIALIZED_TENANT_HOURLY_COMPARISON_REPORTS_COLLECTION_NAME = "materialized_tenant_hourly_comparison_reports";
430
+ export declare const MATERIALIZED_TENANT_HOURLY_COMPARISON_ENTRIES_COLLECTION_NAME = "materialized_tenant_hourly_comparison_entries";
431
+ /** Hour documents only. This is an HOURLY report; no day or period documents. */
432
+ export declare const MATERIALIZED_HOURLY_COMPARISON_REPORT_SCOPES: MATERIALIZED_REPORT_SCOPE_ENUM[];
433
+ /** The same key grammar as Sales Comparison: `COMPLETED:POS_DINE-IN`. */
434
+ export declare const HOURLY_COMPARISON_KEY_FILTERS: MATERIALIZED_REPORT_KEY_FILTER_ENUM[];
435
+ export declare const MATERIALIZED_TENANT_HOURLY_COMPARISON_REPORTS_SCHEMA_VERSION = 1;
436
+ export declare const MATERIALIZED_TENANT_HOURLY_COMPARISON_ENTRIES_SCHEMA_VERSION = 1;
437
+ /**
438
+ * Payments Comparison (see console/admin-panel/docs/report-payments-comparison-concept.md).
439
+ *
440
+ * Payment ROWS, not orders: a split order contributes one row per payment, so this
441
+ * report can never be merged with Sales Comparison (which sums orders). The key is
442
+ * `<PAYMENT_METHOD>:<ORDER_STATUS>` (decision B); the method is the normalized,
443
+ * OPEN-string payment type.
444
+ */
445
+ export declare const MATERIALIZED_TENANT_PAYMENTS_COMPARISON_REPORTS_COLLECTION_NAME = "materialized_tenant_payments_comparison_reports";
446
+ export declare const MATERIALIZED_TENANT_PAYMENTS_COMPARISON_ENTRIES_COLLECTION_NAME = "materialized_tenant_payments_comparison_entries";
447
+ /** The same six comparison grains; no hour / ISO week. */
448
+ export declare const MATERIALIZED_PAYMENTS_COMPARISON_REPORT_SCOPES: MATERIALIZED_REPORT_SCOPE_ENUM[];
449
+ /** Ordered key filters: `<PAYMENT_METHOD>:<ORDER_STATUS>`. */
450
+ export declare const PAYMENTS_COMPARISON_KEY_FILTERS: MATERIALIZED_REPORT_KEY_FILTER_ENUM[];
451
+ export declare const MATERIALIZED_TENANT_PAYMENTS_COMPARISON_REPORTS_SCHEMA_VERSION = 1;
452
+ export declare const MATERIALIZED_TENANT_PAYMENTS_COMPARISON_ENTRIES_SCHEMA_VERSION = 1;
453
+ /**
454
+ * The metric the Payments Comparison page charts (client-side).
455
+ * `AVERAGE_PAYMENT` is derived (`payment_amount / payment_count`), never stored.
456
+ */
457
+ export declare enum PAYMENTS_COMPARISON_METRIC_ENUM {
458
+ PAYMENT_AMOUNT = "PAYMENT_AMOUNT",
459
+ PAYMENT_COUNT = "PAYMENT_COUNT",
460
+ AVERAGE_PAYMENT = "AVERAGE_PAYMENT",
461
+ CARD_CHARGES = "CARD_CHARGES",
462
+ REFUNDED_AMOUNT = "REFUNDED_AMOUNT",
463
+ AMOUNT_DUE = "AMOUNT_DUE"
464
+ }
465
+ export declare const ALL_PAYMENTS_COMPARISON_METRICS: PAYMENTS_COMPARISON_METRIC_ENUM[];