@nomalism-com/types 0.43.36 → 0.43.37
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 +433 -471
- package/dist/index.js +433 -471
- package/dist/modules/supply/documentLine/interfaces.d.ts +2 -19
- package/dist/modules/supply/documentLine/route.schema.d.ts +0 -1
- package/dist/modules/supply/externalDocumentHeader/interface.d.ts +3 -25
- package/dist/modules/supply/externalDocumentHeader/route.schema.d.ts +0 -4
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as IShared from '../../../shared/interface';
|
|
2
|
-
import { DocumentLine, DocumentLineVirtuals, DocumentLinePendingConflict, DocumentLineBaseVirtuals, ProductPromotionVirtuals, DocumentLineNote, DocumentLineRM
|
|
2
|
+
import { DocumentLine, DocumentLineVirtuals, DocumentLinePendingConflict, DocumentLineBaseVirtuals, ProductPromotionVirtuals, DocumentLineNote, DocumentLineRM } from '../../../shared/entities/stock';
|
|
3
3
|
import * as IDocumentLineAssoc from '../documentLineAssoc/interfaces';
|
|
4
4
|
import { IDocumentTypeCodeType, IDocumentTypeUserType } from '../documentType/interfaces';
|
|
5
5
|
import { IProductType, IProductState } from '../../stock/productGoogleSheets/interface';
|
|
@@ -13,7 +13,7 @@ export type IDocumentLineVirtuals = DocumentLineVirtuals;
|
|
|
13
13
|
export type IDocumentLineBaseVirtuals = DocumentLineBaseVirtuals;
|
|
14
14
|
export type IDocumentLineRM = DocumentLineRM;
|
|
15
15
|
export type IPromotions = Pick<ProductPromotionVirtuals, 'exclusive_to_location_id' | 'exclusive_to_client_id' | 'discount'>;
|
|
16
|
-
export type IDataKeys = 'AvisoCliente' | 'Quantidade Encomendada Originalmente' | 'Linha criada na EM' | 'Opcao EM' | 'Levantar DF' | 'Enviar Email NCF' | 'Fechar DF' | 'Documento pago' | 'Pagamento' | 'Recibo do documento'
|
|
16
|
+
export type IDataKeys = 'AvisoCliente' | 'Quantidade Encomendada Originalmente' | 'Linha criada na EM' | 'Opcao EM' | 'Levantar DF' | 'Enviar Email NCF' | 'Fechar DF' | 'Documento pago' | 'Pagamento' | 'Recibo do documento';
|
|
17
17
|
export interface IDataPayload {
|
|
18
18
|
value: unknown;
|
|
19
19
|
updated_at: Date;
|
|
@@ -104,16 +104,6 @@ export interface IUpdateRequest {
|
|
|
104
104
|
sent_to_client?: boolean;
|
|
105
105
|
sent_to_provider?: boolean;
|
|
106
106
|
}
|
|
107
|
-
export interface IUpdateDataRequest {
|
|
108
|
-
trigger_states?: boolean;
|
|
109
|
-
document_header_id: string;
|
|
110
|
-
document_line_ids: string[];
|
|
111
|
-
datafield: IDataKeys;
|
|
112
|
-
payload: IDataPayload;
|
|
113
|
-
}
|
|
114
|
-
export interface IEntityWithDocumentLine extends DocumentLineAssoc {
|
|
115
|
-
document_line: DocumentLine;
|
|
116
|
-
}
|
|
117
107
|
export interface IUpdateManyRequest {
|
|
118
108
|
ids: string[];
|
|
119
109
|
client_discount?: number;
|
|
@@ -128,11 +118,6 @@ export interface IUpdateManyRequest {
|
|
|
128
118
|
export interface IUpdateManyByDocumentHeaderRequest {
|
|
129
119
|
sent_to_provider?: boolean;
|
|
130
120
|
}
|
|
131
|
-
export interface IUpdateDataRequestWithoutStamps extends Omit<IUpdateDataRequest, 'payload'> {
|
|
132
|
-
payload: Pick<IDataPayload, 'value'> & {
|
|
133
|
-
updated_by?: string;
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
121
|
export interface IUpdateLineStatesTriggerResponse {
|
|
137
122
|
document_header_id: string;
|
|
138
123
|
trigger_event: boolean;
|
|
@@ -147,10 +132,8 @@ export interface IPrintLabelQueryRequest {
|
|
|
147
132
|
export interface IRepository {
|
|
148
133
|
create(data: ICreateRequest[]): Promise<IDocumentLineAssoc.IEntityExtended[]>;
|
|
149
134
|
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>;
|
|
150
|
-
updateData(data: IUpdateDataRequest): Promise<IEntityWithDocumentLine[]>;
|
|
151
135
|
updateMany(data: IUpdateManyRequest): Promise<void>;
|
|
152
136
|
updateManyByDocumentHeader(selector: IShared.IFindByIdRequest, data: IUpdateManyByDocumentHeaderRequest): Promise<void>;
|
|
153
|
-
updateIndexes(document_line_ids: string[]): Promise<void>;
|
|
154
137
|
deleteMany(document_line_ids: string[]): Promise<void>;
|
|
155
138
|
}
|
|
156
139
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import joi from 'joi';
|
|
2
2
|
export declare const createBody: joi.ArraySchema<any[]>;
|
|
3
3
|
export declare const updateBody: joi.ObjectSchema<any>;
|
|
4
|
-
export declare const updateDataBody: joi.ObjectSchema<any>;
|
|
5
4
|
export declare const updateManyBody: joi.ObjectSchema<any>;
|
|
6
5
|
export declare const updateIndexesBody: joi.ArraySchema<string[]>;
|
|
7
6
|
export declare const deleteBody: joi.ArraySchema<string[]>;
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import * as IShared from '../../../shared/interface';
|
|
2
2
|
import { ExternalDocumentHeader } from '../../../shared/entities/stock';
|
|
3
|
-
import { IUpdateDataRequest } from '../documentLine/interfaces';
|
|
4
3
|
export type Entity = ExternalDocumentHeader;
|
|
5
4
|
export declare const Route = "external_document_header";
|
|
6
5
|
export declare const UpperName = "ExternalDocumentHeader";
|
|
7
6
|
export declare const LowerName: string;
|
|
8
|
-
export type IFindByIdResponse = Entity;
|
|
9
|
-
export type IFindRequest = Record<string, unknown>;
|
|
10
|
-
export type IFindResponse = Entity;
|
|
11
|
-
export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {
|
|
12
|
-
}
|
|
13
|
-
export type IFindWithPaginationResponse = IShared.IPaginationResponse<Entity>;
|
|
14
7
|
export interface IFindByOwnerIdItem {
|
|
15
8
|
external_document_header_id: string | null;
|
|
16
9
|
document_header_id: string;
|
|
@@ -21,22 +14,11 @@ export interface IFindByOwnerIdItem {
|
|
|
21
14
|
is_void: boolean;
|
|
22
15
|
created_by: string;
|
|
23
16
|
can_have_no_pdf: boolean;
|
|
24
|
-
|
|
17
|
+
can_retry: boolean;
|
|
25
18
|
}
|
|
26
19
|
export interface IFindByOwnerIdItemWithVersions extends IFindByOwnerIdItem {
|
|
27
20
|
older_versions: Pick<IFindByOwnerIdItem, 'label' | 'pdf_link'>[];
|
|
28
21
|
}
|
|
29
|
-
export interface ICreateRequest {
|
|
30
|
-
document_header_id: string;
|
|
31
|
-
external_id: string;
|
|
32
|
-
external_pdf_link: string;
|
|
33
|
-
pdf_link: string;
|
|
34
|
-
}
|
|
35
|
-
export interface IUpdateRequest {
|
|
36
|
-
external_id?: string;
|
|
37
|
-
external_pdf_link?: string;
|
|
38
|
-
pdf_link?: string;
|
|
39
|
-
}
|
|
40
22
|
export interface IAttachment {
|
|
41
23
|
filename: string;
|
|
42
24
|
multimedia_id: string;
|
|
@@ -51,13 +33,9 @@ export interface ISendEmailDocumentRequest {
|
|
|
51
33
|
};
|
|
52
34
|
}
|
|
53
35
|
export interface IRepository {
|
|
54
|
-
findById(selector: IShared.IFindByIdRequest): Promise<
|
|
36
|
+
findById(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
|
|
55
37
|
findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdItemWithVersions[]>;
|
|
56
38
|
sendEmailDocument: (data: ISendEmailDocumentRequest) => Promise<void>;
|
|
57
|
-
|
|
58
|
-
findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
|
|
59
|
-
create(data: ICreateRequest): Promise<Entity>;
|
|
60
|
-
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
|
|
61
|
-
deleteOne(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
|
|
39
|
+
retry(selector: IShared.IFindByIdRequest): Promise<void>;
|
|
62
40
|
}
|
|
63
41
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
import joi from 'joi';
|
|
2
|
-
export declare const findQuery: joi.ObjectSchema<any>;
|
|
3
|
-
export declare const findWithPaginationQuery: joi.ObjectSchema<any>;
|
|
4
|
-
export declare const createBody: joi.ObjectSchema<any>;
|
|
5
|
-
export declare const updateBody: joi.ObjectSchema<any>;
|
|
6
2
|
export declare const sendEmailDocumentBody: joi.ObjectSchema<any>;
|
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.43.
|
|
4
|
+
"version": "0.43.37",
|
|
5
5
|
"author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"type": "module",
|