@sixtyninecommerce/admin 0.10.0 → 0.12.0

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 (302) hide show
  1. package/README.md +5772 -118
  2. package/dist/auth/index.d.ts +7 -1
  3. package/dist/auth/index.js +8 -1
  4. package/dist/catalog/assets.d.ts +120 -8
  5. package/dist/catalog/assets.js +98 -12
  6. package/dist/catalog/collections.d.ts +279 -14
  7. package/dist/catalog/collections.js +246 -15
  8. package/dist/catalog/documents.d.ts +142 -0
  9. package/dist/catalog/documents.js +114 -0
  10. package/dist/catalog/index.d.ts +54 -6
  11. package/dist/catalog/index.js +10 -1
  12. package/dist/catalog/metadata.d.ts +244 -0
  13. package/dist/catalog/metadata.js +220 -0
  14. package/dist/catalog/products.d.ts +159 -19
  15. package/dist/catalog/products.js +88 -13
  16. package/dist/catalog/properties.d.ts +140 -14
  17. package/dist/catalog/properties.js +65 -1
  18. package/dist/catalog/recommendations.d.ts +288 -0
  19. package/dist/catalog/recommendations.js +237 -0
  20. package/dist/catalog/reviews.d.ts +381 -0
  21. package/dist/catalog/reviews.js +325 -0
  22. package/dist/catalog/types.d.ts +17 -1
  23. package/dist/catalog/types.js +10 -0
  24. package/dist/catalog/variant-find.d.ts +136 -0
  25. package/dist/catalog/variant-find.js +239 -0
  26. package/dist/catalog/variants.d.ts +293 -26
  27. package/dist/catalog/variants.js +164 -7
  28. package/dist/catalog/visibility.d.ts +38 -7
  29. package/dist/catalog/visibility.js +19 -1
  30. package/dist/client.d.ts +121 -9
  31. package/dist/client.js +53 -14
  32. package/dist/content/assets.d.ts +285 -0
  33. package/dist/content/assets.js +181 -0
  34. package/dist/content/forms.d.ts +332 -1
  35. package/dist/content/forms.js +140 -4
  36. package/dist/content/items.d.ts +292 -0
  37. package/dist/content/items.js +170 -0
  38. package/dist/content/menus.d.ts +254 -0
  39. package/dist/content/menus.js +70 -0
  40. package/dist/content/strings.d.ts +137 -0
  41. package/dist/content/strings.js +82 -0
  42. package/dist/content/types.d.ts +282 -0
  43. package/dist/content/types.js +100 -0
  44. package/dist/customers/age-verification.d.ts +66 -0
  45. package/dist/customers/age-verification.js +79 -0
  46. package/dist/customers/credit.d.ts +263 -0
  47. package/dist/customers/credit.js +244 -0
  48. package/dist/customers/delivery-preferences.d.ts +120 -0
  49. package/dist/customers/delivery-preferences.js +97 -0
  50. package/dist/customers/delivery-terms.d.ts +44 -0
  51. package/dist/customers/delivery-terms.js +32 -0
  52. package/dist/customers/groups.d.ts +207 -0
  53. package/dist/customers/groups.js +438 -0
  54. package/dist/customers/index.d.ts +462 -37
  55. package/dist/customers/index.js +317 -40
  56. package/dist/customers/invitation-status.d.ts +57 -0
  57. package/dist/customers/invitation-status.js +21 -0
  58. package/dist/customers/notes.d.ts +67 -0
  59. package/dist/customers/notes.js +51 -0
  60. package/dist/customers/notification-recipients.d.ts +97 -0
  61. package/dist/customers/notification-recipients.js +84 -0
  62. package/dist/customers/saved-lists.d.ts +42 -0
  63. package/dist/customers/saved-lists.js +61 -0
  64. package/dist/customers/vat.d.ts +83 -0
  65. package/dist/customers/vat.js +46 -0
  66. package/dist/customers/wire.d.ts +20 -0
  67. package/dist/customers/wire.js +35 -0
  68. package/dist/documents/ar.d.ts +307 -0
  69. package/dist/documents/ar.js +254 -0
  70. package/dist/documents/emails.d.ts +150 -0
  71. package/dist/documents/emails.js +220 -0
  72. package/dist/documents/index.d.ts +744 -21
  73. package/dist/documents/index.js +438 -24
  74. package/dist/documents/pdf.d.ts +2 -0
  75. package/dist/documents/pdf.js +11 -0
  76. package/dist/fulfillments/create.d.ts +167 -0
  77. package/dist/fulfillments/create.js +216 -0
  78. package/dist/fulfillments/index.d.ts +163 -11
  79. package/dist/fulfillments/index.js +135 -6
  80. package/dist/fulfillments/payment-policy.d.ts +64 -0
  81. package/dist/fulfillments/payment-policy.js +140 -0
  82. package/dist/fulfillments/warehouse.d.ts +724 -0
  83. package/dist/fulfillments/warehouse.js +914 -0
  84. package/dist/geo/index.d.ts +119 -0
  85. package/dist/geo/index.js +107 -0
  86. package/dist/index.d.ts +147 -39
  87. package/dist/index.js +51 -12
  88. package/dist/integrations/afas-actions.d.ts +234 -0
  89. package/dist/integrations/afas-actions.js +310 -0
  90. package/dist/integrations/afas-types.d.ts +483 -0
  91. package/dist/integrations/afas-types.js +5 -0
  92. package/dist/integrations/afas.d.ts +234 -0
  93. package/dist/integrations/afas.js +290 -0
  94. package/dist/integrations/connections.d.ts +103 -0
  95. package/dist/integrations/connections.js +55 -0
  96. package/dist/integrations/esp.d.ts +313 -0
  97. package/dist/integrations/esp.js +169 -0
  98. package/dist/integrations/exact-online-types.d.ts +965 -0
  99. package/dist/integrations/exact-online-types.js +6 -0
  100. package/dist/integrations/exact-online.d.ts +784 -0
  101. package/dist/integrations/exact-online.js +1089 -0
  102. package/dist/integrations/index.d.ts +44 -3
  103. package/dist/integrations/index.js +23 -3
  104. package/dist/integrations/pipeline-discoveries.d.ts +65 -0
  105. package/dist/integrations/pipeline-discoveries.js +65 -0
  106. package/dist/integrations/pipeline-keys.d.ts +13 -0
  107. package/dist/integrations/pipeline-keys.js +22 -0
  108. package/dist/integrations/pipeline-runs.d.ts +119 -0
  109. package/dist/integrations/pipeline-runs.js +87 -0
  110. package/dist/integrations/pipelines.d.ts +87 -15
  111. package/dist/integrations/pipelines.js +41 -22
  112. package/dist/integrations/price-import.d.ts +223 -0
  113. package/dist/integrations/price-import.js +124 -0
  114. package/dist/integrations/types.d.ts +367 -3
  115. package/dist/integrations/types.js +4 -3
  116. package/dist/locations/index.d.ts +66 -0
  117. package/dist/locations/index.js +31 -0
  118. package/dist/meta/index.d.ts +172 -0
  119. package/dist/metafields/index.d.ts +8 -1
  120. package/dist/metafields/index.js +10 -0
  121. package/dist/orders/cancel-with-money.d.ts +237 -0
  122. package/dist/orders/cancel-with-money.js +155 -0
  123. package/dist/orders/commit-edit.d.ts +23 -1
  124. package/dist/orders/commit-edit.js +19 -2
  125. package/dist/orders/deposit-policy.d.ts +3 -1
  126. package/dist/orders/drafts.d.ts +800 -0
  127. package/dist/orders/drafts.js +771 -0
  128. package/dist/orders/fields.d.ts +245 -0
  129. package/dist/orders/fields.js +188 -0
  130. package/dist/orders/get.d.ts +29 -19
  131. package/dist/orders/get.js +17 -8
  132. package/dist/orders/index.d.ts +66 -15
  133. package/dist/orders/index.js +25 -2
  134. package/dist/orders/lifecycle.d.ts +128 -0
  135. package/dist/orders/lifecycle.js +158 -0
  136. package/dist/orders/line-price-preview.d.ts +7 -2
  137. package/dist/orders/list.d.ts +243 -0
  138. package/dist/orders/list.js +487 -0
  139. package/dist/orders/manual-discounts.d.ts +13 -5
  140. package/dist/orders/manual-pricing.d.ts +5 -0
  141. package/dist/orders/money-view.d.ts +149 -0
  142. package/dist/orders/money-view.js +99 -0
  143. package/dist/orders/order-entry.d.ts +20 -7
  144. package/dist/orders/plan-edit.d.ts +34 -2
  145. package/dist/orders/plan-edit.js +112 -11
  146. package/dist/orders/settings.d.ts +201 -0
  147. package/dist/orders/settings.js +325 -0
  148. package/dist/orders/status.d.ts +159 -13
  149. package/dist/orders/status.js +21 -0
  150. package/dist/orders/surcharges.d.ts +20 -1
  151. package/dist/orders/surcharges.js +37 -11
  152. package/dist/payments/account-credit.d.ts +46 -0
  153. package/dist/payments/account-credit.js +42 -0
  154. package/dist/payments/ar.d.ts +292 -0
  155. package/dist/payments/ar.js +223 -0
  156. package/dist/payments/connected-account.d.ts +47 -0
  157. package/dist/payments/connected-account.js +61 -0
  158. package/dist/payments/credit-noted-fields.d.ts +19 -0
  159. package/dist/payments/credit-noted-fields.js +69 -0
  160. package/dist/payments/customer-consent.d.ts +30 -0
  161. package/dist/payments/customer-consent.js +49 -0
  162. package/dist/payments/index.d.ts +340 -19
  163. package/dist/payments/index.js +151 -1
  164. package/dist/payments/methods.d.ts +303 -8
  165. package/dist/payments/methods.js +337 -7
  166. package/dist/payments/mollie-methods.d.ts +159 -0
  167. package/dist/payments/mollie-methods.js +141 -0
  168. package/dist/payments/payment-links.d.ts +180 -0
  169. package/dist/payments/payment-links.js +97 -0
  170. package/dist/payments/provider-keys.d.ts +150 -0
  171. package/dist/payments/provider-keys.js +118 -0
  172. package/dist/payments/providers.d.ts +86 -11
  173. package/dist/payments/providers.js +29 -0
  174. package/dist/payments/requests.d.ts +147 -0
  175. package/dist/payments/requests.js +93 -0
  176. package/dist/payments/store-credit-fields.d.ts +15 -0
  177. package/dist/payments/store-credit-fields.js +51 -0
  178. package/dist/pickups/index.d.ts +106 -0
  179. package/dist/pickups/index.js +108 -0
  180. package/dist/platform/channels.d.ts +132 -0
  181. package/dist/platform/channels.js +128 -0
  182. package/dist/platform/email-gateways.d.ts +165 -0
  183. package/dist/platform/email-gateways.js +78 -0
  184. package/dist/platform/geo.d.ts +123 -0
  185. package/dist/platform/geo.js +144 -0
  186. package/dist/platform/tax.d.ts +162 -0
  187. package/dist/platform/tax.js +169 -0
  188. package/dist/pos/anomalies.d.ts +158 -0
  189. package/dist/pos/anomalies.js +64 -0
  190. package/dist/pos/assisted-selling.d.ts +79 -0
  191. package/dist/pos/assisted-selling.js +38 -0
  192. package/dist/pos/exchanges.d.ts +108 -0
  193. package/dist/pos/exchanges.js +22 -0
  194. package/dist/pos/gift-cards.d.ts +135 -0
  195. package/dist/pos/gift-cards.js +47 -0
  196. package/dist/pos/index.d.ts +2370 -58
  197. package/dist/pos/index.js +854 -7
  198. package/dist/pos/no-receipt.d.ts +94 -0
  199. package/dist/pos/no-receipt.js +25 -0
  200. package/dist/pos/offline-sales.d.ts +228 -0
  201. package/dist/pos/offline-sales.js +170 -0
  202. package/dist/pos/pay-by-link.d.ts +143 -0
  203. package/dist/pos/pay-by-link.js +57 -0
  204. package/dist/pos/quick-keys.d.ts +103 -0
  205. package/dist/pos/quick-keys.js +45 -0
  206. package/dist/pos/reports.d.ts +360 -0
  207. package/dist/pos/reports.js +62 -0
  208. package/dist/pos/returns.d.ts +244 -0
  209. package/dist/pos/returns.js +83 -0
  210. package/dist/pricing/bulk-coupons.d.ts +139 -0
  211. package/dist/pricing/bulk-coupons.js +112 -0
  212. package/dist/pricing/index.d.ts +174 -4
  213. package/dist/pricing/index.js +174 -1
  214. package/dist/pricing/price-lists.d.ts +606 -0
  215. package/dist/pricing/price-lists.js +600 -0
  216. package/dist/purchasing/alerts.d.ts +104 -0
  217. package/dist/purchasing/alerts.js +88 -0
  218. package/dist/purchasing/backorders.d.ts +61 -0
  219. package/dist/purchasing/backorders.js +92 -0
  220. package/dist/purchasing/cost.d.ts +110 -0
  221. package/dist/purchasing/cost.js +86 -0
  222. package/dist/purchasing/index.d.ts +54 -0
  223. package/dist/purchasing/index.js +24 -0
  224. package/dist/purchasing/links.d.ts +263 -0
  225. package/dist/purchasing/links.js +192 -0
  226. package/dist/purchasing/purchase-orders.d.ts +551 -0
  227. package/dist/purchasing/purchase-orders.js +491 -0
  228. package/dist/purchasing/receipts.d.ts +396 -0
  229. package/dist/purchasing/receipts.js +287 -0
  230. package/dist/purchasing/replenishment.d.ts +281 -0
  231. package/dist/purchasing/replenishment.js +240 -0
  232. package/dist/purchasing/returns.d.ts +273 -0
  233. package/dist/purchasing/returns.js +229 -0
  234. package/dist/purchasing/settings.d.ts +152 -0
  235. package/dist/purchasing/settings.js +181 -0
  236. package/dist/purchasing/suppliers.d.ts +476 -0
  237. package/dist/purchasing/suppliers.js +438 -0
  238. package/dist/quotes/index.d.ts +518 -0
  239. package/dist/quotes/index.js +439 -0
  240. package/dist/reports/index.d.ts +71 -8
  241. package/dist/reports/index.js +74 -11
  242. package/dist/returns/index.d.ts +675 -21
  243. package/dist/returns/index.js +756 -11
  244. package/dist/search/index.d.ts +76 -1
  245. package/dist/search/index.js +63 -0
  246. package/dist/seo/config.d.ts +128 -0
  247. package/dist/seo/config.js +95 -0
  248. package/dist/seo/redirects.d.ts +125 -0
  249. package/dist/seo/redirects.js +60 -1
  250. package/dist/seo/settings.d.ts +147 -0
  251. package/dist/seo/settings.js +209 -0
  252. package/dist/shipping/definitions.d.ts +29 -0
  253. package/dist/shipping/definitions.js +47 -0
  254. package/dist/shipping/fulfillment-profiles.d.ts +174 -0
  255. package/dist/shipping/fulfillment-profiles.js +104 -0
  256. package/dist/shipping/hendriks.d.ts +97 -0
  257. package/dist/shipping/hendriks.js +50 -0
  258. package/dist/shipping/index.d.ts +54 -0
  259. package/dist/shipping/index.js +27 -0
  260. package/dist/shipping/methods.d.ts +205 -0
  261. package/dist/shipping/methods.js +240 -0
  262. package/dist/shipping/myparcel.d.ts +668 -0
  263. package/dist/shipping/myparcel.js +466 -0
  264. package/dist/shipping/parcel-count-suggestion.d.ts +2 -0
  265. package/dist/shipping/parcel-rule.d.ts +6 -5
  266. package/dist/shipping/parcel-rule.js +21 -23
  267. package/dist/shipping/rate-tables.d.ts +324 -0
  268. package/dist/shipping/rate-tables.js +390 -0
  269. package/dist/shipping/ship-to-countries.d.ts +75 -0
  270. package/dist/shipping/ship-to-countries.js +47 -0
  271. package/dist/stock/by-location.d.ts +86 -0
  272. package/dist/stock/by-location.js +94 -0
  273. package/dist/stock/index.d.ts +18 -4
  274. package/dist/stock/index.js +7 -0
  275. package/dist/stock/locations.d.ts +144 -0
  276. package/dist/stock/locations.js +168 -0
  277. package/dist/stock/settings.d.ts +106 -0
  278. package/dist/stock/settings.js +103 -0
  279. package/dist/stock/transfers.d.ts +386 -52
  280. package/dist/stock/transfers.js +222 -17
  281. package/dist/stored-value/index.d.ts +312 -11
  282. package/dist/stored-value/index.js +223 -4
  283. package/dist/subscriptions/index.d.ts +682 -0
  284. package/dist/subscriptions/index.js +815 -0
  285. package/dist/tax/display-policy.d.ts +105 -0
  286. package/dist/tax/display-policy.js +84 -0
  287. package/dist/tax/index.d.ts +79 -1
  288. package/dist/tax/index.js +52 -0
  289. package/dist/tenant/email-style.d.ts +102 -0
  290. package/dist/tenant/email-style.js +72 -0
  291. package/dist/tenant/email-templates.d.ts +287 -0
  292. package/dist/tenant/email-templates.js +271 -0
  293. package/dist/tenant/notifications.d.ts +23 -17
  294. package/dist/tenant/settings-sources.d.ts +1 -1
  295. package/dist/tenant/time-zone.d.ts +17 -0
  296. package/dist/tenant/time-zone.js +11 -0
  297. package/dist/types.d.ts +50 -3
  298. package/dist/users/index.d.ts +3 -0
  299. package/dist/users/index.js +2 -0
  300. package/dist/users/warehouses.d.ts +50 -0
  301. package/dist/users/warehouses.js +51 -0
  302. package/package.json +2 -2
@@ -1,5 +1,15 @@
1
1
  import { type Page, type Transport } from '@sixtyninecommerce/core';
2
- import type { Call } from '../types.js';
2
+ import type { Call, ListOptions } from '../types.js';
3
+ import { type PosAnomaliesModule } from './anomalies.js';
4
+ import { type PosAssistedSellingModule } from './assisted-selling.js';
5
+ import { type PosExchangesModule } from './exchanges.js';
6
+ import { type PosGiftCardsModule } from './gift-cards.js';
7
+ import { type PosNoReceiptModule } from './no-receipt.js';
8
+ import { type PosDeviceOfflineSalesToReview, type PosOfflineCashSales, type PosOfflineCashSalesInput, type PosOfflineSalesModule } from './offline-sales.js';
9
+ import { type PosPayByLinkModule } from './pay-by-link.js';
10
+ import { type PosQuickKeysModule } from './quick-keys.js';
11
+ import { type PosReportsModule } from './reports.js';
12
+ import { type PosReturnsModule } from './returns.js';
3
13
  /**
4
14
  * Point of sale on a machine principal (spec §8.8): a vertical's own backend
5
15
  * runs the till — register sessions, cash, tenders, the sale, refunds, X and Z —
@@ -29,7 +39,8 @@ import type { Call } from '../types.js';
29
39
  * / `registerRef`)
30
40
  * — the platform records those refs on each payment only when it vouches for
31
41
  * the credential; they are attribution, never authorization. For a principal
32
- * the CREDENTIAL is the manager gate for discounts and refunds.
42
+ * the CREDENTIAL is the manager gate for discounts and refunds, and for a
43
+ * drawer's paid-out, no-sale and float adjustment.
33
44
  *
34
45
  * ## Money
35
46
  *
@@ -55,17 +66,98 @@ import type { Call } from '../types.js';
55
66
  * - the tenders take money on such a cart (once it is placed, more money is
56
67
  * `POS_ORDER_NOT_PAYABLE`) or on an order the till did not open while it can
57
68
  * still take payment (see {@link PosTendersModule.card});
58
- * - `refunds.create` refunds a payment of a till's sale.
69
+ * - `refunds.create` refunds a payment of a till's sale (money only);
70
+ * - `returns.quote` / `returns.create` / `returns.void` take a sale's items back (or void it) and
71
+ * refund them to the sale's own payments (engine sprint 20);
72
+ * - `exchanges.quote` / `exchanges.create` take a sale's items back and carry their value to an
73
+ * open till cart as its last tender (engine sprint 21).
74
+ *
75
+ * ## Setting the till up
76
+ *
77
+ * `settings` and `terminals` are the store's own setup, for a back-office user
78
+ * or its tooling, not for a till: `settings.get` reads the POS settings, with the
79
+ * till's Mollie API key only ever as `hasMollieKey` and its mask;
80
+ * `settings.setMollieApiKey` / `removeMollieApiKey` write the key (it is never
81
+ * readable again, and a store that is not live takes only a `test_` key);
82
+ * `terminals.list` asks Mollie, server-side with the stored key, which card
83
+ * terminals that key reaches (the id a device is assigned);
84
+ * `settings.setCashRoundingMode` chooses how the cash that settles a sale is
85
+ * rounded, between shifts only; and `settings.readiness` says what the tills
86
+ * still need before they take cash and card payments, judged by the engine from
87
+ * the store's own records. `quickKeys.get` / `quickKeys.set` read and replace the
88
+ * store's quick keys, the favourite-product buttons on every till's sell screen.
89
+ *
90
+ * ## A store's days
91
+ *
92
+ * `days` is a location's business days for a back office: `days.get` one day with its drawers
93
+ * and totals, `days.list` a window of days, `days.close` once every drawer of the day is closed
94
+ * (no drawer opens on it after), `days.reopen` with a reason (engine sprint 26e).
95
+ *
96
+ * ## Reports
97
+ *
98
+ * `reports` is the back office's figures, computed by the engine: `reports.summary` by business
99
+ * day (reconciled to the Z reports), `tenders`, `locations`, `hours` and `cashiers`, each its own
100
+ * document over `posReport` (engine sprint 28). `anomalies` is the store's anomaly flags: the
101
+ * rules (off until the store turns them on), the flags each location's ended business day raised,
102
+ * their acknowledgement with a note, and a day scanned on demand (engine row 43).
103
+ *
104
+ * ## The staff
105
+ *
106
+ * `staff` is the store's cashiers and managers as the back office manages them:
107
+ * name, role, active, and each one's own till language (`locale`). Creating one
108
+ * sets its first PIN; the PIN is never read back.
109
+ *
110
+ * ## Offline cash sales
111
+ *
112
+ * `settings.offlineCashSales` / `setOfflineCashSales` are the store's switch for cash sales a
113
+ * till makes while offline (off by default) and its limits; `offlineSales` is the manager's queue
114
+ * of the ones the engine could not record as rung (engine sprint 45). The till's replay is its
115
+ * own door: no method here sends one.
116
+ *
117
+ * ## Idle lock
118
+ *
119
+ * `settings.idleLock` / `setIdleLock` are after how many minutes without a cashier's touch,
120
+ * keystroke or scan the store's tills sign their cashier out (1 to 60; the tills' default of 5
121
+ * until the store chooses).
59
122
  */
60
123
  export interface PosModule {
61
124
  registers: PosRegistersModule;
62
125
  sessions: PosSessionsModule;
63
126
  cash: PosCashModule;
127
+ /** The store's till sales for a back office (engine sprint 27). */
128
+ orders: PosOrdersModule;
129
+ /** A location's business days: read, list, close and reopen (engine sprint 26). */
130
+ days: PosDaysModule;
131
+ /** The back office's reports, every figure computed by the engine (engine sprint 28). */
132
+ reports: PosReportsModule;
133
+ /** The store's anomaly flags and their rules (engine row 43). Off until the store turns them on. */
134
+ anomalies: PosAnomaliesModule;
64
135
  sale: PosSaleModule;
65
136
  tenders: PosTendersModule;
66
137
  refunds: PosRefundsModule;
138
+ /** Till returns and voids: goods back to the till, money to the sale's tenders (engine sprint 20). */
139
+ returns: PosReturnsModule;
140
+ /** Till exchanges: a sale's items back, their value to an open cart (engine sprint 21). */
141
+ exchanges: PosExchangesModule;
142
+ /** Returns without a receipt: the store's rules and the quote (engine sprint 21). */
143
+ noReceipt: PosNoReceiptModule;
67
144
  devices: PosDevicesModule;
68
145
  receiptNumbering: PosReceiptNumberingModule;
146
+ settings: PosSettingsModule;
147
+ terminals: PosTerminalsModule;
148
+ staff: PosStaffModule;
149
+ quickKeys: PosQuickKeysModule;
150
+ /** Upsell prompts and assisted search at the till (engine sprint C4/44). */
151
+ assistedSelling: PosAssistedSellingModule;
152
+ /** Pay by link at the till: a link and QR code for part or all of a sale (engine C5). */
153
+ payByLink: PosPayByLinkModule;
154
+ /** The offline sales a manager must look at, and marking them handled (engine sprint 45). */
155
+ offlineSales: PosOfflineSalesModule;
156
+ /**
157
+ * Gift cards at the till (engine C6): a card's balance by its code, paying by code, and a
158
+ * sale whose codes the till hands over (their codes in the completion's first answer only).
159
+ */
160
+ giftCards: PosGiftCardsModule;
69
161
  }
70
162
  /**
71
163
  * A money call: the key is REQUIRED, not optional. The server claims it before
@@ -92,35 +184,102 @@ export interface PosRegister {
92
184
  createdAt: string;
93
185
  updatedAt: string;
94
186
  }
187
+ /**
188
+ * The store's registers: the logical tills a drawer session, its Z numbers and a device's cash
189
+ * belong to, each standing at one stock location for good.
190
+ */
95
191
  export interface PosRegistersModule {
96
192
  /**
97
- * The store's registers. A machine principal sees only the registers at its
98
- * own verified location — the ids it may open a session on.
193
+ * The store's registers, newest first, whole (one page). A machine principal sees only the
194
+ * registers at its own verified location — the ids it may open a session on — and a
195
+ * location-restricted credential only those at its locations.
196
+ *
197
+ * @effect read
99
198
  */
100
199
  list(options?: Call): Promise<Page<PosRegister>>;
101
- /** One register, or null (also for another location's register, to a principal). */
200
+ /**
201
+ * One register, or null when the store has none by that id (another store's reads the same;
202
+ * to a principal, also another location's, and to a location-restricted credential one
203
+ * outside its locations).
204
+ *
205
+ * @effect read
206
+ */
102
207
  get(id: string, options?: Call): Promise<PosRegister | null>;
103
- /** Needs `ManagePosDevices` (or `UpdateSettings`). */
208
+ /**
209
+ * Add an active register at one of the store's stock locations; its location never changes.
210
+ * Needs `ManagePosDevices` (or `UpdateSettings`). A location outside a restricted credential's
211
+ * is refused `LOCATION_NOT_ALLOWED` (`PermissionDeniedError`), one the store does not have
212
+ * `POS_LOCATION_NOT_FOUND` (`NotFoundError`; an engine before W10-62 answers it uncoded), and an
213
+ * organization workspace `ORGANIZATION_WORKSPACE_NOT_A_STORE`. All before anything is written.
214
+ *
215
+ * @effect write
216
+ */
104
217
  create(input: {
105
218
  name: string;
106
219
  stockLocationId: string;
107
220
  }, options?: Call): Promise<PosRegister>;
108
- /** Needs `ManagePosDevices` (or `UpdateSettings`). */
221
+ /**
222
+ * Rename a register, or retire it with `status: 'inactive'` (and bring it back with
223
+ * `'active'`). Only an active register opens a drawer (`POS_REGISTER_INACTIVE` to a new one, and
224
+ * from W10-62 to a device being given it); a drawer already open on it can still be counted and
225
+ * closed. Its sessions and Z numbers stay. Needs `ManagePosDevices` (or `UpdateSettings`).
226
+ * Refused `POS_REGISTER_NOT_FOUND` (`NotFoundError`) for a register the store does not have, and
227
+ * `LOCATION_NOT_ALLOWED` (`PermissionDeniedError`) for one standing outside a restricted
228
+ * credential's locations (both coded from W10-62; an older engine answers the first uncoded and
229
+ * does not check the second).
230
+ *
231
+ * @effect write
232
+ */
109
233
  update(id: string, input: {
110
234
  name?: string;
111
235
  status?: string;
112
236
  }, options?: Call): Promise<PosRegister>;
113
237
  }
238
+ /**
239
+ * A register session's tender totals, integer minor units of the drawer's
240
+ * currency (the store's default), from the SETTLED payments and refunds of the
241
+ * session's orders: a card payment still waiting on the terminal is not counted.
242
+ * Orders in a currency other than the store's default are left out.
243
+ */
114
244
  export interface PosSessionTotals {
115
- /** Cash taken in sales, minor units. */
245
+ /** Settled payments on the till's cash method. */
116
246
  cash: number;
117
- /** Card and other tenders are reconciled from payments, not the drawer: always 0 here. */
247
+ /** Settled payments on the till's card terminal method. */
118
248
  card: number;
249
+ /** Settled payments on any other method (manual tenders). */
119
250
  other: number;
251
+ /**
252
+ * All settled refunds, on every tender (`cashRefunds + cardRefunds +
253
+ * otherRefunds` of {@link PosStoredSessionTotals}).
254
+ */
120
255
  refunds: number;
256
+ /** `cash + card + other - refunds`. */
121
257
  net: number;
258
+ /** Completed sales: the session's orders given a receipt number. */
122
259
  saleCount: number;
123
260
  }
261
+ /** A session's stored totals (the Z): the X-report figures plus the refunds split by tender. */
262
+ export interface PosStoredSessionTotals extends PosSessionTotals {
263
+ /** Settled refunds on cash payments. Absent on older engines. */
264
+ cashRefunds?: number;
265
+ /** Settled refunds on card terminal payments. Absent on older engines. */
266
+ cardRefunds?: number;
267
+ /** Settled refunds on payments of any other method. Absent on older engines. */
268
+ otherRefunds?: number;
269
+ /**
270
+ * Signed cash rounding the drawer kept (+) or gave up (−), from its ledger; not in `net`. On a
271
+ * store that rounds cash (`cashRoundingMode`), cash into the drawer from sales is
272
+ * `cash - cashRefunds + cashRounding`. Absent on older engines.
273
+ */
274
+ cashRounding?: number;
275
+ /**
276
+ * Of which gift cards sold (engine C6): the face value and count of the cards the session's
277
+ * completed sales issued, a memo already inside the tenders (a liability, not sales). Absent on
278
+ * a Z closed before C6 and on older engines: read it as 0.
279
+ */
280
+ giftCardsSold?: number;
281
+ giftCardsSoldCount?: number;
282
+ }
124
283
  /** A register session: one drawer, from its opening float to its Z. */
125
284
  export interface PosRegisterSession {
126
285
  id: string;
@@ -136,16 +295,122 @@ export interface PosRegisterSession {
136
295
  countedCash: number | null;
137
296
  /** `countedCash - expectedCash`; negative is short. Null while open. */
138
297
  cashOverShort: number | null;
139
- totals: PosSessionTotals | null;
298
+ totals: PosStoredSessionTotals | null;
140
299
  openedAt: string;
141
300
  closedAt: string | null;
301
+ /**
302
+ * The close's details (engine sprint 25b), read by `sessions.get` and `sessions.list`; absent
303
+ * from the other session calls, and null while open and for sessions closed before 25b. Who
304
+ * closed it (null for a machine principal without a staff token).
305
+ */
306
+ closedByStaffId?: string | null;
307
+ /** Whether the store counted blind when it closed. */
308
+ blindCount?: boolean | null;
309
+ /** The store's variance threshold when it closed (minor units); null for none. */
310
+ varianceThreshold?: number | null;
311
+ /**
312
+ * What became of the variance: `not_required` (within the threshold), `approved` (a manager, or
313
+ * a machine credential, approved it at the close) or `pending` (a manager still has to). More may
314
+ * come: show an unknown value as it is.
315
+ */
316
+ varianceApproval?: PosVarianceApproval | (string & {}) | null;
317
+ /** The manager who approved it; null when none needed to, a machine credential did, or pending. */
318
+ varianceApprovedByStaffId?: string | null;
319
+ varianceApprovedAt?: string | null;
320
+ /**
321
+ * A `pending` close approved afterwards in the back office (engine sprint 27): the person's
322
+ * user id. Read by `sessions.approval` and `sessions.approveClose`; absent elsewhere.
323
+ */
324
+ varianceApprovedByUserId?: string | null;
325
+ /** That person's name as the store's administrators hold it now. Same documents as above. */
326
+ varianceApprovedByUserName?: string | null;
327
+ /** The machine credential that approved it afterwards (`api_token:<id>` / `app_installation:<id>`). */
328
+ varianceApprovedByCredential?: string | null;
329
+ /** Why the variance was accepted afterwards. Same documents as above. */
330
+ varianceApprovalNote?: string | null;
331
+ /**
332
+ * The Z's identity (engine sprint 26), read by `sessions.record` and `sessions.records`; absent
333
+ * from the other session calls. The store's business day it opened in (`YYYY-MM-DD`, its own
334
+ * day start in its location's zone; null for a drawer opened before 26 and not closed since).
335
+ */
336
+ businessDay?: string | null;
337
+ /** The stock location it was opened at, and that location's zone then (null before 26). */
338
+ stockLocationId?: string | null;
339
+ timeZone?: string | null;
340
+ /** The register's Z number, 1, 2, 3… in close order; null while open and for drawers closed before 26. */
341
+ zNumber?: number | null;
342
+ /**
343
+ * How it closed: `till` (its tablet, or a machine credential), `back_office` (a person, named
344
+ * in `closedByUserId`) or `auto` (closed without a count, left open). More may come: show an
345
+ * unknown value as it is. Null while open and before 26.
346
+ */
347
+ closeSource?: PosCloseSource | (string & {}) | null;
348
+ /** The person who closed it in the back office (their user id); null otherwise. */
349
+ closedByUserId?: string | null;
350
+ /** That person's name as the store's administrators hold it now. Read by `sessions.record` only. */
351
+ closedByUserName?: string | null;
352
+ /**
353
+ * A drawer closed WITHOUT a count, and counted later (engine sprint 26b), read by
354
+ * `sessions.record`, `sessions.records`, `sessions.closeUncounted` and `sessions.count`; absent
355
+ * elsewhere. Why it closed automatically (`after_closing_time` or `idle`; null for every other
356
+ * close). More may come: show an unknown value as it is.
357
+ */
358
+ autoCloseReason?: PosAutoCloseReason | (string & {}) | null;
359
+ /** Why a person closed it without a count (`sessions.closeUncounted`'s note); null otherwise. */
360
+ closeNote?: string | null;
361
+ /** When its cash was counted after a close without a count (`sessions.count`); null otherwise. */
362
+ countedAt?: string | null;
363
+ /** The person who counted it afterwards (their user id); null for a machine credential. */
364
+ countedByUserId?: string | null;
365
+ /** That person's name as the store's administrators hold it now. Not read by `records`. */
366
+ countedByUserName?: string | null;
367
+ /** The counter's note; null when none was given. */
368
+ countNote?: string | null;
369
+ }
370
+ /** Why a drawer was closed automatically, without a count (engine sprint 26b). More may come. */
371
+ export type PosAutoCloseReason = 'after_closing_time' | 'idle';
372
+ /** How a drawer closed (engine sprint 26). More may come. */
373
+ export type PosCloseSource = 'till' | 'back_office' | 'auto';
374
+ /**
375
+ * What became of a closed drawer's variance, with who approved it after the close (engine sprint
376
+ * 27, `sessions.approval`). Approved at the close: `varianceApprovedByStaffId` (a manager) or
377
+ * nobody named (a machine credential); approved afterwards: `varianceApprovedByUserId` (a person)
378
+ * or `varianceApprovedByCredential`, with the note.
379
+ */
380
+ export interface PosSessionApproval {
381
+ sessionId: string;
382
+ varianceApproval: PosVarianceApproval | (string & {}) | null;
383
+ varianceThreshold: number | null;
384
+ varianceApprovedByStaffId: string | null;
385
+ varianceApprovedAt: string | null;
386
+ varianceApprovedByUserId: string | null;
387
+ varianceApprovedByUserName: string | null;
388
+ varianceApprovedByCredential: string | null;
389
+ varianceApprovalNote: string | null;
390
+ }
391
+ /**
392
+ * What became of a closed drawer's variance (engine sprint 25b): within the threshold, approved,
393
+ * or waiting for a manager; or (engine sprint 26b) `uncounted`, closed without a count, so there
394
+ * is no variance yet: count it with `sessions.count` (never approved as it is).
395
+ */
396
+ export type PosVarianceApproval = 'not_required' | 'approved' | 'pending' | 'uncounted';
397
+ /** The X report's totals: the drawer so far, with the gift cards its sales issued (engine C6). */
398
+ export interface PosXReportTotals extends PosSessionTotals {
399
+ /**
400
+ * Of which gift cards sold (engine C6): the face value of the cards the session's completed sales
401
+ * issued, a memo already inside the tenders (a liability, not sales; never subtract it from
402
+ * `net`). Absent when an engine before C6 answered: leave it out, never show it as 0.
403
+ */
404
+ giftCardsSold?: number;
405
+ /** How many gift cards those sales issued; absent like {@link giftCardsSold}. */
406
+ giftCardsSoldCount?: number;
142
407
  }
143
408
  /** A mid-shift snapshot. Reading it changes nothing. */
144
409
  export interface PosXReport {
145
410
  sessionId: string;
146
411
  openingFloat: number;
147
412
  expectedCash: number;
148
- totals: PosSessionTotals;
413
+ totals: PosXReportTotals;
149
414
  movementCount: number;
150
415
  }
151
416
  export interface OpenPosSessionInput {
@@ -164,27 +429,238 @@ export interface PosSessionsModule {
164
429
  /**
165
430
  * Open a drawer. Refusals: `POS_REGISTER_REQUIRED`, `POS_REGISTER_NOT_FOUND`,
166
431
  * `POS_REGISTER_INACTIVE`, `POS_LOCATION_MISMATCH`, `POS_DEVICE_NOT_ALLOWED`,
167
- * and an already-open session on that register.
432
+ * `POS_DEVICE_NOT_FOUND`, `POS_DEVICE_NO_REGISTER`, and `POS_SESSION_ALREADY_OPEN` for a
433
+ * session already open on that register (`extensions.sessionId` names it; engine 25a, an
434
+ * uncoded error before).
168
435
  */
169
436
  open(input: OpenPosSessionInput, options?: PosCall): Promise<PosRegisterSession>;
170
437
  /**
171
438
  * Close it — this IS the Z report: expected cash from the ledger, your count,
172
- * the variance and the totals are stored on the session and returned.
439
+ * the variance and the totals are stored on the session and returned. A session already
440
+ * closed is `POS_SESSION_CLOSED`, an id that is no session of the store
441
+ * `POS_SESSION_NOT_FOUND` (engine 25a; uncoded errors before).
173
442
  */
174
443
  close(input: {
175
444
  sessionId: string;
176
445
  countedCash: number;
177
446
  closingCounts?: Record<string, number>;
178
447
  }, options?: PosCall): Promise<PosRegisterSession>;
179
- /** The X report: the drawer so far, read-only. */
448
+ /**
449
+ * The X report: the drawer so far, read-only, with the gift cards its sales issued
450
+ * (`totals.giftCardsSold`, engine C6). On a closed session the figures are its stored Z's. An
451
+ * engine before C6 refuses the memo at validation; the report is then read without it (the two
452
+ * memo fields absent). An id that is no session of the store is `POS_SESSION_NOT_FOUND`.
453
+ *
454
+ * @effect read
455
+ */
180
456
  xReport(sessionId: string, options?: Call): Promise<PosXReport>;
457
+ /**
458
+ * One session with its close's details (engine sprint 25b): who closed it, whether the store
459
+ * counted blind, its variance threshold then and what became of the variance (`pending`: a
460
+ * manager still has to approve it). Null for no session of the store. A till read, like
461
+ * `zReport`: any staff member of the store (or a `pos` token) may call it, and a machine
462
+ * principal reads a session at its verified location. An engine before 25b refuses the
463
+ * document at validation; `zReport` reads the session without these fields on every engine.
464
+ */
465
+ get(sessionId: string, options?: Call): Promise<PosRegisterSession | null>;
466
+ /**
467
+ * The drawer session open on a device now, or null when none is (an id that is no device of the
468
+ * store reads the same). Any staff member of the store may read it; a paired till reads its own
469
+ * device only (`POS_DEVICE_MISMATCH`), and a machine credential, which has no device, is refused
470
+ * `POS_DEVICE_NOT_ALLOWED`: read its session with `get`.
471
+ *
472
+ * @effect read
473
+ */
474
+ openForDevice(deviceId: string, options?: Call): Promise<PosRegisterSession | null>;
475
+ /**
476
+ * The store's register sessions, newest opened first, each with its close's details (as
477
+ * {@link PosSessionsModule.get}: who closed it, blind or not, the threshold then and what became
478
+ * of its variance, so a close still `pending` a manager can be found). `limit` is at most 100
479
+ * (50 when omitted); `after` is the previous page's cursor. Filters narrow it on the server.
480
+ * Needs `UpdateSettings` or `ManagePosDevices`; a paired till lists only the sessions its own
481
+ * device opened, a location-restricted credential only the drawers of registers at its
482
+ * locations, and a machine principal is `FORBIDDEN`. An engine before 25b refuses the document
483
+ * at validation.
484
+ *
485
+ * @effect read
486
+ */
487
+ list(options?: PosSessionListOptions): Promise<Page<PosRegisterSession>>;
181
488
  /**
182
489
  * The stored Z of a CLOSED session (the session as `close` left it). On a
183
490
  * session that is still open the Z fields are null — close it first.
184
491
  */
185
492
  zReport(sessionId: string, options?: Call): Promise<PosRegisterSession | null>;
493
+ /**
494
+ * A drawer session's cash ledger, newest first, with the WHOLE session's
495
+ * summary by kind (engine sprint 25a). Each row is its effect on the drawer
496
+ * (positive in, negative out) and the expected cash right after it; the
497
+ * summary's `expectedCash` is the X report's. `take` is at most 100 (50 when
498
+ * omitted); `skip` pages back in time. Read-only.
499
+ *
500
+ * A machine principal reads a session at its verified location; staff need
501
+ * `UpdateSettings` or `ManagePosDevices` (else `FORBIDDEN`). Another store's
502
+ * session, or none, is `POS_SESSION_NOT_FOUND`. An engine before 25a refuses
503
+ * the document at validation.
504
+ */
505
+ movements(sessionId: string, options?: Call & {
506
+ skip?: number;
507
+ take?: number;
508
+ }): Promise<PosDrawerMovementList>;
509
+ /**
510
+ * A session's variance approval with who approved it after the close (engine sprint 27): see
511
+ * {@link PosSessionApproval}. Null for no session of the store. Its own document, so `get`,
512
+ * `list` and `movements` keep working on an engine before 27, which refuses only this one at
513
+ * validation (`GRAPHQL_VALIDATION_FAILED`).
514
+ */
515
+ approval(sessionId: string, options?: Call): Promise<PosSessionApproval | null>;
516
+ /**
517
+ * Approve, after the close, a variance still waiting for a manager (`varianceApproval`
518
+ * `pending`, engine sprint 27): it becomes `approved` with who approved it, when and the note.
519
+ * The close's figures (expected, counted, variance, totals, the threshold then) never change.
520
+ * Idempotent by state: approving a session already approved answers it unchanged and writes
521
+ * nothing, so a lost answer is safe to retry and a second manager sees the first's approval.
522
+ * Refusals: `POS_SESSION_APPROVAL_NOTE_INVALID` (the note: 1 to 500 characters once trimmed,
523
+ * line breaks allowed; the refusal names the field `note`, `error.details[0].field`, and its
524
+ * `extensions.reason` is `required`, `too_long` or `control_character`), `POS_SESSION_CLOSE_NOT_PENDING` (open, within
525
+ * the threshold, closed before the store had cash controls; `extensions.varianceApproval`),
526
+ * `POS_SESSION_NOT_FOUND`. Needs `UpdateSettings` or `ManagePosDevices`; a `pos` token holding
527
+ * only `OperatePos` is `FORBIDDEN`. An engine before 27 refuses the document at validation.
528
+ */
529
+ approveClose(sessionId: string, input: {
530
+ note: string;
531
+ }, options?: Call): Promise<PosRegisterSession>;
532
+ /**
533
+ * One session's Z RECORD (engine sprint 26): everything `get` and `approval` read, plus the
534
+ * business day it opened in, its location and zone, the register's Z number, how it closed
535
+ * (`closeSource`) and who closed it in the back office, by name. Null for no session of the
536
+ * store. Its own document, so `get`, `list` and every other session call keep working on an
537
+ * engine before 26, which refuses only this one at validation (`GRAPHQL_VALIDATION_FAILED`).
538
+ */
539
+ record(sessionId: string, options?: Call): Promise<PosRegisterSession | null>;
540
+ /**
541
+ * The store's register sessions with their Z record (engine sprint 26), paged and filtered as
542
+ * {@link PosSessionsModule.list}, so a sessions list stays one read: the close's details, who
543
+ * approved it afterwards (by id and credential; the names are per session, read them with
544
+ * `record`), the business day, Z number and close source. Needs `UpdateSettings` or
545
+ * `ManagePosDevices`. An engine before 26 refuses the document at validation: fall back to
546
+ * `list`.
547
+ */
548
+ records(options?: PosSessionListOptions): Promise<Page<PosRegisterSession>>;
549
+ /**
550
+ * Close an OPEN drawer without a count, from the back office (engine sprint 26b): a till left
551
+ * open. Its Z is written as at any close (expected cash from the ledger, tender totals, the
552
+ * register's Z number, the business day, the store's threshold then) with no counted cash and
553
+ * `varianceApproval` `uncounted`; `closeSource` is `back_office`, `closeNote` the note, and the
554
+ * till finds the drawer closed at its next drawer call. Answers the session as `record` reads
555
+ * it. Idempotent by state: closing a drawer this way again answers it unchanged and writes
556
+ * nothing, so a lost answer is safe to retry. Refusals: `POS_CLOSE_NOTE_INVALID` (the note: 1 to
557
+ * 500 characters once trimmed; `extensions.reason` `required`, `too_long` or
558
+ * `control_character`), `POS_SESSION_NOT_FOUND`, `POS_SESSION_CLOSED` (closed another way: at
559
+ * the till, counted, or automatically), `POS_SESSION_SALE_IN_PROGRESS` (a payment is in flight
560
+ * on one of its carts; `extensions.orderCodes`, at most 10: finish or cancel it at the till
561
+ * first), `LOCATION_NOT_ALLOWED` (a credential restricted to other locations). Needs
562
+ * `UpdateSettings` or `ManagePosDevices`; a `pos` token holding only `OperatePos` is
563
+ * `FORBIDDEN`. An engine before 26 refuses the document at validation
564
+ * (`GRAPHQL_VALIDATION_FAILED`).
565
+ */
566
+ closeUncounted(sessionId: string, input: {
567
+ note: string;
568
+ }, options?: Call): Promise<PosRegisterSession>;
569
+ /**
570
+ * Record the count of a drawer closed without one (engine sprint 26b), in minor units of the
571
+ * drawer's currency. Fills `countedCash`, `closingCounts` and `cashOverShort` against the
572
+ * expected cash STORED at its close; `varianceApproval` becomes `not_required` within the
573
+ * threshold stored at its close, or `pending` above it (approve it with `approveClose`): the
574
+ * count never approves. The ledger, expected cash, totals and Z number never change. Idempotent
575
+ * by state: the same count again answers the session unchanged and writes nothing; other
576
+ * figures are refused. Refusals: `POS_SESSION_COUNT_INVALID` (`countedCash` a whole number from
577
+ * 0 to 100000000; `closingCounts` at most 50 denominations, each a whole count of 0 or more;
578
+ * `extensions.field` and `reason`), `POS_CLOSE_NOTE_INVALID` (the optional note: at most 500
579
+ * characters once trimmed), `POS_SESSION_NOT_FOUND`, `POS_SESSION_NOT_UNCOUNTED` (open, counted
580
+ * already with other figures, or not closed without a count; `extensions.status` and
581
+ * `varianceApproval`), `LOCATION_NOT_ALLOWED`. Needs `UpdateSettings` or `ManagePosDevices`. An
582
+ * engine before 26 refuses the document at validation (`GRAPHQL_VALIDATION_FAILED`).
583
+ */
584
+ count(sessionId: string, input: {
585
+ countedCash: number;
586
+ closingCounts?: Record<string, number>;
587
+ note?: string;
588
+ }, options?: Call): Promise<PosRegisterSession>;
589
+ }
590
+ /** `sessions.list`'s page and filters; every filter is optional and narrows on the server. */
591
+ export interface PosSessionListOptions extends ListOptions {
592
+ status?: 'open' | 'closed';
593
+ registerId?: string;
594
+ deviceId?: string;
595
+ /** The staff member who OPENED it. */
596
+ staffId?: string;
597
+ /** ISO instants bounding `openedAt`, both inclusive. */
598
+ openedAfter?: string;
599
+ openedBefore?: string;
600
+ }
601
+ /**
602
+ * One row of a drawer session's ledger as the drawer felt it. `type` is a
603
+ * string: besides the {@link PosCashMovementType}s it may be `cash_rounding`
604
+ * (the engine's rounding row), and a newer engine may add one; show an unknown
605
+ * type by its amount.
606
+ */
607
+ export interface PosDrawerMovement {
608
+ id: string;
609
+ type: string;
610
+ /** Its effect on the drawer, minor units: positive in, negative out, 0 for a no-sale. */
611
+ amount: number;
612
+ /** The expected cash right after this row: the opening float plus every row up to it. */
613
+ balanceAfter: number;
614
+ reason: string | null;
615
+ /** Who recorded it; null for a machine credential's row. */
616
+ staffId: string | null;
617
+ staffName: string | null;
618
+ /** The manager who approved it (a paid-out, no-sale, float adjustment or safe drop). */
619
+ approvedByStaffId: string | null;
620
+ approvedByStaffName: string | null;
621
+ /** The sale or refunded sale it belongs to. */
622
+ orderId: string | null;
623
+ orderCode: string | null;
624
+ receiptNumber: string | null;
625
+ createdAt: string;
626
+ }
627
+ /** A drawer session's ledger by kind: what makes up its expected cash (minor units). */
628
+ export interface PosDrawerSummary {
629
+ openingFloat: number;
630
+ /** Cash taken for sales in this drawer. */
631
+ cashSales: number;
632
+ /** Cash paid out of this drawer for refunds, whichever session sold them (negative). */
633
+ cashRefunds: number;
634
+ /** Signed cash rounding the drawer kept (+) or gave up (−). */
635
+ cashRounding: number;
636
+ paidIn: number;
637
+ /** Negative. */
638
+ paidOut: number;
639
+ /** Cash moved to the safe (negative). */
640
+ safeDrops: number;
641
+ /** Signed. */
642
+ floatAdjustments: number;
643
+ noSaleCount: number;
644
+ /** The opening float plus every row: the X report's expected cash. */
645
+ expectedCash: number;
646
+ movementCount: number;
647
+ }
648
+ /** A page of a drawer session's ledger, newest first, and the whole session's summary. */
649
+ export interface PosDrawerMovementList {
650
+ items: PosDrawerMovement[];
651
+ totalItems: number;
652
+ summary: PosDrawerSummary;
186
653
  }
187
- export type PosCashMovementType = 'sale' | 'refund' | 'paid_in' | 'paid_out' | 'no_sale' | 'float_adjust';
654
+ export type PosCashMovementType = 'sale' | 'refund' | 'paid_in' | 'paid_out' | 'no_sale' | 'float_adjust'
655
+ /** Cash taken from the drawer to the safe mid-shift (engine sprint 25a). */
656
+ | 'safe_drop';
657
+ /**
658
+ * The movement types `cash.record` takes: the five a person records (a safe
659
+ * drop since engine sprint 25a). A `sale` or `refund` movement is the engine's
660
+ * own, written when a sale or a refund settles in cash, so it is a
661
+ * {@link PosCashMovementType} you read back, never one you send.
662
+ */
663
+ export type PosRecordableCashMovementType = 'paid_in' | 'paid_out' | 'no_sale' | 'float_adjust' | 'safe_drop';
188
664
  export interface PosCashMovement {
189
665
  id: string;
190
666
  sessionId: string;
@@ -198,21 +674,401 @@ export interface PosCashMovement {
198
674
  export interface PosCashModule {
199
675
  /**
200
676
  * Record a drawer movement that is not a sale — paid in, paid out, a no-sale
201
- * open. Sales and refunds record their own.
677
+ * open. Sales and refunds record their own, so `type` takes only the four
678
+ * movement types a person records ({@link PosRecordableCashMovementType}); a
679
+ * caller that sends `sale` or `refund` anyway (from JavaScript, past the
680
+ * type) is refused `POS_CASH_MOVEMENT_TYPE_NOT_ALLOWED` (a permission
681
+ * refusal, whoever calls) and nothing is recorded. A `paid_out`, `no_sale`
682
+ * or `float_adjust` needs a manager: on a paired till a manager's PIN
683
+ * session, else `POS_MANAGER_REQUIRED`; for this principal the credential is
684
+ * that authority.
685
+ *
686
+ * For `paid_in` and `paid_out`, `amount` is the MAGNITUDE in minor units, 0
687
+ * or more: a paid-out of 10.00 is `1000`. The engine applies the sign: it
688
+ * records a paid-in as cash in and a paid-out as cash out (the movement it
689
+ * answers carries `-1000`). A `no_sale` carries no amount: send `0`. A
690
+ * negative amount, or a no-sale with any amount but `0`, is refused
691
+ * `POS_CASH_MOVEMENT_AMOUNT_INVALID` and nothing is recorded. `amount` is a
692
+ * GraphQL `Int`, so a fractional one never reaches the engine: the API
693
+ * refuses it as invalid input before anything runs. A `float_adjust` amount
694
+ * stays signed.
202
695
  *
203
696
  * The drawer holds the store's default currency. A movement naming the
204
697
  * `orderId` of an order in another currency is refused
205
698
  * `CASH_TENDER_CURRENCY_NOT_SUPPORTED` and nothing is recorded. An `orderId`
206
699
  * that is not an order of this store (another store's, or none at all) is
207
700
  * refused `ENTITY_NOT_FOUND`, and nothing is recorded.
701
+ *
702
+ * Engine sprint 25a: a `safe_drop` (cash to the safe) is a magnitude like a
703
+ * paid-out and needs a manager. A `float_adjust` needs an amount other than
704
+ * `0` (`POS_CASH_MOVEMENT_AMOUNT_INVALID`) and a reason
705
+ * (`POS_CASH_MOVEMENT_REASON_REQUIRED`). A movement on a closed session is
706
+ * `POS_SESSION_CLOSED`. With `options.idempotencyKey` (1 to 200
707
+ * characters, minted per movement) the movement is recorded at most once: a
708
+ * retry under the same key answers the movement already recorded, the same
709
+ * key for a different movement is `IDEMPOTENCY_CONFLICT`. The key is sent
710
+ * only when given, so a call without one works on an engine before 25a,
711
+ * which refuses the field.
208
712
  */
209
713
  record(input: {
210
714
  sessionId: string;
211
- type: PosCashMovementType;
715
+ type: PosRecordableCashMovementType;
212
716
  amount: number;
213
717
  reason?: string;
214
718
  orderId?: string;
215
719
  }, options?: PosCall): Promise<PosCashMovement>;
720
+ /**
721
+ * The store's drawer movements across every session and register, newest first, for a back
722
+ * office (engine sprint 27): each row's drawer effect (positive in, negative out, 0 for a
723
+ * no-sale), its session, register and till, who recorded and approved it, its order and the
724
+ * till's key it was recorded under (`idempotencyKey`, null for a row sent without one and for
725
+ * rows before 27), so a "may have gone through" on a till can be matched to one row. No
726
+ * running balance: `sessions.movements` has a session's. `fromDay`/`toDay` are the STORE's
727
+ * calendar days (`YYYY-MM-DD`, inclusive, both today when omitted, at most 31 days apart);
728
+ * `types` keeps only those ledger types (an unknown one is refused); `staffId` matches who
729
+ * recorded OR approved. `limit` is at most 100 (50 when omitted); `after` is the previous page's
730
+ * cursor. Refused `POS_LIST_RANGE_INVALID` (`extensions.reason`). Needs `UpdateSettings` or
731
+ * `ManagePosDevices`; a location-restricted credential reads the drawers at its locations
732
+ * only. An engine before 27 refuses the document at validation.
733
+ *
734
+ * @effect read
735
+ */
736
+ list(options?: PosCashMovementListOptions): Promise<Page<PosStoreCashMovement>>;
737
+ }
738
+ /** `cash.list`'s page and filters (engine sprint 27). */
739
+ export interface PosCashMovementListOptions extends ListOptions {
740
+ /** `YYYY-MM-DD` in the store's zone, inclusive. */
741
+ fromDay?: string;
742
+ toDay?: string;
743
+ registerId?: string;
744
+ sessionId?: string;
745
+ /** Only these ledger types (`sale`, `refund`, `cash_rounding`, `paid_in`, …); every type when omitted or empty. */
746
+ types?: readonly string[];
747
+ /** Recorded or approved by this staff member. */
748
+ staffId?: string;
749
+ }
750
+ /** One drawer ledger row as the store-wide list answers it (engine sprint 27). */
751
+ export interface PosStoreCashMovement {
752
+ id: string;
753
+ sessionId: string;
754
+ registerId: string;
755
+ registerName: string | null;
756
+ /** The till whose drawer it is; null for a machine credential's session. */
757
+ deviceId: string | null;
758
+ deviceLabel: string | null;
759
+ /** A ledger type; a newer engine may add one: show an unknown type by its amount. */
760
+ type: PosCashMovementType | 'cash_rounding' | (string & {});
761
+ /** Its effect on the drawer, minor units: positive in, negative out, 0 for a no-sale. */
762
+ amount: number;
763
+ reason: string | null;
764
+ staffId: string | null;
765
+ staffName: string | null;
766
+ approvedByStaffId: string | null;
767
+ approvedByStaffName: string | null;
768
+ orderId: string | null;
769
+ orderCode: string | null;
770
+ receiptNumber: string | null;
771
+ /** The till's key it was recorded under; null without one and for rows before engine 27. */
772
+ idempotencyKey: string | null;
773
+ createdAt: string;
774
+ }
775
+ /** The tender a till sale's settled payments were taken in. */
776
+ export type PosTenderKind = 'cash' | 'card' | 'other';
777
+ /** A completed till sale as the back office's list answers it (engine sprint 27). Money in minor units of `currencyCode`. */
778
+ export interface PosOrderSummary {
779
+ orderId: string;
780
+ orderCode: string;
781
+ receiptNumber: string;
782
+ placedAt: string | null;
783
+ state: string;
784
+ currencyCode: string;
785
+ totalWithTax: number;
786
+ totalQuantity: number;
787
+ /** Refunds that returned money or are on their way (Settled or Pending), over every payment. */
788
+ refundedTotal: number;
789
+ /** The tenders its settled payments were taken in, each once: cash, then card, then other. */
790
+ tenderKinds: PosTenderKind[];
791
+ /** `walk_in`, `customer` or `none`; more may come. */
792
+ customerKind: string;
793
+ /** The named customer's name; null for the walk-in and when none is attached. Customer data. */
794
+ customerName: string | null;
795
+ registerId: string | null;
796
+ registerName: string | null;
797
+ /** The drawer session it was rung up under; null when none. */
798
+ sessionId: string | null;
799
+ /** The paired till that sold it; null for a machine credential's sale. */
800
+ deviceId: string | null;
801
+ deviceLabel: string | null;
802
+ /** The cashier who completed it; null for a machine credential's sale. */
803
+ staffId: string | null;
804
+ staffName: string | null;
805
+ }
806
+ /** `orders.list`'s page and filters (engine sprint 27). */
807
+ export interface PosOrderListOptions extends ListOptions {
808
+ /** `YYYY-MM-DD` in the store's zone, inclusive. */
809
+ fromDay?: string;
810
+ toDay?: string;
811
+ registerId?: string;
812
+ sessionId?: string;
813
+ deviceId?: string;
814
+ /** The cashier who completed the sale. */
815
+ staffId?: string;
816
+ /** Sales with a settled payment in this tender; a split sale is listed under each. */
817
+ tender?: PosTenderKind;
818
+ /** 2 to 100 characters: an order code prefix, a receipt number suffix, or a named customer's name or email. */
819
+ term?: string;
820
+ }
821
+ /** One payment of a till sale, with its refund position (engine sprint 19). */
822
+ export interface PosTillSalePayment {
823
+ paymentId: string;
824
+ kind: PosTenderKind;
825
+ method: string;
826
+ state: string;
827
+ amount: number;
828
+ /** Refunds that returned money or are on their way (Settled or Pending). */
829
+ refunded: number;
830
+ /** Refunds with no confirmed outcome, held back until reconciled. */
831
+ refundUnknown: number;
832
+ /**
833
+ * What the till may still refund; 0 unless the payment is Settled, and 0 on an invoiced sale,
834
+ * which the till's guard refuses (`REFUND_REQUIRES_CREDIT_NOTE`): refund that through the
835
+ * invoice's correction.
836
+ */
837
+ refundable: number;
838
+ }
839
+ /**
840
+ * An in-person ID check a till recorded on a sale in a store with a minimum age (engine
841
+ * user decision L1): the cashier confirmed they saw the buyer's ID. Who and where are the till's
842
+ * own session and its cashier's PIN sign-in, never something a request named.
843
+ */
844
+ export interface PosTillSaleIdCheck {
845
+ id: string;
846
+ /** When the cashier confirmed it (ISO 8601, the server's clock). */
847
+ checkedAt: string;
848
+ staffId: string;
849
+ /** The cashier's name now; null when the store no longer has the staff row. */
850
+ staffName: string | null;
851
+ /** The paired till it was confirmed on, and that till's stock location. */
852
+ deviceId: string;
853
+ deviceLabel: string | null;
854
+ stockLocationId: string;
855
+ /** The store's minimum age when it was confirmed. */
856
+ minimumAge: number;
857
+ }
858
+ /** A till sale as the order page's "Till sale" card reads it (`orders.get`, engine sprint 19's read). */
859
+ export interface PosTillSale {
860
+ orderId: string;
861
+ orderCode: string;
862
+ orderState: string;
863
+ receiptNumber: string | null;
864
+ placedAt: string | null;
865
+ customerKind: string;
866
+ deviceId: string | null;
867
+ deviceLabel: string | null;
868
+ registerId: string | null;
869
+ registerName: string | null;
870
+ sessionId: string | null;
871
+ staffId: string | null;
872
+ staffName: string | null;
873
+ /** Every payment, oldest first, failed and cancelled ones included. */
874
+ payments: PosTillSalePayment[];
875
+ /**
876
+ * The in-person ID check standing for the sale (engine user decision L1): "ID checked by
877
+ * `staffName` at `checkedAt`". Null when none was recorded, or the one recorded was voided when
878
+ * the sale was held and resumed.
879
+ */
880
+ idCheck: PosTillSaleIdCheck | null;
881
+ }
882
+ export interface PosOrdersModule {
883
+ /**
884
+ * The store's completed till sales for a back office, newest first, every register and every
885
+ * kind of till (engine sprint 27, `posOrders`). `fromDay`/`toDay` are the STORE's calendar
886
+ * days (`YYYY-MM-DD`, inclusive, both today when omitted, at most 31 days apart); `registerId`,
887
+ * `sessionId`, `deviceId`, `staffId`, `tender` and `term` narrow it on the server, each sent
888
+ * only when given. `limit` is at most 100 (50 when omitted); `after` is the previous page's
889
+ * cursor. Refused `POS_LIST_RANGE_INVALID` (`extensions.reason`: `day_format`, `day_order`,
890
+ * `span_too_long`, `term_too_long`). Needs `UpdateSettings` or `ManagePosDevices` AND
891
+ * `ReadOrder` (else `FORBIDDEN`): the rows name customers. A location-restricted credential
892
+ * lists the sales of its locations only. An engine before 27 refuses the document at
893
+ * validation.
894
+ *
895
+ * @effect read
896
+ */
897
+ list(options?: PosOrderListOptions): Promise<Page<PosOrderSummary>>;
898
+ /**
899
+ * One till sale with its receipt number, till, register, drawer session, cashier and per
900
+ * payment what was refunded and may still be (engine sprint 19's `posTillOrder`). An order no
901
+ * till sold is refused `POS_ORDER_UNSTAMPED`: call it only when `sale.tillDetails` says
902
+ * `isPosOrder`. Another store's order, or none, is `ENTITY_NOT_FOUND`. Needs `ReadOrder`.
903
+ * A sale a machine credential rang up (no paired till on it) answers only that credential at
904
+ * its own location: any other caller, a back office included, is refused
905
+ * `POS_PRINCIPAL_REQUIRED`. `idCheck` is the cashier's in-person ID check of the sale
906
+ * (engine user decision L1); an engine before it is read with the sale's other fields only, and
907
+ * answers `idCheck: null`.
908
+ *
909
+ * @effect read
910
+ */
911
+ get(orderId: string, options?: Call): Promise<PosTillSale>;
912
+ }
913
+ /** A store day's state (engine sprint 26). More may come: a reader shows an unknown one as it is. */
914
+ export type PosStoreDayStatus = 'open' | 'closed' | 'reopened';
915
+ /**
916
+ * A store day's money, rolled up from its drawers' Zs (engine sprint 26): integer minor units of
917
+ * the store's default currency. Over the day's CLOSED drawers: their floats, expected cash and
918
+ * tender totals; the counted cash and the variance over the COUNTED ones only.
919
+ */
920
+ export interface PosStoreDayTotals {
921
+ currencyCode: string;
922
+ /** The Zs rolled up: the day's closed drawers. */
923
+ sessionCount: number;
924
+ /** Drawers closed without a count and not counted since. */
925
+ uncountedCount: number;
926
+ openingFloat: number;
927
+ expectedCash: number;
928
+ /** Over the counted drawers only. */
929
+ countedCash: number;
930
+ /** Over the counted drawers only: negative short, positive over. */
931
+ cashOverShort: number;
932
+ cash: number;
933
+ card: number;
934
+ other: number;
935
+ refunds: number;
936
+ net: number;
937
+ saleCount: number;
938
+ cashRefunds: number;
939
+ cardRefunds: number;
940
+ otherRefunds: number;
941
+ cashRounding: number;
942
+ }
943
+ /** One drawer of a store day, as its Z says (engine sprint 26). */
944
+ export interface PosStoreDaySession {
945
+ sessionId: string;
946
+ registerId: string;
947
+ /** The register's name now; null when it is gone. */
948
+ registerName: string | null;
949
+ /** The register's Z number; null while open and for drawers closed before sprint 26. */
950
+ zNumber: number | null;
951
+ status: 'open' | 'closed';
952
+ /** How it closed; null while open. */
953
+ closeSource: PosCloseSource | null;
954
+ openedAt: string;
955
+ closedAt: string | null;
956
+ openingFloat: number;
957
+ expectedCash: number | null;
958
+ /** Null while open and for a drawer closed without a count. */
959
+ countedCash: number | null;
960
+ cashOverShort: number | null;
961
+ varianceApproval: PosVarianceApproval | null;
962
+ /** The stored Z's tender totals; null while open. */
963
+ totals: PosStoredSessionTotals | null;
964
+ }
965
+ /**
966
+ * A store's business day at one stock location, as `days.list` reads it (engine sprint 26):
967
+ * everything but its drawers and the closer's and reopener's names, which `days.get` reads.
968
+ */
969
+ export interface PosStoreDaySummary {
970
+ /** Null for a day no drawer opened on and nobody closed (it has no record yet). */
971
+ id: string | null;
972
+ stockLocationId: string;
973
+ /** `YYYY-MM-DD`: the store's business day (it starts at the store's day start, not midnight). */
974
+ businessDay: string;
975
+ /** The IANA zone the day is counted in. */
976
+ timeZone: string;
977
+ /** The day's window: from its start to the next day's start (23, 24 or 25 hours). */
978
+ startsAt: string;
979
+ endsAt: string;
980
+ status: PosStoreDayStatus;
981
+ /** True: `totals` is the roll-up stored at the close (refreshed by a later count); false: computed now. */
982
+ totalsFinal: boolean;
983
+ totals: PosStoreDayTotals;
984
+ /** Drawers of the day still open: the day does not close while there is one. */
985
+ openSessionCount: number;
986
+ /** Drawers whose variance waits for a manager (`sessions.approveClose`), read now. */
987
+ pendingCount: number;
988
+ /** Drawers closed without a count and not counted since (`sessions.count`), read now. */
989
+ uncountedCount: number;
990
+ closedAt: string | null;
991
+ /** The person who closed it last (a User id); null for a machine credential and before. */
992
+ closedByUserId: string | null;
993
+ /** The machine credential that closed it last (`api_token:<id>` / `app_installation:<id>`). */
994
+ closedByCredential: string | null;
995
+ closeNote: string | null;
996
+ /** How many times it was closed: 0 before its first close, 2 after a reopen and a close again. */
997
+ closeCount: number;
998
+ reopenedAt: string | null;
999
+ reopenedByUserId: string | null;
1000
+ reopenNote: string | null;
1001
+ }
1002
+ /** A store's business day with its drawers and names, as `days.get`, `close` and `reopen` read it. */
1003
+ export interface PosStoreDay extends PosStoreDaySummary {
1004
+ /** The day's drawers, by register name, then Z number. */
1005
+ sessions: PosStoreDaySession[];
1006
+ /** The closer's name as the store's administrators hold it now; null when unknown or not a person. */
1007
+ closedByUserName: string | null;
1008
+ reopenedByUserName: string | null;
1009
+ }
1010
+ /**
1011
+ * A location's business days, closed and reopened in the back office (engine sprint 26e). A day
1012
+ * is the store's business day at ONE stock location (each location's own zone, the store's day
1013
+ * start); its drawers are the ones that opened in it. Every call needs `UpdateSettings` or
1014
+ * `ManagePosDevices` (a `pos` token holding only `OperatePos` is `FORBIDDEN`); a credential
1015
+ * restricted to other locations is refused `LOCATION_NOT_ALLOWED`. Each is its own document: an
1016
+ * engine before 26 refuses only these, at validation (`GRAPHQL_VALIDATION_FAILED`).
1017
+ */
1018
+ export interface PosDaysModule {
1019
+ /**
1020
+ * One business day at a location, with its drawers (by register name, then Z number), its
1021
+ * totals (the roll-up stored at its close when `totalsFinal`, else computed now from the
1022
+ * drawers' Zs), its open, pending and uncounted drawers counted now, and who closed or reopened
1023
+ * it, by name. Any valid day answers, one with no record as `open` with `id` null. Refused
1024
+ * `POS_STORE_DAY_INVALID` (`extensions.reason`: `day_format`, or `location_unknown` for a
1025
+ * location where no register, day or drawer of the store stands).
1026
+ */
1027
+ get(input: {
1028
+ stockLocationId: string;
1029
+ businessDay: string;
1030
+ }, options?: Call): Promise<PosStoreDay>;
1031
+ /**
1032
+ * A location's business days from `fromDay` to `toDay` (`YYYY-MM-DD`, inclusive; both the
1033
+ * business day today when omitted; at most 31 days apart), newest first: the days with a drawer
1034
+ * or a record only, each with its totals and counts, never its drawers or names (read them with
1035
+ * `get`). Returned whole. Refused `POS_LIST_RANGE_INVALID` (`extensions.reason`: `day_format`,
1036
+ * `day_order`, `span_too_long`) and `POS_STORE_DAY_INVALID` (`location_unknown`).
1037
+ */
1038
+ list(input: {
1039
+ stockLocationId: string;
1040
+ fromDay?: string;
1041
+ toDay?: string;
1042
+ }, options?: Call): Promise<Page<PosStoreDaySummary>>;
1043
+ /**
1044
+ * Close a business day at a location: every drawer of the day must be closed; drawers closed
1045
+ * without a count or waiting for a manager are not blocking (the day lists them). Stores the
1046
+ * day's totals and who closed it, with the optional note; from then on no drawer opens on that
1047
+ * day (a till is refused `POS_STORE_DAY_CLOSED`). Idempotent by state: closing a closed day
1048
+ * answers it unchanged and writes nothing, so a lost answer is safe to retry. Refusals:
1049
+ * `POS_STORE_DAY_SESSIONS_OPEN` (`extensions.sessionIds`, `registerIds`: close them at the
1050
+ * till or with `sessions.closeUncounted` first), `POS_STORE_DAY_INVALID` (`extensions.reason`:
1051
+ * `day_format`, `future`, `location_unknown`), `POS_CLOSE_NOTE_INVALID` (at most 500
1052
+ * characters once trimmed). A later `sessions.count` of one of its drawers refreshes the stored
1053
+ * totals.
1054
+ */
1055
+ close(input: {
1056
+ stockLocationId: string;
1057
+ businessDay: string;
1058
+ note?: string;
1059
+ }, options?: Call): Promise<PosStoreDay>;
1060
+ /**
1061
+ * Reopen a CLOSED business day, with a reason (1 to 500 characters once trimmed), so drawers
1062
+ * open on it again; its stored totals stay until it is closed again (`closeCount` + 1).
1063
+ * Refusals: `POS_STORE_DAY_NOT_CLOSED` (`extensions.status`: `open`, or `reopened` already),
1064
+ * `POS_CLOSE_NOTE_INVALID`, `POS_STORE_DAY_INVALID` (`day_format`). Needs the store's `pos`
1065
+ * grant (a lapsed store closes its days but never reopens one).
1066
+ */
1067
+ reopen(input: {
1068
+ stockLocationId: string;
1069
+ businessDay: string;
1070
+ note: string;
1071
+ }, options?: Call): Promise<PosStoreDay>;
216
1072
  }
217
1073
  /** A till cart — a draft order — as far as this module projects it. */
218
1074
  export interface PosCart {
@@ -234,7 +1090,23 @@ export interface PosCart {
234
1090
  quantity: number;
235
1091
  productVariantId: string;
236
1092
  linePriceWithTax: number;
1093
+ /**
1094
+ * A custom item's name (sprint 16b), null on a catalogue line. Present on carts answered by
1095
+ * {@link PosSaleModule.addCustomItem}; absent on the others, which do not select it.
1096
+ */
1097
+ customItemName?: string | null;
1098
+ /**
1099
+ * The line's note (sprint 16c), null when it has none. Present on carts answered by
1100
+ * {@link PosSaleModule.setOrderNote} and {@link PosSaleModule.setLineNote}; absent on the
1101
+ * others, which do not select it.
1102
+ */
1103
+ note?: string | null;
237
1104
  }>;
1105
+ /**
1106
+ * The sale's note (sprint 16c), null when it has none. Present on carts answered by the note
1107
+ * methods only, as the lines' `note`.
1108
+ */
1109
+ note?: string | null;
238
1110
  surcharges: Array<{
239
1111
  description: string;
240
1112
  sku: string;
@@ -243,6 +1115,32 @@ export interface PosCart {
243
1115
  taxRate: number;
244
1116
  }>;
245
1117
  }
1118
+ /**
1119
+ * What a till wrote on a sale, for a back office reading the order (sprint 16d): the sale's note
1120
+ * and, per line, its custom item name and its note. Every order answers it; one the till did not
1121
+ * sell has `isPosOrder: false` and nothing else set.
1122
+ */
1123
+ export interface PosTillSaleDetails {
1124
+ orderId: string;
1125
+ /** The order was sold at a till. */
1126
+ isPosOrder: boolean;
1127
+ /** The sale's note, null when it has none. May name a customer: customer data. */
1128
+ note: string | null;
1129
+ /** Every line of the order, in the order's own order. */
1130
+ lines: Array<{
1131
+ id: string;
1132
+ /** A custom item's name, null on a catalogue line: the till's name for what it sold. */
1133
+ customItemName: string | null;
1134
+ /** The line's note, null when it has none. Customer data, as the sale's note. */
1135
+ note: string | null;
1136
+ }>;
1137
+ /**
1138
+ * Present (`true`) when the caller's customer-data level blanked a field of this answer: an
1139
+ * app installation below `customerData: full` reads the notes as null, which is then not "no
1140
+ * note".
1141
+ */
1142
+ redacted?: true;
1143
+ }
246
1144
  export interface CompletedPosSale {
247
1145
  orderId: string;
248
1146
  orderCode: string;
@@ -315,6 +1213,89 @@ export interface PosSaleModule {
315
1213
  orderId: string;
316
1214
  couponCode: string;
317
1215
  }, options?: Call): Promise<PosCart>;
1216
+ /**
1217
+ * Add a custom item (sprint 16b): a line you name and price, sold on one of the store's custom
1218
+ * item tax categories (`settings.customItemPolicy().taxCategories`). The unit price is in minor
1219
+ * units of the cart's currency on the ORDER's price basis: its first line's, else the store's
1220
+ * (`amountsIncludeTax`: gross on an inclusive store). The two differ only on an inclusive store's
1221
+ * cart taxed in another zone (an attached customer from a tax-exclusive country), whose lines are
1222
+ * net. The engine states it on the line and core taxes it from the category in the order's zone,
1223
+ * so you never compute tax. Only in the store's default currency, at least 1, at
1224
+ * most the store's `maxUnitPrice`; quantity 1 to 999 (1 when omitted); a name of 1 to 80
1225
+ * characters on one line, printed on the receipt and invoice.
1226
+ *
1227
+ * Above the store's `cashierLimit` a manager approves it. A machine principal's credential IS
1228
+ * the manager (a person minted it), so a `pos` token is never asked. A paired till's cashier
1229
+ * passes a manager's single-use `approvalToken` (a `posStaffLogin` with purpose `APPROVAL`),
1230
+ * which the engine spends only when the item is added. The price of a custom line is fixed:
1231
+ * correct it by removing the line and adding the item again.
1232
+ *
1233
+ * Refusals: `POS_CUSTOM_ITEM_INVALID` (`field`), `POS_CUSTOM_ITEMS_DISABLED` (`reason`: `store`,
1234
+ * or `host` for an engine that cannot), `POS_CUSTOM_ITEM_CURRENCY_UNSUPPORTED`,
1235
+ * `POS_CUSTOM_ITEM_TAX_CATEGORY_UNAVAILABLE` (`reason`: `not_listed` or `no_rate`),
1236
+ * `POS_CUSTOM_ITEM_PRICE_ABOVE_MAX` (`maxUnitPrice`), `POS_MANAGER_REQUIRED`
1237
+ * (`customItemLimit`, `unitPrice`), and the cart doors' own (`POS_ORDER_NOT_EDITABLE`, …). Takes
1238
+ * `options.idempotencyKey` (required: a fresh UUIDv7 per item): a retry answers the cart as it is
1239
+ * now, never a second line.
1240
+ */
1241
+ addCustomItem(input: {
1242
+ orderId: string;
1243
+ name: string;
1244
+ unitPrice: number;
1245
+ taxCategoryId: string;
1246
+ quantity?: number;
1247
+ }, options: PosMoneyCall & {
1248
+ staffToken?: string;
1249
+ approvalToken?: string;
1250
+ }): Promise<PosCart>;
1251
+ /**
1252
+ * Set or remove the sale's note (sprint 16c): one line printed on the receipt, at most 280
1253
+ * characters; `null` or a blank string removes it. Any staff member (a paired till's cashier
1254
+ * passes `staffToken`; a `pos` token needs none), on an open till cart opened at your location,
1255
+ * a cart readied for payment included: a note changes no money. A cashier may type a customer's
1256
+ * name into it, so treat it as customer data: the engine never writes the text to its audit
1257
+ * trail. Refused `POS_NOTE_INVALID` (`field`, `maxLength`: too long, or a line break or other
1258
+ * control character), `POS_CART_HELD`, and the cart doors' own (`POS_ORDER_NOT_EDITABLE`, …).
1259
+ * Takes `options.idempotencyKey` (required): a retry answers the cart as it is now. The cart it
1260
+ * answers carries `note` and each line's `note` and `customItemName`.
1261
+ */
1262
+ setOrderNote(input: {
1263
+ orderId: string;
1264
+ note: string | null;
1265
+ }, options: PosMoneyCall & {
1266
+ staffToken?: string;
1267
+ }): Promise<PosCart>;
1268
+ /**
1269
+ * Set or remove one line's note (sprint 16c): printed under the line, at most 140 characters;
1270
+ * the rules of {@link PosSaleModule.setOrderNote}. A line that is not on the cart is
1271
+ * `POS_ORDER_LINE_NOT_FOUND`. A line with a note is never merged with a later add of the same
1272
+ * variant: that add is a line of its own.
1273
+ */
1274
+ setLineNote(input: {
1275
+ orderId: string;
1276
+ lineId: string;
1277
+ note: string | null;
1278
+ }, options: PosMoneyCall & {
1279
+ staffToken?: string;
1280
+ }): Promise<PosCart>;
1281
+ /**
1282
+ * Clear the sale (sprint 16c): the unpaid till draft is DELETED with its lines, discounts,
1283
+ * coupons, notes and the attached customer, so the till is free for the next customer. Never
1284
+ * cancelled (no cancellation email). Any staff member, no manager. Refused
1285
+ * `POS_CART_NOT_CLEARABLE` with `reason` `readied` (it started taking payment), `payment` (it has
1286
+ * a payment record of any state: finish it, or refund it) or `open_key` (a payment on the store
1287
+ * may still be in progress: wait and try again); `POS_CART_HELD` (resume it first); and the cart
1288
+ * doors' own (`POS_ORDER_NOT_EDITABLE` for a placed order, …). Answers the deleted sale's id and
1289
+ * code. Takes `options.idempotencyKey` (required). A retry after the clear succeeded (its answer
1290
+ * lost) finds no order, `ENTITY_NOT_FOUND`: re-read the order (`orders.get(orderId)`), and a
1291
+ * sale that is no longer there was cleared.
1292
+ */
1293
+ clearCart(orderId: string, options: PosMoneyCall & {
1294
+ staffToken?: string;
1295
+ }): Promise<{
1296
+ orderId: string;
1297
+ orderCode: string;
1298
+ }>;
318
1299
  /**
319
1300
  * Finalise a fully paid sale: settles the order, debits your location's
320
1301
  * stock through its fulfillment profile (none at that location is
@@ -323,34 +1304,251 @@ export interface PosSaleModule {
323
1304
  complete(orderId: string, options: PosMoneyCall & {
324
1305
  staffToken?: string;
325
1306
  }): Promise<CompletedPosSale>;
326
- }
327
- export interface PosTenderResult {
328
- orderId: string;
329
- paymentId: string;
330
- /** True once settled payments cover the order total. */
331
- covered: boolean;
332
- outstanding: number;
333
- /** Cash only: `tendered - amount`, floored at zero. */
334
- change: number;
335
- }
336
- export interface PosTendersModule {
337
1307
  /**
338
- * Cash into the drawer of the cart's register session. `tendered` is what the
339
- * customer handed over; the difference comes back as `change`.
340
- *
341
- * On an order the till did NOT open (see {@link PosTendersModule.card}) there
342
- * is no cart session, so name the `registerId` whose open session takes the
343
- * cash — without it the tender is refused `POS_SESSION_REQUIRED`. Send
344
- * `registerId` only for such an order: a server older than this field
345
- * refuses the whole call.
346
- *
347
- * Cash is taken only on an order in the store's default currency, the
348
- * currency the drawer holds. On an order in another currency the tender is
349
- * refused `CASH_TENDER_CURRENCY_NOT_SUPPORTED`, its message naming both
350
- * currencies, and nothing is taken. Take the payment with
1308
+ * What the till wrote on an order (sprint 16d), for a back office showing it: the sale's note,
1309
+ * and each line's custom item name and note. Reads any order of the store, sold at a till or
1310
+ * not (`isPosOrder`); null when the store holds no order with that id. Needs `ReadOrder`, like
1311
+ * `orders.get`. Its own read rather than a block of `orders.get`, because an engine before
1312
+ * sprint 16c has none of these fields: there it is refused `GRAPHQL_VALIDATION_FAILED`, and an
1313
+ * order page that reads it beside `orders.get` keeps working.
1314
+ */
1315
+ tillDetails(orderId: string, options?: Call): Promise<PosTillSaleDetails | null>;
1316
+ /**
1317
+ * A completed till sale's receipt (engine sprint 22): ONE structured document, money in minor
1318
+ * units of `currencyCode`, every row core's own figure, so it adds up in both tax displays
1319
+ * (`subtotal` + `adjustments` [+ `taxes` when `EXCLUSIVE`] = `total`, the billable total). It
1320
+ * carries no words of its own: label the rows and lay them out yourself, by their `kind` (each
1321
+ * row kind, adjustment kind and tender kind is one label in your own vocabulary). `kind` is
1322
+ * `SALE` today; read an unknown one as a sale. Who may read it is the till's
1323
+ * sale read rule: a paired till any till sale of the store, a `pos` API token a sale of its
1324
+ * verified location, staff with `ReadOrder`. Refusals: `POS_RECEIPT_NOT_AVAILABLE` (the sale is
1325
+ * not completed), `POS_ORDER_UNSTAMPED` (no till opened the order), `ENTITY_NOT_FOUND`. Below
1326
+ * the `full` customer-data level the notes are withheld (`redacted: true`). An engine before 22
1327
+ * refuses the document at validation.
1328
+ */
1329
+ receipt(orderId: string, options?: Call): Promise<PosReceipt & {
1330
+ redacted?: true;
1331
+ }>;
1332
+ /**
1333
+ * Email a completed till sale's receipt through the store's own email (engine sprint 22c): the
1334
+ * POS Receipt notification's template, gateway, styles and logo, logged under Settings, Emails,
1335
+ * Deliveries. To `emailAddress` alone (no configured CC/BCC), or, omitted, to the sale's
1336
+ * customer (never the till's walk-in). Once per `options.idempotencyKey` (required; a retry
1337
+ * answers the first answer and sends nothing); a paired till signs with `staffToken`. The engine
1338
+ * keeps no address: the answer says where it came from (`source`: `typed`/`customer`) and how
1339
+ * many receipt emails the sale had in 24 hours. Refusals: `POS_RECEIPT_EMAIL_INVALID`,
1340
+ * `POS_RECEIPT_EMAIL_NO_ADDRESS`, `POS_RECEIPT_EMAIL_LIMIT` (`limit` sale or till,
1341
+ * `retryAfterSeconds`: 5 per sale a day, 30 per till an hour by default),
1342
+ * `POS_RECEIPT_EMAIL_UNAVAILABLE` (`reason` disabled or not_installed),
1343
+ * `POS_RECEIPT_NOT_AVAILABLE`, `IDEMPOTENCY_CONFLICT`. An engine before 22c refuses the document
1344
+ * at validation.
1345
+ */
1346
+ emailReceipt(input: {
1347
+ orderId: string;
1348
+ emailAddress?: string | null;
1349
+ }, options: PosMoneyCall & {
1350
+ staffToken?: string;
1351
+ }): Promise<PosEmailReceiptResult>;
1352
+ /**
1353
+ * A completed till sale's digital receipt and prints, for an order page (engine sprint 23):
1354
+ * whether the platform serves receipt pages (`available`) and the store has them on (`enabled`),
1355
+ * how long a new link lives, the RECEIPT then the GIFT link's state (`url` only while `ACTIVE`)
1356
+ * and how many copies and gift receipts were printed through `printReceipt`. Who may read it:
1357
+ * `receipt`'s rule. Refusals as `receipt`. An engine before 23 refuses the document at
1358
+ * validation.
1359
+ */
1360
+ receiptSharing(orderId: string, options?: Call): Promise<PosReceiptSharing>;
1361
+ /**
1362
+ * The sale's live link of `variant`, created when there is none or it expired (engine sprint
1363
+ * 23); a live one is answered unchanged (state-driven: no key). Anyone holding the URL can open
1364
+ * the page (the receipt without the customer, the cashier or notes; the gift receipt without a
1365
+ * price). Needs `UpdateOrder`. Refused `POS_RECEIPT_LINK_UNAVAILABLE` (`reason`:
1366
+ * `not_configured`, the platform serves no receipt pages; `disabled`, the store has digital
1367
+ * receipts off), `POS_RECEIPT_NOT_AVAILABLE`, `POS_ORDER_UNSTAMPED`.
1368
+ */
1369
+ issueReceiptLink(orderId: string, variant: PosReceiptVariant, options?: Call): Promise<PosReceiptLinkStatus>;
1370
+ /**
1371
+ * Withdraw the sale's live link of `variant` (engine sprint 23): its page stops answering at
1372
+ * once and a printed QR is dead; a new link is a new token. A sale with no live link answers its
1373
+ * status and changes nothing. Needs `UpdateOrder`; allowed without the `pos` entitlement (it only
1374
+ * removes access).
1375
+ */
1376
+ revokeReceiptLink(orderId: string, variant: PosReceiptVariant, options?: Call): Promise<PosReceiptLinkStatus>;
1377
+ /**
1378
+ * Print a receipt or a gift receipt again (engine sprint 23): the engine numbers the print and
1379
+ * answers the document to print. A `RECEIPT` print is always a copy (`receipt.copy`: its number
1380
+ * and when it was printed; lay out "COPY"); a `GIFT` print is the gift original the first time
1381
+ * and a copy from the second on, and its `giftReceipt` has no money at all. Once per
1382
+ * `options.idempotencyKey` (minted here when omitted: send your own to retry the same print and
1383
+ * get the same number back); a paired till signs with `staffToken`, staff in the back office
1384
+ * print as themselves. Refused `POS_RECEIPT_NOT_AVAILABLE`, `POS_ORDER_UNSTAMPED`,
1385
+ * `IDEMPOTENCY_CONFLICT`.
1386
+ */
1387
+ printReceipt(input: {
1388
+ orderId: string;
1389
+ variant: PosReceiptVariant;
1390
+ }, options?: Call & {
1391
+ idempotencyKey?: string;
1392
+ staffToken?: string;
1393
+ }): Promise<PosPrintReceiptResult>;
1394
+ /**
1395
+ * A completed till sale's gift receipt (engine sprint 23): the same sale without a single price,
1396
+ * with its live GIFT link. A read: nothing is printed or counted (print one with `printReceipt`).
1397
+ */
1398
+ giftReceipt(orderId: string, options?: Call): Promise<PosGiftReceipt>;
1399
+ }
1400
+ /** Which receipt a link or a print is for (engine sprint 23). */
1401
+ export type PosReceiptVariant = 'RECEIPT' | 'GIFT';
1402
+ /** A live public link to a receipt (engine sprint 23). */
1403
+ export interface PosReceiptLink {
1404
+ variant: PosReceiptVariant;
1405
+ url: string;
1406
+ issuedAt: string;
1407
+ expiresAt: string;
1408
+ }
1409
+ /** This print is a copy (engine sprint 23): lay out "COPY" with its number and instant. */
1410
+ export interface PosReceiptCopy {
1411
+ /** 1 for the first copy. */
1412
+ number: number;
1413
+ printedAt: string;
1414
+ }
1415
+ /** Where a sale's link stands (engine sprint 23). `url` only while `ACTIVE`. */
1416
+ export interface PosReceiptLinkStatus {
1417
+ variant: PosReceiptVariant;
1418
+ /** `ACTIVE`, `EXPIRED`, `REVOKED` or `NONE`; read an unknown one as not active. */
1419
+ state: string;
1420
+ url: string | null;
1421
+ issuedAt: string | null;
1422
+ expiresAt: string | null;
1423
+ revokedAt: string | null;
1424
+ /** `staff` or `erasure`; null unless `REVOKED`. */
1425
+ revokeReason: string | null;
1426
+ }
1427
+ /** A till sale's digital receipt and prints (engine sprint 23). */
1428
+ export interface PosReceiptSharing {
1429
+ /** The platform serves receipt pages (a public base URL is configured). */
1430
+ available: boolean;
1431
+ /** The store has digital receipts switched on. */
1432
+ enabled: boolean;
1433
+ /** How long a new link stays valid, in days. */
1434
+ ttlDays: number;
1435
+ /** The RECEIPT link, then the GIFT link. */
1436
+ links: PosReceiptLinkStatus[];
1437
+ /** Copies of the receipt printed through `printReceipt`. */
1438
+ receiptCopies: number;
1439
+ /** Gift receipts printed through `printReceipt` (the first is the gift original). */
1440
+ giftPrints: number;
1441
+ }
1442
+ /** A gift receipt line (engine sprint 23): what was bought, never its price. */
1443
+ export interface PosGiftReceiptLine {
1444
+ orderLineId: string;
1445
+ name: string;
1446
+ sku: string | null;
1447
+ quantity: number;
1448
+ }
1449
+ /** A gift receipt (engine sprint 23): no money field at all. */
1450
+ export interface PosGiftReceipt {
1451
+ orderId: string;
1452
+ orderCode: string;
1453
+ receiptNumber: string;
1454
+ issuedAt: string;
1455
+ language: string;
1456
+ locale: string;
1457
+ timeZone: string;
1458
+ /** The store's name, address, phone and extra lines (no VAT or registration number). */
1459
+ header: PosReceiptIdentity & {
1460
+ extraLines: string[];
1461
+ };
1462
+ registerName: string | null;
1463
+ lines: PosGiftReceiptLine[];
1464
+ footerLines: string[];
1465
+ thankYou: boolean;
1466
+ scanCode: string;
1467
+ link: PosReceiptLink | null;
1468
+ copy: PosReceiptCopy | null;
1469
+ }
1470
+ /** One print through `printReceipt` (engine sprint 23): exactly one of the two documents. */
1471
+ export interface PosPrintReceiptResult {
1472
+ orderId: string;
1473
+ variant: PosReceiptVariant;
1474
+ /** 1, 2, … per order and variant. */
1475
+ printNumber: number;
1476
+ /** True for every RECEIPT print and every GIFT print after the first. */
1477
+ copy: boolean;
1478
+ receipt: (PosReceipt & {
1479
+ link: PosReceiptLink | null;
1480
+ copy: PosReceiptCopy | null;
1481
+ }) | null;
1482
+ giftReceipt: PosGiftReceipt | null;
1483
+ }
1484
+ /** The store's digital receipts (engine sprint 23). */
1485
+ export interface PosDigitalReceiptSettings {
1486
+ /** Digital receipts are on: a link is minted at completion and its QR printed. */
1487
+ publicLink: boolean;
1488
+ /** The platform serves receipt pages; false = `publicLink` cannot be switched on. */
1489
+ publicLinkAvailable: boolean;
1490
+ }
1491
+ /** The receipt account claim (engine C3/32). */
1492
+ export interface PosReceiptAccountClaimSettings {
1493
+ /**
1494
+ * Shoppers may add a receipt to their webshop account from its page: the page links to the
1495
+ * store's storefront at `/account/claim-receipt`. Inert while digital receipts are off.
1496
+ */
1497
+ accountClaim: boolean;
1498
+ /** Digital receipts are on and the store has a storefront address: it can be switched on. */
1499
+ accountClaimAvailable: boolean;
1500
+ }
1501
+ /** A queued receipt email (engine sprint 22c). Never the address. */
1502
+ export interface PosEmailReceiptResult {
1503
+ orderId: string;
1504
+ /** `typed` or `customer`. */
1505
+ source: string;
1506
+ /** Receipt emails accepted for the sale in the last 24 hours, this one included. */
1507
+ sentForSale: number;
1508
+ }
1509
+ export interface PosTenderResult {
1510
+ orderId: string;
1511
+ paymentId: string;
1512
+ /** True once settled payments cover the order total. */
1513
+ covered: boolean;
1514
+ outstanding: number;
1515
+ /**
1516
+ * Cash only. The tender that clears the balance on a store that rounds cash
1517
+ * (`cashRoundingMode`) is due rounded (12.33 → 12.35 on `nearest_05`), and change is
1518
+ * `tendered - rounded due`. Otherwise `tendered - amount`. Floored at zero. The difference
1519
+ * from the exact amount is recorded as the drawer's cash rounding; the payment stays the exact
1520
+ * `amount`.
1521
+ */
1522
+ change: number;
1523
+ }
1524
+ export interface PosTendersModule {
1525
+ /**
1526
+ * Cash into the drawer of the cart's register session. `tendered` is what the
1527
+ * customer handed over; the difference comes back as `change`.
1528
+ *
1529
+ * On an order the till did NOT open (see {@link PosTendersModule.card}) there
1530
+ * is no cart session, so name the `registerId` whose open session takes the
1531
+ * cash — without it the tender is refused `POS_SESSION_REQUIRED`. Send
1532
+ * `registerId` only for such an order: a server older than this field
1533
+ * refuses the whole call.
1534
+ *
1535
+ * Cash is taken only on an order in the store's default currency, the
1536
+ * currency the drawer holds. On an order in another currency the tender is
1537
+ * refused `CASH_TENDER_CURRENCY_NOT_SUPPORTED`, its message naming both
1538
+ * currencies, and nothing is taken. Take the payment with
351
1539
  * {@link PosTendersModule.card} or {@link PosTendersModule.manual} instead:
352
1540
  * neither touches the drawer, so this rule does not apply to them.
353
1541
  *
1542
+ * On a store that rounds cash (`cashRoundingMode` `nearest_05` / `nearest_10`), only the
1543
+ * tender that clears the balance is rounded: its `amount` is due rounded to the store's
1544
+ * increment, and `change` is measured from that rounded due. Such a tender may hand over the
1545
+ * exact amount or the rounded one (1 and 2 cent coins stay legal tender), and `tendered` is 0
1546
+ * when the rounded due is 0 (a 0.02 balance on `nearest_05`). A partial tender
1547
+ * (one that leaves a balance) is never rounded and must hand over at least its `amount`, or it
1548
+ * is refused (`Only the cash tender that clears the balance is rounded`) and nothing is
1549
+ * taken. The payment is always the exact `amount`; the difference is the drawer's cash
1550
+ * rounding, reported on the session's stored totals.
1551
+ *
354
1552
  * The first tender of a sale asks the apps the store installed
355
1553
  * (`order.validate`) before anything is taken: a refusal is `HOOK_REJECTED`
356
1554
  * (`HookRejectedError`, with the app's `customerMessage`) or
@@ -458,7 +1656,15 @@ export interface PosRefundsModule {
458
1656
  * Hand money back against one payment of the order, never more than the order
459
1657
  * took (`REFUND_EXCEEDS_SETTLED`). Refusals that mean NO money moved:
460
1658
  * `REFUND_METHOD_UNAVAILABLE` (that payment's method is disabled or gone),
461
- * `REFUND_REFUSED` (the gateway said no, with its reason) — retry is safe.
1659
+ * `REFUND_REFUSED` (the gateway said no, with its reason) — retry is safe —
1660
+ * and `LIVE_CONNECTION_REFUSED`: a store that is not live holds a till
1661
+ * Mollie key that is not a `test_` key, so no card refund is asked of Mollie
1662
+ * until that key is replaced by a test key (`settings.setMollieApiKey`) or
1663
+ * removed; `settings.readiness()` reads `KEY_LIVE_ON_TEST_STORE` meanwhile.
1664
+ * `REFUND_REQUIRES_CREDIT_NOTE` (409): the sale has a live invoice, so its
1665
+ * refund goes back through the invoice's correction in the back office
1666
+ * (`documents.commitCorrection`, the invoice named by
1667
+ * `payments.refundCreditNoteRequirement`), never at the till.
462
1668
  *
463
1669
  * `IDEMPOTENCY_OUTCOME_UNKNOWN` is neither: the card refund reached the
464
1670
  * payment provider and then failed (no answer, a timeout, a provider error),
@@ -482,6 +1688,12 @@ export interface PosRefundsModule {
482
1688
  * `CASH_TENDER_CURRENCY_NOT_SUPPORTED` before anything moves. Refund that
483
1689
  * payment from the order in the back office instead.
484
1690
  *
1691
+ * On a store that rounds cash (`cashRoundingMode`), a refund of a CASH payment pays out the
1692
+ * `amount` cash-rounded like a sale (12.33 refunded on `nearest_05` pays out 12.35), and the
1693
+ * difference is recorded on the drawer as its cash rounding; the refund itself stays the exact
1694
+ * `amount`. The engine answers the payout as `cashPaidOut`, which this SDK version does not
1695
+ * read, so older engines keep answering: work it out with the same rounding when you need it.
1696
+ *
485
1697
  * The order must be a till's sale made at your location, and the payment one
486
1698
  * of ITS payments: an order no till opened is `POS_ORDER_UNSTAMPED`, a payment
487
1699
  * of another order `USER_INPUT_ERROR`, another store's order `ENTITY_NOT_FOUND`.
@@ -502,26 +1714,321 @@ export interface PosDevice {
502
1714
  label: string;
503
1715
  status: 'active' | 'revoked';
504
1716
  paired: boolean;
505
- /** Recorded server-side every time the tablet authenticates. */
1717
+ /** Stamped when the tablet signs in (`authenticate`) and, from engine sprint 35, at each heartbeat. */
506
1718
  lastSeenAt: string | null;
1719
+ /**
1720
+ * The Mollie card terminal (`term_…`) its card tenders go to (`devices.assignTerminal`); null
1721
+ * while none is assigned. A display holds none.
1722
+ */
1723
+ mollieTerminalId: string | null;
1724
+ createdAt: string;
1725
+ updatedAt: string;
1726
+ /**
1727
+ * The device's health columns (engine sprint 35), read by `devices.fleet`, `devices.lock` and
1728
+ * `devices.unlock`; absent from `list` and `revoke`, which keep answering an older engine. When
1729
+ * the till last sent a heartbeat; null for an app build that sends none.
1730
+ */
1731
+ heartbeatAt?: string | null;
1732
+ /** When a manager locked it (`devices.lock`); null while unlocked. */
1733
+ lockedAt?: string | null;
1734
+ /** Since when the till has been silent with a drawer open; null otherwise. */
1735
+ silentSince?: string | null;
1736
+ /**
1737
+ * What the device is (engine sprint 39): a `till` sells, a `display` shows the shopper the sale
1738
+ * of its register. Chosen at `create`, never changed. Read by `fleet`, `lock`, `unlock` and a
1739
+ * `create` that names a kind; absent elsewhere, where it is a till. More may come: treat an
1740
+ * unknown kind as neither.
1741
+ */
1742
+ kind?: PosDeviceKind | (string & {});
1743
+ }
1744
+ /** A device's kind (engine sprint 39). */
1745
+ export type PosDeviceKind = 'till' | 'display';
1746
+ /** The kinds a device is created as (engine sprint 39), in the engine's order. */
1747
+ export declare const POS_DEVICE_KINDS: readonly PosDeviceKind[];
1748
+ /** A one-time pairing code (`devices.pair`) and when it stops working (ISO-8601). */
1749
+ export interface PosPairingCode {
1750
+ code: string;
1751
+ expiresAt: string;
1752
+ }
1753
+ /**
1754
+ * How long a pairing code works before a tablet claims it (`devices.pair`, engine
1755
+ * `emre/pos-reviewer-pairing`): `STANDARD` 10 minutes, `APP_REVIEW` 30 days for a store reviewer's
1756
+ * device. Either way the code is claimed once.
1757
+ */
1758
+ export type PosPairingCodeValidity = 'STANDARD' | 'APP_REVIEW';
1759
+ /** The validities a pairing code is issued with, in the engine's order. */
1760
+ export declare const POS_PAIRING_CODE_VALIDITIES: readonly PosPairingCodeValidity[];
1761
+ /** A new device (`devices.create`). */
1762
+ export interface PosDeviceCreateInput {
1763
+ label: string;
1764
+ /** The stock location it sells from (a till) or stands at (a display). */
1765
+ stockLocationId: string;
1766
+ /** The register it works at. A display shows the sale of this register's open drawer. */
1767
+ registerId?: string | null;
1768
+ /** `till` when omitted (engine sprint 39); never changes. */
1769
+ kind?: PosDeviceKind;
1770
+ }
1771
+ /**
1772
+ * A device's health as the engine judges it now (engine sprint 35): `online` (heard within 2
1773
+ * minutes), `quiet` (2 to 15), `silent` (longer, with a drawer open), `idle` (longer, no drawer
1774
+ * open), `unknown` (never sent a heartbeat: an app build before 35), and `locked`, `unpaired` or
1775
+ * `revoked`, which take precedence. More may come: show an unknown status as it is.
1776
+ */
1777
+ export type PosDeviceHealthStatus = 'online' | 'quiet' | 'silent' | 'idle' | 'unknown' | 'locked' | 'unpaired' | 'revoked';
1778
+ export interface PosDeviceHealth {
1779
+ status: PosDeviceHealthStatus | (string & {});
1780
+ /** The last heartbeat the engine stored; null when it never sent one. */
1781
+ lastHeardAt: string | null;
1782
+ silentSince: string | null;
1783
+ }
1784
+ /**
1785
+ * What a till said in its last heartbeat (engine sprint 35). Every value is the till's own claim,
1786
+ * null when it did not say. The closed values (`platform`, `connection`, `printer`) may grow: show
1787
+ * an unknown one as it is.
1788
+ */
1789
+ export interface PosDeviceHeartbeatReport {
1790
+ appVersion: string | null;
1791
+ buildNumber: string | null;
1792
+ runtimeVersion: string | null;
1793
+ updateId: string | null;
1794
+ updateChannel: string | null;
1795
+ platform: 'ios' | 'android' | 'other' | (string & {}) | null;
1796
+ /** `online` or `degraded`: a till that is offline sends nothing. */
1797
+ connection: 'online' | 'degraded' | (string & {}) | null;
1798
+ outboxPending: number | null;
1799
+ offlineSalesPending: number | null;
1800
+ offlineSalesRefused: number | null;
1801
+ printer: 'none' | 'ready' | 'unreachable' | 'unknown' | (string & {}) | null;
1802
+ reportedAt: string;
507
1803
  }
508
- /** Paired tablets. Every method needs `ManagePosDevices` (or `UpdateSettings`). */
1804
+ /** The drawer a till has open (engine sprint 35). */
1805
+ export interface PosDeviceOpenDrawer {
1806
+ sessionId: string;
1807
+ registerId: string;
1808
+ openedAt: string;
1809
+ /** The cashier who opened it, as the store names them now; null for a machine principal. */
1810
+ openedByStaffName: string | null;
1811
+ }
1812
+ /**
1813
+ * One device of the store with its health (engine sprint 35, `devices.fleet`). How many of its
1814
+ * offline sales wait for a manager (engine sprint 45) is its own read,
1815
+ * `devices.offlineSalesToReview`, so this row answers an engine before 45.
1816
+ */
1817
+ export interface PosDeviceFleetRow {
1818
+ device: PosDevice;
1819
+ health: PosDeviceHealth;
1820
+ /** Null until the till sends its first heartbeat. */
1821
+ report: PosDeviceHeartbeatReport | null;
1822
+ openDrawer: PosDeviceOpenDrawer | null;
1823
+ /** Who locked it, as the store's administrators name them now; null when unknown or not a person. */
1824
+ lockedByUserName: string | null;
1825
+ }
1826
+ /**
1827
+ * The store's tills and customer displays. Every method needs `ManagePosDevices` or
1828
+ * `UpdateSettings` (either one). A `deviceId` that is not one of this store's devices (missing, or
1829
+ * another store's) is refused `POS_DEVICE_NOT_FOUND` (`NotFoundError`); `get` and `heartbeat`
1830
+ * answer null instead.
1831
+ */
509
1832
  export interface PosDevicesModule {
1833
+ /**
1834
+ * The store's devices, newest first, whole (one page); a location-restricted credential sees
1835
+ * the devices at its locations only. Their health is `fleet`'s.
1836
+ *
1837
+ * @effect read
1838
+ */
510
1839
  list(options?: Call): Promise<Page<PosDevice>>;
511
1840
  /**
512
- * A one-time pairing code the tablet redeems; it expires. Needs a human session: an API token
513
- * is refused (`PermissionDeniedError` `TOKEN_CREDENTIAL_NOT_ALLOWED`), because the paired
514
- * device's session would outlive the token.
1841
+ * One device of the store, or null when the store has none by that id (another store's reads
1842
+ * the same, and so does, to a location-restricted credential, a device at another location).
1843
+ * Its kind and health are `fleet`'s.
1844
+ *
1845
+ * @effect read
1846
+ */
1847
+ get(deviceId: string, options?: Call): Promise<PosDevice | null>;
1848
+ /**
1849
+ * Add a device to the store; pair it afterwards with `pair`. Without `kind` it is a till, and
1850
+ * the call works against any engine. `kind: 'display'` adds a customer display (engine sprint
1851
+ * 39), which shows the shopper the sale of its register's open drawer: give it the register
1852
+ * (or assign one later), since a display without one shows nothing. A display takes no card
1853
+ * terminal (`POS_DEVICE_KIND_NOT_ALLOWED` on assigning one). A kind outside `POS_DEVICE_KINDS`
1854
+ * is refused before anything is sent (`ValidationError`, code `POS_DEVICE_KIND_INVALID`, the
1855
+ * engine's own code for it), and an engine before 39 fails the document's validation. Needs a
1856
+ * human session like `pair`: an API token is refused `TOKEN_CREDENTIAL_NOT_ALLOWED`.
1857
+ *
1858
+ * Adding a device first sets the store's POS up where it is not yet (its payment methods,
1859
+ * in-store shipping method, till role and fulfilment profile; idempotent). A location outside a
1860
+ * restricted credential's is refused `LOCATION_NOT_ALLOWED` (`PermissionDeniedError`) before
1861
+ * anything is written, and so is a caller that does not hold every permission the till will
1862
+ * carry (`POS_DEVICE_CEILING_NOT_ALLOWED`). A `registerId` is judged as
1863
+ * {@link PosDevicesModule.assignRegister} judges it, against the new device's location, before
1864
+ * the device is written.
1865
+ *
1866
+ * @effect write
1867
+ */
1868
+ create(input: PosDeviceCreateInput, options?: Call): Promise<PosDevice>;
1869
+ /**
1870
+ * Move a device to another of the store's stock locations: a till then sells from it and
1871
+ * reserves its stock. Its register moves WITH it (engine `pos-device-writes-validate`): a
1872
+ * device holding a register moves only with `options.registerId`, an active register at the new
1873
+ * location (judged as {@link PosDevicesModule.assignRegister} judges one), unless its register
1874
+ * already stands there; otherwise it is refused `POS_LOCATION_MISMATCH` (`BusinessRuleError`,
1875
+ * `reason` `device_register_elsewhere`) and nothing changes, so its drawer never stays behind at
1876
+ * the old location. A device with no register moves without one.
1877
+ *
1878
+ * Refused before anything changes: `POS_DEVICE_NOT_FOUND` (`NotFoundError`, another store's
1879
+ * reads the same), `LOCATION_NOT_ALLOWED` (`PermissionDeniedError`: the device's own location or
1880
+ * the new one outside a restricted credential's), `POS_DEVICE_REVOKED` (`BusinessRuleError`),
1881
+ * `POS_LOCATION_NOT_FOUND` (`NotFoundError`, a location the store does not have). An older
1882
+ * engine keeps the device's register as it was, answers an unknown location as a server fault,
1883
+ * and refuses a call that names `registerId` at validation (`GRAPHQL_VALIDATION_FAILED`, or a
1884
+ * 400 the transport reports as `BAD_REQUEST`); without it the document is the one every engine
1885
+ * serves.
1886
+ *
1887
+ * From engine `pos-device-move-refuses-open-drawer`, a move that changes the device's location
1888
+ * or register is refused `POS_DEVICE_SESSION_OPEN` (`BusinessRuleError`, the engine's sentence
1889
+ * naming the drawer's register) while the device has an open drawer: the drawer stays on the
1890
+ * register it opened on, so close it first (at the till, or `sessions.close` /
1891
+ * `sessions.closeUncounted` in the back office; {@link PosSessionsModule.openForDevice} reads
1892
+ * it). A move to where the device already stands, with its own register, still answers the
1893
+ * device. An older engine moves the device and leaves the drawer behind.
1894
+ *
1895
+ * @effect write
1896
+ */
1897
+ assignLocation(deviceId: string, stockLocationId: string, options?: {
1898
+ registerId?: string;
1899
+ } & Call): Promise<PosDevice>;
1900
+ /**
1901
+ * The register the device's drawer sessions open on (a display shows that register's sale):
1902
+ * one of `registers.list()` that is active and stands at the device's `stockLocationId`. From
1903
+ * engine W10-62 anything else is refused before the device changes: a register the store does
1904
+ * not have `POS_REGISTER_NOT_FOUND` (`NotFoundError`, another store's reads the same), one at
1905
+ * another location `POS_LOCATION_MISMATCH` (`BusinessRuleError`; move the device there first,
1906
+ * or pick a register at its location), a retired one `POS_REGISTER_INACTIVE`
1907
+ * (`BusinessRuleError`). An older engine stores any id as sent. From engine
1908
+ * `pos-device-writes-validate` the device is judged first, as
1909
+ * {@link PosDevicesModule.assignLocation} judges it (`POS_DEVICE_NOT_FOUND`,
1910
+ * `LOCATION_NOT_ALLOWED` for a device at a location outside a restricted credential's,
1911
+ * `POS_DEVICE_REVOKED`). From engine `pos-device-move-refuses-open-drawer`, another register
1912
+ * is refused `POS_DEVICE_SESSION_OPEN` (`BusinessRuleError`) while the device has an open
1913
+ * drawer, as {@link PosDevicesModule.assignLocation} says; the register it holds still answers
1914
+ * the device.
1915
+ *
1916
+ * @effect write
1917
+ */
1918
+ assignRegister(deviceId: string, registerId: string, options?: Call): Promise<PosDevice>;
1919
+ /**
1920
+ * The Mollie card terminal (`term_…`, one of `terminals.list()`) the device's card tenders go
1921
+ * to. The engine does not ask Mollie about it, and one terminal may be assigned to several
1922
+ * devices. A display takes none: `POS_DEVICE_KIND_NOT_ALLOWED` (`PermissionDeniedError`).
1923
+ *
1924
+ * From engine `pos-device-writes-validate` the id is stored trimmed, and one that is empty,
1925
+ * longer than 100 characters or not one word is refused `POS_MOLLIE_TERMINAL_ID_INVALID`
1926
+ * (`ValidationError`, `reason` `empty` | `too_long` | `not_one_word`); the device is judged as
1927
+ * {@link PosDevicesModule.assignRegister} judges it. An older engine stores any text as sent.
1928
+ * Take a terminal off a device with {@link PosDevicesModule.clearTerminal}.
1929
+ *
1930
+ * @effect write
1931
+ */
1932
+ assignTerminal(deviceId: string, terminalId: string, options?: Call): Promise<PosDevice>;
1933
+ /**
1934
+ * Take the device's own card terminal off it (engine `pos-device-writes-validate`): its card
1935
+ * tenders then go to the one reader assigned to its stock location (`terminals`, Settings →
1936
+ * Payments), and are refused when the location has none or several. Clearing a device with none
1937
+ * answers it unchanged. Refused `POS_DEVICE_NOT_FOUND` (`NotFoundError`), `LOCATION_NOT_ALLOWED`
1938
+ * (`PermissionDeniedError`, a device at a location outside a restricted credential's) and
1939
+ * `POS_DEVICE_REVOKED` (`BusinessRuleError`). An older engine fails the document's validation
1940
+ * (`GRAPHQL_VALIDATION_FAILED`, or a 400 the transport reports as `BAD_REQUEST`).
1941
+ *
1942
+ * @effect write
1943
+ */
1944
+ clearTerminal(deviceId: string, options?: Call): Promise<PosDevice>;
1945
+ /**
1946
+ * The store's devices with their health, version and open drawer (engine sprint 35), grouped by
1947
+ * health status with the newest heartbeat first, whole (one page). `stockLocationId` keeps one
1948
+ * location's; a location-restricted caller sees its own locations only. The engine judges the
1949
+ * health at the time of the read: ask again for a fresh view. An engine before 35 fails the
1950
+ * document's validation (`GRAPHQL_VALIDATION_FAILED`, or a 400 the transport reports as
1951
+ * `BAD_REQUEST`); `list` keeps working there.
1952
+ *
1953
+ * @effect read
1954
+ */
1955
+ fleet(options?: {
1956
+ stockLocationId?: string;
1957
+ } & Call): Promise<Page<PosDeviceFleetRow>>;
1958
+ /**
1959
+ * How many of each device's offline sales wait for a manager (engine sprint 45, the fleet's
1960
+ * `offlineSalesToReview`: `needs_review` or `refused`, not yet handled), one row per device
1961
+ * `fleet` lists, whole (one page). Its own document, so `fleet` keeps answering an engine
1962
+ * before 45, which fails this one alone at validation (`GRAPHQL_VALIDATION_FAILED`, or a 400
1963
+ * the transport reports as `BAD_REQUEST`). The sales themselves: `offlineSales.list`.
1964
+ *
1965
+ * @effect read
1966
+ */
1967
+ offlineSalesToReview(options?: {
1968
+ stockLocationId?: string;
1969
+ } & Call): Promise<Page<PosDeviceOfflineSalesToReview>>;
1970
+ /**
1971
+ * Lock a device (engine sprint 35): every call of its session is refused `POS_DEVICE_LOCKED`
1972
+ * except its heartbeat, its cashiers' PIN sessions end, and nobody signs in on it until
1973
+ * `unlock`. Its pairing, its open drawer and the sale on its screen stay, and a card already on
1974
+ * the terminal still settles; the sale is completed after the unlock. The lock is never refused
1975
+ * for money in flight. Locking a locked device answers it unchanged. Refused `POS_DEVICE_REVOKED`
1976
+ * (`BusinessRuleError`) and `LOCATION_NOT_ALLOWED`. A store without its `pos` grant can still
1977
+ * lock a lost till.
1978
+ *
1979
+ * @effect write
1980
+ */
1981
+ lock(deviceId: string, options?: Call): Promise<PosDevice>;
1982
+ /**
1983
+ * Unlock a locked device (engine sprint 35); an unlocked one answers unchanged.
1984
+ *
1985
+ * @effect write
1986
+ */
1987
+ unlock(deviceId: string, options?: Call): Promise<PosDevice>;
1988
+ /**
1989
+ * A one-time pairing code the tablet redeems; it expires. A new code replaces any the device
1990
+ * still had. Needs a human session: an API token is refused (`PermissionDeniedError`
1991
+ * `TOKEN_CREDENTIAL_NOT_ALLOWED`), because the paired device's session would outlive the token.
1992
+ * A revoked device is refused `POS_DEVICE_REVOKED` (`BusinessRuleError`): revoke retires a
1993
+ * device for good, so add a new device to use that tablet again. A device its till unpaired is
1994
+ * still `active` and is paired again here. Refused `LOCATION_NOT_ALLOWED` at a location outside
1995
+ * a restricted credential's, and `POS_DEVICE_CEILING_NOT_ALLOWED` to a caller that does not
1996
+ * hold every permission the till will carry.
1997
+ *
1998
+ * `validity` sets how long the code works unclaimed: `STANDARD` (10 minutes, what a call without
1999
+ * it gets) or `APP_REVIEW` (30 days), for a store reviewer who installs the app days after it
2000
+ * was submitted. Either way the code is claimed once, by one tablet, and a new code of either
2001
+ * validity replaces the device's unclaimed one. Only a platform SuperAdmin may ask for
2002
+ * `APP_REVIEW` (the demo store's tool): anyone else is refused
2003
+ * `POS_PAIRING_REVIEW_CODE_NOT_ALLOWED` (`PermissionDeniedError`) before the device is read. Without `validity` the call works against any
2004
+ * engine; with one it needs an engine with `emre/pos-reviewer-pairing`. An older engine refuses
2005
+ * the document (it does not know the argument), and the SDK raises a 400 `ValidationError`
2006
+ * (`BAD_REQUEST`). A value outside
2007
+ * `POS_PAIRING_CODE_VALIDITIES` is refused before anything is sent (`ValidationError`, code
2008
+ * `POS_PAIRING_CODE_VALIDITY_INVALID`). Show `expiresAt` in the store's time zone.
2009
+ *
2010
+ * @effect write
2011
+ */
2012
+ pair(deviceId: string, options?: {
2013
+ validity?: PosPairingCodeValidity;
2014
+ } & Call): Promise<PosPairingCode>;
2015
+ /**
2016
+ * Retire the device for good: its token stops working at once, its tablet's sessions end, and
2017
+ * it can never be paired again (add a new device to use that tablet). There is no undo.
2018
+ * Revoking a revoked device answers it as it is. From engine `pos-device-writes-validate` a
2019
+ * device at a location outside a restricted credential's is refused `LOCATION_NOT_ALLOWED`
2020
+ * (`PermissionDeniedError`).
2021
+ *
2022
+ * @effect destructive
515
2023
  */
516
- pair(deviceId: string, options?: Call): Promise<{
517
- code: string;
518
- expiresAt: string;
519
- }>;
520
2024
  revoke(deviceId: string, options?: Call): Promise<PosDevice>;
521
2025
  /**
522
- * The device's last sign of life. There is no heartbeat WRITE for an SDK to
523
- * send: the server stamps `lastSeenAt` on every authenticated tablet request,
524
- * so this reads it.
2026
+ * The device's `lastSeenAt`: when its tablet last signed in (`authenticate`) and, from engine
2027
+ * sprint 35, when it last sent a heartbeat. It is not stamped on every request. A paired till
2028
+ * reports its health every minute through its own session, a door no SDK sends; read that report
2029
+ * with `fleet` (`health`, `report`, `device.heartbeatAt`). Null as `get` answers null.
2030
+ *
2031
+ * @effect read
525
2032
  */
526
2033
  heartbeat(deviceId: string, options?: Call): Promise<{
527
2034
  lastSeenAt: string | null;
@@ -535,33 +2042,838 @@ export interface PosReceiptNumbering {
535
2042
  }
536
2043
  /** Needs `ManagePosDevices` (or `UpdateSettings`). */
537
2044
  export interface PosReceiptNumberingModule {
2045
+ /**
2046
+ * The format the store's receipts are numbered in: its organization's while it inherits
2047
+ * `settings.numbering_formats`, else its own.
2048
+ *
2049
+ * @effect read
2050
+ */
538
2051
  get(options?: Call): Promise<PosReceiptNumbering>;
2052
+ /**
2053
+ * Change the store's own receipt number format; an omitted field keeps its value, `digits` is
2054
+ * held to 3..8. Answers the store's own row, not the inherited format `get` reads: read again
2055
+ * after saving. A store that inherits the format is refused `ORGANIZATION_SETTINGS_INHERITED`
2056
+ * until it overrides the group, and one whose organization locks it `MANAGED_BY_ORGANIZATION`.
2057
+ *
2058
+ * @effect write
2059
+ */
539
2060
  set(input: Partial<PosReceiptNumbering>, options?: Call): Promise<PosReceiptNumbering>;
540
2061
  }
2062
+ /** A store's POS settings as the setup surfaces read them. The Mollie key itself is never returned. */
2063
+ export interface PosSettings {
2064
+ /** Whether the store's tills may open sessions and take payments. */
2065
+ enabled: boolean;
2066
+ /** The till's cash payment method; null = the engine's default `pos-cash`. */
2067
+ cashPaymentMethodCode: string | null;
2068
+ /** The till's card (terminal) payment method; null = the engine's default `pos-mollie-terminal`. */
2069
+ cardPaymentMethodCode: string | null;
2070
+ inStoreShippingMethodId: string | null;
2071
+ /**
2072
+ * The fulfillment profile a till sale prefers when it sits at the till's location; null = the
2073
+ * location's own POS profile (`pos-<locationId>`), else its first enabled one.
2074
+ */
2075
+ fulfillmentProfileId: string | null;
2076
+ /** Pre-fills a new device's location; the engine never reads it otherwise. */
2077
+ defaultStockLocationId: string | null;
2078
+ /** `none`, `nearest_05` or `nearest_10`; a till treats any other stored value as `none`. */
2079
+ cashRoundingMode: string;
2080
+ /** A Mollie API key is stored for the till. */
2081
+ hasMollieKey: boolean;
2082
+ /**
2083
+ * The stored key masked (`live_••••k6rW`: its mode and last four), or null: when none is stored,
2084
+ * when the engine can no longer decrypt it, and for a caller without `UpdateSettings` or
2085
+ * `ManagePosDevices` (a `pos` API token included), whatever is stored. Read `hasMollieKey` for
2086
+ * whether a key is stored.
2087
+ */
2088
+ maskedMollieApiKey: string | null;
2089
+ }
2090
+ /**
2091
+ * What `settings.update` changes: an omitted field keeps its value, `null` clears a reference
2092
+ * (the till then charges through the engine's default method, `pos-cash` / `pos-mollie-terminal`).
2093
+ * Every reference names one of the store's own records. The Mollie key and the cash rounding have
2094
+ * methods of their own (`setMollieApiKey`, `setCashRoundingMode`), and so do the receipt
2095
+ * (`setReceipt`) and the idle lock (`setIdleLock`).
2096
+ */
2097
+ export interface PosSettingsInput {
2098
+ /** Whether the store's tills may open sessions and take payments. */
2099
+ enabled?: boolean;
2100
+ /** A payment method CODE of the store, the one cash sales are recorded on. */
2101
+ cashPaymentMethodCode?: string | null;
2102
+ /** A payment method CODE of the store, the one card (terminal) sales are recorded on. */
2103
+ cardPaymentMethodCode?: string | null;
2104
+ /** A live shipping method of the store: the zero-cost "collect in store" method till sales carry. */
2105
+ inStoreShippingMethodId?: string | null;
2106
+ /** A fulfillment profile of the store a till sale prefers. */
2107
+ fulfillmentProfileId?: string | null;
2108
+ /** A stock location of the store that a new device is pre-filled with. */
2109
+ defaultStockLocationId?: string | null;
2110
+ }
2111
+ /** The fields `settings.update` sends; anything else is refused before a request is made. */
2112
+ export declare const POS_SETTINGS_INPUT_FIELDS: readonly ["enabled", "cashPaymentMethodCode", "cardPaymentMethodCode", "inStoreShippingMethodId", "fulfillmentProfileId", "defaultStockLocationId"];
2113
+ /** A Mollie terminal the store's till key reaches, as Mollie reports it now. */
2114
+ export interface PosMollieTerminal {
2115
+ /** `term_…`: what a device is assigned. */
2116
+ terminalId: string;
2117
+ /** The name the merchant gave it in Mollie, or its id when it has none. */
2118
+ description: string;
2119
+ /** `pending` (not activated yet), `active` or `inactive`. */
2120
+ status: string;
2121
+ brand: string | null;
2122
+ model: string | null;
2123
+ serialNumber: string | null;
2124
+ currency: string | null;
2125
+ }
2126
+ /**
2127
+ * A Mollie terminal pairing code for the store's till key (engine `pos-mollie-terminal-pairing`):
2128
+ * a Mollie Tap terminal (the Tap app on a phone, or a Mollie Tap device) scans `qrCodeSvg` or has
2129
+ * `code` typed in to join the key's Mollie profile. Usable more than once until it expires or is
2130
+ * revoked: `code` is a secret, never store or log it.
2131
+ */
2132
+ export interface PosMollieTerminalPairingCode {
2133
+ /** Mollie's id for the code (`termpc_…`): what {@link PosTerminalsModule.revokePairingCode} takes. */
2134
+ pairingCodeId: string;
2135
+ /** The code a person types on the terminal. */
2136
+ code: string;
2137
+ /** Mollie's QR for the code, a `data:image/svg+xml;base64,` URI to show as an image; null when Mollie sent none. */
2138
+ qrCodeSvg: string | null;
2139
+ /** ISO 8601: when Mollie stops accepting it; null when Mollie did not say. */
2140
+ expiresAt: string | null;
2141
+ }
2142
+ /** One thing the store's tills need before they take cash and card payments. */
2143
+ export interface PosSetupCheck {
2144
+ /** `pos_enabled`, `cash_method`, `card_method`, `mollie_key`, `card_device`, `in_store_shipping`, `default_location`, `staff`, `fulfillment_profile`; more may come. */
2145
+ check: string;
2146
+ ok: boolean;
2147
+ /** False for a check the tills can trade without. */
2148
+ required: boolean;
2149
+ /** A code saying why it is not ok; null when ok. */
2150
+ reason: string | null;
2151
+ }
2152
+ /** What the store's tills still need: `ready` when every required check is ok. */
2153
+ export interface PosSetupReadiness {
2154
+ ready: boolean;
2155
+ checks: PosSetupCheck[];
2156
+ }
2157
+ /**
2158
+ * How a store rounds the cash that settles a sale: not at all, or to the nearest 5 or 10 minor units
2159
+ * of its currency (`nearest_05`: 12.33 is paid as 12.35 and 12.32 as 12.30).
2160
+ */
2161
+ export type PosCashRoundingMode = 'none' | 'nearest_05' | 'nearest_10';
2162
+ /** A tax category a custom item may use, with its rate in the store's own tax zone. */
2163
+ export interface PosCustomItemTaxCategory {
2164
+ id: string;
2165
+ name: string;
2166
+ /** Percent in the store's default tax zone; null when that zone has none for it (unusable). */
2167
+ taxRate: number | null;
2168
+ }
2169
+ /** A store's rules for custom items (sprint 16b). Money in minor units of `currencyCode`. */
2170
+ export interface PosCustomItemPolicy {
2171
+ /** The store sells custom items; off until it turns them on. */
2172
+ enabled: boolean;
2173
+ /** False when the engine cannot sell custom items at all. */
2174
+ available: boolean;
2175
+ /** The categories a custom item may use, in the store's order. */
2176
+ taxCategories: PosCustomItemTaxCategory[];
2177
+ /** Every category the store could list, for a settings form. */
2178
+ taxCategoryChoices: PosCustomItemTaxCategory[];
2179
+ /** The highest unit price; 0 until set. */
2180
+ maxUnitPrice: number;
2181
+ /** The highest unit price a cashier sells without a manager; 0: a manager approves each one. */
2182
+ cashierLimit: number;
2183
+ /** The amounts include tax (the store's price basis). */
2184
+ amountsIncludeTax: boolean;
2185
+ /** The store's default currency: custom items are sold only in it. */
2186
+ currencyCode: string;
2187
+ }
2188
+ /** What `setCustomItemPolicy` changes: an omitted field keeps its value; `taxCategoryIds` replaces the list. */
2189
+ export interface PosCustomItemPolicyInput {
2190
+ enabled?: boolean;
2191
+ taxCategoryIds?: string[];
2192
+ maxUnitPrice?: number;
2193
+ cashierLimit?: number;
2194
+ }
2195
+ /** Needs `UpdateSettings` to write; `get` needs any session of the store. */
2196
+ export interface PosSettingsModule {
2197
+ /**
2198
+ * The store's POS settings, or null when POS was never set up.
2199
+ *
2200
+ * @effect read
2201
+ */
2202
+ get(options?: Call): Promise<PosSettings | null>;
2203
+ /**
2204
+ * Change what the store's tills sell through: POS on or off, the cash and card payment methods,
2205
+ * the in-store shipping method, the fulfillment profile and the default stock location
2206
+ * ({@link PosSettingsInput}); an omitted field keeps its value. Needs `UpdateSettings` alone: it
2207
+ * names the methods the till charges through, so `ManagePosDevices` (the till estate) is not
2208
+ * enough. A store with no POS settings yet gets them, POS off unless `enabled` says otherwise.
2209
+ *
2210
+ * Refusals: `POS_CONFIG_REFERENCE_INVALID` (400) when a reference the call CHANGES is not one of
2211
+ * the store's own records: a payment method code the store does not have, a shipping method,
2212
+ * fulfillment profile or stock location of another store or of none; `details[]` names each
2213
+ * such field as `/<field>`, and nothing is written. Another store's record and a missing one are
2214
+ * refused alike. A value sent back unchanged always passes, even one stored before the check
2215
+ * that no longer resolves. `LOCATION_NOT_ALLOWED` when a location-restricted credential names a
2216
+ * default location outside its own. `ORGANIZATION_WORKSPACE_NOT_A_STORE` when switching POS on in
2217
+ * an organization's workspace (switching it off is never refused). A field this method does not
2218
+ * know (the Mollie key, the cash rounding) is refused with a `TypeError` before anything is sent.
2219
+ *
2220
+ * Whether a method is enabled, or works with the till's cash or terminal handler, is not judged
2221
+ * here: `readiness()` reports it.
2222
+ *
2223
+ * @effect write
2224
+ */
2225
+ update(input: PosSettingsInput, options?: Call): Promise<PosSettings>;
2226
+ /**
2227
+ * Store the till's Mollie API key (encrypted at rest; never readable again). The key is trimmed;
2228
+ * an empty one is refused here (`TypeError`) — remove it with `removeMollieApiKey`. Sending the
2229
+ * masked value back keeps the stored key. Refusals: `LIVE_CONNECTION_REFUSED` (a store that is not
2230
+ * live takes only a `test_` key), `SECRET_ARG_MASK_INVALID`, `APP_SECRET_ARG_NOT_ALLOWED` (an app
2231
+ * installation), `ORGANIZATION_WORKSPACE_NOT_A_STORE`, `POS_ENCRYPTION_NOT_CONFIGURED` (the engine
2232
+ * cannot store a card key yet: its operator must configure it; a non-retryable 500, nothing
2233
+ * stored, and `settings.readiness()` reports it as the `mollie_key` reason
2234
+ * `ENCRYPTION_NOT_CONFIGURED`). Replacing it does not move payments already
2235
+ * taken: a card payment or refund of a payment made under a key of ANOTHER Mollie account can no
2236
+ * longer be read or refunded through the till.
2237
+ */
2238
+ setMollieApiKey(apiKey: string, options?: Call): Promise<PosSettings>;
2239
+ /** Remove the stored key: card payments and card refunds at the till stop until one is set again. */
2240
+ removeMollieApiKey(options?: Call): Promise<PosSettings>;
2241
+ /**
2242
+ * Set how the cash that settles a sale is rounded (`nearest_05`: 12.33 is paid as 12.35). Only the
2243
+ * cash tender that clears the balance is rounded, and the customer may still pay the exact amount;
2244
+ * card payments and the order total are never rounded, and the difference is recorded on the
2245
+ * drawer as cash rounding. Sends the mode alone. Refusals: `POS_CASH_ROUNDING_MODE_INVALID` (not
2246
+ * one of the three), `POS_CASH_ROUNDING_SESSION_OPEN` (a register session of the store is open:
2247
+ * close it on the till first; the message says how many are open). Setting the stored mode again
2248
+ * is never refused. Needs `UpdateSettings`. An engine older than these checks stores the mode
2249
+ * without them.
2250
+ */
2251
+ setCashRoundingMode(mode: PosCashRoundingMode, options?: Call): Promise<PosSettings>;
2252
+ /**
2253
+ * What the tills still need (no provider is asked). Needs `UpdateSettings` or `ManagePosDevices`.
2254
+ * The tills judged are the POS app's paired devices: `card_device` counts an active, paired
2255
+ * device on a register that reaches a terminal. A till your own backend runs with a `pos` API token (no device)
2256
+ * is not judged, so a store with no paired device reads `NO_ACTIVE_DEVICE` and not `ready`.
2257
+ */
2258
+ readiness(options?: Call): Promise<PosSetupReadiness>;
2259
+ /**
2260
+ * The store's cash controls at the till's close (engine sprint 25b): whether the till counts
2261
+ * blind, and the variance threshold (minor units of the drawer's currency) above which a close
2262
+ * needs a manager's approval, at the close or later. Null when POS was never set up; the engine
2263
+ * then closes with its defaults (blind off, threshold 0: every variance needs a manager). Any
2264
+ * session of the store reads it. An engine before 25b refuses the document at validation.
2265
+ */
2266
+ cashControls(options?: Call): Promise<PosCashControls | null>;
2267
+ /**
2268
+ * Set the store's cash controls; they apply from the next close, open drawers included.
2269
+ * `varianceThreshold`: whole minor units from 0 to 100000000, `null` for never, omitted to keep
2270
+ * the stored one (0 makes every variance need a manager). Refusals: `POS_CASH_CONTROLS_INVALID`
2271
+ * (out of range), `ORGANIZATION_WORKSPACE_NOT_A_STORE`. Needs `UpdateSettings`. An engine
2272
+ * before 25b refuses the document at validation.
2273
+ */
2274
+ setCashControls(input: PosCashControlsInput, options?: Call): Promise<PosCashControls>;
2275
+ /**
2276
+ * The store's business day and the automatic close of forgotten drawers (engine sprint 26): when
2277
+ * its day starts and when it closes (`HH:MM` on each location's wall clock), and after how many
2278
+ * minutes a drawer left open is closed without a count. Null when POS was never set up; the
2279
+ * engine then runs with its defaults (00:00, no closing time, 120 minutes after it, 24 hours
2280
+ * idle). Any session of the store reads it. An engine before 26 refuses the document at
2281
+ * validation.
2282
+ */
2283
+ dayControls(options?: Call): Promise<PosDayControls | null>;
2284
+ /**
2285
+ * Set the store's day controls, all at once (engine sprint 26). A new day start applies to
2286
+ * drawers opened after it: an open drawer keeps the business day it was stamped with. An omitted
2287
+ * or null `closingTime` is no closing time (no closing-time auto-close); an omitted
2288
+ * `autoCloseIdleMinutes` keeps the stored one, `null` switches the idle close off. Refused
2289
+ * `POS_DAY_CONTROLS_INVALID` (a `ValidationError`; `error.details[0].field` names the control,
2290
+ * `extensions.reason` is `time_format`, `day_start_out_of_range`, `after_closing_out_of_range`
2291
+ * or `idle_out_of_range`): times are `HH:MM`, the day starts 00:00 to 12:00, the grace is 30 to
2292
+ * 1440 minutes, the idle time 120 to 10080. Also `ORGANIZATION_WORKSPACE_NOT_A_STORE`. Needs
2293
+ * `UpdateSettings`; setting what is stored writes nothing.
2294
+ */
2295
+ setDayControls(input: PosDayControlsInput, options?: Call): Promise<PosDayControls>;
2296
+ /** The store's custom item rules (sprint 16b), with every category it could list. Any staff session. */
2297
+ customItemPolicy(options?: Call): Promise<PosCustomItemPolicy>;
2298
+ /**
2299
+ * Change the store's custom item rules (sprint 16b); needs `UpdateSettings`. Refused
2300
+ * `POS_CUSTOM_ITEM_POLICY_INVALID` (`field`; `taxCategoryId` for a category that does not exist or
2301
+ * has no rate in the store's tax zone): at most 20 categories, each once; amounts 0 to
2302
+ * 2147483647; turning it on needs a category and a `maxUnitPrice` of at least 1. A change that
2303
+ * changes nothing writes nothing.
2304
+ */
2305
+ setCustomItemPolicy(input: PosCustomItemPolicyInput, options?: Call): Promise<PosCustomItemPolicy>;
2306
+ /**
2307
+ * The store's receipt settings (engine sprint 22): which of the store's details print at the top
2308
+ * (`identity` is what the platform holds, edited under the store's details, never here), its
2309
+ * extra header and footer lines, and how tax shows. `configured: false` for a store that never
2310
+ * saved them: its receipt prints as before. Null when POS was never set up. Any staff session
2311
+ * of the store reads it. An engine before 22 refuses the document at validation.
2312
+ */
2313
+ receipt(options?: Call): Promise<PosReceiptSettings | null>;
2314
+ /**
2315
+ * Change the store's receipt settings; an omitted field keeps its value. `footerLines: null`
2316
+ * prints the receipt's own thank-you line, `[]` no footer. Refusals:
2317
+ * `POS_RECEIPT_SETTINGS_INVALID` with `field` (`headerLines`, `footerLines`, `taxDisplay`: more
2318
+ * than 4 lines, a line over 48 characters or holding a tab or a line break),
2319
+ * `ORGANIZATION_WORKSPACE_NOT_A_STORE`. A change that changes nothing writes nothing. Needs
2320
+ * `UpdateSettings`. An engine before 22 refuses the document at validation.
2321
+ */
2322
+ setReceipt(input: PosReceiptSettingsInput, options?: Call): Promise<PosReceiptSettings>;
2323
+ /**
2324
+ * A sample sale's receipt with these settings over the stored ones (nothing is written), for a
2325
+ * preview, laid out as you lay out `sale.receipt`. Refused `POS_RECEIPT_SETTINGS_INVALID` as the save
2326
+ * would be. Needs `UpdateSettings` or `ManagePosDevices`. An engine before 22 refuses the
2327
+ * document at validation.
2328
+ */
2329
+ previewReceipt(input?: PosReceiptSettingsInput, options?: Call): Promise<PosReceipt>;
2330
+ /**
2331
+ * The store's digital receipts (engine sprint 23): on or off, and whether the platform serves
2332
+ * receipt pages at all. Its own read, so `receipt()` keeps working on an engine before 23 (this
2333
+ * one is refused there at validation). Null when POS was never set up. Switch it with
2334
+ * `setReceipt({ publicLink })`.
2335
+ */
2336
+ digitalReceipts(options?: Call): Promise<PosDigitalReceiptSettings | null>;
2337
+ /**
2338
+ * The receipt account claim (engine C3/32): on or off, and whether it can be switched on (digital
2339
+ * receipts on and a storefront address). Its own read, so `digitalReceipts()` keeps working on
2340
+ * an engine before C3 (this one is refused there at validation). Null when POS was never set
2341
+ * up. Switch it with `setReceipt({ accountClaim })`.
2342
+ */
2343
+ receiptAccountClaim(options?: Call): Promise<PosReceiptAccountClaimSettings | null>;
2344
+ /**
2345
+ * The store's offline cash sales (engine sprint 45): whether its tills may keep selling for cash
2346
+ * while offline (off until a manager turns it on), the three limits, and whether the store can
2347
+ * sell offline now (`ready`; `notReadyReasons` says why not: `prices_exclude_tax`,
2348
+ * `automatic_promotions`, `no_cash_method`, `pos_disabled`, more may come). A till sells offline
2349
+ * only on a store that is switched on AND ready. Null when POS was never set up (the defaults
2350
+ * apply: off). Any staff session of the store reads it. Its own document: an engine before 45
2351
+ * refuses it at validation, and every other settings read keeps working.
2352
+ */
2353
+ offlineCashSales(options?: Call): Promise<PosOfflineCashSales | null>;
2354
+ /**
2355
+ * Set the store's offline cash sales, every field at once, each within
2356
+ * `POS_OFFLINE_CASH_SALES_LIMITS` (the sale amount in minor units of the store's default
2357
+ * currency). Switching on is allowed on a store that is not ready: its tills sell offline once it
2358
+ * is. Refused `POS_OFFLINE_POLICY_INVALID` (`ValidationError`; `details[0].field` names the
2359
+ * limit, `extensions.min`/`max` its bounds) and `ORGANIZATION_WORKSPACE_NOT_A_STORE`. Needs
2360
+ * `UpdateSettings`. An engine before 45 refuses the document at validation.
2361
+ */
2362
+ setOfflineCashSales(input: PosOfflineCashSalesInput, options?: Call): Promise<PosOfflineCashSales>;
2363
+ /**
2364
+ * The store's idle lock at its tills: after how many minutes without a cashier's touch,
2365
+ * keystroke or scan a till signs its cashier out. `minutes` is the store's choice, 1 to 60, or
2366
+ * null until it chooses (its tills then lock after `POS_IDLE_LOCK_LIMITS.defaultMinutes`, 5).
2367
+ * Null when POS was never set up. Any staff session of the store reads it. Its own document: an
2368
+ * engine without the setting refuses it at validation, and every other settings read keeps
2369
+ * working.
2370
+ */
2371
+ idleLock(options?: Call): Promise<PosIdleLock | null>;
2372
+ /**
2373
+ * Set the store's idle lock: a whole number of minutes, which the engine holds to
2374
+ * `POS_IDLE_LOCK_LIMITS` (never refused: 0 is stored as 1, 90 as 60), or `null` back to the
2375
+ * tills' default. A value that is not a whole number is refused here (`TypeError`), before
2376
+ * anything is sent. It applies at each till's next sign-in. Needs `UpdateSettings`. An engine
2377
+ * without the setting refuses the document at validation.
2378
+ */
2379
+ setIdleLock(minutes: number | null, options?: Call): Promise<PosIdleLock>;
2380
+ }
2381
+ /** A store's idle lock at its tills. */
2382
+ export interface PosIdleLock {
2383
+ /** The store's choice, 1 to 60 minutes; null for the tills' default. */
2384
+ minutes: number | null;
2385
+ }
2386
+ /** The bounds the engine holds a store's idle lock to, and the tills' default. */
2387
+ export declare const POS_IDLE_LOCK_LIMITS: {
2388
+ readonly minMinutes: 1;
2389
+ readonly maxMinutes: 60;
2390
+ readonly defaultMinutes: 5;
2391
+ };
2392
+ /** How tax shows on a receipt (engine sprint 22). */
2393
+ export type PosReceiptTaxDisplay = 'INCLUSIVE' | 'EXCLUSIVE';
2394
+ /** The store's details as the platform holds them (what a receipt's header may print). */
2395
+ export interface PosReceiptIdentity {
2396
+ storeName: string | null;
2397
+ addressLines: string[];
2398
+ phone: string | null;
2399
+ vatNumber: string | null;
2400
+ registrationNumber: string | null;
2401
+ }
2402
+ /** The store's receipt settings (engine sprint 22). */
2403
+ export interface PosReceiptSettings {
2404
+ /** False for a store that never saved them: its receipt prints as before. */
2405
+ configured: boolean;
2406
+ showStoreName: boolean;
2407
+ showAddress: boolean;
2408
+ showPhone: boolean;
2409
+ /** The VAT number and the registration number. */
2410
+ showVatNumber: boolean;
2411
+ /** At most 4 lines of at most 48 characters under the store's details. */
2412
+ headerLines: string[];
2413
+ /** At most 4 lines of at most 48 characters; null = the receipt's own thank-you line. */
2414
+ footerLines: string[] | null;
2415
+ /** The stored choice, else the store's price basis. */
2416
+ taxDisplay: PosReceiptTaxDisplay;
2417
+ identity: PosReceiptIdentity;
2418
+ }
2419
+ /** What `setReceipt` / `previewReceipt` change: an omitted field keeps its value. */
2420
+ export interface PosReceiptSettingsInput {
2421
+ showStoreName?: boolean;
2422
+ showAddress?: boolean;
2423
+ showPhone?: boolean;
2424
+ showVatNumber?: boolean;
2425
+ headerLines?: string[];
2426
+ /** null = the receipt's own thank-you line; [] = no footer. */
2427
+ footerLines?: string[] | null;
2428
+ taxDisplay?: PosReceiptTaxDisplay;
2429
+ /**
2430
+ * Digital receipts on or off (engine sprint 23; send it only to change it: an engine before 23
2431
+ * refuses the field). Switching on where the platform serves no receipt pages is refused
2432
+ * `POS_RECEIPT_LINK_UNAVAILABLE` (`reason: not_configured`).
2433
+ */
2434
+ publicLink?: boolean;
2435
+ /**
2436
+ * The receipt account claim on or off (engine C3/32; send it only to change it: an engine before
2437
+ * C3 refuses the field). Switching on without digital receipts or a storefront address is refused
2438
+ * `POS_RECEIPT_LINK_UNAVAILABLE` (`reason: no_storefront`).
2439
+ */
2440
+ accountClaim?: boolean;
2441
+ }
2442
+ /** A completed till sale's receipt document (engine sprint 22). Money in minor units. */
2443
+ export interface PosReceipt {
2444
+ /** `SALE` today; read an unknown kind as a sale. */
2445
+ kind: string;
2446
+ orderId: string;
2447
+ orderCode: string;
2448
+ receiptNumber: string;
2449
+ /** When the sale was placed (ISO). */
2450
+ issuedAt: string;
2451
+ /** The receipt's language: the store's when the till speaks it, else `en`. */
2452
+ language: string;
2453
+ /** BCP 47, for money and dates (`nl-NL`). */
2454
+ locale: string;
2455
+ /** IANA zone `issuedAt` is shown in. */
2456
+ timeZone: string;
2457
+ currencyCode: string;
2458
+ taxDisplay: PosReceiptTaxDisplay;
2459
+ header: PosReceiptIdentity & {
2460
+ extraLines: string[];
2461
+ };
2462
+ cashierName: string | null;
2463
+ registerName: string | null;
2464
+ lines: PosReceiptLine[];
2465
+ /** The lines at list price plus their own discount rows. */
2466
+ subtotal: number;
2467
+ adjustments: PosReceiptAdjustment[];
2468
+ taxes: PosReceiptTax[];
2469
+ /** The sale's billable total: what was paid. */
2470
+ total: number;
2471
+ tenders: PosReceiptTender[];
2472
+ changeDue: number;
2473
+ refunds: PosReceiptRefund[];
2474
+ orderNote: string | null;
2475
+ /** Where the sale's ship lines go (engine C3); null for a take-now sale. Absent before C3. */
2476
+ delivery?: PosReceiptDelivery | null;
2477
+ footerLines: string[];
2478
+ /** The receipt's own thank-you line prints. */
2479
+ thankYou: boolean;
2480
+ /** The order code, printed as a Code 128 barcode. */
2481
+ scanCode: string;
2482
+ }
2483
+ export interface PosReceiptLine {
2484
+ orderLineId: string;
2485
+ name: string;
2486
+ /** Null for a custom item. */
2487
+ sku: string | null;
2488
+ quantity: number;
2489
+ unitPrice: number;
2490
+ amount: number;
2491
+ /** Percent. */
2492
+ taxRate: number;
2493
+ discounts: Array<{
2494
+ kind: 'PROMOTION' | 'TILL';
2495
+ description: string | null;
2496
+ amount: number;
2497
+ }>;
2498
+ note: string | null;
2499
+ /** Shipped to the customer: printed "To be delivered" (engine C3). Absent before C3. */
2500
+ ships?: boolean;
2501
+ }
2502
+ /** Where a sale's ship lines go (engine C3): the customer's delivery address, never a phone. */
2503
+ export interface PosReceiptDelivery {
2504
+ name: string | null;
2505
+ addressLines: string[];
2506
+ /** The delivery method's name in the receipt language. */
2507
+ methodName: string | null;
2508
+ }
2509
+ export interface PosReceiptAdjustment {
2510
+ kind: 'PROMOTION' | 'TILL_DISCOUNT' | 'SURCHARGE' | 'SHIPPING' | 'ROUNDING';
2511
+ description: string | null;
2512
+ amount: number;
2513
+ }
2514
+ export interface PosReceiptTax {
2515
+ description: string;
2516
+ rate: number;
2517
+ base: number;
2518
+ amount: number;
2519
+ }
2520
+ export interface PosReceiptTender {
2521
+ kind: 'cash' | 'card' | 'other';
2522
+ /**
2523
+ * An exchange's carried credit (engine C3): label it from the receipt's own words, never
2524
+ * `methodName`. Absent from an older engine's answer.
2525
+ */
2526
+ exchange?: boolean;
2527
+ /** The payment method's name in the receipt language. */
2528
+ methodName: string | null;
2529
+ amount: number;
2530
+ /** Cash only. */
2531
+ tendered: number | null;
2532
+ /** Cash only: + the drawer kept more than the amount. */
2533
+ cashRounding: number | null;
2534
+ /** Cash only. */
2535
+ change: number | null;
2536
+ }
2537
+ export interface PosReceiptRefund {
2538
+ kind: 'cash' | 'card' | 'other';
2539
+ /** A refund of an exchange's carried credit (engine C3). */
2540
+ exchange?: boolean;
2541
+ methodName: string | null;
2542
+ /** Positive: the money returned. */
2543
+ amount: number;
2544
+ refundedAt: string;
2545
+ }
2546
+ /** A store's cash controls at the till's close (engine sprint 25b). */
2547
+ export interface PosCashControls {
2548
+ /** The cashier counts the drawer without seeing the expected cash; the variance shows after. */
2549
+ blindCount: boolean;
2550
+ /** A variance above this (minor units) needs a manager; null for never. */
2551
+ varianceThreshold: number | null;
2552
+ }
2553
+ export interface PosCashControlsInput {
2554
+ blindCount: boolean;
2555
+ /** Omitted keeps the stored threshold; null sets "never". */
2556
+ varianceThreshold?: number | null;
2557
+ }
2558
+ /** A store's business day and the auto-close of forgotten drawers (engine sprint 26). */
2559
+ export interface PosDayControls {
2560
+ /** When a business day begins, `HH:MM` (00:00 to 12:00): a drawer opened earlier is the day before's. */
2561
+ businessDayStartsAt: string;
2562
+ /** When the store closes, `HH:MM`; at or before the day start it is on the next calendar day. Null: none. */
2563
+ closingTime: string | null;
2564
+ /** A drawer still open this many minutes after the closing time is closed without a count. */
2565
+ autoCloseAfterClosingMinutes: number;
2566
+ /** A drawer idle this many minutes is closed without a count; null for never. */
2567
+ autoCloseIdleMinutes: number | null;
2568
+ }
2569
+ export interface PosDayControlsInput {
2570
+ businessDayStartsAt: string;
2571
+ /** Omitted or null: no closing time. */
2572
+ closingTime?: string | null;
2573
+ autoCloseAfterClosingMinutes: number;
2574
+ /** Omitted keeps the stored idle time; null switches the idle close off. */
2575
+ autoCloseIdleMinutes?: number | null;
2576
+ }
2577
+ /** Needs `UpdateSettings` or `ManagePosDevices`. */
2578
+ export interface PosTerminalsModule {
2579
+ /**
2580
+ * The Mollie terminals the store's till key reaches, read from Mollie now (at most 250; the whole
2581
+ * list in one page). Refusals, each carrying `.code`: POS_MOLLIE_KEY_INVALID (Mollie refused the
2582
+ * key; a `ValidationError`), POS_MOLLIE_KEY_MISSING, POS_MOLLIE_KEY_UNREADABLE,
2583
+ * POS_MOLLIE_UNREACHABLE (try again) and POS_MOLLIE_REQUEST_REFUSED (each a `BusinessRuleError`),
2584
+ * and POS_ENCRYPTION_NOT_CONFIGURED (the engine cannot store or read a card key yet: its
2585
+ * operator must configure it; a non-retryable 500, Mollie not asked). Branch on the code.
2586
+ */
2587
+ list(options?: Call): Promise<Page<PosMollieTerminal>>;
2588
+ /**
2589
+ * A new Mollie pairing code, with Mollie's QR, for the profile of the store's till key (engine
2590
+ * `pos-mollie-terminal-pairing`): show it, and a Mollie Tap terminal that scans it (or has the
2591
+ * code typed in) joins the profile and appears in {@link list}, pending at first. PAX terminals
2592
+ * take no code: Mollie ships them set up. Every call makes a new code; revoke it with
2593
+ * {@link revokePairingCode} once the terminal shows up. Refusals, each carrying `.code`:
2594
+ * POS_MOLLIE_PAIRING_TEST_MODE (a `test_` key: Mollie pairs nothing in test mode, its test
2595
+ * terminal is in {@link list} already), POS_MOLLIE_PAIRING_NOT_ELIGIBLE (Mollie does not let the
2596
+ * account pair terminals yet: finish onboarding at Mollie), and the key refusals of
2597
+ * {@link list}. A person's session only: an API token is refused `TOKEN_CREDENTIAL_NOT_ALLOWED`
2598
+ * and an app installation `APP_CREDENTIAL_NOT_ALLOWED` (each a `PermissionDeniedError`), since the
2599
+ * code joins a card reader to the store's Mollie account. An engine before it fails the
2600
+ * document's validation (`GRAPHQL_VALIDATION_FAILED`, or a 400 the transport reports as
2601
+ * `BAD_REQUEST`).
2602
+ *
2603
+ * @effect write
2604
+ */
2605
+ createPairingCode(options?: Call): Promise<PosMollieTerminalPairingCode>;
2606
+ /**
2607
+ * Revoke a pairing code of the store's till key: no terminal pairs with it again, and terminals it
2608
+ * already paired keep working. A code Mollie no longer knows answers `true`. Refused
2609
+ * POS_MOLLIE_PAIRING_CODE_ID_INVALID (`ValidationError`: not a `termpc_` id) and the key
2610
+ * refusals of {@link list}.
2611
+ *
2612
+ * @effect write
2613
+ */
2614
+ revokePairingCode(pairingCodeId: string, options?: Call): Promise<boolean>;
2615
+ }
2616
+ /**
2617
+ * The languages a staff member's own till language may be (`en`, `nl`, `de`, `fr`); the engine's
2618
+ * list, which a value outside it is refused against. The till speaks a language only once its
2619
+ * catalogue is released; until then it falls back to the store's language.
2620
+ */
2621
+ export declare const POS_STAFF_LOCALES: readonly ["en", "nl", "de", "fr"];
2622
+ export type PosStaffLocale = (typeof POS_STAFF_LOCALES)[number];
2623
+ export type PosStaffRole = 'cashier' | 'manager';
2624
+ /** A cashier or manager of the store, as the back office manages them. */
2625
+ export interface PosStaffMember {
2626
+ id: string;
2627
+ name: string;
2628
+ /** A manager can approve what a cashier may not do alone (a discount, a refund, a paid-out). */
2629
+ role: PosStaffRole;
2630
+ /** An inactive staff member cannot sign in on a till. */
2631
+ active: boolean;
2632
+ /** The back-office administrator this staff member is linked to, if any. */
2633
+ administratorId: string | null;
2634
+ /**
2635
+ * Their own till language, or null to follow the store's. A string, not narrowed to
2636
+ * {@link PosStaffLocale}, so a language a newer engine adds never fails a read.
2637
+ */
2638
+ locale: string | null;
2639
+ createdAt: string;
2640
+ updatedAt: string;
2641
+ }
2642
+ export interface PosStaffCreateInput {
2643
+ name: string;
2644
+ /** The first PIN, which the cashier signs in with on the till. Never readable again. */
2645
+ pin: string;
2646
+ /** `cashier` when omitted. */
2647
+ role?: PosStaffRole;
2648
+ /** Their own till language; omitted or null follows the store's. */
2649
+ locale?: PosStaffLocale | null;
2650
+ }
2651
+ export interface PosStaffUpdateInput {
2652
+ name?: string;
2653
+ role?: PosStaffRole;
2654
+ active?: boolean;
2655
+ /** Their own till language; null follows the store's; omitted leaves it as it is. */
2656
+ locale?: PosStaffLocale | null;
2657
+ }
2658
+ /**
2659
+ * The till actions a store may let a cashier do without a manager's approval (engine sprint 18). A
2660
+ * manager may do all of them, whatever is stored. Closing a drawer above the store's variance
2661
+ * threshold is not one: it stays a manager's.
2662
+ */
2663
+ export declare const POS_STAFF_GRANTS: readonly ["manual_price", "discount", "custom_item_over_limit", "refund", "discard_held_sale", "paid_out", "no_sale", "safe_drop", "float_adjust", "return_items", "void_sale", "no_receipt_return", "online_return", "manage_card_terminal", "discount_over_limit", "view_reports"];
2664
+ export type PosStaffGrant = (typeof POS_STAFF_GRANTS)[number];
2665
+ /**
2666
+ * The grants a staff member holds only when stored on their record, whatever their role: a manager
2667
+ * does not hold these by being one. `discount_over_limit` lets a till discount they authorise
2668
+ * (their own, or one they approve as a manager) go past the store's discount limit.
2669
+ */
2670
+ export declare const POS_EXPLICIT_STAFF_GRANTS: readonly ["discount_over_limit"];
2671
+ /** What one staff member may do at a till without a manager, as the store stored it. */
2672
+ export interface PosStaffGrants {
2673
+ id: string;
2674
+ role: PosStaffRole;
2675
+ /**
2676
+ * The stored grants, as strings: a grant a newer engine adds never fails a read. A manager may do
2677
+ * everything whatever this says (the list is kept, unused, while they are a manager).
2678
+ */
2679
+ grants: string[];
2680
+ }
2681
+ /**
2682
+ * The store's staff. Every method needs `UpdateSettings` or `ManagePosDevices`.
2683
+ *
2684
+ * `locale` is checked before anything is sent: a value outside {@link POS_STAFF_LOCALES} (`nl_BE`,
2685
+ * `es`) is refused `POS_LOCALE_UNSUPPORTED` as a `ValidationError` (`details[0].field` is
2686
+ * `locale`); the engine's own refusal of that code arrives as the same class (400), by core's code
2687
+ * table. It is trimmed and lower-cased like the engine does (`' NL '` is `nl`), and an empty one
2688
+ * follows the store, as null does. A language the till has not released yet is accepted: the till
2689
+ * uses the store's language until it ships.
2690
+ *
2691
+ * Every staff document names `locale`, so an engine older than the staff language refuses each
2692
+ * call (`GRAPHQL_VALIDATION_FAILED`, or `BAD_REQUEST` over HTTP 400) before running it.
2693
+ */
2694
+ export interface PosStaffModule {
2695
+ /**
2696
+ * Every staff member of the store, inactive ones included, oldest first; returned whole.
2697
+ *
2698
+ * @effect read
2699
+ */
2700
+ list(options?: Call): Promise<Page<PosStaffMember>>;
2701
+ /**
2702
+ * One staff member, or null when the id is not one of this store's.
2703
+ *
2704
+ * @effect read
2705
+ */
2706
+ get(id: string, options?: Call): Promise<PosStaffMember | null>;
2707
+ /**
2708
+ * A new staff member, active, with their first PIN (the engine checks its format, as
2709
+ * {@link PosStaffModule.setPin} says). On an organization workspace refused
2710
+ * `ORGANIZATION_WORKSPACE_NOT_A_STORE`.
2711
+ *
2712
+ * @effect write
2713
+ */
2714
+ create(input: PosStaffCreateInput, options?: Call): Promise<PosStaffMember>;
2715
+ /**
2716
+ * Change what `input` names; a field left out is left as it is. `active: false` is how a staff
2717
+ * member leaves: they can no longer sign in on a till and a shift they have open stops working,
2718
+ * while every sale, drawer and approval they made stays theirs; `active: true` brings them back
2719
+ * (refused `POS_STAFF_NAME_TAKEN` while an active member has the name). There is no delete.
2720
+ * Refused `POS_STAFF_NOT_FOUND` (`NotFoundError`, 404) for an id that is not this store's.
2721
+ *
2722
+ * @effect write
2723
+ */
2724
+ update(id: string, input: PosStaffUpdateInput, options?: Call): Promise<PosStaffMember>;
2725
+ /**
2726
+ * Replace a staff member's PIN. The PIN is 4 to 8 digits, neither one digit repeated (`1111`)
2727
+ * nor a run (`1234`, `9876`); anything else is refused `POS_PIN_FORMAT_INVALID`
2728
+ * (`ValidationError`, 400, the engine's sentence naming the rule, never the PIN) before
2729
+ * anything is read. A new PIN also clears the member's wrong-PIN count, which is how a locked
2730
+ * member is unlocked (the till's own count is left). The PIN is never read back, and this SDK
2731
+ * never puts it in an error or a log. Refused `POS_STAFF_NOT_FOUND` (`NotFoundError`, 404) for an
2732
+ * id that is not this store's. Needs `UpdateSettings` or `ManagePosDevices`.
2733
+ *
2734
+ * @effect write
2735
+ */
2736
+ setPin(id: string, pin: string, options?: Call): Promise<void>;
2737
+ /**
2738
+ * What one staff member may do without a manager (engine sprint 18), or null when the id is not
2739
+ * one of this store's. An engine older than sprint 18 refuses the document
2740
+ * (`GRAPHQL_VALIDATION_FAILED`, or `BAD_REQUEST` over HTTP 400).
2741
+ *
2742
+ * @effect read
2743
+ */
2744
+ grants(id: string, options?: Call): Promise<PosStaffGrants | null>;
2745
+ /**
2746
+ * Every staff member's grants, inactive ones included; returned whole (engine sprint 18).
2747
+ *
2748
+ * @effect read
2749
+ */
2750
+ listGrants(options?: Call): Promise<Page<PosStaffGrants>>;
2751
+ /**
2752
+ * Replace a staff member's grants (engine sprint 18): what they may do at a till without a
2753
+ * manager. The engine stores the set deduplicated, in its own order, and writes (and audits)
2754
+ * only a change. A manager keeps every power whatever is stored. Refused `POS_STAFF_NOT_FOUND`
2755
+ * (`NotFoundError`, 404) for an id that is not this store's, `ORGANIZATION_WORKSPACE_NOT_A_STORE`
2756
+ * on a workspace; a value outside the engine's `PosStaffGrant` enum fails its validation.
2757
+ *
2758
+ * @effect write
2759
+ */
2760
+ setGrants(id: string, grants: readonly PosStaffGrant[], options?: Call): Promise<PosStaffGrants>;
2761
+ /**
2762
+ * The grants the engine this client talks to knows (its `PosStaffGrant` enum), so a caller
2763
+ * deployed ahead of the engine offers only those: `setGrants` naming one the engine lacks fails
2764
+ * GraphQL validation for the whole document. Empty for an engine with no grants at all.
2765
+ *
2766
+ * @effect read
2767
+ */
2768
+ knownGrants(options?: Call): Promise<string[]>;
2769
+ }
541
2770
  export declare const POS_REGISTERS_QUERY = "query PosRegisters { posRegisters { id stockLocationId name status createdAt updatedAt } }";
542
2771
  export declare const POS_REGISTER_QUERY = "query PosRegister($id: ID!) { posRegister(id: $id) { id stockLocationId name status createdAt updatedAt } }";
543
2772
  export declare const CREATE_POS_REGISTER_MUTATION = "mutation CreatePosRegister($input: CreatePosRegisterInput!) { createPosRegister(input: $input) { id stockLocationId name status createdAt updatedAt } }";
544
2773
  export declare const UPDATE_POS_REGISTER_MUTATION = "mutation UpdatePosRegister($id: ID!, $input: UpdatePosRegisterInput!) { updatePosRegister(id: $id, input: $input) { id stockLocationId name status createdAt updatedAt } }";
545
2774
  export declare const OPEN_POS_SESSION_MUTATION = "mutation OpenPosRegisterSession($input: OpenPosRegisterSessionInput!, $staffToken: String) { openPosRegisterSession(input: $input, staffToken: $staffToken) { id registerId deviceId openedByStaffId openingFloat status expectedCash countedCash cashOverShort totals openedAt closedAt } }";
546
2775
  export declare const CLOSE_POS_SESSION_MUTATION = "mutation ClosePosRegisterSession($input: ClosePosRegisterSessionInput!, $staffToken: String) { closePosRegisterSession(input: $input, staffToken: $staffToken) { id registerId deviceId openedByStaffId openingFloat status expectedCash countedCash cashOverShort totals openedAt closedAt } }";
547
- export declare const POS_X_REPORT_QUERY = "query PosXReport($sessionId: ID!) { posXReport(sessionId: $sessionId) { sessionId openingFloat expectedCash movementCount totals { cash card other refunds net saleCount } } }";
2776
+ export declare const POS_X_REPORT_QUERY = "query PosXReport($sessionId: ID!) { posXReport(sessionId: $sessionId) { sessionId openingFloat expectedCash movementCount totals { cash card other refunds net saleCount giftCardsSold giftCardsSoldCount } } }";
2777
+ /** {@link POS_X_REPORT_QUERY} for an engine before C6 (no gift-card memo), which refuses it. */
2778
+ export declare const POS_X_REPORT_QUERY_BEFORE_GIFT_CARDS = "query PosXReport($sessionId: ID!) { posXReport(sessionId: $sessionId) { sessionId openingFloat expectedCash movementCount totals { cash card other refunds net saleCount } } }";
548
2779
  export declare const POS_SESSION_QUERY = "query PosRegisterSession($id: ID!) { posRegisterSession(id: $id) { id registerId deviceId openedByStaffId openingFloat status expectedCash countedCash cashOverShort totals openedAt closedAt } }";
2780
+ export declare const POS_SESSION_DETAIL_QUERY = "query PosRegisterSessionDetail($id: ID!) { posRegisterSession(id: $id) { id registerId deviceId openedByStaffId openingFloat status expectedCash countedCash cashOverShort totals openedAt closedAt closedByStaffId blindCount varianceThreshold varianceApproval varianceApprovedByStaffId varianceApprovedAt } }";
2781
+ export declare const POS_SESSION_APPROVAL_QUERY = "query PosRegisterSessionApproval($id: ID!) { posRegisterSession(id: $id) { id varianceApproval varianceThreshold varianceApprovedByStaffId varianceApprovedAt varianceApprovedByUserId varianceApprovedByUserName varianceApprovedByCredential varianceApprovalNote } }";
2782
+ export declare const APPROVE_POS_SESSION_CLOSE_MUTATION = "mutation ApprovePosRegisterSessionClose($input: ApprovePosRegisterSessionCloseInput!) { approvePosRegisterSessionClose(input: $input) { id registerId deviceId openedByStaffId openingFloat status expectedCash countedCash cashOverShort totals openedAt closedAt closedByStaffId blindCount varianceThreshold varianceApproval varianceApprovedByStaffId varianceApprovedAt varianceApprovedByUserId varianceApprovedByUserName varianceApprovedByCredential varianceApprovalNote } }";
2783
+ export declare const SESSION_RECORD_FIELDS = "businessDay stockLocationId timeZone zNumber closeSource closedByUserId autoCloseReason closeNote countedAt countedByUserId countNote";
2784
+ export declare const SESSION_RECORD_NAME_FIELDS = "varianceApprovedByUserName closedByUserName countedByUserName";
2785
+ export declare const POS_SESSION_RECORD_QUERY = "query PosRegisterSessionRecord($id: ID!) { posRegisterSession(id: $id) { id registerId deviceId openedByStaffId openingFloat status expectedCash countedCash cashOverShort totals openedAt closedAt closedByStaffId blindCount varianceThreshold varianceApproval varianceApprovedByStaffId varianceApprovedAt varianceApprovedByUserId varianceApprovedByCredential varianceApprovalNote businessDay stockLocationId timeZone zNumber closeSource closedByUserId autoCloseReason closeNote countedAt countedByUserId countNote varianceApprovedByUserName closedByUserName countedByUserName } }";
2786
+ export declare const POS_SESSION_RECORDS_QUERY = "query PosRegisterSessionRecords($options: PosRegisterSessionListOptions) { posRegisterSessions(options: $options) { totalItems items { id registerId deviceId openedByStaffId openingFloat status expectedCash countedCash cashOverShort totals openedAt closedAt closedByStaffId blindCount varianceThreshold varianceApproval varianceApprovedByStaffId varianceApprovedAt varianceApprovedByUserId varianceApprovedByCredential varianceApprovalNote businessDay stockLocationId timeZone zNumber closeSource closedByUserId autoCloseReason closeNote countedAt countedByUserId countNote } } }";
2787
+ export declare const CLOSE_POS_SESSION_UNCOUNTED_MUTATION = "mutation ClosePosRegisterSessionUncounted($input: ClosePosRegisterSessionUncountedInput!) { closePosRegisterSessionUncounted(input: $input) { id registerId deviceId openedByStaffId openingFloat status expectedCash countedCash cashOverShort totals openedAt closedAt closedByStaffId blindCount varianceThreshold varianceApproval varianceApprovedByStaffId varianceApprovedAt varianceApprovedByUserId varianceApprovedByCredential varianceApprovalNote businessDay stockLocationId timeZone zNumber closeSource closedByUserId autoCloseReason closeNote countedAt countedByUserId countNote varianceApprovedByUserName closedByUserName countedByUserName } }";
2788
+ export declare const COUNT_POS_SESSION_MUTATION = "mutation CountPosRegisterSession($input: CountPosRegisterSessionInput!) { countPosRegisterSession(input: $input) { id registerId deviceId openedByStaffId openingFloat status expectedCash countedCash cashOverShort totals openedAt closedAt closedByStaffId blindCount varianceThreshold varianceApproval varianceApprovedByStaffId varianceApprovedAt varianceApprovedByUserId varianceApprovedByCredential varianceApprovalNote businessDay stockLocationId timeZone zNumber closeSource closedByUserId autoCloseReason closeNote countedAt countedByUserId countNote varianceApprovedByUserName closedByUserName countedByUserName } }";
2789
+ export declare const POS_ORDERS_QUERY = "query PosOrders($input: PosOrderListInput) { posOrders(input: $input) { totalItems items { orderId orderCode receiptNumber placedAt state currencyCode totalWithTax totalQuantity refundedTotal tenderKinds customerKind customerName registerId registerName sessionId deviceId deviceLabel staffId staffName } } }";
2790
+ export declare const POS_TILL_SALE_QUERY = "query PosTillSale($orderId: ID!) { posTillOrder(orderId: $orderId) { order { id code state } receiptNumber placedAt customerKind deviceId deviceLabel registerId registerName sessionId staffId staffName payments { paymentId kind method state amount refunded refundUnknown refundable } idCheck { id checkedAt staffId staffName deviceId deviceLabel stockLocationId minimumAge } } }";
2791
+ /**
2792
+ * {@link POS_TILL_SALE_QUERY} for an engine older than the till's ID check (user decision L1),
2793
+ * which refuses the whole document at validation: the sale is still read, with no ID check.
2794
+ */
2795
+ export declare const POS_TILL_SALE_QUERY_LEGACY = "query PosTillSale($orderId: ID!) { posTillOrder(orderId: $orderId) { order { id code state } receiptNumber placedAt customerKind deviceId deviceLabel registerId registerName sessionId staffId staffName payments { paymentId kind method state amount refunded refundUnknown refundable } } }";
2796
+ export declare const POS_CASH_MOVEMENTS_QUERY = "query PosCashMovements($input: PosCashMovementListInput) { posCashMovements(input: $input) { totalItems items { id sessionId registerId registerName deviceId deviceLabel type amount reason staffId staffName approvedByStaffId approvedByStaffName orderId orderCode receiptNumber idempotencyKey createdAt } } }";
2797
+ export declare const STORE_DAY_TOTALS_FIELDS = "currencyCode sessionCount uncountedCount openingFloat expectedCash countedCash cashOverShort cash card other refunds net saleCount cashRefunds cardRefunds otherRefunds cashRounding";
2798
+ export declare const STORE_DAY_SESSION_FIELDS = "sessionId registerId registerName zNumber status closeSource openedAt closedAt openingFloat expectedCash countedCash cashOverShort varianceApproval totals { cash card other refunds net saleCount cashRefunds cardRefunds otherRefunds cashRounding }";
2799
+ export declare const STORE_DAY_FIELDS = "id stockLocationId businessDay timeZone startsAt endsAt status totalsFinal totals { currencyCode sessionCount uncountedCount openingFloat expectedCash countedCash cashOverShort cash card other refunds net saleCount cashRefunds cardRefunds otherRefunds cashRounding } openSessionCount pendingCount uncountedCount closedAt closedByUserId closedByCredential closeNote closeCount reopenedAt reopenedByUserId reopenNote";
2800
+ /** What a single day's read adds to a list item: its drawers and the two names. */
2801
+ export declare const STORE_DAY_DETAIL_FIELDS = "sessions { sessionId registerId registerName zNumber status closeSource openedAt closedAt openingFloat expectedCash countedCash cashOverShort varianceApproval totals { cash card other refunds net saleCount cashRefunds cardRefunds otherRefunds cashRounding } } closedByUserName reopenedByUserName";
2802
+ export declare const POS_STORE_DAY_QUERY = "query PosStoreDay($stockLocationId: ID!, $businessDay: String!) { posStoreDay(stockLocationId: $stockLocationId, businessDay: $businessDay) { id stockLocationId businessDay timeZone startsAt endsAt status totalsFinal totals { currencyCode sessionCount uncountedCount openingFloat expectedCash countedCash cashOverShort cash card other refunds net saleCount cashRefunds cardRefunds otherRefunds cashRounding } openSessionCount pendingCount uncountedCount closedAt closedByUserId closedByCredential closeNote closeCount reopenedAt reopenedByUserId reopenNote sessions { sessionId registerId registerName zNumber status closeSource openedAt closedAt openingFloat expectedCash countedCash cashOverShort varianceApproval totals { cash card other refunds net saleCount cashRefunds cardRefunds otherRefunds cashRounding } } closedByUserName reopenedByUserName } }";
2803
+ export declare const POS_STORE_DAYS_QUERY = "query PosStoreDays($input: PosStoreDayListInput!) { posStoreDays(input: $input) { totalItems items { id stockLocationId businessDay timeZone startsAt endsAt status totalsFinal totals { currencyCode sessionCount uncountedCount openingFloat expectedCash countedCash cashOverShort cash card other refunds net saleCount cashRefunds cardRefunds otherRefunds cashRounding } openSessionCount pendingCount uncountedCount closedAt closedByUserId closedByCredential closeNote closeCount reopenedAt reopenedByUserId reopenNote } } }";
2804
+ export declare const CLOSE_POS_STORE_DAY_MUTATION = "mutation ClosePosStoreDay($input: ClosePosStoreDayInput!) { closePosStoreDay(input: $input) { id stockLocationId businessDay timeZone startsAt endsAt status totalsFinal totals { currencyCode sessionCount uncountedCount openingFloat expectedCash countedCash cashOverShort cash card other refunds net saleCount cashRefunds cardRefunds otherRefunds cashRounding } openSessionCount pendingCount uncountedCount closedAt closedByUserId closedByCredential closeNote closeCount reopenedAt reopenedByUserId reopenNote sessions { sessionId registerId registerName zNumber status closeSource openedAt closedAt openingFloat expectedCash countedCash cashOverShort varianceApproval totals { cash card other refunds net saleCount cashRefunds cardRefunds otherRefunds cashRounding } } closedByUserName reopenedByUserName } }";
2805
+ export declare const REOPEN_POS_STORE_DAY_MUTATION = "mutation ReopenPosStoreDay($input: ReopenPosStoreDayInput!) { reopenPosStoreDay(input: $input) { id stockLocationId businessDay timeZone startsAt endsAt status totalsFinal totals { currencyCode sessionCount uncountedCount openingFloat expectedCash countedCash cashOverShort cash card other refunds net saleCount cashRefunds cardRefunds otherRefunds cashRounding } openSessionCount pendingCount uncountedCount closedAt closedByUserId closedByCredential closeNote closeCount reopenedAt reopenedByUserId reopenNote sessions { sessionId registerId registerName zNumber status closeSource openedAt closedAt openingFloat expectedCash countedCash cashOverShort varianceApproval totals { cash card other refunds net saleCount cashRefunds cardRefunds otherRefunds cashRounding } } closedByUserName reopenedByUserName } }";
2806
+ export declare const POS_SESSION_LIST_QUERY = "query PosRegisterSessionList($options: PosRegisterSessionListOptions) { posRegisterSessions(options: $options) { totalItems items { id registerId deviceId openedByStaffId openingFloat status expectedCash countedCash cashOverShort totals openedAt closedAt closedByStaffId blindCount varianceThreshold varianceApproval varianceApprovedByStaffId varianceApprovedAt } } }";
549
2807
  export declare const RECORD_POS_CASH_MOVEMENT_MUTATION = "mutation RecordPosCashMovement($input: RecordPosCashMovementInput!, $staffToken: String) { recordPosCashMovement(input: $input, staffToken: $staffToken) { id sessionId type amount reason orderId createdAt } }";
2808
+ export declare const POS_DRAWER_MOVEMENTS_QUERY = "query PosDrawerMovements($sessionId: ID!, $skip: Int, $take: Int) { posDrawerMovements(sessionId: $sessionId, skip: $skip, take: $take) { totalItems items { id type amount balanceAfter reason staffId staffName approvedByStaffId approvedByStaffName orderId orderCode receiptNumber createdAt } summary { openingFloat cashSales cashRefunds cashRounding paidIn paidOut safeDrops floatAdjustments noSaleCount expectedCash movementCount } } }";
550
2809
  export declare const POS_CREATE_CART_MUTATION = "mutation PosCreateCart($registerId: ID) { posCreateCart(registerId: $registerId) { id code state currencyCode total totalWithTax couponCodes\n lines { id quantity productVariant { id } linePriceWithTax }\n surcharges { description sku price priceWithTax taxRate } } }";
551
2810
  export declare const POS_ADD_ITEM_MUTATION = "mutation PosAddItem($input: PosAddItemInput!) { posAddItem(input: $input) { id code state currencyCode total totalWithTax couponCodes\n lines { id quantity productVariant { id } linePriceWithTax }\n surcharges { description sku price priceWithTax taxRate } } }";
552
2811
  export declare const POS_APPLY_DISCOUNT_MUTATION = "mutation PosApplyDiscount($input: PosApplyDiscountInput!, $staffToken: String) { posApplyDiscount(input: $input, staffToken: $staffToken) { id code state currencyCode total totalWithTax couponCodes\n lines { id quantity productVariant { id } linePriceWithTax }\n surcharges { description sku price priceWithTax taxRate } } }";
553
2812
  export declare const POS_APPLY_COUPON_CODE_MUTATION = "mutation PosApplyCouponCode($input: PosCouponCodeInput!) { posApplyCouponCode(input: $input) { id code state currencyCode total totalWithTax couponCodes\n lines { id quantity productVariant { id } linePriceWithTax }\n surcharges { description sku price priceWithTax taxRate } } }";
554
2813
  export declare const POS_REMOVE_COUPON_CODE_MUTATION = "mutation PosRemoveCouponCode($input: PosCouponCodeInput!) { posRemoveCouponCode(input: $input) { id code state currencyCode total totalWithTax couponCodes\n lines { id quantity productVariant { id } linePriceWithTax }\n surcharges { description sku price priceWithTax taxRate } } }";
2814
+ export declare const POS_ADD_CUSTOM_ITEM_MUTATION = "mutation PosAddCustomItem($input: PosAddCustomItemInput!, $staffToken: String, $approvalToken: String) { posAddCustomItem(input: $input, staffToken: $staffToken, approvalToken: $approvalToken) { id code state currencyCode total totalWithTax couponCodes\n lines { id quantity productVariant { id } linePriceWithTax }\n surcharges { description sku price priceWithTax taxRate } lines { id customFields { posCustomItemName } } } }";
2815
+ export declare const POS_SET_ORDER_NOTE_MUTATION = "mutation PosSetOrderNote($input: PosSetOrderNoteInput!, $staffToken: String) { posSetOrderNote(input: $input, staffToken: $staffToken) { id code state currencyCode total totalWithTax couponCodes\n lines { id quantity productVariant { id } linePriceWithTax }\n surcharges { description sku price priceWithTax taxRate } customFields { posOrderNote } lines { id customFields { posCustomItemName posLineNote } } } }";
2816
+ export declare const POS_SET_LINE_NOTE_MUTATION = "mutation PosSetLineNote($input: PosSetLineNoteInput!, $staffToken: String) { posSetLineNote(input: $input, staffToken: $staffToken) { id code state currencyCode total totalWithTax couponCodes\n lines { id quantity productVariant { id } linePriceWithTax }\n surcharges { description sku price priceWithTax taxRate } customFields { posOrderNote } lines { id customFields { posCustomItemName posLineNote } } } }";
2817
+ export declare const POS_TILL_SALE_DETAILS_QUERY = "query PosTillSaleDetails($id: ID!) { order(id: $id) { id customFields { isPosOrder posOrderNote } lines { id customFields { posCustomItemName posLineNote } } } }";
2818
+ export declare const POS_CLEAR_CART_MUTATION = "mutation PosClearCart($input: PosClearCartInput!, $staffToken: String) { posClearCart(input: $input, staffToken: $staffToken) { orderId orderCode } }";
555
2819
  export declare const POS_COMPLETE_SALE_MUTATION = "mutation PosCompleteSale($input: PosCompleteSaleInput!, $staffToken: String) { posCompleteSale(input: $input, staffToken: $staffToken) { orderId orderCode receiptNumber state } }";
556
2820
  export declare const POS_TENDER_CASH_MUTATION = "mutation PosTenderCash($input: PosTenderCashInput!, $staffToken: String) { posTenderCash(input: $input, staffToken: $staffToken) { orderId paymentId covered outstanding change } }";
557
2821
  export declare const POS_TENDER_CARD_MUTATION = "mutation PosTenderCard($input: PosTenderCardInput!, $staffToken: String) { posTenderCard(input: $input, staffToken: $staffToken) { orderId paymentId covered outstanding change } }";
558
2822
  export declare const POS_TENDER_STORED_VALUE_MUTATION = "mutation PosTenderStoredValue($input: PosTenderStoredValueInput!, $staffToken: String) { posTenderStoredValue(input: $input, staffToken: $staffToken) { orderId paymentId covered outstanding change } }";
559
2823
  export declare const POS_TENDER_MANUAL_MUTATION = "mutation PosTenderManual($input: PosTenderManualInput!, $staffToken: String) { posTenderManual(input: $input, staffToken: $staffToken) { orderId paymentId covered outstanding change } }";
560
2824
  export declare const POS_REFUND_MUTATION = "mutation PosRefund($input: PosRefundInput!, $staffToken: String) { posRefund(input: $input, staffToken: $staffToken) { orderId refundId state } }";
561
- export declare const POS_DEVICES_QUERY = "query PosDevices { posDevices { id stockLocationId registerId label status paired lastSeenAt } }";
2825
+ export declare const POS_DEVICES_QUERY = "query PosDevices { posDevices { id stockLocationId registerId label status paired lastSeenAt mollieTerminalId createdAt updatedAt } }";
562
2826
  export declare const POS_DEVICE_QUERY = "query PosDevice($id: ID!) { posDevice(id: $id) { lastSeenAt } }";
563
2827
  export declare const POS_PAIRING_CODE_MUTATION = "mutation GeneratePosPairingCode($deviceId: ID!) { generatePosPairingCode(deviceId: $deviceId) { code expiresAt } }";
564
- export declare const REVOKE_POS_DEVICE_MUTATION = "mutation RevokePosDevice($deviceId: ID!) { revokePosDevice(deviceId: $deviceId) { id stockLocationId registerId label status paired lastSeenAt } }";
2828
+ export declare const POS_PAIRING_CODE_WITH_VALIDITY_MUTATION = "mutation GeneratePosPairingCodeWithValidity($deviceId: ID!, $validity: PosPairingCodeValidity!) { generatePosPairingCode(deviceId: $deviceId, validity: $validity) { code expiresAt } }";
2829
+ export declare const REVOKE_POS_DEVICE_MUTATION = "mutation RevokePosDevice($deviceId: ID!) { revokePosDevice(deviceId: $deviceId) { id stockLocationId registerId label status paired lastSeenAt mollieTerminalId createdAt updatedAt } }";
2830
+ export declare const POS_DEVICE_DETAIL_QUERY = "query PosDeviceDetail($id: ID!) { posDevice(id: $id) { id stockLocationId registerId label status paired lastSeenAt mollieTerminalId createdAt updatedAt } }";
2831
+ export declare const ASSIGN_POS_DEVICE_LOCATION_MUTATION = "mutation AssignPosDeviceLocation($deviceId: ID!, $stockLocationId: ID!) { assignPosDeviceLocation(deviceId: $deviceId, stockLocationId: $stockLocationId) { id stockLocationId registerId label status paired lastSeenAt mollieTerminalId createdAt updatedAt } }";
2832
+ export declare const ASSIGN_POS_DEVICE_REGISTER_MUTATION = "mutation AssignPosDeviceRegister($deviceId: ID!, $registerId: ID!) { assignPosDeviceRegister(deviceId: $deviceId, registerId: $registerId) { id stockLocationId registerId label status paired lastSeenAt mollieTerminalId createdAt updatedAt } }";
2833
+ export declare const ASSIGN_POS_DEVICE_TERMINAL_MUTATION = "mutation AssignPosDeviceMollieTerminal($deviceId: ID!, $terminalId: String!) { assignPosDeviceMollieTerminal(deviceId: $deviceId, terminalId: $terminalId) { id stockLocationId registerId label status paired lastSeenAt mollieTerminalId createdAt updatedAt } }";
2834
+ export declare const ASSIGN_POS_DEVICE_LOCATION_WITH_REGISTER_MUTATION = "mutation AssignPosDeviceLocationWithRegister($deviceId: ID!, $stockLocationId: ID!, $registerId: ID!) { assignPosDeviceLocation(deviceId: $deviceId, stockLocationId: $stockLocationId, registerId: $registerId) { id stockLocationId registerId label status paired lastSeenAt mollieTerminalId createdAt updatedAt } }";
2835
+ export declare const CLEAR_POS_DEVICE_TERMINAL_MUTATION = "mutation ClearPosDeviceMollieTerminal($deviceId: ID!) { clearPosDeviceMollieTerminal(deviceId: $deviceId) { id stockLocationId registerId label status paired lastSeenAt mollieTerminalId createdAt updatedAt } }";
2836
+ export declare const POS_OPEN_SESSION_FOR_DEVICE_QUERY = "query PosOpenSessionForDevice($deviceId: ID!) { posOpenSessionForDevice(deviceId: $deviceId) { id registerId deviceId openedByStaffId openingFloat status expectedCash countedCash cashOverShort totals openedAt closedAt } }";
2837
+ export declare const CREATE_POS_DEVICE_MUTATION = "mutation CreatePosDevice($input: CreatePosDeviceInput!) { createPosDevice(input: $input) { id stockLocationId registerId label status paired lastSeenAt mollieTerminalId createdAt updatedAt } }";
2838
+ export declare const CREATE_POS_DEVICE_KIND_MUTATION = "mutation CreatePosDeviceOfKind($input: CreatePosDeviceInput!) { createPosDevice(input: $input) { id stockLocationId registerId label status paired lastSeenAt mollieTerminalId createdAt updatedAt kind } }";
2839
+ export declare const POS_DEVICE_FLEET_QUERY = "query PosDeviceFleet($stockLocationId: ID) { posDeviceFleet(stockLocationId: $stockLocationId) { device { id stockLocationId registerId label status paired lastSeenAt mollieTerminalId createdAt updatedAt heartbeatAt lockedAt silentSince kind } health { status lastHeardAt silentSince } report { appVersion buildNumber runtimeVersion updateId updateChannel platform connection outboxPending offlineSalesPending offlineSalesRefused printer reportedAt } openDrawer { sessionId registerId openedAt openedByStaffName } lockedByUserName } }";
2840
+ export declare const LOCK_POS_DEVICE_MUTATION = "mutation LockPosDevice($deviceId: ID!) { lockPosDevice(deviceId: $deviceId) { id stockLocationId registerId label status paired lastSeenAt mollieTerminalId createdAt updatedAt heartbeatAt lockedAt silentSince kind } }";
2841
+ export declare const UNLOCK_POS_DEVICE_MUTATION = "mutation UnlockPosDevice($deviceId: ID!) { unlockPosDevice(deviceId: $deviceId) { id stockLocationId registerId label status paired lastSeenAt mollieTerminalId createdAt updatedAt heartbeatAt lockedAt silentSince kind } }";
565
2842
  export declare const POS_RECEIPT_NUMBERING_QUERY = "query PosReceiptNumberingConfig { posReceiptNumberingConfig { prefix suffix digits } }";
566
2843
  export declare const UPDATE_POS_RECEIPT_NUMBERING_MUTATION = "mutation UpdatePosReceiptNumberingConfig($input: UpdatePosReceiptNumberingConfigInput!) { updatePosReceiptNumberingConfig(input: $input) { prefix suffix digits } }";
2844
+ export declare const POS_SETTINGS_QUERY = "query PosSettings { getPosConfig { enabled cashPaymentMethodCode cardPaymentMethodCode inStoreShippingMethodId fulfillmentProfileId defaultStockLocationId cashRoundingMode hasMollieKey maskedMollieApiKey } }";
2845
+ export declare const UPDATE_POS_SETTINGS_MUTATION = "mutation UpdatePosSettings($input: UpdatePosConfigInput!) { updatePosConfig(input: $input) { enabled cashPaymentMethodCode cardPaymentMethodCode inStoreShippingMethodId fulfillmentProfileId defaultStockLocationId cashRoundingMode hasMollieKey maskedMollieApiKey } }";
2846
+ export declare const POS_MOLLIE_TERMINALS_QUERY = "query PosMollieTerminals { posMollieTerminals { terminalId description status brand model serialNumber currency } }";
2847
+ export declare const CREATE_POS_MOLLIE_PAIRING_CODE_MUTATION = "mutation CreatePosMollieTerminalPairingCode { createPosMollieTerminalPairingCode { pairingCodeId code qrCodeSvg expiresAt } }";
2848
+ export declare const REVOKE_POS_MOLLIE_PAIRING_CODE_MUTATION = "mutation RevokePosMollieTerminalPairingCode($pairingCodeId: String!) { revokePosMollieTerminalPairingCode(pairingCodeId: $pairingCodeId) }";
2849
+ export declare const POS_CASH_CONTROLS_QUERY = "query PosCashControls { getPosConfig { cashControls { blindCount varianceThreshold } } }";
2850
+ export declare const SET_POS_CASH_CONTROLS_MUTATION = "mutation SetPosCashControls($input: PosCashControlsInput!) { setPosCashControls(input: $input) { blindCount varianceThreshold } }";
2851
+ export declare const POS_IDLE_LOCK_QUERY = "query PosIdleLock { getPosConfig { idleLockMinutes } }";
2852
+ export declare const SET_POS_IDLE_LOCK_MUTATION = "mutation SetPosIdleLock($input: UpdatePosConfigInput!) { updatePosConfig(input: $input) { idleLockMinutes } }";
2853
+ export declare const POS_RECEIPT_SETTINGS_QUERY = "query PosReceiptSettings { getPosConfig { receipt { configured showStoreName showAddress showPhone showVatNumber headerLines footerLines taxDisplay identity { storeName addressLines phone vatNumber registrationNumber } } } }";
2854
+ export declare const SET_POS_RECEIPT_SETTINGS_MUTATION = "mutation SetPosReceiptSettings($input: PosReceiptSettingsInput!) { setPosReceiptSettings(input: $input) { configured showStoreName showAddress showPhone showVatNumber headerLines footerLines taxDisplay identity { storeName addressLines phone vatNumber registrationNumber } } }";
2855
+ export declare const POS_RECEIPT_PREVIEW_QUERY = "query PosReceiptPreview($input: PosReceiptSettingsInput) { posReceiptPreview(input: $input) { kind orderId orderCode receiptNumber issuedAt language locale timeZone currencyCode taxDisplay header { storeName addressLines phone vatNumber registrationNumber extraLines } cashierName registerName lines { orderLineId name sku quantity unitPrice amount taxRate discounts { kind description amount } note ships } subtotal adjustments { kind description amount } taxes { description rate base amount } total tenders { kind exchange methodName amount tendered cashRounding change } changeDue refunds { kind exchange methodName amount refundedAt } orderNote delivery { name addressLines methodName } footerLines thankYou scanCode } }";
2856
+ export declare const POS_RECEIPT_QUERY = "query PosReceipt($orderId: ID!) { posReceipt(orderId: $orderId) { kind orderId orderCode receiptNumber issuedAt language locale timeZone currencyCode taxDisplay header { storeName addressLines phone vatNumber registrationNumber extraLines } cashierName registerName lines { orderLineId name sku quantity unitPrice amount taxRate discounts { kind description amount } note ships } subtotal adjustments { kind description amount } taxes { description rate base amount } total tenders { kind exchange methodName amount tendered cashRounding change } changeDue refunds { kind exchange methodName amount refundedAt } orderNote delivery { name addressLines methodName } footerLines thankYou scanCode } }";
2857
+ export declare const POS_RECEIPT_SHARING_QUERY = "query PosReceiptSharing($orderId: ID!) { posReceiptSharing(orderId: $orderId) { available enabled ttlDays links { variant state url issuedAt expiresAt revokedAt revokeReason } receiptCopies giftPrints } }";
2858
+ export declare const POS_ISSUE_RECEIPT_LINK_MUTATION = "mutation PosIssueReceiptLink($orderId: ID!, $variant: PosReceiptVariant!) { posIssueReceiptLink(orderId: $orderId, variant: $variant) { variant state url issuedAt expiresAt revokedAt revokeReason } }";
2859
+ export declare const REVOKE_POS_RECEIPT_LINK_MUTATION = "mutation RevokePosReceiptLink($orderId: ID!, $variant: PosReceiptVariant!) { revokePosReceiptLink(orderId: $orderId, variant: $variant) { variant state url issuedAt expiresAt revokedAt revokeReason } }";
2860
+ export declare const POS_PRINT_RECEIPT_MUTATION = "mutation PosPrintReceipt($input: PosPrintReceiptInput!, $staffToken: String) { posPrintReceipt(input: $input, staffToken: $staffToken) { orderId variant printNumber copy receipt { kind orderId orderCode receiptNumber issuedAt language locale timeZone currencyCode taxDisplay header { storeName addressLines phone vatNumber registrationNumber extraLines } cashierName registerName lines { orderLineId name sku quantity unitPrice amount taxRate discounts { kind description amount } note ships } subtotal adjustments { kind description amount } taxes { description rate base amount } total tenders { kind exchange methodName amount tendered cashRounding change } changeDue refunds { kind exchange methodName amount refundedAt } orderNote delivery { name addressLines methodName } footerLines thankYou scanCode link { variant url issuedAt expiresAt } copy { number printedAt } } giftReceipt { orderId orderCode receiptNumber issuedAt language locale timeZone header { storeName addressLines phone vatNumber registrationNumber extraLines } registerName lines { orderLineId name sku quantity } footerLines thankYou scanCode link { variant url issuedAt expiresAt } copy { number printedAt } } } }";
2861
+ export declare const POS_GIFT_RECEIPT_QUERY = "query PosGiftReceipt($orderId: ID!) { posReceipt(orderId: $orderId) { gift { orderId orderCode receiptNumber issuedAt language locale timeZone header { storeName addressLines phone vatNumber registrationNumber extraLines } registerName lines { orderLineId name sku quantity } footerLines thankYou scanCode link { variant url issuedAt expiresAt } copy { number printedAt } } } }";
2862
+ export declare const POS_DIGITAL_RECEIPTS_QUERY = "query PosDigitalReceipts { getPosConfig { receipt { publicLink publicLinkAvailable } } }";
2863
+ export declare const POS_RECEIPT_ACCOUNT_CLAIM_QUERY = "query PosReceiptAccountClaim { getPosConfig { receipt { accountClaim accountClaimAvailable } } }";
2864
+ export declare const POS_EMAIL_RECEIPT_MUTATION = "mutation PosEmailReceipt($input: PosEmailReceiptInput!, $staffToken: String) { posEmailReceipt(input: $input, staffToken: $staffToken) { orderId source sentForSale } }";
2865
+ export declare const POS_DAY_CONTROLS_QUERY = "query PosDayControls { getPosConfig { id dayControls { businessDayStartsAt closingTime autoCloseAfterClosingMinutes autoCloseIdleMinutes } } }";
2866
+ export declare const SET_POS_DAY_CONTROLS_MUTATION = "mutation SetPosDayControls($input: PosDayControlsInput!) { setPosDayControls(input: $input) { businessDayStartsAt closingTime autoCloseAfterClosingMinutes autoCloseIdleMinutes } }";
2867
+ export declare const POS_SETUP_READINESS_QUERY = "query PosSetupReadiness { posSetupReadiness { ready checks { check ok required reason } } }";
2868
+ export declare const POS_CUSTOM_ITEM_POLICY_QUERY = "query PosCustomItemPolicy { posCustomItemPolicy { enabled available maxUnitPrice cashierLimit amountsIncludeTax currencyCode taxCategories { id name taxRate } taxCategoryChoices { id name taxRate } } }";
2869
+ export declare const SET_POS_CUSTOM_ITEM_POLICY_MUTATION = "mutation SetPosCustomItemPolicy($input: PosCustomItemPolicyInput!) { setPosCustomItemPolicy(input: $input) { enabled available maxUnitPrice cashierLimit amountsIncludeTax currencyCode taxCategories { id name taxRate } taxCategoryChoices { id name taxRate } } }";
2870
+ export declare const POS_STAFF_LIST_QUERY = "query PosStaffList { posStaffList { id name role active administratorId locale createdAt updatedAt } }";
2871
+ export declare const POS_STAFF_QUERY = "query PosStaff($id: ID!) { posStaff(id: $id) { id name role active administratorId locale createdAt updatedAt } }";
2872
+ export declare const CREATE_POS_STAFF_MUTATION = "mutation CreatePosStaff($input: CreatePosStaffInput!) { createPosStaff(input: $input) { id name role active administratorId locale createdAt updatedAt } }";
2873
+ export declare const UPDATE_POS_STAFF_MUTATION = "mutation UpdatePosStaff($id: ID!, $input: UpdatePosStaffInput!) { updatePosStaff(id: $id, input: $input) { id name role active administratorId locale createdAt updatedAt } }";
2874
+ export declare const SET_POS_STAFF_PIN_MUTATION = "mutation SetPosStaffPin($id: ID!, $pin: String!) { setPosStaffPin(id: $id, pin: $pin) }";
2875
+ export declare const POS_STAFF_GRANTS_QUERY = "query PosStaffGrants($id: ID!) { posStaff(id: $id) { id role grants } }";
2876
+ export declare const POS_STAFF_GRANTS_LIST_QUERY = "query PosStaffGrantsList { posStaffList { id role grants } }";
2877
+ export declare const SET_POS_STAFF_GRANTS_MUTATION = "mutation SetPosStaffGrants($id: ID!, $grants: [PosStaffGrant!]!) { setPosStaffGrants(id: $id, grants: $grants) { id role grants } }";
2878
+ export declare const POS_STAFF_GRANT_VALUES_QUERY = "query PosStaffGrantValues { __type(name: \"PosStaffGrant\") { enumValues { name } } }";
567
2879
  export declare function createPosModule(transport: Transport): PosModule;