@facturacr/atv-sdk 1.0.1 → 1.1.0
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/publish.yml +10 -12
- package/.github/workflows/release-please.yml +17 -0
- package/CHANGELOG.md +8 -0
- package/dist/src/ATV/core/CreateDocFactory.d.ts +2 -0
- package/dist/src/ATV/core/CreateDocFactory.js.map +1 -1
- package/dist/src/ATV/core/Person.d.ts +1 -1
- package/dist/src/ATV/core/ReceptorConsecutive.d.ts +13 -0
- package/dist/src/ATV/core/ReceptorConsecutive.js +21 -0
- package/dist/src/ATV/core/ReceptorConsecutive.js.map +1 -0
- package/dist/src/ATV/core/documentNames.types.d.ts +1 -1
- package/dist/src/ATV/core/types.d.ts +20 -0
- package/dist/src/ATV/core/types.js +10 -0
- package/dist/src/ATV/core/types.js.map +1 -0
- package/dist/src/ATV/index.d.ts +8 -0
- package/dist/src/ATV/index.js +5 -0
- package/dist/src/ATV/index.js.map +1 -1
- package/dist/src/ATV/mappers/billDocToAtv.d.ts +2 -0
- package/dist/src/ATV/mappers/billDocToAtv.js +20 -1
- package/dist/src/ATV/mappers/billDocToAtv.js.map +1 -1
- package/dist/src/ATV/useCases/createDocument/types.d.ts +16 -13
- package/dist/src/ATV/useCases/createReceptorMessage/index.d.ts +31 -0
- package/dist/src/ATV/useCases/createReceptorMessage/index.js +115 -0
- package/dist/src/ATV/useCases/createReceptorMessage/index.js.map +1 -0
- package/dist/src/confirmXML.js +1 -1
- package/dist/src/confirmXML.js.map +1 -1
- package/dist/src/electronicBill.js.map +1 -1
- package/dist/src/helpers/comprobantes.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +3 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib/genJSON/confirmXML.js +3 -3
- package/dist/src/lib/genJSON/confirmXML.js.map +1 -1
- package/dist/src/lib/genJSON/index.js.map +1 -1
- package/dist/src/lib/genXML/index.d.ts +2 -1
- package/dist/src/lib/genXML/index.js +3 -3
- package/dist/src/lib/genXML/index.js.map +1 -1
- package/dist/src/types/facturaInterfaces.d.ts +19 -2
- package/examples/README.md +10 -5
- package/examples/atvAccept.ts +76 -0
- package/package.json +1 -1
- package/src/ATV/core/CreateDocFactory.ts +2 -0
- package/src/ATV/core/Person.ts +1 -1
- package/src/ATV/core/ReceptorConsecutive.ts +27 -0
- package/src/ATV/core/documentNames.types.ts +2 -1
- package/src/ATV/core/types.ts +22 -0
- package/src/ATV/index.ts +6 -0
- package/src/ATV/mappers/billDocToAtv.ts +20 -0
- package/src/ATV/useCases/createDocument/types.ts +16 -13
- package/src/ATV/useCases/createReceptorMessage/index.ts +121 -0
- package/src/confirmXML.ts +2 -2
- package/src/electronicBill.ts +2 -1
- package/src/helpers/comprobantes.ts +1 -1
- package/src/index.ts +1 -1
- package/src/lib/genJSON/confirmXML.ts +5 -5
- package/src/lib/genJSON/index.ts +1 -1
- package/src/lib/genXML/index.ts +2 -1
- package/src/types/facturaInterfaces.ts +21 -2
- package/examples/confirmXML.ts +0 -76
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/genJSON/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,sCAAwC;AAExC,qBAAqB;AACrB,MAAM,cAAc,GAAG;IACrB,GAAG,EAAE,CAAC;IACN,OAAO,EAAE,aAAa;IACtB,cAAc,EAAE,qBAAqB;IACrC,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/genJSON/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,sCAAwC;AAExC,qBAAqB;AACrB,MAAM,cAAc,GAAG;IACrB,GAAG,EAAE,CAAC;IACN,OAAO,EAAE,aAAa;IACtB,cAAc,EAAE,qBAAqB;IACrC,kBAAkB,EAAE,IAAyC;CAC9D,CAAA;AAED,SAAS,QAAQ,CAAC,KAAqB;IACrC,OAA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CAAC,KAAK,CAAC;KACpC,CAAA;IACD,MAAM,OAAO,GAA6B;QACxC,CAAC,GAAG,CAAC,EAAE,IAAI;KACZ,CAAA;IACD,MAAM,GAAG,GAAG,MAAM,IAAA,eAAM,EAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;IAC/C,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { XMLRawDocument } from '@src/types/facturaInterfaces';
|
|
1
2
|
export declare const objToXML: (xmlStructure: string, obj: object) => string;
|
|
2
3
|
export declare function genXML(xmlStructure: string, obj: object, options?: {
|
|
3
4
|
buffer?: string;
|
|
4
5
|
password?: string;
|
|
5
6
|
base64?: boolean;
|
|
6
7
|
}): Promise<string>;
|
|
7
|
-
export declare const
|
|
8
|
+
export declare const parseElectronicBillXML: (xml: string) => XMLRawDocument;
|
|
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
15
|
+
exports.parseElectronicBillXML = exports.genXML = exports.objToXML = void 0;
|
|
16
16
|
const fast_xml_parser_1 = require("fast-xml-parser");
|
|
17
17
|
const xmlConfig_1 = require("./xmlConfig");
|
|
18
18
|
const index_1 = __importDefault(require("./sigXML/index"));
|
|
@@ -34,7 +34,7 @@ function genXML(xmlStructure, obj, options) {
|
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
exports.genXML = genXML;
|
|
37
|
-
const
|
|
37
|
+
const parseElectronicBillXML = (xml) => {
|
|
38
38
|
try {
|
|
39
39
|
const json = (0, fast_xml_parser_1.parse)(xml, {
|
|
40
40
|
ignoreAttributes: false,
|
|
@@ -47,5 +47,5 @@ const xmlToJson = (xml) => {
|
|
|
47
47
|
return null;
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
exports.
|
|
50
|
+
exports.parseElectronicBillXML = parseElectronicBillXML;
|
|
51
51
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/genXML/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,qDAAkD;AAClD,2CAAuF;AACvF,2DAAiD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/genXML/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,qDAAkD;AAClD,2CAAuF;AACvF,2DAAiD;AAG1C,MAAM,QAAQ,GAAG,CAAC,YAAoB,EAAE,GAAW,EAAU,EAAE;IACpE,MAAM,MAAM,GAAG,IAAI,2BAAS,CAAC,0BAAc,CAAC,CAAA,CAAC,8BAA8B;IAC3E,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;IACnC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,GAAG,0BAAc,CAAC,YAAY,CAAC,CAAA;IAChD,OAAO,uBAAW,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;AACxC,CAAC,CAAA;AALY,QAAA,QAAQ,YAKpB;AAED,4BAA4B;AAC5B,SAAsB,MAAM,CAAC,YAAoB,EAAE,GAAW,EAAE,OAI7D;;QACD,MAAM,GAAG,GAAG,IAAA,gBAAQ,EAAC,YAAY,EAAE,GAAG,CAAC,CAAA;QACvC,IAAI,CAAC,OAAO;YAAE,OAAO,GAAG,CAAA;QACxB,MAAM,SAAS,GAAG,MAAM,IAAA,eAAM,EAAC,GAAG,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;QACrE,OAAO,SAAS,CAAA;IAClB,CAAC;CAAA;AATD,wBASC;AAEM,MAAM,sBAAsB,GAAG,CAAC,GAAW,EAAkB,EAAE;IACpE,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAA,uBAAK,EAAC,GAAG,EAAE;YACtB,gBAAgB,EAAE,KAAK;YACvB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,KAAK;SACtB,CAAC,CAAA;QACF,OAAO,IAAI,CAAC,kBAAkB,CAAA;IAChC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC,CAAA;AAXY,QAAA,sBAAsB,0BAWlC"}
|
|
@@ -41,7 +41,7 @@ export interface Resumen {
|
|
|
41
41
|
export interface Persona {
|
|
42
42
|
Nombre: string;
|
|
43
43
|
Identificacion: {
|
|
44
|
-
Tipo?:
|
|
44
|
+
Tipo?: '01' | '02';
|
|
45
45
|
Numero: string;
|
|
46
46
|
};
|
|
47
47
|
NombreComercial?: string;
|
|
@@ -90,8 +90,24 @@ export interface Document {
|
|
|
90
90
|
};
|
|
91
91
|
InformacionReferencia?: InformacionReferencia;
|
|
92
92
|
}
|
|
93
|
+
export interface XMLRawDocument extends Document {
|
|
94
|
+
}
|
|
95
|
+
interface MensajeReceptor {
|
|
96
|
+
Clave: string;
|
|
97
|
+
NumeroCedulaEmisor: string;
|
|
98
|
+
FechaEmisionDoc: string;
|
|
99
|
+
Mensaje: string;
|
|
100
|
+
DetalleMensaje: string;
|
|
101
|
+
MontoTotalImpuesto: number;
|
|
102
|
+
CodigoActividad: string;
|
|
103
|
+
CondicionImpuesto: string;
|
|
104
|
+
MontoTotalDeGastoAplicable: number;
|
|
105
|
+
TotalFactura: number;
|
|
106
|
+
NumeroCedulaReceptor: string;
|
|
107
|
+
NumeroConsecutivoReceptor: string;
|
|
108
|
+
}
|
|
93
109
|
export interface InvoiceDocumentContainer {
|
|
94
|
-
[key: string]: Document;
|
|
110
|
+
[key: string]: Document | MensajeReceptor;
|
|
95
111
|
}
|
|
96
112
|
export type ConfirmationMessageRaw = {
|
|
97
113
|
MensajeHacienda: {
|
|
@@ -116,3 +132,4 @@ export type ConfirmationMessageRaw = {
|
|
|
116
132
|
};
|
|
117
133
|
};
|
|
118
134
|
};
|
|
135
|
+
export {};
|
package/examples/README.md
CHANGED
|
@@ -9,6 +9,16 @@ Para probar crear y enviar factura
|
|
|
9
9
|
yarn ts-node -r tsconfig-paths/register --require dotenv/config examples/createAndSend.ts
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
+
Para aceptar una factura
|
|
13
|
+
```
|
|
14
|
+
yarn ts-node -r tsconfig-paths/register --require dotenv/config examples/atvAccept.ts
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Para crear y enviar una nota de credito
|
|
18
|
+
```
|
|
19
|
+
yarn ts-node -r tsconfig-paths/register --require dotenv/config examples/createCreditNote.ts
|
|
20
|
+
```
|
|
21
|
+
|
|
12
22
|
Para probar genJson HeaderXML
|
|
13
23
|
```
|
|
14
24
|
yarn ts-node -r tsconfig-paths/register --require dotenv/config examples/genBasicXML.ts
|
|
@@ -19,11 +29,6 @@ Generar la clave
|
|
|
19
29
|
yarn ts-node -r tsconfig-paths/register--require dotenv/config examples/getClave.ts
|
|
20
30
|
```
|
|
21
31
|
|
|
22
|
-
Para crear una nota de credito
|
|
23
|
-
```
|
|
24
|
-
yarn ts-node -r tsconfig-paths/register --require dotenv/config examples/createCreditNote.ts
|
|
25
|
-
```
|
|
26
|
-
|
|
27
32
|
Para obtener un token
|
|
28
33
|
```
|
|
29
34
|
yarn ts-node -r tsconfig-paths/register --require dotenv/config examples/getToken.ts
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import fs from 'fs'
|
|
2
|
+
import { createDocumentInputExample } from '@test/stubs/createDocument.data'
|
|
3
|
+
import { ATV, CreateDocumentInput } from '../dist/src'
|
|
4
|
+
import { PersonProps } from 'dist/src/ATV/core/Person'
|
|
5
|
+
import { AceptationStates } from 'dist/src/ATV/core/types'
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
const IS_STG = process.env.IS_STG
|
|
9
|
+
const USERNAME_TEST = process.env.USERNAME_TEST
|
|
10
|
+
const PASSWORD_TEST = process.env.PASSWORD_TEST
|
|
11
|
+
const XML_TO_CONFIRM = process.env.XML_TO_CONFIRM
|
|
12
|
+
console.log('process.env.IS_STG', IS_STG)
|
|
13
|
+
|
|
14
|
+
const SOURCE_P12_URI = process.env.SOURCE_P12_URI
|
|
15
|
+
const SOURCE_P12_PASSPORT = process.env.SOURCE_P12_PASSPORT
|
|
16
|
+
|
|
17
|
+
if (!SOURCE_P12_PASSPORT || !SOURCE_P12_URI) {
|
|
18
|
+
throw new Error('No environment. For running examples set .env before.')
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const pem = fs.readFileSync(SOURCE_P12_URI, 'binary')
|
|
22
|
+
const receivedDocumentXML = fs.readFileSync(XML_TO_CONFIRM, 'utf-8')
|
|
23
|
+
|
|
24
|
+
// TODO: dynamic param --identifier 1 args[x]
|
|
25
|
+
createDocumentInputExample.consecutiveIdentifier = process.env.TEST_CONSECUTIVE
|
|
26
|
+
createDocumentInputExample.emitter.identifier.id = process.env.EMITTER_IDENTIFIER_ID as string;
|
|
27
|
+
createDocumentInputExample.emitter.identifier.type = process.env.EMITTER_IDENTIFIER_TYPE as PersonProps['identifier']['type'];
|
|
28
|
+
|
|
29
|
+
console.log('requestStub consecutivo', createDocumentInputExample.consecutiveIdentifier)
|
|
30
|
+
|
|
31
|
+
function getConfimation(atv: ATV, token: string, location: string, ms: number): Promise<any> {
|
|
32
|
+
return new Promise((resolve, reject): any => {
|
|
33
|
+
setTimeout(() => {
|
|
34
|
+
console.log('location', location)
|
|
35
|
+
atv.sendConfirmation({
|
|
36
|
+
url: location,
|
|
37
|
+
headers: {
|
|
38
|
+
'Content-Type': 'application/json',
|
|
39
|
+
Authorization: 'bearer ' + token
|
|
40
|
+
}
|
|
41
|
+
}).then(data => resolve(data))
|
|
42
|
+
.catch(err => reject(err))
|
|
43
|
+
}, ms)
|
|
44
|
+
})
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async function main(): Promise<void> {
|
|
48
|
+
const atv = new ATV({}, 'stg')
|
|
49
|
+
const tokenData = await atv.getToken({
|
|
50
|
+
username: USERNAME_TEST,
|
|
51
|
+
password: PASSWORD_TEST
|
|
52
|
+
})
|
|
53
|
+
const { command, extraData } = await atv.createReceptorMessage({
|
|
54
|
+
aceptationState: AceptationStates.ACCEPTED,
|
|
55
|
+
aceptationDetailMessage: 'Accepted',
|
|
56
|
+
receivedDocument: receivedDocumentXML,
|
|
57
|
+
branch: '01',
|
|
58
|
+
terminal: '01',
|
|
59
|
+
consecutive: '01',
|
|
60
|
+
token: tokenData.accessToken,
|
|
61
|
+
signatureOptions: {
|
|
62
|
+
buffer: pem,
|
|
63
|
+
password: SOURCE_P12_PASSPORT
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
console.log('extraData', extraData);
|
|
67
|
+
const response = await atv.sendDocument(command)
|
|
68
|
+
if (response.errorCause) {
|
|
69
|
+
console.log('error response', response)
|
|
70
|
+
return
|
|
71
|
+
}
|
|
72
|
+
const confirmationResponse = await getConfimation(atv, tokenData.accessToken, response.location, 2000)
|
|
73
|
+
console.log({ MensajeHacienda: confirmationResponse.confirmation })
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
main()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@facturacr/atv-sdk",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Librería (SDK) de Javascript/NodeJS para acceder al API de Administración Tributaria Virtual (ATV) del Ministerio de Hacienda.",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -7,6 +7,7 @@ import { Document } from '@src/ATV/core/Document'
|
|
|
7
7
|
import { Clave } from '@src/ATV/core/Clave'
|
|
8
8
|
import { DocumentType } from '@src/ATV/core/DocumentType'
|
|
9
9
|
import { ReferenceInformation, ReferenceInformationProps } from './ReferenceInformation'
|
|
10
|
+
import { ReceptorMessageProps } from './types'
|
|
10
11
|
|
|
11
12
|
type PersonInput = PersonProps;
|
|
12
13
|
|
|
@@ -51,6 +52,7 @@ type DocumentInput = {
|
|
|
51
52
|
export type CreateDocumentInput = {
|
|
52
53
|
document: DocumentInput;
|
|
53
54
|
token: string;
|
|
55
|
+
receptorMessageProps?: ReceptorMessageProps;
|
|
54
56
|
signatureOptions: {
|
|
55
57
|
buffer: string;
|
|
56
58
|
password: string;
|
package/src/ATV/core/Person.ts
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type ReceptorConsecutiveProps = {
|
|
2
|
+
branch: string; // sucursal
|
|
3
|
+
terminal: string; // terminal
|
|
4
|
+
documentType: '05' | '06' | '07'; // 05=aceptación, 06=aceptación parcial, 07=rechazo
|
|
5
|
+
consecutive: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export class ReceptorConsecutive {
|
|
9
|
+
private props: ReceptorConsecutiveProps
|
|
10
|
+
|
|
11
|
+
constructor(props: ReceptorConsecutiveProps) {
|
|
12
|
+
this.props = props
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
get value(): string {
|
|
16
|
+
return Object.values(this.props).join('')
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public static create(props: ReceptorConsecutiveProps): ReceptorConsecutive {
|
|
20
|
+
return new ReceptorConsecutive({
|
|
21
|
+
branch: props.branch.padStart(3, '0'),
|
|
22
|
+
terminal: props.terminal.padStart(5, '0'),
|
|
23
|
+
documentType: props.documentType,
|
|
24
|
+
consecutive: props.consecutive.padStart(10, '0')
|
|
25
|
+
})
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export enum AceptationStates {
|
|
2
|
+
ACCEPTED = 1,
|
|
3
|
+
PARTIALLY_ACCEPTED = 2,
|
|
4
|
+
DECLINED = 3
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type ReceptorMessageProps = {
|
|
8
|
+
clave: string;
|
|
9
|
+
emitterIdentifier: string;
|
|
10
|
+
emitterIdentifierType: string;
|
|
11
|
+
receptorIdentifier: string;
|
|
12
|
+
receptorIdentifierType: string;
|
|
13
|
+
documentIssueDate: Date;
|
|
14
|
+
activityCode: string;
|
|
15
|
+
aceptationState: AceptationStates
|
|
16
|
+
aceptationDetailMessage: string;
|
|
17
|
+
receptorConcecutive: string;
|
|
18
|
+
taxCondition: string;
|
|
19
|
+
totalTaxes: number;
|
|
20
|
+
totalSale: number;
|
|
21
|
+
}
|
|
22
|
+
|
package/src/ATV/index.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { ATVOptions, ConfirmationMessage, Mode, SendConfirmationInput, SendRespo
|
|
|
8
8
|
import { Command, CreateAndSendDocumentResponse } from './useCases/createDocument/types'
|
|
9
9
|
import { CreateDocumentCommand } from './useCases/createDocument'
|
|
10
10
|
import { CreateDocumentInput } from './core/CreateDocFactory'
|
|
11
|
+
import { CreateReceptorMessageCommand, CreateReceptorMessageCommandInput } from './useCases/createReceptorMessage'
|
|
11
12
|
|
|
12
13
|
export class ATV {
|
|
13
14
|
public readonly options: ATVOptions
|
|
@@ -25,6 +26,11 @@ export class ATV {
|
|
|
25
26
|
return createDocument.execute(input)
|
|
26
27
|
}
|
|
27
28
|
|
|
29
|
+
public createReceptorMessage(input: CreateReceptorMessageCommandInput) {
|
|
30
|
+
const useCase = new CreateReceptorMessageCommand(this)
|
|
31
|
+
return useCase.execute(input)
|
|
32
|
+
}
|
|
33
|
+
|
|
28
34
|
public async sendDocument(input: Command): Promise<SendResponse> {
|
|
29
35
|
try {
|
|
30
36
|
const response = await axios(input)
|
|
@@ -3,6 +3,7 @@ import { Document as DomainDocument } from '../core/Document'
|
|
|
3
3
|
import { OrderLine } from '../core/OrderLine'
|
|
4
4
|
import { Person } from '../core/Person'
|
|
5
5
|
import { ReferenceInformation } from '../core/ReferenceInformation'
|
|
6
|
+
import { ReceptorMessageProps } from '../core/types'
|
|
6
7
|
|
|
7
8
|
type AtvFormat = InvoiceDocumentContainer
|
|
8
9
|
|
|
@@ -120,3 +121,22 @@ export const mapDocumentToAtvFormat = (docName: string, document: DomainDocument
|
|
|
120
121
|
[key]: doc
|
|
121
122
|
}
|
|
122
123
|
}
|
|
124
|
+
|
|
125
|
+
export const mapReceptorMessageToAtvFormat = (props: ReceptorMessageProps): AtvFormat => {
|
|
126
|
+
return {
|
|
127
|
+
MensajeReceptor: {
|
|
128
|
+
Clave: props.clave,
|
|
129
|
+
NumeroCedulaEmisor: props.emitterIdentifier,
|
|
130
|
+
FechaEmisionDoc: props.documentIssueDate.toISOString(),
|
|
131
|
+
Mensaje: props.aceptationState.toString(), // 1 Aceptado | 2 Aceptado Parcialmente | 3 Rechazado
|
|
132
|
+
DetalleMensaje: props.aceptationDetailMessage,
|
|
133
|
+
MontoTotalImpuesto: props.totalTaxes,
|
|
134
|
+
CodigoActividad: props.activityCode,
|
|
135
|
+
CondicionImpuesto: props.taxCondition,
|
|
136
|
+
MontoTotalDeGastoAplicable: props.totalSale, // fullInvoice.ResumenFactura.TotalVenta, // TODO investigar casos de uso
|
|
137
|
+
TotalFactura: props.totalSale, // fullInvoice.ResumenFactura.TotalVenta,
|
|
138
|
+
NumeroCedulaReceptor: props.receptorIdentifier,
|
|
139
|
+
NumeroConsecutivoReceptor: props.receptorConcecutive
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -5,22 +5,25 @@ import { Method } from 'axios'
|
|
|
5
5
|
|
|
6
6
|
export type DocumentTypes = 'FE'
|
|
7
7
|
|
|
8
|
+
type CommandData = {
|
|
9
|
+
clave: string;
|
|
10
|
+
fecha: string;
|
|
11
|
+
emisor: {
|
|
12
|
+
tipoIdentificacion: string;
|
|
13
|
+
numeroIdentificacion: string;
|
|
14
|
+
};
|
|
15
|
+
receptor: {
|
|
16
|
+
tipoIdentificacion: string;
|
|
17
|
+
numeroIdentificacion: string;
|
|
18
|
+
};
|
|
19
|
+
comprobanteXml: string;
|
|
20
|
+
consecutivoReceptor?: string;
|
|
21
|
+
};
|
|
22
|
+
|
|
8
23
|
export type Command = {
|
|
9
24
|
url: string;
|
|
10
25
|
method: Method;
|
|
11
|
-
data:
|
|
12
|
-
clave: string;
|
|
13
|
-
fecha: string;
|
|
14
|
-
emisor: {
|
|
15
|
-
tipoIdentificacion: string;
|
|
16
|
-
numeroIdentificacion: string;
|
|
17
|
-
};
|
|
18
|
-
receptor: {
|
|
19
|
-
tipoIdentificacion: string;
|
|
20
|
-
numeroIdentificacion: string;
|
|
21
|
-
};
|
|
22
|
-
comprobanteXml: string;
|
|
23
|
-
};
|
|
26
|
+
data: CommandData;
|
|
24
27
|
headers: {
|
|
25
28
|
Authorization: string;
|
|
26
29
|
'Content-Type': string;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { AceptationStates, ReceptorMessageProps } from "@src/ATV/core/types";
|
|
2
|
+
import { mapReceptorMessageToAtvFormat } from "@src/ATV/mappers/billDocToAtv";
|
|
3
|
+
import { genXML, parseElectronicBillXML } from "@src/lib/genXML";
|
|
4
|
+
import { Command } from "../createDocument/types";
|
|
5
|
+
import { ATV } from "@src/ATV";
|
|
6
|
+
import { ReceptorConsecutive } from "@src/ATV/core/ReceptorConsecutive";
|
|
7
|
+
|
|
8
|
+
export type CreateReceptorMessageCommandInput = {
|
|
9
|
+
receivedDocument: string;
|
|
10
|
+
aceptationState: AceptationStates;
|
|
11
|
+
aceptationDetailMessage: string;
|
|
12
|
+
branch: string;
|
|
13
|
+
terminal: string;
|
|
14
|
+
token: string;
|
|
15
|
+
consecutive: string;
|
|
16
|
+
signatureOptions: {
|
|
17
|
+
buffer: string;
|
|
18
|
+
password: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const options: { [key: string]: { serviceUrl: string}} = {
|
|
23
|
+
prod: {
|
|
24
|
+
serviceUrl: 'https://api.comprobanteselectronicos.go.cr/v1/recepcion'
|
|
25
|
+
},
|
|
26
|
+
stg: {
|
|
27
|
+
serviceUrl: 'https://api-sandbox.comprobanteselectronicos.go.cr/recepcion/v1/recepcion'
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class CreateReceptorMessageCommand {
|
|
32
|
+
private readonly serviceUrl: string
|
|
33
|
+
|
|
34
|
+
constructor(scope: ATV) {
|
|
35
|
+
this.serviceUrl = options[scope.mode].serviceUrl
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public async execute(input: CreateReceptorMessageCommandInput) {
|
|
39
|
+
const receptorMessageProps = this.processDocument(input)
|
|
40
|
+
const atvDocument = mapReceptorMessageToAtvFormat(receptorMessageProps)
|
|
41
|
+
const xml = await genXML('MensajeReceptor', atvDocument, input.signatureOptions)
|
|
42
|
+
const command = await this.createDocumentCommand(receptorMessageProps, xml, input.token)
|
|
43
|
+
return {
|
|
44
|
+
command,
|
|
45
|
+
extraData: {
|
|
46
|
+
xml,
|
|
47
|
+
document: atvDocument
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
private async createDocumentCommand(receptorMessageProps: ReceptorMessageProps, xml: string, token: string): Promise<Command> {
|
|
53
|
+
return {
|
|
54
|
+
url: this.serviceUrl,
|
|
55
|
+
method: 'post',
|
|
56
|
+
data: {
|
|
57
|
+
clave: receptorMessageProps.clave,
|
|
58
|
+
fecha: receptorMessageProps.documentIssueDate.toISOString(),
|
|
59
|
+
emisor: {
|
|
60
|
+
tipoIdentificacion: receptorMessageProps.emitterIdentifierType,
|
|
61
|
+
numeroIdentificacion: receptorMessageProps.emitterIdentifier,
|
|
62
|
+
},
|
|
63
|
+
receptor: {
|
|
64
|
+
tipoIdentificacion: receptorMessageProps.receptorIdentifierType,
|
|
65
|
+
numeroIdentificacion: receptorMessageProps.receptorIdentifier,
|
|
66
|
+
},
|
|
67
|
+
comprobanteXml: this.encodeXML(xml),
|
|
68
|
+
consecutivoReceptor: receptorMessageProps.receptorConcecutive
|
|
69
|
+
},
|
|
70
|
+
headers: {
|
|
71
|
+
Authorization: 'bearer ' + token,
|
|
72
|
+
'Content-Type': 'application/json'
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
private encodeXML(xmlStr: string): string {
|
|
78
|
+
const buffer = Buffer.from(xmlStr)
|
|
79
|
+
return buffer.toString('base64')
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
private acceptationStateToDocumentType(aceptationState: AceptationStates) {
|
|
83
|
+
switch (aceptationState) {
|
|
84
|
+
case AceptationStates.ACCEPTED:
|
|
85
|
+
return '05'
|
|
86
|
+
case AceptationStates.PARTIALLY_ACCEPTED:
|
|
87
|
+
return '06'
|
|
88
|
+
default:
|
|
89
|
+
return '07'
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
private processDocument(input: CreateReceptorMessageCommandInput): ReceptorMessageProps {
|
|
94
|
+
try {
|
|
95
|
+
const electronillBillRaw = parseElectronicBillXML(input.receivedDocument)
|
|
96
|
+
const receptorConsecutive = ReceptorConsecutive.create({
|
|
97
|
+
branch: input.branch,
|
|
98
|
+
terminal: input.terminal,
|
|
99
|
+
documentType: this.acceptationStateToDocumentType(input.aceptationState),
|
|
100
|
+
consecutive: input.consecutive,
|
|
101
|
+
})
|
|
102
|
+
return {
|
|
103
|
+
clave: electronillBillRaw.Clave,
|
|
104
|
+
emitterIdentifier: electronillBillRaw.Emisor.Identificacion.Numero,
|
|
105
|
+
emitterIdentifierType: electronillBillRaw.Emisor.Identificacion.Tipo,
|
|
106
|
+
receptorIdentifier: electronillBillRaw.Receptor.Identificacion.Numero,
|
|
107
|
+
receptorIdentifierType: electronillBillRaw.Receptor.Identificacion.Tipo,
|
|
108
|
+
documentIssueDate: new Date(electronillBillRaw.FechaEmision),
|
|
109
|
+
activityCode: electronillBillRaw.CodigoActividad,
|
|
110
|
+
taxCondition: electronillBillRaw.CondicionVenta,
|
|
111
|
+
totalTaxes: electronillBillRaw.ResumenFactura.TotalImpuesto,
|
|
112
|
+
totalSale: electronillBillRaw.ResumenFactura.TotalVenta,
|
|
113
|
+
aceptationState: input.aceptationState,
|
|
114
|
+
aceptationDetailMessage: input.aceptationDetailMessage,
|
|
115
|
+
receptorConcecutive: receptorConsecutive.value
|
|
116
|
+
}
|
|
117
|
+
} catch (err) {
|
|
118
|
+
throw new Error('Error parsing the document')
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
package/src/confirmXML.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { consecutivoStr } from '@src/lib/genClave'
|
|
2
|
-
import {
|
|
2
|
+
import { parseElectronicBillXML, genXML } from '@src/lib/genXML/index'
|
|
3
3
|
import { send } from '@src/services/send/index'
|
|
4
4
|
import { getFinalMessage, getMsjObj } from '@src/lib/genJSON/confirmXML'
|
|
5
5
|
|
|
@@ -21,7 +21,7 @@ export default async (opts: {
|
|
|
21
21
|
}): Promise<any> => {
|
|
22
22
|
const { token, pemOpt, tipoDocKey } = opts
|
|
23
23
|
const consecutivo = getConsecutivoStr(opts)
|
|
24
|
-
const fullInvoice =
|
|
24
|
+
const fullInvoice = parseElectronicBillXML(opts.xmlStr)
|
|
25
25
|
const msjObj = getMsjObj({ fullInvoice, consecutivo, tipoDocKey })
|
|
26
26
|
const xmlBase64 = await genXML(tipoDocKey, msjObj, {
|
|
27
27
|
buffer: pemOpt.buffer,
|
package/src/electronicBill.ts
CHANGED
|
@@ -2,9 +2,10 @@ import { ClientPayload, FinalMessagePerson } from '@src/types/globalInterfaces'
|
|
|
2
2
|
import { genClaveObj, genString, parseOptions } from '@src/lib/genClave/index'
|
|
3
3
|
import genJSON from '@src/lib/genJSON/index'
|
|
4
4
|
import { send } from '@src/services/send/index'
|
|
5
|
+
import { Persona } from './types/facturaInterfaces'
|
|
5
6
|
|
|
6
7
|
const DEFAULT_VALUES = {
|
|
7
|
-
tipoIdentificacion: '01'
|
|
8
|
+
tipoIdentificacion: '01' as Persona['Identificacion']['Tipo']
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
const encodeXML = (xmlStr: string): string => {
|
|
@@ -6,7 +6,7 @@ const DEFAULT_VALUES = {
|
|
|
6
6
|
message: 'Default msj',
|
|
7
7
|
detailsMessage: 'Default details msj',
|
|
8
8
|
taxes: 100,
|
|
9
|
-
tipoIdentificacion: '01'
|
|
9
|
+
tipoIdentificacion: '01' as Persona['Identificacion']['Tipo']
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export function getSimpleSender(frontEndRequest: ClientPayload): FinalMessagePerson {
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export { parseElectronicBillXML as xmlToJson } from './lib/genXML'
|
|
2
2
|
export { Document, InvoiceDocumentContainer, DetalleServicio, Resumen, Persona } from './types/facturaInterfaces'
|
|
3
3
|
export { CreateDocumentInput } from './ATV/core/CreateDocFactory'
|
|
4
4
|
export { ATV } from './ATV'
|
|
@@ -31,17 +31,17 @@ export function getMsjObj(opts: {
|
|
|
31
31
|
export function getFinalMessage(fullInvoice: any, consecutivoReceptor: string, xmlBase64: any): any {
|
|
32
32
|
const date = new Date()
|
|
33
33
|
return {
|
|
34
|
-
clave: fullInvoice.Clave,
|
|
35
|
-
fecha: date.toISOString(),
|
|
36
|
-
emisor: {
|
|
34
|
+
clave: fullInvoice.Clave, // in command
|
|
35
|
+
fecha: date.toISOString(), // in command
|
|
36
|
+
emisor: { // in command
|
|
37
37
|
tipoIdentificacion: fullInvoice.Receptor.Identificacion.Tipo,
|
|
38
38
|
numeroIdentificacion: fullInvoice.Receptor.Identificacion.Numero
|
|
39
39
|
},
|
|
40
|
-
receptor: {
|
|
40
|
+
receptor: { // in command
|
|
41
41
|
tipoIdentificacion: fullInvoice.Emisor.Identificacion.Tipo,
|
|
42
42
|
numeroIdentificacion: fullInvoice.Emisor.Identificacion.Numero
|
|
43
43
|
},
|
|
44
44
|
consecutivoReceptor,
|
|
45
|
-
comprobanteXml: xmlBase64
|
|
45
|
+
comprobanteXml: xmlBase64 // in command
|
|
46
46
|
}
|
|
47
47
|
}
|
package/src/lib/genJSON/index.ts
CHANGED
package/src/lib/genXML/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { j2xParser, parse } from 'fast-xml-parser'
|
|
2
2
|
import { declaration, defaultOptions, xmlExtructures } from '@src/lib/genXML/xmlConfig'
|
|
3
3
|
import sigXML from '@src/lib/genXML/sigXML/index'
|
|
4
|
+
import { XMLRawDocument } from '@src/types/facturaInterfaces'
|
|
4
5
|
|
|
5
6
|
export const objToXML = (xmlStructure: string, obj: object): string => {
|
|
6
7
|
const parser = new j2xParser(defaultOptions) // eslint-disable-line new-cap
|
|
@@ -21,7 +22,7 @@ export async function genXML(xmlStructure: string, obj: object, options?: {
|
|
|
21
22
|
return signedXML
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
export const
|
|
25
|
+
export const parseElectronicBillXML = (xml: string): XMLRawDocument => {
|
|
25
26
|
try {
|
|
26
27
|
const json = parse(xml, {
|
|
27
28
|
ignoreAttributes: false,
|
|
@@ -51,7 +51,7 @@ export interface Resumen {
|
|
|
51
51
|
export interface Persona {
|
|
52
52
|
Nombre: string;
|
|
53
53
|
Identificacion: {
|
|
54
|
-
Tipo?:
|
|
54
|
+
Tipo?: '01' | '02';
|
|
55
55
|
Numero: string;
|
|
56
56
|
};
|
|
57
57
|
NombreComercial?: string;
|
|
@@ -104,8 +104,27 @@ export interface Document {
|
|
|
104
104
|
InformacionReferencia?: InformacionReferencia;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
export interface XMLRawDocument extends Document {
|
|
108
|
+
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
interface MensajeReceptor {
|
|
112
|
+
Clave: string;
|
|
113
|
+
NumeroCedulaEmisor: string;
|
|
114
|
+
FechaEmisionDoc: string;
|
|
115
|
+
Mensaje: string;
|
|
116
|
+
DetalleMensaje: string;
|
|
117
|
+
MontoTotalImpuesto: number;
|
|
118
|
+
CodigoActividad: string;
|
|
119
|
+
CondicionImpuesto: string;
|
|
120
|
+
MontoTotalDeGastoAplicable: number;
|
|
121
|
+
TotalFactura: number;
|
|
122
|
+
NumeroCedulaReceptor: string;
|
|
123
|
+
NumeroConsecutivoReceptor: string;
|
|
124
|
+
}
|
|
125
|
+
|
|
107
126
|
export interface InvoiceDocumentContainer {
|
|
108
|
-
[key: string]: Document;
|
|
127
|
+
[key: string]: Document | MensajeReceptor;
|
|
109
128
|
}
|
|
110
129
|
|
|
111
130
|
export type ConfirmationMessageRaw = {
|