@nomalism-com/types 0.22.102 → 0.22.104

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 (39) hide show
  1. package/dist/index.min.js +1 -1
  2. package/dist/main.d.ts +10 -1
  3. package/dist/modules/document/materialEntrance/interfaces.d.ts +2 -2
  4. package/dist/modules/document/order/interfaces.d.ts +1 -6
  5. package/dist/modules/document/purchase/interfaces.d.ts +1 -3
  6. package/dist/modules/document/returnToProvider/interface.d.ts +1 -1
  7. package/dist/modules/integration/emailLog/interfaces.d.ts +1 -0
  8. package/dist/modules/integration/emailVerification/interfaces.d.ts +23 -0
  9. package/dist/modules/integration/emailVerification/route.schema.d.ts +5 -0
  10. package/dist/modules/integration/file/interface.d.ts +11 -3
  11. package/dist/modules/integration/file/route.schema.d.ts +3 -1
  12. package/dist/modules/integration/googleSheets/interfaces.d.ts +2 -2
  13. package/dist/modules/integration/projectInfo/interfaces.d.ts +5 -5
  14. package/dist/modules/stock/chat/interfaces.d.ts +55 -0
  15. package/dist/modules/stock/chat/route.schema.d.ts +5 -0
  16. package/dist/modules/stock/chatToken/interfaces.d.ts +10 -0
  17. package/dist/modules/stock/prison/interface.d.ts +1 -1
  18. package/dist/modules/stock/queryList/route.schema.d.ts +3 -3
  19. package/dist/modules/stock/queryParameter/interfaces.d.ts +1 -0
  20. package/dist/modules/stock/savedProviderProposal/interfaces.d.ts +3 -3
  21. package/dist/modules/stock/task/interface.d.ts +53 -0
  22. package/dist/modules/stock/task/route.schema.d.ts +4 -0
  23. package/dist/modules/stock/taskMessage/interface.d.ts +14 -0
  24. package/dist/modules/stock/taskMessage/route.schema.d.ts +3 -0
  25. package/dist/modules/supply/documentHeader/interfaces.d.ts +22 -17
  26. package/dist/modules/supply/documentLine/interfaces.d.ts +6 -5
  27. package/dist/modules/supply/documentLineAssoc/interfaces.d.ts +6 -4
  28. package/dist/modules/supply/orderManagement/interface.d.ts +4 -7
  29. package/dist/modules/supply/payment/interface.d.ts +1 -0
  30. package/dist/modules/user/clients/route.schema.d.ts +1 -1
  31. package/dist/modules/user/persona/interface.d.ts +6 -7
  32. package/dist/modules/user/persona/route.schema.d.ts +1 -0
  33. package/dist/modules/user/purchaseConditions/interface.d.ts +12 -6
  34. package/dist/modules/user/users/interface.d.ts +1 -3
  35. package/dist/shared/entities/index.d.ts +5 -0
  36. package/dist/shared/entities/integration.d.ts +17 -0
  37. package/dist/shared/entities/stock.d.ts +51 -4
  38. package/dist/shared/interface.d.ts +28 -1
  39. package/package.json +7 -7
@@ -1,5 +1,4 @@
1
- import { IDocumentTypeUserType } from "../documentType/interfaces";
2
- import { IProductType } from "../../stock/productGoogleSheets/interface";
1
+ import { IProductType } from "../../stock/product/interface";
3
2
  export declare const Route = "order_management";
4
3
  export declare const UpperName = "OrderManagement";
5
4
  export declare const LowerName: string;
@@ -7,8 +6,9 @@ export interface IFindProviderProductsRequest {
7
6
  provider_id: string;
8
7
  }
9
8
  export interface IFindProposals {
9
+ id: string;
10
10
  name: string;
11
- url: string;
11
+ start_document_header_id: string;
12
12
  pdf_link: string | null;
13
13
  }
14
14
  export interface IFindProviderProductsResponse {
@@ -46,10 +46,7 @@ export interface IFindProductHistoryProviderOrder {
46
46
  export interface IFindProductHistoryMovement {
47
47
  date: Date;
48
48
  document_name: string;
49
- link_user_type: IDocumentTypeUserType | null;
50
- link_owner_id: string | null;
51
- link_document_header_id: string | null;
52
- link_closed: boolean | null;
49
+ document_header_id: string | null;
53
50
  quantity_in: number;
54
51
  quantity_out: number;
55
52
  stock_to_date: number;
@@ -148,6 +148,7 @@ export interface IRepository {
148
148
  findPaymentBatches(): Promise<IPaymentsBatchResponse[]>;
149
149
  deleteBatch(data: IShared.IFindByIdRequest): Promise<void>;
150
150
  findCurrentAccountByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindCurrentAccountByOwnerIdResponse[]>;
151
+ findBalanceByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<number>;
151
152
  findSettledMaterialEntrance(params: IUnpaidPurchasesRequest): Promise<IUnpaidPurchasesResponse[]>;
152
153
  findSettledMaterialEntranceProviders(): Promise<IFindProvidersWithClientIdResponse[]>;
153
154
  findSettledMaterialEntranceByDate(params: IUnpaidByDatePurchasesRequest): Promise<IUnpaidPurchasesResponse[]>;
@@ -1,4 +1,4 @@
1
- import joi from 'joi';
1
+ import joi from "joi";
2
2
  export declare const createBody: joi.ObjectSchema<any>;
3
3
  export declare const updateBody: joi.ObjectSchema<any>;
4
4
  export declare const findQuery: joi.ObjectSchema<any>;
@@ -1,6 +1,5 @@
1
1
  import * as IShared from "../../../shared/interface";
2
2
  import { Persona, Country } from "../../../shared/entities";
3
- import { IDocumentTypeUserType } from "../../supply/documentType/interfaces";
4
3
  export type Entity = Persona;
5
4
  export declare const Route = "persona";
6
5
  export declare const UpperName = "Persona";
@@ -44,13 +43,9 @@ export interface IBasicSearchRequest extends IShared.IPaginationRequest {
44
43
  inactive?: boolean;
45
44
  }
46
45
  export interface IBasicSearchResponse {
47
- user_id: string;
48
- user_type: IDocumentTypeUserType;
46
+ id: string;
49
47
  name: string;
50
48
  number: number;
51
- persona_name?: string;
52
- persona_telephone?: string;
53
- persona_nif?: string | null;
54
49
  updated_at: Date;
55
50
  }
56
51
  export interface IFindRequest {
@@ -65,12 +60,16 @@ export interface IFindResponse {
65
60
  persona_locality: string;
66
61
  persona_country_id: string;
67
62
  }
63
+ export interface IDeletePersonaRequest {
64
+ id: string;
65
+ new_main_persona_id?: string;
66
+ }
68
67
  export interface IRepository {
69
68
  findById(selector: IShared.IFindByIdRequest): Promise<IEntityExtended | null>;
70
69
  findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
71
70
  create(data: ICreateRequest): Promise<IEntityExtended>;
72
71
  update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<IEntityExtended | null>;
73
- deleteOne(selector: IShared.IFindByIdRequest): Promise<IEntityExtended | null>;
72
+ deleteOne(params: IDeletePersonaRequest): Promise<IEntityExtended | null>;
74
73
  findByBasic(data: IBasicSearchRequest): Promise<IShared.IPaginationResponse<IBasicSearchResponse>>;
75
74
  find(data: IFindRequest): Promise<IFindResponse[]>;
76
75
  }
@@ -3,3 +3,4 @@ export declare const createBody: joi.ObjectSchema<any>;
3
3
  export declare const updateBody: joi.ObjectSchema<any>;
4
4
  export declare const findQuery: joi.ObjectSchema<any>;
5
5
  export declare const getBasicSearchParamsValidate: joi.ObjectSchema<any>;
6
+ export declare const deleteQueryValidate: joi.ObjectSchema<any>;
@@ -4,10 +4,15 @@ export type Entity = PurchaseConditions;
4
4
  export declare const Route = "purchase_conditions";
5
5
  export declare const UpperName = "PurchaseConditions";
6
6
  export declare const LowerName: string;
7
+ interface IFindDetailedResponse extends Entity {
8
+ }
9
+ export type IFindByIdResponse = Omit<IFindDetailedResponse, "product_category">;
10
+ export type IFindByOwnerIdResponse = Omit<IFindDetailedResponse, "">;
7
11
  export type IFindRequest = Record<string, unknown>;
12
+ export type IFindResponse = Omit<IFindDetailedResponse, "">;
8
13
  export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {
9
14
  }
10
- export type IFindWithPaginationResponse = IShared.IPaginationResponse<Entity>;
15
+ export type IFindWithPaginationResponse = IShared.IPaginationResponse<Omit<IFindDetailedResponse, "">>;
11
16
  export interface ICreateRequest {
12
17
  provider_id: string;
13
18
  discount: string;
@@ -20,12 +25,13 @@ export interface IUpdateRequest {
20
25
  minimum_quantity?: string;
21
26
  }
22
27
  export interface IRepository {
23
- findById(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
24
- findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<Entity[]>;
25
- find(selector: IFindRequest): Promise<Entity[]>;
28
+ findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse | null>;
29
+ findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
30
+ find(selector: IFindRequest): Promise<IFindResponse[]>;
26
31
  findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
27
32
  create(data: ICreateRequest): Promise<Entity>;
28
- update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
29
- deleteOne(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
33
+ update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<IFindByOwnerIdResponse | null>;
34
+ deleteOne(selector: IShared.IFindByIdRequest): Promise<IFindByOwnerIdResponse | null>;
30
35
  }
31
36
  export type IController = IShared.IEntityWithUserToken<IRepository>;
37
+ export {};
@@ -5,9 +5,7 @@ export declare const Route = "users";
5
5
  export declare const UpperName = "Users";
6
6
  export declare const LowerName: string;
7
7
  export interface IFindByEmailResponse extends Entity {
8
- store_operator: {
9
- location_id: string;
10
- } | null;
8
+ store_operator: Pick<StoreOperator, "id" | "location_id"> | null;
11
9
  }
12
10
  export interface IFindByIdResponse extends Entity {
13
11
  provider: (Providers & {
@@ -8,6 +8,8 @@ import * as Tickets from "./tickets";
8
8
  export import BankData = User.BankData;
9
9
  export import Clients = User.Clients;
10
10
  export import ClientType = User.ClientType;
11
+ export import Chat = Stock.Chat;
12
+ export import ChatToken = Stock.ChatToken;
11
13
  export import Commissioner = User.Commissioner;
12
14
  export import Counter = Stock.Counter;
13
15
  export import Country = User.Country;
@@ -106,3 +108,6 @@ export import GoogleSheetImports = Stock.GoogleSheetImports;
106
108
  export import DocumentLineNote = Stock.DocumentLineNote;
107
109
  export import SavedProviderProposal = Stock.SavedProviderProposal;
108
110
  export import ProductSheet = Stock.ProductSheet;
111
+ export import EmailVerification = Integration.EmailVerification;
112
+ export import Task = Stock.Task;
113
+ export import TaskMessage = Stock.TaskMessage;
@@ -24,6 +24,9 @@ export type File = {
24
24
  owner_id: string;
25
25
  multimedia_id: string;
26
26
  filename: string;
27
+ is_customer: boolean;
28
+ is_private: boolean;
29
+ tags: string;
27
30
  created_by: string;
28
31
  updated_by: string;
29
32
  created_at: Date;
@@ -60,16 +63,20 @@ export type ProjectInfo = {
60
63
  email: string;
61
64
  telephone: string;
62
65
  description: string;
66
+ document_header_id: string | null;
63
67
  created_at: Date;
64
68
  updated_at: Date;
65
69
  };
66
70
  export type EmailLog = {
67
71
  id: string;
68
72
  template: string;
73
+ document_header_id: string | null;
74
+ chat_id: string | null;
69
75
  variables: unknown;
70
76
  mail_options: unknown;
71
77
  smtp_response: unknown;
72
78
  error: string | null;
79
+ retried: boolean;
73
80
  created_at: Date;
74
81
  updated_at: Date;
75
82
  };
@@ -94,3 +101,13 @@ export type EmailTemplateAttachment = {
94
101
  created_at: Date;
95
102
  updated_at: Date;
96
103
  };
104
+ export type EmailVerification = {
105
+ id: string;
106
+ email: string;
107
+ token: string;
108
+ verified: boolean;
109
+ created_by: string;
110
+ created_at: Date;
111
+ updated_by: string;
112
+ updated_at: Date;
113
+ };
@@ -11,6 +11,31 @@ import { ISavedEmPickingData } from "../../modules/stock/savedEmPicking/interfac
11
11
  import { IDocumentLineNoteType } from "../../modules/supply/documentLineNote/interfaces";
12
12
  import { IProductBase } from "../../modules/supply/cabideProduct/interface";
13
13
  import { IProductSheetState } from "../../modules/stock/productGoogleSheets/interface";
14
+ export type Chat = {
15
+ id: string;
16
+ document_header_id: string;
17
+ message: string;
18
+ email_processed: boolean;
19
+ email_delivered: boolean;
20
+ email_opened: boolean;
21
+ email_clicked: boolean;
22
+ whatsapp_sent: boolean;
23
+ read: boolean;
24
+ is_customer: boolean;
25
+ deleted: boolean;
26
+ created_by: string;
27
+ updated_by: string;
28
+ created_at: Date;
29
+ updated_at: Date;
30
+ };
31
+ export type ChatToken = {
32
+ id: string;
33
+ active: boolean;
34
+ created_by: string;
35
+ updated_by: string;
36
+ created_at: Date;
37
+ updated_at: Date;
38
+ };
14
39
  export type Location = {
15
40
  id: string;
16
41
  type_of_location_id: string;
@@ -334,6 +359,7 @@ export type DocumentHeader = {
334
359
  who_handles: string | null;
335
360
  tags: string | null;
336
361
  warning: string | null;
362
+ chat_token_id: string | null;
337
363
  created_at: Date;
338
364
  updated_at: Date;
339
365
  created_by: string;
@@ -357,6 +383,7 @@ export type DocumentLine = {
357
383
  prison: boolean;
358
384
  cativado: boolean;
359
385
  cativado_date: Date | null;
386
+ consignacao: boolean;
360
387
  document_line_group_id: string;
361
388
  document_line_folder_id: string | null;
362
389
  index: number;
@@ -886,10 +913,7 @@ export type StockMovement = {
886
913
  emission_date: string;
887
914
  name: string;
888
915
  pdf_link: string | null;
889
- link_user_type: IDocumentTypeUserType | null;
890
- link_owner_id: string | null;
891
- link_document_header_id: string | null;
892
- link_closed: boolean | null;
916
+ parent_document_header_id: string | null;
893
917
  created_by: string;
894
918
  quantity: number;
895
919
  stock_to_date: number;
@@ -1015,3 +1039,26 @@ export type ProductSheet = {
1015
1039
  created_by: string;
1016
1040
  updated_by: string;
1017
1041
  };
1042
+ export interface Task {
1043
+ id: string;
1044
+ from: string;
1045
+ to: string | null;
1046
+ task: string;
1047
+ read: boolean;
1048
+ finished: boolean;
1049
+ archived: boolean;
1050
+ history: unknown | null;
1051
+ created_at: Date;
1052
+ updated_at: Date;
1053
+ created_by: string;
1054
+ updated_by: string;
1055
+ }
1056
+ export interface TaskMessage {
1057
+ id: string;
1058
+ message: string;
1059
+ task_id: string;
1060
+ created_at: Date;
1061
+ updated_at: Date;
1062
+ created_by: string;
1063
+ updated_by: string;
1064
+ }
@@ -5,6 +5,7 @@ import { messages } from "./messages";
5
5
  import { IDocumentTypeUserType } from "../modules/supply/documentType/interfaces";
6
6
  import { IScheduleType } from "../modules/supply/schedule/interface";
7
7
  import { IWarningType } from "../modules/supply/documentHeader/interfaces";
8
+ import { IProjectInfoType } from "../modules/integration/projectInfo/interfaces";
8
9
  export { messages };
9
10
  type CreatedAt = "created_at";
10
11
  type UpdatedAt = "updated_at";
@@ -126,7 +127,10 @@ export declare enum IBrokerTopic {
126
127
  perform_task = "perform_task",
127
128
  warning_email = "warning_email",
128
129
  retry_errored_emails = "retry_errored_emails",
129
- send_errored_emails_summary = "send_errored_emails_summary"
130
+ send_errored_emails_summary = "send_errored_emails_summary",
131
+ dispatch_chat_message = "dispatch_chat_message",
132
+ create_site_proposal = "create_site_proposal",
133
+ verification_email = "verification_email"
130
134
  }
131
135
  export type IBrokerTopicPayload = {
132
136
  [IBrokerTopic.create]: Record<string, unknown>;
@@ -213,6 +217,7 @@ export type IBrokerTopicPayload = {
213
217
  };
214
218
  [IBrokerTopic.client_notice_schedule_email]: {
215
219
  document_header_id: string;
220
+ chat_id: string;
216
221
  name: string;
217
222
  email: string;
218
223
  };
@@ -236,6 +241,28 @@ export type IBrokerTopicPayload = {
236
241
  [IBrokerTopic.send_errored_emails_summary]: {
237
242
  warningErrors: string[];
238
243
  };
244
+ [IBrokerTopic.dispatch_chat_message]: {
245
+ email: string;
246
+ name: string;
247
+ phone_number: string | null;
248
+ reply_url: string;
249
+ document_header_id: string;
250
+ document_name: string;
251
+ chat_id: string;
252
+ message: string;
253
+ created_by: string;
254
+ };
255
+ [IBrokerTopic.create_site_proposal]: {
256
+ type: IProjectInfoType;
257
+ name: string;
258
+ email: string;
259
+ telephone: string;
260
+ description: string;
261
+ };
262
+ [IBrokerTopic.verification_email]: {
263
+ email: string;
264
+ token: string;
265
+ };
239
266
  };
240
267
  export interface IBrokerMessage<T extends IBrokerTopic = IBrokerTopic> {
241
268
  topic: T;
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "typescript",
10
10
  "helper"
11
11
  ],
12
- "version": "0.22.102",
12
+ "version": "0.22.104",
13
13
  "main": "./dist/index.min.js",
14
14
  "types": "./dist/index.d.ts",
15
15
  "files": [
@@ -34,16 +34,16 @@
34
34
  "prepack": "npm run lint && npm run typecheck && npm run build && npm run start"
35
35
  },
36
36
  "dependencies": {
37
- "joi": "^17.13.1"
37
+ "joi": "^17.13.3"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@rollup/plugin-terser": "^0.4.4",
41
41
  "@rollup/plugin-typescript": "^11.1.6",
42
- "@types/node": "^20.12.13",
43
- "@typescript-eslint/eslint-plugin": "^7.11.0",
44
- "@typescript-eslint/parser": "^7.11.0",
42
+ "@types/node": "^20.16.3",
43
+ "@typescript-eslint/eslint-plugin": "^7.18.0",
44
+ "@typescript-eslint/parser": "^7.18.0",
45
45
  "eslint": "^8.57.0",
46
- "rollup": "^4.18.0",
47
- "tslib": "^2.6.2"
46
+ "rollup": "^4.21.2",
47
+ "tslib": "^2.7.0"
48
48
  }
49
49
  }