@nomalism-com/types 1.3.52 → 1.3.54
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 +14 -1
- package/dist/index.js +14 -1
- package/dist/modules/supply/documentHeader/interfaces.d.ts +49 -0
- package/dist/modules/supply/documentType/interfaces.d.ts +6 -0
- package/dist/modules/supply/externalDocumentHeader/interface.d.ts +1 -0
- package/dist/shared/interface.d.ts +1 -0
- package/package.json +3 -3
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
|
-
|
|
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
|
-
|
|
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,54 @@ 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
|
+
}
|
|
138
|
+
export declare const RectificationTypeEnum: {
|
|
139
|
+
value: "value";
|
|
140
|
+
tax: "tax";
|
|
141
|
+
};
|
|
142
|
+
export type IRectificationType = (typeof RectificationTypeEnum)[keyof typeof RectificationTypeEnum];
|
|
143
|
+
export declare const rectificationTypes: string[];
|
|
144
|
+
export interface IRectificationLineInput {
|
|
145
|
+
document_line_id: string;
|
|
146
|
+
/** Valor com IVA a retificar nesta linha (retificação de valor). */
|
|
147
|
+
value?: number;
|
|
148
|
+
/** Taxa de IVA correta (retificação de IVA). */
|
|
149
|
+
tax_percentage?: number;
|
|
150
|
+
}
|
|
151
|
+
export interface IRectificationInput {
|
|
152
|
+
type: IRectificationType;
|
|
153
|
+
/** Valor total com IVA, repartido pelas linhas (retificação de valor). */
|
|
154
|
+
total?: number;
|
|
155
|
+
lines?: IRectificationLineInput[];
|
|
156
|
+
}
|
|
157
|
+
export interface IRectificationPreviewRequest {
|
|
158
|
+
document_type_id: number;
|
|
159
|
+
from_header: string[];
|
|
160
|
+
from_lines: string[];
|
|
161
|
+
rectification?: IRectificationInput;
|
|
162
|
+
}
|
|
163
|
+
export interface IRectificationPreviewLine {
|
|
164
|
+
document_line_id: string;
|
|
165
|
+
product_reference: string | null;
|
|
166
|
+
product_designation: string;
|
|
167
|
+
quantity: number;
|
|
168
|
+
/** Saldo com IVA da linha (fatura mais notas de débito menos notas de crédito). */
|
|
169
|
+
balance_gross_total: number;
|
|
170
|
+
current_tax_percentage: number;
|
|
171
|
+
/** Tipo de retificação já usado nesta linha. */
|
|
172
|
+
locked_type: "quantity" | "value" | "tax" | null;
|
|
173
|
+
tax_percentage: number;
|
|
174
|
+
net_total: number;
|
|
175
|
+
tax_total: number;
|
|
176
|
+
gross_total: number;
|
|
177
|
+
}
|
|
178
|
+
export interface IRectificationPreviewResponse {
|
|
179
|
+
lines: IRectificationPreviewLine[];
|
|
180
|
+
tax_percentages: number[];
|
|
181
|
+
net_total: number;
|
|
182
|
+
tax_total: number;
|
|
183
|
+
gross_total: number;
|
|
136
184
|
}
|
|
137
185
|
export type ICreateFromHeaderDocumentLineNote = {
|
|
138
186
|
note: string;
|
|
@@ -317,6 +365,7 @@ export interface IRepository {
|
|
|
317
365
|
getActions(selector: IShared.IFindByIdRequest): Promise<IGetActionsResponse[]>;
|
|
318
366
|
create(data: ICreateRequest): Promise<ICreateResponse>;
|
|
319
367
|
createFromHeader(data: ICreateFromHeaderRequest): Promise<void>;
|
|
368
|
+
rectificationPreview(data: IRectificationPreviewRequest): Promise<IRectificationPreviewResponse>;
|
|
320
369
|
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>;
|
|
321
370
|
transferClientOwnership(params: ITransferOwnershipRequest): Promise<void>;
|
|
322
371
|
deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
|
|
@@ -13,6 +13,7 @@ export interface IFindByOwnerIdItem {
|
|
|
13
13
|
created_by: string;
|
|
14
14
|
can_have_no_pdf: boolean;
|
|
15
15
|
can_retry: boolean;
|
|
16
|
+
document_type_code: string;
|
|
16
17
|
}
|
|
17
18
|
export interface IFindByOwnerIdItemWithVersions extends IFindByOwnerIdItem {
|
|
18
19
|
older_versions: Pick<IFindByOwnerIdItem, "label" | "pdf_link">[];
|
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.
|
|
4
|
+
"version": "1.3.54",
|
|
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.
|
|
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.
|
|
40
|
+
"typescript-eslint": "^8.71.0"
|
|
41
41
|
},
|
|
42
42
|
"repository": {
|
|
43
43
|
"type": "git",
|