@nomalism-com/types 0.49.29 → 0.49.31
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 +40 -1
- package/dist/index.js +40 -1
- package/dist/modules/stock/productUpdate/interface.d.ts +71 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -988,7 +988,10 @@ var Route64 = "product_location";
|
|
|
988
988
|
var interface_exports22 = {};
|
|
989
989
|
__export(interface_exports22, {
|
|
990
990
|
ExtractErrorCodeEnum: () => ExtractErrorCodeEnum,
|
|
991
|
-
|
|
991
|
+
MappableFieldEnum: () => MappableFieldEnum,
|
|
992
|
+
MappableFieldLabels: () => MappableFieldLabels,
|
|
993
|
+
Route: () => Route65,
|
|
994
|
+
UpdatableFieldKinds: () => UpdatableFieldKinds
|
|
992
995
|
});
|
|
993
996
|
var Route65 = "product_update";
|
|
994
997
|
var ExtractErrorCodeEnum = {
|
|
@@ -1003,6 +1006,42 @@ var ExtractErrorCodeEnum = {
|
|
|
1003
1006
|
EXTRACTION_FAILED: "EXTRACTION_FAILED"
|
|
1004
1007
|
// outra falha
|
|
1005
1008
|
};
|
|
1009
|
+
var MappableFieldEnum = {
|
|
1010
|
+
provider_ref: "provider_ref",
|
|
1011
|
+
// obrigatório: liga a linha do PDF ao artigo
|
|
1012
|
+
designation: "designation",
|
|
1013
|
+
price_cost: "price_cost",
|
|
1014
|
+
price_sale: "price_sale",
|
|
1015
|
+
width: "width",
|
|
1016
|
+
height: "height",
|
|
1017
|
+
length: "length",
|
|
1018
|
+
diameter: "diameter",
|
|
1019
|
+
weight: "weight",
|
|
1020
|
+
compositions: "compositions"
|
|
1021
|
+
};
|
|
1022
|
+
var MappableFieldLabels = {
|
|
1023
|
+
provider_ref: "Refer\xEAncia do fornecedor",
|
|
1024
|
+
designation: "Designa\xE7\xE3o",
|
|
1025
|
+
price_cost: "Pre\xE7o de custo",
|
|
1026
|
+
price_sale: "Pre\xE7o de venda",
|
|
1027
|
+
width: "Largura",
|
|
1028
|
+
height: "Altura",
|
|
1029
|
+
length: "Comprimento",
|
|
1030
|
+
diameter: "Di\xE2metro",
|
|
1031
|
+
weight: "Peso",
|
|
1032
|
+
compositions: "Composi\xE7\xE3o"
|
|
1033
|
+
};
|
|
1034
|
+
var UpdatableFieldKinds = {
|
|
1035
|
+
designation: "text",
|
|
1036
|
+
price_cost: "price",
|
|
1037
|
+
price_sale: "price",
|
|
1038
|
+
width: "number",
|
|
1039
|
+
height: "number",
|
|
1040
|
+
length: "number",
|
|
1041
|
+
diameter: "number",
|
|
1042
|
+
weight: "number",
|
|
1043
|
+
compositions: "text"
|
|
1044
|
+
};
|
|
1006
1045
|
|
|
1007
1046
|
// src/modules/stock/promotion/interface.ts
|
|
1008
1047
|
var interface_exports23 = {};
|
package/dist/index.js
CHANGED
|
@@ -815,7 +815,10 @@ var Route64 = "product_location";
|
|
|
815
815
|
var interface_exports22 = {};
|
|
816
816
|
__export(interface_exports22, {
|
|
817
817
|
ExtractErrorCodeEnum: () => ExtractErrorCodeEnum,
|
|
818
|
-
|
|
818
|
+
MappableFieldEnum: () => MappableFieldEnum,
|
|
819
|
+
MappableFieldLabels: () => MappableFieldLabels,
|
|
820
|
+
Route: () => Route65,
|
|
821
|
+
UpdatableFieldKinds: () => UpdatableFieldKinds
|
|
819
822
|
});
|
|
820
823
|
var Route65 = "product_update";
|
|
821
824
|
var ExtractErrorCodeEnum = {
|
|
@@ -830,6 +833,42 @@ var ExtractErrorCodeEnum = {
|
|
|
830
833
|
EXTRACTION_FAILED: "EXTRACTION_FAILED"
|
|
831
834
|
// outra falha
|
|
832
835
|
};
|
|
836
|
+
var MappableFieldEnum = {
|
|
837
|
+
provider_ref: "provider_ref",
|
|
838
|
+
// obrigatório: liga a linha do PDF ao artigo
|
|
839
|
+
designation: "designation",
|
|
840
|
+
price_cost: "price_cost",
|
|
841
|
+
price_sale: "price_sale",
|
|
842
|
+
width: "width",
|
|
843
|
+
height: "height",
|
|
844
|
+
length: "length",
|
|
845
|
+
diameter: "diameter",
|
|
846
|
+
weight: "weight",
|
|
847
|
+
compositions: "compositions"
|
|
848
|
+
};
|
|
849
|
+
var MappableFieldLabels = {
|
|
850
|
+
provider_ref: "Refer\xEAncia do fornecedor",
|
|
851
|
+
designation: "Designa\xE7\xE3o",
|
|
852
|
+
price_cost: "Pre\xE7o de custo",
|
|
853
|
+
price_sale: "Pre\xE7o de venda",
|
|
854
|
+
width: "Largura",
|
|
855
|
+
height: "Altura",
|
|
856
|
+
length: "Comprimento",
|
|
857
|
+
diameter: "Di\xE2metro",
|
|
858
|
+
weight: "Peso",
|
|
859
|
+
compositions: "Composi\xE7\xE3o"
|
|
860
|
+
};
|
|
861
|
+
var UpdatableFieldKinds = {
|
|
862
|
+
designation: "text",
|
|
863
|
+
price_cost: "price",
|
|
864
|
+
price_sale: "price",
|
|
865
|
+
width: "number",
|
|
866
|
+
height: "number",
|
|
867
|
+
length: "number",
|
|
868
|
+
diameter: "number",
|
|
869
|
+
weight: "number",
|
|
870
|
+
compositions: "text"
|
|
871
|
+
};
|
|
833
872
|
|
|
834
873
|
// src/modules/stock/promotion/interface.ts
|
|
835
874
|
var interface_exports23 = {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as IShared from "../../../shared/interface";
|
|
2
|
+
import type { IProductState } from "../productGoogleSheets/interface";
|
|
2
3
|
export declare const Route = "product_update";
|
|
3
4
|
export interface IExtractRequest {
|
|
4
5
|
multimedia_ids: string[];
|
|
@@ -53,8 +54,78 @@ export type IExtractFileResult = (IExtractFileResultBase & {
|
|
|
53
54
|
export interface IExtractResponse {
|
|
54
55
|
results: IExtractFileResult[];
|
|
55
56
|
}
|
|
57
|
+
export declare const MappableFieldEnum: {
|
|
58
|
+
provider_ref: "provider_ref";
|
|
59
|
+
designation: "designation";
|
|
60
|
+
price_cost: "price_cost";
|
|
61
|
+
price_sale: "price_sale";
|
|
62
|
+
width: "width";
|
|
63
|
+
height: "height";
|
|
64
|
+
length: "length";
|
|
65
|
+
diameter: "diameter";
|
|
66
|
+
weight: "weight";
|
|
67
|
+
compositions: "compositions";
|
|
68
|
+
};
|
|
69
|
+
export type IMappableField = (typeof MappableFieldEnum)[keyof typeof MappableFieldEnum];
|
|
70
|
+
export type IUpdatableField = Exclude<IMappableField, "provider_ref">;
|
|
71
|
+
export declare const MappableFieldLabels: Record<IMappableField, string>;
|
|
72
|
+
export type IMappableFieldKind = "text" | "price" | "number";
|
|
73
|
+
export declare const UpdatableFieldKinds: Record<IUpdatableField, IMappableFieldKind>;
|
|
74
|
+
export type IAnalyzeRowValues = Partial<Record<IUpdatableField, string>>;
|
|
75
|
+
export interface IAnalyzeRowInput {
|
|
76
|
+
page: number;
|
|
77
|
+
provider_ref: string;
|
|
78
|
+
values: IAnalyzeRowValues;
|
|
79
|
+
}
|
|
80
|
+
export interface IAnalyzeRequest {
|
|
81
|
+
id_provider: number;
|
|
82
|
+
price_sale_includes_vat: boolean;
|
|
83
|
+
new_products_vat_tax_id?: string;
|
|
84
|
+
rows: IAnalyzeRowInput[];
|
|
85
|
+
}
|
|
86
|
+
export type IAnalyzeValues = Partial<Record<IUpdatableField, string | number | null>>;
|
|
87
|
+
export interface IAnalyzeUpdate {
|
|
88
|
+
product_id: string;
|
|
89
|
+
reference: string;
|
|
90
|
+
provider_ref: string;
|
|
91
|
+
page: number;
|
|
92
|
+
current: IAnalyzeValues & {
|
|
93
|
+
state: IProductState;
|
|
94
|
+
};
|
|
95
|
+
new: IAnalyzeValues;
|
|
96
|
+
changes: IUpdatableField[];
|
|
97
|
+
reactivate: boolean;
|
|
98
|
+
}
|
|
99
|
+
export interface IAnalyzeCreate {
|
|
100
|
+
provider_ref: string;
|
|
101
|
+
page: number;
|
|
102
|
+
values: IAnalyzeValues;
|
|
103
|
+
}
|
|
104
|
+
export interface IAnalyzeDiscontinue {
|
|
105
|
+
product_id: string;
|
|
106
|
+
reference: string;
|
|
107
|
+
provider_ref: string;
|
|
108
|
+
designation: string;
|
|
109
|
+
state: IProductState;
|
|
110
|
+
price_cost: number | null;
|
|
111
|
+
price_sale: number | null;
|
|
112
|
+
}
|
|
113
|
+
export interface IAnalyzeProblem {
|
|
114
|
+
page: number;
|
|
115
|
+
provider_ref: string | null;
|
|
116
|
+
message: string;
|
|
117
|
+
}
|
|
118
|
+
export interface IAnalyzeResponse {
|
|
119
|
+
to_update: IAnalyzeUpdate[];
|
|
120
|
+
to_create: IAnalyzeCreate[];
|
|
121
|
+
to_discontinue: IAnalyzeDiscontinue[];
|
|
122
|
+
problems: IAnalyzeProblem[];
|
|
123
|
+
unchanged_count: number;
|
|
124
|
+
without_provider_ref_count: number;
|
|
125
|
+
}
|
|
56
126
|
export interface IRepository {
|
|
57
127
|
extract(data: IExtractRequest): Promise<IExtractResponse>;
|
|
128
|
+
analyze(data: IAnalyzeRequest): Promise<IAnalyzeResponse>;
|
|
58
129
|
}
|
|
59
130
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
60
131
|
export {};
|
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.
|
|
4
|
+
"version": "0.49.31",
|
|
5
5
|
"author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"type": "module",
|