@use-stall/types 0.2.11 → 0.2.13
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/package.json +1 -1
- package/src/taxes.d.ts +33 -28
package/package.json
CHANGED
package/src/taxes.d.ts
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
export interface UnifiedTaxRate {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string; // VAT
|
|
4
|
+
class: string; // tax class id
|
|
5
|
+
jurisdiction: {
|
|
6
|
+
country: string; // ZA, US
|
|
7
|
+
states: string[]; // States or provinces -> Empty array applies to all
|
|
8
|
+
postcode: string[]; // An array of postal codes -> Empty array applies to all
|
|
9
|
+
locations: string[]; // Useful for in-person sales -> Empty array applies to all
|
|
10
|
+
};
|
|
11
|
+
rate: number;
|
|
12
|
+
type: "fixed" | "percentage";
|
|
13
|
+
calculation_base: "net" | "gross";
|
|
14
|
+
application: "per_item" | "per_order";
|
|
15
|
+
priority: number; // application order
|
|
16
|
+
compound: boolean;
|
|
17
|
+
rules: UnifiedTaxRateRule[];
|
|
12
18
|
metadata: {
|
|
13
19
|
stall_offline_id: string;
|
|
14
20
|
stall_offline_created_at: string;
|
|
@@ -18,17 +24,21 @@ export interface UnifiedTaxRegionType {
|
|
|
18
24
|
}; // Additional metadata
|
|
19
25
|
}
|
|
20
26
|
|
|
21
|
-
export interface
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
type: "
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
export interface UnifiedTaxRateRule {
|
|
28
|
+
type: "exemption" | "reduction";
|
|
29
|
+
conditions: UnifiedTaxRateRuleCondition[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface UnifiedTaxRateRuleCondition {
|
|
33
|
+
type: "item_price" | "item_quantity" | "total_price";
|
|
34
|
+
operator: "eq" | "gt" | "gte" | "lt" | "lte";
|
|
35
|
+
amount: number;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface UnifiedTaxClass {
|
|
39
|
+
id: string;
|
|
40
|
+
name: string; // Standard
|
|
41
|
+
tax_calculation: "inclusive" | "additive";
|
|
32
42
|
metadata: {
|
|
33
43
|
stall_offline_id: string;
|
|
34
44
|
stall_offline_created_at: string;
|
|
@@ -36,9 +46,4 @@ export interface UnifiedTaxRateType {
|
|
|
36
46
|
stall_offline_deleted_at: string;
|
|
37
47
|
[key: string]: any;
|
|
38
48
|
}; // Additional metadata
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface UnifiedTaxRateRule {
|
|
42
|
-
type: "collection" | "product" | "category" | "product_type";
|
|
43
|
-
value: string;
|
|
44
|
-
}
|
|
49
|
+
}
|