@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,62 +0,0 @@
|
|
|
1
|
-
import * as IShared from '../../../shared/interface';
|
|
2
|
-
import { PromotionAssoc, Promotion, Location } from '../../../shared/entities/stock';
|
|
3
|
-
|
|
4
|
-
export type Entity = PromotionAssoc;
|
|
5
|
-
export const Route = 'promotion_assoc';
|
|
6
|
-
export const UpperName = 'PromotionAssoc';
|
|
7
|
-
export const LowerName = UpperName[0].toLowerCase() + UpperName.substring(1);
|
|
8
|
-
|
|
9
|
-
interface IFindDetailedResponse extends Entity {
|
|
10
|
-
location: Location | null;
|
|
11
|
-
promotion: Promotion;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// omit any unnecessary fields
|
|
15
|
-
export type IFindByIdResponse = Omit<IFindDetailedResponse, 'location' | 'promotion'>;
|
|
16
|
-
|
|
17
|
-
// omit any unnecessary fields
|
|
18
|
-
export type IFindByOwnerIdResponse = Omit<IFindDetailedResponse, ''>;
|
|
19
|
-
|
|
20
|
-
export type IFindRequest = Record<string, unknown>;
|
|
21
|
-
|
|
22
|
-
// omit any unnecessary fields
|
|
23
|
-
export type IFindResponse = Omit<IFindDetailedResponse, 'location' | 'promotion'>;
|
|
24
|
-
|
|
25
|
-
export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {}
|
|
26
|
-
|
|
27
|
-
export type IFindWithPaginationResponse = IShared.IPaginationResponse<
|
|
28
|
-
Omit<IFindDetailedResponse, 'location' | 'promotion'>
|
|
29
|
-
>;
|
|
30
|
-
|
|
31
|
-
export interface ICreateRequest {
|
|
32
|
-
// create fields
|
|
33
|
-
client_id: string;
|
|
34
|
-
location_id: string;
|
|
35
|
-
product_id: string;
|
|
36
|
-
promotion_id: string;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface IUpdateRequest {
|
|
40
|
-
// updatable fields
|
|
41
|
-
client_id?: string;
|
|
42
|
-
location_id?: string;
|
|
43
|
-
product_id?: string;
|
|
44
|
-
promotion_id?: string;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface IRepository {
|
|
48
|
-
findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse | null>;
|
|
49
|
-
|
|
50
|
-
findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
|
|
51
|
-
find(selector: IFindRequest): Promise<IFindResponse[]>;
|
|
52
|
-
findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
|
|
53
|
-
|
|
54
|
-
create(data: ICreateRequest): Promise<IFindByOwnerIdResponse>;
|
|
55
|
-
update(
|
|
56
|
-
selector: IShared.IFindByIdRequest,
|
|
57
|
-
data: IUpdateRequest,
|
|
58
|
-
): Promise<IFindByOwnerIdResponse | null>;
|
|
59
|
-
deleteOne(selector: IShared.IFindByIdRequest): Promise<IFindByOwnerIdResponse | null>;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import joi from 'joi';
|
|
2
|
-
import { messages } from '../../../shared/messages';
|
|
3
|
-
import * as IShared from '../../../shared/interface';
|
|
4
|
-
import { IFindRequest, IFindPaginatedRequest, ICreateRequest, IUpdateRequest } from './interface';
|
|
5
|
-
|
|
6
|
-
// create body validation
|
|
7
|
-
const createBodyKeys: IShared.IRouteRequest<ICreateRequest> = {
|
|
8
|
-
promotion_id: joi.string().uuid().required(),
|
|
9
|
-
product_id: joi.string().uuid().optional().allow(null),
|
|
10
|
-
client_id: joi.string().uuid().optional().allow(null),
|
|
11
|
-
location_id: joi.string().uuid().optional().allow(null),
|
|
12
|
-
};
|
|
13
|
-
export const createBody = joi.object().keys(createBodyKeys).messages(messages);
|
|
14
|
-
|
|
15
|
-
// update body validation
|
|
16
|
-
const updateBodyKeys: IShared.IRouteRequest<IUpdateRequest> = {
|
|
17
|
-
promotion_id: joi.string().uuid().optional(),
|
|
18
|
-
client_id: joi.string().uuid().optional().allow(null),
|
|
19
|
-
location_id: joi.string().uuid().optional().allow(null),
|
|
20
|
-
product_id: joi.string().uuid().optional().allow(null),
|
|
21
|
-
};
|
|
22
|
-
export const updateBody = joi.object().keys(updateBodyKeys).messages(messages);
|
|
23
|
-
|
|
24
|
-
const findQueryKeys: IShared.IRouteRequest<IFindRequest> = {};
|
|
25
|
-
export const findQuery = joi.object().keys(findQueryKeys).messages(messages);
|
|
26
|
-
|
|
27
|
-
// find with pagination query validation
|
|
28
|
-
const findWithPaginationQueryKeys: IShared.IRouteRequest<IFindPaginatedRequest> = {
|
|
29
|
-
per_page: joi.number().integer().positive().default(10).optional(),
|
|
30
|
-
current_page: joi.number().integer().positive().default(1).optional(),
|
|
31
|
-
};
|
|
32
|
-
export const findWithPaginationQuery = joi
|
|
33
|
-
.object()
|
|
34
|
-
.keys(findWithPaginationQueryKeys)
|
|
35
|
-
.messages(messages);
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import * as IShared from '../../../shared/interface';
|
|
2
|
-
import { QueryList, QueryParameter } from '../../../shared/entities/stock';
|
|
3
|
-
|
|
4
|
-
export type Entity = QueryList;
|
|
5
|
-
export const Route = 'query';
|
|
6
|
-
export const UpperName = 'QueryList';
|
|
7
|
-
export const LowerName = UpperName[0].toLowerCase() + UpperName.substring(1);
|
|
8
|
-
|
|
9
|
-
export interface ICreateRequest {
|
|
10
|
-
label: string;
|
|
11
|
-
code: string;
|
|
12
|
-
group: string | null;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface IUpdateRequest {
|
|
16
|
-
label?: string;
|
|
17
|
-
code?: string;
|
|
18
|
-
group?: string | null;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface IFindResponse extends QueryList {
|
|
22
|
-
parameters: QueryParameter[];
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export const executeOutput = ['csv', 'pdf', 'xlsx', 'json'] as const;
|
|
26
|
-
|
|
27
|
-
export type IExecuteOutput = (typeof executeOutput)[number];
|
|
28
|
-
|
|
29
|
-
type IParameterDataType = string | Date | number | boolean | null | undefined;
|
|
30
|
-
|
|
31
|
-
export type IExecuteInputParameters = Record<string, IParameterDataType>;
|
|
32
|
-
|
|
33
|
-
export interface IExecuteRequest extends IExecuteInputParameters {
|
|
34
|
-
query_id: string;
|
|
35
|
-
output: IExecuteOutput;
|
|
36
|
-
token?: string;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface IExecuteResponse extends IFindResponse {
|
|
40
|
-
outputParameters: QueryParameter[];
|
|
41
|
-
data: IParameterDataType[][];
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface IRepository {
|
|
45
|
-
find(): Promise<IFindResponse[]>;
|
|
46
|
-
findById(selector: IShared.IFindByIdRequest): Promise<IFindResponse | null>;
|
|
47
|
-
create(data: ICreateRequest): Promise<IFindResponse>;
|
|
48
|
-
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<IFindResponse | null>;
|
|
49
|
-
deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export type IApi = Omit<IRepository, 'execute'> & {
|
|
53
|
-
execute(data: IExecuteRequest): Promise<IExecuteResponse>;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import joi from 'joi';
|
|
2
|
-
import { messages } from '../../../shared/messages';
|
|
3
|
-
import * as IShared from '../../../shared/interface';
|
|
4
|
-
import { ICreateRequest, IUpdateRequest, IExecuteRequest, executeOutput } from './interfaces';
|
|
5
|
-
|
|
6
|
-
// create body validation
|
|
7
|
-
const createBodyKeys: IShared.IRouteRequest<ICreateRequest> = {
|
|
8
|
-
code: joi.string().required(),
|
|
9
|
-
label: joi.string().required(),
|
|
10
|
-
group: joi.string().allow(null).required(),
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const createBody = joi.object().keys(createBodyKeys).messages(messages);
|
|
14
|
-
|
|
15
|
-
// update body validation
|
|
16
|
-
const updateBodyKeys: IShared.IRouteRequest<IUpdateRequest> = {
|
|
17
|
-
code: joi.string().optional(),
|
|
18
|
-
label: joi.string().optional(),
|
|
19
|
-
group: joi.string().allow(null).optional(),
|
|
20
|
-
};
|
|
21
|
-
export const updateBody = joi.object().keys(updateBodyKeys).messages(messages);
|
|
22
|
-
|
|
23
|
-
export const executeBodyKeys: IShared.IRouteRequest<IExecuteRequest> = {
|
|
24
|
-
output: joi
|
|
25
|
-
.string()
|
|
26
|
-
.valid(...executeOutput)
|
|
27
|
-
.required(),
|
|
28
|
-
query_id: joi.string().uuid().required(),
|
|
29
|
-
token: joi.string().optional(),
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const executeBody = joi
|
|
33
|
-
.object()
|
|
34
|
-
.keys(executeBodyKeys)
|
|
35
|
-
.pattern(joi.string(), joi.any())
|
|
36
|
-
.optional()
|
|
37
|
-
.messages(messages);
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import * as IShared from '../../../shared/interface';
|
|
2
|
-
import { QueryParameter } from '../../../shared/entities/stock';
|
|
3
|
-
|
|
4
|
-
export type Entity = QueryParameter;
|
|
5
|
-
export const Route = 'query_parameter';
|
|
6
|
-
export const UpperName = 'QueryParameter';
|
|
7
|
-
export const LowerName = UpperName[0].toLowerCase() + UpperName.substring(1);
|
|
8
|
-
|
|
9
|
-
export const QueryParameterDatatypeEnum: {
|
|
10
|
-
boolean: 'boolean';
|
|
11
|
-
decimal: 'decimal';
|
|
12
|
-
integer: 'integer';
|
|
13
|
-
text: 'text';
|
|
14
|
-
date: 'date';
|
|
15
|
-
month: 'month';
|
|
16
|
-
idnr: 'idnr';
|
|
17
|
-
link: 'link';
|
|
18
|
-
user: 'user';
|
|
19
|
-
hidden: 'hidden';
|
|
20
|
-
} = {
|
|
21
|
-
boolean: 'boolean',
|
|
22
|
-
decimal: 'decimal',
|
|
23
|
-
integer: 'integer',
|
|
24
|
-
text: 'text',
|
|
25
|
-
date: 'date',
|
|
26
|
-
month: 'month',
|
|
27
|
-
idnr: 'idnr',
|
|
28
|
-
link: 'link',
|
|
29
|
-
user: 'user',
|
|
30
|
-
hidden: 'hidden',
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export type IQueryParameterDatatype =
|
|
34
|
-
(typeof QueryParameterDatatypeEnum)[keyof typeof QueryParameterDatatypeEnum];
|
|
35
|
-
|
|
36
|
-
export const queryParametersDatatypes = Object.keys(QueryParameterDatatypeEnum);
|
|
37
|
-
|
|
38
|
-
export interface ICreateRequest {
|
|
39
|
-
label: string;
|
|
40
|
-
accessor: string;
|
|
41
|
-
datatype: IQueryParameterDatatype;
|
|
42
|
-
suffix: string | null;
|
|
43
|
-
preffix: string | null;
|
|
44
|
-
input: boolean;
|
|
45
|
-
width: number | null;
|
|
46
|
-
output: boolean;
|
|
47
|
-
query_id: string;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export interface IUpdateRequest {
|
|
51
|
-
label?: string;
|
|
52
|
-
accessor?: string;
|
|
53
|
-
width?: number;
|
|
54
|
-
datatype?: IQueryParameterDatatype;
|
|
55
|
-
suffix?: string | null;
|
|
56
|
-
preffix?: string | null;
|
|
57
|
-
input?: boolean;
|
|
58
|
-
output?: boolean;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export type IFindByOwnerIdResponse = Entity;
|
|
62
|
-
|
|
63
|
-
export interface IRepository {
|
|
64
|
-
find(): Promise<Entity[]>;
|
|
65
|
-
findById(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
|
|
66
|
-
create(data: ICreateRequest): Promise<Entity>;
|
|
67
|
-
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
|
|
68
|
-
deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
|
|
69
|
-
findByOwnerId(selector: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import joi from 'joi';
|
|
2
|
-
import { messages } from '../../../shared/messages';
|
|
3
|
-
import * as IShared from '../../../shared/interface';
|
|
4
|
-
import { ICreateRequest, IUpdateRequest } from './interfaces';
|
|
5
|
-
|
|
6
|
-
// create body validation
|
|
7
|
-
const createBodyKeys: IShared.IRouteRequest<ICreateRequest> = {
|
|
8
|
-
label: joi.string().required(),
|
|
9
|
-
accessor: joi.string().required(),
|
|
10
|
-
datatype: joi
|
|
11
|
-
.string()
|
|
12
|
-
.valid(...Object.values(IShared.IDataTypeEnum))
|
|
13
|
-
.required(),
|
|
14
|
-
input: joi.boolean().default(false),
|
|
15
|
-
output: joi.boolean().default(false),
|
|
16
|
-
preffix: joi.string().allow(null).required(),
|
|
17
|
-
suffix: joi.string().allow(null).required(),
|
|
18
|
-
query_id: joi.string().uuid().required(),
|
|
19
|
-
width: joi.number().default(55),
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const createBody = joi.object().keys(createBodyKeys).messages(messages);
|
|
23
|
-
|
|
24
|
-
// update body validation
|
|
25
|
-
const updateBodyKeys: IShared.IRouteRequest<IUpdateRequest> = {
|
|
26
|
-
label: joi.string().optional(),
|
|
27
|
-
accessor: joi.string().optional(),
|
|
28
|
-
datatype: joi.string().valid(...Object.values(IShared.IDataTypeEnum)),
|
|
29
|
-
input: joi.boolean().optional(),
|
|
30
|
-
output: joi.boolean().optional(),
|
|
31
|
-
preffix: joi.string().allow(null).optional(),
|
|
32
|
-
suffix: joi.string().allow(null).optional(),
|
|
33
|
-
width: joi.number().optional(),
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const updateBody = joi.object().keys(updateBodyKeys).messages(messages);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as IShared from '../../../shared/interface';
|
|
2
|
-
|
|
3
|
-
export const Route = 'recurrent_tasks';
|
|
4
|
-
export const UpperName = 'RecurrentTasks';
|
|
5
|
-
export const LowerName = UpperName[0].toLowerCase() + UpperName.substring(1);
|
|
6
|
-
|
|
7
|
-
export interface IRepository {
|
|
8
|
-
from_master(): Promise<string>;
|
|
9
|
-
from_master_checked(): Promise<string>;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as IShared from '../../../shared/interface';
|
|
2
|
-
import { ReturnReason } from '../../../shared/entities/stock';
|
|
3
|
-
|
|
4
|
-
export type Entity = ReturnReason;
|
|
5
|
-
export const Route = 'return_reason';
|
|
6
|
-
export const UpperName = 'ReturnReason';
|
|
7
|
-
export const LowerName = UpperName[0].toLowerCase() + UpperName.substring(1);
|
|
8
|
-
|
|
9
|
-
export interface ICreateRequest {
|
|
10
|
-
reason: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface IUpdateRequest {
|
|
14
|
-
reason: string;
|
|
15
|
-
}
|
|
16
|
-
export interface IRepository {
|
|
17
|
-
create(data: ICreateRequest): Promise<Entity>;
|
|
18
|
-
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
|
|
19
|
-
find(): Promise<Entity[]>;
|
|
20
|
-
deleteOne(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import joi from 'joi';
|
|
2
|
-
import { messages } from '../../../shared/messages';
|
|
3
|
-
import * as IShared from '../../../shared/interface';
|
|
4
|
-
import { ICreateRequest, IUpdateRequest } from './interfaces';
|
|
5
|
-
|
|
6
|
-
const createBodyKeys: IShared.IRouteRequest<ICreateRequest> = {
|
|
7
|
-
reason: joi.string().required(),
|
|
8
|
-
};
|
|
9
|
-
export const createBody = joi.object().keys(createBodyKeys).messages(messages);
|
|
10
|
-
|
|
11
|
-
const updateBodyKeys: IShared.IRouteRequest<IUpdateRequest> = {
|
|
12
|
-
reason: joi.string(),
|
|
13
|
-
};
|
|
14
|
-
export const updateBody = joi.object().keys(updateBodyKeys).messages(messages);
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import * as IShared from '../../../shared/interface';
|
|
2
|
-
import { SavedEmPicking } from '../../../shared/entities/stock';
|
|
3
|
-
import { IUnfinishedPickingLineGroupExtended } from '../../document/materialEntrance/interfaces';
|
|
4
|
-
|
|
5
|
-
export type Entity = SavedEmPicking;
|
|
6
|
-
export const Route = 'saved_em_picking';
|
|
7
|
-
export const UpperName = 'SavedEmPicking';
|
|
8
|
-
export const LowerName = UpperName[0].toLowerCase() + UpperName.substring(1);
|
|
9
|
-
|
|
10
|
-
export type ISavedEmPickingData = Pick<
|
|
11
|
-
IUnfinishedPickingLineGroupExtended,
|
|
12
|
-
'clientOrders' | 'stock' | 'not_ok'
|
|
13
|
-
>;
|
|
14
|
-
|
|
15
|
-
export interface ICreateRequest {
|
|
16
|
-
provider_id: string;
|
|
17
|
-
document_header_id: string;
|
|
18
|
-
document_line_group_id: string;
|
|
19
|
-
data: ISavedEmPickingData;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface ICreateManyRequest {
|
|
23
|
-
items: ICreateRequest[];
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface IDeleteManyRequest {
|
|
27
|
-
ids: string[];
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface IRepository {
|
|
31
|
-
create(data: ICreateRequest): Promise<string>;
|
|
32
|
-
createMany(data: ICreateManyRequest): Promise<string[]>;
|
|
33
|
-
deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
|
|
34
|
-
deleteMany(data: IDeleteManyRequest): Promise<void>;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import joi from 'joi';
|
|
2
|
-
import { messages } from '../../../shared/messages';
|
|
3
|
-
import * as IShared from '../../../shared/interface';
|
|
4
|
-
import {
|
|
5
|
-
ICreateManyRequest,
|
|
6
|
-
ICreateRequest,
|
|
7
|
-
ISavedEmPickingData,
|
|
8
|
-
type IDeleteManyRequest,
|
|
9
|
-
} from './interfaces';
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
IEntradaDeMaterialClientOrder,
|
|
13
|
-
IEntradaDeMaterialNC,
|
|
14
|
-
IEntradaDeMaterialStock,
|
|
15
|
-
createMaterialEntranceClientOrderOptions,
|
|
16
|
-
createMaterialEntranceStockOptions,
|
|
17
|
-
createMaterialEntranceStockWithoutOrderOptions,
|
|
18
|
-
} from '../../document/materialEntrance/interfaces';
|
|
19
|
-
|
|
20
|
-
const entradaDeMaterialClientOrderBodyKeys: IShared.IRouteRequest<IEntradaDeMaterialClientOrder> = {
|
|
21
|
-
ef_dla_id: joi.string().uuid().required(),
|
|
22
|
-
ordered_quantity: joi.number().positive().required(),
|
|
23
|
-
pc_virtual_name: joi.string().required(),
|
|
24
|
-
pc_dh_id: joi.string().uuid().required(),
|
|
25
|
-
pc_dh_number: joi.number().integer().positive().required(),
|
|
26
|
-
pc_dla_id: joi.string().uuid().required(),
|
|
27
|
-
pc_sheet: joi.string().allow(null),
|
|
28
|
-
pc_created_by: joi.string().uuid().required(),
|
|
29
|
-
|
|
30
|
-
document_line_id: joi.string().uuid().required(),
|
|
31
|
-
quantity: joi.number().positive().allow(0).required(),
|
|
32
|
-
option: joi
|
|
33
|
-
.string()
|
|
34
|
-
.valid(...createMaterialEntranceClientOrderOptions)
|
|
35
|
-
.allow(null)
|
|
36
|
-
.required(),
|
|
37
|
-
note: joi.string().allow(null),
|
|
38
|
-
printed: joi.string().allow(null),
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const entradaDeMaterialClientOrderBody = joi
|
|
42
|
-
.object()
|
|
43
|
-
.keys(entradaDeMaterialClientOrderBodyKeys)
|
|
44
|
-
.messages(messages);
|
|
45
|
-
|
|
46
|
-
const entradaDeMaterialStockBodyKeys: IShared.IRouteRequest<IEntradaDeMaterialStock> = {
|
|
47
|
-
ef_dla_id: joi.string().uuid().allow(null).required(),
|
|
48
|
-
ordered_quantity: joi.number().positive().allow(0).required(),
|
|
49
|
-
|
|
50
|
-
document_line_id: joi.string().uuid().allow(null).required(),
|
|
51
|
-
quantity: joi.number().positive().allow(0).required(),
|
|
52
|
-
option: joi
|
|
53
|
-
.string()
|
|
54
|
-
.valid(...createMaterialEntranceStockOptions, ...createMaterialEntranceStockWithoutOrderOptions)
|
|
55
|
-
.allow(null)
|
|
56
|
-
.required(),
|
|
57
|
-
note: joi.string().allow(null),
|
|
58
|
-
printed: joi.string().allow(null),
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const entradaDeMaterialStockBody = joi
|
|
62
|
-
.object()
|
|
63
|
-
.keys(entradaDeMaterialStockBodyKeys)
|
|
64
|
-
.required()
|
|
65
|
-
|
|
66
|
-
.messages(messages);
|
|
67
|
-
|
|
68
|
-
const entradaDeMaterialNCBodyKeys: IShared.IRouteRequest<IEntradaDeMaterialNC> = {
|
|
69
|
-
ef_dla_id: joi.valid(null).required(),
|
|
70
|
-
ordered_quantity: joi.number().valid(0).required(),
|
|
71
|
-
|
|
72
|
-
document_line_id: joi.string().uuid().required(),
|
|
73
|
-
quantity: joi.number().positive().allow(0).required(),
|
|
74
|
-
option: joi.valid(null).required(),
|
|
75
|
-
note: joi.string().allow(null),
|
|
76
|
-
printed: joi.string().allow(null),
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
const entradaDeMaterialNCBody = joi.object().keys(entradaDeMaterialNCBodyKeys).messages(messages);
|
|
80
|
-
|
|
81
|
-
const entradaDeMaterialDocumentHeaderBodyKeys: IShared.IRouteRequest<ISavedEmPickingData> = {
|
|
82
|
-
clientOrders: joi.array().items(entradaDeMaterialClientOrderBody).required(),
|
|
83
|
-
stock: joi.array().items(entradaDeMaterialStockBody).required(),
|
|
84
|
-
not_ok: entradaDeMaterialNCBody,
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const entradaDeMaterialDocumentHeaderBody = joi
|
|
88
|
-
.object()
|
|
89
|
-
.keys(entradaDeMaterialDocumentHeaderBodyKeys)
|
|
90
|
-
.messages(messages);
|
|
91
|
-
|
|
92
|
-
// create body validation
|
|
93
|
-
const createBodyKeys: IShared.IRouteRequest<ICreateRequest> = {
|
|
94
|
-
provider_id: joi.string().uuid().required(),
|
|
95
|
-
document_header_id: joi.string().uuid().required(),
|
|
96
|
-
document_line_group_id: joi.string().uuid().required(),
|
|
97
|
-
data: entradaDeMaterialDocumentHeaderBody,
|
|
98
|
-
};
|
|
99
|
-
export const createBody = joi.object().keys(createBodyKeys).messages(messages);
|
|
100
|
-
|
|
101
|
-
export const createManyBody = joi
|
|
102
|
-
.object<ICreateManyRequest>()
|
|
103
|
-
.keys({
|
|
104
|
-
items: joi.array().items(createBody).required(),
|
|
105
|
-
})
|
|
106
|
-
.messages(messages);
|
|
107
|
-
|
|
108
|
-
export const deleteManyBody = joi
|
|
109
|
-
.object<IDeleteManyRequest>()
|
|
110
|
-
.keys({
|
|
111
|
-
ids: joi.array().items(joi.string().uuid().required()).required(),
|
|
112
|
-
})
|
|
113
|
-
.messages(messages);
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import * as IShared from '../../../shared/interface';
|
|
2
|
-
import { SavedProviderProposal } from '../../../shared/entities/stock';
|
|
3
|
-
|
|
4
|
-
export type Entity = SavedProviderProposal;
|
|
5
|
-
export const Route = 'saved_provider_proposal';
|
|
6
|
-
export const UpperName = 'SavedProviderProposal';
|
|
7
|
-
export const LowerName = UpperName[0].toLowerCase() + UpperName.substring(1);
|
|
8
|
-
|
|
9
|
-
export interface ICreateRequest {
|
|
10
|
-
provider_id: string;
|
|
11
|
-
product_id: string;
|
|
12
|
-
quantity: number;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface IFindManyResponse {
|
|
16
|
-
product_id: string;
|
|
17
|
-
quantity: number;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export type IUpdateRequest = Omit<ICreateRequest, 'provider_id' | 'product_id'>;
|
|
21
|
-
|
|
22
|
-
export interface IRepository {
|
|
23
|
-
findByProviderId(selector: IShared.IFindByIdRequest): Promise<IFindManyResponse[]>;
|
|
24
|
-
|
|
25
|
-
create(data: ICreateRequest): Promise<void>;
|
|
26
|
-
|
|
27
|
-
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>;
|
|
28
|
-
|
|
29
|
-
deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import joi from 'joi';
|
|
2
|
-
import { messages } from '../../../shared/messages';
|
|
3
|
-
import * as IShared from '../../../shared/interface';
|
|
4
|
-
import { ICreateRequest, IUpdateRequest } from './interfaces';
|
|
5
|
-
|
|
6
|
-
const createBodyKeys: IShared.IRouteRequest<ICreateRequest> = {
|
|
7
|
-
provider_id: joi.string().uuid().required(),
|
|
8
|
-
product_id: joi.string().uuid().required(),
|
|
9
|
-
quantity: joi.number().positive().required(),
|
|
10
|
-
};
|
|
11
|
-
export const createBody = joi.object().keys(createBodyKeys).messages(messages);
|
|
12
|
-
|
|
13
|
-
const updateBodyKeys: IShared.IRouteRequest<IUpdateRequest> = {
|
|
14
|
-
quantity: joi.number().positive().required(),
|
|
15
|
-
};
|
|
16
|
-
export const updateBody = joi.object().keys(updateBodyKeys).messages(messages);
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import * as IShared from '../../../shared/interface';
|
|
2
|
-
|
|
3
|
-
export interface IFindByDocumentLineStateRequest {
|
|
4
|
-
document_type_id: 100 | 116;
|
|
5
|
-
document_line_state: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface IFindByDocumentLineStateResponse {
|
|
9
|
-
document_header_id: string;
|
|
10
|
-
document_number: string;
|
|
11
|
-
identifier: string | null;
|
|
12
|
-
created_at: Date;
|
|
13
|
-
created_by: string;
|
|
14
|
-
who_handles: string | null;
|
|
15
|
-
tags: string | null;
|
|
16
|
-
adjudicated: boolean;
|
|
17
|
-
unread: boolean;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface IFindByStateRequest {
|
|
21
|
-
document_type_id: number;
|
|
22
|
-
search_value?: string | null;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface IFindByStateResponse {
|
|
26
|
-
name: string;
|
|
27
|
-
count: number;
|
|
28
|
-
unread: boolean;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface IFindSideMenuCountersResponse {
|
|
32
|
-
counts: Record<string, number>;
|
|
33
|
-
timestamp: string;
|
|
34
|
-
}
|
|
35
|
-
interface IRepository {
|
|
36
|
-
findSideMenuStoreOperators(): Promise<string[]>;
|
|
37
|
-
|
|
38
|
-
findByState(data: IFindByStateRequest): Promise<IFindByStateResponse[]>;
|
|
39
|
-
|
|
40
|
-
findByDocumentLineState(
|
|
41
|
-
params: IFindByDocumentLineStateRequest,
|
|
42
|
-
): Promise<IFindByDocumentLineStateResponse[]>;
|
|
43
|
-
|
|
44
|
-
findSideMenuCounters(): Promise<IFindSideMenuCountersResponse>;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
48
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import joi from 'joi';
|
|
2
|
-
import { messages } from '../../../shared/messages';
|
|
3
|
-
import * as IShared from '../../../shared/interface';
|
|
4
|
-
import { IFindByDocumentLineStateRequest, IFindByStateRequest } from './interface';
|
|
5
|
-
|
|
6
|
-
const findByDocumentLineStateQueryKeys: IShared.IRouteRequest<IFindByDocumentLineStateRequest> = {
|
|
7
|
-
document_type_id: joi.number().valid(100, 116).required(),
|
|
8
|
-
document_line_state: joi.string().required(),
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const findByStateQueryKeys: IShared.IRouteRequest<IFindByStateRequest> = {
|
|
12
|
-
document_type_id: joi.number().integer().positive().required(),
|
|
13
|
-
search_value: joi.string().allow(null).empty('').optional(),
|
|
14
|
-
};
|
|
15
|
-
export const findByStateQuery = joi.object().keys(findByStateQueryKeys).messages(messages);
|
|
16
|
-
|
|
17
|
-
export const findByDocumentLineStateQuery = joi
|
|
18
|
-
.object()
|
|
19
|
-
.keys(findByDocumentLineStateQueryKeys)
|
|
20
|
-
.messages(messages);
|