@facturacr/atv-sdk 0.0.25-beta → 1.0.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.
- package/.github/workflows/ci.yml +2 -2
- package/.github/workflows/publish.yml +27 -0
- package/CHANGELOG.md +29 -0
- package/__tests__/stubs/commonExpectedXml.xml +13 -13
- package/__tests__/stubs/{createDocument.stub.ts → createDocument.data.ts} +23 -15
- package/__tests__/tests/ATV/__snapshots__/index.test.ts.snap +1 -1
- package/__tests__/tests/ATV/index.test.ts +5 -5
- package/dist/src/ATV/core/CreateDocFactory.d.ts +53 -0
- package/dist/src/ATV/core/CreateDocFactory.js +67 -0
- package/dist/src/ATV/core/CreateDocFactory.js.map +1 -0
- package/dist/src/ATV/core/Document.d.ts +3 -0
- package/dist/src/ATV/core/Document.js +3 -0
- package/dist/src/ATV/core/Document.js.map +1 -1
- package/dist/src/ATV/core/ReferenceInformation.d.ts +17 -0
- package/dist/src/ATV/core/ReferenceInformation.js +28 -0
- package/dist/src/ATV/core/ReferenceInformation.js.map +1 -0
- package/dist/src/ATV/index.d.ts +2 -1
- package/dist/src/ATV/index.js.map +1 -1
- package/dist/src/ATV/mappers/billDocToAtv.js +12 -0
- package/dist/src/ATV/mappers/billDocToAtv.js.map +1 -1
- package/dist/src/ATV/useCases/createDocument/index.d.ts +3 -8
- package/dist/src/ATV/useCases/createDocument/index.js +4 -68
- package/dist/src/ATV/useCases/createDocument/index.js.map +1 -1
- package/dist/src/ATV/useCases/createDocument/types.d.ts +0 -43
- package/dist/src/index.d.ts +1 -1
- package/dist/src/types/facturaInterfaces.d.ts +8 -0
- package/examples/createAndSend.ts +8 -5
- package/examples/createCreditNote.ts +52 -22
- package/package.json +1 -1
- package/src/ATV/core/CreateDocFactory.ts +117 -0
- package/src/ATV/core/Document.ts +6 -0
- package/src/ATV/core/ReferenceInformation.ts +41 -0
- package/src/ATV/index.ts +2 -1
- package/src/ATV/mappers/billDocToAtv.ts +15 -1
- package/src/ATV/useCases/createDocument/index.ts +9 -74
- package/src/ATV/useCases/createDocument/types.ts +2 -48
- package/src/index.ts +1 -1
- package/src/types/facturaInterfaces.ts +9 -0
|
@@ -1,56 +1,10 @@
|
|
|
1
|
-
import { PersonProps } from '@src/ATV/core/Person'
|
|
2
|
-
import { DocumentNames } from '@src/ATV/core/documentNames.types'
|
|
3
|
-
import { InvoiceDocumentContainer } from '@src/types/facturaInterfaces';
|
|
4
|
-
import { Method } from 'axios'
|
|
5
|
-
|
|
6
|
-
type PersonInput = PersonProps;
|
|
7
1
|
|
|
8
|
-
type TaxInput = {
|
|
9
|
-
code: string;
|
|
10
|
-
rateCode: string;
|
|
11
|
-
rate: number;
|
|
12
|
-
amount?: number;
|
|
13
|
-
}
|
|
14
2
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
unitaryPrice: number;
|
|
18
|
-
lineNumber?: string;
|
|
19
|
-
code?: string;
|
|
20
|
-
quantity?: number;
|
|
21
|
-
measureUnit?: string;
|
|
22
|
-
totalAmount?: number;
|
|
23
|
-
subTotal?: number;
|
|
24
|
-
tax?: TaxInput;
|
|
25
|
-
totalOrderLineAmount?: number;
|
|
26
|
-
}
|
|
3
|
+
import { InvoiceDocumentContainer } from '@src/types/facturaInterfaces';
|
|
4
|
+
import { Method } from 'axios'
|
|
27
5
|
|
|
28
6
|
export type DocumentTypes = 'FE'
|
|
29
7
|
|
|
30
|
-
type DocumentInput = {
|
|
31
|
-
emitter: PersonInput;
|
|
32
|
-
receiver: PersonInput;
|
|
33
|
-
branch: string; // sucursal
|
|
34
|
-
terminal: string; // terminal
|
|
35
|
-
// documentType: DocumentTypes; // @deprecated
|
|
36
|
-
documentName: DocumentNames;
|
|
37
|
-
countryCode: string; // codigoPais
|
|
38
|
-
securityCode: string; // codigoSeguridad
|
|
39
|
-
activityCode: string;
|
|
40
|
-
consecutiveIdentifier: string; // consecutivo
|
|
41
|
-
ceSituation: string; // situacionCE
|
|
42
|
-
orderLines: OrderInput[];
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export type CreateDocumentInput = {
|
|
46
|
-
document: DocumentInput;
|
|
47
|
-
token: string;
|
|
48
|
-
signatureOptions: {
|
|
49
|
-
buffer: string;
|
|
50
|
-
password: string;
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
8
|
export type Command = {
|
|
55
9
|
url: string;
|
|
56
10
|
method: Method;
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
2
|
export { Document, InvoiceDocumentContainer, DetalleServicio, Resumen, Persona } from './types/facturaInterfaces'
|
|
3
|
-
export { CreateDocumentInput } from './ATV/
|
|
3
|
+
export { CreateDocumentInput } from './ATV/core/CreateDocFactory'
|
|
4
4
|
export { ATV } from './ATV'
|
|
@@ -78,6 +78,14 @@ export interface Message {
|
|
|
78
78
|
DetalleMensaje: string;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
export interface InformacionReferencia {
|
|
82
|
+
TipoDoc: string;
|
|
83
|
+
Numero: string;
|
|
84
|
+
FechaEmision: string;
|
|
85
|
+
Codigo: string;
|
|
86
|
+
Razon: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
81
89
|
export interface Document {
|
|
82
90
|
Clave: string;
|
|
83
91
|
CodigoActividad: string;
|
|
@@ -93,6 +101,7 @@ export interface Document {
|
|
|
93
101
|
Otros?: {
|
|
94
102
|
OtroTexto: string;
|
|
95
103
|
};
|
|
104
|
+
InformacionReferencia?: InformacionReferencia;
|
|
96
105
|
}
|
|
97
106
|
|
|
98
107
|
export interface InvoiceDocumentContainer {
|