cecon-interfaces 1.1.81 → 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-global/entities/product-ncm.entity.mjs +2 -1
- package/dist/esm2022/product-global/entities/product.entity.mjs +45 -6
- 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/fesm2022/cecon-interfaces.mjs +54 -15
- 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-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 +4 -3
- package/dist/product-global/entities/product.entity.js +45 -5
- 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 +0 -15
- 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,3 +1,4 @@
|
|
1
|
+
import { IBlueSoft } from '../../bluesoft';
|
1
2
|
import { GTINTypeEnum } from '../enums';
|
2
3
|
import { IProductGlobal } from '../interfaces';
|
3
4
|
import { ProductBrandEntity } from './product-brand.entity';
|
@@ -11,7 +12,6 @@ export declare class ProductGlobalEntity implements IProductGlobal {
|
|
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,11 +24,12 @@ export declare class ProductGlobalEntity implements IProductGlobal {
|
|
24
24
|
name: string;
|
25
25
|
ncm: ProductNcmEntity;
|
26
26
|
netWeight: number;
|
27
|
-
netWeightUnit: string | null;
|
28
27
|
price: number;
|
29
28
|
tags: string[];
|
30
29
|
thumbnail: string | null;
|
31
30
|
updatedAt: Date;
|
32
31
|
width: number;
|
33
|
-
constructor(data?: Partial<ProductGlobalEntity
|
32
|
+
constructor(data?: Partial<ProductGlobalEntity>, bluesoft?: IBlueSoft, ref?: number);
|
33
|
+
private getGtinFromGtins;
|
34
|
+
private currencyStringToNumber;
|
34
35
|
}
|
@@ -2,13 +2,15 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
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
8
|
var ProductGlobalEntity = /** @class */ (function () {
|
8
|
-
// #endregion Properties (
|
9
|
+
// #endregion Properties (26)
|
9
10
|
// #region Constructors (1)
|
10
|
-
function ProductGlobalEntity(data) {
|
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 ProductGlobalEntity = /** @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,12 +31,38 @@ var ProductGlobalEntity = /** @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
35
|
this.tags = [];
|
36
36
|
this.thumbnail = null;
|
37
37
|
this.updatedAt = new Date();
|
38
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
|
+
}
|
39
66
|
if (data) {
|
40
67
|
for (var key in data) {
|
41
68
|
if (data.hasOwnProperty(key) && key in this) {
|
@@ -44,6 +71,19 @@ var ProductGlobalEntity = /** @class */ (function () {
|
|
44
71
|
}
|
45
72
|
}
|
46
73
|
}
|
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
|
+
};
|
47
87
|
return ProductGlobalEntity;
|
48
88
|
}());
|
49
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; } });
|
@@ -55,12 +55,6 @@ export interface IProductGlobal {
|
|
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 IProductGlobal {
|
|
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
|