@nomalism-com/types 0.37.7 → 0.37.8
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 +2 -4
- package/dist/index.js +2 -4
- package/dist/modules/supply/documentSet/interface.d.ts +0 -2
- package/dist/shared/entities/stock.d.ts +0 -1
- package/package.json +4 -1
- package/.editorconfig +0 -9
- package/.prettierrc +0 -7
- package/eslint.config.mjs +0 -39
- package/package-lock.json +0 -4327
- package/src/index.ts +0 -3
- package/src/main.ts +0 -672
- package/src/modules/document/billOfLading/interfaces.ts +0 -26
- package/src/modules/document/billOfLading/route.schema.ts +0 -32
- package/src/modules/document/inventario/interface.ts +0 -19
- package/src/modules/document/inventario/route.schema.ts +0 -16
- package/src/modules/document/materialEntrance/interfaces.ts +0 -207
- package/src/modules/document/materialEntrance/route.schema.ts +0 -53
- package/src/modules/document/order/interfaces.ts +0 -172
- package/src/modules/document/order/route.schema.ts +0 -61
- package/src/modules/document/productionOrder/interfaces.ts +0 -12
- package/src/modules/document/productionOrder/route.schema.ts +0 -13
- package/src/modules/document/proforma/interfaces.ts +0 -15
- package/src/modules/document/proforma/route.schema.ts +0 -14
- package/src/modules/document/propostaFornecedor/interfaces.ts +0 -17
- package/src/modules/document/propostaFornecedor/route.schema.ts +0 -21
- package/src/modules/document/propostaSheets/interface.ts +0 -113
- package/src/modules/document/propostaSheets/route.schema.ts +0 -45
- package/src/modules/document/providerCreditNoteFromReturn/interfaces.ts +0 -48
- package/src/modules/document/providerCreditNoteFromReturn/route.schema.ts +0 -41
- package/src/modules/document/providerFinancialCreditNote/interfaces.ts +0 -36
- package/src/modules/document/providerFinancialCreditNote/route.schema.ts +0 -40
- package/src/modules/document/providerServiceInvoice/interfaces.ts +0 -20
- package/src/modules/document/providerServiceInvoice/route.schema.ts +0 -26
- package/src/modules/document/purchase/interfaces.ts +0 -112
- package/src/modules/document/purchase/route.schema.ts +0 -51
- package/src/modules/document/quebra/interfaces.ts +0 -46
- package/src/modules/document/quebra/route.schema.ts +0 -25
- package/src/modules/document/returnToProvider/interface.ts +0 -59
- package/src/modules/document/returnToProvider/route.schema.ts +0 -27
- package/src/modules/document/transformado/interfaces.ts +0 -31
- package/src/modules/document/transformado/route.schema.ts +0 -26
- package/src/modules/document/upfrontReturn/interfaces.ts +0 -17
- package/src/modules/document/upfrontReturn/route.schema.ts +0 -11
- package/src/modules/documentManagement/multimedia/interfaces.ts +0 -22
- package/src/modules/documentManagement/multimedia/route.schema.ts +0 -9
- package/src/modules/integration/emailLog/interfaces.ts +0 -111
- package/src/modules/integration/emailLog/route.schema.ts +0 -18
- package/src/modules/integration/emailTemplate/interfaces.ts +0 -55
- package/src/modules/integration/emailTemplate/route.schema.ts +0 -95
- package/src/modules/integration/emailTemplateAttachment/interfaces.ts +0 -22
- package/src/modules/integration/emailTemplateAttachment/route.schema.ts +0 -12
- package/src/modules/integration/emailVerification/interfaces.ts +0 -30
- package/src/modules/integration/emailVerification/route.schema.ts +0 -34
- package/src/modules/integration/googleFilePermission/interfaces.ts +0 -32
- package/src/modules/integration/googleFilePermission/route.schema.ts +0 -15
- package/src/modules/integration/googleSheets/interfaces.ts +0 -98
- package/src/modules/integration/googleSheets/route.schema.ts +0 -52
- package/src/modules/integration/observation/interfaces.ts +0 -61
- package/src/modules/integration/observation/route.schema.ts +0 -40
- package/src/modules/integration/observationType/interfaces.ts +0 -37
- package/src/modules/integration/observationType/route.schema.ts +0 -17
- package/src/modules/integration/projectInfo/interfaces.ts +0 -26
- package/src/modules/integration/projectInfo/route.schema.ts +0 -18
- package/src/modules/integration/settings/interfaces.ts +0 -31
- package/src/modules/integration/settings/route.schema.ts +0 -24
- package/src/modules/print/npc/interfaces.ts +0 -34
- package/src/modules/print/npc/route.schema.ts +0 -21
- package/src/modules/print/printer/interfaces.ts +0 -47
- package/src/modules/print/printer/route.schema.ts +0 -60
- package/src/modules/print/schedulePrintJob/interfaces.ts +0 -48
- package/src/modules/print/schedulePrintJob/route.schema.ts +0 -39
- package/src/modules/stock/chat/interfaces.ts +0 -82
- package/src/modules/stock/chat/route.schema.ts +0 -28
- package/src/modules/stock/chatRapidMessage/interface.ts +0 -31
- package/src/modules/stock/chatRapidMessage/route.schema.ts +0 -18
- package/src/modules/stock/dashboard/interface.ts +0 -25
- package/src/modules/stock/dashboard/route.schema.ts +0 -11
- package/src/modules/stock/file/interface.ts +0 -37
- package/src/modules/stock/file/route.schema.ts +0 -37
- package/src/modules/stock/location/interface.ts +0 -77
- package/src/modules/stock/location/route.schema.ts +0 -57
- package/src/modules/stock/prison/interface.ts +0 -70
- package/src/modules/stock/prison/route.schema.ts +0 -50
- package/src/modules/stock/productGoogleSheets/interface.ts +0 -339
- package/src/modules/stock/productGoogleSheets/route.schema.ts +0 -146
- package/src/modules/stock/productImage/interface.ts +0 -69
- package/src/modules/stock/productImage/route.schema.ts +0 -52
- package/src/modules/stock/promotion/interface.ts +0 -61
- package/src/modules/stock/promotion/route.schema.ts +0 -39
- package/src/modules/stock/promotionAssoc/interface.ts +0 -62
- package/src/modules/stock/promotionAssoc/route.schema.ts +0 -35
- package/src/modules/stock/queryList/interfaces.ts +0 -56
- package/src/modules/stock/queryList/route.schema.ts +0 -37
- package/src/modules/stock/queryParameter/interfaces.ts +0 -72
- package/src/modules/stock/queryParameter/route.schema.ts +0 -36
- package/src/modules/stock/recurrentTasks/interface.ts +0 -12
- package/src/modules/stock/returnReason/interfaces.ts +0 -23
- package/src/modules/stock/returnReason/route.schema.ts +0 -14
- package/src/modules/stock/savedEmPicking/interfaces.ts +0 -37
- package/src/modules/stock/savedEmPicking/route.schema.ts +0 -113
- package/src/modules/stock/savedProviderProposal/interfaces.ts +0 -32
- package/src/modules/stock/savedProviderProposal/route.schema.ts +0 -16
- package/src/modules/stock/sideMenu/interface.ts +0 -48
- package/src/modules/stock/sideMenu/route.schema.ts +0 -20
- package/src/modules/stock/stockMovement/interface.ts +0 -78
- package/src/modules/stock/stockMovement/route.schema.ts +0 -34
- package/src/modules/stock/tag/interface.ts +0 -36
- package/src/modules/stock/tag/route.schema.ts +0 -30
- package/src/modules/stock/task/interface.ts +0 -126
- package/src/modules/stock/task/route.schema.ts +0 -48
- package/src/modules/stock/taskMessage/interface.ts +0 -18
- package/src/modules/stock/taskMessage/route.schema.ts +0 -19
- package/src/modules/stock/taskRead/interface.ts +0 -17
- package/src/modules/stock/taskRead/route.schema.ts +0 -18
- package/src/modules/stock/typeOfLocation/interface.ts +0 -51
- package/src/modules/stock/typeOfLocation/route.schema.ts +0 -29
- package/src/modules/stock/unitOfMeasure/interface.ts +0 -64
- package/src/modules/stock/unitOfMeasure/route.schema.ts +0 -41
- package/src/modules/stock/vatTax/interface.ts +0 -55
- package/src/modules/stock/vatTax/route.schema.ts +0 -33
- package/src/modules/stock/vatTaxZone/interface.ts +0 -63
- package/src/modules/stock/vatTaxZone/route.schema.ts +0 -42
- package/src/modules/stock/vatValidation/interfaces.ts +0 -10
- package/src/modules/stock/vatValidation/route.schema.ts +0 -8
- package/src/modules/stock/workflow/interfaces.ts +0 -64
- package/src/modules/stock/workflow/route.schema.ts +0 -28
- package/src/modules/supply/batch/interface.ts +0 -0
- package/src/modules/supply/documentHeader/interfaces.ts +0 -497
- package/src/modules/supply/documentHeader/route.schema.ts +0 -371
- package/src/modules/supply/documentHeaderHistory/interfaces.ts +0 -15
- package/src/modules/supply/documentLine/interfaces.ts +0 -210
- package/src/modules/supply/documentLine/route.schema.ts +0 -108
- package/src/modules/supply/documentLineAssoc/interfaces.ts +0 -52
- package/src/modules/supply/documentLineAssoc/route.schema.ts +0 -16
- package/src/modules/supply/documentLineMT/interface.ts +0 -27
- package/src/modules/supply/documentLineMT/route.schema.ts +0 -18
- package/src/modules/supply/documentLineNote/interfaces.ts +0 -53
- package/src/modules/supply/documentLineNote/route.schema.ts +0 -19
- package/src/modules/supply/documentLineRM/interface.ts +0 -34
- package/src/modules/supply/documentLineRM/route.schema.ts +0 -25
- package/src/modules/supply/documentSet/interface.ts +0 -31
- package/src/modules/supply/documentSet/route.schema.ts +0 -20
- package/src/modules/supply/documentType/interfaces.ts +0 -214
- package/src/modules/supply/documentType/route.schema.ts +0 -75
- package/src/modules/supply/externalDocumentHeader/interface.ts +0 -120
- package/src/modules/supply/externalDocumentHeader/route.schema.ts +0 -79
- package/src/modules/supply/externalDocumentType/interface.ts +0 -14
- package/src/modules/supply/orderManagement/interface.ts +0 -49
- package/src/modules/supply/orderManagement/route.schema.ts +0 -0
- package/src/modules/supply/payment/interface.ts +0 -229
- package/src/modules/supply/payment/route.schema.ts +0 -122
- package/src/modules/supply/preSale/interface.ts +0 -92
- package/src/modules/supply/preSale/route.schema.ts +0 -75
- package/src/modules/supply/preSaleProduct/interface.ts +0 -16
- package/src/modules/supply/preSaleProduct/route.schema.ts +0 -7
- package/src/modules/supply/schedule/interface.ts +0 -47
- package/src/modules/supply/schedule/route.schema.ts +0 -14
- package/src/modules/supply/startDocumentHeaderLastUpdate/interface.ts +0 -15
- package/src/modules/tickets/channel/interfaces.ts +0 -35
- package/src/modules/tickets/channel/route.schema.ts +0 -24
- package/src/modules/tickets/clt/interfaces.ts +0 -26
- package/src/modules/tickets/clt/route.schema.ts +0 -24
- package/src/modules/tickets/language/interfaces.ts +0 -25
- package/src/modules/tickets/language/route.schema.ts +0 -28
- package/src/modules/tickets/tickets/interfaces.ts +0 -80
- package/src/modules/tickets/tickets/route.schema.ts +0 -19
- package/src/modules/user/bankData/interface.ts +0 -64
- package/src/modules/user/bankData/route.schema.ts +0 -40
- package/src/modules/user/chatSubscribers/interfaces.ts +0 -34
- package/src/modules/user/chatSubscribers/route.schema.ts +0 -12
- package/src/modules/user/clientType/interface.ts +0 -47
- package/src/modules/user/clientType/route.schema.ts +0 -31
- package/src/modules/user/clients/interface.ts +0 -138
- package/src/modules/user/clients/route.schema.ts +0 -87
- package/src/modules/user/commissioner/interface.ts +0 -110
- package/src/modules/user/commissioner/route.schema.ts +0 -65
- package/src/modules/user/country/interface.ts +0 -54
- package/src/modules/user/country/route.schema.ts +0 -36
- package/src/modules/user/deliveryMethods/interfaces.ts +0 -28
- package/src/modules/user/deliveryMethods/route.schema.ts +0 -15
- package/src/modules/user/favorites/interfaces.ts +0 -28
- package/src/modules/user/favorites/route.schema.ts +0 -19
- package/src/modules/user/groupPermissions/interface.ts +0 -32
- package/src/modules/user/groupPermissions/route.schema.ts +0 -11
- package/src/modules/user/language/interface.ts +0 -47
- package/src/modules/user/language/route.schema.ts +0 -28
- package/src/modules/user/maturityDates/interfaces.ts +0 -31
- package/src/modules/user/maturityDates/route.schema.ts +0 -18
- package/src/modules/user/password/interfaces.ts +0 -21
- package/src/modules/user/password/route.schema.ts +0 -22
- package/src/modules/user/paymentMethods/interfaces.ts +0 -72
- package/src/modules/user/paymentMethods/route.schema.ts +0 -27
- package/src/modules/user/permissions/interface.ts +0 -34
- package/src/modules/user/permissions/route.schema.ts +0 -11
- package/src/modules/user/persona/interface.ts +0 -157
- package/src/modules/user/persona/route.schema.ts +0 -101
- package/src/modules/user/providerType/interface.ts +0 -47
- package/src/modules/user/providerType/route.schema.ts +0 -28
- package/src/modules/user/providers/interface.ts +0 -130
- package/src/modules/user/providers/route.schema.ts +0 -85
- package/src/modules/user/purchaseConditions/interface.ts +0 -58
- package/src/modules/user/purchaseConditions/route.schema.ts +0 -33
- package/src/modules/user/reasonForExemption/interface.ts +0 -53
- package/src/modules/user/reasonForExemption/route.schema.ts +0 -34
- package/src/modules/user/refreshToken/interface.ts +0 -19
- package/src/modules/user/refreshToken/route.schema.ts +0 -10
- package/src/modules/user/segmentsArea/interface.ts +0 -49
- package/src/modules/user/segmentsArea/route.schema.ts +0 -30
- package/src/modules/user/sessions/interface.ts +0 -24
- package/src/modules/user/sessions/route.schema.ts +0 -10
- package/src/modules/user/shippings/interface.ts +0 -57
- package/src/modules/user/shippings/route.schema.ts +0 -35
- package/src/modules/user/storeOperator/interface.ts +0 -42
- package/src/modules/user/storeOperator/route.schema.ts +0 -45
- package/src/modules/user/swift/interface.ts +0 -55
- package/src/modules/user/swift/route.schema.ts +0 -36
- package/src/modules/user/tenant/interface.ts +0 -59
- package/src/modules/user/tenant/route.schema.ts +0 -46
- package/src/modules/user/theme/interfaces.ts +0 -21
- package/src/modules/user/theme/route.schema.ts +0 -19
- package/src/modules/user/userPermissions/interface.ts +0 -28
- package/src/modules/user/userPermissions/route.schema.ts +0 -12
- package/src/modules/user/userPositions/interface.ts +0 -47
- package/src/modules/user/userPositions/route.schema.ts +0 -29
- package/src/modules/user/userTokens/interface.ts +0 -41
- package/src/modules/user/userTokens/route.schema.ts +0 -17
- package/src/modules/user/users/interface.ts +0 -177
- package/src/modules/user/users/route.schema.ts +0 -58
- package/src/modules/user/vehicles/interfaces.ts +0 -31
- package/src/modules/user/vehicles/route.schema.ts +0 -17
- package/src/modules/user/zipCode/interfaces.ts +0 -27
- package/src/modules/user/zipCode/route.schema.ts +0 -26
- package/src/modules/view/adminPanel/interfaces.ts +0 -180
- package/src/modules/view/errorLog/interfaces.ts +0 -36
- package/src/modules/view/errorLog/route.schema.ts +0 -25
- package/src/shared/entities/documentManagement.ts +0 -16
- package/src/shared/entities/integration.ts +0 -136
- package/src/shared/entities/print.ts +0 -49
- package/src/shared/entities/stock.ts +0 -1248
- package/src/shared/entities/tickets.ts +0 -82
- package/src/shared/entities/user.ts +0 -540
- package/src/shared/errors/documentManagementErrors.ts +0 -13
- package/src/shared/errors/integrationErrors.ts +0 -44
- package/src/shared/errors/stockErrors.ts +0 -267
- package/src/shared/errors/userErrors.ts +0 -108
- package/src/shared/errors/viewErrors.ts +0 -6
- package/src/shared/interface.ts +0 -548
- package/src/shared/messages.ts +0 -141
- package/tsconfig.json +0 -20
- package/tsup.config.ts +0 -10
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import joi from 'joi';
|
|
2
|
-
import { messages } from '../../../shared/messages';
|
|
3
|
-
import * as IShared from '../../../shared/interface';
|
|
4
|
-
import {
|
|
5
|
-
documentTypeUserTypes,
|
|
6
|
-
documentTypeCodeTypes,
|
|
7
|
-
ICreateRequest,
|
|
8
|
-
IUpdateRequest,
|
|
9
|
-
} from './interfaces';
|
|
10
|
-
|
|
11
|
-
const createBodyKeys: IShared.IRouteRequest<ICreateRequest> = {
|
|
12
|
-
description: joi.string().required(),
|
|
13
|
-
group: joi.string().required(),
|
|
14
|
-
quantity_in: joi.boolean().default(false).optional(),
|
|
15
|
-
quantity_out: joi.boolean().default(false).optional(),
|
|
16
|
-
credit: joi.boolean().default(false).optional(),
|
|
17
|
-
debit: joi.boolean().default(false).optional(),
|
|
18
|
-
user_type: joi
|
|
19
|
-
.string()
|
|
20
|
-
.valid(...documentTypeUserTypes)
|
|
21
|
-
.required(),
|
|
22
|
-
code: joi
|
|
23
|
-
.string()
|
|
24
|
-
.valid(...documentTypeCodeTypes)
|
|
25
|
-
.required(),
|
|
26
|
-
external_document_type_id: joi.string().allow(null).optional(),
|
|
27
|
-
document_set_id: joi.string().allow(null).required(),
|
|
28
|
-
ensure_same_provider: joi.boolean().default(false).optional(),
|
|
29
|
-
final_consumer: joi.boolean().default(false).optional(),
|
|
30
|
-
is_searchable: joi.boolean().default(false).optional(),
|
|
31
|
-
invoice: joi.boolean().default(false).optional(),
|
|
32
|
-
return: joi.boolean().default(false).optional(),
|
|
33
|
-
pay: joi.boolean().default(false).optional(),
|
|
34
|
-
allow_create_from_header_without_lines: joi.boolean().default(false).optional(),
|
|
35
|
-
allow_commissioner: joi.boolean().default(false).optional(),
|
|
36
|
-
duplicate_group: joi.string().allow(null).optional(),
|
|
37
|
-
allow_duplicates: joi.boolean().default(false).optional(),
|
|
38
|
-
requires_picking: joi.boolean().default(false).optional(),
|
|
39
|
-
allow_document_line_assoc_plugins: joi.boolean().default(false).optional(),
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const createBody = joi.object().keys(createBodyKeys).messages(messages);
|
|
43
|
-
|
|
44
|
-
const updateBodyKeys: IShared.IRouteRequest<IUpdateRequest> = {
|
|
45
|
-
description: joi.string(),
|
|
46
|
-
group: joi.string(),
|
|
47
|
-
quantity_in: joi.boolean(),
|
|
48
|
-
quantity_out: joi.boolean(),
|
|
49
|
-
credit: joi.boolean(),
|
|
50
|
-
debit: joi.boolean(),
|
|
51
|
-
user_type: joi
|
|
52
|
-
.string()
|
|
53
|
-
.valid(...documentTypeUserTypes)
|
|
54
|
-
.optional(),
|
|
55
|
-
code: joi
|
|
56
|
-
.string()
|
|
57
|
-
.valid(...documentTypeCodeTypes)
|
|
58
|
-
.optional(),
|
|
59
|
-
external_document_type_id: joi.string().allow(null, ''),
|
|
60
|
-
document_set_id: joi.string().allow(null).optional(),
|
|
61
|
-
ensure_same_provider: joi.boolean(),
|
|
62
|
-
final_consumer: joi.boolean(),
|
|
63
|
-
is_searchable: joi.boolean(),
|
|
64
|
-
invoice: joi.boolean(),
|
|
65
|
-
return: joi.boolean(),
|
|
66
|
-
pay: joi.boolean(),
|
|
67
|
-
allow_create_from_header_without_lines: joi.boolean(),
|
|
68
|
-
allow_commissioner: joi.boolean(),
|
|
69
|
-
duplicate_group: joi.string().allow(null).optional(),
|
|
70
|
-
allow_duplicates: joi.boolean(),
|
|
71
|
-
requires_picking: joi.boolean(),
|
|
72
|
-
allow_document_line_assoc_plugins: joi.boolean(),
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export const updateBody = joi.object().keys(updateBodyKeys).messages(messages);
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import * as IShared from '../../../shared/interface';
|
|
2
|
-
import { ExternalDocumentHeader } from '../../../shared/entities/stock';
|
|
3
|
-
import { IUpdateDataRequest } from '../documentLine/interfaces';
|
|
4
|
-
export type Entity = ExternalDocumentHeader;
|
|
5
|
-
export declare const Route = 'external_document_header';
|
|
6
|
-
export declare const UpperName = 'ExternalDocumentHeader';
|
|
7
|
-
export declare const LowerName: string;
|
|
8
|
-
type IEntityExtended = Entity;
|
|
9
|
-
export type IFindByIdResponse = Omit<IEntityExtended, ''>;
|
|
10
|
-
export interface IFindByOwnerIdItem {
|
|
11
|
-
id: string | null;
|
|
12
|
-
document_header_id: string;
|
|
13
|
-
is_void: boolean;
|
|
14
|
-
pdf_link: string | null;
|
|
15
|
-
external_id: string | null;
|
|
16
|
-
label: string;
|
|
17
|
-
visible: boolean;
|
|
18
|
-
loading: boolean;
|
|
19
|
-
emission_date: Date;
|
|
20
|
-
retryPayload: IUpdateDataRequest | null;
|
|
21
|
-
}
|
|
22
|
-
export interface IFindByOwnerIdItemWithVersions extends IFindByOwnerIdItem {
|
|
23
|
-
older_versions: IFindByOwnerIdItem[];
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export type IFindRequest = Record<string, unknown>;
|
|
27
|
-
export type IFindResponse = Omit<IEntityExtended, ''>;
|
|
28
|
-
export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {}
|
|
29
|
-
export type IFindWithPaginationResponse = IShared.IPaginationResponse<Omit<IEntityExtended, ''>>;
|
|
30
|
-
export interface ICreateRequest {
|
|
31
|
-
document_header_id: string;
|
|
32
|
-
external_id: string;
|
|
33
|
-
external_pdf_link: string;
|
|
34
|
-
pdf_link: string;
|
|
35
|
-
}
|
|
36
|
-
export interface IUpdateRequest {
|
|
37
|
-
external_id?: string;
|
|
38
|
-
external_pdf_link?: string;
|
|
39
|
-
pdf_link?: string;
|
|
40
|
-
}
|
|
41
|
-
export interface ISendEmailDocument {
|
|
42
|
-
template: IShared.IUserSendEmailDocumentTemplate;
|
|
43
|
-
external_document_header_ids: string[];
|
|
44
|
-
document_line_assoc_ids: string[];
|
|
45
|
-
user: {
|
|
46
|
-
name: string;
|
|
47
|
-
email: string;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export enum IPublicDocumentHeaderNoteType {
|
|
52
|
-
Provider = 'Provider',
|
|
53
|
-
Client = 'Client',
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export interface PublicDocumentHeaderNote {
|
|
57
|
-
id: string;
|
|
58
|
-
note: string;
|
|
59
|
-
type: IPublicDocumentHeaderNoteType;
|
|
60
|
-
created_at: Date;
|
|
61
|
-
updated_at: Date;
|
|
62
|
-
created_by: string;
|
|
63
|
-
updated_by: string;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export type ISendEmailDocumentRequest = IShared.RequireOnlyOne<
|
|
67
|
-
ISendEmailDocument,
|
|
68
|
-
'document_line_assoc_ids' | 'external_document_header_ids'
|
|
69
|
-
>;
|
|
70
|
-
export interface IPublicFindByOwnerIdResponse {
|
|
71
|
-
start_document_header_id: string;
|
|
72
|
-
label: string;
|
|
73
|
-
emission_date: Date;
|
|
74
|
-
pdf_link: string;
|
|
75
|
-
new_chat_messages: number;
|
|
76
|
-
pc_tags: string[];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface PublicDocumentHeaderNoteCreateRequest {
|
|
80
|
-
document_header_id: string;
|
|
81
|
-
note: string;
|
|
82
|
-
type: IPublicDocumentHeaderNoteType;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export interface PublicDocumentHeaderNoteUpdateRequest {
|
|
86
|
-
note: string;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export interface IRepository {
|
|
90
|
-
findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse | null>;
|
|
91
|
-
|
|
92
|
-
publicFindByOwnerId(
|
|
93
|
-
params: IShared.IFindByOwnerIdRequest,
|
|
94
|
-
): Promise<IPublicFindByOwnerIdResponse[]>;
|
|
95
|
-
|
|
96
|
-
findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdItemWithVersions[]>;
|
|
97
|
-
|
|
98
|
-
sendEmailDocument: (data: ISendEmailDocumentRequest) => Promise<void>;
|
|
99
|
-
|
|
100
|
-
find(selector: IFindRequest): Promise<IFindResponse[]>;
|
|
101
|
-
|
|
102
|
-
findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
|
|
103
|
-
|
|
104
|
-
create(data: ICreateRequest): Promise<Entity>;
|
|
105
|
-
|
|
106
|
-
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
|
|
107
|
-
|
|
108
|
-
deleteOne(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
|
|
109
|
-
|
|
110
|
-
createPublicDocumentHeaderNote: (
|
|
111
|
-
data: PublicDocumentHeaderNoteCreateRequest[],
|
|
112
|
-
) => Promise<PublicDocumentHeaderNote[]>;
|
|
113
|
-
|
|
114
|
-
updatePublicDocumentHeaderNote: (
|
|
115
|
-
selector: IShared.IFindByIdRequest,
|
|
116
|
-
data: PublicDocumentHeaderNoteUpdateRequest[],
|
|
117
|
-
) => Promise<PublicDocumentHeaderNote[]>;
|
|
118
|
-
}
|
|
119
|
-
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
120
|
-
export {};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import joi from 'joi';
|
|
2
|
-
import { messages } from '../../../shared/messages';
|
|
3
|
-
import * as IShared from '../../../shared/interface';
|
|
4
|
-
import {
|
|
5
|
-
IFindRequest,
|
|
6
|
-
IFindPaginatedRequest,
|
|
7
|
-
ICreateRequest,
|
|
8
|
-
IUpdateRequest,
|
|
9
|
-
ISendEmailDocumentRequest,
|
|
10
|
-
PublicDocumentHeaderNoteUpdateRequest,
|
|
11
|
-
PublicDocumentHeaderNoteCreateRequest,
|
|
12
|
-
} from './interface';
|
|
13
|
-
|
|
14
|
-
const findQueryKeys: IShared.IRouteRequest<IFindRequest> = {};
|
|
15
|
-
export const findQuery = joi.object().keys(findQueryKeys).messages(messages);
|
|
16
|
-
|
|
17
|
-
// find with pagination query validation
|
|
18
|
-
const findWithPaginationQueryKeys: IShared.IRouteRequest<IFindPaginatedRequest> = {
|
|
19
|
-
per_page: joi.number().integer().positive().default(10).optional(),
|
|
20
|
-
current_page: joi.number().integer().positive().default(1).optional(),
|
|
21
|
-
};
|
|
22
|
-
export const findWithPaginationQuery = joi
|
|
23
|
-
.object()
|
|
24
|
-
.keys(findWithPaginationQueryKeys)
|
|
25
|
-
.messages(messages);
|
|
26
|
-
|
|
27
|
-
// create body validation
|
|
28
|
-
const createBodyKeys: IShared.IRouteRequest<ICreateRequest> = {
|
|
29
|
-
document_header_id: joi.string().uuid().required(),
|
|
30
|
-
external_id: joi.string().required(),
|
|
31
|
-
external_pdf_link: joi.string().required(),
|
|
32
|
-
pdf_link: joi.string().required(),
|
|
33
|
-
};
|
|
34
|
-
export const createBody = joi.object().keys(createBodyKeys).messages(messages);
|
|
35
|
-
|
|
36
|
-
// update body validation
|
|
37
|
-
const updateBodyKeys: IShared.IRouteRequest<IUpdateRequest> = {
|
|
38
|
-
external_id: joi.string(),
|
|
39
|
-
external_pdf_link: joi.string(),
|
|
40
|
-
pdf_link: joi.string(),
|
|
41
|
-
};
|
|
42
|
-
export const updateBody = joi.object().keys(updateBodyKeys).messages(messages);
|
|
43
|
-
|
|
44
|
-
const sendEmailDocumentBodyKeys: IShared.IRouteRequest<ISendEmailDocumentRequest> = {
|
|
45
|
-
template: joi
|
|
46
|
-
.string()
|
|
47
|
-
.valid(...IShared.IUserSendEmailDocumentTemplateTypes)
|
|
48
|
-
.required(),
|
|
49
|
-
document_line_assoc_ids: joi.array().items(joi.string().uuid()),
|
|
50
|
-
external_document_header_ids: joi.array().items(joi.string().uuid()),
|
|
51
|
-
user: joi
|
|
52
|
-
.object()
|
|
53
|
-
.keys({
|
|
54
|
-
name: joi.string().required(),
|
|
55
|
-
email: joi.string().trim(true).lowercase().required(),
|
|
56
|
-
})
|
|
57
|
-
.optional(),
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export const sendEmailDocumentBody = joi
|
|
61
|
-
.object()
|
|
62
|
-
.keys(sendEmailDocumentBodyKeys)
|
|
63
|
-
.xor('document_line_assoc_ids', 'external_document_header_ids')
|
|
64
|
-
.messages(messages);
|
|
65
|
-
|
|
66
|
-
// create Note body validation
|
|
67
|
-
const createNoteBodyKeys: IShared.IRouteRequest<PublicDocumentHeaderNoteCreateRequest> = {
|
|
68
|
-
document_header_id: joi.string().uuid().required(),
|
|
69
|
-
note: joi.string().required(),
|
|
70
|
-
type: joi.string().required().valid('Client', 'Provider'),
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export const createNoteBody = joi.object().keys(createNoteBodyKeys).messages(messages);
|
|
74
|
-
|
|
75
|
-
// update Note body validation
|
|
76
|
-
const updateNoteBodyKeys: IShared.IRouteRequest<PublicDocumentHeaderNoteUpdateRequest> = {
|
|
77
|
-
note: joi.string().required().allow(''),
|
|
78
|
-
};
|
|
79
|
-
export const updateNoteBody = joi.object().keys(updateNoteBodyKeys).messages(messages);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ExternalDocumentType } from '../../../shared/entities/stock';
|
|
2
|
-
import * as IShared from '../../../shared/interface';
|
|
3
|
-
|
|
4
|
-
export type Entity = ExternalDocumentType;
|
|
5
|
-
export const Route = 'external_document_type';
|
|
6
|
-
export const UpperName = 'ExternalDocumentType';
|
|
7
|
-
export const LowerName = UpperName[0].toLowerCase() + UpperName.substring(1);
|
|
8
|
-
|
|
9
|
-
export interface IRepository {
|
|
10
|
-
find(): Promise<Entity[]>;
|
|
11
|
-
findMinified(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { IProductType } from '../../stock/productGoogleSheets/interface';
|
|
2
|
-
|
|
3
|
-
export const Route = 'order_management';
|
|
4
|
-
export const UpperName = 'OrderManagement';
|
|
5
|
-
export const LowerName = UpperName[0].toLowerCase() + UpperName.substring(1);
|
|
6
|
-
|
|
7
|
-
export interface IFindProviderProductsRequest {
|
|
8
|
-
provider_id: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface IFindProposals {
|
|
12
|
-
id: string;
|
|
13
|
-
name: string;
|
|
14
|
-
start_document_header_id: string;
|
|
15
|
-
pdf_link: string | null;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface IFindProviderProductsResponse {
|
|
19
|
-
product_id: string;
|
|
20
|
-
type: IProductType;
|
|
21
|
-
obs: boolean;
|
|
22
|
-
multimedia_id: string | null;
|
|
23
|
-
ref: string;
|
|
24
|
-
des: string;
|
|
25
|
-
provider_ref: string | null;
|
|
26
|
-
price_cost: number;
|
|
27
|
-
price_sale: number;
|
|
28
|
-
available: number;
|
|
29
|
-
last_ef_date: Date | null;
|
|
30
|
-
ordered_quantity: number;
|
|
31
|
-
last_em_date: Date | null;
|
|
32
|
-
notation: string;
|
|
33
|
-
pfs: IFindProposals[];
|
|
34
|
-
pcs: IFindProposals[];
|
|
35
|
-
client_quantity: number;
|
|
36
|
-
pre_ordered_quantity: number;
|
|
37
|
-
last6m_consumption: number;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface IFindAllProviderProductsResponse extends IFindProviderProductsResponse {
|
|
41
|
-
provider_id: string;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface IRepository {
|
|
45
|
-
findProviderProducts(
|
|
46
|
-
params: IFindProviderProductsRequest,
|
|
47
|
-
): Promise<IFindProviderProductsResponse[]>;
|
|
48
|
-
findAllProviderProducts(): Promise<IFindAllProviderProductsResponse[]>;
|
|
49
|
-
}
|
|
File without changes
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
import * as IShared from '../../../shared/interface';
|
|
2
|
-
import { Payment, DocumentHeader } from '../../../shared/entities/stock';
|
|
3
|
-
import * as IUser from '../../user/users/interface';
|
|
4
|
-
import * as IObservation from '../../integration/observation/interfaces';
|
|
5
|
-
|
|
6
|
-
export type Entity = Payment;
|
|
7
|
-
export const Route = 'payment';
|
|
8
|
-
export const UpperName = 'Payment';
|
|
9
|
-
export const LowerName = UpperName[0].toLowerCase() + UpperName.substring(1);
|
|
10
|
-
|
|
11
|
-
type IEntityExtended = Entity;
|
|
12
|
-
|
|
13
|
-
// omit any unnecessary fields
|
|
14
|
-
export type IFindByIdResponse = Omit<IEntityExtended, ''>;
|
|
15
|
-
|
|
16
|
-
// omit any unnecessary fields
|
|
17
|
-
export type IFindByOwnerIdResponse = Omit<IEntityExtended, ''>;
|
|
18
|
-
|
|
19
|
-
export type IFindRequest = Record<string, unknown>;
|
|
20
|
-
|
|
21
|
-
// omit any unnecessary fields
|
|
22
|
-
export type IFindResponse = Omit<IEntityExtended, ''>;
|
|
23
|
-
|
|
24
|
-
export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {}
|
|
25
|
-
|
|
26
|
-
export type IFindWithPaginationResponse = IShared.IPaginationResponse<Omit<IEntityExtended, ''>>;
|
|
27
|
-
|
|
28
|
-
export interface ICreateForThisDocumentHeaderRequest {
|
|
29
|
-
date: Date;
|
|
30
|
-
debit: number;
|
|
31
|
-
credit: number;
|
|
32
|
-
payment_method_id?: string | null;
|
|
33
|
-
payment_method?: string | null;
|
|
34
|
-
notes: string | null;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface ICreateRequest extends ICreateForThisDocumentHeaderRequest {
|
|
38
|
-
document_header_id: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface ICurrentAccountNotes {
|
|
42
|
-
date: string;
|
|
43
|
-
credit: number | null;
|
|
44
|
-
debit: number | null;
|
|
45
|
-
iban: string | null;
|
|
46
|
-
payment_batch_id: string | null;
|
|
47
|
-
payment_method: string | null;
|
|
48
|
-
notes: string | null;
|
|
49
|
-
owner_name: string;
|
|
50
|
-
created_at: string;
|
|
51
|
-
created_by: string;
|
|
52
|
-
updated_at: string;
|
|
53
|
-
updated_by: string;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export interface IFindCurrentAccountByOwnerIdResponse {
|
|
57
|
-
payment_date: string;
|
|
58
|
-
emission_date: string;
|
|
59
|
-
document_description: string;
|
|
60
|
-
document_name: string;
|
|
61
|
-
debit: number;
|
|
62
|
-
credit: number;
|
|
63
|
-
notes: ICurrentAccountNotes[];
|
|
64
|
-
por_regularizar: number;
|
|
65
|
-
balance: number;
|
|
66
|
-
href?: string | null;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface IUnpaidPurchasesRequest {
|
|
70
|
-
provider_id: string;
|
|
71
|
-
client_id: string | null;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface IUnpaidByDatePurchasesRequest {
|
|
75
|
-
due_date: Date;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export type IPaymentOrigin =
|
|
79
|
-
| 'CC Fornecedor'
|
|
80
|
-
| 'CC Cliente'
|
|
81
|
-
| 'CC Fornecedor (Descontinuado)'
|
|
82
|
-
| 'CC Cliente (Descontinuado)';
|
|
83
|
-
|
|
84
|
-
export interface IUnpaidPurchasesResponse extends Pick<Entity, 'date' | 'debit' | 'credit'> {
|
|
85
|
-
document_header: Pick<DocumentHeader, 'emission_date' | 'pdf_link' | 'id'>;
|
|
86
|
-
origin: IPaymentOrigin;
|
|
87
|
-
document_type_code: string | null;
|
|
88
|
-
document_name: string;
|
|
89
|
-
user?: {
|
|
90
|
-
user_name: string;
|
|
91
|
-
provider_id: string;
|
|
92
|
-
client_id?: string | null;
|
|
93
|
-
};
|
|
94
|
-
maturity_days: number;
|
|
95
|
-
observations: IObservation.IFindByOwnerResponse[];
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export interface IProviderPaymentDocument {
|
|
99
|
-
document_header_id: string;
|
|
100
|
-
value: number;
|
|
101
|
-
discount_value?: number | null;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export interface IProviderPaymentRequest {
|
|
105
|
-
provider_id: string;
|
|
106
|
-
client_id: string | null;
|
|
107
|
-
documents: IProviderPaymentDocument[];
|
|
108
|
-
total: number;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export interface IPaymentsNotExportedRequest {
|
|
112
|
-
whiteList?: string[];
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export interface IPaymentsNotExportedResponse {
|
|
116
|
-
iban: string;
|
|
117
|
-
payment_ids: string[];
|
|
118
|
-
npf_dh: {
|
|
119
|
-
id: string;
|
|
120
|
-
name: string;
|
|
121
|
-
pdf_link: string | null;
|
|
122
|
-
total: number;
|
|
123
|
-
}[];
|
|
124
|
-
provider: string;
|
|
125
|
-
value: number;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export interface IExportPaymentsRequest {
|
|
129
|
-
provider: string;
|
|
130
|
-
value: number;
|
|
131
|
-
npf_ids?: string[];
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export type IBatchType = 'national' | 'international' | 'null';
|
|
135
|
-
|
|
136
|
-
export interface IPaymentsBatchNpfDh {
|
|
137
|
-
id: string;
|
|
138
|
-
name: string;
|
|
139
|
-
sent: string | null;
|
|
140
|
-
owner_id: string;
|
|
141
|
-
owner_number: number;
|
|
142
|
-
owner_name: string;
|
|
143
|
-
external_document_header_id: string | null;
|
|
144
|
-
pdf_link: string | null;
|
|
145
|
-
total: number;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export interface IPaymentsBatchResponse {
|
|
149
|
-
batch_id: string;
|
|
150
|
-
batch_value: number;
|
|
151
|
-
batch_type: IBatchType | null;
|
|
152
|
-
multimedia_id: string | null;
|
|
153
|
-
times_downloaded: number;
|
|
154
|
-
npf_dh: IPaymentsBatchNpfDh[];
|
|
155
|
-
updated_at: Date;
|
|
156
|
-
updated_by: string;
|
|
157
|
-
created_at: Date;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export const IExportCurrentAccountOutputEnum: {
|
|
161
|
-
csv: 'csv';
|
|
162
|
-
pdf: 'pdf';
|
|
163
|
-
} = {
|
|
164
|
-
csv: 'csv',
|
|
165
|
-
pdf: 'pdf',
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
export type IExportCurrentAccountOutput =
|
|
169
|
-
(typeof IExportCurrentAccountOutputEnum)[keyof typeof IExportCurrentAccountOutputEnum];
|
|
170
|
-
|
|
171
|
-
export const IExportCurrentAccountOutputOptions = Object.keys(IExportCurrentAccountOutputEnum);
|
|
172
|
-
|
|
173
|
-
export interface IExportCurrentAccountRequest {
|
|
174
|
-
token: string;
|
|
175
|
-
owner_id: string;
|
|
176
|
-
output: IExportCurrentAccountOutput;
|
|
177
|
-
start_date: Date | null;
|
|
178
|
-
end_date: Date | null;
|
|
179
|
-
}
|
|
180
|
-
export interface IFindCurrentAccountPaginatedRequest
|
|
181
|
-
extends IShared.IFindByOwnerIdRequest,
|
|
182
|
-
IShared.IPaginationRequest {}
|
|
183
|
-
export interface IRepository {
|
|
184
|
-
findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse | null>;
|
|
185
|
-
|
|
186
|
-
findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
|
|
187
|
-
|
|
188
|
-
find(selector: IFindRequest): Promise<IFindResponse[]>;
|
|
189
|
-
|
|
190
|
-
findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
|
|
191
|
-
|
|
192
|
-
findPaymentsNotExported(
|
|
193
|
-
params: IPaymentsNotExportedRequest,
|
|
194
|
-
): Promise<IPaymentsNotExportedResponse[]>;
|
|
195
|
-
|
|
196
|
-
findPaymentBatches(): Promise<IPaymentsBatchResponse[]>;
|
|
197
|
-
|
|
198
|
-
deleteBatch(data: IShared.IFindByIdRequest): Promise<void>;
|
|
199
|
-
|
|
200
|
-
findCurrentAccountByOwnerId(
|
|
201
|
-
params: IShared.IFindByOwnerIdRequest,
|
|
202
|
-
): Promise<IFindCurrentAccountByOwnerIdResponse[]>;
|
|
203
|
-
|
|
204
|
-
findBalanceByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<number>;
|
|
205
|
-
|
|
206
|
-
findSettledMaterialEntrance(params: IUnpaidPurchasesRequest): Promise<IUnpaidPurchasesResponse[]>;
|
|
207
|
-
|
|
208
|
-
findSettledMaterialEntranceProviders(): Promise<IUser.IFindProvidersWithClientIdResponse[]>;
|
|
209
|
-
|
|
210
|
-
findSettledMaterialEntranceByDate(
|
|
211
|
-
params: IUnpaidByDatePurchasesRequest,
|
|
212
|
-
): Promise<IUnpaidPurchasesResponse[]>;
|
|
213
|
-
|
|
214
|
-
createProvidersPayments(params: IProviderPaymentRequest[]): Promise<string[]>;
|
|
215
|
-
|
|
216
|
-
exportPayments(params: IExportPaymentsRequest[]): Promise<void>;
|
|
217
|
-
|
|
218
|
-
updateDownloadedBatchNumber(id: IShared.IFindByIdRequest): Promise<void>;
|
|
219
|
-
|
|
220
|
-
exportCurrentAccount(
|
|
221
|
-
params: IExportCurrentAccountRequest,
|
|
222
|
-
): Promise<IFindCurrentAccountByOwnerIdResponse[]>;
|
|
223
|
-
|
|
224
|
-
findCurrentAccountPaginated(
|
|
225
|
-
params: IFindCurrentAccountPaginatedRequest,
|
|
226
|
-
): Promise<IShared.IPaginationResponse<IFindCurrentAccountByOwnerIdResponse>>;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import joi from 'joi';
|
|
2
|
-
import { messages } from '../../../shared/messages';
|
|
3
|
-
import * as IShared from '../../../shared/interface';
|
|
4
|
-
import {
|
|
5
|
-
IFindRequest,
|
|
6
|
-
IFindPaginatedRequest,
|
|
7
|
-
IUnpaidPurchasesRequest,
|
|
8
|
-
IProviderPaymentRequest,
|
|
9
|
-
IExportPaymentsRequest,
|
|
10
|
-
IExportCurrentAccountRequest,
|
|
11
|
-
IUnpaidByDatePurchasesRequest,
|
|
12
|
-
IProviderPaymentDocument,
|
|
13
|
-
IExportCurrentAccountOutputOptions,
|
|
14
|
-
IPaymentsNotExportedRequest,
|
|
15
|
-
IFindCurrentAccountPaginatedRequest,
|
|
16
|
-
} from './interface';
|
|
17
|
-
|
|
18
|
-
const findQueryKeys: IShared.IRouteRequest<IFindRequest> = {};
|
|
19
|
-
export const findQuery = joi.object().keys(findQueryKeys).messages(messages);
|
|
20
|
-
|
|
21
|
-
// find with pagination query validation
|
|
22
|
-
const findWithPaginationQueryKeys: IShared.IRouteRequest<IFindPaginatedRequest> = {
|
|
23
|
-
per_page: joi.number().integer().positive().default(10).optional(),
|
|
24
|
-
current_page: joi.number().integer().positive().default(1).optional(),
|
|
25
|
-
};
|
|
26
|
-
export const findWithPaginationQuery = joi
|
|
27
|
-
.object()
|
|
28
|
-
.keys(findWithPaginationQueryKeys)
|
|
29
|
-
.messages(messages);
|
|
30
|
-
|
|
31
|
-
// find settled material entrances
|
|
32
|
-
const findSettledMaterialEntranceQueryKeys: IShared.IRouteRequest<IUnpaidPurchasesRequest> = {
|
|
33
|
-
provider_id: joi.string().uuid().required(),
|
|
34
|
-
client_id: joi.string().uuid().allow(null).required(),
|
|
35
|
-
};
|
|
36
|
-
export const findSettledMaterialEntranceQuery = joi
|
|
37
|
-
.object()
|
|
38
|
-
.keys(findSettledMaterialEntranceQueryKeys)
|
|
39
|
-
.messages(messages);
|
|
40
|
-
|
|
41
|
-
// create provider payment(s)
|
|
42
|
-
const providerPaymentDocumentKeys: IShared.IRouteRequest<IProviderPaymentDocument> = {
|
|
43
|
-
document_header_id: joi.string().uuid().required(),
|
|
44
|
-
value: joi.number().required(),
|
|
45
|
-
discount_value: joi
|
|
46
|
-
.number()
|
|
47
|
-
.optional()
|
|
48
|
-
.allow(0, '', null)
|
|
49
|
-
.when('value', {
|
|
50
|
-
is: joi.number().positive(),
|
|
51
|
-
then: joi.number().max(joi.ref('value')),
|
|
52
|
-
otherwise: joi.number().min(joi.ref('value')),
|
|
53
|
-
}),
|
|
54
|
-
};
|
|
55
|
-
const providerPaymentDocument = joi.object().keys(providerPaymentDocumentKeys).required();
|
|
56
|
-
const providerPaymentBodyKeys: IShared.IRouteRequest<IProviderPaymentRequest> = {
|
|
57
|
-
provider_id: joi.string().uuid().required(),
|
|
58
|
-
client_id: joi.string().uuid().allow(null).optional(),
|
|
59
|
-
documents: joi.array().items(providerPaymentDocument).required(),
|
|
60
|
-
total: joi.number().positive().allow(0).required(),
|
|
61
|
-
};
|
|
62
|
-
export const providerPaymentBody = joi
|
|
63
|
-
.array()
|
|
64
|
-
.items(joi.object().keys(providerPaymentBodyKeys))
|
|
65
|
-
.messages(messages);
|
|
66
|
-
|
|
67
|
-
// create export payments
|
|
68
|
-
const exportPaymentsBodyKeys: IShared.IRouteRequest<IExportPaymentsRequest> = {
|
|
69
|
-
value: joi.number().positive().required(),
|
|
70
|
-
provider: joi.string().required(),
|
|
71
|
-
npf_ids: joi.array().items(joi.string().uuid().required()).optional(),
|
|
72
|
-
};
|
|
73
|
-
export const exportPaymentsBody = joi
|
|
74
|
-
.array()
|
|
75
|
-
.items(joi.object().keys(exportPaymentsBodyKeys))
|
|
76
|
-
.messages(messages);
|
|
77
|
-
|
|
78
|
-
// create export payments
|
|
79
|
-
const exportCurrentAccountBetweenDatesQueryKeys: IShared.IRouteRequest<IExportCurrentAccountRequest> =
|
|
80
|
-
{
|
|
81
|
-
owner_id: joi.string().required(),
|
|
82
|
-
output: joi
|
|
83
|
-
.string()
|
|
84
|
-
.valid(...IExportCurrentAccountOutputOptions)
|
|
85
|
-
.required(),
|
|
86
|
-
start_date: joi.string().optional(),
|
|
87
|
-
end_date: joi.string().optional(),
|
|
88
|
-
token: joi.string().required(),
|
|
89
|
-
};
|
|
90
|
-
export const exportCurrentAccountBetweenDatesQuery = joi
|
|
91
|
-
.object()
|
|
92
|
-
.keys(exportCurrentAccountBetweenDatesQueryKeys)
|
|
93
|
-
.messages(messages);
|
|
94
|
-
|
|
95
|
-
// find by date
|
|
96
|
-
const findSettledMaterialEntranceBuDateParamsKeys: IShared.IRouteRequest<IUnpaidByDatePurchasesRequest> =
|
|
97
|
-
{
|
|
98
|
-
due_date: joi.string().optional(),
|
|
99
|
-
};
|
|
100
|
-
export const findSettledMaterialEntranceBuDateParams = joi
|
|
101
|
-
.object()
|
|
102
|
-
.keys(findSettledMaterialEntranceBuDateParamsKeys)
|
|
103
|
-
.messages(messages);
|
|
104
|
-
|
|
105
|
-
export const findPaymentsNotExportedQuery = joi
|
|
106
|
-
.object<IPaymentsNotExportedRequest>()
|
|
107
|
-
.keys({
|
|
108
|
-
whiteList: joi.array().items(joi.string().uuid().required()).optional(),
|
|
109
|
-
})
|
|
110
|
-
.messages(messages);
|
|
111
|
-
|
|
112
|
-
// find with pagination query validation
|
|
113
|
-
const findCurrentAccountWithPaginationQueryKeys: IShared.IRouteRequest<IFindCurrentAccountPaginatedRequest> =
|
|
114
|
-
{
|
|
115
|
-
owner_id: joi.string().uuid().required(),
|
|
116
|
-
per_page: joi.number().integer().positive().default(10).optional(),
|
|
117
|
-
current_page: joi.number().integer().positive().default(1).optional(),
|
|
118
|
-
};
|
|
119
|
-
export const findCurrentAccountWithPaginationQuery = joi
|
|
120
|
-
.object()
|
|
121
|
-
.keys(findCurrentAccountWithPaginationQueryKeys)
|
|
122
|
-
.messages(messages);
|