sinfactura-types 1.10.49 → 1.10.50

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.
@@ -129,6 +129,37 @@ declare global {
129
129
  total: number;
130
130
  condition: PartCondition;
131
131
  }
132
+ /**
133
+ * One material a quote version PROPOSES to use.
134
+ *
135
+ * Deliberately **not** {@link PartUsed}. That is the fitted-parts ledger and
136
+ * carries `unitCost` (merchant cost, operator-only) and `total` (the charged
137
+ * line amount). A quote line is disclosed to the customer on the presupuesto
138
+ * and rides a customer-visible entity, so it carries **no money at all** —
139
+ * `wsPostStore` delivers a payload to that payload's own customer, so a
140
+ * merchant cost on a quote version would sit one broadcast from a customer
141
+ * socket. The priced figure stays the version's own `partsCost`.
142
+ *
143
+ * PROSPECTIVE, not derived. A presupuesto is an offer: at quote time the
144
+ * parts have usually not been fitted, so `ServiceOrder.partsUsed` is empty or
145
+ * partial. These are supplied on the create request instead.
146
+ *
147
+ * `sku` and `name` are SNAPSHOTS taken when the version is stamped and are
148
+ * never re-resolved — the document's job is to show what the customer was
149
+ * actually shown, so a later product rename must not rewrite a historical
150
+ * presupuesto.
151
+ */
152
+ interface ServiceQuotePart {
153
+ /** FK to Product. Never printed; this is what a future hold reserves against. */
154
+ productId: string;
155
+ /** Snapshot at stamp time, never re-resolved. */
156
+ sku: string;
157
+ /** Snapshot at stamp time — the name the customer was actually shown. */
158
+ name: string;
159
+ quantity: number;
160
+ /** Ley 24.240 art. 20 — a non-new material must be declared in writing. */
161
+ condition: PartCondition;
162
+ }
132
163
  /**
133
164
  * A technician work session logged against a service order (manual hours at V1).
134
165
  *
@@ -313,6 +344,25 @@ declare global {
313
344
  rejection?: ServiceQuoteRejection;
314
345
  /** `quoteId` of the version that replaced this one. */
315
346
  supersededBy?: string;
347
+ /**
348
+ * The materials THIS version proposes, so a reprint of a superseded
349
+ * version discloses the set that version offered rather than the order's
350
+ * current parts.
351
+ *
352
+ * Optional forever: versions stored before this field existed have none,
353
+ * and nothing backfills them. A backfilled list would be a fabricated
354
+ * record of what was offered, which is worse than the gap it closes.
355
+ *
356
+ * ⚠️ **Absent and empty mean different things, and conflating them
357
+ * reproduces the exact defect this field fixes.**
358
+ *
359
+ * - `undefined` → a legacy version. Fall back to the order's netted
360
+ * `partsUsed`, which is the behaviour that shipped before this field.
361
+ * - `[]` → this version proposes **no** materials (labour-only).
362
+ * Disclose nothing. Falling back here would print materials onto the
363
+ * one quote that was honest about having none.
364
+ */
365
+ parts?: ServiceQuotePart[];
316
366
  }
317
367
  /**
318
368
  * A seña taken against a service order.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.10.49",
3
+ "version": "1.10.50",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",