sinfactura-types 1.10.332 → 1.10.334

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.
@@ -27,6 +27,23 @@ declare global {
27
27
  * a mutation of this one, so the original booking's history survives.
28
28
  */
29
29
  type AppointmentStatus = 'REQUESTED' | 'CONFIRMED' | 'CHECKED_IN' | 'IN_PROGRESS' | 'COMPLETED' | 'CANCELLED' | 'NO_SHOW' | 'RESCHEDULED';
30
+ /**
31
+ * Why a `CANCELLED` booking is not an ordinary cancellation — see
32
+ * {@link Appointment.cancelReason}, which carries the full rule.
33
+ *
34
+ * - `'recurrence-exception'` — the operator added this date to the series'
35
+ * skip list («omitir fechas»). Omitting a date from a series is not a
36
+ * cancellation of a booking, and a client must not toast it as one.
37
+ *
38
+ * ⚠️ **Type-only, deliberately — unlike {@link SERIES_SCOPES} and
39
+ * `APPOINTMENT_ICS_FEED_SCOPES`, which are runtime tuples.** Those two are
40
+ * INBOUND vocabularies: a string arrives from outside the type system and has
41
+ * to be tested for membership. This one is written by the api and only ever
42
+ * read, so there is nothing to validate at runtime and a published tuple
43
+ * would invite a client to treat the set as closed — which is the opposite of
44
+ * the "treat an unrecognised member as non-ordinary" rule above.
45
+ */
46
+ type AppointmentCancelReason = 'recurrence-exception';
30
47
  /**
31
48
  * A scheduled booking. Phase 1 is an INTERNAL operations tool: every frame
32
49
  * is operator-audience, and no customer-facing booking surface consumes
@@ -180,6 +197,38 @@ declare global {
180
197
  rescheduledFrom?: string;
181
198
  cancelledAt?: number;
182
199
  cancelledBy?: string;
200
+ /**
201
+ * WHY this booking was cancelled, where the cause is not an ordinary
202
+ * cancellation.
203
+ *
204
+ * ⚠️ **Absence is the meaningful value: no `cancelReason` means a REAL
205
+ * cancellation** — the operator (or the customer) dropped this booking, and
206
+ * a client should notify exactly as it always has. The field exists because
207
+ * a `CANCELLED` row alone cannot distinguish that from a series being
208
+ * reshaped, so every other operator on the store socket got told "an
209
+ * appointment was cancelled" for a date that was merely omitted.
210
+ *
211
+ * ⚠️ **Written by exactly ONE path**: the skip-list leg of
212
+ * `POST /appointments/{id}` with `scope: 'series'` — adding a date to
213
+ * {@link Appointment.recurrenceExceptions} cancels the live occurrence
214
+ * standing on it and stamps `'recurrence-exception'`. Every other cancel
215
+ * writer (the operator `DELETE`, the customer-facing web `DELETE`, a scoped
216
+ * status edit) leaves the attribute ABSENT rather than writing a default, so
217
+ * a row without it is not a row whose reason was lost.
218
+ *
219
+ * ⚠️ **Forward-only** — rows cancelled before this shipped carry nothing,
220
+ * and nothing backfills them. A historical `CANCELLED` occurrence of a
221
+ * skipped date is therefore indistinguishable from a real cancellation, by
222
+ * design.
223
+ *
224
+ * ⚠️ **NOT `cancelledBy`**, which is the ACTOR's user id and is stamped on
225
+ * every cancellation including this one. Who, and why, are two fields.
226
+ *
227
+ * A union rather than a single literal so a future cause is additive; treat
228
+ * an unrecognised member as "some non-ordinary cause" rather than falling
229
+ * back to the cancellation toast.
230
+ */
231
+ cancelReason?: AppointmentCancelReason;
183
232
  checkedInAt?: number;
184
233
  completedAt?: number;
185
234
  createdAt: number;
package/dist/invoice.d.ts CHANGED
@@ -205,6 +205,27 @@ declare global {
205
205
  parentServiceOrderId?: string;
206
206
  attemptedCbteNro?: number;
207
207
  attemptedCbteFch?: string;
208
+ /**
209
+ * The punto de venta the attempt recorded in `attemptedCbteNro` was SUBMITTED
210
+ * under. ARCA numbers each `(PtoVta, CbteTipo)` as its own sequence, so a
211
+ * voucher is named by the triple (punto de venta, voucher class, number) and
212
+ * the recorded number alone names nothing. This field records the first
213
+ * member. ⚠️ The second — the voucher class the attempt was submitted as — is
214
+ * NOT recorded beside the marker: the reconcile reads the row's `invoiceType`
215
+ * for it, which is the submitted class for an attempt made by the issue path,
216
+ * since that path writes both in the same row from the same voucher. Written in
217
+ * the same write as `attemptedCbteNro`, by both of its writers (the issue
218
+ * path's pending-row write and the outage drain's pre-submit marker), and
219
+ * removed wherever that marker is removed.
220
+ *
221
+ * ABSENT MEANS UNKNOWN — never "equal to `pointOfSale`". The store's punto de
222
+ * venta can be edited between an attempt and its reconciliation, and an
223
+ * attempt made by a drain pass went out under the value live at THAT moment,
224
+ * not the row's. Forward-only: a row that recorded its attempt before this
225
+ * field existed carries the marker without it, and the drain holds such a row
226
+ * for an operator rather than guessing a sequence to query.
227
+ */
228
+ attemptedPointOfSale?: number;
208
229
  invoicePrinted?: boolean;
209
230
  /**
210
231
  * Server-derived ms epoch, stamped by the WSS `ack` handler on an
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.10.332",
3
+ "version": "1.10.334",
4
4
  "description": "Shared wire and entity contracts for the SINFACTURA platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",