cecon-interfaces 1.1.80 → 1.1.82
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/bluesoft/index.d.ts +1 -0
- package/dist/bluesoft/index.js +17 -0
- package/dist/bluesoft/interfaces/i-bluesoft-brand.d.ts +4 -0
- package/dist/bluesoft/interfaces/i-bluesoft-brand.js +2 -0
- package/dist/bluesoft/interfaces/i-bluesoft-gtin-commercial-unit.d.ts +6 -0
- package/dist/bluesoft/interfaces/i-bluesoft-gtin-commercial-unit.js +2 -0
- package/dist/bluesoft/interfaces/i-bluesoft-gtin.d.ts +5 -0
- package/dist/bluesoft/interfaces/i-bluesoft-gtin.js +2 -0
- package/dist/bluesoft/interfaces/i-bluesoft-ncm.d.ts +6 -0
- package/dist/bluesoft/interfaces/i-bluesoft-ncm.js +2 -0
- package/dist/bluesoft/interfaces/i-bluesoft.d.ts +24 -0
- package/dist/bluesoft/interfaces/i-bluesoft.js +2 -0
- package/dist/bluesoft/interfaces/index.d.ts +1 -0
- package/dist/bluesoft/interfaces/index.js +2 -0
- package/dist/esm2022/bluesoft/index.mjs +2 -0
- package/dist/esm2022/bluesoft/interfaces/i-bluesoft-brand.mjs +2 -0
- package/dist/esm2022/bluesoft/interfaces/i-bluesoft-gtin-commercial-unit.mjs +2 -0
- package/dist/esm2022/bluesoft/interfaces/i-bluesoft-gtin.mjs +2 -0
- package/dist/esm2022/bluesoft/interfaces/i-bluesoft-ncm.mjs +2 -0
- package/dist/esm2022/bluesoft/interfaces/i-bluesoft.mjs +2 -0
- package/dist/esm2022/bluesoft/interfaces/index.mjs +2 -0
- package/dist/esm2022/index.mjs +2 -1
- package/dist/esm2022/product-container/entities/product.entity.mjs +4 -5
- package/dist/esm2022/product-container/interfaces/i-product.mjs +1 -1
- package/dist/esm2022/product-global/entities/index.mjs +2 -2
- package/dist/esm2022/product-global/entities/product-ncm.entity.mjs +2 -1
- package/dist/esm2022/product-global/entities/product.entity.mjs +46 -8
- package/dist/esm2022/product-global/enums/gtin-type.enum.mjs +9 -9
- package/dist/esm2022/product-global/enums/index.mjs +2 -2
- package/dist/esm2022/product-global/interfaces/i-ncm.mjs +1 -1
- package/dist/esm2022/product-global/interfaces/i-product.mjs +1 -1
- package/dist/esm2022/product-global/interfaces/index.mjs +1 -1
- package/dist/fesm2022/cecon-interfaces.mjs +58 -21
- package/dist/fesm2022/cecon-interfaces.mjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/package.json +1 -1
- package/dist/product-container/entities/product.entity.d.ts +2 -3
- package/dist/product-container/entities/product.entity.js +3 -4
- package/dist/product-container/interfaces/i-product.d.ts +2 -10
- package/dist/product-global/entities/index.d.ts +1 -1
- package/dist/product-global/entities/index.js +2 -2
- package/dist/product-global/entities/product-ncm.entity.d.ts +1 -0
- package/dist/product-global/entities/product-ncm.entity.js +1 -0
- package/dist/product-global/entities/product.entity.d.ts +6 -6
- package/dist/product-global/entities/product.entity.js +49 -10
- package/dist/product-global/enums/gtin-type.enum.d.ts +1 -1
- package/dist/product-global/enums/gtin-type.enum.js +9 -9
- package/dist/product-global/enums/index.d.ts +1 -1
- package/dist/product-global/enums/index.js +1 -1
- package/dist/product-global/interfaces/i-ncm.d.ts +1 -0
- package/dist/product-global/interfaces/i-product.d.ts +1 -24
- package/dist/product-global/interfaces/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./app"), exports);
|
18
18
|
__exportStar(require("./billing"), exports);
|
19
19
|
__exportStar(require("./billing-order"), exports);
|
20
|
+
__exportStar(require("./bluesoft"), exports);
|
20
21
|
__exportStar(require("./campaign"), exports);
|
21
22
|
__exportStar(require("./clients"), exports);
|
22
23
|
__exportStar(require("./company"), exports);
|
package/dist/package.json
CHANGED
@@ -1,10 +1,9 @@
|
|
1
|
-
import {
|
1
|
+
import { ProductGlobalEntity } from '../../product-global/entities/product.entity';
|
2
2
|
import { IProductContainer } from '../interfaces';
|
3
|
-
export declare class ProductContainerEntity extends
|
3
|
+
export declare class ProductContainerEntity extends ProductGlobalEntity implements IProductContainer {
|
4
4
|
cest: string | null;
|
5
5
|
containerId: string;
|
6
6
|
customEAN: string;
|
7
7
|
exTipi: string;
|
8
|
-
sku: string;
|
9
8
|
constructor(data?: Partial<ProductContainerEntity>);
|
10
9
|
}
|
@@ -16,7 +16,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
16
16
|
})();
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
18
18
|
exports.ProductContainerEntity = void 0;
|
19
|
-
var
|
19
|
+
var product_entity_1 = require("../../product-global/entities/product.entity");
|
20
20
|
var ProductContainerEntity = /** @class */ (function (_super) {
|
21
21
|
__extends(ProductContainerEntity, _super);
|
22
22
|
// #endregion Properties (5)
|
@@ -28,7 +28,6 @@ var ProductContainerEntity = /** @class */ (function (_super) {
|
|
28
28
|
_this.containerId = '';
|
29
29
|
_this.customEAN = '';
|
30
30
|
_this.exTipi = '';
|
31
|
-
_this.sku = '';
|
32
31
|
if (data) {
|
33
32
|
for (var key in data) {
|
34
33
|
if (data.hasOwnProperty(key) && key in _this) {
|
@@ -37,7 +36,7 @@ var ProductContainerEntity = /** @class */ (function (_super) {
|
|
37
36
|
}
|
38
37
|
}
|
39
38
|
return _this;
|
40
|
-
}
|
39
|
+
} // #endregion Constructors (1)
|
41
40
|
return ProductContainerEntity;
|
42
|
-
}(
|
41
|
+
}(product_entity_1.ProductGlobalEntity));
|
43
42
|
exports.ProductContainerEntity = ProductContainerEntity;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
export interface IProductContainer extends
|
1
|
+
import { IProductGlobal } from '../../product-global';
|
2
|
+
export interface IProductContainer extends IProductGlobal {
|
3
3
|
/**
|
4
4
|
* Container CEST. Optional if the product is from root.
|
5
5
|
* @minlength 7
|
@@ -28,12 +28,4 @@ export interface IProductContainer extends IProductBase {
|
|
28
28
|
* @example "01"
|
29
29
|
*/
|
30
30
|
exTipi: string;
|
31
|
-
/**
|
32
|
-
* Code of the product.
|
33
|
-
* @minlength 1
|
34
|
-
* @maxlength 60
|
35
|
-
* @pattern ^[a-zA-Z0-9]+$
|
36
|
-
* @example "123456789"
|
37
|
-
*/
|
38
|
-
sku: string;
|
39
31
|
}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.ProductglobalEntity = exports.ProductNcmEntity = exports.ProductBrandEntity = void 0;
|
4
4
|
var product_brand_entity_1 = require("./product-brand.entity");
|
5
5
|
Object.defineProperty(exports, "ProductBrandEntity", { enumerable: true, get: function () { return product_brand_entity_1.ProductBrandEntity; } });
|
6
6
|
var product_ncm_entity_1 = require("./product-ncm.entity");
|
7
7
|
Object.defineProperty(exports, "ProductNcmEntity", { enumerable: true, get: function () { return product_ncm_entity_1.ProductNcmEntity; } });
|
8
8
|
var product_entity_1 = require("./product.entity");
|
9
|
-
Object.defineProperty(exports, "
|
9
|
+
Object.defineProperty(exports, "ProductglobalEntity", { enumerable: true, get: function () { return product_entity_1.ProductGlobalEntity; } });
|
@@ -1,8 +1,9 @@
|
|
1
|
+
import { IBlueSoft } from '../../bluesoft';
|
1
2
|
import { GTINTypeEnum } from '../enums';
|
2
|
-
import {
|
3
|
+
import { IProductGlobal } from '../interfaces';
|
3
4
|
import { ProductBrandEntity } from './product-brand.entity';
|
4
5
|
import { ProductNcmEntity } from './product-ncm.entity';
|
5
|
-
export declare class
|
6
|
+
export declare class ProductGlobalEntity implements IProductGlobal {
|
6
7
|
active: boolean;
|
7
8
|
avgPrice: number;
|
8
9
|
barcodeImage: string | null;
|
@@ -11,7 +12,6 @@ export declare class ProductBaseEntity implements IProductBase {
|
|
11
12
|
createdAt: Date;
|
12
13
|
description: string;
|
13
14
|
grossWeight: number;
|
14
|
-
grossWeightUnit: string | null;
|
15
15
|
gtin: string;
|
16
16
|
gtinType: GTINTypeEnum;
|
17
17
|
height: number;
|
@@ -24,12 +24,12 @@ export declare class ProductBaseEntity implements IProductBase {
|
|
24
24
|
name: string;
|
25
25
|
ncm: ProductNcmEntity;
|
26
26
|
netWeight: number;
|
27
|
-
netWeightUnit: string | null;
|
28
27
|
price: number;
|
29
|
-
sku: string;
|
30
28
|
tags: string[];
|
31
29
|
thumbnail: string | null;
|
32
30
|
updatedAt: Date;
|
33
31
|
width: number;
|
34
|
-
constructor(data?: Partial<
|
32
|
+
constructor(data?: Partial<ProductGlobalEntity>, bluesoft?: IBlueSoft, ref?: number);
|
33
|
+
private getGtinFromGtins;
|
34
|
+
private currencyStringToNumber;
|
35
35
|
}
|
@@ -1,14 +1,16 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.ProductGlobalEntity = void 0;
|
4
4
|
var enums_1 = require("../enums");
|
5
|
+
var gtin_type_enum_1 = require("../enums/gtin-type.enum");
|
5
6
|
var product_brand_entity_1 = require("./product-brand.entity");
|
6
7
|
var product_ncm_entity_1 = require("./product-ncm.entity");
|
7
|
-
var
|
8
|
-
// #endregion Properties (
|
8
|
+
var ProductGlobalEntity = /** @class */ (function () {
|
9
|
+
// #endregion Properties (26)
|
9
10
|
// #region Constructors (1)
|
10
|
-
function
|
11
|
-
|
11
|
+
function ProductGlobalEntity(data, bluesoft, ref) {
|
12
|
+
var _a, _b, _c, _d;
|
13
|
+
// #region Properties (26)
|
12
14
|
this.active = true;
|
13
15
|
this.avgPrice = 0;
|
14
16
|
this.barcodeImage = null;
|
@@ -17,7 +19,6 @@ var ProductBaseEntity = /** @class */ (function () {
|
|
17
19
|
this.createdAt = new Date();
|
18
20
|
this.description = '';
|
19
21
|
this.grossWeight = 0;
|
20
|
-
this.grossWeightUnit = null;
|
21
22
|
this.gtin = '';
|
22
23
|
this.gtinType = enums_1.GTINTypeEnum.THIRTEEN;
|
23
24
|
this.height = 0;
|
@@ -30,13 +31,38 @@ var ProductBaseEntity = /** @class */ (function () {
|
|
30
31
|
this.name = '';
|
31
32
|
this.ncm = new product_ncm_entity_1.ProductNcmEntity();
|
32
33
|
this.netWeight = 0;
|
33
|
-
this.netWeightUnit = null;
|
34
34
|
this.price = 0;
|
35
|
-
this.sku = '';
|
36
35
|
this.tags = [];
|
37
36
|
this.thumbnail = null;
|
38
37
|
this.updatedAt = new Date();
|
39
38
|
this.width = 0;
|
39
|
+
if (bluesoft) {
|
40
|
+
this.active = true;
|
41
|
+
this.avgPrice = bluesoft.avgPrice;
|
42
|
+
this.barcodeImage = bluesoft.barcodeImage;
|
43
|
+
this.brand = new product_brand_entity_1.ProductBrandEntity(bluesoft.brand);
|
44
|
+
this.cest = '';
|
45
|
+
this.createdAt = new Date();
|
46
|
+
this.description = bluesoft.description;
|
47
|
+
this.grossWeight = bluesoft.grossWeight || 0;
|
48
|
+
this.gtin = bluesoft.gtin.toString();
|
49
|
+
this.gtinType = gtin_type_enum_1.EGtintype.FOURTEEN;
|
50
|
+
this.height = bluesoft.height || 0;
|
51
|
+
this.id = '';
|
52
|
+
this.length = bluesoft.length || 0;
|
53
|
+
this.maxPrice = bluesoft.maxPrice || 0;
|
54
|
+
this.measureQuantity = ((_b = (_a = this.getGtinFromGtins(ref || 0, bluesoft.gtins)) === null || _a === void 0 ? void 0 : _a.commercialUnit) === null || _b === void 0 ? void 0 : _b.quantityPackaging) || 1;
|
55
|
+
this.measureUnit = ((_d = (_c = this.getGtinFromGtins(ref || 0, bluesoft.gtins)) === null || _c === void 0 ? void 0 : _c.commercialUnit) === null || _d === void 0 ? void 0 : _d.typePackaging) || 'Unidade';
|
56
|
+
this.minPrice = bluesoft.minPrice || 0;
|
57
|
+
this.name = bluesoft.description || '';
|
58
|
+
this.ncm = new product_ncm_entity_1.ProductNcmEntity(bluesoft.ncm);
|
59
|
+
this.netWeight = bluesoft.netWeight || 0;
|
60
|
+
this.price = this.currencyStringToNumber(bluesoft.price);
|
61
|
+
this.tags = [];
|
62
|
+
this.thumbnail = bluesoft.thumbnail || '';
|
63
|
+
this.updatedAt = new Date();
|
64
|
+
this.width = bluesoft.width || 0;
|
65
|
+
}
|
40
66
|
if (data) {
|
41
67
|
for (var key in data) {
|
42
68
|
if (data.hasOwnProperty(key) && key in this) {
|
@@ -45,6 +71,19 @@ var ProductBaseEntity = /** @class */ (function () {
|
|
45
71
|
}
|
46
72
|
}
|
47
73
|
}
|
48
|
-
|
74
|
+
// #endregion Constructors (1)
|
75
|
+
// #region Private Methods (1)
|
76
|
+
ProductGlobalEntity.prototype.getGtinFromGtins = function (ref, gtins) {
|
77
|
+
for (var i = 0; i < gtins.length; i++) {
|
78
|
+
if (gtins[i].gtin === ref) {
|
79
|
+
return gtins[i];
|
80
|
+
}
|
81
|
+
}
|
82
|
+
return null;
|
83
|
+
};
|
84
|
+
ProductGlobalEntity.prototype.currencyStringToNumber = function (value) {
|
85
|
+
return Number(value.replace(/[^0-9.-]+/g, ''));
|
86
|
+
};
|
87
|
+
return ProductGlobalEntity;
|
49
88
|
}());
|
50
|
-
exports.
|
89
|
+
exports.ProductGlobalEntity = ProductGlobalEntity;
|
@@ -1,11 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
4
|
-
var
|
5
|
-
(function (
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
})(
|
3
|
+
exports.EGtintype = void 0;
|
4
|
+
var EGtintype;
|
5
|
+
(function (EGtintype) {
|
6
|
+
EGtintype["ZERO"] = "SEM GTIN";
|
7
|
+
EGtintype["EIGHT"] = "8";
|
8
|
+
EGtintype["TWELVE"] = "12";
|
9
|
+
EGtintype["THIRTEEN"] = "13";
|
10
|
+
EGtintype["FOURTEEN"] = "14";
|
11
|
+
})(EGtintype || (exports.EGtintype = EGtintype = {}));
|
@@ -1 +1 @@
|
|
1
|
-
export { GTINTypeEnum } from
|
1
|
+
export { EGtintype as GTINTypeEnum } from './gtin-type.enum';
|
@@ -2,4 +2,4 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.GTINTypeEnum = void 0;
|
4
4
|
var gtin_type_enum_1 = require("./gtin-type.enum");
|
5
|
-
Object.defineProperty(exports, "GTINTypeEnum", { enumerable: true, get: function () { return gtin_type_enum_1.
|
5
|
+
Object.defineProperty(exports, "GTINTypeEnum", { enumerable: true, get: function () { return gtin_type_enum_1.EGtintype; } });
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { GTINTypeEnum } from '../enums';
|
2
2
|
import { IProductBrand } from './i-brand';
|
3
3
|
import { IProductNcm } from './i-ncm';
|
4
|
-
export interface
|
4
|
+
export interface IProductGlobal {
|
5
5
|
/**
|
6
6
|
* Indicates whether the product is active.
|
7
7
|
* @default true
|
@@ -55,12 +55,6 @@ export interface IProductBase {
|
|
55
55
|
* @default 0
|
56
56
|
*/
|
57
57
|
grossWeight: number | null;
|
58
|
-
/**
|
59
|
-
* Unit of measurement of gross weight.
|
60
|
-
* @minlength 1
|
61
|
-
* @maxlength 6
|
62
|
-
*/
|
63
|
-
grossWeightUnit: string | null;
|
64
58
|
/**
|
65
59
|
* To be filled with the GTIN-8, GTIN-12, GTIN-13 or GTIN-14 code
|
66
60
|
* (old EAN, UPC and DUN-14 codes).
|
@@ -148,15 +142,6 @@ export interface IProductBase {
|
|
148
142
|
* @multipleOf 0.001
|
149
143
|
*/
|
150
144
|
netWeight: number | null;
|
151
|
-
/**
|
152
|
-
* Unit of measurement of net weight.
|
153
|
-
* @minlength 1
|
154
|
-
* @maxlength 6
|
155
|
-
* @example "KG"
|
156
|
-
* @default "UN"
|
157
|
-
* @pattern ^[A-Z]+$
|
158
|
-
*/
|
159
|
-
netWeightUnit: string | null;
|
160
145
|
/**
|
161
146
|
* Price of the product.
|
162
147
|
* @example 1.5
|
@@ -166,14 +151,6 @@ export interface IProductBase {
|
|
166
151
|
* @multipleOf 0.01
|
167
152
|
*/
|
168
153
|
price: number;
|
169
|
-
/**
|
170
|
-
* Code of the product.
|
171
|
-
* @minlength 1
|
172
|
-
* @maxlength 60
|
173
|
-
* @pattern ^[a-zA-Z0-9]+$
|
174
|
-
* @example "123456789"
|
175
|
-
*/
|
176
|
-
sku: string;
|
177
154
|
/**
|
178
155
|
* Tags associated with the product.
|
179
156
|
* @example ["tag1", "tag2"]
|