@nomalism-com/types 0.22.101 → 0.22.103
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.min.js +1 -1
- package/dist/main.d.ts +3 -1
- package/dist/modules/document/materialEntrance/interfaces.d.ts +1 -2
- package/dist/modules/document/order/interfaces.d.ts +1 -4
- package/dist/modules/document/purchase/interfaces.d.ts +1 -3
- package/dist/modules/document/returnToProvider/interface.d.ts +1 -1
- package/dist/modules/integration/file/interface.d.ts +1 -0
- package/dist/modules/stock/chat/interfaces.d.ts +51 -0
- package/dist/modules/stock/chat/route.schema.d.ts +5 -0
- package/dist/modules/stock/prison/interface.d.ts +1 -1
- package/dist/modules/stock/productGoogleSheets/interface.d.ts +7 -0
- package/dist/modules/stock/queryList/route.schema.d.ts +3 -3
- package/dist/modules/stock/savedProviderProposal/interfaces.d.ts +3 -3
- package/dist/modules/supply/documentHeader/interfaces.d.ts +7 -13
- package/dist/modules/supply/documentLine/interfaces.d.ts +3 -3
- package/dist/modules/supply/documentLineAssoc/interfaces.d.ts +6 -4
- package/dist/modules/supply/orderManagement/interface.d.ts +3 -7
- package/dist/modules/supply/payment/interface.d.ts +1 -0
- package/dist/modules/user/persona/interface.d.ts +1 -3
- package/dist/modules/user/purchaseConditions/interface.d.ts +12 -8
- package/dist/modules/user/purchaseConditions/route.schema.d.ts +1 -1
- package/dist/modules/user/users/interface.d.ts +1 -3
- package/dist/shared/entities/index.d.ts +1 -0
- package/dist/shared/entities/integration.d.ts +1 -0
- package/dist/shared/entities/stock.d.ts +15 -4
- package/dist/shared/interface.d.ts +13 -1
- package/package.json +6 -6
package/dist/main.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ import * as ClientType from "./modules/user/clientType/interface";
|
|
|
12
12
|
import * as ClientTypeRoutes from "./modules/user/clientType/route.schema";
|
|
13
13
|
import * as ZipCode from "./modules/user/zipCode/interfaces";
|
|
14
14
|
import * as ZipCodeRoutes from "./modules/user/zipCode/route.schema";
|
|
15
|
+
import * as Chat from "./modules/stock/chat/interfaces";
|
|
16
|
+
import * as ChatRoutes from "./modules/stock/chat/route.schema";
|
|
15
17
|
import * as Commissioner from "./modules/user/commissioner/interface";
|
|
16
18
|
import * as CommissionerRoutes from "./modules/user/commissioner/route.schema";
|
|
17
19
|
import * as Counter from "./modules/supply/counter/interfaces";
|
|
@@ -206,4 +208,4 @@ import * as SavedProviderProposal from "./modules/stock/savedProviderProposal/in
|
|
|
206
208
|
import * as SavedProviderProposalRoutes from "./modules/stock/savedProviderProposal/route.schema";
|
|
207
209
|
import * as ProductGoogleSheets from "./modules/stock/productGoogleSheets/interface";
|
|
208
210
|
import * as ProductGoogleSheetsRoutes from "./modules/stock/productGoogleSheets/route.schema";
|
|
209
|
-
export { shared, viewErrors, stockErrors, userErrors, documentManagementErrors, integrationErrors, ZipCode, ZipCodeRoutes, BankData, BankDataRoutes, Client, ClientRoutes, ClientType, ClientTypeRoutes, ClientCurrentAccount, ClientCurrentAccountRoutes, Commissioner, CommissionerRoutes, Counter, CounterRoutes, Country, CountryRoutes, DeliveryMethods, DeliveryMethodsRoutes, DocumentHeader, DocumentHeaderRoutes, DocumentLine, DocumentLineRoutes, DocumentLineAssoc, DocumentLineAssocRoutes, DocumentLineFolder, DocumentLineFolderRoutes, DocumentSet, DocumentSetRoutes, DocumentType, DocumentTypeRoutes, ExternalDocumentType, ExternalDocumentHeader, ExternalDocumentHeaderRoutes, EventHistory, EventHistoryRoutes, Favorites, FavoritesRoutes, Field, File, FileRoutes, GroupPermissions, GroupPermissionsRoutes, GoogleSheets, GoogleSheetsRoutes, Language, LanguageRoutes, Location, LocationRoutes, MaturityDates, MaturityDatesRoutes, Multimedia, MultimediaRoutes, OrderManagement, Observation, ObservationRoutes, ObservationType, ObservationTypeRoutes, Password, PasswordRoutes, Payment, PaymentRoutes, PaymentConditions, PaymentConditionsRoutes, PaymentMethods, PaymentMethodsRoutes, Permissions, PermissionsRoutes, Product, ProductRoutes, ProductImage, ProductImageRoutes, Promotion, PromotionRoutes, PromotionAssoc, PromotionAssocRoutes, Providers, ProvidersRoutes, ProviderType, ProviderTypeRoutes, ProviderCurrentAccount, ProviderCurrentAccountRoutes, PurchaseConditions, PurchaseConditionsRoutes, ReasonForExemption, ReasonForExemptionRoutes, RefreshToken, RefreshTokenRoutes, SegmentsArea, SegmentsAreaRoutes, Sessions, SessionsRoutes, Shippings, ShippingsRoutes, SocialMedia, SocialMediaRoutes, StoreOperator, StoreOperatorRoutes, Swift, SwiftRoutes, TypeOfLocation, TypeOfLocationRoutes, UnitOfMeasure, UnitOfMeasureRoutes, UserPermissions, UserPermissionsRoutes, UserPositions, UserPositionsRoutes, Users, UsersRoutes, UserTokens, UserTokensRoutes, VatValidation, VatValidationRoutes, VatTax, VatTaxRoutes, VatTaxZone, VatTaxZoneRoutes, Vehicles, VehiclesRoutes, Workflow, WorkflowRoutes, MoloniRequest, MoloniRequestRoutes, StockMovement, StockMovementRoutes, Tenant, TenantRoutes, PreSale, PreSaleRoutes, PreSaleProduct, PreSaleProductRoutes, Cabide, CabideRoutes, CabideProduct, CabideProductRoutes, Npc, NpcRoutes, Printer, PrinterRoutes, SchedulePrintJob, SchedulePrintJobRoutes, QueryList, QueryListRoutes, QueryParameter, QueryParameterRoutes, ReturnReason, ReturnReasonRoutes, PropostaSheets, PropostaSheetsRoutes, Schedule, ScheduleRoutes, GoogleFilePermission, GoogleFilePermissionRoutes, Settings, SettingsRoutes, Tickets, TicketsRoutes, Channel, ChannelRoutes, TicketsLanguage, TicketsLanguageRoutes, CLT, CLTRoutes, StartDocumentHeaderLastUpdate, ErrorHandler, ErrorHandlerRoutes, Persona, PersonaRoutes, ProjectInfo, ProjectInfoRoutes, EmailLog, EmailLogRoutes, Purchase, PurchaseRoutes, Order, OrderRoutes, MaterialEntrance, MaterialEntranceRoutes, Transformado, TransformadoRoutes, Quebra, QuebraRoutes, UpfrontReturn, UpfrontReturnRoutes, SavedEmPicking, SavedEmPickingRoutes, EmailTemplate, EmailTemplateRoutes, EmailTemplateAttachment, EmailTemplateAttachmentRoutes, Inventario, InventarioRoutes, ReturnToProvider, ReturnToProviderRoutes, Prison, PrisonRoutes, DocumentLineNote, DocumentLineNoteRoutes, SavedProviderProposal, SavedProviderProposalRoutes, ProductGoogleSheets, ProductGoogleSheetsRoutes, };
|
|
211
|
+
export { shared, viewErrors, stockErrors, userErrors, documentManagementErrors, integrationErrors, ZipCode, ZipCodeRoutes, BankData, BankDataRoutes, Client, ClientRoutes, ClientType, ClientTypeRoutes, ClientCurrentAccount, ClientCurrentAccountRoutes, Chat, ChatRoutes, Commissioner, CommissionerRoutes, Counter, CounterRoutes, Country, CountryRoutes, DeliveryMethods, DeliveryMethodsRoutes, DocumentHeader, DocumentHeaderRoutes, DocumentLine, DocumentLineRoutes, DocumentLineAssoc, DocumentLineAssocRoutes, DocumentLineFolder, DocumentLineFolderRoutes, DocumentSet, DocumentSetRoutes, DocumentType, DocumentTypeRoutes, ExternalDocumentType, ExternalDocumentHeader, ExternalDocumentHeaderRoutes, EventHistory, EventHistoryRoutes, Favorites, FavoritesRoutes, Field, File, FileRoutes, GroupPermissions, GroupPermissionsRoutes, GoogleSheets, GoogleSheetsRoutes, Language, LanguageRoutes, Location, LocationRoutes, MaturityDates, MaturityDatesRoutes, Multimedia, MultimediaRoutes, OrderManagement, Observation, ObservationRoutes, ObservationType, ObservationTypeRoutes, Password, PasswordRoutes, Payment, PaymentRoutes, PaymentConditions, PaymentConditionsRoutes, PaymentMethods, PaymentMethodsRoutes, Permissions, PermissionsRoutes, Product, ProductRoutes, ProductImage, ProductImageRoutes, Promotion, PromotionRoutes, PromotionAssoc, PromotionAssocRoutes, Providers, ProvidersRoutes, ProviderType, ProviderTypeRoutes, ProviderCurrentAccount, ProviderCurrentAccountRoutes, PurchaseConditions, PurchaseConditionsRoutes, ReasonForExemption, ReasonForExemptionRoutes, RefreshToken, RefreshTokenRoutes, SegmentsArea, SegmentsAreaRoutes, Sessions, SessionsRoutes, Shippings, ShippingsRoutes, SocialMedia, SocialMediaRoutes, StoreOperator, StoreOperatorRoutes, Swift, SwiftRoutes, TypeOfLocation, TypeOfLocationRoutes, UnitOfMeasure, UnitOfMeasureRoutes, UserPermissions, UserPermissionsRoutes, UserPositions, UserPositionsRoutes, Users, UsersRoutes, UserTokens, UserTokensRoutes, VatValidation, VatValidationRoutes, VatTax, VatTaxRoutes, VatTaxZone, VatTaxZoneRoutes, Vehicles, VehiclesRoutes, Workflow, WorkflowRoutes, MoloniRequest, MoloniRequestRoutes, StockMovement, StockMovementRoutes, Tenant, TenantRoutes, PreSale, PreSaleRoutes, PreSaleProduct, PreSaleProductRoutes, Cabide, CabideRoutes, CabideProduct, CabideProductRoutes, Npc, NpcRoutes, Printer, PrinterRoutes, SchedulePrintJob, SchedulePrintJobRoutes, QueryList, QueryListRoutes, QueryParameter, QueryParameterRoutes, ReturnReason, ReturnReasonRoutes, PropostaSheets, PropostaSheetsRoutes, Schedule, ScheduleRoutes, GoogleFilePermission, GoogleFilePermissionRoutes, Settings, SettingsRoutes, Tickets, TicketsRoutes, Channel, ChannelRoutes, TicketsLanguage, TicketsLanguageRoutes, CLT, CLTRoutes, StartDocumentHeaderLastUpdate, ErrorHandler, ErrorHandlerRoutes, Persona, PersonaRoutes, ProjectInfo, ProjectInfoRoutes, EmailLog, EmailLogRoutes, Purchase, PurchaseRoutes, Order, OrderRoutes, MaterialEntrance, MaterialEntranceRoutes, Transformado, TransformadoRoutes, Quebra, QuebraRoutes, UpfrontReturn, UpfrontReturnRoutes, SavedEmPicking, SavedEmPickingRoutes, EmailTemplate, EmailTemplateRoutes, EmailTemplateAttachment, EmailTemplateAttachmentRoutes, Inventario, InventarioRoutes, ReturnToProvider, ReturnToProviderRoutes, Prison, PrisonRoutes, DocumentLineNote, DocumentLineNoteRoutes, SavedProviderProposal, SavedProviderProposalRoutes, ProductGoogleSheets, ProductGoogleSheetsRoutes, };
|
|
@@ -14,7 +14,6 @@ export declare const createMaterialEntranceClientOrderOptions: string[];
|
|
|
14
14
|
export interface IGetMaterialEntranceInfoClientOrder {
|
|
15
15
|
ef_dla_id: string;
|
|
16
16
|
ordered_quantity: number;
|
|
17
|
-
pc_owner_id: string;
|
|
18
17
|
pc_dh_id: string;
|
|
19
18
|
pc_dh_number: number;
|
|
20
19
|
pc_virtual_name: string;
|
|
@@ -84,7 +83,7 @@ export interface IUnfinishedPickingLineGroup {
|
|
|
84
83
|
export type IUnfinishedPickingLineGroupExtended = IUnfinishedPickingLineGroup & IGetMaterialEntranceInfoResponse;
|
|
85
84
|
export interface IUnfinishedPickingsResponse extends Pick<DocumentHeader, "id" | "owner_id"> {
|
|
86
85
|
identifier: string;
|
|
87
|
-
|
|
86
|
+
start_document_header_id: string;
|
|
88
87
|
lineGroups: IUnfinishedPickingLineGroupExtended[];
|
|
89
88
|
}
|
|
90
89
|
export interface IUndoEntradaDeMaterialRequest {
|
|
@@ -11,6 +11,7 @@ export declare const ConferirEncomendaClienteOptionsEnum: {
|
|
|
11
11
|
"Espera Info Cliente": "Espera Info Cliente";
|
|
12
12
|
"Espera Dev. Catálogo": "Espera Dev. Catálogo";
|
|
13
13
|
"Espera Envio (RM)": "Espera Envio (RM)";
|
|
14
|
+
"Espera Envio (RM com aconselhamento)": "Espera Envio (RM com aconselhamento)";
|
|
14
15
|
"Espera Marcação (RM)": "Espera Marcação (RM)";
|
|
15
16
|
"Espera Folha (RM)": "Espera Folha (RM)";
|
|
16
17
|
"Espera Vendedor Retificar (RM)": "Espera Vendedor Retificar (RM)";
|
|
@@ -72,12 +73,8 @@ export interface IFindRequest {
|
|
|
72
73
|
export type IOrderType = "VA" | "Stock";
|
|
73
74
|
export interface IFindResponse {
|
|
74
75
|
order_type: IOrderType;
|
|
75
|
-
client_id?: string;
|
|
76
76
|
pc_id?: string;
|
|
77
|
-
pc_closed?: boolean;
|
|
78
|
-
provider_id?: string;
|
|
79
77
|
pf_id?: string;
|
|
80
|
-
pf_closed?: boolean;
|
|
81
78
|
document_line_id: string;
|
|
82
79
|
document_line_quantity: number;
|
|
83
80
|
product_id: string;
|
|
@@ -9,7 +9,7 @@ export interface IUnpaidMaterialEntranceLineDetails {
|
|
|
9
9
|
quantity: number;
|
|
10
10
|
notes: DocumentLineNote[];
|
|
11
11
|
pc_name: string | null;
|
|
12
|
-
|
|
12
|
+
pc_id: string | null;
|
|
13
13
|
}
|
|
14
14
|
export interface IUnpaidMaterialEntranceLineResponse {
|
|
15
15
|
group: string;
|
|
@@ -19,10 +19,8 @@ export interface IUnpaidMaterialEntranceLineResponse {
|
|
|
19
19
|
designation: string;
|
|
20
20
|
multimedia_id: string | null;
|
|
21
21
|
provider_ref: string | null;
|
|
22
|
-
pf_owner_id: string;
|
|
23
22
|
pf_id: string;
|
|
24
23
|
ef_name: string;
|
|
25
|
-
pf_closed: boolean;
|
|
26
24
|
quantity: number;
|
|
27
25
|
discount: number;
|
|
28
26
|
provider_purchase_discount: number;
|
|
@@ -21,7 +21,7 @@ export interface IFindLinesToReturnResponse {
|
|
|
21
21
|
updated_by: string | null;
|
|
22
22
|
updated_at: Date;
|
|
23
23
|
}
|
|
24
|
-
export declare const checkLinesToReturnOptions: readonly ["Por tratar", "Levantar", "Enviar email", "Quebrar", "
|
|
24
|
+
export declare const checkLinesToReturnOptions: readonly ["Por tratar", "Levantar", "Enviar email", "Quebrar", "Cancelar devolução", "Fechar"];
|
|
25
25
|
export type ICheckLinesToReturnOptions = (typeof checkLinesToReturnOptions)[number];
|
|
26
26
|
export interface ICheckLinesToReturnLinesRequest {
|
|
27
27
|
document_line_assoc_id: string;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as IShared from "../../../shared/interface";
|
|
2
|
+
import { Chat, File } from "../../../shared/entities";
|
|
3
|
+
export type Entity = Chat;
|
|
4
|
+
export declare const Route = "chat";
|
|
5
|
+
export declare const UpperName = "Chat";
|
|
6
|
+
export declare const LowerName: string;
|
|
7
|
+
export interface IFindByTokenRequest {
|
|
8
|
+
token: string;
|
|
9
|
+
}
|
|
10
|
+
export interface IChatBalloon {
|
|
11
|
+
chat?: Omit<Entity, "id" | "document_header_id" | "is_customer" | "created_at" | "updated_at" | "created_by" | "updated_by"> & {
|
|
12
|
+
id?: string;
|
|
13
|
+
};
|
|
14
|
+
file?: Omit<File, "id" | "owner_id" | "is_customer" | "created_at" | "updated_at" | "created_by" | "updated_by"> & {
|
|
15
|
+
id?: string;
|
|
16
|
+
};
|
|
17
|
+
created_at: Date;
|
|
18
|
+
updated_at: Date;
|
|
19
|
+
created_by: string;
|
|
20
|
+
updated_by: string;
|
|
21
|
+
is_customer: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface IFindByTokenResponse {
|
|
24
|
+
documentHeader: {
|
|
25
|
+
id: string;
|
|
26
|
+
contact_persona_name: string | null;
|
|
27
|
+
contact_persona_email: string | null;
|
|
28
|
+
virtual_total: number;
|
|
29
|
+
};
|
|
30
|
+
chat: IChatBalloon[];
|
|
31
|
+
}
|
|
32
|
+
export interface ICreateRequest {
|
|
33
|
+
document_header_id: string;
|
|
34
|
+
message: string;
|
|
35
|
+
username: string;
|
|
36
|
+
is_customer: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface IUpdateRequest {
|
|
39
|
+
message?: string;
|
|
40
|
+
email_sent?: boolean;
|
|
41
|
+
whatsapp_sent?: boolean;
|
|
42
|
+
username?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface IRepository {
|
|
45
|
+
findByToken(query: IFindByTokenRequest): Promise<IFindByTokenResponse>;
|
|
46
|
+
findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<Chat[]>;
|
|
47
|
+
create(data: ICreateRequest): Promise<Chat>;
|
|
48
|
+
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>;
|
|
49
|
+
deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import joi from "joi";
|
|
2
|
+
import { IFindByTokenRequest } from "./interfaces";
|
|
3
|
+
export declare const createBody: joi.ObjectSchema<any>;
|
|
4
|
+
export declare const updateBody: joi.ObjectSchema<any>;
|
|
5
|
+
export declare const findByTokenQuery: joi.ObjectSchema<IFindByTokenRequest>;
|
|
@@ -20,7 +20,7 @@ export interface IFindLinesInPrisonResponse {
|
|
|
20
20
|
updated_by: string;
|
|
21
21
|
updated_at: Date;
|
|
22
22
|
}
|
|
23
|
-
export declare const checkLineInPrisonOptions: readonly ["Por confirmar", "
|
|
23
|
+
export declare const checkLineInPrisonOptions: readonly ["Por confirmar", "Desprender", "Quebrar", "Devolver a fornecedor"];
|
|
24
24
|
export type ICheckLineInPrisonOptions = (typeof checkLineInPrisonOptions)[number];
|
|
25
25
|
export interface ICheckLinesInPrisonLinesRequest {
|
|
26
26
|
id_provider: number;
|
|
@@ -13,6 +13,13 @@ export type IProductsForSheetsResponse = Record<string, any>;
|
|
|
13
13
|
export type IProductFromSheetsValues = Record<string, any>;
|
|
14
14
|
export type SheetsCreateOrUpdate = "create" | "update";
|
|
15
15
|
export type IProductSheetState = "Ativa" | "Inativa" | "VemTemporariamente";
|
|
16
|
+
export declare const ProductStateEnum: {
|
|
17
|
+
Ativa: "Ativa";
|
|
18
|
+
Inativa: "Inativa";
|
|
19
|
+
VemTemporariamente: "VemTemporariamente";
|
|
20
|
+
};
|
|
21
|
+
export type IProductState = (typeof ProductStateEnum)[keyof typeof ProductStateEnum];
|
|
22
|
+
export declare const productState: string[];
|
|
16
23
|
export declare const ProductTypeEnum: {
|
|
17
24
|
Encomenda: "Encomenda";
|
|
18
25
|
Stock: "Stock";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import joi from
|
|
2
|
-
import * as IShared from
|
|
3
|
-
import { IExecuteRequest } from
|
|
1
|
+
import joi from "joi";
|
|
2
|
+
import * as IShared from "../../../shared/interface";
|
|
3
|
+
import { IExecuteRequest } from "./interfaces";
|
|
4
4
|
export declare const createBody: joi.ObjectSchema<any>;
|
|
5
5
|
export declare const updateBody: joi.ObjectSchema<any>;
|
|
6
6
|
export declare const executeBodyKeys: IShared.IRouteRequest<IExecuteRequest>;
|
|
@@ -16,8 +16,8 @@ export interface IFindManyResponse {
|
|
|
16
16
|
export type IUpdateRequest = Omit<ICreateRequest, 'provider_id' | 'product_id'>;
|
|
17
17
|
export interface IRepository {
|
|
18
18
|
findByProviderId(selector: IShared.IFindByIdRequest): Promise<IFindManyResponse[]>;
|
|
19
|
-
create(data: ICreateRequest): Promise<
|
|
20
|
-
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<
|
|
21
|
-
deleteOne(selector: IShared.IFindByIdRequest): Promise<
|
|
19
|
+
create(data: ICreateRequest): Promise<void>;
|
|
20
|
+
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>;
|
|
21
|
+
deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
|
|
22
22
|
}
|
|
23
23
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -12,20 +12,12 @@ export type IDocumentHeaderClientVirtuals = DocumentHeaderClientVirtuals;
|
|
|
12
12
|
export type IDocumentHeaderProviderVirtuals = DocumentHeaderProviderVirtuals;
|
|
13
13
|
export type IStartDocumentHeaderVirtuals = StartDocumentHeaderVirtuals;
|
|
14
14
|
export type IDocumentHeaderClientPaymentVirtuals = DocumentHeaderClientPaymentVirtuals;
|
|
15
|
-
interface IFindOneBase extends Omit<Entity, "external_data"> {
|
|
15
|
+
export interface IFindOneBase extends Omit<Entity, "external_data"> {
|
|
16
16
|
document_type: IDocumentType.IEntityExtended;
|
|
17
17
|
}
|
|
18
18
|
export interface IFindOneResponse extends IFindOneBase {
|
|
19
19
|
base_virtual: IDocumentHeaderBaseVirtuals | null;
|
|
20
20
|
}
|
|
21
|
-
export interface IFindStartResponse extends IFindOneBase {
|
|
22
|
-
start_virtual: StartDocumentHeaderVirtuals | null;
|
|
23
|
-
last_google_sheet_import: {
|
|
24
|
-
done: boolean;
|
|
25
|
-
error: string | null;
|
|
26
|
-
} | null;
|
|
27
|
-
client_balance?: number | null;
|
|
28
|
-
}
|
|
29
21
|
export interface IFindByDocumentLineStateRequest {
|
|
30
22
|
document_type_id: 100 | 116;
|
|
31
23
|
document_line_state: string;
|
|
@@ -38,7 +30,6 @@ export interface IFindByDocumentLineStateResponse {
|
|
|
38
30
|
created_by: string;
|
|
39
31
|
who_handles: string | null;
|
|
40
32
|
tags: string | null;
|
|
41
|
-
url: string;
|
|
42
33
|
upfront_total: number;
|
|
43
34
|
}
|
|
44
35
|
export interface IBasicSearchRequest extends IShared.IPaginationRequest {
|
|
@@ -51,7 +42,8 @@ export interface IBasicSearchResponse {
|
|
|
51
42
|
name: string | null;
|
|
52
43
|
user_number: number;
|
|
53
44
|
document_line_count: number;
|
|
54
|
-
|
|
45
|
+
document_header_id: string | null;
|
|
46
|
+
start_document_header_id: string | null;
|
|
55
47
|
pdf_link: string | null;
|
|
56
48
|
updated_at: Date;
|
|
57
49
|
}
|
|
@@ -211,6 +203,7 @@ export interface IUpdateRequest {
|
|
|
211
203
|
tags?: string | null;
|
|
212
204
|
warning?: IWarningType;
|
|
213
205
|
created_by?: string;
|
|
206
|
+
chat_token_active?: boolean;
|
|
214
207
|
}
|
|
215
208
|
export interface IGetActionsResponse {
|
|
216
209
|
document_type: DocumentType;
|
|
@@ -308,6 +301,7 @@ export type IFindResponse = Pick<Entity, "document_number" | "id"> & {
|
|
|
308
301
|
total: number;
|
|
309
302
|
emission_date: string;
|
|
310
303
|
line_count: number;
|
|
304
|
+
tags: string;
|
|
311
305
|
};
|
|
312
306
|
export type IUpdateManyWithPersona = {
|
|
313
307
|
id: string;
|
|
@@ -415,7 +409,8 @@ export interface ICreateProForma {
|
|
|
415
409
|
}
|
|
416
410
|
export interface IRepository {
|
|
417
411
|
findOne(selector: IShared.IFindByIdRequest): Promise<IFindOneResponse | null>;
|
|
418
|
-
findStart(selector: IShared.IFindByIdRequest): Promise<
|
|
412
|
+
findStart(selector: IShared.IFindByIdRequest): Promise<IFindOneBase | null>;
|
|
413
|
+
findStartVirtual(selector: IShared.IFindByIdRequest): Promise<IStartDocumentHeaderVirtuals | null>;
|
|
419
414
|
findByDocumentLineState(params: IFindByDocumentLineStateRequest): Promise<IFindByDocumentLineStateResponse[]>;
|
|
420
415
|
findByType(params: IFindByTypeRequest): Promise<IFindByTypeResponse[]>;
|
|
421
416
|
findByBasicSearch(data: IBasicSearchRequest): Promise<IShared.IPaginationResponse<IBasicSearchResponse>>;
|
|
@@ -454,4 +449,3 @@ export type IApi = Omit<IRepository, "createFromHeader" | "createProductionOrder
|
|
|
454
449
|
createProForma(params: ICreateProForma): Promise<IShared.ITaskCluster[]>;
|
|
455
450
|
};
|
|
456
451
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
457
|
-
export {};
|
|
@@ -36,7 +36,7 @@ export interface IDataPagamento {
|
|
|
36
36
|
export interface IDocumentLineDocuments {
|
|
37
37
|
code: IDocumentTypeCodeType;
|
|
38
38
|
user_type: IDocumentTypeUserType;
|
|
39
|
-
|
|
39
|
+
start_document_header_id: string | null;
|
|
40
40
|
pdf_link: string | null;
|
|
41
41
|
}
|
|
42
42
|
export interface IHistory {
|
|
@@ -45,8 +45,8 @@ export interface IHistory {
|
|
|
45
45
|
who: string;
|
|
46
46
|
}
|
|
47
47
|
export interface IEntityExtended extends Omit<DocumentLine, "data"> {
|
|
48
|
+
group: string;
|
|
48
49
|
data: IHistory[];
|
|
49
|
-
virtual: IDocumentLineVirtuals | null;
|
|
50
50
|
document_headers: IDocumentLineDocuments[];
|
|
51
51
|
document_line_folder: DocumentLineFolder | null;
|
|
52
52
|
pending_conflict: DocumentLinePendingConflict | null;
|
|
@@ -122,7 +122,7 @@ export interface IPrintLabelQueryRequest {
|
|
|
122
122
|
}
|
|
123
123
|
export interface IRepository {
|
|
124
124
|
findByState(data: IFindByDocumentLineStateRequest): Promise<IFindByDocumentLineStateResponse[]>;
|
|
125
|
-
create(data: ICreateRequest[]): Promise<IDocumentLineAssoc.
|
|
125
|
+
create(data: ICreateRequest[]): Promise<IDocumentLineAssoc.IEntityExtended[]>;
|
|
126
126
|
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>;
|
|
127
127
|
updateData(data: IUpdateDataRequest): Promise<IUpdateLineStatesTriggerResponse>;
|
|
128
128
|
updateMany(data: IUpdateManyRequest): Promise<void>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import * as IShared from
|
|
2
|
-
import { DocumentLineAssoc, DocumentLine } from
|
|
3
|
-
import * as IDocumentLine from
|
|
1
|
+
import * as IShared from "../../../shared/interface";
|
|
2
|
+
import { DocumentLineAssoc, DocumentLine } from "../../../shared/entities";
|
|
3
|
+
import * as IDocumentLine from "../documentLine/interfaces";
|
|
4
|
+
import { IDocumentLineVirtuals } from "../documentLine/interfaces";
|
|
4
5
|
export type Entity = DocumentLineAssoc;
|
|
5
6
|
export declare const Route = "documentLineAssoc";
|
|
6
7
|
export declare const UpperName = "DocumentLineAssoc";
|
|
@@ -25,8 +26,9 @@ export interface IUpdateGroupRequest {
|
|
|
25
26
|
export interface IRepository {
|
|
26
27
|
findById(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
|
|
27
28
|
findByOwnerId(data: IShared.IFindByOwnerIdRequest): Promise<IEntityExtended[]>;
|
|
29
|
+
findVirtualsByOwnerId(data: IShared.IFindByOwnerIdRequest): Promise<IDocumentLineVirtuals[]>;
|
|
28
30
|
create(data: ICreateRequest[]): Promise<IEntityWithDocumentLine[]>;
|
|
29
31
|
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<IEntityWithDocumentLine>;
|
|
30
32
|
}
|
|
31
|
-
export type IApi = Omit<IRepository,
|
|
33
|
+
export type IApi = Omit<IRepository, "findById">;
|
|
32
34
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IProductType } from "../../stock/productGoogleSheets/interface";
|
|
1
|
+
import { IProductType } from "../../stock/product/interface";
|
|
3
2
|
export declare const Route = "order_management";
|
|
4
3
|
export declare const UpperName = "OrderManagement";
|
|
5
4
|
export declare const LowerName: string;
|
|
@@ -8,7 +7,7 @@ export interface IFindProviderProductsRequest {
|
|
|
8
7
|
}
|
|
9
8
|
export interface IFindProposals {
|
|
10
9
|
name: string;
|
|
11
|
-
|
|
10
|
+
start_document_header_id: string;
|
|
12
11
|
pdf_link: string | null;
|
|
13
12
|
}
|
|
14
13
|
export interface IFindProviderProductsResponse {
|
|
@@ -46,10 +45,7 @@ export interface IFindProductHistoryProviderOrder {
|
|
|
46
45
|
export interface IFindProductHistoryMovement {
|
|
47
46
|
date: Date;
|
|
48
47
|
document_name: string;
|
|
49
|
-
|
|
50
|
-
link_owner_id: string | null;
|
|
51
|
-
link_document_header_id: string | null;
|
|
52
|
-
link_closed: boolean | null;
|
|
48
|
+
document_header_id: string | null;
|
|
53
49
|
quantity_in: number;
|
|
54
50
|
quantity_out: number;
|
|
55
51
|
stock_to_date: number;
|
|
@@ -148,6 +148,7 @@ export interface IRepository {
|
|
|
148
148
|
findPaymentBatches(): Promise<IPaymentsBatchResponse[]>;
|
|
149
149
|
deleteBatch(data: IShared.IFindByIdRequest): Promise<void>;
|
|
150
150
|
findCurrentAccountByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindCurrentAccountByOwnerIdResponse[]>;
|
|
151
|
+
findBalanceByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<number>;
|
|
151
152
|
findSettledMaterialEntrance(params: IUnpaidPurchasesRequest): Promise<IUnpaidPurchasesResponse[]>;
|
|
152
153
|
findSettledMaterialEntranceProviders(): Promise<IFindProvidersWithClientIdResponse[]>;
|
|
153
154
|
findSettledMaterialEntranceByDate(params: IUnpaidByDatePurchasesRequest): Promise<IUnpaidPurchasesResponse[]>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as IShared from "../../../shared/interface";
|
|
2
2
|
import { Persona, Country } from "../../../shared/entities";
|
|
3
|
-
import { IDocumentTypeUserType } from "../../supply/documentType/interfaces";
|
|
4
3
|
export type Entity = Persona;
|
|
5
4
|
export declare const Route = "persona";
|
|
6
5
|
export declare const UpperName = "Persona";
|
|
@@ -44,8 +43,7 @@ export interface IBasicSearchRequest extends IShared.IPaginationRequest {
|
|
|
44
43
|
inactive?: boolean;
|
|
45
44
|
}
|
|
46
45
|
export interface IBasicSearchResponse {
|
|
47
|
-
|
|
48
|
-
user_type: IDocumentTypeUserType;
|
|
46
|
+
id: string;
|
|
49
47
|
name: string;
|
|
50
48
|
number: number;
|
|
51
49
|
persona_name?: string;
|
|
@@ -4,30 +4,34 @@ export type Entity = PurchaseConditions;
|
|
|
4
4
|
export declare const Route = "purchase_conditions";
|
|
5
5
|
export declare const UpperName = "PurchaseConditions";
|
|
6
6
|
export declare const LowerName: string;
|
|
7
|
+
interface IFindDetailedResponse extends Entity {
|
|
8
|
+
}
|
|
9
|
+
export type IFindByIdResponse = Omit<IFindDetailedResponse, "product_category">;
|
|
10
|
+
export type IFindByOwnerIdResponse = Omit<IFindDetailedResponse, "">;
|
|
7
11
|
export type IFindRequest = Record<string, unknown>;
|
|
12
|
+
export type IFindResponse = Omit<IFindDetailedResponse, "">;
|
|
8
13
|
export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {
|
|
9
14
|
}
|
|
10
|
-
export type IFindWithPaginationResponse = IShared.IPaginationResponse<
|
|
15
|
+
export type IFindWithPaginationResponse = IShared.IPaginationResponse<Omit<IFindDetailedResponse, "">>;
|
|
11
16
|
export interface ICreateRequest {
|
|
12
17
|
provider_id: string;
|
|
13
18
|
discount: string;
|
|
14
19
|
deadline: string;
|
|
15
20
|
minimum_quantity: string;
|
|
16
|
-
product_category_id?: string | null;
|
|
17
21
|
}
|
|
18
22
|
export interface IUpdateRequest {
|
|
19
23
|
discount?: string;
|
|
20
24
|
deadline?: string;
|
|
21
25
|
minimum_quantity?: string;
|
|
22
|
-
product_category_id?: string | null;
|
|
23
26
|
}
|
|
24
27
|
export interface IRepository {
|
|
25
|
-
findById(selector: IShared.IFindByIdRequest): Promise<
|
|
26
|
-
findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<
|
|
27
|
-
find(selector: IFindRequest): Promise<
|
|
28
|
+
findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse | null>;
|
|
29
|
+
findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
|
|
30
|
+
find(selector: IFindRequest): Promise<IFindResponse[]>;
|
|
28
31
|
findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
|
|
29
32
|
create(data: ICreateRequest): Promise<Entity>;
|
|
30
|
-
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<
|
|
31
|
-
deleteOne(selector: IShared.IFindByIdRequest): Promise<
|
|
33
|
+
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<IFindByOwnerIdResponse | null>;
|
|
34
|
+
deleteOne(selector: IShared.IFindByIdRequest): Promise<IFindByOwnerIdResponse | null>;
|
|
32
35
|
}
|
|
33
36
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
37
|
+
export {};
|
|
@@ -5,9 +5,7 @@ export declare const Route = "users";
|
|
|
5
5
|
export declare const UpperName = "Users";
|
|
6
6
|
export declare const LowerName: string;
|
|
7
7
|
export interface IFindByEmailResponse extends Entity {
|
|
8
|
-
store_operator:
|
|
9
|
-
location_id: string;
|
|
10
|
-
} | null;
|
|
8
|
+
store_operator: Pick<StoreOperator, "id" | "location_id"> | null;
|
|
11
9
|
}
|
|
12
10
|
export interface IFindByIdResponse extends Entity {
|
|
13
11
|
provider: (Providers & {
|
|
@@ -8,6 +8,7 @@ import * as Tickets from "./tickets";
|
|
|
8
8
|
export import BankData = User.BankData;
|
|
9
9
|
export import Clients = User.Clients;
|
|
10
10
|
export import ClientType = User.ClientType;
|
|
11
|
+
export import Chat = Stock.Chat;
|
|
11
12
|
export import Commissioner = User.Commissioner;
|
|
12
13
|
export import Counter = Stock.Counter;
|
|
13
14
|
export import Country = User.Country;
|
|
@@ -11,6 +11,19 @@ import { ISavedEmPickingData } from "../../modules/stock/savedEmPicking/interfac
|
|
|
11
11
|
import { IDocumentLineNoteType } from "../../modules/supply/documentLineNote/interfaces";
|
|
12
12
|
import { IProductBase } from "../../modules/supply/cabideProduct/interface";
|
|
13
13
|
import { IProductSheetState } from "../../modules/stock/productGoogleSheets/interface";
|
|
14
|
+
export type Chat = {
|
|
15
|
+
id: string;
|
|
16
|
+
document_header_id: string;
|
|
17
|
+
message: string;
|
|
18
|
+
email_sent: boolean;
|
|
19
|
+
whatsapp_sent: boolean;
|
|
20
|
+
is_customer: boolean;
|
|
21
|
+
deleted: boolean;
|
|
22
|
+
created_by: string;
|
|
23
|
+
updated_by: string;
|
|
24
|
+
created_at: Date;
|
|
25
|
+
updated_at: Date;
|
|
26
|
+
};
|
|
14
27
|
export type Location = {
|
|
15
28
|
id: string;
|
|
16
29
|
type_of_location_id: string;
|
|
@@ -334,6 +347,7 @@ export type DocumentHeader = {
|
|
|
334
347
|
who_handles: string | null;
|
|
335
348
|
tags: string | null;
|
|
336
349
|
warning: string | null;
|
|
350
|
+
chat_token_id: string | null;
|
|
337
351
|
created_at: Date;
|
|
338
352
|
updated_at: Date;
|
|
339
353
|
created_by: string;
|
|
@@ -886,10 +900,7 @@ export type StockMovement = {
|
|
|
886
900
|
emission_date: string;
|
|
887
901
|
name: string;
|
|
888
902
|
pdf_link: string | null;
|
|
889
|
-
|
|
890
|
-
link_owner_id: string | null;
|
|
891
|
-
link_document_header_id: string | null;
|
|
892
|
-
link_closed: boolean | null;
|
|
903
|
+
parent_document_header_id: string | null;
|
|
893
904
|
created_by: string;
|
|
894
905
|
quantity: number;
|
|
895
906
|
stock_to_date: number;
|
|
@@ -126,7 +126,8 @@ export declare enum IBrokerTopic {
|
|
|
126
126
|
perform_task = "perform_task",
|
|
127
127
|
warning_email = "warning_email",
|
|
128
128
|
retry_errored_emails = "retry_errored_emails",
|
|
129
|
-
send_errored_emails_summary = "send_errored_emails_summary"
|
|
129
|
+
send_errored_emails_summary = "send_errored_emails_summary",
|
|
130
|
+
dispatch_chat_message = "dispatch_chat_message"
|
|
130
131
|
}
|
|
131
132
|
export type IBrokerTopicPayload = {
|
|
132
133
|
[IBrokerTopic.create]: Record<string, unknown>;
|
|
@@ -236,6 +237,17 @@ export type IBrokerTopicPayload = {
|
|
|
236
237
|
[IBrokerTopic.send_errored_emails_summary]: {
|
|
237
238
|
warningErrors: string[];
|
|
238
239
|
};
|
|
240
|
+
[IBrokerTopic.dispatch_chat_message]: {
|
|
241
|
+
email: string;
|
|
242
|
+
name: string;
|
|
243
|
+
phone_number: string | null;
|
|
244
|
+
reply_url: string;
|
|
245
|
+
document_header_id: string;
|
|
246
|
+
document_name: string;
|
|
247
|
+
chat_id: string;
|
|
248
|
+
message: string;
|
|
249
|
+
created_by: string;
|
|
250
|
+
};
|
|
239
251
|
};
|
|
240
252
|
export interface IBrokerMessage<T extends IBrokerTopic = IBrokerTopic> {
|
|
241
253
|
topic: T;
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"typescript",
|
|
10
10
|
"helper"
|
|
11
11
|
],
|
|
12
|
-
"version": "0.22.
|
|
12
|
+
"version": "0.22.103",
|
|
13
13
|
"main": "./dist/index.min.js",
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
15
|
"files": [
|
|
@@ -34,16 +34,16 @@
|
|
|
34
34
|
"prepack": "npm run lint && npm run typecheck && npm run build && npm run start"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"joi": "^17.13.
|
|
37
|
+
"joi": "^17.13.3"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@rollup/plugin-terser": "^0.4.4",
|
|
41
41
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
42
|
-
"@types/node": "^20.
|
|
43
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
44
|
-
"@typescript-eslint/parser": "^7.
|
|
42
|
+
"@types/node": "^20.14.9",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^7.15.0",
|
|
44
|
+
"@typescript-eslint/parser": "^7.15.0",
|
|
45
45
|
"eslint": "^8.57.0",
|
|
46
46
|
"rollup": "^4.18.0",
|
|
47
|
-
"tslib": "^2.6.
|
|
47
|
+
"tslib": "^2.6.3"
|
|
48
48
|
}
|
|
49
49
|
}
|