@riocrypto/common-server 1.0.1421 → 1.0.1423
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.
|
@@ -23,7 +23,7 @@ class InvopopClient {
|
|
|
23
23
|
this.baseUrl = "https://api.invopop.com";
|
|
24
24
|
}
|
|
25
25
|
createJob(order, user) {
|
|
26
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
26
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
27
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
28
|
const uuid = (0, uuid_1.v1)();
|
|
29
29
|
const operationDate = new Date(order.createdAt);
|
|
@@ -32,6 +32,8 @@ class InvopopClient {
|
|
|
32
32
|
const operationDay = String(operationDate.getDate()).padStart(2, "0");
|
|
33
33
|
const operationDateFormatted = `${operationYear}-${operationMonth}-${operationDay}`;
|
|
34
34
|
const issueDate = new Date();
|
|
35
|
+
const mexicoCityOffset = -6;
|
|
36
|
+
issueDate.setUTCHours(issueDate.getUTCHours() + mexicoCityOffset);
|
|
35
37
|
const issueYear = issueDate.getFullYear();
|
|
36
38
|
const issueMonth = String(issueDate.getMonth() + 1).padStart(2, "0"); // Month is zero-indexed
|
|
37
39
|
const issueDay = String(issueDate.getDate()).padStart(2, "0");
|
|
@@ -66,18 +68,18 @@ class InvopopClient {
|
|
|
66
68
|
tax_id: {
|
|
67
69
|
country: "MX",
|
|
68
70
|
zone: ((_e = (_d = user.invoicing) === null || _d === void 0 ? void 0 : _d.MX) === null || _e === void 0 ? void 0 : _e.shouldInvoice)
|
|
69
|
-
? user.address.postalCode
|
|
71
|
+
? (_h = (_g = (_f = user.onboarding) === null || _f === void 0 ? void 0 : _f.MX) === null || _g === void 0 ? void 0 : _g.address) === null || _h === void 0 ? void 0 : _h.postalCode
|
|
70
72
|
: "66260",
|
|
71
|
-
code: ((
|
|
73
|
+
code: ((_k = (_j = user.onboarding) === null || _j === void 0 ? void 0 : _j.MX) === null || _k === void 0 ? void 0 : _k.taxId) || "XAXX010101000",
|
|
72
74
|
},
|
|
73
75
|
identities: [
|
|
74
76
|
{
|
|
75
77
|
key: "mx-cfdi-fiscal-regime",
|
|
76
|
-
code: ((
|
|
78
|
+
code: ((_o = (_m = (_l = user.invoicing) === null || _l === void 0 ? void 0 : _l.MX) === null || _m === void 0 ? void 0 : _m.fiscalRegimenCode) === null || _o === void 0 ? void 0 : _o.toString()) || "616",
|
|
77
79
|
},
|
|
78
80
|
{
|
|
79
81
|
key: "mx-cfdi-use",
|
|
80
|
-
code: ((
|
|
82
|
+
code: ((_q = (_p = user.invoicing) === null || _p === void 0 ? void 0 : _p.MX) === null || _q === void 0 ? void 0 : _q.shouldInvoice) ? "G03" : "S01",
|
|
81
83
|
},
|
|
82
84
|
],
|
|
83
85
|
},
|
|
@@ -88,7 +90,7 @@ class InvopopClient {
|
|
|
88
90
|
item: {
|
|
89
91
|
name: "Facilitación de Compra-Venta de Activos Virtuales",
|
|
90
92
|
identities: [{ key: "mx-cfdi-prod-serv", code: "80151500" }],
|
|
91
|
-
price: (
|
|
93
|
+
price: (_r = order.actualFees.platformFeeFiat) === null || _r === void 0 ? void 0 : _r.toFixed(2),
|
|
92
94
|
},
|
|
93
95
|
taxes: [
|
|
94
96
|
{
|
package/build/models/ubo.d.ts
CHANGED
|
@@ -34,16 +34,16 @@ interface UBOAttrs {
|
|
|
34
34
|
personalIdentificationCertificate?: string;
|
|
35
35
|
extraFiles?: string[];
|
|
36
36
|
};
|
|
37
|
+
address?: {
|
|
38
|
+
street1?: string;
|
|
39
|
+
street2?: string;
|
|
40
|
+
city?: string;
|
|
41
|
+
state?: string;
|
|
42
|
+
postalCode?: string;
|
|
43
|
+
country: CountryOfOrigin;
|
|
44
|
+
};
|
|
37
45
|
};
|
|
38
46
|
};
|
|
39
|
-
address: {
|
|
40
|
-
street1: string;
|
|
41
|
-
street2?: string;
|
|
42
|
-
city: string;
|
|
43
|
-
state: string;
|
|
44
|
-
postalCode: string;
|
|
45
|
-
country: CountryOfOrigin;
|
|
46
|
-
};
|
|
47
47
|
}
|
|
48
48
|
interface UBOModel extends Model<UBODoc> {
|
|
49
49
|
build(attrs: UBOAttrs): UBODoc;
|
|
@@ -85,14 +85,6 @@ interface UBODoc extends Document {
|
|
|
85
85
|
};
|
|
86
86
|
};
|
|
87
87
|
};
|
|
88
|
-
address: {
|
|
89
|
-
street1: string;
|
|
90
|
-
street2?: string;
|
|
91
|
-
city: string;
|
|
92
|
-
state: string;
|
|
93
|
-
postalCode: string;
|
|
94
|
-
country: CountryOfOrigin;
|
|
95
|
-
};
|
|
96
88
|
}
|
|
97
89
|
declare const buildUBO: (mongoose: Mongoose) => UBOModel;
|
|
98
90
|
export { buildUBO, UBODoc };
|
package/build/models/ubo.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1423",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@everapi/currencyapi-js": "^1.0.6",
|
|
28
28
|
"@google-cloud/storage": "^6.9.5",
|
|
29
29
|
"@google-cloud/vision": "^4.0.2",
|
|
30
|
-
"@riocrypto/common": "^1.0.
|
|
30
|
+
"@riocrypto/common": "^1.0.1272",
|
|
31
31
|
"@types/express": "^4.17.13",
|
|
32
32
|
"axios": "^0.27.2",
|
|
33
33
|
"ccxt": "^3.0.30",
|