@riocrypto/common-server 1.0.1205 → 1.0.1207

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.
@@ -50,9 +50,7 @@ class BitsoClient {
50
50
  "Content-Type": "application/json",
51
51
  },
52
52
  data: {
53
- alias: `CLABE for ${user.type === common_1.UserType.Business
54
- ? user.companyName
55
- : user.firstName + " " + user.lastName} - ${user.id}`,
53
+ alias: `CLABE for ${(0, common_1.getUserName)(user)} - ${user.id}`,
56
54
  user_id: this.env === "production" ? "8298933" : "53166",
57
55
  currency: "mxn",
58
56
  taxonomy: {
@@ -56,9 +56,7 @@ class InvopopClient {
56
56
  customer: {
57
57
  name: user.mexicoFiscalName
58
58
  ? user.mexicoFiscalName.toLocaleUpperCase()
59
- : user.type === common_1.UserType.Business
60
- ? user.companyName.toLocaleUpperCase()
61
- : `${user.firstName.toLocaleUpperCase()} ${user.lastName.toLocaleUpperCase()}`,
59
+ : (0, common_1.getUserName)(user),
62
60
  tax_id: {
63
61
  country: "MX",
64
62
  zone: user.rfc ? user.postalCode : "66260",
@@ -38,9 +38,7 @@ class KapstarClient {
38
38
  return __awaiter(this, void 0, void 0, function* () {
39
39
  const kapstarResponse = yield this.axiosInstance.post("/transaction-service/v1/external/invoice", {
40
40
  amount,
41
- name: user.type === common_1.UserType.Business
42
- ? user.companyName
43
- : user.firstName + " " + user.lastName,
41
+ name: (0, common_1.getUserName)(user),
44
42
  tags: [orderId],
45
43
  tax_id: user.cpf,
46
44
  });
@@ -1,4 +1,4 @@
1
- import { KYCStatus, Language, PlatformFeeRange, USState, UserAttribute, UserType, CountryOfOrigin } from "@riocrypto/common";
1
+ import { Country, KYCStatus, Language, PlatformFeeRange, USState, UserAttribute, UserType, CountryOfOrigin } from "@riocrypto/common";
2
2
  import { Mongoose, Model, Document } from "mongoose";
3
3
  interface UserAttrs {
4
4
  createdAt: Date;
@@ -41,6 +41,7 @@ interface UserAttrs {
41
41
  authorizedPhoneNumbers?: string[];
42
42
  notificationUrl?: string;
43
43
  rfc?: string;
44
+ countriesToInvoice: Country[];
44
45
  mexicoFiscalRegimenCode?: number;
45
46
  mexicoFiscalName?: string;
46
47
  taxId?: string;
@@ -75,6 +76,7 @@ interface UserDoc extends Document {
75
76
  economicActivity?: string;
76
77
  birthday?: Date;
77
78
  language?: Language;
79
+ countriesToInvoice: Country[];
78
80
  attributes?: UserAttribute[];
79
81
  brokerId?: string;
80
82
  platformFeeRanges?: {
@@ -84,6 +84,11 @@ const buildUser = (mongoose) => {
84
84
  type: String,
85
85
  },
86
86
  ],
87
+ countriesToInvoice: [
88
+ {
89
+ type: String,
90
+ },
91
+ ],
87
92
  kycStatus: {
88
93
  type: String,
89
94
  required: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1205",
3
+ "version": "1.0.1207",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -26,7 +26,7 @@
26
26
  "@aws-sdk/client-s3": "^3.297.0",
27
27
  "@everapi/currencyapi-js": "^1.0.6",
28
28
  "@google-cloud/storage": "^6.9.5",
29
- "@riocrypto/common": "^1.0.1093",
29
+ "@riocrypto/common": "^1.0.1095",
30
30
  "@types/express": "^4.17.13",
31
31
  "axios": "^0.27.2",
32
32
  "ccxt": "^3.0.30",