sinfactura-types 1.6.29 → 1.6.30
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/basket.d.ts +8 -0
- package/dist/customer.d.ts +6 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/invoice.d.ts +5 -0
- package/dist/pricing.d.ts +72 -0
- package/dist/pricing.js +1 -0
- package/dist/product.d.ts +5 -4
- package/dist/store.d.ts +1 -1
- package/dist/subscription.d.ts +1 -1
- package/package.json +1 -1
package/dist/basket.d.ts
CHANGED
|
@@ -24,6 +24,14 @@ declare global {
|
|
|
24
24
|
ivaType: number;
|
|
25
25
|
cost: number;
|
|
26
26
|
price: number;
|
|
27
|
+
listId?: number;
|
|
28
|
+
currency?: string;
|
|
29
|
+
currencyValue?: number;
|
|
30
|
+
currencyValueAt?: number;
|
|
31
|
+
priceSource?: 'percent' | 'amount';
|
|
32
|
+
appliedMinQty?: number;
|
|
33
|
+
promoApplied?: boolean;
|
|
34
|
+
basePrice?: number;
|
|
27
35
|
}
|
|
28
36
|
}
|
|
29
37
|
export {};
|
package/dist/customer.d.ts
CHANGED
|
@@ -40,6 +40,12 @@ declare global {
|
|
|
40
40
|
phone: string;
|
|
41
41
|
photoURL: string;
|
|
42
42
|
postalCode: string;
|
|
43
|
+
/**
|
|
44
|
+
* FK to PriceList.id (NOT a positional ordinal). Picks which PriceSlot /
|
|
45
|
+
* materialized priceN applies to this customer. Legacy values 1..4 already
|
|
46
|
+
* equal the seeded list ids, so the migration is value-preserving; getPrice
|
|
47
|
+
* resolves by id, not by `price${ordinal}`. (#1780 / types#88)
|
|
48
|
+
*/
|
|
43
49
|
priceList: number;
|
|
44
50
|
province: string;
|
|
45
51
|
salt?: string;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/invoice.d.ts
CHANGED
|
@@ -48,6 +48,11 @@ declare global {
|
|
|
48
48
|
quantity: number;
|
|
49
49
|
iva: number;
|
|
50
50
|
neto: number;
|
|
51
|
+
unitPrice?: number;
|
|
52
|
+
listId?: number;
|
|
53
|
+
appliedMinQty?: number;
|
|
54
|
+
promoApplied?: boolean;
|
|
55
|
+
basePrice?: number;
|
|
51
56
|
}
|
|
52
57
|
interface InvoiceWithCustomer extends Invoice {
|
|
53
58
|
customer: Customer;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
/**
|
|
3
|
+
* ADR-0013 self-describing money stamp — STRICT (frozen rate required).
|
|
4
|
+
* Used ONLY on the new pricing-authoring shapes (PriceSlot[absolute] /
|
|
5
|
+
* PriceBreak / PricePromo). An optional frozen rate would reopen the
|
|
6
|
+
* live-rate hole (#1542). `currency` is bare `string` (catalogId) for parity
|
|
7
|
+
* with `Product.currency` — do NOT half-narrow to `CatalogId` while the
|
|
8
|
+
* entity stamps stay `string`. Do NOT retrofit this onto SupplierInvoice /
|
|
9
|
+
* SupplierAccount (optional-currency by design — would break supplier writes).
|
|
10
|
+
*/
|
|
11
|
+
interface CurrencyStamp {
|
|
12
|
+
currency: string;
|
|
13
|
+
currencyValue: number;
|
|
14
|
+
currencyValueAt: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A named, extensible price list. Split OUT of the shared `Method` blob
|
|
18
|
+
* (`Method` is reused by 7 unrelated Store arrays — don't leak pricing into
|
|
19
|
+
* paymentMethods / ivaTypes). A structural SUPERSET of `Method` (keeps
|
|
20
|
+
* id / name / value? / removable? / editable?) so `store.priceLists:
|
|
21
|
+
* Method[] → PriceList[]` is type-compatible. `id` is the stable FK target
|
|
22
|
+
* for `Customer.priceList` + `PriceSlot.listId`.
|
|
23
|
+
*/
|
|
24
|
+
interface PriceList {
|
|
25
|
+
id: number;
|
|
26
|
+
name: string;
|
|
27
|
+
value?: number;
|
|
28
|
+
removable?: boolean;
|
|
29
|
+
editable?: boolean;
|
|
30
|
+
order?: number;
|
|
31
|
+
defaultCurrency?: string;
|
|
32
|
+
tierGated?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Quantity break within a slot. Resolution: highest `minQty <= qty` wins.
|
|
36
|
+
* Stored sorted ascending by `minQty`; no two breaks share a `minQty`
|
|
37
|
+
* (BE-validated). Open-ended top tier (no `maxQty` — ranges derive from the
|
|
38
|
+
* next break's `minQty`).
|
|
39
|
+
*/
|
|
40
|
+
interface PriceBreak extends CurrencyStamp {
|
|
41
|
+
minQty: number;
|
|
42
|
+
amount: number;
|
|
43
|
+
}
|
|
44
|
+
/** Time-limited promo override. `amount` is absolute. */
|
|
45
|
+
interface PricePromo extends CurrencyStamp {
|
|
46
|
+
from?: number;
|
|
47
|
+
until: number;
|
|
48
|
+
amount: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* One price list's pricing for a product. Discriminated union — kills the
|
|
52
|
+
* `{}`, both-set and neither-set invalid states; the `kind:'absolute' ⇒
|
|
53
|
+
* stamp` invariant rides the discriminant. `listId` is an FK to
|
|
54
|
+
* `PriceList.id`.
|
|
55
|
+
*/
|
|
56
|
+
type PriceSlot = {
|
|
57
|
+
kind: 'percent';
|
|
58
|
+
listId: number;
|
|
59
|
+
percent: number;
|
|
60
|
+
breaks?: PriceBreak[];
|
|
61
|
+
promo?: PricePromo;
|
|
62
|
+
visibleOnStorefront?: boolean;
|
|
63
|
+
} | ({
|
|
64
|
+
kind: 'absolute';
|
|
65
|
+
listId: number;
|
|
66
|
+
amount: number;
|
|
67
|
+
breaks?: PriceBreak[];
|
|
68
|
+
promo?: PricePromo;
|
|
69
|
+
visibleOnStorefront?: boolean;
|
|
70
|
+
} & CurrencyStamp);
|
|
71
|
+
}
|
|
72
|
+
export {};
|
package/dist/pricing.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/product.d.ts
CHANGED
|
@@ -43,10 +43,11 @@ declare global {
|
|
|
43
43
|
isNew: boolean;
|
|
44
44
|
isService: boolean;
|
|
45
45
|
cost: number;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
prices?: PriceSlot[];
|
|
47
|
+
price1?: number;
|
|
48
|
+
price2?: number;
|
|
49
|
+
price3?: number;
|
|
50
|
+
price4?: number;
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
export {};
|
package/dist/store.d.ts
CHANGED
package/dist/subscription.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ declare global {
|
|
|
63
63
|
* every existing plan in `FEATURE_MATRIX` must then declare the new key
|
|
64
64
|
* (TypeScript enforces this via `Record<FeatureKey, Entitlement>`).
|
|
65
65
|
*/
|
|
66
|
-
type FeatureKey = 'maxOrdersMonth' | 'maxInvoicesMonth' | 'maxProducts' | 'maxUsers' | 'maxCustomers' | 'maxStores' | 'afipInvoicing' | 'paymentIntegrations' | 'suppliers' | 'cashManagement' | 'multiStore' | 'importExport' | 'advancedReports' | 'customBranding' | 'apiAccess' | 'prioritySupport' | 'whatsappCommerce' | 'aiFeatures' | 'mobileApp' | 'customDomain';
|
|
66
|
+
type FeatureKey = 'maxOrdersMonth' | 'maxInvoicesMonth' | 'maxProducts' | 'maxUsers' | 'maxCustomers' | 'maxStores' | 'priceListsMax' | 'afipInvoicing' | 'paymentIntegrations' | 'suppliers' | 'cashManagement' | 'multiStore' | 'importExport' | 'advancedReports' | 'customBranding' | 'apiAccess' | 'prioritySupport' | 'whatsappCommerce' | 'aiFeatures' | 'mobileApp' | 'customDomain' | 'advancedPricing';
|
|
67
67
|
/** Full feature matrix — every tier declares every feature. */
|
|
68
68
|
type FeatureMatrix = Record<PlanTier, Record<FeatureKey, Entitlement>>;
|
|
69
69
|
/** Resolved entitlements for a specific tenant (matrix + overrides applied). */
|