sinfactura-types 1.10.405 → 1.10.407

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.
@@ -1,2 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.REPORT_WAREHOUSE_NONE = void 0;
4
+ /**
5
+ * The `warehouseId` query value that selects rows carrying NO depósito, on the
6
+ * reports that take a sucursal filter (`mode=sales`, `GET /shifts`).
7
+ *
8
+ * Those rows were written before depósito-aware sales (or on a store that has
9
+ * not switched `stockAuthority`), and they stay in their own bucket: a report
10
+ * filtered to the primary depósito never includes them, however the rest of the
11
+ * app chooses to DISPLAY an absent depósito. Omitting `warehouseId` altogether
12
+ * is still the unfiltered, store-wide report.
13
+ *
14
+ * ⚠️ `mode=stocks` does not take it — stock is a balance, not a dated row, and a
15
+ * per-depósito balance is read from the levels alone.
16
+ */
17
+ exports.REPORT_WAREHOUSE_NONE = 'none';
package/dist/report.d.ts CHANGED
@@ -348,7 +348,9 @@ declare global {
348
348
  * One currency's slice of a `GET /reports?mode=sales` RANGE.
349
349
  *
350
350
  * Sits beside `data` in the response, never inside a `ReportSales` row:
351
- * `{ message, data, byCurrency, mixedCurrency, truncated? }`. The per-day rows
351
+ * `{ message, data, byCurrency, mixedCurrency, truncated?, warehouseId? }` —
352
+ * `warehouseId` echoes the sucursal filter (`REPORT_WAREHOUSE_NONE` included)
353
+ * and is absent on the unfiltered report. The per-day rows
352
354
  * remain unchanged and remain BLENDED across currencies — a client rendering a
353
355
  * mixed range must show these range totals and SUPPRESS the day rows, because a
354
356
  * blended day figure is a wrong number rather than an imprecise one.
@@ -821,4 +823,18 @@ declare global {
821
823
  unconvertedCurrencies?: string[];
822
824
  }
823
825
  }
826
+ /**
827
+ * The `warehouseId` query value that selects rows carrying NO depósito, on the
828
+ * reports that take a sucursal filter (`mode=sales`, `GET /shifts`).
829
+ *
830
+ * Those rows were written before depósito-aware sales (or on a store that has
831
+ * not switched `stockAuthority`), and they stay in their own bucket: a report
832
+ * filtered to the primary depósito never includes them, however the rest of the
833
+ * app chooses to DISPLAY an absent depósito. Omitting `warehouseId` altogether
834
+ * is still the unfiltered, store-wide report.
835
+ *
836
+ * ⚠️ `mode=stocks` does not take it — stock is a balance, not a dated row, and a
837
+ * per-depósito balance is read from the levels alone.
838
+ */
839
+ export declare const REPORT_WAREHOUSE_NONE = "none";
824
840
  export {};
package/dist/report.js CHANGED
@@ -1 +1,14 @@
1
- export {};
1
+ /**
2
+ * The `warehouseId` query value that selects rows carrying NO depósito, on the
3
+ * reports that take a sucursal filter (`mode=sales`, `GET /shifts`).
4
+ *
5
+ * Those rows were written before depósito-aware sales (or on a store that has
6
+ * not switched `stockAuthority`), and they stay in their own bucket: a report
7
+ * filtered to the primary depósito never includes them, however the rest of the
8
+ * app chooses to DISPLAY an absent depósito. Omitting `warehouseId` altogether
9
+ * is still the unfiltered, store-wide report.
10
+ *
11
+ * ⚠️ `mode=stocks` does not take it — stock is a balance, not a dated row, and a
12
+ * per-depósito balance is read from the levels alone.
13
+ */
14
+ export const REPORT_WAREHOUSE_NONE = 'none';
package/dist/return.d.ts CHANGED
@@ -24,6 +24,21 @@ declare global {
24
24
  customerId: string;
25
25
  invoiceId?: string;
26
26
  creditNoteId?: string;
27
+ /**
28
+ * The originating SALE's depósito — the order's first line carrying an
29
+ * `OrderLine.warehouseId`, frozen when the return is written. It is what a
30
+ * sucursal sales report nets this return against, so the report filters on
31
+ * it without joining back to the order.
32
+ *
33
+ * ⚠️ Not where the units went back to: a return may restock another
34
+ * depósito (`CreateReturnRequest.warehouseId`), and its `INCOME#` ledger
35
+ * rows record that one.
36
+ *
37
+ * ⚠️ OPTIONAL PERMANENTLY. Absent on returns written before it existed and
38
+ * on returns of orders whose lines carry no depósito; a report puts those
39
+ * under `REPORT_WAREHOUSE_NONE`, never under the primary.
40
+ */
41
+ warehouseId?: string;
27
42
  items: ReturnItem[];
28
43
  /**
29
44
  * GROSS sum of the selected lines, BEFORE the originating order's
@@ -85,7 +85,7 @@ declare global {
85
85
  * quietly missing a feature), but it means the caller must be updated in the
86
86
  * same change. Adding a key is never only additive downstream.
87
87
  */
88
- type FeatureKey = 'maxOrdersMonth' | 'maxInvoicesMonth' | 'maxProducts' | 'maxUsers' | 'maxCustomers' | 'maxStores' | 'maxWarehouses' | 'priceListsMax' | 'afipInvoicing' | 'suppliers' | 'domesticPayments' | 'stripePayments' | 'cashManagement' | 'multiStore' | 'importExport' | 'advancedReports' | 'customBranding' | 'prioritySupport' | 'whatsappCommerce' | 'aiFeatures' | 'mobileApp' | 'customDomain' | 'advancedPricing' | 'marketplaceChannels' | 'storefront' | 'loyalty' | 'marketing' | 'mandatory2fa';
88
+ type FeatureKey = 'maxOrdersMonth' | 'maxInvoicesMonth' | 'maxProducts' | 'maxUsers' | 'maxCustomers' | 'maxWarehouses' | 'priceListsMax' | 'afipInvoicing' | 'suppliers' | 'domesticPayments' | 'stripePayments' | 'cashManagement' | 'importExport' | 'advancedReports' | 'customBranding' | 'prioritySupport' | 'whatsappCommerce' | 'aiFeatures' | 'mobileApp' | 'customDomain' | 'advancedPricing' | 'marketplaceChannels' | 'storefront' | 'loyalty' | 'marketing' | 'mandatory2fa';
89
89
  /** Resolved entitlements for a specific tenant (matrix + overrides applied). */
90
90
  type ResolvedEntitlements = Record<FeatureKey, Entitlement>;
91
91
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.10.405",
3
+ "version": "1.10.407",
4
4
  "description": "Shared wire and entity contracts for the SINFACTURA platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",