@shushed/helpers 0.0.213 → 0.0.214
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.
|
@@ -26,6 +26,14 @@
|
|
|
26
26
|
"minLength": 1,
|
|
27
27
|
"description": "Variant code, e.g., XS, M, XL, ONE, or numeric like 10, 37, 40"
|
|
28
28
|
},
|
|
29
|
+
"source_system": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"enum": [
|
|
32
|
+
"bc",
|
|
33
|
+
"centra",
|
|
34
|
+
"sitoo"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
29
37
|
"history": {
|
|
30
38
|
"type": "array",
|
|
31
39
|
"items": {
|
|
@@ -41,6 +49,17 @@
|
|
|
41
49
|
"pattern": "^\\d{3}-[A-Z]+$|^[A-Z]{2,}-?[A-Z]*$|^[A-Z]{2,}\\d{3}$",
|
|
42
50
|
"description": "Valid location code like 001-DR, JL200, HEADOFFICE"
|
|
43
51
|
},
|
|
52
|
+
"description": {
|
|
53
|
+
"type": "string"
|
|
54
|
+
},
|
|
55
|
+
"document_no": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"description": "BC Document no. Should be empty for other systems"
|
|
58
|
+
},
|
|
59
|
+
"external_document_no": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"description": "Original document i.e. Sitoo ID that caused the change"
|
|
62
|
+
},
|
|
44
63
|
"type": {
|
|
45
64
|
"type": "string",
|
|
46
65
|
"enum": [
|
|
@@ -62,10 +81,21 @@
|
|
|
62
81
|
],
|
|
63
82
|
"description": "Cost per unit, can be null"
|
|
64
83
|
},
|
|
84
|
+
"document_date": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"format": "date",
|
|
87
|
+
"description": "Date of the creation of the document. Preferably creation time of the item ledger entry",
|
|
88
|
+
"faker": {
|
|
89
|
+
"date.between": [
|
|
90
|
+
"2024-01-01",
|
|
91
|
+
"2025-04-30"
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
},
|
|
65
95
|
"posting_date": {
|
|
66
96
|
"type": "string",
|
|
67
97
|
"format": "date",
|
|
68
|
-
"description": "Date of
|
|
98
|
+
"description": "Date of posting the record in BC. This should be empty for non-BC systems. Preferably creation time of the item ledger entry",
|
|
69
99
|
"faker": {
|
|
70
100
|
"date.between": [
|
|
71
101
|
"2024-01-01",
|
|
@@ -89,7 +119,7 @@
|
|
|
89
119
|
"quantity",
|
|
90
120
|
"location_code",
|
|
91
121
|
"created_at",
|
|
92
|
-
"
|
|
122
|
+
"document_date",
|
|
93
123
|
"type"
|
|
94
124
|
]
|
|
95
125
|
}
|
|
@@ -108,6 +138,7 @@
|
|
|
108
138
|
},
|
|
109
139
|
"required": [
|
|
110
140
|
"style_id",
|
|
141
|
+
"source_system",
|
|
111
142
|
"colour_id",
|
|
112
143
|
"size_code",
|
|
113
144
|
"history",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const schema = { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Stock Movement Schema", "type": "object", "additionalProperties": false, "properties": { "style_id": { "type": "string", "minLength": 1 }, "colour_id": { "type": "string", "minLength": 1 }, "size_code": { "type": "string", "minLength": 1 }, "history": { "type": "array", "items": { "type": "object", "properties": { "quantity": { "type": "integer", "minimum": 0 }, "location_code": { "type": "string", "pattern": "^\\d{3}-[A-Z]+$|^[A-Z]{2,}-?[A-Z]*$|^[A-Z]{2,}\\d{3}$" }, "type": { "type": "string", "enum": ["transfer", "negative adjustment", "positive adjustment", "purchase", "sale"] }, "unit_cost": { "oneOf": [{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Money", "type": "object", "additionalProperties": false, "properties": { "value": { "type": "integer", "minimum": 0 }, "decimal_places": { "type": "integer", "minimum": 0, "maximum": 4 }, "currency": { "title": "Currency", "$schema": "http://json-schema.org/draft-07/schema#", "type": "string", "enum": ["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"] }, "lcy_value": { "type": "integer", "minimum": 0 }, "lcy_currency": { "title": "LCY Currency", "$schema": "http://json-schema.org/draft-07/schema#", "type": "string", "enum": ["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"] }, "lcy_decimal_places": { "type": "integer", "minimum": 0, "maximum": 4 } }, "required": ["value", "currency", "lcy_value", "lcy_currency", "decimal_places", "lcy_decimal_places"] }, { "type": "null" }] }, "posting_date": { "type": "string", "format": "date" }, "created_at": { "type": "string", "format": "date-time" } }, "required": ["quantity", "location_code", "created_at", "
|
|
3
|
+
const schema = { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Stock Movement Schema", "type": "object", "additionalProperties": false, "properties": { "style_id": { "type": "string", "minLength": 1 }, "colour_id": { "type": "string", "minLength": 1 }, "size_code": { "type": "string", "minLength": 1 }, "source_system": { "type": "string", "enum": ["bc", "centra", "sitoo"] }, "history": { "type": "array", "items": { "type": "object", "properties": { "quantity": { "type": "integer", "minimum": 0 }, "location_code": { "type": "string", "pattern": "^\\d{3}-[A-Z]+$|^[A-Z]{2,}-?[A-Z]*$|^[A-Z]{2,}\\d{3}$" }, "document_no": { "type": "string" }, "external_document_no": { "type": "string" }, "type": { "type": "string", "enum": ["transfer", "negative adjustment", "positive adjustment", "purchase", "sale"] }, "unit_cost": { "oneOf": [{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Money", "type": "object", "additionalProperties": false, "properties": { "value": { "type": "integer", "minimum": 0 }, "decimal_places": { "type": "integer", "minimum": 0, "maximum": 4 }, "currency": { "title": "Currency", "$schema": "http://json-schema.org/draft-07/schema#", "type": "string", "enum": ["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"] }, "lcy_value": { "type": "integer", "minimum": 0 }, "lcy_currency": { "title": "LCY Currency", "$schema": "http://json-schema.org/draft-07/schema#", "type": "string", "enum": ["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"] }, "lcy_decimal_places": { "type": "integer", "minimum": 0, "maximum": 4 } }, "required": ["value", "currency", "lcy_value", "lcy_currency", "decimal_places", "lcy_decimal_places"] }, { "type": "null" }] }, "document_date": { "type": "string", "format": "date" }, "posting_date": { "type": "string", "format": "date" }, "created_at": { "type": "string", "format": "date-time" } }, "required": ["quantity", "location_code", "created_at", "document_date", "type"] } }, "last_modified_at": { "type": "string", "format": "date-time" } }, "required": ["style_id", "source_system", "colour_id", "size_code", "history", "last_modified_at"], "$id": "https://shushed.example.com/stock-move.schema.json" };
|
|
4
4
|
exports.default = schema;
|
|
@@ -16,6 +16,10 @@ declare const schema: {
|
|
|
16
16
|
readonly type: "string";
|
|
17
17
|
readonly minLength: 1;
|
|
18
18
|
};
|
|
19
|
+
readonly source_system: {
|
|
20
|
+
readonly type: "string";
|
|
21
|
+
readonly enum: readonly ["bc", "centra", "sitoo"];
|
|
22
|
+
};
|
|
19
23
|
readonly history: {
|
|
20
24
|
readonly type: "array";
|
|
21
25
|
readonly items: {
|
|
@@ -29,6 +33,12 @@ declare const schema: {
|
|
|
29
33
|
readonly type: "string";
|
|
30
34
|
readonly pattern: "^\\d{3}-[A-Z]+$|^[A-Z]{2,}-?[A-Z]*$|^[A-Z]{2,}\\d{3}$";
|
|
31
35
|
};
|
|
36
|
+
readonly document_no: {
|
|
37
|
+
readonly type: "string";
|
|
38
|
+
};
|
|
39
|
+
readonly external_document_no: {
|
|
40
|
+
readonly type: "string";
|
|
41
|
+
};
|
|
32
42
|
readonly type: {
|
|
33
43
|
readonly type: "string";
|
|
34
44
|
readonly enum: readonly ["transfer", "negative adjustment", "positive adjustment", "purchase", "sale"];
|
|
@@ -76,6 +86,10 @@ declare const schema: {
|
|
|
76
86
|
readonly type: "null";
|
|
77
87
|
}];
|
|
78
88
|
};
|
|
89
|
+
readonly document_date: {
|
|
90
|
+
readonly type: "string";
|
|
91
|
+
readonly format: "date";
|
|
92
|
+
};
|
|
79
93
|
readonly posting_date: {
|
|
80
94
|
readonly type: "string";
|
|
81
95
|
readonly format: "date";
|
|
@@ -85,7 +99,7 @@ declare const schema: {
|
|
|
85
99
|
readonly format: "date-time";
|
|
86
100
|
};
|
|
87
101
|
};
|
|
88
|
-
readonly required: readonly ["quantity", "location_code", "created_at", "
|
|
102
|
+
readonly required: readonly ["quantity", "location_code", "created_at", "document_date", "type"];
|
|
89
103
|
};
|
|
90
104
|
};
|
|
91
105
|
readonly last_modified_at: {
|
|
@@ -93,7 +107,7 @@ declare const schema: {
|
|
|
93
107
|
readonly format: "date-time";
|
|
94
108
|
};
|
|
95
109
|
};
|
|
96
|
-
readonly required: readonly ["style_id", "colour_id", "size_code", "history", "last_modified_at"];
|
|
110
|
+
readonly required: readonly ["style_id", "source_system", "colour_id", "size_code", "history", "last_modified_at"];
|
|
97
111
|
readonly $id: "https://shushed.example.com/stock-move.schema.json";
|
|
98
112
|
};
|
|
99
113
|
export default schema;
|
|
@@ -4,12 +4,17 @@ export interface __MainSchema {
|
|
|
4
4
|
style_id: string;
|
|
5
5
|
colour_id: string;
|
|
6
6
|
size_code: string;
|
|
7
|
+
source_system: ("bc" | "centra" | "sitoo");
|
|
7
8
|
history: {
|
|
8
9
|
quantity: number;
|
|
9
10
|
location_code: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
document_no?: string;
|
|
13
|
+
external_document_no?: string;
|
|
10
14
|
type: ("transfer" | "negative adjustment" | "positive adjustment" | "purchase" | "sale");
|
|
11
15
|
unit_cost?: (Money | null);
|
|
12
|
-
|
|
16
|
+
document_date: string;
|
|
17
|
+
posting_date?: string;
|
|
13
18
|
created_at: string;
|
|
14
19
|
[k: string]: unknown;
|
|
15
20
|
}[];
|