@nomalism-com/types 1.3.53 → 1.3.55

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 CHANGED
@@ -1037,9 +1037,16 @@ var interfaces_exports52 = {};
1037
1037
  __export(interfaces_exports52, {
1038
1038
  IWarningEnum: () => IWarningEnum,
1039
1039
  IWarningType: () => IWarningType,
1040
- Route: () => Route84
1040
+ RectificationTypeEnum: () => RectificationTypeEnum,
1041
+ Route: () => Route84,
1042
+ rectificationTypes: () => rectificationTypes
1041
1043
  });
1042
1044
  var Route84 = "document_header";
1045
+ var RectificationTypeEnum = {
1046
+ value: "value",
1047
+ tax: "tax"
1048
+ };
1049
+ var rectificationTypes = Object.keys(RectificationTypeEnum);
1043
1050
  var IWarningEnum = {
1044
1051
  AvisoTotal: "AvisoTotal",
1045
1052
  AvisoParcial: "AvisoParcial",
@@ -1151,6 +1158,12 @@ var DocumentTypeCodeTypeEnum = {
1151
1158
  FS: "FS",
1152
1159
  FR: "FR",
1153
1160
  NC: "NC",
1161
+ NCR: "NCR",
1162
+ NCRM: "NCRM",
1163
+ NCRD: "NCRD",
1164
+ ND: "ND",
1165
+ NDM: "NDM",
1166
+ NDD: "NDD",
1154
1167
  GT: "GT",
1155
1168
  GR: "GR",
1156
1169
  GDF: "GDF",
package/dist/index.js CHANGED
@@ -1033,9 +1033,16 @@ var interfaces_exports52 = {};
1033
1033
  __export(interfaces_exports52, {
1034
1034
  IWarningEnum: () => IWarningEnum,
1035
1035
  IWarningType: () => IWarningType,
1036
- Route: () => Route84
1036
+ RectificationTypeEnum: () => RectificationTypeEnum,
1037
+ Route: () => Route84,
1038
+ rectificationTypes: () => rectificationTypes
1037
1039
  });
1038
1040
  var Route84 = "document_header";
1041
+ var RectificationTypeEnum = {
1042
+ value: "value",
1043
+ tax: "tax"
1044
+ };
1045
+ var rectificationTypes = Object.keys(RectificationTypeEnum);
1039
1046
  var IWarningEnum = {
1040
1047
  AvisoTotal: "AvisoTotal",
1041
1048
  AvisoParcial: "AvisoParcial",
@@ -1147,6 +1154,12 @@ var DocumentTypeCodeTypeEnum = {
1147
1154
  FS: "FS",
1148
1155
  FR: "FR",
1149
1156
  NC: "NC",
1157
+ NCR: "NCR",
1158
+ NCRM: "NCRM",
1159
+ NCRD: "NCRD",
1160
+ ND: "ND",
1161
+ NDM: "NDM",
1162
+ NDD: "NDD",
1150
1163
  GT: "GT",
1151
1164
  GR: "GR",
1152
1165
  GDF: "GDF",
@@ -133,6 +133,60 @@ export interface ICreateFromHeaderRequest {
133
133
  copy_from_document?: string | null;
134
134
  owner_ref_document?: string | null;
135
135
  document_line_note?: ICreateFromHeaderDocumentLineNote;
136
+ rectification?: IRectificationInput;
137
+ /** NC de quantidade: quantidade a creditar por linha (omissa = a linha toda). */
138
+ line_quantities?: ICreateFromHeaderLineQuantity[];
139
+ }
140
+ export interface ICreateFromHeaderLineQuantity {
141
+ document_line_id: string;
142
+ quantity: number;
143
+ }
144
+ export declare const RectificationTypeEnum: {
145
+ value: "value";
146
+ tax: "tax";
147
+ };
148
+ export type IRectificationType = (typeof RectificationTypeEnum)[keyof typeof RectificationTypeEnum];
149
+ export declare const rectificationTypes: string[];
150
+ export interface IRectificationLineInput {
151
+ document_line_id: string;
152
+ /** Valor com IVA a retificar nesta linha (retificação de valor). */
153
+ value?: number;
154
+ /** Taxa de IVA correta (retificação de IVA). */
155
+ tax_percentage?: number;
156
+ }
157
+ export interface IRectificationInput {
158
+ type: IRectificationType;
159
+ /** Valor total com IVA, repartido pelas linhas (retificação de valor). */
160
+ total?: number;
161
+ lines?: IRectificationLineInput[];
162
+ }
163
+ export interface IRectificationPreviewRequest {
164
+ document_type_id: number;
165
+ from_header: string[];
166
+ from_lines: string[];
167
+ rectification?: IRectificationInput;
168
+ }
169
+ export interface IRectificationPreviewLine {
170
+ document_line_id: string;
171
+ product_reference: string | null;
172
+ product_designation: string;
173
+ quantity: number;
174
+ /** Saldo com IVA da linha (fatura mais notas de débito menos notas de crédito). */
175
+ balance_gross_total: number;
176
+ current_tax_percentage: number;
177
+ /** Tipo de retificação já usado nesta linha. */
178
+ locked_type: "quantity" | "value" | "tax" | null;
179
+ tax_percentage: number;
180
+ net_total: number;
181
+ tax_total: number;
182
+ gross_total: number;
183
+ }
184
+ export interface IRectificationPreviewResponse {
185
+ lines: IRectificationPreviewLine[];
186
+ tax_percentages: number[];
187
+ net_total: number;
188
+ tax_total: number;
189
+ gross_total: number;
136
190
  }
137
191
  export type ICreateFromHeaderDocumentLineNote = {
138
192
  note: string;
@@ -317,6 +371,7 @@ export interface IRepository {
317
371
  getActions(selector: IShared.IFindByIdRequest): Promise<IGetActionsResponse[]>;
318
372
  create(data: ICreateRequest): Promise<ICreateResponse>;
319
373
  createFromHeader(data: ICreateFromHeaderRequest): Promise<void>;
374
+ rectificationPreview(data: IRectificationPreviewRequest): Promise<IRectificationPreviewResponse>;
320
375
  update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>;
321
376
  transferClientOwnership(params: ITransferOwnershipRequest): Promise<void>;
322
377
  deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
@@ -21,6 +21,12 @@ export declare const DocumentTypeCodeTypeEnum: {
21
21
  FS: "FS";
22
22
  FR: "FR";
23
23
  NC: "NC";
24
+ NCR: "NCR";
25
+ NCRM: "NCRM";
26
+ NCRD: "NCRD";
27
+ ND: "ND";
28
+ NDM: "NDM";
29
+ NDD: "NDD";
24
30
  GT: "GT";
25
31
  GR: "GR";
26
32
  GDF: "GDF";
@@ -405,6 +405,8 @@ export type DocumentLine = {
405
405
  sent_to_client: boolean;
406
406
  sent_to_provider: boolean;
407
407
  global_discount: boolean;
408
+ split_from_document_line_id?: string | null;
409
+ merged_at?: Date | null;
408
410
  created_at: Date;
409
411
  updated_at: Date;
410
412
  created_by: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nomalism-com/types",
3
3
  "description": "A nomalism package with all necessary types and validations for developing APIs",
4
- "version": "1.3.53",
4
+ "version": "1.3.55",
5
5
  "author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "devDependencies": {
27
27
  "@eslint/js": "^10.0.1",
28
- "@swc/core": "^1.16.2",
28
+ "@swc/core": "^1.16.13",
29
29
  "@types/node": "^26.6.3",
30
30
  "@typescript-eslint/eslint-plugin": "^8.62.0",
31
31
  "@typescript-eslint/parser": "^8.62.0",
@@ -37,7 +37,7 @@
37
37
  "lint-staged": "^17.6.0",
38
38
  "prettier": "^3.9.9",
39
39
  "tsup": "^8.5.1",
40
- "typescript-eslint": "^8.70.1"
40
+ "typescript-eslint": "^8.71.0"
41
41
  },
42
42
  "repository": {
43
43
  "type": "git",