@nomalism-com/types 0.34.28 → 0.34.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 -7
- package/dist/index.js +15 -7
- package/dist/modules/document/order/interfaces.d.ts +1 -3
- package/dist/modules/user/persona/interface.d.ts +15 -0
- package/dist/modules/user/persona/route.schema.d.ts +1 -0
- package/dist/shared/entities/stock.d.ts +2 -0
- package/package-lock.json +239 -236
- package/package.json +1 -1
- package/src/modules/document/order/interfaces.ts +2 -6
- package/src/modules/user/persona/interface.ts +19 -0
- package/src/modules/user/persona/route.schema.ts +21 -15
- package/src/shared/entities/stock.ts +2 -0
package/package.json
CHANGED
|
@@ -34,6 +34,7 @@ export const ConferirEncomendaClienteOptionsEnum: {
|
|
|
34
34
|
'Encomendar Serviço': 'Encomendar Serviço';
|
|
35
35
|
'Encomendar Serviço Sem Notificação': 'Encomendar Serviço Sem Notificação';
|
|
36
36
|
'Encomendar VA': 'Encomendar VA';
|
|
37
|
+
'Encomendar VA c/ Anexos': 'Encomendar VA c/ Anexos';
|
|
37
38
|
'Encomendar VA Sem Notificação': 'Encomendar VA Sem Notificação';
|
|
38
39
|
'Encomendar Stock': 'Encomendar Stock';
|
|
39
40
|
'Cancelar Encomendar': 'Cancelar Encomendar';
|
|
@@ -41,9 +42,6 @@ export const ConferirEncomendaClienteOptionsEnum: {
|
|
|
41
42
|
Refaturar: 'Refaturar';
|
|
42
43
|
'Desligar do Sheets': 'Desligar do Sheets';
|
|
43
44
|
'Fechar Linha': 'Fechar Linha';
|
|
44
|
-
'Encomendar RM': 'Encomendar RM';
|
|
45
|
-
'Encomendar MT': 'Encomendar MT';
|
|
46
|
-
'M - terminado': 'M - terminado';
|
|
47
45
|
} = {
|
|
48
46
|
'Por Confirmar': 'Por Confirmar',
|
|
49
47
|
'Espera Def. Det. Vendedor': 'Espera Def. Det. Vendedor',
|
|
@@ -70,6 +68,7 @@ export const ConferirEncomendaClienteOptionsEnum: {
|
|
|
70
68
|
'Encomendar Serviço': 'Encomendar Serviço',
|
|
71
69
|
'Encomendar Serviço Sem Notificação': 'Encomendar Serviço Sem Notificação',
|
|
72
70
|
'Encomendar VA': 'Encomendar VA',
|
|
71
|
+
'Encomendar VA c/ Anexos': 'Encomendar VA c/ Anexos',
|
|
73
72
|
'Encomendar VA Sem Notificação': 'Encomendar VA Sem Notificação',
|
|
74
73
|
'Encomendar Stock': 'Encomendar Stock',
|
|
75
74
|
'Cancelar Encomendar': 'Cancelar Encomendar',
|
|
@@ -77,9 +76,6 @@ export const ConferirEncomendaClienteOptionsEnum: {
|
|
|
77
76
|
Refaturar: 'Refaturar',
|
|
78
77
|
'Desligar do Sheets': 'Desligar do Sheets',
|
|
79
78
|
'Fechar Linha': 'Fechar Linha',
|
|
80
|
-
'Encomendar RM': 'Encomendar RM',
|
|
81
|
-
'Encomendar MT': 'Encomendar MT',
|
|
82
|
-
'M - terminado': 'M - terminado',
|
|
83
79
|
};
|
|
84
80
|
|
|
85
81
|
export type IConferirEncomendaClienteOptions =
|
|
@@ -113,6 +113,21 @@ export interface IFindByEmailResponse {
|
|
|
113
113
|
} | null;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
export interface IFindClientOrProviderRequest {
|
|
117
|
+
nif?: string | null;
|
|
118
|
+
name?: string | null;
|
|
119
|
+
email?: string | null;
|
|
120
|
+
telephone?: string | null;
|
|
121
|
+
user_type: 'client' | 'provider';
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface IFindClientOrProviderResponse {
|
|
125
|
+
nif: string | null;
|
|
126
|
+
name: string | null;
|
|
127
|
+
email: string | null;
|
|
128
|
+
telephone: string | null;
|
|
129
|
+
user_type: 'client' | 'provider';
|
|
130
|
+
}
|
|
116
131
|
export interface IRepository {
|
|
117
132
|
findById(selector: IShared.IFindByIdRequest): Promise<IEntityExtended | null>;
|
|
118
133
|
|
|
@@ -133,6 +148,10 @@ export interface IRepository {
|
|
|
133
148
|
find(data: IFindRequest): Promise<IFindResponse[]>;
|
|
134
149
|
|
|
135
150
|
findByEmail(data: IFindByEmailRequest): Promise<IFindByEmailResponse[]>;
|
|
151
|
+
|
|
152
|
+
findClientOrProvider(
|
|
153
|
+
data: IFindClientOrProviderRequest,
|
|
154
|
+
): Promise<IFindClientOrProviderResponse[]>;
|
|
136
155
|
}
|
|
137
156
|
|
|
138
157
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -8,8 +8,14 @@ import {
|
|
|
8
8
|
IFindByEmailRequest,
|
|
9
9
|
IFindRequest,
|
|
10
10
|
IUpdateRequest,
|
|
11
|
+
IFindClientOrProviderRequest,
|
|
11
12
|
} from './interface';
|
|
12
13
|
|
|
14
|
+
const emailSchema = joi
|
|
15
|
+
.string()
|
|
16
|
+
.trim(true)
|
|
17
|
+
.lowercase()
|
|
18
|
+
.email({ tlds: { allow: false } });
|
|
13
19
|
// create body validation
|
|
14
20
|
const createBodyKeys: IShared.IRouteRequest<ICreateRequest> = {
|
|
15
21
|
name: joi.string().allow(null, '').optional(),
|
|
@@ -19,11 +25,7 @@ const createBodyKeys: IShared.IRouteRequest<ICreateRequest> = {
|
|
|
19
25
|
postal_code: joi.string().trim(true).lowercase().allow(null, '').optional(),
|
|
20
26
|
country_id: joi.string().uuid().allow(null, '').optional(),
|
|
21
27
|
telephone: joi.string().allow(null, '').optional(),
|
|
22
|
-
email:
|
|
23
|
-
.string()
|
|
24
|
-
.email({ tlds: { allow: false } })
|
|
25
|
-
.allow(null, '')
|
|
26
|
-
.optional(),
|
|
28
|
+
email: emailSchema.optional(),
|
|
27
29
|
observations: joi.string().allow(null, '').optional(),
|
|
28
30
|
provider_id: joi.string().uuid().allow(null, ''),
|
|
29
31
|
client_id: joi.string().uuid().allow(null, ''),
|
|
@@ -49,11 +51,7 @@ const updateBodyKeys: IShared.IRouteRequest<IUpdateRequest> = {
|
|
|
49
51
|
postal_code: joi.string().trim(true).lowercase().allow(null, '').optional(),
|
|
50
52
|
country_id: joi.string().uuid().allow(null, '').optional(),
|
|
51
53
|
telephone: joi.string().allow(null, '').optional(),
|
|
52
|
-
email:
|
|
53
|
-
.string()
|
|
54
|
-
.email({ tlds: { allow: false } })
|
|
55
|
-
.allow(null, '')
|
|
56
|
-
.optional(),
|
|
54
|
+
email: emailSchema.optional(),
|
|
57
55
|
observations: joi.string().allow(null, '').optional(),
|
|
58
56
|
reason_for_exemption_id: joi.string().uuid().allow(null, '').optional(),
|
|
59
57
|
main: joi.boolean().optional(),
|
|
@@ -85,10 +83,18 @@ const deleteQueryKeys: IShared.IRouteRequest<IDeletePersonaRequest> = {
|
|
|
85
83
|
export const deleteQueryValidate = joi.object().keys(deleteQueryKeys).messages(messages);
|
|
86
84
|
|
|
87
85
|
const findByEmailQueryKeys: IShared.IRouteRequest<IFindByEmailRequest> = {
|
|
88
|
-
email:
|
|
89
|
-
.string()
|
|
90
|
-
.trim(true)
|
|
91
|
-
.lowercase()
|
|
92
|
-
.email({ tlds: { allow: false } }),
|
|
86
|
+
email: emailSchema,
|
|
93
87
|
};
|
|
94
88
|
export const FindByEmailQueryValidate = joi.object().keys(findByEmailQueryKeys).messages(messages);
|
|
89
|
+
|
|
90
|
+
const findClientOrProviderQueryKeys: IShared.IRouteRequest<IFindClientOrProviderRequest> = {
|
|
91
|
+
name: joi.string().allow('', null).optional(),
|
|
92
|
+
nif: joi.string().allow('', null).optional(),
|
|
93
|
+
email: emailSchema.optional(),
|
|
94
|
+
telephone: joi.string().allow('', null).optional(),
|
|
95
|
+
user_type: joi.string().valid('client', 'provider').optional(),
|
|
96
|
+
};
|
|
97
|
+
export const FindClientOrProviderQueryValidate = joi
|
|
98
|
+
.object()
|
|
99
|
+
.keys(findClientOrProviderQueryKeys)
|
|
100
|
+
.messages(messages);
|
|
@@ -373,6 +373,8 @@ export type DocumentLine = {
|
|
|
373
373
|
cancelled: boolean;
|
|
374
374
|
original_product_id: string | null;
|
|
375
375
|
imported_from_sheets: IImportedFromSheets | null;
|
|
376
|
+
reinvoicing: boolean;
|
|
377
|
+
force_closed: boolean;
|
|
376
378
|
quantity: number;
|
|
377
379
|
preco_custo: number;
|
|
378
380
|
provider_discount: number;
|