platform-types 1.10.808 → 1.10.810

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/cart.d.ts CHANGED
@@ -211,6 +211,25 @@ declare global {
211
211
  * while `ecommerce.config.showNetPlusIva` is on.
212
212
  */
213
213
  netOfIva?: number;
214
+ /**
215
+ * The «PRECIO SIN IMPUESTOS NACIONALES» amount of `price`, per unit:
216
+ * `netOfIva` minus the line's impuestos internos,
217
+ * `netOfIva − round2(netOfIva × internalTaxes.percent / 100)`, and
218
+ * `netOfIva` itself when the line records none. Present exactly when
219
+ * `netOfIva` is, except that an unreadable `internalTaxes` or a refused
220
+ * figure leaves it out alone.
221
+ *
222
+ * ⚠️ READ-TIME and DISPLAY ONLY, on the same customer exits as `netOfIva`
223
+ * and under the same rules: never stored, never on an operator copy, never
224
+ * charged or totalled. Not gated by `showNetPlusIva`.
225
+ */
226
+ netOfNationalTaxes?: number;
227
+ /**
228
+ * The product's `internalTaxes`, stamped from the product row at re-price
229
+ * time like `ivaType`: the input to `netOfNationalTaxes`. Absent means
230
+ * none. Rides the line onto `OrderLine`; no invoice reads it.
231
+ */
232
+ internalTaxes?: ProductInternalTaxes;
214
233
  listId?: number;
215
234
  currency?: string;
216
235
  currencyValue?: number;
@@ -7,10 +7,10 @@ exports.BASE_QUANTITY_DECIMAL_PLACES = 6;
7
7
  exports.MAX_BASE_QUANTITY = 1_000_000;
8
8
  /**
9
9
  * The `sort` values Web `GET /products?mode=discover` serves. `newest` is
10
- * descending product id; name and price sorts are not served (no index can
11
- * order them inside one bounded request).
10
+ * descending product id; `price_asc` / `price_desc` are the caller's own price
11
+ * (see `PublicProductDiscoverInput.sort`). Name sorts are not served.
12
12
  */
13
- exports.DISCOVERY_SORTS = ['newest'];
13
+ exports.DISCOVERY_SORTS = ['newest', 'price_asc', 'price_desc'];
14
14
  /**
15
15
  * The facets Web `GET /products?mode=discover` can count (`facets=brand,tag,category`).
16
16
  * `brand` tallies `brandId`, `tag` each of `tagIds`, `category` the EXACT `categoryId`
@@ -738,6 +738,9 @@ exports.isSocketAction = isSocketAction;
738
738
  * `ivaType` is an INPUT to the shopper copy's `prices[].netOfIva`: the customer
739
739
  * fan-out re-prices the frame, and without the rate a merged frame would leave a
740
740
  * stale net beside a new gross. The customer copy still drops the Id itself.
741
+ * `internalTaxes` is the same kind of input, to `prices[].netOfNationalTaxes`:
742
+ * without it a frame would publish the legend amount of a product with no
743
+ * impuestos internos. The customer copy drops it too.
741
744
  */
742
745
  exports.PRODUCT_STOCK_FRAME_FIELDS = [
743
746
  'stock',
@@ -750,6 +753,7 @@ exports.PRODUCT_STOCK_FRAME_FIELDS = [
750
753
  'updatedAt',
751
754
  'lastMovementAt',
752
755
  'ivaType',
756
+ 'internalTaxes',
753
757
  ];
754
758
  /* Agent diagnostic commands */
755
759
  /**
package/dist/pricing.d.ts CHANGED
@@ -143,9 +143,19 @@ declare global {
143
143
  * A price slot as a PUBLIC read emits it (web catalogue reads, customer
144
144
  * `products` frames). A read-time extension of {@link PriceSlot}, never
145
145
  * stored: `Product.prices` stays `PriceSlot[]`, so no writer can persist a net.
146
+ *
147
+ * `netOfNationalTaxes` is the «PRECIO SIN IMPUESTOS NACIONALES» amount
148
+ * (Resolución SIC 4/2025 art. 2(c)), the same shape as `netOfIva`, figure for
149
+ * figure: each `netOfIva` figure minus the product's impuestos internos
150
+ * (`Product.internalTaxes`), `net − round2(net × percent / 100)`. A product
151
+ * recording no internos gets the `netOfIva` figures. Present exactly when
152
+ * `netOfIva` is, except that an unreadable stored `internalTaxes` or a refused
153
+ * figure leaves it out alone. Never replaces `amount`, and is sent whatever
154
+ * `showNetPlusIva` says: the legend shows on every view.
146
155
  */
147
156
  type PublicPriceSlot = PriceSlot & {
148
157
  netOfIva?: PublicPriceNet;
158
+ netOfNationalTaxes?: PublicPriceNet;
149
159
  };
150
160
  }
151
161
  export {};
package/dist/product.d.ts CHANGED
@@ -4,10 +4,10 @@ export declare const BASE_QUANTITY_DECIMAL_PLACES = 6;
4
4
  export declare const MAX_BASE_QUANTITY = 1000000;
5
5
  /**
6
6
  * The `sort` values Web `GET /products?mode=discover` serves. `newest` is
7
- * descending product id; name and price sorts are not served (no index can
8
- * order them inside one bounded request).
7
+ * descending product id; `price_asc` / `price_desc` are the caller's own price
8
+ * (see `PublicProductDiscoverInput.sort`). Name sorts are not served.
9
9
  */
10
- export declare const DISCOVERY_SORTS: readonly ["newest"];
10
+ export declare const DISCOVERY_SORTS: readonly ["newest", "price_asc", "price_desc"];
11
11
  export type DiscoverySort = (typeof DISCOVERY_SORTS)[number];
12
12
  /**
13
13
  * The facets Web `GET /products?mode=discover` can count (`facets=brand,tag,category`).
@@ -36,12 +36,25 @@ declare global {
36
36
  /** Server-owned; starts at 1 and increments when the declaration changes. */
37
37
  unitRevision: number;
38
38
  }
39
+ /**
40
+ * `Product.internalTaxes`: impuestos internos as a nominal `percent`,
41
+ * greater than 0 and less than 100, applied to the net of IVA. The legend
42
+ * amount is `netOfIva − round2(netOfIva × percent / 100)`. A rate only:
43
+ * a fixed amount per unit would need a currency and an FX step the
44
+ * per-figure net has none of. A later basis is an additive key.
45
+ */
46
+ interface ProductInternalTaxes {
47
+ percent: number;
48
+ }
39
49
  type ProductUnitsInput = Omit<ProductUnits, 'unitRevision'>;
40
50
  /** The display declaration plus the purchase-unit factor; `unitRevision` stays server-only. */
41
51
  type PublicProductUnits = Pick<ProductUnits, 'baseUnit' | 'purchaseUnit' | 'packLabel' | 'baseUnitsPerPurchaseUnit'>;
42
52
  type PublicProduct = Omit<Partial<Product>, 'units' | 'unitRevisionGeneration' | 'prices'> & {
43
53
  units?: PublicProductUnits | null;
44
- /** The shopper's one applicable slot, with its read-time `netOfIva` when the product is rated. */
54
+ /**
55
+ * The shopper's one applicable slot, with its read-time `netOfIva` and
56
+ * `netOfNationalTaxes` when the product is rated.
57
+ */
45
58
  prices?: PublicPriceSlot[];
46
59
  };
47
60
  /** Anonymous Web GET /products lookup; the tenant comes from the public store context. */
@@ -280,10 +293,22 @@ declare global {
280
293
  isNew?: 'true';
281
294
  /**
282
295
  * A member of `DISCOVERY_SORTS`. `newest` = descending product id (mint
283
- * order), on every filter combination. A well-formed value the api does not
284
- * serve is 400 `DISCOVERY_SORT_UNSUPPORTED` ({@link DiscoverySortRefusal});
285
- * one not matching `^[a-z_]{1,32}$` is 400 `INVALID_DISCOVERY_QUERY`. An
286
- * empty value is absent. Bound into the cursor when present.
296
+ * order), on every filter combination. `price_asc` / `price_desc` = the
297
+ * caller's own price, as each row is priced for them: in the store's display
298
+ * currency, an open offer counting as the price, no quantity break. Rows the
299
+ * caller is shown no price for (a hidden slot, every row for a guest of a
300
+ * store that hides prices) come LAST in both directions; equal prices and
301
+ * that unpriced tail are newest first. A price sort reads the whole filtered
302
+ * set on every page, so a set too large for one read is 400
303
+ * `DISCOVERY_SORT_UNSUPPORTED` after the reads, with `supportedSorts`
304
+ * naming what that query can be served in, and a read the time budget cut
305
+ * short is 503 `PRODUCT_LOOKUP_INCOMPLETE` (retryable). A price cursor is
306
+ * also bound to the caller's price list: resumed under another (a sign-in,
307
+ * a list change) it is 400 `INVALID_CURSOR`. A well-formed value the api does
308
+ * not serve is 400 `DISCOVERY_SORT_UNSUPPORTED` ({@link DiscoverySortRefusal})
309
+ * before any read; one not matching `^[a-z_]{1,32}$` is 400
310
+ * `INVALID_DISCOVERY_QUERY`. An empty value is absent. Bound into the cursor
311
+ * when present.
287
312
  */
288
313
  sort?: string;
289
314
  /** The previous response's `LastEvaluatedKey`, under the SAME filters and sort; else 400 INVALID_CURSOR. */
@@ -380,8 +405,14 @@ declare global {
380
405
  truncated?: true;
381
406
  }
382
407
  /** Refusals of Web `GET /products?mode=discover`. */
383
- type DiscoveryErrorCode = 'INVALID_DISCOVERY_QUERY' | 'INVALID_CURSOR' | 'DISCOVERY_SORT_UNSUPPORTED';
384
- /** 400 body for a well-formed `sort` the api does not serve; `supportedSorts` lists what it does. */
408
+ type DiscoveryErrorCode = 'INVALID_DISCOVERY_QUERY' | 'INVALID_CURSOR' | 'DISCOVERY_SORT_UNSUPPORTED'
409
+ /** 503: a price-sorted walk the time budget cut short; retry. */
410
+ | 'PRODUCT_LOOKUP_INCOMPLETE';
411
+ /**
412
+ * 400 body for a `sort` the api does not serve for this request; `supportedSorts` lists what
413
+ * it does — every member for an unknown value, the non-price sorts when a price sort's
414
+ * filtered set was too large to read whole.
415
+ */
385
416
  interface DiscoverySortRefusal {
386
417
  message: string;
387
418
  error: 'DISCOVERY_SORT_UNSUPPORTED';
@@ -938,6 +969,19 @@ declare global {
938
969
  currencyValue?: number;
939
970
  currencyValueAt?: number;
940
971
  ivaType: number;
972
+ /**
973
+ * Impuestos internos the merchant records for this product, as a nominal
974
+ * rate: the input to the public `prices[].netOfNationalTaxes` and the cart
975
+ * line's `netOfNationalTaxes` («PRECIO SIN IMPUESTOS NACIONALES»). Absent
976
+ * means none. Written through `POST /products`, cleared through
977
+ * `removeFields: ['internalTaxes']`.
978
+ *
979
+ * ⚠️ DISPLAY INPUT ONLY. No invoice reads it: the voucher declares no
980
+ * impuestos internos tributo, so a product recording them still prints
981
+ * `$0,00` on the RG 5614 «Otros Impuestos Nacionales Indirectos» line.
982
+ * Never on a public product row; the shopper gets the net, never the rate.
983
+ */
984
+ internalTaxes?: ProductInternalTaxes;
941
985
  /** Optional category membership. New enabled membership atomically requires an existing, enabled, unfrozen category.
942
986
  * Cosmetic edits preserve legacy references; leaving or disabling remains allowed while frozen.
943
987
  */
package/dist/product.js CHANGED
@@ -4,10 +4,10 @@ export const BASE_QUANTITY_DECIMAL_PLACES = 6;
4
4
  export const MAX_BASE_QUANTITY = 1_000_000;
5
5
  /**
6
6
  * The `sort` values Web `GET /products?mode=discover` serves. `newest` is
7
- * descending product id; name and price sorts are not served (no index can
8
- * order them inside one bounded request).
7
+ * descending product id; `price_asc` / `price_desc` are the caller's own price
8
+ * (see `PublicProductDiscoverInput.sort`). Name sorts are not served.
9
9
  */
10
- export const DISCOVERY_SORTS = ['newest'];
10
+ export const DISCOVERY_SORTS = ['newest', 'price_asc', 'price_desc'];
11
11
  /**
12
12
  * The facets Web `GET /products?mode=discover` can count (`facets=brand,tag,category`).
13
13
  * `brand` tallies `brandId`, `tag` each of `tagIds`, `category` the EXACT `categoryId`
@@ -194,7 +194,7 @@ declare global {
194
194
  * (per combination only), `stock` (always 0), `tagIds` and `typedAttributes`
195
195
  * (set per child afterwards, through `POST /products`).
196
196
  */
197
- type ProductVariantFields = Partial<Pick<Product, 'description' | 'categoryId' | 'brandId' | 'zone' | 'cost' | 'currency' | 'ivaType' | 'prices' | 'limit' | 'isService' | 'isNew' | 'hiddenFromStorefront' | 'sellableOn' | 'minStock' | 'reorderPoint' | 'safetyStock' | 'leadTimeDays' | 'serviceLevel' | 'lotTracking' | 'weightGrams' | 'lengthMm' | 'widthMm' | 'heightMm' | 'model' | 'seoTitle' | 'seoDescription' | 'attributes'>> & {
197
+ type ProductVariantFields = Partial<Pick<Product, 'description' | 'categoryId' | 'brandId' | 'zone' | 'cost' | 'currency' | 'ivaType' | 'internalTaxes' | 'prices' | 'limit' | 'isService' | 'isNew' | 'hiddenFromStorefront' | 'sellableOn' | 'minStock' | 'reorderPoint' | 'safetyStock' | 'leadTimeDays' | 'serviceLevel' | 'lotTracking' | 'weightGrams' | 'lengthMm' | 'widthMm' | 'heightMm' | 'model' | 'seoTitle' | 'seoDescription' | 'attributes'>> & {
198
198
  /** `draft` or `active`; omitted creates the child as `POST /products` does. */
199
199
  catalogStatus?: Exclude<CatalogStatus, 'archived'>;
200
200
  /**
package/dist/socket.d.ts CHANGED
@@ -176,8 +176,11 @@ export interface SocketMessage<T = unknown> {
176
176
  * `ivaType` is an INPUT to the shopper copy's `prices[].netOfIva`: the customer
177
177
  * fan-out re-prices the frame, and without the rate a merged frame would leave a
178
178
  * stale net beside a new gross. The customer copy still drops the Id itself.
179
+ * `internalTaxes` is the same kind of input, to `prices[].netOfNationalTaxes`:
180
+ * without it a frame would publish the legend amount of a product with no
181
+ * impuestos internos. The customer copy drops it too.
179
182
  */
180
- export declare const PRODUCT_STOCK_FRAME_FIELDS: readonly ["stock", "prices", "cost", "currency", "hiddenFromStorefront", "disabled", "catalogStatus", "updatedAt", "lastMovementAt", "ivaType"];
183
+ export declare const PRODUCT_STOCK_FRAME_FIELDS: readonly ["stock", "prices", "cost", "currency", "hiddenFromStorefront", "disabled", "catalogStatus", "updatedAt", "lastMovementAt", "ivaType", "internalTaxes"];
181
184
  /**
182
185
  * `data` of a **partial** `products` frame — the projection every stock-moving
183
186
  * write announces, and the only `products` shape that is not a whole `Product`.
package/dist/socket.js CHANGED
@@ -734,6 +734,9 @@ export const isSocketAction = (value) => typeof value === 'string' && SOCKET_ACT
734
734
  * `ivaType` is an INPUT to the shopper copy's `prices[].netOfIva`: the customer
735
735
  * fan-out re-prices the frame, and without the rate a merged frame would leave a
736
736
  * stale net beside a new gross. The customer copy still drops the Id itself.
737
+ * `internalTaxes` is the same kind of input, to `prices[].netOfNationalTaxes`:
738
+ * without it a frame would publish the legend amount of a product with no
739
+ * impuestos internos. The customer copy drops it too.
737
740
  */
738
741
  export const PRODUCT_STOCK_FRAME_FIELDS = [
739
742
  'stock',
@@ -746,6 +749,7 @@ export const PRODUCT_STOCK_FRAME_FIELDS = [
746
749
  'updatedAt',
747
750
  'lastMovementAt',
748
751
  'ivaType',
752
+ 'internalTaxes',
749
753
  ];
750
754
  /* Agent diagnostic commands */
751
755
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platform-types",
3
- "version": "1.10.808",
3
+ "version": "1.10.810",
4
4
  "description": "Shared wire and entity contracts for the platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",