@riocrypto/common-server 1.0.1762 → 1.0.1764

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.
@@ -16,7 +16,14 @@ declare class CoincoverClient {
16
16
  };
17
17
  }>;
18
18
  registerIndividualUser(user: User): Promise<void>;
19
- registerBusinessUser(user: User, contactPersonName: string, contactPersonEmail: string): Promise<void>;
19
+ registerBusinessUser(user: User, address: {
20
+ street1: string;
21
+ street2?: string;
22
+ city: string;
23
+ state: string;
24
+ postalCode: string;
25
+ country: string;
26
+ }, contactPersonName: string, contactPersonEmail: string): Promise<void>;
20
27
  private formatDate;
21
28
  private formatAddress;
22
29
  private getResidenceCountry;
@@ -13,9 +13,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.buildCoincoverClient = void 0;
16
- const secret_manager_client_1 = require("./secret-manager-client");
17
- const axios_with_logging_1 = __importDefault(require("./axios-with-logging"));
18
16
  const common_1 = require("@riocrypto/common");
17
+ const axios_with_logging_1 = __importDefault(require("./axios-with-logging"));
18
+ const secret_manager_client_1 = require("./secret-manager-client");
19
19
  class CoincoverClient {
20
20
  constructor(apiKey) {
21
21
  this.apiKey = apiKey;
@@ -94,14 +94,13 @@ class CoincoverClient {
94
94
  return data;
95
95
  });
96
96
  }
97
- registerBusinessUser(user, contactPersonName, contactPersonEmail) {
98
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
97
+ registerBusinessUser(user, address, contactPersonName, contactPersonEmail) {
98
+ var _a;
99
99
  return __awaiter(this, void 0, void 0, function* () {
100
- const highestOnboardingCountry = (0, common_1.getHighestOnboardingStatus)(user).country;
101
100
  const { data } = yield axios_with_logging_1.default.post(`${this.baseUrl}/business`, {
102
101
  businessId: user.id,
103
102
  name: (_a = user.businessData) === null || _a === void 0 ? void 0 : _a.businessName,
104
- address: this.formatAddress((_c = (_b = user.onboarding[highestOnboardingCountry]) === null || _b === void 0 ? void 0 : _b.address) === null || _c === void 0 ? void 0 : _c.street1, (_e = (_d = user.onboarding[highestOnboardingCountry]) === null || _d === void 0 ? void 0 : _d.address) === null || _e === void 0 ? void 0 : _e.city, (_g = (_f = user.onboarding[highestOnboardingCountry]) === null || _f === void 0 ? void 0 : _f.address) === null || _g === void 0 ? void 0 : _g.state, (_j = (_h = user.onboarding[highestOnboardingCountry]) === null || _h === void 0 ? void 0 : _h.address) === null || _j === void 0 ? void 0 : _j.postalCode, (_l = (_k = user.onboarding[highestOnboardingCountry]) === null || _k === void 0 ? void 0 : _k.address) === null || _l === void 0 ? void 0 : _l.country, (_o = (_m = user.onboarding[highestOnboardingCountry]) === null || _m === void 0 ? void 0 : _m.address) === null || _o === void 0 ? void 0 : _o.street2),
103
+ address: this.formatAddress(address.street1, address.city, address.state, address.postalCode, address.country, address.street2),
105
104
  contactPersonName,
106
105
  contactPersonEmail,
107
106
  }, {
@@ -107,6 +107,7 @@ interface UserAttrs {
107
107
  };
108
108
  };
109
109
  };
110
+ attioRecordId?: string;
110
111
  }
111
112
  interface UserModel extends Model<UserDoc> {
112
113
  build(attrs: UserAttrs): UserDoc;
@@ -115,6 +116,7 @@ interface UserDoc extends Document {
115
116
  _id: string;
116
117
  createdAt: Date;
117
118
  authIds?: string[];
119
+ attioRecordId?: string;
118
120
  registeredWithCoincover?: boolean;
119
121
  individualData?: {
120
122
  firstName: string;
@@ -41,6 +41,9 @@ const buildUser = (mongoose) => {
41
41
  type: Boolean,
42
42
  required: true,
43
43
  },
44
+ attioRecordId: {
45
+ type: String,
46
+ },
44
47
  attributes: [
45
48
  {
46
49
  type: String,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1762",
3
+ "version": "1.0.1764",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",