@nomalism-com/types 1.3.38 → 1.3.40

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.
Files changed (154) hide show
  1. package/dist/index.js +958 -1023
  2. package/dist/main.d.ts +16 -1
  3. package/dist/modules/document/CAT/interfaces.d.ts +12 -0
  4. package/dist/modules/document/CAT/route.schema.d.ts +3 -0
  5. package/dist/modules/document/NRCL/interface.d.ts +1 -3
  6. package/dist/modules/document/billOfLading/interfaces.d.ts +3 -0
  7. package/dist/modules/document/inventario/interface.d.ts +0 -2
  8. package/dist/modules/document/materialEntrance/interfaces.d.ts +11 -6
  9. package/dist/modules/document/order/interfaces.d.ts +5 -2
  10. package/dist/modules/document/order/route.schema.d.ts +1 -0
  11. package/dist/modules/document/productionOrder/interfaces.d.ts +1 -0
  12. package/dist/modules/document/proforma/interfaces.d.ts +1 -0
  13. package/dist/modules/document/propostaFornecedor/interfaces.d.ts +1 -0
  14. package/dist/modules/document/propostaSheets/interface.d.ts +1 -3
  15. package/dist/modules/document/providerCreditNoteFromReturn/interfaces.d.ts +1 -0
  16. package/dist/modules/document/providerFinancialCreditNote/interfaces.d.ts +1 -0
  17. package/dist/modules/document/providerServiceInvoice/interfaces.d.ts +1 -0
  18. package/dist/modules/document/purchase/interfaces.d.ts +0 -2
  19. package/dist/modules/document/quebra/interfaces.d.ts +0 -2
  20. package/dist/modules/document/returnToProvider/interface.d.ts +0 -2
  21. package/dist/modules/document/transformado/interfaces.d.ts +0 -2
  22. package/dist/modules/document/upfrontReturn/interfaces.d.ts +0 -2
  23. package/dist/modules/documentManagement/multimedia/interfaces.d.ts +1 -2
  24. package/dist/modules/integration/emailLog/interfaces.d.ts +0 -2
  25. package/dist/modules/integration/emailTemplate/interfaces.d.ts +0 -2
  26. package/dist/modules/integration/emailTemplateAttachment/interfaces.d.ts +0 -2
  27. package/dist/modules/integration/emailVerification/interfaces.d.ts +0 -2
  28. package/dist/modules/integration/googleFilePermission/interfaces.d.ts +0 -2
  29. package/dist/modules/integration/googleSheets/interfaces.d.ts +0 -2
  30. package/dist/modules/integration/observation/interfaces.d.ts +0 -2
  31. package/dist/modules/integration/observationType/interfaces.d.ts +1 -3
  32. package/dist/modules/integration/patchNotes/interfaces.d.ts +0 -2
  33. package/dist/modules/integration/projectInfo/interfaces.d.ts +0 -2
  34. package/dist/modules/integration/settings/interfaces.d.ts +0 -2
  35. package/dist/modules/llm/llm/interfaces.d.ts +5 -0
  36. package/dist/modules/print/npc/interfaces.d.ts +0 -2
  37. package/dist/modules/print/printer/interfaces.d.ts +0 -2
  38. package/dist/modules/print/schedulePrintJob/interfaces.d.ts +0 -2
  39. package/dist/modules/sms/smsSender/interfaces.d.ts +42 -0
  40. package/dist/modules/sms/smsTemplate/interfaces.d.ts +29 -0
  41. package/dist/modules/sms/smsTemplate/route.schema.d.ts +5 -0
  42. package/dist/modules/stock/accountCode/interface.d.ts +0 -2
  43. package/dist/modules/stock/chat/interfaces.d.ts +0 -2
  44. package/dist/modules/stock/chatRapidMessage/interface.d.ts +1 -3
  45. package/dist/modules/stock/conferirEncomenda/interface.d.ts +2 -3
  46. package/dist/modules/stock/dashboard/interface.d.ts +20 -2
  47. package/dist/modules/stock/dashboard/route.schema.d.ts +1 -0
  48. package/dist/modules/stock/file/interface.d.ts +0 -2
  49. package/dist/modules/stock/gmails/interface.d.ts +0 -2
  50. package/dist/modules/stock/googleCalendar/interface.d.ts +0 -2
  51. package/dist/modules/stock/googleSheetPool/interface.d.ts +0 -2
  52. package/dist/modules/stock/location/interface.d.ts +0 -2
  53. package/dist/modules/stock/mobilePrint/interface.d.ts +13 -0
  54. package/dist/modules/stock/mobilePrint/route.schema.d.ts +2 -0
  55. package/dist/modules/stock/prison/interface.d.ts +0 -2
  56. package/dist/modules/stock/productGoogleSheets/interface.d.ts +7 -4
  57. package/dist/modules/stock/productGoogleSheets/route.schema.d.ts +2 -1
  58. package/dist/modules/stock/productImage/interface.d.ts +0 -2
  59. package/dist/modules/stock/productLocation/interface.d.ts +18 -0
  60. package/dist/modules/stock/promotion/interface.d.ts +0 -2
  61. package/dist/modules/stock/promotionAssoc/interface.d.ts +0 -2
  62. package/dist/modules/stock/queryList/interfaces.d.ts +0 -2
  63. package/dist/modules/stock/queryParameter/interfaces.d.ts +0 -2
  64. package/dist/modules/stock/recurrentTasks/interface.d.ts +0 -2
  65. package/dist/modules/stock/returnReason/interfaces.d.ts +0 -2
  66. package/dist/modules/stock/savedEmPicking/interfaces.d.ts +0 -2
  67. package/dist/modules/stock/savedProviderProposal/interfaces.d.ts +0 -2
  68. package/dist/modules/stock/stockMovement/interface.d.ts +0 -2
  69. package/dist/modules/stock/tag/interface.d.ts +0 -2
  70. package/dist/modules/stock/task/interface.d.ts +0 -2
  71. package/dist/modules/stock/taskMessage/interface.d.ts +0 -2
  72. package/dist/modules/stock/taskRead/interface.d.ts +0 -2
  73. package/dist/modules/stock/typeOfLocation/interface.d.ts +0 -2
  74. package/dist/modules/stock/unitOfMeasure/interface.d.ts +0 -2
  75. package/dist/modules/stock/vatTax/interface.d.ts +0 -2
  76. package/dist/modules/stock/vatTaxZone/interface.d.ts +0 -2
  77. package/dist/modules/stock/vatValidation/interfaces.d.ts +0 -2
  78. package/dist/modules/stock/workflow/interfaces.d.ts +0 -2
  79. package/dist/modules/supply/currentAccount/interface.d.ts +5 -6
  80. package/dist/modules/supply/documentHeader/interfaces.d.ts +6 -19
  81. package/dist/modules/supply/documentHeader/route.schema.d.ts +0 -1
  82. package/dist/modules/supply/documentHeaderHistory/interfaces.d.ts +1 -3
  83. package/dist/modules/supply/documentHeaderSubscriber/interface.d.ts +2 -4
  84. package/dist/modules/supply/documentHeaderSurvey/interfaces.d.ts +37 -4
  85. package/dist/modules/supply/documentHeaderSurvey/route.schema.d.ts +2 -0
  86. package/dist/modules/supply/documentLine/interfaces.d.ts +5 -4
  87. package/dist/modules/supply/documentLine/route.schema.d.ts +2 -1
  88. package/dist/modules/supply/documentLineAssoc/interfaces.d.ts +1 -3
  89. package/dist/modules/supply/documentLineMT/interface.d.ts +0 -2
  90. package/dist/modules/supply/documentLineNote/interfaces.d.ts +1 -3
  91. package/dist/modules/supply/documentLineRM/interface.d.ts +0 -2
  92. package/dist/modules/supply/documentSet/interface.d.ts +0 -2
  93. package/dist/modules/supply/documentType/interfaces.d.ts +3 -3
  94. package/dist/modules/supply/externalDocumentHeader/interface.d.ts +0 -2
  95. package/dist/modules/supply/externalDocumentType/interface.d.ts +0 -2
  96. package/dist/modules/supply/orderManagement/interface.d.ts +0 -2
  97. package/dist/modules/supply/payment/interface.d.ts +0 -2
  98. package/dist/modules/supply/paymentBatch/interface.d.ts +1 -3
  99. package/dist/modules/supply/preSale/interface.d.ts +0 -2
  100. package/dist/modules/supply/preSaleProduct/interface.d.ts +0 -2
  101. package/dist/modules/supply/schedule/interface.d.ts +0 -2
  102. package/dist/modules/supply/startDocumentHeaderLastUpdate/interface.d.ts +0 -2
  103. package/dist/modules/tickets/channel/interfaces.d.ts +0 -2
  104. package/dist/modules/tickets/clt/interfaces.d.ts +0 -2
  105. package/dist/modules/tickets/language/interfaces.d.ts +0 -2
  106. package/dist/modules/tickets/tickets/interfaces.d.ts +0 -2
  107. package/dist/modules/ui/portal/interface.d.ts +6 -1
  108. package/dist/modules/ui/portal/route.schema.d.ts +1 -0
  109. package/dist/modules/ui/sideMenu/interface.d.ts +2 -0
  110. package/dist/modules/ui/sidemenuHighlight/interface.d.ts +34 -0
  111. package/dist/modules/ui/sidemenuHighlight/route.schema.d.ts +3 -0
  112. package/dist/modules/user/bankData/interface.d.ts +0 -2
  113. package/dist/modules/user/chatSubscribers/interfaces.d.ts +16 -3
  114. package/dist/modules/user/chatSubscribers/route.schema.d.ts +3 -0
  115. package/dist/modules/user/clientType/interface.d.ts +0 -2
  116. package/dist/modules/user/clients/interface.d.ts +0 -2
  117. package/dist/modules/user/commissioner/interface.d.ts +0 -2
  118. package/dist/modules/user/country/interface.d.ts +0 -2
  119. package/dist/modules/user/deliveryMethods/interfaces.d.ts +0 -2
  120. package/dist/modules/user/favorites/interfaces.d.ts +0 -2
  121. package/dist/modules/user/language/interface.d.ts +0 -2
  122. package/dist/modules/user/maturityDates/interfaces.d.ts +0 -2
  123. package/dist/modules/user/paymentMethods/interfaces.d.ts +0 -2
  124. package/dist/modules/user/persona/interface.d.ts +0 -2
  125. package/dist/modules/user/providerType/interface.d.ts +0 -2
  126. package/dist/modules/user/providers/interface.d.ts +0 -2
  127. package/dist/modules/user/purchaseConditions/interface.d.ts +0 -2
  128. package/dist/modules/user/reasonForExemption/interface.d.ts +0 -2
  129. package/dist/modules/user/refreshToken/interface.d.ts +1 -1
  130. package/dist/modules/user/segmentsArea/interface.d.ts +0 -2
  131. package/dist/modules/user/sessions/interface.d.ts +5 -0
  132. package/dist/modules/user/shippings/interface.d.ts +0 -2
  133. package/dist/modules/user/storeOperator/interface.d.ts +5 -2
  134. package/dist/modules/user/storeOperator/route.schema.d.ts +1 -0
  135. package/dist/modules/user/swift/interface.d.ts +0 -2
  136. package/dist/modules/user/systemModule/interface.d.ts +43 -0
  137. package/dist/modules/user/systemModule/route.schema.d.ts +3 -0
  138. package/dist/modules/user/tenant/interface.d.ts +0 -2
  139. package/dist/modules/user/theme/interfaces.d.ts +0 -2
  140. package/dist/modules/user/timeSheet/interfaces.d.ts +52 -0
  141. package/dist/modules/user/timeSheet/route.schema.d.ts +6 -0
  142. package/dist/modules/user/userPositions/interface.d.ts +0 -2
  143. package/dist/modules/user/userTokens/interface.d.ts +0 -2
  144. package/dist/modules/user/users/interface.d.ts +3 -3
  145. package/dist/modules/user/vehicles/interfaces.d.ts +0 -2
  146. package/dist/modules/user/zipCode/interfaces.d.ts +0 -2
  147. package/dist/modules/view/adminPanel/interfaces.d.ts +0 -2
  148. package/dist/modules/view/errorLog/interfaces.d.ts +1 -3
  149. package/dist/modules/view/webSocket/interfaces.d.ts +117 -0
  150. package/dist/shared/entities/sms.d.ts +31 -0
  151. package/dist/shared/entities/stock.d.ts +21 -1
  152. package/dist/shared/entities/user.d.ts +32 -42
  153. package/dist/shared/interface.d.ts +55 -13
  154. package/package.json +9 -9
@@ -0,0 +1,43 @@
1
+ import type * as IShared from '../../../shared/interface';
2
+ import type { SystemModule } from '../../../shared/entities/user';
3
+ export type Entity = SystemModule;
4
+ export declare const Route = "system_module";
5
+ export declare enum SystemModuleEnum {
6
+ encomendas_stock = "encomendas_stock",
7
+ entradas = "entradas",
8
+ compras = "compras",
9
+ pagamentos = "pagamentos",
10
+ lotes = "lotes",
11
+ parcelas = "parcelas",
12
+ obrigacoes_legais = "obrigacoes_legais",
13
+ dashboard = "dashboard",
14
+ listagens = "listagens",
15
+ tasks = "tasks",
16
+ contas_corrente = "contas_corrente",
17
+ rms = "rms",
18
+ calendario = "calendario",
19
+ gestao_utilizadores = "gestao_utilizadores",
20
+ templates_email = "templates_email",
21
+ audit = "audit"
22
+ }
23
+ export interface IFindByStoreOperatorIdRequest {
24
+ store_operator_id: string;
25
+ }
26
+ export interface IFindByStoreOperatorIdResponse {
27
+ store_operator_id: string;
28
+ values: SystemModuleEnum[];
29
+ }
30
+ export interface IFindResponseItem {
31
+ store_operator_id: string;
32
+ values: SystemModuleEnum[];
33
+ }
34
+ export interface ISetStoreOperatorModulesRequest {
35
+ store_operator_id: string;
36
+ values: SystemModuleEnum[];
37
+ }
38
+ export interface IRepository {
39
+ find(): Promise<IFindResponseItem[]>;
40
+ findByStoreOperatorId(selector: IFindByStoreOperatorIdRequest): Promise<IFindByStoreOperatorIdResponse>;
41
+ setStoreOperatorModules(data: ISetStoreOperatorModulesRequest): Promise<void>;
42
+ }
43
+ export type IController = IShared.IEntityWithUserToken<IRepository>;
@@ -0,0 +1,3 @@
1
+ import joi from 'joi';
2
+ export declare const findByStoreOperatorIdParam: joi.ObjectSchema<any>;
3
+ export declare const setStoreOperatorModulesBody: joi.ObjectSchema<any>;
@@ -2,8 +2,6 @@ import * as IShared from '../../../shared/interface';
2
2
  import { Tenant } from '../../../shared/entities/user';
3
3
  export type Entity = Tenant;
4
4
  export declare const Route = "tenant";
5
- export declare const UpperName = "Tenant";
6
- export declare const LowerName: string;
7
5
  export interface ICreateRequest {
8
6
  name: string;
9
7
  customer_id: string;
@@ -2,8 +2,6 @@ import * as IShared from '../../../shared/interface';
2
2
  import { Theme } from '../../../shared/entities/user';
3
3
  export type Entity = Theme;
4
4
  export declare const Route = "theme";
5
- export declare const UpperName = "Theme";
6
- export declare const LowerName: string;
7
5
  export interface ISessionStorageColor {
8
6
  name: string;
9
7
  hex: string;
@@ -0,0 +1,52 @@
1
+ import * as IShared from '../../../shared/interface';
2
+ import { TimeSheet } from '../../../shared/entities/user';
3
+ export type Entity = TimeSheet;
4
+ export declare const Route = "time_sheet";
5
+ export declare const ITimeSheetRecordTypeEnum: {
6
+ readonly ENTRY: "ENTRY";
7
+ readonly EXIT: "EXIT";
8
+ readonly CREDIT: "CREDIT";
9
+ readonly DEBIT: "DEBIT";
10
+ };
11
+ export type ITimeSheetRecordType = (typeof ITimeSheetRecordTypeEnum)[keyof typeof ITimeSheetRecordTypeEnum];
12
+ export declare const timeSheetRecordTypes: ("ENTRY" | "EXIT" | "CREDIT" | "DEBIT")[];
13
+ export declare const ITimeSheetRegistryTypeEnum: {
14
+ readonly AUTOMATIC: "AUTOMATIC";
15
+ readonly MANUAL: "MANUAL";
16
+ };
17
+ export type ITimeSheetRegistryType = (typeof ITimeSheetRegistryTypeEnum)[keyof typeof ITimeSheetRegistryTypeEnum];
18
+ export declare const timeSheetRegistryTypes: ("AUTOMATIC" | "MANUAL")[];
19
+ export interface IFindRequest {
20
+ user_id?: string;
21
+ start_date?: string;
22
+ end_date?: string;
23
+ }
24
+ export interface IFindByDateRequest {
25
+ user_id: string;
26
+ date: string;
27
+ }
28
+ export interface IDailySummaryRequest {
29
+ user_id: string;
30
+ start_date: string;
31
+ end_date: string;
32
+ }
33
+ export interface IDailySummaryResponse {
34
+ user_id: string;
35
+ date: string;
36
+ total_worked: number;
37
+ balance: number;
38
+ record_count: number;
39
+ }
40
+ export type ICreateRequest = Omit<Entity, 'id' | 'created_at' | 'updated_at'>;
41
+ export type IUpdateRequest = Partial<Pick<Entity, 'type' | 'time' | 'minutes' | 'note' | 'updated_by' | 'updated_at'>>;
42
+ export interface IRepository {
43
+ find(filters?: IFindRequest): Promise<Entity[]>;
44
+ findById(id: string): Promise<Entity | null>;
45
+ create(data: ICreateRequest): Promise<Entity>;
46
+ update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
47
+ deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
48
+ findByUserAndDate(filters: IFindByDateRequest): Promise<Entity[]>;
49
+ getDailySummary(filters: IDailySummaryRequest): Promise<IDailySummaryResponse[]>;
50
+ }
51
+ export type IController = IShared.IEntityWithUserToken<IRepository>;
52
+ export type IApi = Omit<IRepository, 'findById'>;
@@ -0,0 +1,6 @@
1
+ import joi from 'joi';
2
+ export declare const createBody: joi.ObjectSchema<any>;
3
+ export declare const updateBody: joi.ObjectSchema<any>;
4
+ export declare const findQuery: joi.ObjectSchema<any>;
5
+ export declare const findByDateQuery: joi.ObjectSchema<any>;
6
+ export declare const dailySummaryQuery: joi.ObjectSchema<any>;
@@ -2,8 +2,6 @@ import * as IShared from '../../../shared/interface';
2
2
  import { UserPositions } from '../../../shared/entities/user';
3
3
  export type Entity = UserPositions;
4
4
  export declare const Route = "user_positions";
5
- export declare const UpperName = "UserPositions";
6
- export declare const LowerName: string;
7
5
  type IFindDetailedResponse = Entity;
8
6
  export type IFindByIdResponse = Omit<IFindDetailedResponse, ''>;
9
7
  export type IFindRequest = Record<string, unknown>;
@@ -2,8 +2,6 @@ import * as IShared from '../../../shared/interface';
2
2
  import { UserTokens } from '../../../shared/entities/user';
3
3
  export type Entity = UserTokens;
4
4
  export declare const Route = "user_token";
5
- export declare const UpperName = "UserTokens";
6
- export declare const LowerName: string;
7
5
  export type IFindRequest = Record<string, unknown>;
8
6
  export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {
9
7
  }
@@ -1,17 +1,17 @@
1
1
  import * as IShared from '../../../shared/interface';
2
2
  import { Providers, Country, Language, ProviderType, ReasonForExemption, Persona, Clients, SegmentsArea, ClientType, StoreOperator, UserPositions, Commissioner, Users, PaymentMethods, MaturityDates, DeliveryMethods, Vehicles, Theme } from '../../../shared/entities/user';
3
+ import type { SystemModuleEnum } from '../systemModule/interface';
3
4
  export type Entity = Users;
4
5
  export type EntityWithoutPassword = Omit<Users, 'password'>;
5
6
  export declare const Route = "users";
6
- export declare const UpperName = "Users";
7
- export declare const LowerName: string;
8
7
  interface IMainPersona extends Persona {
9
8
  country: Country | null;
10
9
  reason_for_exemption: ReasonForExemption | null;
11
10
  }
12
- interface IStoreOperator extends Pick<StoreOperator, 'id' | 'location_id' | 'superuser'> {
11
+ interface IStoreOperator extends Pick<StoreOperator, 'id' | 'superuser'> {
13
12
  main_persona: Pick<Persona, 'name' | 'email'>;
14
13
  theme: Pick<Theme, 'colors'> | null;
14
+ system_modules: SystemModuleEnum[];
15
15
  }
16
16
  export interface IFindByEmailResponse extends Pick<Entity, 'id'> {
17
17
  store_operator: IStoreOperator;
@@ -2,8 +2,6 @@ import * as IShared from '../../../shared/interface';
2
2
  import { Vehicles } from '../../../shared/entities/user';
3
3
  export type Entity = Vehicles;
4
4
  export declare const Route = "vehicles";
5
- export declare const UpperName = "Vehicles";
6
- export declare const LowerName: string;
7
5
  export interface ICreateRequest {
8
6
  description: string;
9
7
  vehicle_id: number;
@@ -1,8 +1,6 @@
1
1
  import { ZipCode } from '../../../shared/entities/user';
2
2
  export type Entity = ZipCode;
3
3
  export declare const Route = "zip_code";
4
- export declare const UpperName = "ZipCode";
5
- export declare const LowerName: string;
6
4
  export interface ICreateRequest {
7
5
  postal_code: string;
8
6
  address: string;
@@ -1,6 +1,4 @@
1
1
  export declare const Route = "admin_panel";
2
- export declare const UpperName = "AdminPanel";
3
- export declare const LowerName: string;
4
2
  export interface ICalendar {
5
3
  year: number;
6
4
  month: number;
@@ -1,6 +1,4 @@
1
- export declare const Route = "error_handler";
2
- export declare const UpperName = "ErrorHandler";
3
- export declare const LowerName: string;
1
+ export declare const Route = "error_log";
4
2
  export declare const IErrorTypeEnum: {
5
3
  prisma: 'prisma';
6
4
  unhandled: 'unhandled';
@@ -0,0 +1,117 @@
1
+ import type { IChatBalloon } from '../../stock/chat/interfaces';
2
+ import type { ILastTicketCalledTodayByChannel, IRemainingTodayTickets } from '../../tickets/tickets/interfaces';
3
+ import type { IPublicDocument, IPublicFindBySubscriberId, ITags } from '../../ui/portal/interface';
4
+ import type { IFindByOwnerIdItemWithVersions } from '../../supply/externalDocumentHeader/interface';
5
+ export declare const Route = "ws";
6
+ export interface IEvent {
7
+ type: string;
8
+ }
9
+ export interface IPing extends IEvent {
10
+ type: 'ping';
11
+ }
12
+ export interface IPong extends IEvent {
13
+ type: 'pong';
14
+ }
15
+ export interface IChatTranslationUpdated extends IEvent {
16
+ type: 'chat.translation.updated';
17
+ chat_id: string;
18
+ translation: string;
19
+ target_language_id: string;
20
+ }
21
+ export interface IChatMessageCreated extends IEvent {
22
+ type: 'chat.message.created';
23
+ balloon: IChatBalloon;
24
+ }
25
+ export interface IChatFileCreated extends IEvent {
26
+ type: 'chat.file.created';
27
+ balloon: IChatBalloon;
28
+ }
29
+ export interface IChatMessageUpdated extends IEvent {
30
+ type: 'chat.message.updated';
31
+ chat_id: string;
32
+ patch: Partial<NonNullable<IChatBalloon['chat']>>;
33
+ }
34
+ export interface IChatMessageDeleted extends IEvent {
35
+ type: 'chat.message.deleted';
36
+ chat_id: string;
37
+ }
38
+ export interface IChatFileDeleted extends IEvent {
39
+ type: 'chat.file.deleted';
40
+ file_id: string;
41
+ }
42
+ export interface IChatReadStateUpdated extends IEvent {
43
+ type: 'chat.read_state.updated';
44
+ chat_document_header_id: string;
45
+ client_read: boolean;
46
+ chat_id?: string;
47
+ file_id?: string;
48
+ }
49
+ export interface IChatTagsUpdated extends IEvent {
50
+ type: 'chat.tags.updated';
51
+ chat_document_header_id: string;
52
+ tags: ITags[];
53
+ }
54
+ export interface IPersonaUpdated extends IEvent {
55
+ type: 'persona.updated';
56
+ persona: NonNullable<IPublicFindBySubscriberId['persona']>;
57
+ }
58
+ export interface IDocumentUpdated extends IEvent {
59
+ type: 'document.updated';
60
+ document: IPublicDocument;
61
+ }
62
+ export type ChatSocketEvent = IChatTranslationUpdated | IChatMessageCreated | IChatFileCreated | IChatMessageUpdated | IChatMessageDeleted | IChatFileDeleted | IChatReadStateUpdated | IChatTagsUpdated | IPersonaUpdated | IDocumentUpdated | IPing | IPong;
63
+ export interface ITicketsChanged extends IEvent {
64
+ type: 'tickets.changed';
65
+ last_tickets_called_today_by_channel: ILastTicketCalledTodayByChannel[];
66
+ remaining_today_tickets_to_call: IRemainingTodayTickets[];
67
+ }
68
+ export type TicketsSocketEvent = ITicketsChanged | IPing | IPong;
69
+ export interface IPropostaSheetsImportStatus extends IEvent {
70
+ type: 'proposta_sheets.import.status';
71
+ document_header_id: string;
72
+ google_sheet_id: string;
73
+ is_processing: boolean;
74
+ error: string | null;
75
+ }
76
+ export type PropostaSheetsSocketEvent = IPropostaSheetsImportStatus | IPing | IPong;
77
+ /**
78
+ * Emitted whenever an external/certified document tied to a dossier is
79
+ * created (post-create effects finished), retried, or voided. The payload
80
+ * carries the full `IFindByOwnerIdItemWithVersions` row so the client can
81
+ * upsert it straight into the `ExternalDocumentHeaderFindByOwnerId` cache
82
+ * keyed by `owner_id` (the dossier / start_document_header_id), matching on
83
+ * `item.document_header_id` to decide between insert and replace.
84
+ */
85
+ export interface IExternalDocumentUpserted extends IEvent {
86
+ type: 'external_document.upserted';
87
+ owner_id: string;
88
+ item: IFindByOwnerIdItemWithVersions;
89
+ }
90
+ export type SupplyDocumentSocketEvent = IExternalDocumentUpserted | IPing | IPong;
91
+ export interface IPushNotificationEvent extends IEvent {
92
+ type: 'push_notification';
93
+ counts: Record<string, number>;
94
+ timestamp?: string;
95
+ }
96
+ export interface ISidemenuHighlightChangedEvent extends IEvent {
97
+ type: 'sidemenu_highlight_changed';
98
+ store_operator_id: string;
99
+ values: string[];
100
+ timestamp?: string;
101
+ }
102
+ export type SideMenuSocketEvent = IPushNotificationEvent | ISidemenuHighlightChangedEvent | IPing | IPong;
103
+ export interface SocketOptions<T extends IEvent> {
104
+ token: string;
105
+ channel?: string;
106
+ onEvent: (evt: T) => void;
107
+ onOpen?: () => void;
108
+ onReconnect?: () => void;
109
+ onClose?: () => void;
110
+ onAuthUnverified?: () => void;
111
+ }
112
+ export interface SocketHandle {
113
+ close: () => void;
114
+ }
115
+ export interface IClient {
116
+ openSocket<T extends IEvent>(data: SocketOptions<T>): SocketHandle;
117
+ }
@@ -0,0 +1,31 @@
1
+ import { ISmsSenderStats } from '../../modules/sms/smsSender/interfaces';
2
+ /**
3
+ * Model SmsSender
4
+ *
5
+ */
6
+ export type SmsSender = {
7
+ id: string;
8
+ document_line_id: string | null;
9
+ telephone: string;
10
+ message: string;
11
+ status: ISmsSenderStats;
12
+ error: string | null;
13
+ created_at: Date;
14
+ processed_at: Date | null;
15
+ sent_at: Date | null;
16
+ };
17
+ /**
18
+ * Model SmsTemplate
19
+ *
20
+ */
21
+ export type SmsTemplate = {
22
+ id: string;
23
+ key: string;
24
+ name: string;
25
+ message: string;
26
+ variables: unknown;
27
+ created_at: Date;
28
+ updated_at: Date;
29
+ created_by: string;
30
+ updated_by: string;
31
+ };
@@ -40,6 +40,8 @@ export type Chat = {
40
40
  is_customer: boolean;
41
41
  deleted: boolean;
42
42
  lang: string | null;
43
+ lang_confidence: number | null;
44
+ lang_multi_dominant: boolean | null;
43
45
  created_by: string;
44
46
  updated_by: string;
45
47
  created_at: Date;
@@ -305,6 +307,8 @@ export type DocumentHeader = {
305
307
  delivery_departure_street: string | null;
306
308
  delivery_departure_locality: string | null;
307
309
  delivery_departure_postal_code: string | null;
310
+ delivery_departure_country_id: string | null;
311
+ delivery_departure_country_name: string | null;
308
312
  delivery_method_id: string | null;
309
313
  delivery_method: string | null;
310
314
  vehicle_id: string | null;
@@ -318,6 +322,8 @@ export type DocumentHeader = {
318
322
  commission_percentage: number;
319
323
  commission_paid: boolean;
320
324
  return_reason: string | null;
325
+ is_prepared: boolean;
326
+ is_rejected: boolean;
321
327
  is_archived: boolean;
322
328
  is_void: boolean;
323
329
  is_void_reason: string | null;
@@ -377,6 +383,7 @@ export type DocumentLine = {
377
383
  cativado: boolean;
378
384
  cativado_date: Date | null;
379
385
  consignacao: boolean;
386
+ abater_na_fatura_final: boolean;
380
387
  document_line_group_id: string;
381
388
  index: number;
382
389
  data: IData;
@@ -1085,7 +1092,7 @@ export type DocumentHeaderSurvey = {
1085
1092
  export type DocumentHeaderSubscriber = {
1086
1093
  id: string;
1087
1094
  document_header_id: string;
1088
- store_operator_id: string;
1095
+ user_id: string;
1089
1096
  created_at: Date;
1090
1097
  created_by: string;
1091
1098
  updated_at: Date;
@@ -1111,3 +1118,16 @@ export type GoogleCalendar = {
1111
1118
  done: Date | null;
1112
1119
  error: string | null;
1113
1120
  };
1121
+ /**
1122
+ * Model SidemenuHightlight
1123
+ *
1124
+ */
1125
+ export type SidemenuHightlight = {
1126
+ id: string;
1127
+ store_operator_id: string;
1128
+ value: string;
1129
+ created_at: Date;
1130
+ updated_at: Date;
1131
+ created_by: string;
1132
+ updated_by: string;
1133
+ };
@@ -1,5 +1,7 @@
1
1
  import { IPaymentMethodsSaftCodeEnum } from '../../modules/user/paymentMethods/interfaces';
2
2
  import type { IReasonForExemptionType } from '../../modules/user/reasonForExemption/interface';
3
+ import type { SystemModuleEnum } from '../../modules/user/systemModule/interface';
4
+ import { ITimeSheetRecordType, ITimeSheetRegistryType } from '../../modules/user/timeSheet/interfaces';
3
5
  /**
4
6
  * Model Users
5
7
  *
@@ -38,48 +40,6 @@ export type Favorites = {
38
40
  created_at: Date;
39
41
  updated_at: Date;
40
42
  };
41
- /**
42
- * Model Permissions
43
- *
44
- */
45
- export type Permissions = {
46
- id: number;
47
- code: string;
48
- description: string;
49
- enable: boolean;
50
- created_at: Date;
51
- updated_at: Date;
52
- created_by: string;
53
- updated_by: string;
54
- };
55
- /**
56
- * Model GroupPermissions
57
- *
58
- */
59
- export type GroupPermissions = {
60
- id: number;
61
- code: string;
62
- description: string;
63
- enable: boolean;
64
- created_at: Date;
65
- updated_at: Date;
66
- created_by: string;
67
- updated_by: string;
68
- };
69
- /**
70
- * Model UserPermissions
71
- *
72
- */
73
- export type UserPermissions = {
74
- id: number;
75
- user_id: string;
76
- group_id: number;
77
- permission_id: number;
78
- created_at: Date;
79
- updated_at: Date;
80
- created_by: string;
81
- updated_by: string;
82
- };
83
43
  /**
84
44
  * Model Providers
85
45
  *
@@ -464,6 +424,7 @@ export type Persona = {
464
424
  nif: string | null;
465
425
  telephone: string | null;
466
426
  email: string | null;
427
+ email_access_token: string | null;
467
428
  observations: string | null;
468
429
  street: string | null;
469
430
  postal_code: string | null;
@@ -506,3 +467,32 @@ export type ChatSubscriber = {
506
467
  created_by: string;
507
468
  updated_by: string;
508
469
  };
470
+ /**
471
+ * Model SystemModule
472
+ *
473
+ */
474
+ export type SystemModule = {
475
+ id: string;
476
+ store_operator_id: string;
477
+ value: SystemModuleEnum;
478
+ created_at: Date;
479
+ updated_at: Date;
480
+ created_by: string;
481
+ updated_by: string;
482
+ };
483
+ /**
484
+ * Model TimeSheet
485
+ */
486
+ export interface TimeSheet {
487
+ id: string;
488
+ user_id: string;
489
+ type: ITimeSheetRecordType;
490
+ time: Date | null;
491
+ minutes: number | null;
492
+ registry_type: ITimeSheetRegistryType;
493
+ note: string | null;
494
+ created_at: Date;
495
+ updated_at: Date;
496
+ created_by: string;
497
+ updated_by: string;
498
+ }
@@ -1,6 +1,5 @@
1
1
  import joi from 'joi';
2
2
  import { messages } from './messages';
3
- import type { ILastTicketCalledTodayByChannel, IRemainingTodayTickets } from '../modules/tickets/tickets/interfaces';
4
3
  import type { IGetUserData } from '../modules/integration/googleSheets/interfaces';
5
4
  import type { IDocumentTypeUserType } from '../modules/supply/documentType/interfaces';
6
5
  import type { IScheduleType } from '../modules/supply/schedule/interface';
@@ -12,6 +11,8 @@ import type { ProjectInfo } from './entities/integration';
12
11
  import type { IAttachment } from '../modules/supply/externalDocumentHeader/interface';
13
12
  import type { Persona } from './entities/user';
14
13
  import type { ITranslateRequest } from '../modules/stock/chat/interfaces';
14
+ import type { ChatSocketEvent, TicketsSocketEvent, SupplyDocumentSocketEvent } from '../modules/view/webSocket/interfaces';
15
+ import type { SystemModuleEnum } from '../modules/user/systemModule/interface';
15
16
  export { messages };
16
17
  type CreatedAt = 'created_at';
17
18
  type UpdatedAt = 'updated_at';
@@ -39,7 +40,8 @@ export type WithUserstamps = WithCreatedBy & WithUpdatedBy;
39
40
  export type WithoutUserstamps<T> = Omit<T, CreatedBy | UpdatedBy>;
40
41
  export interface IUserToken {
41
42
  id: string;
42
- location_id: string;
43
+ superuser?: boolean;
44
+ system_modules?: SystemModuleEnum[];
43
45
  }
44
46
  export type IEntityWithUserToken<T> = {
45
47
  [K in keyof T]: T[K] extends (...params: infer U) => any ? (...params: [...U, IUserToken]) => ReturnType<T[K]> : T[K];
@@ -123,8 +125,8 @@ export declare const idNumberParam: joi.ObjectSchema<any>;
123
125
  export declare const findMinifiedReponse: joi.ArraySchema<{
124
126
  id: unknown;
125
127
  name: unknown;
126
- multimedia_id: unknown;
127
128
  group: unknown;
129
+ multimedia_id: unknown;
128
130
  }[]>;
129
131
  export declare const joiValidateStamps: IRouteResponseWithoutStamps<WithTimestampsOriginID>;
130
132
  export declare const IUserSendEmailDocumentTemplateEnum: {
@@ -133,8 +135,19 @@ export declare const IUserSendEmailDocumentTemplateEnum: {
133
135
  };
134
136
  export type IUserSendEmailDocumentTemplate = (typeof IUserSendEmailDocumentTemplateEnum)[keyof typeof IUserSendEmailDocumentTemplateEnum];
135
137
  export declare const IUserSendEmailDocumentTemplateTypes: string[];
138
+ export interface ISmsSenderSelectLinesData {
139
+ document_line_id: string;
140
+ document_header_id: string;
141
+ execution_date: string;
142
+ type: 'RM' | 'MT';
143
+ }
136
144
  export declare enum IBrokerTopic {
137
145
  tickets_change = "tickets_change",
146
+ push_notification = "push_notification",
147
+ portal_subscriber_events = "portal_subscriber_events",
148
+ portal_document_events = "portal_document_events",
149
+ sidemenu_highlight_changed = "sidemenu_highlight_changed",
150
+ proposta_sheets_import_status = "proposta_sheets_import_status",
138
151
  user_send_email_password = "user_send_email_password",
139
152
  grant_access = "grant_access",
140
153
  remove_access = "remove_access",
@@ -152,11 +165,13 @@ export declare enum IBrokerTopic {
152
165
  espera_devolver_catalogo_email = "espera_devolver_catalogo_email",
153
166
  verification_email = "verification_email",
154
167
  dispatch_chat_message = "dispatch_chat_message",
155
- persona_lang_change = "persona_lang_change",
156
- translate_chat_message = "translate_chat_message",
168
+ send_espera_info_cliente_messages = "send_espera_info_cliente_messages",
169
+ send_email_client_survey = "send_email_client_survey",
157
170
  perform_task = "perform_task",
158
171
  create_site_proposal = "create_site_proposal",
159
- push_notification = "push_notification",
172
+ translate_chat_message = "translate_chat_message",
173
+ persona_updated = "persona_updated",
174
+ persona_lang_change = "persona_lang_change",
160
175
  error_log = "error_log",
161
176
  kafka_log = "kafka_log",
162
177
  express_log = "express_log",
@@ -177,8 +192,7 @@ export declare enum IBrokerTopic {
177
192
  googlesheet_stock_log = "googlesheet_stock_log",
178
193
  googlesheet_encomenda_log = "googlesheet_encomenda_log",
179
194
  log_google_api_request = "log_google_api_request",
180
- send_espera_info_cliente_messages = "send_espera_info_cliente_messages",
181
- send_email_client_survey = "send_email_client_survey"
195
+ sms_sender_select_lines = "sms_sender_select_lines"
182
196
  }
183
197
  export type IBrokerTopicPayload = {
184
198
  [IBrokerTopic.google_sheet_import]: {
@@ -186,7 +200,6 @@ export type IBrokerTopicPayload = {
186
200
  google_sheet_id: string;
187
201
  original_document_header_id?: string;
188
202
  user_id: string;
189
- location_id: string;
190
203
  };
191
204
  [IBrokerTopic.user_send_email_password]: {
192
205
  token: string;
@@ -213,10 +226,7 @@ export type IBrokerTopicPayload = {
213
226
  [IBrokerTopic.remove_access]: {
214
227
  email: string;
215
228
  };
216
- [IBrokerTopic.tickets_change]: {
217
- last_tickets_called_today_by_channel: ILastTicketCalledTodayByChannel[];
218
- remaining_today_tickets_to_call: IRemainingTodayTickets[];
219
- };
229
+ [IBrokerTopic.tickets_change]: TicketsSocketEvent;
220
230
  [IBrokerTopic.google_sheet_set_permissions]: {
221
231
  file_id: string;
222
232
  email: string;
@@ -299,6 +309,17 @@ export type IBrokerTopicPayload = {
299
309
  counts: Record<string, number>;
300
310
  timestamp: string;
301
311
  };
312
+ [IBrokerTopic.sidemenu_highlight_changed]: {
313
+ store_operator_id: string;
314
+ values: string[];
315
+ timestamp: string;
316
+ };
317
+ [IBrokerTopic.proposta_sheets_import_status]: {
318
+ document_header_id: string;
319
+ google_sheet_id: string;
320
+ is_processing: boolean;
321
+ error: string | null;
322
+ };
302
323
  [IBrokerTopic.import_master_artigos]: {};
303
324
  [IBrokerTopic.kafka_log]: {
304
325
  id: string;
@@ -361,6 +382,7 @@ export type IBrokerTopicPayload = {
361
382
  };
362
383
  [IBrokerTopic.send_email_client_survey]: {
363
384
  persona_id: string;
385
+ owner_id: string;
364
386
  document_header_id: string;
365
387
  document_number: number;
366
388
  persona_name: string;
@@ -370,6 +392,26 @@ export type IBrokerTopicPayload = {
370
392
  chat_document_header_id: string;
371
393
  language_id: string;
372
394
  };
395
+ [IBrokerTopic.persona_updated]: Pick<Persona, 'name' | 'nif' | 'telephone' | 'email' | 'street' | 'postal_code' | 'locality' | 'country_id' | 'reason_for_exemption_id'> & {
396
+ id: string;
397
+ owner_id?: string;
398
+ owner_name?: string | null;
399
+ updated_by: string;
400
+ country_name: string | null;
401
+ reason_for_exemption: string | null;
402
+ };
403
+ [IBrokerTopic.portal_subscriber_events]: {
404
+ chat_document_header_id: string;
405
+ target_subscriber_ids: string[];
406
+ event: ChatSocketEvent;
407
+ };
408
+ [IBrokerTopic.portal_document_events]: {
409
+ owner_id: string;
410
+ event: SupplyDocumentSocketEvent;
411
+ };
412
+ [IBrokerTopic.sms_sender_select_lines]: {
413
+ data: ISmsSenderSelectLinesData;
414
+ };
373
415
  };
374
416
  export interface IBrokerMessage<T extends IBrokerTopic = IBrokerTopic> {
375
417
  topic: T;