@nomalism-com/types 1.2.1 → 1.2.2
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.js +19 -5
- package/dist/modules/document/transformado/interfaces.d.ts +10 -4
- package/dist/modules/document/transformado/route.schema.d.ts +2 -1
- package/dist/modules/integration/googleSheets/interfaces.d.ts +0 -2
- package/dist/modules/stock/task/interface.d.ts +6 -0
- package/dist/modules/stock/task/route.schema.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4661,20 +4661,27 @@ var LowerName78 = UpperName78[0].toLowerCase() + UpperName78.substring(1);
|
|
|
4661
4661
|
// src/modules/document/transformado/route.schema.ts
|
|
4662
4662
|
var route_schema_exports85 = {};
|
|
4663
4663
|
__export(route_schema_exports85, {
|
|
4664
|
-
|
|
4664
|
+
destransformarBody: () => destransformarBody,
|
|
4665
|
+
transformarBody: () => transformarBody
|
|
4665
4666
|
});
|
|
4666
|
-
var
|
|
4667
|
+
var productsKeys = {
|
|
4667
4668
|
id: joi10.string().uuid().required().invalid(joi10.ref("/product_id")),
|
|
4668
4669
|
quantity: joi10.number().positive().required()
|
|
4669
4670
|
};
|
|
4670
|
-
var
|
|
4671
|
+
var transformarKeys = {
|
|
4671
4672
|
product_id: joi10.string().uuid().required(),
|
|
4672
4673
|
quantity: joi10.number().positive().required(),
|
|
4673
4674
|
price_cost: joi10.number().positive().allow(0).required(),
|
|
4674
4675
|
price_sale: joi10.number().positive().allow(0).required(),
|
|
4675
|
-
|
|
4676
|
+
out_products: joi10.array().items(joi10.object().keys(productsKeys)).min(1)
|
|
4676
4677
|
};
|
|
4677
|
-
var
|
|
4678
|
+
var transformarBody = joi10.object().keys(transformarKeys).messages(messages);
|
|
4679
|
+
var destransformarKeys = {
|
|
4680
|
+
product_id: joi10.string().uuid().required(),
|
|
4681
|
+
quantity: joi10.number().positive().required(),
|
|
4682
|
+
in_products: joi10.array().items(joi10.object().keys(productsKeys)).min(1)
|
|
4683
|
+
};
|
|
4684
|
+
var destransformarBody = joi10.object().keys(destransformarKeys).messages(messages);
|
|
4678
4685
|
|
|
4679
4686
|
// src/modules/document/quebra/interfaces.ts
|
|
4680
4687
|
var interfaces_exports46 = {};
|
|
@@ -5236,6 +5243,7 @@ var historyStatusDataType = Object.keys(IHistoryStatusDataTypeEnum);
|
|
|
5236
5243
|
var route_schema_exports97 = {};
|
|
5237
5244
|
__export(route_schema_exports97, {
|
|
5238
5245
|
createBody: () => createBody64,
|
|
5246
|
+
createFromDossierBody: () => createFromDossierBody,
|
|
5239
5247
|
findTaskParams: () => findTaskParams,
|
|
5240
5248
|
updateBody: () => updateBody55
|
|
5241
5249
|
});
|
|
@@ -5243,6 +5251,12 @@ var createBodyKeys63 = {
|
|
|
5243
5251
|
task: joi10.string().required()
|
|
5244
5252
|
};
|
|
5245
5253
|
var createBody64 = joi10.object().keys(createBodyKeys63).messages(messages);
|
|
5254
|
+
var createFromDossierBodyKeys = {
|
|
5255
|
+
from: joi10.string().uuid().required(),
|
|
5256
|
+
to: joi10.string().uuid().allow(null).required(),
|
|
5257
|
+
task: joi10.string().required()
|
|
5258
|
+
};
|
|
5259
|
+
var createFromDossierBody = joi10.object().keys(createFromDossierBodyKeys).messages(messages);
|
|
5246
5260
|
var updateBodyKeys55 = {
|
|
5247
5261
|
from: joi10.string().uuid().optional(),
|
|
5248
5262
|
to: joi10.string().uuid().allow(null).optional(),
|
|
@@ -2,18 +2,24 @@ import * as IShared from '../../../shared/interface';
|
|
|
2
2
|
export declare const Route = "transformado";
|
|
3
3
|
export declare const UpperName = "Transformado";
|
|
4
4
|
export declare const LowerName: string;
|
|
5
|
-
export interface
|
|
5
|
+
export interface IProducts {
|
|
6
6
|
id: string;
|
|
7
7
|
quantity: number;
|
|
8
8
|
}
|
|
9
|
-
export interface
|
|
9
|
+
export interface ITransformar {
|
|
10
10
|
product_id: string;
|
|
11
11
|
quantity: number;
|
|
12
12
|
price_sale: number;
|
|
13
13
|
price_cost: number;
|
|
14
|
-
|
|
14
|
+
out_products: IProducts[];
|
|
15
|
+
}
|
|
16
|
+
export interface IDestransformar {
|
|
17
|
+
product_id: string;
|
|
18
|
+
quantity: number;
|
|
19
|
+
in_products: IProducts[];
|
|
15
20
|
}
|
|
16
21
|
export interface IRepository {
|
|
17
|
-
|
|
22
|
+
transformar(data: ITransformar): Promise<string>;
|
|
23
|
+
destransformar(data: IDestransformar): Promise<string>;
|
|
18
24
|
}
|
|
19
25
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -26,7 +26,6 @@ export interface ICloneResponse {
|
|
|
26
26
|
}
|
|
27
27
|
export type IGetProductGroup = 'cortinado' | 'tapete' | 'estore' | 'estofo' | 'almofada' | 'outros' | 'calhas&varões' | 'papel' | 'varoes' | 'terceiros';
|
|
28
28
|
export type IGetProductType = 'confecção' | 'calha' | 'tecido 1' | 'tecido 2' | 'varoes' | 'livre' | 'papel';
|
|
29
|
-
export type IReferenceType = 'noma' | 'sheets' | undefined;
|
|
30
29
|
export interface IGetProduct {
|
|
31
30
|
index: number;
|
|
32
31
|
group: IGetProductGroup;
|
|
@@ -37,7 +36,6 @@ export interface IGetProduct {
|
|
|
37
36
|
discount: number;
|
|
38
37
|
price_sale: number;
|
|
39
38
|
price_cost: number;
|
|
40
|
-
reference_type?: IReferenceType;
|
|
41
39
|
}
|
|
42
40
|
export interface IGetDataResponse {
|
|
43
41
|
products: IGetProduct[];
|
|
@@ -14,6 +14,11 @@ export declare const taskStatusDataType: string[];
|
|
|
14
14
|
export type ICreateRequest = {
|
|
15
15
|
task: string;
|
|
16
16
|
};
|
|
17
|
+
export type ICreateFromDossierRequest = {
|
|
18
|
+
from: string;
|
|
19
|
+
to: string | null;
|
|
20
|
+
task: string;
|
|
21
|
+
};
|
|
17
22
|
export type IUpdateRequest = {
|
|
18
23
|
from?: string;
|
|
19
24
|
to?: string | null;
|
|
@@ -75,6 +80,7 @@ export interface IRepository {
|
|
|
75
80
|
find(selector: IFindTasksRequest): Promise<IFindResponse[]>;
|
|
76
81
|
findWithMessages(id: IShared.IFindByIdRequest): Promise<IFindWithMessagesResponse>;
|
|
77
82
|
create(data: ICreateRequest): Promise<Entity>;
|
|
83
|
+
createFromDossier(data: ICreateFromDossierRequest): Promise<Entity>;
|
|
78
84
|
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>;
|
|
79
85
|
delete(selector: IShared.IFindByIdRequest): Promise<void>;
|
|
80
86
|
findByOwnerId: (selector: IShared.IFindByOwnerIdRequest) => Promise<IFindByOwnerResponse[]>;
|
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": "1.2.
|
|
4
|
+
"version": "1.2.2",
|
|
5
5
|
"author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"type": "module",
|