cecon-interfaces 1.1.80 → 1.1.82

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.
Files changed (54) hide show
  1. package/dist/bluesoft/index.d.ts +1 -0
  2. package/dist/bluesoft/index.js +17 -0
  3. package/dist/bluesoft/interfaces/i-bluesoft-brand.d.ts +4 -0
  4. package/dist/bluesoft/interfaces/i-bluesoft-brand.js +2 -0
  5. package/dist/bluesoft/interfaces/i-bluesoft-gtin-commercial-unit.d.ts +6 -0
  6. package/dist/bluesoft/interfaces/i-bluesoft-gtin-commercial-unit.js +2 -0
  7. package/dist/bluesoft/interfaces/i-bluesoft-gtin.d.ts +5 -0
  8. package/dist/bluesoft/interfaces/i-bluesoft-gtin.js +2 -0
  9. package/dist/bluesoft/interfaces/i-bluesoft-ncm.d.ts +6 -0
  10. package/dist/bluesoft/interfaces/i-bluesoft-ncm.js +2 -0
  11. package/dist/bluesoft/interfaces/i-bluesoft.d.ts +24 -0
  12. package/dist/bluesoft/interfaces/i-bluesoft.js +2 -0
  13. package/dist/bluesoft/interfaces/index.d.ts +1 -0
  14. package/dist/bluesoft/interfaces/index.js +2 -0
  15. package/dist/esm2022/bluesoft/index.mjs +2 -0
  16. package/dist/esm2022/bluesoft/interfaces/i-bluesoft-brand.mjs +2 -0
  17. package/dist/esm2022/bluesoft/interfaces/i-bluesoft-gtin-commercial-unit.mjs +2 -0
  18. package/dist/esm2022/bluesoft/interfaces/i-bluesoft-gtin.mjs +2 -0
  19. package/dist/esm2022/bluesoft/interfaces/i-bluesoft-ncm.mjs +2 -0
  20. package/dist/esm2022/bluesoft/interfaces/i-bluesoft.mjs +2 -0
  21. package/dist/esm2022/bluesoft/interfaces/index.mjs +2 -0
  22. package/dist/esm2022/index.mjs +2 -1
  23. package/dist/esm2022/product-container/entities/product.entity.mjs +4 -5
  24. package/dist/esm2022/product-container/interfaces/i-product.mjs +1 -1
  25. package/dist/esm2022/product-global/entities/index.mjs +2 -2
  26. package/dist/esm2022/product-global/entities/product-ncm.entity.mjs +2 -1
  27. package/dist/esm2022/product-global/entities/product.entity.mjs +46 -8
  28. package/dist/esm2022/product-global/enums/gtin-type.enum.mjs +9 -9
  29. package/dist/esm2022/product-global/enums/index.mjs +2 -2
  30. package/dist/esm2022/product-global/interfaces/i-ncm.mjs +1 -1
  31. package/dist/esm2022/product-global/interfaces/i-product.mjs +1 -1
  32. package/dist/esm2022/product-global/interfaces/index.mjs +1 -1
  33. package/dist/fesm2022/cecon-interfaces.mjs +58 -21
  34. package/dist/fesm2022/cecon-interfaces.mjs.map +1 -1
  35. package/dist/index.d.ts +1 -0
  36. package/dist/index.js +1 -0
  37. package/dist/package.json +1 -1
  38. package/dist/product-container/entities/product.entity.d.ts +2 -3
  39. package/dist/product-container/entities/product.entity.js +3 -4
  40. package/dist/product-container/interfaces/i-product.d.ts +2 -10
  41. package/dist/product-global/entities/index.d.ts +1 -1
  42. package/dist/product-global/entities/index.js +2 -2
  43. package/dist/product-global/entities/product-ncm.entity.d.ts +1 -0
  44. package/dist/product-global/entities/product-ncm.entity.js +1 -0
  45. package/dist/product-global/entities/product.entity.d.ts +6 -6
  46. package/dist/product-global/entities/product.entity.js +49 -10
  47. package/dist/product-global/enums/gtin-type.enum.d.ts +1 -1
  48. package/dist/product-global/enums/gtin-type.enum.js +9 -9
  49. package/dist/product-global/enums/index.d.ts +1 -1
  50. package/dist/product-global/enums/index.js +1 -1
  51. package/dist/product-global/interfaces/i-ncm.d.ts +1 -0
  52. package/dist/product-global/interfaces/i-product.d.ts +1 -24
  53. package/dist/product-global/interfaces/index.d.ts +1 -1
  54. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './app';
2
2
  export * from './billing';
3
3
  export * from './billing-order';
4
+ export * from './bluesoft';
4
5
  export * from './campaign';
5
6
  export * from './clients';
6
7
  export * from './company';
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,6 +1,6 @@
1
1
  {
2
2
  "name": "cecon-interfaces",
3
- "version": "1.1.80",
3
+ "version": "1.1.82",
4
4
  "description": "Interfaces de Projetos Cecon",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,10 +1,9 @@
1
- import { ProductBaseEntity } from '../../product-global';
1
+ import { ProductGlobalEntity } from '../../product-global/entities/product.entity';
2
2
  import { IProductContainer } from '../interfaces';
3
- export declare class ProductContainerEntity extends ProductBaseEntity implements IProductContainer {
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 product_global_1 = require("../../product-global");
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
- }(product_global_1.ProductBaseEntity));
41
+ }(product_entity_1.ProductGlobalEntity));
43
42
  exports.ProductContainerEntity = ProductContainerEntity;
@@ -1,5 +1,5 @@
1
- import { IProductBase } from '../../product-global';
2
- export interface IProductContainer extends IProductBase {
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,3 +1,3 @@
1
1
  export { ProductBrandEntity } from './product-brand.entity';
2
2
  export { ProductNcmEntity } from './product-ncm.entity';
3
- export { ProductBaseEntity } from './product.entity';
3
+ export { ProductGlobalEntity as ProductglobalEntity } from './product.entity';
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProductBaseEntity = exports.ProductNcmEntity = exports.ProductBrandEntity = void 0;
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, "ProductBaseEntity", { enumerable: true, get: function () { return product_entity_1.ProductBaseEntity; } });
9
+ Object.defineProperty(exports, "ProductglobalEntity", { enumerable: true, get: function () { return product_entity_1.ProductGlobalEntity; } });
@@ -3,5 +3,6 @@ export declare class ProductNcmEntity implements IProductNcm {
3
3
  code: string;
4
4
  description: string;
5
5
  fullDescription: string;
6
+ ex: string | null;
6
7
  constructor(data?: Partial<ProductNcmEntity>);
7
8
  }
@@ -9,6 +9,7 @@ var ProductNcmEntity = /** @class */ (function () {
9
9
  this.code = '';
10
10
  this.description = '';
11
11
  this.fullDescription = '';
12
+ this.ex = null;
12
13
  if (data) {
13
14
  for (var key in data) {
14
15
  if (data.hasOwnProperty(key) && key in this) {
@@ -1,8 +1,9 @@
1
+ import { IBlueSoft } from '../../bluesoft';
1
2
  import { GTINTypeEnum } from '../enums';
2
- import { IProductBase } from '../interfaces';
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 ProductBaseEntity implements IProductBase {
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<ProductBaseEntity>);
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.ProductBaseEntity = void 0;
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 ProductBaseEntity = /** @class */ (function () {
8
- // #endregion Properties (29)
8
+ var ProductGlobalEntity = /** @class */ (function () {
9
+ // #endregion Properties (26)
9
10
  // #region Constructors (1)
10
- function ProductBaseEntity(data) {
11
- // #region Properties (29)
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
- return ProductBaseEntity;
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.ProductBaseEntity = ProductBaseEntity;
89
+ exports.ProductGlobalEntity = ProductGlobalEntity;
@@ -1,4 +1,4 @@
1
- export declare enum GTINTypeEnum {
1
+ export declare enum EGtintype {
2
2
  ZERO = "SEM GTIN",
3
3
  EIGHT = "8",
4
4
  TWELVE = "12",
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GTINTypeEnum = void 0;
4
- var GTINTypeEnum;
5
- (function (GTINTypeEnum) {
6
- GTINTypeEnum["ZERO"] = "SEM GTIN";
7
- GTINTypeEnum["EIGHT"] = "8";
8
- GTINTypeEnum["TWELVE"] = "12";
9
- GTINTypeEnum["THIRTEEN"] = "13";
10
- GTINTypeEnum["FOURTEEN"] = "14";
11
- })(GTINTypeEnum || (exports.GTINTypeEnum = GTINTypeEnum = {}));
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 "./gtin-type.enum";
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.GTINTypeEnum; } });
5
+ Object.defineProperty(exports, "GTINTypeEnum", { enumerable: true, get: function () { return gtin_type_enum_1.EGtintype; } });
@@ -2,4 +2,5 @@ export interface IProductNcm {
2
2
  code: string;
3
3
  description: string;
4
4
  fullDescription: string;
5
+ ex: string | null;
5
6
  }
@@ -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 IProductBase {
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"]
@@ -1,3 +1,3 @@
1
1
  export { IProductBrand } from './i-brand';
2
2
  export { IProductNcm } from './i-ncm';
3
- export { IProductBase } from './i-product';
3
+ export { IProductGlobal } from './i-product';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cecon-interfaces",
3
- "version": "1.1.80",
3
+ "version": "1.1.82",
4
4
  "description": "Interfaces de Projetos Cecon",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",