@softwear/latestcollectioncore 1.0.4 → 1.0.6

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/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default as ean13 } from "./ean13";
2
2
  export { default as hashBrand } from "./hashBrand";
3
+ export * from "./types";
package/dist/index.js CHANGED
@@ -1,4 +1,18 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
18
  };
@@ -8,3 +22,4 @@ var ean13_1 = require("./ean13");
8
22
  Object.defineProperty(exports, "ean13", { enumerable: true, get: function () { return __importDefault(ean13_1).default; } });
9
23
  var hashBrand_1 = require("./hashBrand");
10
24
  Object.defineProperty(exports, "hashBrand", { enumerable: true, get: function () { return __importDefault(hashBrand_1).default; } });
25
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,179 @@
1
+ declare enum vatCategoryE {
2
+ LOW = "low",
3
+ HIGH = "high",
4
+ ZERO = "zero"
5
+ }
6
+ declare enum tagTypeE {
7
+ STICKER = "stikker",
8
+ LABEL = "label"
9
+ }
10
+ interface ImageI {
11
+ name: string;
12
+ url: string;
13
+ }
14
+ interface GroupI {
15
+ name: string;
16
+ value: string;
17
+ }
18
+ interface CareI {
19
+ temperature: number;
20
+ bleach: number;
21
+ iron: number;
22
+ chemical: number;
23
+ dryer: number;
24
+ }
25
+ interface AttributeI {
26
+ key: string;
27
+ value: string;
28
+ }
29
+ type barcode = string;
30
+ interface RowI {
31
+ cells: {
32
+ key?: barcode | undefined;
33
+ value: number;
34
+ state?: string;
35
+ }[];
36
+ group: string;
37
+ initialIndex?: number;
38
+ filteredOut?: boolean;
39
+ warehouse?: string;
40
+ selected?: boolean;
41
+ }
42
+ interface MatrixI {
43
+ matrixMetadata: string | string[];
44
+ headers: string[];
45
+ rows: RowI[];
46
+ }
47
+ interface StockAdviceMatrixI {
48
+ rows: RowI[];
49
+ selection: StockAdviceSelectionI;
50
+ }
51
+ interface StockAdviceDataI extends StockAdviceMatrixI {
52
+ rowIndex: number;
53
+ cellIndex: number | undefined;
54
+ value: number | undefined;
55
+ }
56
+ interface StockAdviceSelectionI {
57
+ cells: {
58
+ cellIndex: number;
59
+ value: number;
60
+ }[];
61
+ rowIndex: number | null;
62
+ }
63
+ /**
64
+ * A SKU is the main building block of our product data model.
65
+ * It is the most granualar piece of information. We store all possible properties at this object. That is very redundant but we do it for a reason.
66
+ * Most product data nowadays is coming from external sources and the SKU is most often used as the communication unit bringing along all those redundant properties.
67
+ * There is no consensus in the market about how to structure that data any further so imposing any structure upon it ultimately will result in conflicts.
68
+ * Therefore, we keep the redundancy to accomodate all possible data and regard that as our single source of truth.
69
+ *
70
+ * UPPERCASE propertynames are used for properties that are added for UI purposes only.
71
+ * They are not part of the persistent data model
72
+ */
73
+ interface SkuI {
74
+ barcode?: barcode;
75
+ id?: barcode;
76
+ primary: boolean;
77
+ articleCode: string;
78
+ articleDescription: string;
79
+ pricetagLayouts: string;
80
+ brand: string;
81
+ articleGroup: string;
82
+ articleGroupSupplier?: string;
83
+ ATTRIBUTES?: object;
84
+ IMAGES?: Array<ImageI>;
85
+ images?: string;
86
+ SIZES?: unknown;
87
+ groups: Array<GroupI>;
88
+ vat: number;
89
+ vatCategory: vatCategoryE;
90
+ supplierName?: string;
91
+ size: string;
92
+ sizeSupplier?: string;
93
+ mainSize?: string;
94
+ subSize?: string;
95
+ subSizeSupplier?: string;
96
+ sizeIndex: number;
97
+ sizes?: Array<string>;
98
+ sizeRange?: string;
99
+ colorCode?: string;
100
+ colorDescription?: string;
101
+ colorSupplier?: string;
102
+ colorCodeSupplier?: string;
103
+ colorFamily: string;
104
+ mainColorCode: string;
105
+ mainColorDescription?: string;
106
+ subColorCode?: string;
107
+ subColorDescription?: string;
108
+ articleCodeSupplier?: string;
109
+ price: number;
110
+ buyPrice: number;
111
+ suggestedRetailPrice: number;
112
+ valuePrice: number;
113
+ salePrice: number;
114
+ prices?: unknown;
115
+ year?: string;
116
+ season?: string;
117
+ collection: string;
118
+ collectionSupplier?: string;
119
+ active: boolean;
120
+ skuActive: boolean;
121
+ warehouseLocation: string;
122
+ tagType?: tagTypeE;
123
+ directDelivery?: boolean;
124
+ care?: CareI;
125
+ }
126
+ interface MarkedSkuI extends SkuI {
127
+ source?: string;
128
+ usedByTenant?: boolean;
129
+ warehouse?: string;
130
+ qty?: number;
131
+ }
132
+ interface ColorI {
133
+ color: string;
134
+ subColors: Array<string>;
135
+ IMAGES: Array<ImageI>;
136
+ colorCodeSupplier: string;
137
+ colorSupplier: string;
138
+ newColor?: boolean;
139
+ }
140
+ /**
141
+ * A product is our abstraction of a set of SKU's that share the same brand and articleCode (productId)
142
+ * Softwear versions before 7.0 regarded the product as the main unit of information having multiple colors and sizes assoiated with it.
143
+ * From version 7.0 and up we regard the SKU as the main unit of information. A product serves merely as an representational abstraction of a series of SKUs.
144
+ *
145
+ */
146
+ interface ProductI {
147
+ ATTRIBUTES: object;
148
+ COLORS: Array<ColorI>;
149
+ IMAGES?: unknown;
150
+ INDEX: object;
151
+ MATRIX?: MatrixI;
152
+ SIZES: Array<string>;
153
+ SKUS: Array<MarkedSkuI>;
154
+ active: boolean;
155
+ articleCode: string;
156
+ articleCodeSupplier?: string;
157
+ articleDescription: string;
158
+ articleGroup: string;
159
+ articleGroupSupplier: string;
160
+ brand: string;
161
+ buyPrice: number;
162
+ care?: CareI;
163
+ collection: string;
164
+ collectionSupplier: string;
165
+ groups: Array<GroupI>;
166
+ price: number;
167
+ prices?: unknown;
168
+ pricetagLayouts: Array<string>;
169
+ season?: string;
170
+ suggestedRetailPrice: number;
171
+ supplierName?: string;
172
+ tagType?: tagTypeE;
173
+ valuePrice: number;
174
+ vat: number;
175
+ vatCategory: vatCategoryE;
176
+ warehouseLocation: string;
177
+ year?: string;
178
+ }
179
+ export { RowI, StockAdviceSelectionI, MarkedSkuI, vatCategoryE, tagTypeE, SkuI, GroupI, ProductI, ImageI, AttributeI, ColorI, MatrixI, StockAdviceDataI, StockAdviceMatrixI };
package/dist/types.js ADDED
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tagTypeE = exports.vatCategoryE = void 0;
4
+ var vatCategoryE;
5
+ (function (vatCategoryE) {
6
+ vatCategoryE["LOW"] = "low";
7
+ vatCategoryE["HIGH"] = "high";
8
+ vatCategoryE["ZERO"] = "zero";
9
+ })(vatCategoryE || (vatCategoryE = {}));
10
+ exports.vatCategoryE = vatCategoryE;
11
+ var tagTypeE;
12
+ (function (tagTypeE) {
13
+ tagTypeE["STICKER"] = "stikker";
14
+ tagTypeE["LABEL"] = "label";
15
+ })(tagTypeE || (tagTypeE = {}));
16
+ exports.tagTypeE = tagTypeE;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softwear/latestcollectioncore",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Core functions for LatestCollections applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default as ean13 } from "./ean13"
2
2
  export { default as hashBrand } from "./hashBrand"
3
+ export * from "./types"
package/src/types.ts ADDED
@@ -0,0 +1,191 @@
1
+ enum vatCategoryE {
2
+ LOW = "low",
3
+ HIGH = "high",
4
+ ZERO = "zero",
5
+ }
6
+
7
+ enum tagTypeE {
8
+ STICKER = "stikker",
9
+ LABEL = "label",
10
+ }
11
+
12
+ interface ImageI {
13
+ name: string
14
+ url: string
15
+ }
16
+
17
+ interface GroupI {
18
+ name: string
19
+ value: string
20
+ }
21
+
22
+ interface CareI {
23
+ temperature: number
24
+ bleach: number
25
+ iron: number
26
+ chemical: number
27
+ dryer: number
28
+ }
29
+
30
+ interface AttributeI {
31
+ key: string
32
+ value: string
33
+ }
34
+ // better represents what the key is in MatrixI
35
+ type barcode = string
36
+
37
+ interface RowI {
38
+ cells: { key?: barcode | undefined; value: number; state?: string }[] // uses the barcode for backtracking of each cell
39
+ group: string // first column of a row, could be a grouper or a color
40
+ initialIndex?: number // used for filtered data
41
+ filteredOut?: boolean // used for filtered data
42
+ warehouse?: string // used for stock management, the actual string might be in the group key as well
43
+ selected?: boolean // used for UI
44
+ }
45
+
46
+ interface MatrixI {
47
+ matrixMetadata: string | string[]
48
+ headers: string[]
49
+ rows: RowI[]
50
+ }
51
+
52
+ interface StockAdviceMatrixI {
53
+ rows: RowI[]
54
+ selection: StockAdviceSelectionI
55
+ }
56
+
57
+ interface StockAdviceDataI extends StockAdviceMatrixI {
58
+ rowIndex: number
59
+ cellIndex: number | undefined
60
+ value: number | undefined
61
+ }
62
+
63
+ interface StockAdviceSelectionI {
64
+ cells: {
65
+ cellIndex: number
66
+ value: number
67
+ }[]
68
+ rowIndex: number | null
69
+ }
70
+
71
+ /**
72
+ * A SKU is the main building block of our product data model.
73
+ * It is the most granualar piece of information. We store all possible properties at this object. That is very redundant but we do it for a reason.
74
+ * Most product data nowadays is coming from external sources and the SKU is most often used as the communication unit bringing along all those redundant properties.
75
+ * There is no consensus in the market about how to structure that data any further so imposing any structure upon it ultimately will result in conflicts.
76
+ * Therefore, we keep the redundancy to accomodate all possible data and regard that as our single source of truth.
77
+ *
78
+ * UPPERCASE propertynames are used for properties that are added for UI purposes only.
79
+ * They are not part of the persistent data model
80
+ */
81
+ interface SkuI {
82
+ barcode?: barcode
83
+ id?: barcode
84
+ primary: boolean
85
+ articleCode: string
86
+ articleDescription: string
87
+ pricetagLayouts: string
88
+ brand: string
89
+ articleGroup: string
90
+ articleGroupSupplier?: string
91
+ ATTRIBUTES?: object
92
+ IMAGES?: Array<ImageI>
93
+ images?: string
94
+ SIZES?: unknown
95
+ groups: Array<GroupI>
96
+ vat: number
97
+ vatCategory: vatCategoryE
98
+ supplierName?: string
99
+ size: string
100
+ sizeSupplier?: string
101
+ mainSize?: string
102
+ subSize?: string
103
+ subSizeSupplier?: string
104
+ sizeIndex: number
105
+ sizes?: Array<string>
106
+ sizeRange?: string
107
+ colorCode?: string
108
+ colorDescription?: string
109
+ colorSupplier?: string
110
+ colorCodeSupplier?: string
111
+ colorFamily: string
112
+ mainColorCode: string
113
+ mainColorDescription?: string
114
+ subColorCode?: string
115
+ subColorDescription?: string
116
+ articleCodeSupplier?: string
117
+ price: number
118
+ buyPrice: number
119
+ suggestedRetailPrice: number
120
+ valuePrice: number
121
+ salePrice: number
122
+ prices?: unknown
123
+ year?: string
124
+ season?: string
125
+ collection: string
126
+ collectionSupplier?: string
127
+ active: boolean
128
+ skuActive: boolean
129
+ warehouseLocation: string
130
+ tagType?: tagTypeE
131
+ directDelivery?: boolean
132
+ care?: CareI
133
+ }
134
+
135
+ interface MarkedSkuI extends SkuI {
136
+ source?: string
137
+ usedByTenant?: boolean
138
+ warehouse?: string
139
+ qty?: number
140
+ }
141
+
142
+ interface ColorI {
143
+ color: string
144
+ subColors: Array<string>
145
+ IMAGES: Array<ImageI>
146
+ colorCodeSupplier: string
147
+ colorSupplier: string
148
+ newColor?: boolean
149
+ }
150
+
151
+ /**
152
+ * A product is our abstraction of a set of SKU's that share the same brand and articleCode (productId)
153
+ * Softwear versions before 7.0 regarded the product as the main unit of information having multiple colors and sizes assoiated with it.
154
+ * From version 7.0 and up we regard the SKU as the main unit of information. A product serves merely as an representational abstraction of a series of SKUs.
155
+ *
156
+ */
157
+ interface ProductI {
158
+ ATTRIBUTES: object
159
+ COLORS: Array<ColorI>
160
+ IMAGES?: unknown
161
+ INDEX: object
162
+ MATRIX?: MatrixI
163
+ SIZES: Array<string>
164
+ SKUS: Array<MarkedSkuI>
165
+ active: boolean
166
+ articleCode: string
167
+ articleCodeSupplier?: string
168
+ articleDescription: string
169
+ articleGroup: string
170
+ articleGroupSupplier: string
171
+ brand: string
172
+ buyPrice: number
173
+ care?: CareI
174
+ collection: string
175
+ collectionSupplier: string
176
+ groups: Array<GroupI>
177
+ price: number
178
+ prices?: unknown
179
+ pricetagLayouts: Array<string>
180
+ season?: string
181
+ suggestedRetailPrice: number
182
+ supplierName?: string
183
+ tagType?: tagTypeE
184
+ valuePrice: number
185
+ vat: number
186
+ vatCategory: vatCategoryE
187
+ warehouseLocation: string
188
+ year?: string
189
+ }
190
+
191
+ export { RowI, StockAdviceSelectionI, MarkedSkuI, vatCategoryE, tagTypeE, SkuI, GroupI, ProductI, ImageI, AttributeI, ColorI, MatrixI, StockAdviceDataI, StockAdviceMatrixI }