@riocrypto/common-server 1.0.1380 → 1.0.1382

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.
@@ -26,11 +26,16 @@ class InvopopClient {
26
26
  var _a, _b;
27
27
  return __awaiter(this, void 0, void 0, function* () {
28
28
  const uuid = (0, uuid_1.v1)();
29
- const date = new Date(order.createdAt);
30
- const year = date.getFullYear();
31
- const month = String(date.getMonth() + 1).padStart(2, "0"); // Month is zero-indexed
32
- const day = String(date.getDate()).padStart(2, "0");
33
- const formattedDate = `${year}-${month}-${day}`;
29
+ const operationDate = new Date(order.createdAt);
30
+ const operationYear = operationDate.getFullYear();
31
+ const operationMonth = String(operationDate.getMonth() + 1).padStart(2, "0"); // Month is zero-indexed
32
+ const operationDay = String(operationDate.getDate()).padStart(2, "0");
33
+ const operationDateFormatted = `${operationYear}-${operationMonth}-${operationDay}`;
34
+ const issueDate = new Date();
35
+ const issueYear = issueDate.getFullYear();
36
+ const issueMonth = String(issueDate.getMonth() + 1).padStart(2, "0"); // Month is zero-indexed
37
+ const issueDay = String(issueDate.getDate()).padStart(2, "0");
38
+ const issueDateFormatted = `${issueYear}-${issueMonth}-${issueDay}`;
34
39
  const { data } = yield axios_1.default.put(`${this.baseUrl}/transform/v1/jobs/${uuid}`, {
35
40
  workflow_id: "5b123900-1035-4c8c-a97a-36b940d7a21e",
36
41
  data: {
@@ -38,7 +43,8 @@ class InvopopClient {
38
43
  code: "",
39
44
  type: "standard",
40
45
  currency: order.fiat,
41
- issue_date: formattedDate,
46
+ issue_date: issueDateFormatted,
47
+ op_date: operationDateFormatted,
42
48
  supplier: {
43
49
  name: "RAMPA BLOCKCHAIN",
44
50
  tax_id: {
@@ -85,7 +91,9 @@ class InvopopClient {
85
91
  taxes: [
86
92
  {
87
93
  cat: "VAT",
88
- rate: "standard",
94
+ rate: order.actualFees.platformFeeFiatTax
95
+ ? "standard"
96
+ : "zero",
89
97
  },
90
98
  ],
91
99
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1380",
3
+ "version": "1.0.1382",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",