@shushed/helpers 0.0.225 → 0.0.226-fix-erp-631-20260105145100
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/cjs/contracts/index.js +1 -5
- package/dist/cjs/dist-dereferenced/index.js +1 -5
- package/dist/cjs/src-public/airtable.js +59 -96
- package/dist/cjs/src-public/bcOrder.js +38 -0
- package/dist/cjs/src-public/centra.js +5 -56
- package/dist/cjs/src-public/env.js +1 -1
- package/dist/cjs/src-public/index.js +1 -3
- package/dist/package.json +2 -3
- package/dist/types/contracts/index.d.ts +0 -2
- package/dist/types/dist-dereferenced/index.d.ts +0 -2
- package/dist/types/dist-types/index.d.ts +0 -2
- package/dist/types/src-public/airtable.d.ts +9 -0
- package/dist/types/src-public/centra.d.ts +0 -3
- package/dist/types/src-public/index.d.ts +0 -1
- package/package.json +3 -4
- package/dist/cjs/contracts/purchase-orderline.schema.json +0 -124
- package/dist/cjs/contracts/stock-movement.schema.json +0 -144
- package/dist/cjs/dist-dereferenced/purchase-orderline.js +0 -4
- package/dist/cjs/dist-dereferenced/stock-movement.js +0 -4
- package/dist/cjs/dist-types/purchase-orderline.js +0 -2
- package/dist/cjs/dist-types/stock-movement.js +0 -2
- package/dist/cjs/src-public/sitoo.js +0 -349
- package/dist/types/dist-dereferenced/purchase-orderline.d.ts +0 -110
- package/dist/types/dist-dereferenced/stock-movement.d.ts +0 -110
- package/dist/types/dist-types/purchase-orderline.d.ts +0 -30
- package/dist/types/dist-types/stock-movement.d.ts +0 -30
- package/dist/types/src-public/sitoo.d.ts +0 -254
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
declare const schema: {
|
|
2
|
-
readonly $schema: "http://json-schema.org/draft-07/schema#";
|
|
3
|
-
readonly title: "Stock Movement Schema";
|
|
4
|
-
readonly type: "object";
|
|
5
|
-
readonly additionalProperties: false;
|
|
6
|
-
readonly properties: {
|
|
7
|
-
readonly style_id: {
|
|
8
|
-
readonly type: "string";
|
|
9
|
-
readonly minLength: 1;
|
|
10
|
-
};
|
|
11
|
-
readonly colour_id: {
|
|
12
|
-
readonly type: "string";
|
|
13
|
-
readonly minLength: 1;
|
|
14
|
-
};
|
|
15
|
-
readonly product_id: {
|
|
16
|
-
readonly type: "string";
|
|
17
|
-
readonly minLength: 1;
|
|
18
|
-
};
|
|
19
|
-
readonly size_code: {
|
|
20
|
-
readonly type: "string";
|
|
21
|
-
readonly minLength: 1;
|
|
22
|
-
};
|
|
23
|
-
readonly sku: {
|
|
24
|
-
readonly type: "string";
|
|
25
|
-
readonly minLength: 1;
|
|
26
|
-
};
|
|
27
|
-
readonly season_id: {
|
|
28
|
-
readonly type: "string";
|
|
29
|
-
};
|
|
30
|
-
readonly drop: {
|
|
31
|
-
readonly type: "string";
|
|
32
|
-
};
|
|
33
|
-
readonly document_line_no: {
|
|
34
|
-
readonly type: "string";
|
|
35
|
-
};
|
|
36
|
-
readonly document_no: {
|
|
37
|
-
readonly type: "string";
|
|
38
|
-
};
|
|
39
|
-
readonly created_at: {
|
|
40
|
-
readonly type: "string";
|
|
41
|
-
readonly format: "date-time";
|
|
42
|
-
};
|
|
43
|
-
readonly location_code: {
|
|
44
|
-
readonly type: "string";
|
|
45
|
-
};
|
|
46
|
-
readonly quantity: {
|
|
47
|
-
readonly type: "number";
|
|
48
|
-
};
|
|
49
|
-
readonly quantity_received: {
|
|
50
|
-
readonly type: "number";
|
|
51
|
-
};
|
|
52
|
-
readonly quantity_to_receive: {
|
|
53
|
-
readonly type: "number";
|
|
54
|
-
};
|
|
55
|
-
readonly last_modified_at: {
|
|
56
|
-
readonly type: "string";
|
|
57
|
-
readonly format: "date-time";
|
|
58
|
-
};
|
|
59
|
-
readonly expected_date: {
|
|
60
|
-
readonly type: "string";
|
|
61
|
-
readonly format: "date-time";
|
|
62
|
-
};
|
|
63
|
-
readonly unit_price: {
|
|
64
|
-
readonly oneOf: readonly [{
|
|
65
|
-
readonly $schema: "http://json-schema.org/draft-07/schema#";
|
|
66
|
-
readonly title: "Money";
|
|
67
|
-
readonly type: "object";
|
|
68
|
-
readonly additionalProperties: false;
|
|
69
|
-
readonly properties: {
|
|
70
|
-
readonly value: {
|
|
71
|
-
readonly type: "integer";
|
|
72
|
-
readonly minimum: 0;
|
|
73
|
-
};
|
|
74
|
-
readonly decimal_places: {
|
|
75
|
-
readonly type: "integer";
|
|
76
|
-
readonly minimum: 0;
|
|
77
|
-
readonly maximum: 4;
|
|
78
|
-
};
|
|
79
|
-
readonly currency: {
|
|
80
|
-
readonly title: "Currency";
|
|
81
|
-
readonly $schema: "http://json-schema.org/draft-07/schema#";
|
|
82
|
-
readonly type: "string";
|
|
83
|
-
readonly enum: readonly ["AFN", "ALL", "DZD", "USD", "EUR", "AOA", "XCD", "ARS", "AMD", "AWG", "AUD", "AZN", "BSD", "BHD", "BDT", "BBD", "BYN", "BZD", "XOF", "BMD", "BTN", "INR", "BOB", "BOV", "BAM", "BWP", "NOK", "BRL", "BND", "BGN", "BIF", "CVE", "KHR", "XAF", "CAD", "KYD", "CLF", "CLP", "CNY", "COP", "COU", "KMF", "CDF", "NZD", "CRC", "CUC", "CUP", "ANG", "CZK", "DKK", "DJF", "DOP", "EGP", "SVC", "ERN", "ETB", "FKP", "FJD", "XPF", "GMD", "GEL", "GHS", "GIP", "GTQ", "GBP", "GNF", "GYD", "HTG", "HNL", "HKD", "HUF", "ISK", "IDR", "XDR", "IRR", "IQD", "ILS", "JMD", "JPY", "JOD", "KZT", "KES", "KPW", "KRW", "KWD", "KGS", "LAK", "LBP", "LSL", "ZAR", "LRD", "LYD", "CHF", "MOP", "MGA", "MWK", "MYR", "MVR", "MRU", "MUR", "XUA", "MXN", "MXV", "MDL", "MNT", "MAD", "MZN", "MMK", "NAD", "NPR", "NIO", "NGN", "OMR", "PKR", "PAB", "PGK", "PYG", "PEN", "PHP", "PLN", "QAR", "MKD", "RON", "RUB", "RWF", "SHP", "WST", "STN", "SAR", "RSD", "SCR", "SLE", "SGD", "XSU", "SBD", "SOS", "SSP", "LKR", "SDG", "SRD", "SZL", "SEK", "CHE", "CHW", "SYP", "TWD", "TJS", "TZS", "THB", "TOP", "TTD", "TND", "TRY", "TMT", "UGX", "UAH", "AED", "USN", "UYI", "UYU", "UZS", "VUV", "VEF", "VED", "VND", "YER", "ZMW", "ZWL"];
|
|
84
|
-
};
|
|
85
|
-
readonly lcy_value: {
|
|
86
|
-
readonly type: "integer";
|
|
87
|
-
readonly minimum: 0;
|
|
88
|
-
};
|
|
89
|
-
readonly lcy_currency: {
|
|
90
|
-
readonly title: "LCY Currency";
|
|
91
|
-
readonly $schema: "http://json-schema.org/draft-07/schema#";
|
|
92
|
-
readonly type: "string";
|
|
93
|
-
readonly enum: readonly ["AFN", "ALL", "DZD", "USD", "EUR", "AOA", "XCD", "ARS", "AMD", "AWG", "AUD", "AZN", "BSD", "BHD", "BDT", "BBD", "BYN", "BZD", "XOF", "BMD", "BTN", "INR", "BOB", "BOV", "BAM", "BWP", "NOK", "BRL", "BND", "BGN", "BIF", "CVE", "KHR", "XAF", "CAD", "KYD", "CLF", "CLP", "CNY", "COP", "COU", "KMF", "CDF", "NZD", "CRC", "CUC", "CUP", "ANG", "CZK", "DKK", "DJF", "DOP", "EGP", "SVC", "ERN", "ETB", "FKP", "FJD", "XPF", "GMD", "GEL", "GHS", "GIP", "GTQ", "GBP", "GNF", "GYD", "HTG", "HNL", "HKD", "HUF", "ISK", "IDR", "XDR", "IRR", "IQD", "ILS", "JMD", "JPY", "JOD", "KZT", "KES", "KPW", "KRW", "KWD", "KGS", "LAK", "LBP", "LSL", "ZAR", "LRD", "LYD", "CHF", "MOP", "MGA", "MWK", "MYR", "MVR", "MRU", "MUR", "XUA", "MXN", "MXV", "MDL", "MNT", "MAD", "MZN", "MMK", "NAD", "NPR", "NIO", "NGN", "OMR", "PKR", "PAB", "PGK", "PYG", "PEN", "PHP", "PLN", "QAR", "MKD", "RON", "RUB", "RWF", "SHP", "WST", "STN", "SAR", "RSD", "SCR", "SLE", "SGD", "XSU", "SBD", "SOS", "SSP", "LKR", "SDG", "SRD", "SZL", "SEK", "CHE", "CHW", "SYP", "TWD", "TJS", "TZS", "THB", "TOP", "TTD", "TND", "TRY", "TMT", "UGX", "UAH", "AED", "USN", "UYI", "UYU", "UZS", "VUV", "VEF", "VED", "VND", "YER", "ZMW", "ZWL"];
|
|
94
|
-
};
|
|
95
|
-
readonly lcy_decimal_places: {
|
|
96
|
-
readonly type: "integer";
|
|
97
|
-
readonly minimum: 0;
|
|
98
|
-
readonly maximum: 4;
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
readonly required: readonly ["value", "currency", "lcy_value", "lcy_currency", "decimal_places", "lcy_decimal_places"];
|
|
102
|
-
}, {
|
|
103
|
-
readonly type: "null";
|
|
104
|
-
}];
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
readonly required: readonly ["document_no", "document_line_no", "style_id", "colour_id", "size_code", "sku", "product_id", "season_id", "drop"];
|
|
108
|
-
readonly $id: "https://shushed.example.com/stock-move.schema.json";
|
|
109
|
-
};
|
|
110
|
-
export default schema;
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
declare const schema: {
|
|
2
|
-
readonly $schema: "http://json-schema.org/draft-07/schema#";
|
|
3
|
-
readonly title: "Stock Movement Schema";
|
|
4
|
-
readonly type: "object";
|
|
5
|
-
readonly additionalProperties: false;
|
|
6
|
-
readonly properties: {
|
|
7
|
-
readonly style_id: {
|
|
8
|
-
readonly type: "string";
|
|
9
|
-
readonly minLength: 1;
|
|
10
|
-
};
|
|
11
|
-
readonly colour_id: {
|
|
12
|
-
readonly type: "string";
|
|
13
|
-
readonly minLength: 1;
|
|
14
|
-
};
|
|
15
|
-
readonly size_code: {
|
|
16
|
-
readonly type: "string";
|
|
17
|
-
readonly minLength: 1;
|
|
18
|
-
};
|
|
19
|
-
readonly location_code: {
|
|
20
|
-
readonly type: "string";
|
|
21
|
-
readonly pattern: "^\\d{3}-[A-Z]+$|^[A-Z]{2,}-?[A-Z]*$|^[A-Z]{2,}\\d{3}$";
|
|
22
|
-
};
|
|
23
|
-
readonly source_system: {
|
|
24
|
-
readonly type: "string";
|
|
25
|
-
readonly enum: readonly ["bc", "centra", "sitoo"];
|
|
26
|
-
};
|
|
27
|
-
readonly quantity: {
|
|
28
|
-
readonly type: "integer";
|
|
29
|
-
readonly minimum: 0;
|
|
30
|
-
};
|
|
31
|
-
readonly entry_no: {
|
|
32
|
-
readonly type: "string";
|
|
33
|
-
};
|
|
34
|
-
readonly external_entry_no: {
|
|
35
|
-
readonly type: "string";
|
|
36
|
-
};
|
|
37
|
-
readonly document_no: {
|
|
38
|
-
readonly type: "string";
|
|
39
|
-
};
|
|
40
|
-
readonly external_document_no: {
|
|
41
|
-
readonly type: "string";
|
|
42
|
-
};
|
|
43
|
-
readonly type: {
|
|
44
|
-
readonly type: "string";
|
|
45
|
-
readonly enum: readonly ["transfer", "negative adjustment", "positive adjustment", "purchase", "sale"];
|
|
46
|
-
};
|
|
47
|
-
readonly unit_cost: {
|
|
48
|
-
readonly oneOf: readonly [{
|
|
49
|
-
readonly $schema: "http://json-schema.org/draft-07/schema#";
|
|
50
|
-
readonly title: "Money";
|
|
51
|
-
readonly type: "object";
|
|
52
|
-
readonly additionalProperties: false;
|
|
53
|
-
readonly properties: {
|
|
54
|
-
readonly value: {
|
|
55
|
-
readonly type: "integer";
|
|
56
|
-
readonly minimum: 0;
|
|
57
|
-
};
|
|
58
|
-
readonly decimal_places: {
|
|
59
|
-
readonly type: "integer";
|
|
60
|
-
readonly minimum: 0;
|
|
61
|
-
readonly maximum: 4;
|
|
62
|
-
};
|
|
63
|
-
readonly currency: {
|
|
64
|
-
readonly title: "Currency";
|
|
65
|
-
readonly $schema: "http://json-schema.org/draft-07/schema#";
|
|
66
|
-
readonly type: "string";
|
|
67
|
-
readonly enum: readonly ["AFN", "ALL", "DZD", "USD", "EUR", "AOA", "XCD", "ARS", "AMD", "AWG", "AUD", "AZN", "BSD", "BHD", "BDT", "BBD", "BYN", "BZD", "XOF", "BMD", "BTN", "INR", "BOB", "BOV", "BAM", "BWP", "NOK", "BRL", "BND", "BGN", "BIF", "CVE", "KHR", "XAF", "CAD", "KYD", "CLF", "CLP", "CNY", "COP", "COU", "KMF", "CDF", "NZD", "CRC", "CUC", "CUP", "ANG", "CZK", "DKK", "DJF", "DOP", "EGP", "SVC", "ERN", "ETB", "FKP", "FJD", "XPF", "GMD", "GEL", "GHS", "GIP", "GTQ", "GBP", "GNF", "GYD", "HTG", "HNL", "HKD", "HUF", "ISK", "IDR", "XDR", "IRR", "IQD", "ILS", "JMD", "JPY", "JOD", "KZT", "KES", "KPW", "KRW", "KWD", "KGS", "LAK", "LBP", "LSL", "ZAR", "LRD", "LYD", "CHF", "MOP", "MGA", "MWK", "MYR", "MVR", "MRU", "MUR", "XUA", "MXN", "MXV", "MDL", "MNT", "MAD", "MZN", "MMK", "NAD", "NPR", "NIO", "NGN", "OMR", "PKR", "PAB", "PGK", "PYG", "PEN", "PHP", "PLN", "QAR", "MKD", "RON", "RUB", "RWF", "SHP", "WST", "STN", "SAR", "RSD", "SCR", "SLE", "SGD", "XSU", "SBD", "SOS", "SSP", "LKR", "SDG", "SRD", "SZL", "SEK", "CHE", "CHW", "SYP", "TWD", "TJS", "TZS", "THB", "TOP", "TTD", "TND", "TRY", "TMT", "UGX", "UAH", "AED", "USN", "UYI", "UYU", "UZS", "VUV", "VEF", "VED", "VND", "YER", "ZMW", "ZWL"];
|
|
68
|
-
};
|
|
69
|
-
readonly lcy_value: {
|
|
70
|
-
readonly type: "integer";
|
|
71
|
-
readonly minimum: 0;
|
|
72
|
-
};
|
|
73
|
-
readonly lcy_currency: {
|
|
74
|
-
readonly title: "LCY Currency";
|
|
75
|
-
readonly $schema: "http://json-schema.org/draft-07/schema#";
|
|
76
|
-
readonly type: "string";
|
|
77
|
-
readonly enum: readonly ["AFN", "ALL", "DZD", "USD", "EUR", "AOA", "XCD", "ARS", "AMD", "AWG", "AUD", "AZN", "BSD", "BHD", "BDT", "BBD", "BYN", "BZD", "XOF", "BMD", "BTN", "INR", "BOB", "BOV", "BAM", "BWP", "NOK", "BRL", "BND", "BGN", "BIF", "CVE", "KHR", "XAF", "CAD", "KYD", "CLF", "CLP", "CNY", "COP", "COU", "KMF", "CDF", "NZD", "CRC", "CUC", "CUP", "ANG", "CZK", "DKK", "DJF", "DOP", "EGP", "SVC", "ERN", "ETB", "FKP", "FJD", "XPF", "GMD", "GEL", "GHS", "GIP", "GTQ", "GBP", "GNF", "GYD", "HTG", "HNL", "HKD", "HUF", "ISK", "IDR", "XDR", "IRR", "IQD", "ILS", "JMD", "JPY", "JOD", "KZT", "KES", "KPW", "KRW", "KWD", "KGS", "LAK", "LBP", "LSL", "ZAR", "LRD", "LYD", "CHF", "MOP", "MGA", "MWK", "MYR", "MVR", "MRU", "MUR", "XUA", "MXN", "MXV", "MDL", "MNT", "MAD", "MZN", "MMK", "NAD", "NPR", "NIO", "NGN", "OMR", "PKR", "PAB", "PGK", "PYG", "PEN", "PHP", "PLN", "QAR", "MKD", "RON", "RUB", "RWF", "SHP", "WST", "STN", "SAR", "RSD", "SCR", "SLE", "SGD", "XSU", "SBD", "SOS", "SSP", "LKR", "SDG", "SRD", "SZL", "SEK", "CHE", "CHW", "SYP", "TWD", "TJS", "TZS", "THB", "TOP", "TTD", "TND", "TRY", "TMT", "UGX", "UAH", "AED", "USN", "UYI", "UYU", "UZS", "VUV", "VEF", "VED", "VND", "YER", "ZMW", "ZWL"];
|
|
78
|
-
};
|
|
79
|
-
readonly lcy_decimal_places: {
|
|
80
|
-
readonly type: "integer";
|
|
81
|
-
readonly minimum: 0;
|
|
82
|
-
readonly maximum: 4;
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
readonly required: readonly ["value", "currency", "lcy_value", "lcy_currency", "decimal_places", "lcy_decimal_places"];
|
|
86
|
-
}, {
|
|
87
|
-
readonly type: "null";
|
|
88
|
-
}];
|
|
89
|
-
};
|
|
90
|
-
readonly document_date: {
|
|
91
|
-
readonly type: "string";
|
|
92
|
-
readonly format: "date";
|
|
93
|
-
};
|
|
94
|
-
readonly posting_date: {
|
|
95
|
-
readonly type: "string";
|
|
96
|
-
readonly format: "date";
|
|
97
|
-
};
|
|
98
|
-
readonly created_at: {
|
|
99
|
-
readonly type: "string";
|
|
100
|
-
readonly format: "date-time";
|
|
101
|
-
};
|
|
102
|
-
readonly last_modified_at: {
|
|
103
|
-
readonly type: "string";
|
|
104
|
-
readonly format: "date-time";
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
readonly required: readonly ["style_id", "source_system", "location_code", "colour_id", "size_code", "last_modified_at", "quantity", "created_at", "document_date", "type"];
|
|
108
|
-
readonly $id: "https://shushed.example.com/stock-move.schema.json";
|
|
109
|
-
};
|
|
110
|
-
export default schema;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export type Currency = ("AFN" | "ALL" | "DZD" | "USD" | "EUR" | "AOA" | "XCD" | "ARS" | "AMD" | "AWG" | "AUD" | "AZN" | "BSD" | "BHD" | "BDT" | "BBD" | "BYN" | "BZD" | "XOF" | "BMD" | "BTN" | "INR" | "BOB" | "BOV" | "BAM" | "BWP" | "NOK" | "BRL" | "BND" | "BGN" | "BIF" | "CVE" | "KHR" | "XAF" | "CAD" | "KYD" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "KMF" | "CDF" | "NZD" | "CRC" | "CUC" | "CUP" | "ANG" | "CZK" | "DKK" | "DJF" | "DOP" | "EGP" | "SVC" | "ERN" | "ETB" | "FKP" | "FJD" | "XPF" | "GMD" | "GEL" | "GHS" | "GIP" | "GTQ" | "GBP" | "GNF" | "GYD" | "HTG" | "HNL" | "HKD" | "HUF" | "ISK" | "IDR" | "XDR" | "IRR" | "IQD" | "ILS" | "JMD" | "JPY" | "JOD" | "KZT" | "KES" | "KPW" | "KRW" | "KWD" | "KGS" | "LAK" | "LBP" | "LSL" | "ZAR" | "LRD" | "LYD" | "CHF" | "MOP" | "MGA" | "MWK" | "MYR" | "MVR" | "MRU" | "MUR" | "XUA" | "MXN" | "MXV" | "MDL" | "MNT" | "MAD" | "MZN" | "MMK" | "NAD" | "NPR" | "NIO" | "NGN" | "OMR" | "PKR" | "PAB" | "PGK" | "PYG" | "PEN" | "PHP" | "PLN" | "QAR" | "MKD" | "RON" | "RUB" | "RWF" | "SHP" | "WST" | "STN" | "SAR" | "RSD" | "SCR" | "SLE" | "SGD" | "XSU" | "SBD" | "SOS" | "SSP" | "LKR" | "SDG" | "SRD" | "SZL" | "SEK" | "CHE" | "CHW" | "SYP" | "TWD" | "TJS" | "TZS" | "THB" | "TOP" | "TTD" | "TND" | "TRY" | "TMT" | "UGX" | "UAH" | "AED" | "USN" | "UYI" | "UYU" | "UZS" | "VUV" | "VEF" | "VED" | "VND" | "YER" | "ZMW" | "ZWL");
|
|
2
|
-
export type LCYCurrency = ("AFN" | "ALL" | "DZD" | "USD" | "EUR" | "AOA" | "XCD" | "ARS" | "AMD" | "AWG" | "AUD" | "AZN" | "BSD" | "BHD" | "BDT" | "BBD" | "BYN" | "BZD" | "XOF" | "BMD" | "BTN" | "INR" | "BOB" | "BOV" | "BAM" | "BWP" | "NOK" | "BRL" | "BND" | "BGN" | "BIF" | "CVE" | "KHR" | "XAF" | "CAD" | "KYD" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "KMF" | "CDF" | "NZD" | "CRC" | "CUC" | "CUP" | "ANG" | "CZK" | "DKK" | "DJF" | "DOP" | "EGP" | "SVC" | "ERN" | "ETB" | "FKP" | "FJD" | "XPF" | "GMD" | "GEL" | "GHS" | "GIP" | "GTQ" | "GBP" | "GNF" | "GYD" | "HTG" | "HNL" | "HKD" | "HUF" | "ISK" | "IDR" | "XDR" | "IRR" | "IQD" | "ILS" | "JMD" | "JPY" | "JOD" | "KZT" | "KES" | "KPW" | "KRW" | "KWD" | "KGS" | "LAK" | "LBP" | "LSL" | "ZAR" | "LRD" | "LYD" | "CHF" | "MOP" | "MGA" | "MWK" | "MYR" | "MVR" | "MRU" | "MUR" | "XUA" | "MXN" | "MXV" | "MDL" | "MNT" | "MAD" | "MZN" | "MMK" | "NAD" | "NPR" | "NIO" | "NGN" | "OMR" | "PKR" | "PAB" | "PGK" | "PYG" | "PEN" | "PHP" | "PLN" | "QAR" | "MKD" | "RON" | "RUB" | "RWF" | "SHP" | "WST" | "STN" | "SAR" | "RSD" | "SCR" | "SLE" | "SGD" | "XSU" | "SBD" | "SOS" | "SSP" | "LKR" | "SDG" | "SRD" | "SZL" | "SEK" | "CHE" | "CHW" | "SYP" | "TWD" | "TJS" | "TZS" | "THB" | "TOP" | "TTD" | "TND" | "TRY" | "TMT" | "UGX" | "UAH" | "AED" | "USN" | "UYI" | "UYU" | "UZS" | "VUV" | "VEF" | "VED" | "VND" | "YER" | "ZMW" | "ZWL");
|
|
3
|
-
export interface __MainSchema {
|
|
4
|
-
style_id: string;
|
|
5
|
-
colour_id: string;
|
|
6
|
-
product_id: string;
|
|
7
|
-
size_code: string;
|
|
8
|
-
sku: string;
|
|
9
|
-
season_id: string;
|
|
10
|
-
drop: string;
|
|
11
|
-
document_line_no: string;
|
|
12
|
-
document_no: string;
|
|
13
|
-
created_at?: string;
|
|
14
|
-
location_code?: string;
|
|
15
|
-
quantity?: number;
|
|
16
|
-
quantity_received?: number;
|
|
17
|
-
quantity_to_receive?: number;
|
|
18
|
-
last_modified_at?: string;
|
|
19
|
-
expected_date?: string;
|
|
20
|
-
unit_price?: (Money | null);
|
|
21
|
-
}
|
|
22
|
-
export interface Money {
|
|
23
|
-
value: number;
|
|
24
|
-
decimal_places: number;
|
|
25
|
-
currency: Currency;
|
|
26
|
-
lcy_value: number;
|
|
27
|
-
lcy_currency: LCYCurrency;
|
|
28
|
-
lcy_decimal_places: number;
|
|
29
|
-
}
|
|
30
|
-
export default __MainSchema;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export type Currency = ("AFN" | "ALL" | "DZD" | "USD" | "EUR" | "AOA" | "XCD" | "ARS" | "AMD" | "AWG" | "AUD" | "AZN" | "BSD" | "BHD" | "BDT" | "BBD" | "BYN" | "BZD" | "XOF" | "BMD" | "BTN" | "INR" | "BOB" | "BOV" | "BAM" | "BWP" | "NOK" | "BRL" | "BND" | "BGN" | "BIF" | "CVE" | "KHR" | "XAF" | "CAD" | "KYD" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "KMF" | "CDF" | "NZD" | "CRC" | "CUC" | "CUP" | "ANG" | "CZK" | "DKK" | "DJF" | "DOP" | "EGP" | "SVC" | "ERN" | "ETB" | "FKP" | "FJD" | "XPF" | "GMD" | "GEL" | "GHS" | "GIP" | "GTQ" | "GBP" | "GNF" | "GYD" | "HTG" | "HNL" | "HKD" | "HUF" | "ISK" | "IDR" | "XDR" | "IRR" | "IQD" | "ILS" | "JMD" | "JPY" | "JOD" | "KZT" | "KES" | "KPW" | "KRW" | "KWD" | "KGS" | "LAK" | "LBP" | "LSL" | "ZAR" | "LRD" | "LYD" | "CHF" | "MOP" | "MGA" | "MWK" | "MYR" | "MVR" | "MRU" | "MUR" | "XUA" | "MXN" | "MXV" | "MDL" | "MNT" | "MAD" | "MZN" | "MMK" | "NAD" | "NPR" | "NIO" | "NGN" | "OMR" | "PKR" | "PAB" | "PGK" | "PYG" | "PEN" | "PHP" | "PLN" | "QAR" | "MKD" | "RON" | "RUB" | "RWF" | "SHP" | "WST" | "STN" | "SAR" | "RSD" | "SCR" | "SLE" | "SGD" | "XSU" | "SBD" | "SOS" | "SSP" | "LKR" | "SDG" | "SRD" | "SZL" | "SEK" | "CHE" | "CHW" | "SYP" | "TWD" | "TJS" | "TZS" | "THB" | "TOP" | "TTD" | "TND" | "TRY" | "TMT" | "UGX" | "UAH" | "AED" | "USN" | "UYI" | "UYU" | "UZS" | "VUV" | "VEF" | "VED" | "VND" | "YER" | "ZMW" | "ZWL");
|
|
2
|
-
export type LCYCurrency = ("AFN" | "ALL" | "DZD" | "USD" | "EUR" | "AOA" | "XCD" | "ARS" | "AMD" | "AWG" | "AUD" | "AZN" | "BSD" | "BHD" | "BDT" | "BBD" | "BYN" | "BZD" | "XOF" | "BMD" | "BTN" | "INR" | "BOB" | "BOV" | "BAM" | "BWP" | "NOK" | "BRL" | "BND" | "BGN" | "BIF" | "CVE" | "KHR" | "XAF" | "CAD" | "KYD" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "KMF" | "CDF" | "NZD" | "CRC" | "CUC" | "CUP" | "ANG" | "CZK" | "DKK" | "DJF" | "DOP" | "EGP" | "SVC" | "ERN" | "ETB" | "FKP" | "FJD" | "XPF" | "GMD" | "GEL" | "GHS" | "GIP" | "GTQ" | "GBP" | "GNF" | "GYD" | "HTG" | "HNL" | "HKD" | "HUF" | "ISK" | "IDR" | "XDR" | "IRR" | "IQD" | "ILS" | "JMD" | "JPY" | "JOD" | "KZT" | "KES" | "KPW" | "KRW" | "KWD" | "KGS" | "LAK" | "LBP" | "LSL" | "ZAR" | "LRD" | "LYD" | "CHF" | "MOP" | "MGA" | "MWK" | "MYR" | "MVR" | "MRU" | "MUR" | "XUA" | "MXN" | "MXV" | "MDL" | "MNT" | "MAD" | "MZN" | "MMK" | "NAD" | "NPR" | "NIO" | "NGN" | "OMR" | "PKR" | "PAB" | "PGK" | "PYG" | "PEN" | "PHP" | "PLN" | "QAR" | "MKD" | "RON" | "RUB" | "RWF" | "SHP" | "WST" | "STN" | "SAR" | "RSD" | "SCR" | "SLE" | "SGD" | "XSU" | "SBD" | "SOS" | "SSP" | "LKR" | "SDG" | "SRD" | "SZL" | "SEK" | "CHE" | "CHW" | "SYP" | "TWD" | "TJS" | "TZS" | "THB" | "TOP" | "TTD" | "TND" | "TRY" | "TMT" | "UGX" | "UAH" | "AED" | "USN" | "UYI" | "UYU" | "UZS" | "VUV" | "VEF" | "VED" | "VND" | "YER" | "ZMW" | "ZWL");
|
|
3
|
-
export interface __MainSchema {
|
|
4
|
-
style_id: string;
|
|
5
|
-
colour_id: string;
|
|
6
|
-
size_code: string;
|
|
7
|
-
location_code: string;
|
|
8
|
-
source_system: ("bc" | "centra" | "sitoo");
|
|
9
|
-
quantity: number;
|
|
10
|
-
description?: string;
|
|
11
|
-
entry_no?: string;
|
|
12
|
-
external_entry_no?: string;
|
|
13
|
-
document_no?: string;
|
|
14
|
-
external_document_no?: string;
|
|
15
|
-
type: ("transfer" | "negative adjustment" | "positive adjustment" | "purchase" | "sale");
|
|
16
|
-
unit_cost?: (Money | null);
|
|
17
|
-
document_date: string;
|
|
18
|
-
posting_date?: string;
|
|
19
|
-
created_at: string;
|
|
20
|
-
last_modified_at: string;
|
|
21
|
-
}
|
|
22
|
-
export interface Money {
|
|
23
|
-
value: number;
|
|
24
|
-
decimal_places: number;
|
|
25
|
-
currency: Currency;
|
|
26
|
-
lcy_value: number;
|
|
27
|
-
lcy_currency: LCYCurrency;
|
|
28
|
-
lcy_decimal_places: number;
|
|
29
|
-
}
|
|
30
|
-
export default __MainSchema;
|
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import EnvEngine from './env';
|
|
2
|
-
import Runtime from './runtime';
|
|
3
|
-
export declare enum SitooOrderState {
|
|
4
|
-
Abandoned = -1,
|
|
5
|
-
Open = 0,
|
|
6
|
-
Closed = 10,
|
|
7
|
-
Cancelled = 20
|
|
8
|
-
}
|
|
9
|
-
export declare enum SitooOrderType {
|
|
10
|
-
Order = 10,
|
|
11
|
-
Booking = 100,
|
|
12
|
-
POSParked = 110
|
|
13
|
-
}
|
|
14
|
-
export declare enum SitooPaymentState {
|
|
15
|
-
None = 0,
|
|
16
|
-
Pending = 10,
|
|
17
|
-
Reserved = 15,
|
|
18
|
-
Successful = 20,
|
|
19
|
-
Cancelled = 30,
|
|
20
|
-
Failed = 40
|
|
21
|
-
}
|
|
22
|
-
export declare enum SitooOrderItemType {
|
|
23
|
-
Product = 10,
|
|
24
|
-
Discount = 20
|
|
25
|
-
}
|
|
26
|
-
export interface SitooMoney {
|
|
27
|
-
value: string;
|
|
28
|
-
decimalplaces: number;
|
|
29
|
-
currency: string;
|
|
30
|
-
}
|
|
31
|
-
export interface SitooOrderItemSalesTax {
|
|
32
|
-
name: string;
|
|
33
|
-
code?: string;
|
|
34
|
-
externalid?: string | null;
|
|
35
|
-
groupregion?: string | null;
|
|
36
|
-
moneytotal: SitooMoney;
|
|
37
|
-
moneytax: SitooMoney;
|
|
38
|
-
decimaltaxvalue: string;
|
|
39
|
-
}
|
|
40
|
-
export interface SitooOrderItem {
|
|
41
|
-
orderitemid: number;
|
|
42
|
-
orderitemtype: SitooOrderItemType;
|
|
43
|
-
productid?: number;
|
|
44
|
-
productname: string;
|
|
45
|
-
sku?: string;
|
|
46
|
-
productattributes?: string;
|
|
47
|
-
externalid?: string | null;
|
|
48
|
-
externalidaliased?: string | null;
|
|
49
|
-
unitlabel?: string;
|
|
50
|
-
decimalunitquantity?: string;
|
|
51
|
-
quantity: number;
|
|
52
|
-
decimalquantity?: string;
|
|
53
|
-
moneyrowprice: SitooMoney;
|
|
54
|
-
moneyrowdiscount?: SitooMoney;
|
|
55
|
-
moneyrow: SitooMoney;
|
|
56
|
-
vatvalue?: number;
|
|
57
|
-
deliveryinfo?: string | null;
|
|
58
|
-
salestaxes?: SitooOrderItemSalesTax[];
|
|
59
|
-
additionaldata?: Record<string, string>;
|
|
60
|
-
}
|
|
61
|
-
export interface SitooOrderPayment {
|
|
62
|
-
name: string;
|
|
63
|
-
moneyamount: SitooMoney;
|
|
64
|
-
externalid?: string | null;
|
|
65
|
-
reftype?: string | null;
|
|
66
|
-
refid?: string | null;
|
|
67
|
-
cardissuer?: string | null;
|
|
68
|
-
additionaldata?: Record<string, string>;
|
|
69
|
-
reservedpaymentid?: string | null;
|
|
70
|
-
}
|
|
71
|
-
export interface SitooOrderReservedPayment {
|
|
72
|
-
id: string;
|
|
73
|
-
name: string;
|
|
74
|
-
moneyreserved: SitooMoney;
|
|
75
|
-
externalid?: string | null;
|
|
76
|
-
reftype?: string | null;
|
|
77
|
-
refid?: string | null;
|
|
78
|
-
cardissuer?: string | null;
|
|
79
|
-
additionaldata?: Record<string, string>;
|
|
80
|
-
}
|
|
81
|
-
export interface SitooOrder {
|
|
82
|
-
orderid: number;
|
|
83
|
-
orderstate: SitooOrderState;
|
|
84
|
-
ordertype: SitooOrderType;
|
|
85
|
-
paymentstate: SitooPaymentState;
|
|
86
|
-
datecreated: number;
|
|
87
|
-
datemodified?: number;
|
|
88
|
-
orderdate?: number;
|
|
89
|
-
ordertypename?: string;
|
|
90
|
-
registerid?: string;
|
|
91
|
-
warehouseid?: number;
|
|
92
|
-
storeid?: number;
|
|
93
|
-
email?: string | null;
|
|
94
|
-
namefirst?: string;
|
|
95
|
-
namelast?: string;
|
|
96
|
-
company?: string;
|
|
97
|
-
phone?: string | null;
|
|
98
|
-
personalid?: string;
|
|
99
|
-
externalid?: string | null;
|
|
100
|
-
comment?: string | null;
|
|
101
|
-
commentinternal?: string | null;
|
|
102
|
-
currencycode?: string;
|
|
103
|
-
moneytotal: SitooMoney;
|
|
104
|
-
moneytotaldiscount?: SitooMoney;
|
|
105
|
-
moneyrounding?: SitooMoney;
|
|
106
|
-
moneytotalpayments?: SitooMoney;
|
|
107
|
-
moneytotalreservedpayments?: SitooMoney;
|
|
108
|
-
orderitems?: SitooOrderItem[];
|
|
109
|
-
payments?: SitooOrderPayment[];
|
|
110
|
-
reservedpayments?: SitooOrderReservedPayment[];
|
|
111
|
-
additionaldata?: Record<string, string>;
|
|
112
|
-
address?: string;
|
|
113
|
-
address2?: string;
|
|
114
|
-
zip?: string;
|
|
115
|
-
city?: string;
|
|
116
|
-
state?: string;
|
|
117
|
-
countryid?: string;
|
|
118
|
-
invoicenamefirst?: string;
|
|
119
|
-
invoicenamelast?: string;
|
|
120
|
-
invoicecompany?: string;
|
|
121
|
-
invoiceaddress?: string;
|
|
122
|
-
invoiceaddress2?: string;
|
|
123
|
-
invoicezip?: string;
|
|
124
|
-
invoicecity?: string;
|
|
125
|
-
invoicestate?: string;
|
|
126
|
-
invoicecountryid?: string;
|
|
127
|
-
}
|
|
128
|
-
export interface GetAllOrdersOptions {
|
|
129
|
-
fromTimestamp?: number;
|
|
130
|
-
untilTimestamp?: number;
|
|
131
|
-
filterByState?: SitooOrderState;
|
|
132
|
-
}
|
|
133
|
-
export interface SitooOrdersEnvelope {
|
|
134
|
-
totalcount: number;
|
|
135
|
-
items: SitooOrder[];
|
|
136
|
-
}
|
|
137
|
-
export interface UnitCost {
|
|
138
|
-
value: number;
|
|
139
|
-
decimal_places: number;
|
|
140
|
-
currency: string;
|
|
141
|
-
lcy_value: number;
|
|
142
|
-
lcy_currency: string;
|
|
143
|
-
lcy_decimal_places: number;
|
|
144
|
-
}
|
|
145
|
-
export interface StockMovementInput {
|
|
146
|
-
style_id: string;
|
|
147
|
-
colour_id: string;
|
|
148
|
-
size_code: string;
|
|
149
|
-
location_code: string;
|
|
150
|
-
last_updated_at?: string;
|
|
151
|
-
entry_no: string;
|
|
152
|
-
quantity: number;
|
|
153
|
-
document_no: string;
|
|
154
|
-
external_document_no?: string;
|
|
155
|
-
type: 'transfer' | 'negative adjustment' | 'positive adjustment' | 'purchase' | 'sale';
|
|
156
|
-
unit_cost?: UnitCost;
|
|
157
|
-
document_date?: string;
|
|
158
|
-
posting_date?: string;
|
|
159
|
-
created_at: string;
|
|
160
|
-
}
|
|
161
|
-
export type BasicSitooWarehouse = {
|
|
162
|
-
warehouseid: number;
|
|
163
|
-
warehousetype: string;
|
|
164
|
-
usetype: string;
|
|
165
|
-
storeid: number;
|
|
166
|
-
sellable: boolean;
|
|
167
|
-
name: string;
|
|
168
|
-
externalId: number;
|
|
169
|
-
};
|
|
170
|
-
export type BasicSitooStore = {
|
|
171
|
-
storeid: number;
|
|
172
|
-
name: string;
|
|
173
|
-
externalId: number;
|
|
174
|
-
};
|
|
175
|
-
export type BasicWarehouseTransaction = {
|
|
176
|
-
warehousetransactionid: number;
|
|
177
|
-
warehouseid: number;
|
|
178
|
-
datecreated: number;
|
|
179
|
-
transactiontype: number;
|
|
180
|
-
description: string;
|
|
181
|
-
orderdeliveryid: number | null;
|
|
182
|
-
shipmentid: number | null;
|
|
183
|
-
externalid: string | null;
|
|
184
|
-
reasoncode: string | null;
|
|
185
|
-
items: Array<{
|
|
186
|
-
decimalquantity: string;
|
|
187
|
-
decimaltotal: string;
|
|
188
|
-
moneypricein: string;
|
|
189
|
-
moneytotal: string;
|
|
190
|
-
moneyvalue: string;
|
|
191
|
-
sku: string;
|
|
192
|
-
}>;
|
|
193
|
-
};
|
|
194
|
-
export type WarehouseTransactionEnvelope = {
|
|
195
|
-
totalcount: number;
|
|
196
|
-
items: BasicWarehouseTransaction[];
|
|
197
|
-
};
|
|
198
|
-
export interface WarehouseTransactionSyncOptions {
|
|
199
|
-
preview?: boolean;
|
|
200
|
-
skuGenerator?: (styleId: string, colourId: string, sizeCode: string) => string;
|
|
201
|
-
}
|
|
202
|
-
export interface WarehouseTransactionSyncResult {
|
|
203
|
-
found: Array<{
|
|
204
|
-
entryNo: string;
|
|
205
|
-
transactionId: number;
|
|
206
|
-
}>;
|
|
207
|
-
missing: string[];
|
|
208
|
-
created: Array<{
|
|
209
|
-
entryNo: string;
|
|
210
|
-
transactionId: number;
|
|
211
|
-
}>;
|
|
212
|
-
errors: Array<{
|
|
213
|
-
entryNo: string;
|
|
214
|
-
error: string;
|
|
215
|
-
}>;
|
|
216
|
-
firestoreUpdated: boolean;
|
|
217
|
-
skipped: Array<{
|
|
218
|
-
entryNo: string;
|
|
219
|
-
reason: string;
|
|
220
|
-
}>;
|
|
221
|
-
}
|
|
222
|
-
export interface FirestoreCacheDocument {
|
|
223
|
-
[entryNo: string]: number;
|
|
224
|
-
}
|
|
225
|
-
export default class SitooHelper extends EnvEngine {
|
|
226
|
-
protected opts: {
|
|
227
|
-
accessToken: string;
|
|
228
|
-
sitooBaseUrl: string;
|
|
229
|
-
sitooSiteId: number;
|
|
230
|
-
};
|
|
231
|
-
shaToken: string;
|
|
232
|
-
baseUrl: string;
|
|
233
|
-
siteId: number;
|
|
234
|
-
constructor(options: ConstructorParameters<typeof Runtime>[0], opts: {
|
|
235
|
-
accessToken: string;
|
|
236
|
-
sitooBaseUrl: string;
|
|
237
|
-
sitooSiteId: number;
|
|
238
|
-
});
|
|
239
|
-
getAllOrders(options?: GetAllOrdersOptions): Promise<SitooOrder[]>;
|
|
240
|
-
getSitooWarehouses(): Promise<{
|
|
241
|
-
nameToId: Record<string, number>;
|
|
242
|
-
warehouses: Record<number, BasicSitooWarehouse>;
|
|
243
|
-
}>;
|
|
244
|
-
private fetchWarehouseTransactionsWithFilter;
|
|
245
|
-
private searchTransactionsInApi;
|
|
246
|
-
private batchAddWarehouseTransactions;
|
|
247
|
-
syncWarehouseTransactions(items: StockMovementInput[], options?: WarehouseTransactionSyncOptions): Promise<Array<{
|
|
248
|
-
entryNo: string;
|
|
249
|
-
transactionId: number;
|
|
250
|
-
} | Error | {
|
|
251
|
-
error: boolean;
|
|
252
|
-
message: string;
|
|
253
|
-
}>>;
|
|
254
|
-
}
|