sinfactura-types 1.10.416 → 1.10.418

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.
@@ -195,6 +195,28 @@ declare global {
195
195
  rescheduledTo?: string;
196
196
  /** On a replacement row: the `RESCHEDULED` appointment it superseded. */
197
197
  rescheduledFrom?: string;
198
+ /**
199
+ * The service ticket (`ServiceOrder.serviceOrderId`) staff opened FOR this
200
+ * visit. One ticket per visit, or none; the ticket points back through
201
+ * `ServiceOrder.appointmentId`.
202
+ *
203
+ * ⚠️ **Written only by a staff click** — `POST /services` `mode: 'create'`
204
+ * carrying `appointment`, on a `RECURRING_VISIT` that is not `CANCELLED`,
205
+ * `NO_SHOW` or `RESCHEDULED`. Nothing mints a ticket on its own: not the
206
+ * series expansion, not a sweep, not a future occurrence. Every other
207
+ * booking never carries the field. A second click returns the ticket
208
+ * already linked rather than minting another.
209
+ *
210
+ * ⚠️ **A reschedule carries it onto the replacement row** and re-points the
211
+ * ticket at the new booking; the `RESCHEDULED` row keeps its copy as
212
+ * history. **Cancelling, skipping («omitir fechas») or marking `NO_SHOW`
213
+ * keeps it here too, but unlinks the ticket**: the ticket's own
214
+ * `appointmentId` is removed so it no longer claims a visit that will not
215
+ * happen, and it stays open for the operator to close or keep. So the
216
+ * link is live only when BOTH sides name each other — read the ticket's
217
+ * `appointmentId`, not this field alone, to know whether it still holds.
218
+ */
219
+ serviceOrderId?: string;
198
220
  cancelledAt?: number;
199
221
  cancelledBy?: string;
200
222
  /**
package/dist/cjs/order.js CHANGED
@@ -121,6 +121,9 @@ exports.isTerminalOrderFulfilmentStatus = isTerminalOrderFulfilmentStatus;
121
121
  * client that is retrying the wrong transition.
122
122
  * - `ORDER_ILLEGAL_TRANSITION` · 409 · `ORDER_VERSION_CONFLICT` · 409
123
123
  * - `CUSTOMER_NOT_FOUND` · 404 · `ORDER_HAS_NO_CUSTOMER` · 409
124
+ * - `CUSTOMER_MERGED` · 409 — the order's customer was folded into another, so
125
+ * its balance can no longer move; `data.mergedInto` names the survivor
126
+ * (`CustomerMergedRefusalData`). Nothing was written.
124
127
  * - `FX_CONVERSION_UNAVAILABLE` · 503 — no rate for the order's currency pair.
125
128
  * - `ROLE_FORBIDDEN` · 403
126
129
  *
@@ -148,6 +151,7 @@ exports.ORDER_ERROR_CODES = [
148
151
  'ORDER_ILLEGAL_TRANSITION',
149
152
  'ORDER_VERSION_CONFLICT',
150
153
  'CUSTOMER_NOT_FOUND',
154
+ 'CUSTOMER_MERGED',
151
155
  'ORDER_HAS_NO_CUSTOMER',
152
156
  'FX_CONVERSION_UNAVAILABLE',
153
157
  'ROLE_FORBIDDEN',
@@ -199,6 +199,15 @@ exports.MAX_SERVICE_PICTURES = 20;
199
199
  * (Ley 24.240 art. 23 sets 30). `0` means "not stated" and is accepted. The
200
200
  * same refusal, from the same rule, is answered by `/service-templates`
201
201
  * create and edit.
202
+ * - `APPOINTMENT_*` — `mode: 'create'` with `appointment` (a ticket opened
203
+ * from a maintenance visit). `APPOINTMENT_NOT_FOUND` (404) — no booking at
204
+ * that id/date/startTime. `APPOINTMENT_NOT_LINKABLE` (409) — the booking is
205
+ * not a `RECURRING_VISIT`. `APPOINTMENT_NOT_OPEN` (409) — it is `CANCELLED`,
206
+ * `NO_SHOW` or `RESCHEDULED`; reload and open the ticket from the live
207
+ * booking. `APPOINTMENT_CUSTOMER_MISMATCH` (409) — `customerId` is not the
208
+ * booking's customer. `APPOINTMENT_VERSION_CONFLICT` (409) — the booking
209
+ * changed while the ticket was being opened; nothing was linked, reload and
210
+ * retry, and a retry after a concurrent click returns that click's ticket.
202
211
  * - `VALIDATION_FAILED` · 400 — the body or query failed its schema.
203
212
  *
204
213
  * ⚠️ `ROLE_FORBIDDEN` here is the router's own role check (a print agent, or a
@@ -231,6 +240,12 @@ exports.SERVICE_ORDER_ERROR_CODES = [
231
240
  'SERVICE_ORDER_BILLABLE_FROZEN',
232
241
  'SERVICE_ORDER_EDIT_CHANGED',
233
242
  'SERVICE_ORDER_DISABLED_STATE_UNCHANGED',
243
+ // Intake from a maintenance visit (`appointment`)
244
+ 'APPOINTMENT_NOT_FOUND',
245
+ 'APPOINTMENT_NOT_LINKABLE',
246
+ 'APPOINTMENT_NOT_OPEN',
247
+ 'APPOINTMENT_CUSTOMER_MISMATCH',
248
+ 'APPOINTMENT_VERSION_CONFLICT',
234
249
  // Lifecycle
235
250
  'SERVICE_ORDER_TERMINAL',
236
251
  'SERVICE_ORDER_DISABLED',
@@ -572,6 +572,58 @@ declare global {
572
572
  * Nothing was written.
573
573
  */
574
574
  | 'CUSTOMER_MERGE_SOURCE_HAS_PENDING_MERGE';
575
+ /**
576
+ * The refusal every operator write that MOVES `Customer.balance` answers when
577
+ * the customer it names was folded into another by a merge (the row carries
578
+ * `mergedInto`): `409`, nothing written, `data` is
579
+ * {@link CustomerMergedRefusalData}. Re-issue the movement against
580
+ * `data.mergedInto`, the survivor, which now holds the balance.
581
+ *
582
+ * Answered by `POST /account` (a movement), `DELETE /account`, `POST` and
583
+ * `DELETE /payments/{source}/{paymentId}/link` (link with credit, unlink),
584
+ * and `POST /orders` (create, `mode: 'delivery'`, `mode: 'return'`).
585
+ *
586
+ * HOW it is decided differs by writer, and only the first kind covers a merge
587
+ * that lands after the handler's read:
588
+ * - by the write's own condition — every balance Update, and on order CREATE
589
+ * the CUSTOMER `lastBuy` item of the checkout transaction (the create also
590
+ * refuses early, on a consistent read, before it allocates an order id);
591
+ * - by a PRE-WRITE read — the unlink's owner-mismatch refusals (merge in
592
+ * progress, a third owner, an erased merged row, an unacknowledged
593
+ * `customer-merged` refund flag), decided off the credit row's owner before
594
+ * any write; the ACCOUNT delete then pins that owner, so a later re-point
595
+ * answers `LINK_LOCKED` / `concurrent-account-mutation` rather than this code.
596
+ *
597
+ * An unlink of a payment linked BEFORE a finished merge is not refused — it
598
+ * reverses on the survivor, whose ledger row it now is.
599
+ */
600
+ type CustomerBalanceWriteErrorCode = 'CUSTOMER_MERGED'
601
+ /**
602
+ * `DELETE /payments/{source}/{paymentId}/link` only: the credit row is a
603
+ * LEGACY row naming no customer, and the payment's customer was erased —
604
+ * so whether it had been merged first (and where its money went) is no
605
+ * longer provable. `409`, nothing written; `data` is absent.
606
+ */
607
+ | 'CUSTOMER_ANONYMIZED';
608
+ /**
609
+ * `data` on a `409 CUSTOMER_MERGED`.
610
+ *
611
+ * What to do depends on how the refused write addressed its customer: a
612
+ * write addressed BY CUSTOMER (`POST /account`) is re-issued against
613
+ * `mergedInto`; one addressed by an order, a ledger row or a payment cannot
614
+ * be re-targeted, and needs the merge to finish (`mergeState`) or a
615
+ * compensating movement.
616
+ */
617
+ interface CustomerMergedRefusalData {
618
+ /** The survivor — the customer the money belongs on now. */
619
+ mergedInto: string;
620
+ /**
621
+ * The merge as the merged row stands. ABSENT when an erasure has since
622
+ * removed the markers and `mergedInto` was recovered from the ledger row
623
+ * the merge re-pointed.
624
+ */
625
+ mergeState?: 'in-progress' | 'done';
626
+ }
575
627
  /**
576
628
  * The outcome of one `POST /customers { mode: 'merge' }` run.
577
629
  *
package/dist/order.d.ts CHANGED
@@ -1524,6 +1524,9 @@ export declare const isTerminalOrderFulfilmentStatus: (status: OrderFulfilmentSt
1524
1524
  * client that is retrying the wrong transition.
1525
1525
  * - `ORDER_ILLEGAL_TRANSITION` · 409 · `ORDER_VERSION_CONFLICT` · 409
1526
1526
  * - `CUSTOMER_NOT_FOUND` · 404 · `ORDER_HAS_NO_CUSTOMER` · 409
1527
+ * - `CUSTOMER_MERGED` · 409 — the order's customer was folded into another, so
1528
+ * its balance can no longer move; `data.mergedInto` names the survivor
1529
+ * (`CustomerMergedRefusalData`). Nothing was written.
1527
1530
  * - `FX_CONVERSION_UNAVAILABLE` · 503 — no rate for the order's currency pair.
1528
1531
  * - `ROLE_FORBIDDEN` · 403
1529
1532
  *
@@ -1542,6 +1545,6 @@ export declare const isTerminalOrderFulfilmentStatus: (status: OrderFulfilmentSt
1542
1545
  * `SUBSCRIPTION_READONLY`) sit on the order CREATE leg only: an edit is not a new
1543
1546
  * order, so `bareOrderPostHandler` routes past `requireMetered` entirely.
1544
1547
  */
1545
- export declare const ORDER_ERROR_CODES: readonly ["ORDER_NOT_FOUND", "ORDER_LOCKED", "ORDER_NOT_READY", "ORDER_DELIVERED_ANOTHER_DAY", "ORDER_DELIVERY_STATE_UNCHANGED", "ORDER_ILLEGAL_TRANSITION", "ORDER_VERSION_CONFLICT", "CUSTOMER_NOT_FOUND", "ORDER_HAS_NO_CUSTOMER", "FX_CONVERSION_UNAVAILABLE", "ROLE_FORBIDDEN", "INVALID_IDEMPOTENCY_KEY", "IDEMPOTENCY_KEY_REUSE", "IDEMPOTENCY_IN_PROGRESS", "IDEMPOTENCY_LOCK_CONTENTION", "IDEMPOTENCY_KEY_FAILED", "IDEMPOTENT_RESPONSE_NOT_CACHED"];
1548
+ export declare const ORDER_ERROR_CODES: readonly ["ORDER_NOT_FOUND", "ORDER_LOCKED", "ORDER_NOT_READY", "ORDER_DELIVERED_ANOTHER_DAY", "ORDER_DELIVERY_STATE_UNCHANGED", "ORDER_ILLEGAL_TRANSITION", "ORDER_VERSION_CONFLICT", "CUSTOMER_NOT_FOUND", "CUSTOMER_MERGED", "ORDER_HAS_NO_CUSTOMER", "FX_CONVERSION_UNAVAILABLE", "ROLE_FORBIDDEN", "INVALID_IDEMPOTENCY_KEY", "IDEMPOTENCY_KEY_REUSE", "IDEMPOTENCY_IN_PROGRESS", "IDEMPOTENCY_LOCK_CONTENTION", "IDEMPOTENCY_KEY_FAILED", "IDEMPOTENT_RESPONSE_NOT_CACHED"];
1546
1549
  export type OrderErrorCode = (typeof ORDER_ERROR_CODES)[number];
1547
1550
  export {};
package/dist/order.js CHANGED
@@ -115,6 +115,9 @@ export const isTerminalOrderFulfilmentStatus = (status) => ORDER_FULFILMENT_TRAN
115
115
  * client that is retrying the wrong transition.
116
116
  * - `ORDER_ILLEGAL_TRANSITION` · 409 · `ORDER_VERSION_CONFLICT` · 409
117
117
  * - `CUSTOMER_NOT_FOUND` · 404 · `ORDER_HAS_NO_CUSTOMER` · 409
118
+ * - `CUSTOMER_MERGED` · 409 — the order's customer was folded into another, so
119
+ * its balance can no longer move; `data.mergedInto` names the survivor
120
+ * (`CustomerMergedRefusalData`). Nothing was written.
118
121
  * - `FX_CONVERSION_UNAVAILABLE` · 503 — no rate for the order's currency pair.
119
122
  * - `ROLE_FORBIDDEN` · 403
120
123
  *
@@ -142,6 +145,7 @@ export const ORDER_ERROR_CODES = [
142
145
  'ORDER_ILLEGAL_TRANSITION',
143
146
  'ORDER_VERSION_CONFLICT',
144
147
  'CUSTOMER_NOT_FOUND',
148
+ 'CUSTOMER_MERGED',
145
149
  'ORDER_HAS_NO_CUSTOMER',
146
150
  'FX_CONVERSION_UNAVAILABLE',
147
151
  'ROLE_FORBIDDEN',
@@ -964,6 +964,32 @@ declare global {
964
964
  * linkage.
965
965
  */
966
966
  parentServiceOrderId?: string;
967
+ /**
968
+ * The visit (`Appointment.appointmentId`) this ticket was opened from —
969
+ * staff clicked «abrir orden» on a `RECURRING_VISIT`, and the booking
970
+ * carries this ticket back as `Appointment.serviceOrderId`.
971
+ *
972
+ * ⚠️ A ticket opened this way always starts `custody: 'pending_receipt'`:
973
+ * the equipment is still at the customer's site, and intake refuses
974
+ * `equipmentReceived: true` beside an `appointment`.
975
+ *
976
+ * ⚠️ **Live, not provenance.** A reschedule re-points all three fields at
977
+ * the replacement booking; cancelling, skipping or a `NO_SHOW` REMOVES all
978
+ * three, so a ticket never claims a visit that will not happen. Absent
979
+ * means "not tied to a visit" — including a ticket whose visit was
980
+ * called off.
981
+ */
982
+ appointmentId?: string;
983
+ /**
984
+ * The visit's `Appointment.date` (`YYYYMMDD`, Buenos Aires) — with
985
+ * {@link ServiceOrder.appointmentTime}, the pair that ADDRESSES the booking
986
+ * row, since `GET /appointments/{appointmentId}` needs both. Same stamp as
987
+ * `Order.appointmentDate`. Written and removed together with
988
+ * {@link ServiceOrder.appointmentId}.
989
+ */
990
+ appointmentDate?: number;
991
+ /** The visit's `Appointment.startTime` (`HHmm`). See {@link ServiceOrder.appointmentDate}. */
992
+ appointmentTime?: string;
967
993
  /**
968
994
  * A recorded fact only — nothing branches on it. `POST /services
969
995
  * {mode:'create'}` accepts it and stamps it when supplied, and no handler,
@@ -1216,12 +1242,21 @@ export declare const MAX_SERVICE_PICTURES = 20;
1216
1242
  * (Ley 24.240 art. 23 sets 30). `0` means "not stated" and is accepted. The
1217
1243
  * same refusal, from the same rule, is answered by `/service-templates`
1218
1244
  * create and edit.
1245
+ * - `APPOINTMENT_*` — `mode: 'create'` with `appointment` (a ticket opened
1246
+ * from a maintenance visit). `APPOINTMENT_NOT_FOUND` (404) — no booking at
1247
+ * that id/date/startTime. `APPOINTMENT_NOT_LINKABLE` (409) — the booking is
1248
+ * not a `RECURRING_VISIT`. `APPOINTMENT_NOT_OPEN` (409) — it is `CANCELLED`,
1249
+ * `NO_SHOW` or `RESCHEDULED`; reload and open the ticket from the live
1250
+ * booking. `APPOINTMENT_CUSTOMER_MISMATCH` (409) — `customerId` is not the
1251
+ * booking's customer. `APPOINTMENT_VERSION_CONFLICT` (409) — the booking
1252
+ * changed while the ticket was being opened; nothing was linked, reload and
1253
+ * retry, and a retry after a concurrent click returns that click's ticket.
1219
1254
  * - `VALIDATION_FAILED` · 400 — the body or query failed its schema.
1220
1255
  *
1221
1256
  * ⚠️ `ROLE_FORBIDDEN` here is the router's own role check (a print agent, or a
1222
1257
  * role no mode admits); the cross-cutting wrapper refusals are NOT repeated —
1223
1258
  * check `GATING_ERROR_CODES` in addition.
1224
1259
  */
1225
- export declare const SERVICE_ORDER_ERROR_CODES: readonly ["ROLE_FORBIDDEN", "PARENT_FILTER_CONFLICT", "VALIDATION_FAILED", "INVALID_CURSOR", "INVALID_FROM_DATE", "INVALID_TO_DATE", "INVALID_DATE_RANGE", "REWORK_INDEX_UNAVAILABLE", "STORE_NOT_FOUND", "SERVICE_ORDER_NOT_FOUND", "CUSTOMER_NOT_FOUND", "PARENT_SERVICE_ORDER_NOT_FOUND", "SERVICE_TEMPLATE_NOT_FOUND", "SERVICE_TYPE_REQUIRED", "INVALID_IMAGE_REFERENCE", "MISSING_STORE_CONTEXT", "WARRANTY_BELOW_LEGAL_MINIMUM", "TECHNICIAN_NOT_FOUND", "TECHNICIAN_NOT_ELIGIBLE", "CUSTODY_ILLEGAL_TRANSITION", "SERVICE_ORDER_BILLABLE_FROZEN", "SERVICE_ORDER_EDIT_CHANGED", "SERVICE_ORDER_DISABLED_STATE_UNCHANGED", "SERVICE_ORDER_TERMINAL", "SERVICE_ORDER_DISABLED", "SERVICE_ORDER_ILLEGAL_TRANSITION", "SERVICE_ORDER_STATUS_CHANGED", "SERVICE_ORDER_OUTCOME_REQUIRED", "SERVICE_ORDER_OUTCOME_NOT_ALLOWED", "SERVICE_ORDER_CUSTODY_NOT_RECEIVED", "SERVICE_ORDER_BILLABLE_NOT_AT_THIS_TRANSITION", "PAYMENT_METHODS_NOT_CONFIGURED", "PAYMENT_METHOD_NOT_FOUND", "SERVICE_ORDER_DEPOSIT_CHANGED", "SERVICE_BILLING_PRODUCTS_UNAVAILABLE", "SERVICE_BILLING_PRODUCT_IN_BASKET", "SERVICE_DELIVERY_BASKET_DECISION_REQUIRED", "PRODUCT_NOT_AVAILABLE", "FX_CONVERSION_UNAVAILABLE", "TRANSACT_ITEMS_LIMIT_EXCEEDED", "SERVICE_PARTS_RESTORE_EXCEEDS_CONSUMED", "SERVICE_PARTS_RESTORE_EXCEEDS_AMOUNT", "SERVICE_PARTS_STOCK_INSUFFICIENT", "SERVICE_PARTS_PRODUCT_NOT_FOUND", "SERVICE_PARTS_LEDGER_FULL", "SERVICE_PARTS_TOO_MANY", "SERVICE_ORDER_PARTS_CHANGED", "SERVICE_QUOTE_NOT_FOUND", "SERVICE_QUOTE_NOT_OFFERABLE", "SERVICE_QUOTE_HOLDS_TOO_MANY", "SERVICE_QUOTE_SUPERSEDED", "SERVICE_QUOTE_ALREADY_RESOLVED", "SERVICE_QUOTE_LAPSED", "SERVICE_QUOTE_CHANNEL_RESERVED", "SERVICE_QUOTE_CHANNEL_NOT_APPLICABLE", "SERVICE_QUOTE_REASON_NOT_APPLICABLE", "SERVICE_ORDER_QUOTE_CHANGED", "SERVICE_ORDER_NOT_READY", "SERVICE_RENOTIFY_IMPERSONATED", "SERVICE_RENOTIFY_TOO_SOON", "SERVICE_RENOTIFY_CONFLICT", "SERVICE_RENOTIFY_NOT_RECORDED", "SERVICE_RENOTIFY_LEDGER_UNREADABLE", "SERVICE_RENOTIFY_NOT_DISPATCHED", "SERVICE_TIMER_ALREADY_RUNNING", "SERVICE_TIMER_NOT_RUNNING", "SERVICE_TIMER_STOP_CONFLICT", "TECHNICIAN_NOT_CLOCKED_IN", "SERVICE_ORDER_GONE", "SERVICE_WORKLOG_NOT_FOUND", "SERVICE_WORKLOG_NOT_REVERSIBLE", "SERVICE_WORKLOG_ALREADY_REVERSED", "SERVICE_ORDER_WORKLOG_CHANGED"];
1260
+ export declare const SERVICE_ORDER_ERROR_CODES: readonly ["ROLE_FORBIDDEN", "PARENT_FILTER_CONFLICT", "VALIDATION_FAILED", "INVALID_CURSOR", "INVALID_FROM_DATE", "INVALID_TO_DATE", "INVALID_DATE_RANGE", "REWORK_INDEX_UNAVAILABLE", "STORE_NOT_FOUND", "SERVICE_ORDER_NOT_FOUND", "CUSTOMER_NOT_FOUND", "PARENT_SERVICE_ORDER_NOT_FOUND", "SERVICE_TEMPLATE_NOT_FOUND", "SERVICE_TYPE_REQUIRED", "INVALID_IMAGE_REFERENCE", "MISSING_STORE_CONTEXT", "WARRANTY_BELOW_LEGAL_MINIMUM", "TECHNICIAN_NOT_FOUND", "TECHNICIAN_NOT_ELIGIBLE", "CUSTODY_ILLEGAL_TRANSITION", "SERVICE_ORDER_BILLABLE_FROZEN", "SERVICE_ORDER_EDIT_CHANGED", "SERVICE_ORDER_DISABLED_STATE_UNCHANGED", "APPOINTMENT_NOT_FOUND", "APPOINTMENT_NOT_LINKABLE", "APPOINTMENT_NOT_OPEN", "APPOINTMENT_CUSTOMER_MISMATCH", "APPOINTMENT_VERSION_CONFLICT", "SERVICE_ORDER_TERMINAL", "SERVICE_ORDER_DISABLED", "SERVICE_ORDER_ILLEGAL_TRANSITION", "SERVICE_ORDER_STATUS_CHANGED", "SERVICE_ORDER_OUTCOME_REQUIRED", "SERVICE_ORDER_OUTCOME_NOT_ALLOWED", "SERVICE_ORDER_CUSTODY_NOT_RECEIVED", "SERVICE_ORDER_BILLABLE_NOT_AT_THIS_TRANSITION", "PAYMENT_METHODS_NOT_CONFIGURED", "PAYMENT_METHOD_NOT_FOUND", "SERVICE_ORDER_DEPOSIT_CHANGED", "SERVICE_BILLING_PRODUCTS_UNAVAILABLE", "SERVICE_BILLING_PRODUCT_IN_BASKET", "SERVICE_DELIVERY_BASKET_DECISION_REQUIRED", "PRODUCT_NOT_AVAILABLE", "FX_CONVERSION_UNAVAILABLE", "TRANSACT_ITEMS_LIMIT_EXCEEDED", "SERVICE_PARTS_RESTORE_EXCEEDS_CONSUMED", "SERVICE_PARTS_RESTORE_EXCEEDS_AMOUNT", "SERVICE_PARTS_STOCK_INSUFFICIENT", "SERVICE_PARTS_PRODUCT_NOT_FOUND", "SERVICE_PARTS_LEDGER_FULL", "SERVICE_PARTS_TOO_MANY", "SERVICE_ORDER_PARTS_CHANGED", "SERVICE_QUOTE_NOT_FOUND", "SERVICE_QUOTE_NOT_OFFERABLE", "SERVICE_QUOTE_HOLDS_TOO_MANY", "SERVICE_QUOTE_SUPERSEDED", "SERVICE_QUOTE_ALREADY_RESOLVED", "SERVICE_QUOTE_LAPSED", "SERVICE_QUOTE_CHANNEL_RESERVED", "SERVICE_QUOTE_CHANNEL_NOT_APPLICABLE", "SERVICE_QUOTE_REASON_NOT_APPLICABLE", "SERVICE_ORDER_QUOTE_CHANGED", "SERVICE_ORDER_NOT_READY", "SERVICE_RENOTIFY_IMPERSONATED", "SERVICE_RENOTIFY_TOO_SOON", "SERVICE_RENOTIFY_CONFLICT", "SERVICE_RENOTIFY_NOT_RECORDED", "SERVICE_RENOTIFY_LEDGER_UNREADABLE", "SERVICE_RENOTIFY_NOT_DISPATCHED", "SERVICE_TIMER_ALREADY_RUNNING", "SERVICE_TIMER_NOT_RUNNING", "SERVICE_TIMER_STOP_CONFLICT", "TECHNICIAN_NOT_CLOCKED_IN", "SERVICE_ORDER_GONE", "SERVICE_WORKLOG_NOT_FOUND", "SERVICE_WORKLOG_NOT_REVERSIBLE", "SERVICE_WORKLOG_ALREADY_REVERSED", "SERVICE_ORDER_WORKLOG_CHANGED"];
1226
1261
  export type ServiceOrderErrorCode = (typeof SERVICE_ORDER_ERROR_CODES)[number];
1227
1262
  export {};
@@ -196,6 +196,15 @@ export const MAX_SERVICE_PICTURES = 20;
196
196
  * (Ley 24.240 art. 23 sets 30). `0` means "not stated" and is accepted. The
197
197
  * same refusal, from the same rule, is answered by `/service-templates`
198
198
  * create and edit.
199
+ * - `APPOINTMENT_*` — `mode: 'create'` with `appointment` (a ticket opened
200
+ * from a maintenance visit). `APPOINTMENT_NOT_FOUND` (404) — no booking at
201
+ * that id/date/startTime. `APPOINTMENT_NOT_LINKABLE` (409) — the booking is
202
+ * not a `RECURRING_VISIT`. `APPOINTMENT_NOT_OPEN` (409) — it is `CANCELLED`,
203
+ * `NO_SHOW` or `RESCHEDULED`; reload and open the ticket from the live
204
+ * booking. `APPOINTMENT_CUSTOMER_MISMATCH` (409) — `customerId` is not the
205
+ * booking's customer. `APPOINTMENT_VERSION_CONFLICT` (409) — the booking
206
+ * changed while the ticket was being opened; nothing was linked, reload and
207
+ * retry, and a retry after a concurrent click returns that click's ticket.
199
208
  * - `VALIDATION_FAILED` · 400 — the body or query failed its schema.
200
209
  *
201
210
  * ⚠️ `ROLE_FORBIDDEN` here is the router's own role check (a print agent, or a
@@ -228,6 +237,12 @@ export const SERVICE_ORDER_ERROR_CODES = [
228
237
  'SERVICE_ORDER_BILLABLE_FROZEN',
229
238
  'SERVICE_ORDER_EDIT_CHANGED',
230
239
  'SERVICE_ORDER_DISABLED_STATE_UNCHANGED',
240
+ // Intake from a maintenance visit (`appointment`)
241
+ 'APPOINTMENT_NOT_FOUND',
242
+ 'APPOINTMENT_NOT_LINKABLE',
243
+ 'APPOINTMENT_NOT_OPEN',
244
+ 'APPOINTMENT_CUSTOMER_MISMATCH',
245
+ 'APPOINTMENT_VERSION_CONFLICT',
231
246
  // Lifecycle
232
247
  'SERVICE_ORDER_TERMINAL',
233
248
  'SERVICE_ORDER_DISABLED',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.10.416",
3
+ "version": "1.10.418",
4
4
  "description": "Shared wire and entity contracts for the SINFACTURA platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",