@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,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
|
-
provider_id: joi.string().uuid().required(),
|
|
9
|
-
quantity: joi.string().required(),
|
|
10
|
-
type: joi.string().required().valid('Até', 'Entre', 'A Partir de'),
|
|
11
|
-
value: joi.string().required(),
|
|
12
|
-
unit: joi.string().required(),
|
|
13
|
-
};
|
|
14
|
-
export const createBody = joi.object().keys(createBodyKeys).messages(messages);
|
|
15
|
-
|
|
16
|
-
// update body validation
|
|
17
|
-
const updateBodyKeys: IShared.IRouteRequest<IUpdateRequest> = {
|
|
18
|
-
quantity: joi.string().optional(),
|
|
19
|
-
type: joi.string().valid('Até', 'Entre', 'A Partir de').optional(),
|
|
20
|
-
value: joi.string().optional(),
|
|
21
|
-
unit: joi.string().optional(),
|
|
22
|
-
};
|
|
23
|
-
export const updateBody = joi.object().keys(updateBodyKeys).messages(messages);
|
|
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,42 +0,0 @@
|
|
|
1
|
-
import type * as IShared from '../../../shared/interface';
|
|
2
|
-
import type { StoreOperator, Users, Persona } from '../../../shared/entities/user';
|
|
3
|
-
|
|
4
|
-
export type Entity = StoreOperator;
|
|
5
|
-
export const Route = 'store_operator';
|
|
6
|
-
export const UpperName = 'StoreOperator';
|
|
7
|
-
export const LowerName = UpperName[0].toLowerCase() + UpperName.substring(1);
|
|
8
|
-
|
|
9
|
-
export type IFindPaginatedRequest = IShared.IPaginationRequest & Pick<Entity, 'inactive'>;
|
|
10
|
-
|
|
11
|
-
export interface IFindResponse extends Pick<Entity, 'id' | 'number' | 'inactive'> {
|
|
12
|
-
user: Pick<Users, 'id' | 'account'>;
|
|
13
|
-
main_persona: Pick<Persona, 'id' | 'name' | 'email'>;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface ICreateRequest {
|
|
17
|
-
main_persona_name: string;
|
|
18
|
-
main_persona_email: string | null;
|
|
19
|
-
user_account: string | null;
|
|
20
|
-
password: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface IUpdateRequest {
|
|
24
|
-
main_persona_name: string | null;
|
|
25
|
-
main_persona_email: string | null;
|
|
26
|
-
user_account: string | null;
|
|
27
|
-
password: string | null;
|
|
28
|
-
inactive: boolean;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface IRepository {
|
|
32
|
-
findMinified(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
|
|
33
|
-
find(): Promise<IFindResponse[]>;
|
|
34
|
-
findPaginated(
|
|
35
|
-
selector: IFindPaginatedRequest,
|
|
36
|
-
): Promise<IShared.IPaginationResponse<IFindResponse>>;
|
|
37
|
-
create(data: ICreateRequest): Promise<string>;
|
|
38
|
-
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>;
|
|
39
|
-
deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import joi from 'joi';
|
|
2
|
-
import { messages } from '../../../shared/messages';
|
|
3
|
-
import type * as IShared from '../../../shared/interface';
|
|
4
|
-
import type { ICreateRequest, IUpdateRequest, IFindPaginatedRequest } from './interface';
|
|
5
|
-
|
|
6
|
-
// create body validation
|
|
7
|
-
const createBodyKeys: IShared.IRouteRequest<ICreateRequest> = {
|
|
8
|
-
main_persona_name: joi.string().required(),
|
|
9
|
-
main_persona_email: joi
|
|
10
|
-
.string()
|
|
11
|
-
.email({ tlds: { allow: false } })
|
|
12
|
-
.allow(null, '')
|
|
13
|
-
.optional(),
|
|
14
|
-
user_account: joi.string().allow(null, '').optional(),
|
|
15
|
-
password: joi.string().required(),
|
|
16
|
-
};
|
|
17
|
-
export const createBody = joi.object().keys(createBodyKeys).messages(messages);
|
|
18
|
-
|
|
19
|
-
// update store operator query validation
|
|
20
|
-
const updateStoreOperatorQueryKeys: IShared.IRouteRequest<IUpdateRequest> = {
|
|
21
|
-
main_persona_name: joi.string().allow(null, '').optional(),
|
|
22
|
-
main_persona_email: joi
|
|
23
|
-
.string()
|
|
24
|
-
.email({ tlds: { allow: false } })
|
|
25
|
-
.allow(null, '')
|
|
26
|
-
.optional(),
|
|
27
|
-
user_account: joi.string().allow(null, '').optional(),
|
|
28
|
-
password: joi.string().allow(null, '').optional(),
|
|
29
|
-
inactive: joi.boolean().optional(),
|
|
30
|
-
};
|
|
31
|
-
export const updateStoreOperatorQuery = joi
|
|
32
|
-
.object()
|
|
33
|
-
.keys(updateStoreOperatorQueryKeys)
|
|
34
|
-
.messages(messages);
|
|
35
|
-
|
|
36
|
-
// find with pagination query validation
|
|
37
|
-
const findWithPaginationQueryKeys: IShared.IRouteRequest<IFindPaginatedRequest> = {
|
|
38
|
-
inactive: joi.bool().optional(),
|
|
39
|
-
per_page: joi.number().integer().positive().default(10).optional(),
|
|
40
|
-
current_page: joi.number().integer().positive().default(1).optional(),
|
|
41
|
-
};
|
|
42
|
-
export const findWithPaginationQuery = joi
|
|
43
|
-
.object()
|
|
44
|
-
.keys(findWithPaginationQueryKeys)
|
|
45
|
-
.messages(messages);
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import * as IShared from '../../../shared/interface';
|
|
2
|
-
import { Swift } from '../../../shared/entities/user';
|
|
3
|
-
|
|
4
|
-
export type Entity = Swift;
|
|
5
|
-
export const Route = 'swift';
|
|
6
|
-
export const UpperName = 'Swift';
|
|
7
|
-
export const LowerName = UpperName[0].toLowerCase() + UpperName.substring(1);
|
|
8
|
-
|
|
9
|
-
type IFindDetailedResponse = Entity;
|
|
10
|
-
|
|
11
|
-
// omit any unnecessary fields
|
|
12
|
-
export type IFindByIdResponse = Omit<IFindDetailedResponse, ''>;
|
|
13
|
-
|
|
14
|
-
export type IFindRequest = Record<string, unknown>;
|
|
15
|
-
|
|
16
|
-
// omit any unnecessary fields
|
|
17
|
-
export type IFindResponse = Omit<IFindDetailedResponse, ''>;
|
|
18
|
-
|
|
19
|
-
export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {}
|
|
20
|
-
|
|
21
|
-
export type IFindWithPaginationResponse = IShared.IPaginationResponse<
|
|
22
|
-
Omit<IFindDetailedResponse, ''>
|
|
23
|
-
>;
|
|
24
|
-
|
|
25
|
-
export interface ICreateRequest {
|
|
26
|
-
// create fields
|
|
27
|
-
bank: string;
|
|
28
|
-
city: string;
|
|
29
|
-
branch?: string;
|
|
30
|
-
code: string;
|
|
31
|
-
country_id: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface IUpdateRequest {
|
|
35
|
-
// updatable fields
|
|
36
|
-
bank?: string;
|
|
37
|
-
city?: string;
|
|
38
|
-
branch?: string | null;
|
|
39
|
-
code?: string;
|
|
40
|
-
country_id?: string;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface IRepository {
|
|
44
|
-
findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse | null>;
|
|
45
|
-
|
|
46
|
-
findMinified(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
|
|
47
|
-
find(selector: IFindRequest): Promise<IFindResponse[]>;
|
|
48
|
-
findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
|
|
49
|
-
|
|
50
|
-
create(data: ICreateRequest): Promise<Entity>;
|
|
51
|
-
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
|
|
52
|
-
deleteOne(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
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 { IFindRequest, IFindPaginatedRequest, ICreateRequest, IUpdateRequest } from './interface';
|
|
5
|
-
|
|
6
|
-
// create body validation
|
|
7
|
-
const createBodyKeys: IShared.IRouteRequest<ICreateRequest> = {
|
|
8
|
-
bank: joi.string().required(),
|
|
9
|
-
city: joi.string().required(),
|
|
10
|
-
branch: joi.string().optional().allow(null),
|
|
11
|
-
code: joi.string().required(),
|
|
12
|
-
country_id: joi.string().required(),
|
|
13
|
-
};
|
|
14
|
-
export const createBody = joi.object().keys(createBodyKeys).messages(messages);
|
|
15
|
-
|
|
16
|
-
// update body validation
|
|
17
|
-
const updateBodyKeys: IShared.IRouteRequest<IUpdateRequest> = {
|
|
18
|
-
bank: joi.string().optional(),
|
|
19
|
-
city: joi.string().optional(),
|
|
20
|
-
branch: joi.string().optional().allow(null),
|
|
21
|
-
code: joi.string().optional(),
|
|
22
|
-
country_id: joi.string().optional(),
|
|
23
|
-
};
|
|
24
|
-
export const updateBody = joi.object().keys(updateBodyKeys).messages(messages);
|
|
25
|
-
const findQueryKeys: IShared.IRouteRequest<IFindRequest> = {};
|
|
26
|
-
export const findQuery = joi.object().keys(findQueryKeys).messages(messages);
|
|
27
|
-
|
|
28
|
-
// find with pagination query validation
|
|
29
|
-
const findWithPaginationQueryKeys: IShared.IRouteRequest<IFindPaginatedRequest> = {
|
|
30
|
-
per_page: joi.number().integer().positive().default(10).optional(),
|
|
31
|
-
current_page: joi.number().integer().positive().default(1).optional(),
|
|
32
|
-
};
|
|
33
|
-
export const findWithPaginationQuery = joi
|
|
34
|
-
.object()
|
|
35
|
-
.keys(findWithPaginationQueryKeys)
|
|
36
|
-
.messages(messages);
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import * as IShared from '../../../shared/interface';
|
|
2
|
-
import { Tenant } from '../../../shared/entities/user';
|
|
3
|
-
|
|
4
|
-
export type Entity = Tenant;
|
|
5
|
-
export const Route = 'tenant';
|
|
6
|
-
export const UpperName = 'Tenant';
|
|
7
|
-
export const LowerName = UpperName[0].toLowerCase() + UpperName.substring(1);
|
|
8
|
-
|
|
9
|
-
export interface ICreateRequest {
|
|
10
|
-
// create fields
|
|
11
|
-
name: string;
|
|
12
|
-
customer_id: string;
|
|
13
|
-
taxpayer_number: string;
|
|
14
|
-
commercial_registration_number?: number | null;
|
|
15
|
-
share_capital?: number | null;
|
|
16
|
-
conservatory?: string | null;
|
|
17
|
-
logo?: string | null;
|
|
18
|
-
email: string;
|
|
19
|
-
address: string;
|
|
20
|
-
postal_code: string;
|
|
21
|
-
locality: string;
|
|
22
|
-
country: string;
|
|
23
|
-
Timezone?: string | null;
|
|
24
|
-
telephone?: string | null;
|
|
25
|
-
fax?: string | null;
|
|
26
|
-
website?: string | null;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface IUpdateRequest {
|
|
30
|
-
// updatable fields
|
|
31
|
-
name?: string;
|
|
32
|
-
customer_id?: string;
|
|
33
|
-
taxpayer_number?: string;
|
|
34
|
-
commercial_registration_number?: number | null;
|
|
35
|
-
share_capital?: number | null;
|
|
36
|
-
conservatory?: string | null;
|
|
37
|
-
logo?: string | null;
|
|
38
|
-
email?: string;
|
|
39
|
-
address?: string;
|
|
40
|
-
postal_code?: string;
|
|
41
|
-
locality?: string;
|
|
42
|
-
country?: string;
|
|
43
|
-
Timezone?: string | null;
|
|
44
|
-
telephone?: string | null;
|
|
45
|
-
fax?: string | null;
|
|
46
|
-
website?: string | null;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface IRepository {
|
|
50
|
-
find(): Promise<Entity[]>;
|
|
51
|
-
|
|
52
|
-
findById(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
|
|
53
|
-
|
|
54
|
-
create(data: ICreateRequest): Promise<Entity>;
|
|
55
|
-
|
|
56
|
-
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -1,46 +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 './interface';
|
|
5
|
-
|
|
6
|
-
// create body validation
|
|
7
|
-
const createBodyKeys: IShared.IRouteRequest<ICreateRequest> = {
|
|
8
|
-
customer_id: joi.string().required(),
|
|
9
|
-
name: joi.string().required(),
|
|
10
|
-
taxpayer_number: joi.string().required(),
|
|
11
|
-
commercial_registration_number: joi.number().greater(0),
|
|
12
|
-
share_capital: joi.number().greater(0),
|
|
13
|
-
conservatory: joi.string(),
|
|
14
|
-
logo: joi.string(),
|
|
15
|
-
email: joi.string().trim(true).lowercase().required(),
|
|
16
|
-
address: joi.string().required(),
|
|
17
|
-
postal_code: joi.string().trim(true).lowercase().required(),
|
|
18
|
-
locality: joi.string().required(),
|
|
19
|
-
country: joi.string().required(),
|
|
20
|
-
Timezone: joi.string(),
|
|
21
|
-
telephone: joi.string(),
|
|
22
|
-
fax: joi.string(),
|
|
23
|
-
website: joi.string(),
|
|
24
|
-
};
|
|
25
|
-
export const createBody = joi.object().keys(createBodyKeys).messages(messages);
|
|
26
|
-
|
|
27
|
-
// update body validation
|
|
28
|
-
const updateBodyKeys: IShared.IRouteRequest<IUpdateRequest> = {
|
|
29
|
-
customer_id: joi.string(),
|
|
30
|
-
name: joi.string(),
|
|
31
|
-
taxpayer_number: joi.string(),
|
|
32
|
-
commercial_registration_number: joi.number().greater(0),
|
|
33
|
-
share_capital: joi.number().greater(0),
|
|
34
|
-
conservatory: joi.string(),
|
|
35
|
-
logo: joi.string(),
|
|
36
|
-
email: joi.string().trim(true).lowercase(),
|
|
37
|
-
address: joi.string(),
|
|
38
|
-
postal_code: joi.string().trim(true).lowercase(),
|
|
39
|
-
locality: joi.string(),
|
|
40
|
-
country: joi.string(),
|
|
41
|
-
Timezone: joi.string(),
|
|
42
|
-
telephone: joi.string(),
|
|
43
|
-
fax: joi.string(),
|
|
44
|
-
website: joi.string(),
|
|
45
|
-
};
|
|
46
|
-
export const updateBody = joi.object().keys(updateBodyKeys).messages(messages);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as IShared from '../../../shared/interface';
|
|
2
|
-
import { Theme } from '../../../shared/entities/user';
|
|
3
|
-
|
|
4
|
-
export type Entity = Theme;
|
|
5
|
-
export const Route = 'theme';
|
|
6
|
-
export const UpperName = 'Theme';
|
|
7
|
-
export const LowerName = UpperName[0].toLowerCase() + UpperName.substring(1);
|
|
8
|
-
|
|
9
|
-
export interface ISessionStorageColor {
|
|
10
|
-
name: string;
|
|
11
|
-
hex: string;
|
|
12
|
-
}
|
|
13
|
-
export interface ICreateOrUpdateRequest {
|
|
14
|
-
colors: ISessionStorageColor[];
|
|
15
|
-
store_operator_id: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface IRepository {
|
|
19
|
-
createOrUpdate(data: ICreateOrUpdateRequest): Promise<void>;
|
|
20
|
-
}
|
|
21
|
-
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import joi from 'joi';
|
|
2
|
-
import { messages } from '../../../shared/messages';
|
|
3
|
-
import * as IShared from '../../../shared/interface';
|
|
4
|
-
import { ICreateOrUpdateRequest } from './interfaces';
|
|
5
|
-
|
|
6
|
-
const createOrUpdateBodyKeys: IShared.IRouteRequest<ICreateOrUpdateRequest> = {
|
|
7
|
-
colors: joi
|
|
8
|
-
.array()
|
|
9
|
-
.items(
|
|
10
|
-
joi.object({
|
|
11
|
-
name: joi.string().required(),
|
|
12
|
-
hex: joi.string().required(),
|
|
13
|
-
}),
|
|
14
|
-
)
|
|
15
|
-
.required(),
|
|
16
|
-
store_operator_id: joi.string().uuid().required(),
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const createOrUpdateBody = joi.object().keys(createOrUpdateBodyKeys).messages(messages);
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as IShared from '../../../shared/interface';
|
|
2
|
-
import { UserPermissions, GroupPermissions, Permissions } from '../../../shared/entities/user';
|
|
3
|
-
|
|
4
|
-
export type Entity = UserPermissions;
|
|
5
|
-
export const Route = 'user_permissions';
|
|
6
|
-
export const UpperName = 'UserPermissions';
|
|
7
|
-
export const LowerName = UpperName[0].toLowerCase() + UpperName.substring(1);
|
|
8
|
-
|
|
9
|
-
interface IFindDetailedResponse extends Entity {
|
|
10
|
-
group_permission: GroupPermissions;
|
|
11
|
-
permission: Permissions;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export type IFindByOwnerIdResponse = Omit<IFindDetailedResponse, ''>;
|
|
15
|
-
|
|
16
|
-
export interface ICreateRequest {
|
|
17
|
-
user_id: string;
|
|
18
|
-
permission_id: number;
|
|
19
|
-
group_id: number;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface IRepository {
|
|
23
|
-
findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
|
|
24
|
-
create(data: ICreateRequest): Promise<IFindByOwnerIdResponse>;
|
|
25
|
-
deleteOne(selector: IShared.IFindByIdNumberRequest): Promise<IFindByOwnerIdResponse | null>;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import joi from 'joi';
|
|
2
|
-
import { messages } from '../../../shared/messages';
|
|
3
|
-
import * as IShared from '../../../shared/interface';
|
|
4
|
-
import { ICreateRequest } from './interface';
|
|
5
|
-
|
|
6
|
-
// create body validation
|
|
7
|
-
const createBodyKeys: IShared.IRouteRequest<ICreateRequest> = {
|
|
8
|
-
group_id: joi.number().positive().required(),
|
|
9
|
-
permission_id: joi.number().positive().required(),
|
|
10
|
-
user_id: joi.string().uuid().required(),
|
|
11
|
-
};
|
|
12
|
-
export const createBody = joi.object().keys(createBodyKeys).messages(messages);
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import * as IShared from '../../../shared/interface';
|
|
2
|
-
import { UserPositions } from '../../../shared/entities/user';
|
|
3
|
-
|
|
4
|
-
export type Entity = UserPositions;
|
|
5
|
-
export const Route = 'user_positions';
|
|
6
|
-
export const UpperName = 'UserPositions';
|
|
7
|
-
export const LowerName = UpperName[0].toLowerCase() + UpperName.substring(1);
|
|
8
|
-
|
|
9
|
-
type IFindDetailedResponse = Entity;
|
|
10
|
-
|
|
11
|
-
// omit any unnecessary fields
|
|
12
|
-
export type IFindByIdResponse = Omit<IFindDetailedResponse, ''>;
|
|
13
|
-
|
|
14
|
-
export type IFindRequest = Record<string, unknown>;
|
|
15
|
-
|
|
16
|
-
// omit any unnecessary fields
|
|
17
|
-
export type IFindResponse = Omit<IFindDetailedResponse, ''>;
|
|
18
|
-
|
|
19
|
-
export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {}
|
|
20
|
-
|
|
21
|
-
export type IFindWithPaginationResponse = IShared.IPaginationResponse<
|
|
22
|
-
Omit<IFindDetailedResponse, ''>
|
|
23
|
-
>;
|
|
24
|
-
|
|
25
|
-
export interface ICreateRequest {
|
|
26
|
-
// create fields
|
|
27
|
-
name: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface IUpdateRequest {
|
|
31
|
-
// updatable fields
|
|
32
|
-
name?: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface IRepository {
|
|
36
|
-
findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse | null>;
|
|
37
|
-
|
|
38
|
-
findMinified(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
|
|
39
|
-
find(selector: IFindRequest): Promise<IFindResponse[]>;
|
|
40
|
-
findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
|
|
41
|
-
|
|
42
|
-
create(data: ICreateRequest): Promise<Entity>;
|
|
43
|
-
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
|
|
44
|
-
deleteOne(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -1,29 +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
|
-
name: joi.string().required(),
|
|
9
|
-
};
|
|
10
|
-
export const createBody = joi.object().keys(createBodyKeys).messages(messages);
|
|
11
|
-
|
|
12
|
-
// update body validation
|
|
13
|
-
const updateBodyKeys: IShared.IRouteRequest<IUpdateRequest> = {
|
|
14
|
-
name: joi.string().required(),
|
|
15
|
-
};
|
|
16
|
-
export const updateBody = joi.object().keys(updateBodyKeys).messages(messages);
|
|
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);
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import * as IShared from '../../../shared/interface';
|
|
2
|
-
import { UserTokens } from '../../../shared/entities/user';
|
|
3
|
-
|
|
4
|
-
export type Entity = UserTokens;
|
|
5
|
-
export const Route = 'user_token';
|
|
6
|
-
export const UpperName = 'UserTokens';
|
|
7
|
-
export const LowerName = UpperName[0].toLowerCase() + UpperName.substring(1);
|
|
8
|
-
|
|
9
|
-
export type IFindRequest = Record<string, unknown>;
|
|
10
|
-
|
|
11
|
-
export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {}
|
|
12
|
-
|
|
13
|
-
export type IFindWithPaginationResponse = IShared.IPaginationResponse<UserTokens>;
|
|
14
|
-
|
|
15
|
-
export interface ICreateRequest {
|
|
16
|
-
// create fields
|
|
17
|
-
user_id: string;
|
|
18
|
-
expires_date: Date;
|
|
19
|
-
refresh_token: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface IUpdateRequest {
|
|
23
|
-
consumed?: boolean;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface IRepository {
|
|
27
|
-
findById(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
|
|
28
|
-
findByToken(id: string): Promise<Entity | null>;
|
|
29
|
-
|
|
30
|
-
findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<Entity[]>;
|
|
31
|
-
find(selector: IFindRequest): Promise<Entity[]>;
|
|
32
|
-
findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
|
|
33
|
-
|
|
34
|
-
generate(user_id: string): Promise<Entity>;
|
|
35
|
-
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
|
|
36
|
-
deleteOne(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export type IApi = Omit<IRepository, 'generate' | 'findByToken' | 'update'>;
|
|
40
|
-
|
|
41
|
-
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import joi from 'joi';
|
|
2
|
-
import { messages } from '../../../shared/messages';
|
|
3
|
-
import * as IShared from '../../../shared/interface';
|
|
4
|
-
import { IFindRequest, IFindPaginatedRequest } from './interface';
|
|
5
|
-
|
|
6
|
-
const findQueryKeys: IShared.IRouteRequest<IFindRequest> = {};
|
|
7
|
-
export const findQuery = joi.object().keys(findQueryKeys).messages(messages);
|
|
8
|
-
|
|
9
|
-
// find with pagination query validation
|
|
10
|
-
const findWithPaginationQueryKeys: IShared.IRouteRequest<IFindPaginatedRequest> = {
|
|
11
|
-
per_page: joi.number().integer().positive().default(10).optional(),
|
|
12
|
-
current_page: joi.number().integer().positive().default(1).optional(),
|
|
13
|
-
};
|
|
14
|
-
export const findWithPaginationQuery = joi
|
|
15
|
-
.object()
|
|
16
|
-
.keys(findWithPaginationQueryKeys)
|
|
17
|
-
.messages(messages);
|