@nomalism-com/types 0.49.30 → 0.49.32

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.cjs CHANGED
@@ -988,9 +988,14 @@ var Route64 = "product_location";
988
988
  var interface_exports22 = {};
989
989
  __export(interface_exports22, {
990
990
  ExtractErrorCodeEnum: () => ExtractErrorCodeEnum,
991
+ LengthUnitEnum: () => LengthUnitEnum,
991
992
  MappableFieldEnum: () => MappableFieldEnum,
992
993
  MappableFieldLabels: () => MappableFieldLabels,
993
- Route: () => Route65
994
+ RefMatchEnum: () => RefMatchEnum,
995
+ RefMatchLabels: () => RefMatchLabels,
996
+ Route: () => Route65,
997
+ UpdatableFieldKinds: () => UpdatableFieldKinds,
998
+ WeightUnitEnum: () => WeightUnitEnum
994
999
  });
995
1000
  var Route65 = "product_update";
996
1001
  var ExtractErrorCodeEnum = {
@@ -1010,13 +1015,50 @@ var MappableFieldEnum = {
1010
1015
  // obrigatório: liga a linha do PDF ao artigo
1011
1016
  designation: "designation",
1012
1017
  price_cost: "price_cost",
1013
- price_sale: "price_sale"
1018
+ price_sale: "price_sale",
1019
+ width: "width",
1020
+ height: "height",
1021
+ length: "length",
1022
+ diameter: "diameter",
1023
+ weight: "weight",
1024
+ compositions: "compositions"
1014
1025
  };
1015
1026
  var MappableFieldLabels = {
1016
1027
  provider_ref: "Refer\xEAncia do fornecedor",
1017
1028
  designation: "Designa\xE7\xE3o",
1018
1029
  price_cost: "Pre\xE7o de custo",
1019
- price_sale: "Pre\xE7o de venda"
1030
+ price_sale: "Pre\xE7o de venda",
1031
+ width: "Largura",
1032
+ height: "Altura",
1033
+ length: "Comprimento",
1034
+ diameter: "Di\xE2metro",
1035
+ weight: "Peso",
1036
+ compositions: "Composi\xE7\xE3o"
1037
+ };
1038
+ var UpdatableFieldKinds = {
1039
+ designation: "text",
1040
+ price_cost: "price",
1041
+ price_sale: "price",
1042
+ width: "length",
1043
+ height: "length",
1044
+ length: "length",
1045
+ diameter: "length",
1046
+ weight: "weight",
1047
+ compositions: "text"
1048
+ };
1049
+ var LengthUnitEnum = {
1050
+ m: "m",
1051
+ cm: "cm",
1052
+ mm: "mm"
1053
+ };
1054
+ var WeightUnitEnum = { kg: "kg", g: "g" };
1055
+ var RefMatchEnum = {
1056
+ exact: "exact",
1057
+ contains: "contains"
1058
+ };
1059
+ var RefMatchLabels = {
1060
+ exact: "Igual \xE0 ref. fornecedor",
1061
+ contains: "Contida na ref. fornecedor"
1020
1062
  };
1021
1063
 
1022
1064
  // src/modules/stock/promotion/interface.ts
package/dist/index.js CHANGED
@@ -815,9 +815,14 @@ var Route64 = "product_location";
815
815
  var interface_exports22 = {};
816
816
  __export(interface_exports22, {
817
817
  ExtractErrorCodeEnum: () => ExtractErrorCodeEnum,
818
+ LengthUnitEnum: () => LengthUnitEnum,
818
819
  MappableFieldEnum: () => MappableFieldEnum,
819
820
  MappableFieldLabels: () => MappableFieldLabels,
820
- Route: () => Route65
821
+ RefMatchEnum: () => RefMatchEnum,
822
+ RefMatchLabels: () => RefMatchLabels,
823
+ Route: () => Route65,
824
+ UpdatableFieldKinds: () => UpdatableFieldKinds,
825
+ WeightUnitEnum: () => WeightUnitEnum
821
826
  });
822
827
  var Route65 = "product_update";
823
828
  var ExtractErrorCodeEnum = {
@@ -837,13 +842,50 @@ var MappableFieldEnum = {
837
842
  // obrigatório: liga a linha do PDF ao artigo
838
843
  designation: "designation",
839
844
  price_cost: "price_cost",
840
- price_sale: "price_sale"
845
+ price_sale: "price_sale",
846
+ width: "width",
847
+ height: "height",
848
+ length: "length",
849
+ diameter: "diameter",
850
+ weight: "weight",
851
+ compositions: "compositions"
841
852
  };
842
853
  var MappableFieldLabels = {
843
854
  provider_ref: "Refer\xEAncia do fornecedor",
844
855
  designation: "Designa\xE7\xE3o",
845
856
  price_cost: "Pre\xE7o de custo",
846
- price_sale: "Pre\xE7o de venda"
857
+ price_sale: "Pre\xE7o de venda",
858
+ width: "Largura",
859
+ height: "Altura",
860
+ length: "Comprimento",
861
+ diameter: "Di\xE2metro",
862
+ weight: "Peso",
863
+ compositions: "Composi\xE7\xE3o"
864
+ };
865
+ var UpdatableFieldKinds = {
866
+ designation: "text",
867
+ price_cost: "price",
868
+ price_sale: "price",
869
+ width: "length",
870
+ height: "length",
871
+ length: "length",
872
+ diameter: "length",
873
+ weight: "weight",
874
+ compositions: "text"
875
+ };
876
+ var LengthUnitEnum = {
877
+ m: "m",
878
+ cm: "cm",
879
+ mm: "mm"
880
+ };
881
+ var WeightUnitEnum = { kg: "kg", g: "g" };
882
+ var RefMatchEnum = {
883
+ exact: "exact",
884
+ contains: "contains"
885
+ };
886
+ var RefMatchLabels = {
887
+ exact: "Igual \xE0 ref. fornecedor",
888
+ contains: "Contida na ref. fornecedor"
847
889
  };
848
890
 
849
891
  // src/modules/stock/promotion/interface.ts
@@ -59,37 +59,62 @@ export declare const MappableFieldEnum: {
59
59
  designation: "designation";
60
60
  price_cost: "price_cost";
61
61
  price_sale: "price_sale";
62
+ width: "width";
63
+ height: "height";
64
+ length: "length";
65
+ diameter: "diameter";
66
+ weight: "weight";
67
+ compositions: "compositions";
62
68
  };
63
69
  export type IMappableField = (typeof MappableFieldEnum)[keyof typeof MappableFieldEnum];
70
+ export type IUpdatableField = Exclude<IMappableField, "provider_ref">;
64
71
  export declare const MappableFieldLabels: Record<IMappableField, string>;
72
+ export type IMappableFieldKind = "text" | "price" | "length" | "weight";
73
+ export declare const UpdatableFieldKinds: Record<IUpdatableField, IMappableFieldKind>;
74
+ export declare const LengthUnitEnum: {
75
+ m: "m";
76
+ cm: "cm";
77
+ mm: "mm";
78
+ };
79
+ export type ILengthUnit = (typeof LengthUnitEnum)[keyof typeof LengthUnitEnum];
80
+ export declare const WeightUnitEnum: {
81
+ kg: "kg";
82
+ g: "g";
83
+ };
84
+ export type IWeightUnit = (typeof WeightUnitEnum)[keyof typeof WeightUnitEnum];
85
+ export declare const RefMatchEnum: {
86
+ exact: "exact";
87
+ contains: "contains";
88
+ };
89
+ export type IRefMatch = (typeof RefMatchEnum)[keyof typeof RefMatchEnum];
90
+ export declare const RefMatchLabels: Record<IRefMatch, string>;
91
+ export type IAnalyzeRowValues = Partial<Record<IUpdatableField, string>>;
65
92
  export interface IAnalyzeRowInput {
66
93
  page: number;
67
94
  provider_ref: string;
68
- designation?: string;
69
- price_cost?: string;
70
- price_sale?: string;
95
+ values: IAnalyzeRowValues;
71
96
  }
72
97
  export interface IAnalyzeRequest {
73
98
  id_provider: number;
99
+ ref_match: IRefMatch;
74
100
  price_sale_includes_vat: boolean;
75
101
  new_products_vat_tax_id?: string;
102
+ length_unit: ILengthUnit;
103
+ weight_unit: IWeightUnit;
76
104
  rows: IAnalyzeRowInput[];
77
105
  }
78
- export interface IAnalyzeValues {
79
- designation: string | null;
80
- price_cost: number | null;
81
- price_sale: number | null;
82
- }
106
+ export type IAnalyzeValues = Partial<Record<IUpdatableField, string | number | null>>;
83
107
  export interface IAnalyzeUpdate {
84
108
  product_id: string;
85
109
  reference: string;
86
110
  provider_ref: string;
111
+ product_provider_ref: string;
87
112
  page: number;
88
113
  current: IAnalyzeValues & {
89
114
  state: IProductState;
90
115
  };
91
116
  new: IAnalyzeValues;
92
- changes: IMappableField[];
117
+ changes: IUpdatableField[];
93
118
  reactivate: boolean;
94
119
  }
95
120
  export interface IAnalyzeCreate {
@@ -97,7 +122,7 @@ export interface IAnalyzeCreate {
97
122
  page: number;
98
123
  values: IAnalyzeValues;
99
124
  }
100
- export interface IAnalyzeDiscontinue {
125
+ export interface IAnalyzeProduct {
101
126
  product_id: string;
102
127
  reference: string;
103
128
  provider_ref: string;
@@ -106,6 +131,7 @@ export interface IAnalyzeDiscontinue {
106
131
  price_cost: number | null;
107
132
  price_sale: number | null;
108
133
  }
134
+ export type IAnalyzeDiscontinue = IAnalyzeProduct;
109
135
  export interface IAnalyzeProblem {
110
136
  page: number;
111
137
  provider_ref: string | null;
@@ -117,7 +143,7 @@ export interface IAnalyzeResponse {
117
143
  to_discontinue: IAnalyzeDiscontinue[];
118
144
  problems: IAnalyzeProblem[];
119
145
  unchanged_count: number;
120
- without_provider_ref_count: number;
146
+ without_provider_ref: IAnalyzeProduct[];
121
147
  }
122
148
  export interface IRepository {
123
149
  extract(data: IExtractRequest): Promise<IExtractResponse>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nomalism-com/types",
3
3
  "description": "A nomalism package with all necessary types and validations for developing APIs",
4
- "version": "0.49.30",
4
+ "version": "0.49.32",
5
5
  "author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",