sinfactura-types 1.10.39 → 1.10.40
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.
- package/dist/serviceOrder.d.ts +42 -3
- package/package.json +1 -1
package/dist/serviceOrder.d.ts
CHANGED
|
@@ -115,7 +115,15 @@ declare global {
|
|
|
115
115
|
total: number;
|
|
116
116
|
condition: PartCondition;
|
|
117
117
|
}
|
|
118
|
-
/**
|
|
118
|
+
/**
|
|
119
|
+
* A technician work session logged against a service order (manual hours at V1).
|
|
120
|
+
*
|
|
121
|
+
* Deliberately carries NO parts. Parts live exclusively on the top-level
|
|
122
|
+
* `ServiceOrder.partsUsed` signed ledger, which is what stock movement is
|
|
123
|
+
* derived from; a per-work-log copy would be a second source of truth for
|
|
124
|
+
* the same movement and the two would drift. Log the hours here, post the
|
|
125
|
+
* parts to the ledger.
|
|
126
|
+
*/
|
|
119
127
|
interface WorkLog {
|
|
120
128
|
workLogId: string;
|
|
121
129
|
technicianId: string;
|
|
@@ -124,7 +132,6 @@ declare global {
|
|
|
124
132
|
/** Hours worked in this session. */
|
|
125
133
|
hours: number;
|
|
126
134
|
description: string;
|
|
127
|
-
partsUsed?: PartUsed[];
|
|
128
135
|
}
|
|
129
136
|
/** One entry in a service order's status history (append-only audit trail). */
|
|
130
137
|
interface ServiceStatusEntry {
|
|
@@ -146,7 +153,18 @@ declare global {
|
|
|
146
153
|
* stages (which would corrupt duration metrics).
|
|
147
154
|
*/
|
|
148
155
|
type ServiceQuoteStatus = 'draft' | 'sent' | 'approved' | 'rejected' | 'expired' | 'superseded';
|
|
149
|
-
/**
|
|
156
|
+
/**
|
|
157
|
+
* How the customer's decision on a quote reached the shop.
|
|
158
|
+
*
|
|
159
|
+
* ⚠️ `'portal'` is RESERVED and must not be offered to an operator. The other
|
|
160
|
+
* four are things an operator records second-hand; `'portal'` means the
|
|
161
|
+
* customer approved it themselves, and no customer-facing service endpoint
|
|
162
|
+
* exists on any gateway yet — so an operator selecting it would be recording
|
|
163
|
+
* an event that did not happen. The api rejects it: it is excluded from the
|
|
164
|
+
* `POST /services` quote-resolve enum and returns 400. It stays in the union
|
|
165
|
+
* so rows already carrying it still read back, and so the value is ready the
|
|
166
|
+
* day a customer portal ships. Filter it out of any channel picker.
|
|
167
|
+
*/
|
|
150
168
|
type ServiceQuoteChannel = 'in_person' | 'phone' | 'whatsapp' | 'email' | 'portal';
|
|
151
169
|
/**
|
|
152
170
|
* A customer decision on a quote version, recorded as an event rather than a
|
|
@@ -238,6 +256,12 @@ declare global {
|
|
|
238
256
|
interface ServiceOrderPicture {
|
|
239
257
|
url: string;
|
|
240
258
|
base64?: string;
|
|
259
|
+
/**
|
|
260
|
+
* Which photo leads its stage's gallery — a CLIENT affordance, exactly as
|
|
261
|
+
* on `Product.pictures`. The server accepts, stores and returns it and
|
|
262
|
+
* deliberately never branches on it, so finding no server-side reader is
|
|
263
|
+
* the expected result and not grounds to retire the field.
|
|
264
|
+
*/
|
|
241
265
|
primary?: boolean;
|
|
242
266
|
stage: ServiceOrderPictureStage;
|
|
243
267
|
}
|
|
@@ -432,8 +456,23 @@ declare global {
|
|
|
432
456
|
* Absent while the job is still open, and absent forever on a ticket that
|
|
433
457
|
* ends `cancelled`, `returned_unrepaired` or `abandoned_disposed` — none of
|
|
434
458
|
* those deliver anything to bill.
|
|
459
|
+
*
|
|
460
|
+
* ⚠️ Deliberately has NO reader inside the api, and that is correct — see
|
|
461
|
+
* `invoiceId` below. Do not retire it for want of one.
|
|
435
462
|
*/
|
|
436
463
|
orderId?: string;
|
|
464
|
+
/**
|
|
465
|
+
* The fiscal document issued for this service order, stamped when
|
|
466
|
+
* `POST /invoices` actually draws the voucher — in the same transaction as
|
|
467
|
+
* the `Invoice` put, so the join can never commit half-formed.
|
|
468
|
+
*
|
|
469
|
+
* ⚠️ Like `orderId`, NOTHING server-side branches on this, by design. Both
|
|
470
|
+
* exist so the row is self-describing on `GET`: their consumer is the
|
|
471
|
+
* client's linked-order card, where `invoiceId` alone answers "was this
|
|
472
|
+
* invoiced?" with no second fetch and `orderId` is the navigation target.
|
|
473
|
+
* An audit that finds no reader has found the intended state, not dead
|
|
474
|
+
* fields — do not remove them on that basis.
|
|
475
|
+
*/
|
|
437
476
|
invoiceId?: string;
|
|
438
477
|
warrantyDays?: number;
|
|
439
478
|
/** Unix ms the warranty expires (stamped at delivery). */
|