sinfactura-types 1.10.359 → 1.10.360

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.
@@ -168,5 +168,24 @@ declare global {
168
168
  type PlatformFxSourcesStoredRow = Omit<PlatformFxSourcesRow, 'sources' | 'persisted'> & {
169
169
  sources: PlatformFxSourceInput[];
170
170
  };
171
+ /**
172
+ * WHY a store's display-currency FX rate could not be resolved — the three
173
+ * facts a `Number(rate) || 1` used to swallow as one.
174
+ *
175
+ * Published because it rides `data.reason` on the `400 FX_CONVERSION_UNAVAILABLE`
176
+ * a cart write and a counter sale answer with, and the three have DIFFERENT
177
+ * remedies an FE should be able to say out loud:
178
+ *
179
+ * - `NO_SUBSCRIPTION` — the store holds no `currencies[]` entry for its own
180
+ * `config.displayCurrency`. Remedy: subscribe the currency.
181
+ * - `ZERO_VALUE` — an entry exists and holds `0` (or a negative). Remedy:
182
+ * repair the stored rate.
183
+ * - `NON_NUMERIC_VALUE` — an entry exists and holds something that is not a
184
+ * number. Same remedy, different cause, and worth telling apart in support.
185
+ *
186
+ * ⚠️ The peso never produces one of these: its rate is 1 by definition, so
187
+ * the fallback IS the right answer there.
188
+ */
189
+ type DisplayCurrencyRateUnresolvedReason = 'NO_SUBSCRIPTION' | 'NON_NUMERIC_VALUE' | 'ZERO_VALUE';
171
190
  }
172
191
  export {};
package/dist/store.d.ts CHANGED
@@ -524,14 +524,22 @@ declare global {
524
524
  * be stamped with a currency their balance is not kept in, whatever
525
525
  * this retired field still holds.
526
526
  *
527
- * ⚠️ Two things did NOT follow from that, and they are the live
528
- * questions. Rows stamped BEFORE it shipped are untouched — this repo
529
- * is forward-only, so nothing backfills them. And a `currencyId` that
530
- * resolves to no entry in `store.currencies` is not merely a label
531
- * problem: storefront checkout looks the id up and falls through to a
532
- * conversion rate of `1`, which prices a foreign-currency customer at
533
- * parity and compares the DNI/CUIT threshold against an unconverted
534
- * total.
527
+ * ⚠️ One thing did NOT follow from that: rows stamped BEFORE it shipped
528
+ * are untouched — this repo is forward-only, so nothing backfills them.
529
+ *
530
+ * ⚠️ **This paragraph used to claim a second consequence, and it was
531
+ * WRONG.** It said a `currencyId` resolving to no `store.currencies`
532
+ * entry made storefront checkout fall through to a conversion rate of
533
+ * `1`, pricing a foreign-currency customer at parity and comparing the
534
+ * DNI/CUIT threshold against an unconverted total. The threshold half is
535
+ * false: the storefront's `requiresDniForTotal` converts with the CART's
536
+ * currency falling back to the store's `displayCurrency`, never the
537
+ * customer's, and its own docblock names that as the defect it avoids;
538
+ * it also fails closed on an absent or zero threshold. The residual
539
+ * `|| 1` in that helper falls back to the STORE's rate, not the
540
+ * customer's. So a stale `currencyId` is a label problem here and a
541
+ * presentation one over there — never a fiscal one, which is what the
542
+ * old wording implied.
535
543
  *
536
544
  * Seed catalogId an operator declares as the intended currency-selector
537
545
  * default for new customer-facing money rows. Does not reinterpret
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.10.359",
3
+ "version": "1.10.360",
4
4
  "description": "Shared wire and entity contracts for the SINFACTURA platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",