@nomalism-com/types 0.49.29 → 0.49.30
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 +15 -0
- package/dist/index.js +15 -0
- package/dist/modules/stock/productUpdate/interface.d.ts +67 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -988,6 +988,8 @@ var Route64 = "product_location";
|
|
|
988
988
|
var interface_exports22 = {};
|
|
989
989
|
__export(interface_exports22, {
|
|
990
990
|
ExtractErrorCodeEnum: () => ExtractErrorCodeEnum,
|
|
991
|
+
MappableFieldEnum: () => MappableFieldEnum,
|
|
992
|
+
MappableFieldLabels: () => MappableFieldLabels,
|
|
991
993
|
Route: () => Route65
|
|
992
994
|
});
|
|
993
995
|
var Route65 = "product_update";
|
|
@@ -1003,6 +1005,19 @@ var ExtractErrorCodeEnum = {
|
|
|
1003
1005
|
EXTRACTION_FAILED: "EXTRACTION_FAILED"
|
|
1004
1006
|
// outra falha
|
|
1005
1007
|
};
|
|
1008
|
+
var MappableFieldEnum = {
|
|
1009
|
+
provider_ref: "provider_ref",
|
|
1010
|
+
// obrigatório: liga a linha do PDF ao artigo
|
|
1011
|
+
designation: "designation",
|
|
1012
|
+
price_cost: "price_cost",
|
|
1013
|
+
price_sale: "price_sale"
|
|
1014
|
+
};
|
|
1015
|
+
var MappableFieldLabels = {
|
|
1016
|
+
provider_ref: "Refer\xEAncia do fornecedor",
|
|
1017
|
+
designation: "Designa\xE7\xE3o",
|
|
1018
|
+
price_cost: "Pre\xE7o de custo",
|
|
1019
|
+
price_sale: "Pre\xE7o de venda"
|
|
1020
|
+
};
|
|
1006
1021
|
|
|
1007
1022
|
// src/modules/stock/promotion/interface.ts
|
|
1008
1023
|
var interface_exports23 = {};
|
package/dist/index.js
CHANGED
|
@@ -815,6 +815,8 @@ var Route64 = "product_location";
|
|
|
815
815
|
var interface_exports22 = {};
|
|
816
816
|
__export(interface_exports22, {
|
|
817
817
|
ExtractErrorCodeEnum: () => ExtractErrorCodeEnum,
|
|
818
|
+
MappableFieldEnum: () => MappableFieldEnum,
|
|
819
|
+
MappableFieldLabels: () => MappableFieldLabels,
|
|
818
820
|
Route: () => Route65
|
|
819
821
|
});
|
|
820
822
|
var Route65 = "product_update";
|
|
@@ -830,6 +832,19 @@ var ExtractErrorCodeEnum = {
|
|
|
830
832
|
EXTRACTION_FAILED: "EXTRACTION_FAILED"
|
|
831
833
|
// outra falha
|
|
832
834
|
};
|
|
835
|
+
var MappableFieldEnum = {
|
|
836
|
+
provider_ref: "provider_ref",
|
|
837
|
+
// obrigatório: liga a linha do PDF ao artigo
|
|
838
|
+
designation: "designation",
|
|
839
|
+
price_cost: "price_cost",
|
|
840
|
+
price_sale: "price_sale"
|
|
841
|
+
};
|
|
842
|
+
var MappableFieldLabels = {
|
|
843
|
+
provider_ref: "Refer\xEAncia do fornecedor",
|
|
844
|
+
designation: "Designa\xE7\xE3o",
|
|
845
|
+
price_cost: "Pre\xE7o de custo",
|
|
846
|
+
price_sale: "Pre\xE7o de venda"
|
|
847
|
+
};
|
|
833
848
|
|
|
834
849
|
// src/modules/stock/promotion/interface.ts
|
|
835
850
|
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,74 @@ 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
|
+
};
|
|
63
|
+
export type IMappableField = (typeof MappableFieldEnum)[keyof typeof MappableFieldEnum];
|
|
64
|
+
export declare const MappableFieldLabels: Record<IMappableField, string>;
|
|
65
|
+
export interface IAnalyzeRowInput {
|
|
66
|
+
page: number;
|
|
67
|
+
provider_ref: string;
|
|
68
|
+
designation?: string;
|
|
69
|
+
price_cost?: string;
|
|
70
|
+
price_sale?: string;
|
|
71
|
+
}
|
|
72
|
+
export interface IAnalyzeRequest {
|
|
73
|
+
id_provider: number;
|
|
74
|
+
price_sale_includes_vat: boolean;
|
|
75
|
+
new_products_vat_tax_id?: string;
|
|
76
|
+
rows: IAnalyzeRowInput[];
|
|
77
|
+
}
|
|
78
|
+
export interface IAnalyzeValues {
|
|
79
|
+
designation: string | null;
|
|
80
|
+
price_cost: number | null;
|
|
81
|
+
price_sale: number | null;
|
|
82
|
+
}
|
|
83
|
+
export interface IAnalyzeUpdate {
|
|
84
|
+
product_id: string;
|
|
85
|
+
reference: string;
|
|
86
|
+
provider_ref: string;
|
|
87
|
+
page: number;
|
|
88
|
+
current: IAnalyzeValues & {
|
|
89
|
+
state: IProductState;
|
|
90
|
+
};
|
|
91
|
+
new: IAnalyzeValues;
|
|
92
|
+
changes: IMappableField[];
|
|
93
|
+
reactivate: boolean;
|
|
94
|
+
}
|
|
95
|
+
export interface IAnalyzeCreate {
|
|
96
|
+
provider_ref: string;
|
|
97
|
+
page: number;
|
|
98
|
+
values: IAnalyzeValues;
|
|
99
|
+
}
|
|
100
|
+
export interface IAnalyzeDiscontinue {
|
|
101
|
+
product_id: string;
|
|
102
|
+
reference: string;
|
|
103
|
+
provider_ref: string;
|
|
104
|
+
designation: string;
|
|
105
|
+
state: IProductState;
|
|
106
|
+
price_cost: number | null;
|
|
107
|
+
price_sale: number | null;
|
|
108
|
+
}
|
|
109
|
+
export interface IAnalyzeProblem {
|
|
110
|
+
page: number;
|
|
111
|
+
provider_ref: string | null;
|
|
112
|
+
message: string;
|
|
113
|
+
}
|
|
114
|
+
export interface IAnalyzeResponse {
|
|
115
|
+
to_update: IAnalyzeUpdate[];
|
|
116
|
+
to_create: IAnalyzeCreate[];
|
|
117
|
+
to_discontinue: IAnalyzeDiscontinue[];
|
|
118
|
+
problems: IAnalyzeProblem[];
|
|
119
|
+
unchanged_count: number;
|
|
120
|
+
without_provider_ref_count: number;
|
|
121
|
+
}
|
|
56
122
|
export interface IRepository {
|
|
57
123
|
extract(data: IExtractRequest): Promise<IExtractResponse>;
|
|
124
|
+
analyze(data: IAnalyzeRequest): Promise<IAnalyzeResponse>;
|
|
58
125
|
}
|
|
59
126
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
60
127
|
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.30",
|
|
5
5
|
"author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"type": "module",
|