@riocrypto/common 1.0.1503 → 1.0.1504
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.
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Country } from "../types/country";
|
|
2
|
+
import { User } from "../types/user";
|
|
2
3
|
import { CustomError } from "./custom-error";
|
|
3
4
|
export declare class OnboardingNotApprovedError extends CustomError {
|
|
4
|
-
private
|
|
5
|
+
private user;
|
|
5
6
|
private country;
|
|
6
7
|
statusCode: number;
|
|
7
8
|
internalCode: number;
|
|
8
|
-
constructor(
|
|
9
|
+
constructor(user: User, country: Country);
|
|
9
10
|
serializeErrors(): {
|
|
10
11
|
code: number;
|
|
11
12
|
message: string;
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OnboardingNotApprovedError = void 0;
|
|
4
4
|
const CountryAsset_1 = require("../classes/CountryAsset");
|
|
5
|
+
const get_user_name_1 = require("../helpers/get-user-name");
|
|
5
6
|
const custom_error_1 = require("./custom-error");
|
|
6
7
|
class OnboardingNotApprovedError extends custom_error_1.CustomError {
|
|
7
|
-
constructor(
|
|
8
|
+
constructor(user, country) {
|
|
8
9
|
super(`Onboarding not approved in ${new CountryAsset_1.CountryAsset(country).getName()}`);
|
|
9
|
-
this.
|
|
10
|
+
this.user = user;
|
|
10
11
|
this.country = country;
|
|
11
12
|
this.statusCode = 409;
|
|
12
13
|
this.internalCode = 99;
|
|
@@ -16,9 +17,9 @@ class OnboardingNotApprovedError extends custom_error_1.CustomError {
|
|
|
16
17
|
return [
|
|
17
18
|
{
|
|
18
19
|
code: this.internalCode,
|
|
19
|
-
message: `Onboarding not approved in ${new CountryAsset_1.CountryAsset(this.country).getName()}`,
|
|
20
|
+
message: `Onboarding not approved in ${new CountryAsset_1.CountryAsset(this.country).getName()} for ${(0, get_user_name_1.getUserName)(this.user)}`,
|
|
20
21
|
country: this.country,
|
|
21
|
-
userId: this.
|
|
22
|
+
userId: this.user.id,
|
|
22
23
|
},
|
|
23
24
|
];
|
|
24
25
|
}
|