@nomalism-com/types 0.49.42 → 0.50.1

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 (99) hide show
  1. package/dist/index.cjs +654 -844
  2. package/dist/index.js +652 -832
  3. package/dist/main.d.ts +3 -13
  4. package/dist/modules/document/NRCL/interface.d.ts +0 -2
  5. package/dist/modules/document/billOfLading/interfaces.d.ts +9 -0
  6. package/dist/modules/document/materialEntrance/interfaces.d.ts +0 -6
  7. package/dist/modules/document/order/interfaces.d.ts +0 -14
  8. package/dist/modules/document/providerCreditNoteFromReturn/interfaces.d.ts +1 -1
  9. package/dist/modules/document/providerFinancialCreditNote/interfaces.d.ts +1 -1
  10. package/dist/modules/document/providerServiceInvoice/interfaces.d.ts +1 -1
  11. package/dist/modules/document/upfrontReturn/interfaces.d.ts +0 -1
  12. package/dist/modules/documentManagement/multimedia/interfaces.d.ts +0 -3
  13. package/dist/modules/integration/emailLog/interfaces.d.ts +0 -3
  14. package/dist/modules/integration/emailTemplateAttachment/interfaces.d.ts +0 -13
  15. package/dist/modules/integration/emailVerification/interfaces.d.ts +0 -2
  16. package/dist/modules/integration/googleFilePermission/interfaces.d.ts +0 -8
  17. package/dist/modules/integration/observation/interfaces.d.ts +2 -7
  18. package/dist/modules/integration/patchNotes/interfaces.d.ts +0 -4
  19. package/dist/modules/integration/projectInfo/interfaces.d.ts +0 -2
  20. package/dist/modules/integration/settings/interfaces.d.ts +0 -1
  21. package/dist/modules/llm/llm/interfaces.d.ts +0 -2
  22. package/dist/modules/print/printer/interfaces.d.ts +0 -1
  23. package/dist/modules/sms/smsSender/interfaces.d.ts +0 -7
  24. package/dist/modules/sms/smsTemplate/interfaces.d.ts +0 -9
  25. package/dist/modules/stock/chat/interfaces.d.ts +0 -1
  26. package/dist/modules/stock/conferirEncomenda/interface.d.ts +0 -3
  27. package/dist/modules/stock/emailAccount/interface.d.ts +0 -1
  28. package/dist/modules/stock/gmails/interface.d.ts +0 -4
  29. package/dist/modules/stock/googleSheetPool/interface.d.ts +0 -2
  30. package/dist/modules/stock/location/interface.d.ts +2 -50
  31. package/dist/modules/stock/mobilePrint/interface.d.ts +0 -2
  32. package/dist/modules/stock/productGoogleSheets/interface.d.ts +33 -8
  33. package/dist/modules/stock/productImage/interface.d.ts +2 -19
  34. package/dist/modules/stock/promotion/interface.d.ts +0 -39
  35. package/dist/modules/stock/queryList/interfaces.d.ts +0 -18
  36. package/dist/modules/stock/queryParameter/interfaces.d.ts +0 -34
  37. package/dist/modules/stock/recurrentTasks/interface.d.ts +0 -2
  38. package/dist/modules/stock/returnReason/interfaces.d.ts +0 -9
  39. package/dist/modules/stock/saft/interfaces.d.ts +60 -0
  40. package/dist/modules/stock/stockMovement/interface.d.ts +5 -6
  41. package/dist/modules/stock/task/interface.d.ts +0 -2
  42. package/dist/modules/stock/unitOfMeasure/interface.d.ts +0 -9
  43. package/dist/modules/stock/vatTax/interface.d.ts +0 -9
  44. package/dist/modules/stock/vatTaxZone/interface.d.ts +0 -9
  45. package/dist/modules/supply/currentAccount/interface.d.ts +0 -88
  46. package/dist/modules/supply/documentHeader/interfaces.d.ts +78 -1
  47. package/dist/modules/supply/documentHeaderHistory/interfaces.d.ts +0 -1
  48. package/dist/modules/supply/documentHeaderSurvey/interfaces.d.ts +0 -2
  49. package/dist/modules/supply/documentLine/interfaces.d.ts +0 -5
  50. package/dist/modules/supply/documentSet/interface.d.ts +0 -8
  51. package/dist/modules/supply/documentType/interfaces.d.ts +12 -2
  52. package/dist/modules/supply/externalDocumentHeader/interface.d.ts +2 -0
  53. package/dist/modules/supply/externalDocumentType/interface.d.ts +0 -7
  54. package/dist/modules/supply/payment/interface.d.ts +0 -5
  55. package/dist/modules/supply/paymentBatch/interface.d.ts +0 -2
  56. package/dist/modules/supply/preSale/interface.d.ts +0 -1
  57. package/dist/modules/supply/preSaleProduct/interface.d.ts +0 -1
  58. package/dist/modules/supply/schedule/interface.d.ts +0 -1
  59. package/dist/modules/tickets/tickets/interfaces.d.ts +1 -2
  60. package/dist/modules/ui/sidemenuHighlight/interface.d.ts +0 -11
  61. package/dist/modules/ui/storeOperatorSaftLock/interface.d.ts +9 -0
  62. package/dist/modules/ui/tenantSaftLock/interface.d.ts +10 -0
  63. package/dist/modules/user/bankData/interface.d.ts +0 -9
  64. package/dist/modules/user/clientType/interface.d.ts +0 -16
  65. package/dist/modules/user/clients/interface.d.ts +1 -7
  66. package/dist/modules/user/commissioner/interface.d.ts +0 -12
  67. package/dist/modules/user/country/interface.d.ts +0 -14
  68. package/dist/modules/user/deliveryMethods/interfaces.d.ts +0 -1
  69. package/dist/modules/user/favorites/interfaces.d.ts +0 -3
  70. package/dist/modules/user/language/interface.d.ts +0 -9
  71. package/dist/modules/user/maturityDates/interfaces.d.ts +0 -1
  72. package/dist/modules/user/paymentMethods/interfaces.d.ts +4 -15
  73. package/dist/modules/user/persona/interface.d.ts +1 -4
  74. package/dist/modules/user/providerType/interface.d.ts +0 -13
  75. package/dist/modules/user/providers/interface.d.ts +0 -8
  76. package/dist/modules/user/purchaseConditions/interface.d.ts +0 -9
  77. package/dist/modules/user/reasonForExemption/interface.d.ts +0 -3
  78. package/dist/modules/user/segmentsArea/interface.d.ts +0 -17
  79. package/dist/modules/user/sessions/interface.d.ts +1 -0
  80. package/dist/modules/user/shippings/interface.d.ts +0 -8
  81. package/dist/modules/user/storeOperator/interface.d.ts +1 -2
  82. package/dist/modules/user/swift/interface.d.ts +0 -17
  83. package/dist/modules/user/systemModule/interface.d.ts +0 -11
  84. package/dist/modules/user/timeSheet/interfaces.d.ts +0 -3
  85. package/dist/modules/user/userTokens/interface.d.ts +0 -6
  86. package/dist/modules/user/users/interface.d.ts +2 -29
  87. package/dist/modules/view/adminPanel/interfaces.d.ts +0 -3
  88. package/dist/modules/view/errorLog/interfaces.d.ts +0 -1
  89. package/dist/modules/view/webSocket/interfaces.d.ts +0 -1
  90. package/dist/shared/entities/integration.d.ts +0 -13
  91. package/dist/shared/entities/stock.d.ts +18 -31
  92. package/dist/shared/entities/user.d.ts +2 -17
  93. package/dist/shared/errors/integrationErrors.d.ts +0 -8
  94. package/dist/shared/errors/stockErrors.d.ts +0 -8
  95. package/dist/shared/interface.d.ts +2 -34
  96. package/package.json +2 -2
  97. package/dist/modules/integration/observationType/interfaces.d.ts +0 -25
  98. package/dist/modules/stock/typeOfLocation/interface.d.ts +0 -30
  99. package/dist/modules/user/userPositions/interface.d.ts +0 -28
@@ -1,40 +1 @@
1
- import { Promotion } from "../../../shared/entities/stock";
2
- import * as IShared from "../../../shared/interface";
3
- export type Entity = Promotion;
4
1
  export declare const Route = "promotion";
5
- type IFindDetailedResponse = Entity;
6
- export type IFindByIdResponse = Omit<IFindDetailedResponse, "">;
7
- export type IFindByOwnerIdResponse = Omit<IFindDetailedResponse, "">;
8
- export type IFindRequest = Record<string, unknown>;
9
- export type IFindResponse = Omit<IFindDetailedResponse, "">;
10
- export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {
11
- }
12
- export type IFindWithPaginationResponse = IShared.IPaginationResponse<Omit<IFindDetailedResponse, "">>;
13
- export interface ICreateRequest {
14
- name: string;
15
- initial_date: Date;
16
- final_date: Date;
17
- active_for_purchases_above?: number;
18
- free_shipping_for_purchases_above?: number | null;
19
- discount: number;
20
- }
21
- export interface IUpdateRequest {
22
- name?: string;
23
- initial_date?: Date;
24
- final_date?: Date;
25
- active_for_purchases_above?: number;
26
- free_shipping_for_purchases_above?: number | null;
27
- discount?: number;
28
- }
29
- export interface IRepository {
30
- findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse | null>;
31
- findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
32
- findMinified(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
33
- find(selector: IFindRequest): Promise<IFindResponse[]>;
34
- findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
35
- create(data: ICreateRequest): Promise<Entity>;
36
- update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
37
- deleteOne(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
38
- }
39
- export type IController = IShared.IEntityWithUserToken<IRepository>;
40
- export {};
@@ -1,17 +1,6 @@
1
1
  import { QueryList, QueryParameter } from "../../../shared/entities/stock";
2
2
  import * as IShared from "../../../shared/interface";
3
- export type Entity = QueryList;
4
3
  export declare const Route = "query";
5
- export interface ICreateRequest {
6
- label: string;
7
- code: string;
8
- group: string | null;
9
- }
10
- export interface IUpdateRequest {
11
- label?: string;
12
- code?: string;
13
- group?: string | null;
14
- }
15
4
  export interface IFindResponse extends QueryList {
16
5
  parameters: QueryParameter[];
17
6
  }
@@ -30,12 +19,5 @@ export interface IExecuteResponse extends IFindResponse {
30
19
  }
31
20
  export interface IRepository {
32
21
  find(): Promise<IFindResponse[]>;
33
- findById(selector: IShared.IFindByIdRequest): Promise<IFindResponse | null>;
34
- create(data: ICreateRequest): Promise<IFindResponse>;
35
- update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<IFindResponse | null>;
36
- deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
37
22
  }
38
- export type IApi = Omit<IRepository, "execute"> & {
39
- execute(data: IExecuteRequest): Promise<IExecuteResponse>;
40
- };
41
23
  export type IController = IShared.IEntityWithUserToken<IRepository>;
@@ -1,7 +1,5 @@
1
1
  import { QueryParameter } from "../../../shared/entities/stock";
2
- import * as IShared from "../../../shared/interface";
3
2
  export type Entity = QueryParameter;
4
- export declare const Route = "query_parameter";
5
3
  export declare const QueryParameterDatatypeEnum: {
6
4
  boolean: "boolean";
7
5
  decimal: "decimal";
@@ -15,35 +13,3 @@ export declare const QueryParameterDatatypeEnum: {
15
13
  hidden: "hidden";
16
14
  };
17
15
  export type IQueryParameterDatatype = (typeof QueryParameterDatatypeEnum)[keyof typeof QueryParameterDatatypeEnum];
18
- export declare const queryParametersDatatypes: string[];
19
- export interface ICreateRequest {
20
- label: string;
21
- accessor: string;
22
- datatype: IQueryParameterDatatype;
23
- suffix: string | null;
24
- preffix: string | null;
25
- input: boolean;
26
- width: number | null;
27
- output: boolean;
28
- query_id: string;
29
- }
30
- export interface IUpdateRequest {
31
- label?: string;
32
- accessor?: string;
33
- width?: number;
34
- datatype?: IQueryParameterDatatype;
35
- suffix?: string | null;
36
- preffix?: string | null;
37
- input?: boolean;
38
- output?: boolean;
39
- }
40
- export type IFindByOwnerIdResponse = Entity;
41
- export interface IRepository {
42
- find(): Promise<Entity[]>;
43
- findById(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
44
- create(data: ICreateRequest): Promise<Entity>;
45
- update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
46
- deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
47
- findByOwnerId(selector: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
48
- }
49
- export type IController = IShared.IEntityWithUserToken<IRepository>;
@@ -1,7 +1,5 @@
1
- import * as IShared from "../../../shared/interface";
2
1
  export declare const Route = "recurrent_tasks";
3
2
  export interface IRepository {
4
3
  from_master(): Promise<string>;
5
4
  from_master_checked(): Promise<string>;
6
5
  }
7
- export type IController = IShared.IEntityWithUserToken<IRepository>;
@@ -2,16 +2,7 @@ import { ReturnReason } from "../../../shared/entities/stock";
2
2
  import * as IShared from "../../../shared/interface";
3
3
  export type Entity = ReturnReason;
4
4
  export declare const Route = "return_reason";
5
- export interface ICreateRequest {
6
- reason: string;
7
- }
8
- export interface IUpdateRequest {
9
- reason: string;
10
- }
11
5
  export interface IRepository {
12
- create(data: ICreateRequest): Promise<Entity>;
13
- update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
14
6
  find(): Promise<Entity[]>;
15
- deleteOne(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
16
7
  }
17
8
  export type IController = IShared.IEntityWithUserToken<IRepository>;
@@ -17,3 +17,63 @@ export interface ICloseSeriesRequest {
17
17
  document_saft_counter_id: string;
18
18
  justificacao?: string;
19
19
  }
20
+ /** Ponto 35 — webservices da AT. */
21
+ export type IAtWebservice = "series" | "guias" | "faturas";
22
+ export interface IAtCheck {
23
+ ok: boolean;
24
+ message: string;
25
+ }
26
+ export interface IAtWebserviceStatus {
27
+ service: IAtWebservice;
28
+ label: string;
29
+ setting_key: string;
30
+ enabled: boolean;
31
+ environment: string;
32
+ endpoint: string;
33
+ credentials: IAtCheck;
34
+ certificate: IAtCheck;
35
+ public_key: IAtCheck;
36
+ connectivity: IAtCheck;
37
+ authentication: IAtCheck;
38
+ }
39
+ export interface IAtWebserviceAuditRequest {
40
+ service?: IAtWebservice;
41
+ success?: "true" | "false";
42
+ current_page: number;
43
+ per_page: number;
44
+ }
45
+ export interface IAtWebserviceAudit {
46
+ id: string;
47
+ service: string;
48
+ operation: string;
49
+ environment: string;
50
+ document_header_id: string | null;
51
+ reference: string | null;
52
+ success: boolean;
53
+ return_code: string | null;
54
+ return_message: string | null;
55
+ at_doc_code_id: string | null;
56
+ request: string | null;
57
+ response: string | null;
58
+ duration_ms: number;
59
+ created_at: Date;
60
+ created_by: string | null;
61
+ }
62
+ export interface IAtWebserviceAuditResponse {
63
+ data: IAtWebserviceAudit[];
64
+ total: number;
65
+ current_page: number;
66
+ per_page: number;
67
+ }
68
+ export interface IAtCommunicationResult {
69
+ service: IAtWebservice;
70
+ success: boolean;
71
+ return_code: string | null;
72
+ return_message: string | null;
73
+ at_doc_code_id: string | null;
74
+ }
75
+ export interface IAtDocCodesRequest {
76
+ document_header_ids: string[];
77
+ }
78
+ /** document_header_id → ATDocCodeID devolvido pela AT na comunicação da guia. */
79
+ export type IAtDocCodesResponse = Record<string, string>;
@@ -1,23 +1,24 @@
1
1
  import { StockMovement } from "../../../shared/entities/stock";
2
2
  import * as IShared from "../../../shared/interface";
3
- export type Entity = StockMovement;
4
3
  export declare const Route = "stock_movement";
5
4
  export interface IFindByProviderResponse extends Omit<StockMovement, "product_id" | "stock_to_date"> {
6
5
  reference: string;
7
6
  }
8
7
  export type IFindByOwnerIdResponse = Omit<StockMovement, "document_line_id" | "product_id">;
8
+ export interface IFindMonthlyConsumptionResponse {
9
+ month: string;
10
+ quantity: number;
11
+ }
9
12
  export declare const ExportFormatEnum: {
10
13
  csv: "csv";
11
14
  xml: "xml";
12
15
  };
13
16
  export type IExportFormat = (typeof ExportFormatEnum)[keyof typeof ExportFormatEnum];
14
- export declare const exportFormats: string[];
15
17
  export declare const ExportVersionEnum: {
16
18
  v1_02: "v1_02";
17
19
  v2_01: "v2_01";
18
20
  };
19
21
  export type IExportVersion = (typeof ExportVersionEnum)[keyof typeof ExportVersionEnum];
20
- export declare const exportVersions: string[];
21
22
  export interface IExportRequest {
22
23
  date: Date;
23
24
  format: IExportFormat;
@@ -33,13 +34,11 @@ export interface IExportCsvResponse {
33
34
  unitOfMeasure: string;
34
35
  closingStockValue: number;
35
36
  }
36
- export interface IFindStockMovementPaginatedRequest extends IShared.IFindByOwnerIdRequest, IShared.IPaginationRequest {
37
- }
38
37
  export interface IRepository {
39
38
  findByProvider(selector: IShared.IFindByIdNumberRequest): Promise<IFindByProviderResponse[]>;
40
39
  findByOwnerId(selector: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
41
40
  exportCsv(selector: IExportRequest): Promise<IExportCsvResponse[]>;
42
- findStockMovementPaginated(selector: IFindStockMovementPaginatedRequest): Promise<IShared.IPaginationResponse<IFindByOwnerIdResponse>>;
41
+ findMonthlyConsumption(selector: IShared.IFindByOwnerIdRequest): Promise<IFindMonthlyConsumptionResponse[]>;
43
42
  }
44
43
  export interface IController extends IRepository {
45
44
  findByOwnerId(selector: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
@@ -8,7 +8,6 @@ export declare const ITaskStatusDataTypeEnum: {
8
8
  Problem: "Problem";
9
9
  };
10
10
  export type ITaskStatusDataType = (typeof ITaskStatusDataTypeEnum)[keyof typeof ITaskStatusDataTypeEnum];
11
- export declare const taskStatusDataType: string[];
12
11
  export type ICreateRequest = {
13
12
  task: string;
14
13
  };
@@ -35,7 +34,6 @@ export declare const IHistoryStatusDataTypeEnum: {
35
34
  deleted_message: "deleted_message";
36
35
  };
37
36
  export type IHistoryStatusDataType = (typeof IHistoryStatusDataTypeEnum)[keyof typeof IHistoryStatusDataTypeEnum];
38
- export declare const historyStatusDataType: string[];
39
37
  export interface ITaskHistoryData {
40
38
  status: IHistoryStatusDataType | null;
41
39
  data: string;
@@ -3,13 +3,8 @@ import * as IShared from "../../../shared/interface";
3
3
  export type Entity = UnitOfMeasure;
4
4
  export declare const Route = "unit_of_measure";
5
5
  type IFindDetailedResponse = Entity;
6
- export type IFindByIdResponse = Omit<IFindDetailedResponse, "">;
7
- export type IFindByOwnerIdResponse = Omit<IFindDetailedResponse, "">;
8
6
  export type IFindRequest = Record<string, unknown>;
9
7
  export type IFindResponse = Omit<IFindDetailedResponse, "">;
10
- export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {
11
- }
12
- export type IFindWithPaginationResponse = IShared.IPaginationResponse<Omit<IFindDetailedResponse, "">>;
13
8
  export interface ICreateRequest {
14
9
  name: string;
15
10
  notation: string;
@@ -29,11 +24,7 @@ export interface IUpdateRequest {
29
24
  divisible?: boolean;
30
25
  }
31
26
  export interface IRepository {
32
- findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse | null>;
33
- findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
34
- findMinified(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
35
27
  find(selector: IFindRequest): Promise<IFindResponse[]>;
36
- findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
37
28
  create(data: ICreateRequest): Promise<Entity>;
38
29
  update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
39
30
  deleteOne(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
@@ -3,13 +3,8 @@ import * as IShared from "../../../shared/interface";
3
3
  export type Entity = VatTax;
4
4
  export declare const Route = "vat_tax";
5
5
  type IFindDetailedResponse = Entity;
6
- export type IFindByIdResponse = Omit<IFindDetailedResponse, "">;
7
- export type IFindByOwnerIdResponse = Omit<IFindDetailedResponse, "">;
8
6
  export type IFindRequest = Record<string, unknown>;
9
7
  export type IFindResponse = Omit<IFindDetailedResponse, "">;
10
- export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {
11
- }
12
- export type IFindWithPaginationResponse = IShared.IPaginationResponse<Omit<IFindDetailedResponse, "">>;
13
8
  export interface ICreateRequest {
14
9
  name: string;
15
10
  saft_code: string;
@@ -21,11 +16,7 @@ export interface IUpdateRequest {
21
16
  external_id?: string | null;
22
17
  }
23
18
  export interface IRepository {
24
- findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse | null>;
25
- findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
26
- findMinified(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
27
19
  find(selector: IFindRequest): Promise<IFindResponse[]>;
28
- findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
29
20
  create(data: ICreateRequest): Promise<Entity>;
30
21
  update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
31
22
  deleteOne(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
@@ -5,13 +5,8 @@ export declare const Route = "vat_tax_zone";
5
5
  interface IFindDetailedResponse extends Entity {
6
6
  vat_tax: VatTax;
7
7
  }
8
- export type IFindByIdResponse = Omit<IFindDetailedResponse, "vat_tax">;
9
- export type IFindByOwnerIdResponse = Omit<IFindDetailedResponse, "vat_tax">;
10
8
  export type IFindRequest = Record<string, unknown>;
11
9
  export type IFindResponse = Omit<IFindDetailedResponse, "">;
12
- export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {
13
- }
14
- export type IFindWithPaginationResponse = IShared.IPaginationResponse<Omit<IFindDetailedResponse, "vat_tax">>;
15
10
  export interface ICreateRequest {
16
11
  name: string;
17
12
  value: number;
@@ -29,11 +24,7 @@ export interface IUpdateRequest {
29
24
  external_id?: string | null;
30
25
  }
31
26
  export interface IRepository {
32
- findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse | null>;
33
- findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
34
- findMinified(selector: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
35
27
  find(selector: IFindRequest): Promise<IFindResponse[]>;
36
- findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
37
28
  create(data: ICreateRequest): Promise<IFindResponse>;
38
29
  update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<IFindResponse | null>;
39
30
  deleteOne(selector: IShared.IFindByIdRequest): Promise<IFindResponse | null>;
@@ -1,28 +1,6 @@
1
- import { DocumentHeader, Payment } from "../../../shared/entities/stock";
2
1
  import * as IShared from "../../../shared/interface";
3
- import * as IObservation from "../../integration/observation/interfaces";
4
2
  import { type ICreateFromHeaderRequest } from "../documentHeader/interfaces";
5
- export type Entity = Payment;
6
3
  export declare const Route = "current_account";
7
- type IEntityExtended = Entity;
8
- export type IFindByIdResponse = Omit<IEntityExtended, "">;
9
- export type IFindByOwnerIdResponse = Omit<IEntityExtended, "">;
10
- export type IFindRequest = Record<string, unknown>;
11
- export type IFindResponse = Omit<IEntityExtended, "">;
12
- export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {
13
- }
14
- export type IFindWithPaginationResponse = IShared.IPaginationResponse<Omit<IEntityExtended, "">>;
15
- export interface ICreateForThisDocumentHeaderRequest {
16
- date: Date;
17
- debit: number;
18
- credit: number;
19
- payment_method_id?: string | null;
20
- payment_method?: string | null;
21
- notes: string | null;
22
- }
23
- export interface ICreateRequest extends ICreateForThisDocumentHeaderRequest {
24
- document_header_id: string;
25
- }
26
4
  export interface ICurrentAccountNotes {
27
5
  date: string;
28
6
  credit: number | null;
@@ -59,76 +37,11 @@ export interface IFindCurrentAccountByOwnerIdResponse {
59
37
  href?: string | null;
60
38
  affected: ICurrentAccountAffected[];
61
39
  }
62
- export interface IUnpaidPurchasesRequest {
63
- provider_id: string;
64
- client_id: string | null;
65
- }
66
- export interface IUnpaidByDatePurchasesRequest {
67
- due_date: Date;
68
- }
69
- export type IPaymentOrigin = "CC Fornecedor" | "CC Cliente" | "CC Fornecedor (Descontinuado)" | "CC Cliente (Descontinuado)";
70
- export interface IUnpaidPurchasesResponse extends Pick<Entity, "date" | "debit" | "credit"> {
71
- document_header: Pick<DocumentHeader, "emission_date" | "pdf_link" | "id">;
72
- origin: IPaymentOrigin;
73
- document_type_code: string | null;
74
- document_name: string;
75
- user?: {
76
- user_name: string;
77
- provider_id: string;
78
- client_id?: string | null;
79
- };
80
- maturity_days: number;
81
- observations: IObservation.IFindByOwnerResponse[];
82
- }
83
- export interface IPaymentsNotExportedRequest {
84
- whiteList?: string[];
85
- }
86
- export interface IPaymentsNotExportedResponse {
87
- iban: string;
88
- payment_ids: string[];
89
- npf_dh: {
90
- id: string;
91
- name: string;
92
- pdf_link: string | null;
93
- total: number;
94
- }[];
95
- provider: string;
96
- value: number;
97
- }
98
- export interface IExportPaymentsRequest {
99
- provider: string;
100
- value: number;
101
- npf_ids?: string[];
102
- }
103
- export type IBatchType = "national" | "international" | "null";
104
- export interface IPaymentsBatchNpfDh {
105
- id: string;
106
- name: string;
107
- sent: string | null;
108
- owner_id: string;
109
- owner_number: number;
110
- owner_name: string;
111
- external_document_header_id: string | null;
112
- pdf_link: string | null;
113
- total: number;
114
- }
115
- export interface IPaymentsBatchResponse {
116
- batch_id: string;
117
- batch_value: number;
118
- batch_type: IBatchType | null;
119
- multimedia_id: string | null;
120
- times_downloaded: number;
121
- npf_dh: IPaymentsBatchNpfDh[];
122
- updated_at: Date;
123
- updated_by: string;
124
- created_at: Date;
125
- }
126
40
  export declare const IExportCurrentAccountOutputEnum: {
127
41
  csv: "csv";
128
42
  pdf: "pdf";
129
43
  };
130
44
  export type IExportCurrentAccountOutput = (typeof IExportCurrentAccountOutputEnum)[keyof typeof IExportCurrentAccountOutputEnum];
131
- export declare const IExportCurrentAccountOutputOptions: string[];
132
45
  export interface IExportCurrentAccountRequest {
133
46
  token: string;
134
47
  owner_id: string;
@@ -153,4 +66,3 @@ export interface IRepository {
153
66
  findClientUnpaidDebit(params: IShared.IFindByOwnerIdRequest): Promise<IDocumentResponse[]>;
154
67
  }
155
68
  export type IController = IShared.IEntityWithUserToken<IRepository>;
156
- export {};
@@ -118,7 +118,7 @@ export interface IDeliveryAdresses {
118
118
  export interface ICreateFromHeaderRequest {
119
119
  document_type_id: number;
120
120
  document_set_id?: string;
121
- external_document_name?: string;
121
+ external_reference?: string;
122
122
  emission_date?: Date;
123
123
  account_code?: string | null;
124
124
  from_header: string[];
@@ -135,6 +135,81 @@ export interface ICreateFromHeaderRequest {
135
135
  copy_from_document?: string | null;
136
136
  owner_ref_document?: string | null;
137
137
  document_line_note?: ICreateFromHeaderDocumentLineNote;
138
+ rectification?: IRectificationInput;
139
+ /** NC de quantidade: quantidade a creditar por linha (omissa = a linha toda). */
140
+ line_quantities?: ICreateFromHeaderLineQuantity[];
141
+ /** Recuperação manual (FTM/FRM/FSM, ADM, NCRM/NDM): valores escritos no documento em papel. */
142
+ recovery?: ICreateFromHeaderRecovery;
143
+ }
144
+ export interface ICreateFromHeaderLineQuantity {
145
+ document_line_id: string;
146
+ quantity: number;
147
+ }
148
+ export interface ICreateFromHeaderRecovery {
149
+ /** GrossTotal do documento em papel (total com IVA). */
150
+ gross_total: number;
151
+ /** NetTotal do documento em papel (base tributável). */
152
+ net_total: number;
153
+ /** TaxPayable do documento em papel (total de IVA). */
154
+ tax_payable: number;
155
+ lines: ICreateFromHeaderRecoveryLine[];
156
+ }
157
+ export interface ICreateFromHeaderRecoveryLine {
158
+ /** Omitido no adiantamento (a linha é criada com o documento). */
159
+ document_line_id?: string;
160
+ /** Preço unitário com IVA, antes do desconto. */
161
+ unit_price: number;
162
+ /** Total da linha com IVA. */
163
+ gross_total: number;
164
+ /** Motivo de isenção (código SAF-T), só em linhas a 0%. */
165
+ tax_exemption_code?: string | null;
166
+ }
167
+ export declare const RectificationTypeEnum: {
168
+ value: "value";
169
+ tax: "tax";
170
+ };
171
+ export type IRectificationType = (typeof RectificationTypeEnum)[keyof typeof RectificationTypeEnum];
172
+ export declare const rectificationTypes: string[];
173
+ export interface IRectificationLineInput {
174
+ document_line_id: string;
175
+ /** Valor com IVA a retificar nesta linha (retificação de valor). */
176
+ value?: number;
177
+ /** Taxa de IVA correta (retificação de IVA). */
178
+ tax_percentage?: number;
179
+ }
180
+ export interface IRectificationInput {
181
+ type: IRectificationType;
182
+ /** Valor total com IVA, repartido pelas linhas (retificação de valor). */
183
+ total?: number;
184
+ lines?: IRectificationLineInput[];
185
+ }
186
+ export interface IRectificationPreviewRequest {
187
+ document_type_id: number;
188
+ from_header: string[];
189
+ from_lines: string[];
190
+ rectification?: IRectificationInput;
191
+ }
192
+ export interface IRectificationPreviewLine {
193
+ document_line_id: string;
194
+ product_reference: string | null;
195
+ product_designation: string;
196
+ quantity: number;
197
+ /** Saldo com IVA da linha (fatura mais notas de débito menos notas de crédito). */
198
+ balance_gross_total: number;
199
+ current_tax_percentage: number;
200
+ /** Tipo de retificação já usado nesta linha. */
201
+ locked_type: "quantity" | "value" | "tax" | null;
202
+ tax_percentage: number;
203
+ net_total: number;
204
+ tax_total: number;
205
+ gross_total: number;
206
+ }
207
+ export interface IRectificationPreviewResponse {
208
+ lines: IRectificationPreviewLine[];
209
+ tax_percentages: number[];
210
+ net_total: number;
211
+ tax_total: number;
212
+ gross_total: number;
138
213
  }
139
214
  export type ICreateFromHeaderDocumentLineNote = {
140
215
  note: string;
@@ -233,6 +308,7 @@ export interface ISendClientNotificationRequest {
233
308
  export interface IDocumentPdfRequest {
234
309
  token?: string;
235
310
  only_original?: boolean;
311
+ reason?: string;
236
312
  }
237
313
  export interface IFindByTypeRequest {
238
314
  documentTypeCodes: IDocumentType.IDocumentTypeCodeType[];
@@ -320,6 +396,7 @@ export interface IRepository {
320
396
  getActions(selector: IShared.IFindByIdRequest): Promise<IGetActionsResponse[]>;
321
397
  create(data: ICreateRequest): Promise<ICreateResponse>;
322
398
  createFromHeader(data: ICreateFromHeaderRequest): Promise<void>;
399
+ rectificationPreview(data: IRectificationPreviewRequest): Promise<IRectificationPreviewResponse>;
323
400
  update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>;
324
401
  transferClientOwnership(params: ITransferOwnershipRequest): Promise<void>;
325
402
  deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
@@ -1,6 +1,5 @@
1
1
  import { DocumentHeaderHistory } from "../../../shared/entities/stock";
2
2
  import * as IShared from "../../../shared/interface";
3
- export type Entity = DocumentHeaderHistory;
4
3
  export declare const Route = "document_header_history";
5
4
  export type IFindByOwnerIdResponse = Omit<DocumentHeaderHistory, "id" | "document_header_id">;
6
5
  export interface IRepository {
@@ -2,8 +2,6 @@ import Nomalism from "../../..";
2
2
  import { DocumentHeaderSurvey } from "../../../shared/entities/stock";
3
3
  export type IEntity = DocumentHeaderSurvey;
4
4
  export declare const Route = "document_header_survey";
5
- export type ICreateRequest = Pick<IEntity, "owner_id" | "document_header_id" | "persona_id">;
6
- export type IResponse = IEntity;
7
5
  export interface IFindRequest {
8
6
  date_start: Date;
9
7
  date_end: Date;
@@ -122,11 +122,6 @@ export interface IUpdateManyByDocumentHeaderRequest {
122
122
  sent_to_provider?: boolean;
123
123
  sent_to_client?: IWarningType;
124
124
  }
125
- export interface IUpdateLineStatesTriggerResponse {
126
- document_header_id: string;
127
- trigger_event: boolean;
128
- broker_topic?: IShared.IBrokerTopic;
129
- }
130
125
  export interface IPrintLabelParamsRequest {
131
126
  document_line_ids: string;
132
127
  }
@@ -6,16 +6,8 @@ export interface ICreateRequest {
6
6
  document_set_id: number | null;
7
7
  name: string;
8
8
  }
9
- export interface IUpdateRequest {
10
- document_set_id?: number | null;
11
- name?: string;
12
- }
13
9
  export interface IRepository {
14
- findById(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
15
- find(): Promise<Entity[]>;
16
10
  findMinified(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
17
11
  create(data: ICreateRequest): Promise<Entity>;
18
- update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
19
- deleteOne(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
20
12
  }
21
13
  export type IController = IShared.IEntityWithUserToken<IRepository>;
@@ -10,7 +10,6 @@ export declare const DocumentTypeUserTypeEnum: {
10
10
  self: "self";
11
11
  };
12
12
  export type IDocumentTypeUserType = (typeof DocumentTypeUserTypeEnum)[keyof typeof DocumentTypeUserTypeEnum];
13
- export declare const documentTypeUserTypes: string[];
14
13
  export declare const DocumentTypeCodeTypeEnum: {
15
14
  PC: "PC";
16
15
  FTPF: "FTPF";
@@ -21,7 +20,19 @@ export declare const DocumentTypeCodeTypeEnum: {
21
20
  FS: "FS";
22
21
  FR: "FR";
23
22
  NC: "NC";
23
+ NCR: "NCR";
24
+ NCRM: "NCRM";
25
+ NCRD: "NCRD";
26
+ ND: "ND";
27
+ NDM: "NDM";
28
+ NDD: "NDD";
24
29
  GT: "GT";
30
+ GR: "GR";
31
+ GDF: "GDF";
32
+ GTNV: "GTNV";
33
+ GRNV: "GRNV";
34
+ GTFNV: "GTFNV";
35
+ GDFNV: "GDFNV";
25
36
  RE: "RE";
26
37
  LNC: "LNC";
27
38
  EST: "EST";
@@ -72,7 +83,6 @@ export declare const DocumentTypeCodeTypeEnum: {
72
83
  CAT: "CAT";
73
84
  };
74
85
  export type IDocumentTypeCodeType = (typeof DocumentTypeCodeTypeEnum)[keyof typeof DocumentTypeCodeTypeEnum];
75
- export declare const documentTypeCodeTypes: string[];
76
86
  export interface IEntityExtended extends DocumentType {
77
87
  external_document_type: ExternalDocumentType | null;
78
88
  }
@@ -8,11 +8,13 @@ export interface IFindByOwnerIdItem {
8
8
  label: string;
9
9
  emission_date: Date;
10
10
  external_id: string | null;
11
+ certified: boolean;
11
12
  pdf_link: string | null;
12
13
  is_void: boolean;
13
14
  created_by: string;
14
15
  can_have_no_pdf: boolean;
15
16
  can_retry: boolean;
17
+ document_type_code: string;
16
18
  }
17
19
  export interface IFindByOwnerIdItemWithVersions extends IFindByOwnerIdItem {
18
20
  older_versions: Pick<IFindByOwnerIdItem, "label" | "pdf_link">[];