@temboplus/afloat 0.1.13 → 0.1.30
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.
- package/esm/src/features/auth/access/contract.d.ts +14 -0
- package/esm/src/features/auth/access/contract.d.ts.map +1 -0
- package/esm/src/features/auth/access/contract.js +14 -0
- package/esm/src/features/auth/contract.d.ts +20 -20
- package/esm/src/features/auth/contract.js +2 -2
- package/esm/src/features/auth/identity/contract.d.ts +0 -7
- package/esm/src/features/auth/identity/contract.d.ts.map +1 -1
- package/esm/src/features/auth/identity/contract.js +0 -1
- package/esm/src/features/auth/identity/repository.d.ts +2 -2
- package/esm/src/features/auth/identity/repository.d.ts.map +1 -1
- package/esm/src/features/auth/identity/repository.js +5 -5
- package/esm/src/features/auth/manager.js +1 -1
- package/esm/src/features/auth/profile/contract.d.ts +17 -25
- package/esm/src/features/auth/profile/contract.d.ts.map +1 -1
- package/esm/src/features/auth/profile/contract.js +2 -4
- package/esm/src/features/auth/repository.d.ts +0 -1
- package/esm/src/features/auth/repository.d.ts.map +1 -1
- package/esm/src/features/auth/repository.js +3 -11
- package/esm/src/features/auth/storage/server_token_handler.d.ts +7 -6
- package/esm/src/features/auth/storage/server_token_handler.d.ts.map +1 -1
- package/esm/src/features/auth/storage/server_token_handler.js +73 -26
- package/esm/src/features/contact/contract.d.ts +10 -10
- package/esm/src/features/payout/contract.d.ts +12 -12
- package/esm/src/features/wallet/repository.d.ts +1 -28
- package/esm/src/features/wallet/repository.d.ts.map +1 -1
- package/esm/src/features/wallet/repository.js +0 -51
- package/esm/src/models/contact/derivatives/contact.js +2 -2
- package/esm/src/models/contact/derivatives/contact_info.d.ts +8 -8
- package/esm/src/models/contact/derivatives/contact_info.d.ts.map +1 -1
- package/esm/src/models/contact/derivatives/contact_info.js +12 -12
- package/esm/src/models/payout/channel.d.ts +4 -4
- package/esm/src/models/payout/channel.d.ts.map +1 -1
- package/esm/src/models/payout/channel.js +2 -2
- package/esm/src/models/payout/derivatives/payout.d.ts.map +1 -1
- package/esm/src/models/payout/derivatives/payout.js +2 -2
- package/esm/src/models/user/profile.d.ts +135 -12
- package/esm/src/models/user/profile.d.ts.map +1 -1
- package/esm/src/models/user/profile.js +318 -12
- package/esm/src/models/user/user.d.ts +14 -17
- package/esm/src/models/user/user.d.ts.map +1 -1
- package/esm/src/models/user/user.js +109 -26
- package/esm/src/models/wallet/index.d.ts +0 -1
- package/esm/src/models/wallet/index.d.ts.map +1 -1
- package/esm/src/models/wallet/index.js +0 -1
- package/esm/src/shared/token_required_repository.d.ts +78 -0
- package/esm/src/shared/token_required_repository.d.ts.map +1 -0
- package/esm/src/shared/token_required_repository.js +128 -0
- package/package.json +7 -7
- package/script/src/features/auth/access/contract.d.ts +14 -0
- package/script/src/features/auth/access/contract.d.ts.map +1 -0
- package/script/src/features/auth/access/contract.js +17 -0
- package/script/src/features/auth/contract.d.ts +20 -20
- package/script/src/features/auth/contract.js +1 -1
- package/script/src/features/auth/identity/contract.d.ts +0 -7
- package/script/src/features/auth/identity/contract.d.ts.map +1 -1
- package/script/src/features/auth/identity/contract.js +0 -1
- package/script/src/features/auth/identity/repository.d.ts +2 -2
- package/script/src/features/auth/identity/repository.d.ts.map +1 -1
- package/script/src/features/auth/identity/repository.js +5 -5
- package/script/src/features/auth/manager.js +1 -1
- package/script/src/features/auth/profile/contract.d.ts +17 -25
- package/script/src/features/auth/profile/contract.d.ts.map +1 -1
- package/script/src/features/auth/profile/contract.js +1 -3
- package/script/src/features/auth/repository.d.ts +0 -1
- package/script/src/features/auth/repository.d.ts.map +1 -1
- package/script/src/features/auth/repository.js +3 -11
- package/script/src/features/auth/storage/server_token_handler.d.ts +7 -6
- package/script/src/features/auth/storage/server_token_handler.d.ts.map +1 -1
- package/script/src/features/auth/storage/server_token_handler.js +72 -25
- package/script/src/features/contact/contract.d.ts +10 -10
- package/script/src/features/payout/contract.d.ts +12 -12
- package/script/src/features/wallet/repository.d.ts +1 -28
- package/script/src/features/wallet/repository.d.ts.map +1 -1
- package/script/src/features/wallet/repository.js +0 -51
- package/script/src/models/contact/derivatives/contact.js +1 -1
- package/script/src/models/contact/derivatives/contact_info.d.ts +8 -8
- package/script/src/models/contact/derivatives/contact_info.d.ts.map +1 -1
- package/script/src/models/contact/derivatives/contact_info.js +11 -11
- package/script/src/models/payout/channel.d.ts +4 -4
- package/script/src/models/payout/channel.d.ts.map +1 -1
- package/script/src/models/payout/channel.js +2 -2
- package/script/src/models/payout/derivatives/payout.d.ts.map +1 -1
- package/script/src/models/payout/derivatives/payout.js +1 -1
- package/script/src/models/user/profile.d.ts +135 -12
- package/script/src/models/user/profile.d.ts.map +1 -1
- package/script/src/models/user/profile.js +320 -13
- package/script/src/models/user/user.d.ts +14 -17
- package/script/src/models/user/user.d.ts.map +1 -1
- package/script/src/models/user/user.js +109 -26
- package/script/src/models/wallet/index.d.ts +0 -1
- package/script/src/models/wallet/index.d.ts.map +1 -1
- package/script/src/models/wallet/index.js +0 -1
- package/script/src/shared/token_required_repository.d.ts +78 -0
- package/script/src/shared/token_required_repository.d.ts.map +1 -0
- package/script/src/shared/token_required_repository.js +132 -0
- package/esm/src/features/auth/profile/repository.d.ts +0 -11
- package/esm/src/features/auth/profile/repository.d.ts.map +0 -1
- package/esm/src/features/auth/profile/repository.js +0 -21
- package/esm/src/features/files-gen/contract.d.ts +0 -67
- package/esm/src/features/files-gen/contract.d.ts.map +0 -1
- package/esm/src/features/files-gen/contract.js +0 -40
- package/esm/src/features/files-gen/repository.d.ts +0 -50
- package/esm/src/features/files-gen/repository.d.ts.map +0 -1
- package/esm/src/features/files-gen/repository.js +0 -56
- package/esm/src/models/wallet/statement.d.ts +0 -27
- package/esm/src/models/wallet/statement.d.ts.map +0 -1
- package/esm/src/models/wallet/statement.js +0 -13
- package/script/src/features/auth/profile/repository.d.ts +0 -11
- package/script/src/features/auth/profile/repository.d.ts.map +0 -1
- package/script/src/features/auth/profile/repository.js +0 -25
- package/script/src/features/files-gen/contract.d.ts +0 -67
- package/script/src/features/files-gen/contract.d.ts.map +0 -1
- package/script/src/features/files-gen/contract.js +0 -43
- package/script/src/features/files-gen/repository.d.ts +0 -50
- package/script/src/features/files-gen/repository.d.ts.map +0 -1
- package/script/src/features/files-gen/repository.js +0 -60
- package/script/src/models/wallet/statement.d.ts +0 -27
- package/script/src/models/wallet/statement.d.ts.map +0 -1
- package/script/src/models/wallet/statement.js +0 -16
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ServerTokenHandler = void 0;
|
|
4
4
|
const index_js_1 = require("../../../models/index.js");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
5
|
+
const contract_js_1 = require("../profile/contract.js");
|
|
6
|
+
const contract_js_2 = require("../identity/contract.js");
|
|
7
|
+
const token_required_repository_js_1 = require("../../../shared/token_required_repository.js");
|
|
8
|
+
const contract_js_3 = require("../access/contract.js");
|
|
8
9
|
/**
|
|
9
10
|
* Server-side implementation of TokenHandler.
|
|
10
11
|
* Manages tokens in memory for the duration of a request.
|
|
12
|
+
* Uses TokenRequiredRepository instead of repositories that rely on AfloatAuth.
|
|
11
13
|
* @implements {TokenHandler}
|
|
12
14
|
*/
|
|
13
15
|
class ServerTokenHandler {
|
|
@@ -20,8 +22,30 @@ class ServerTokenHandler {
|
|
|
20
22
|
enumerable: true,
|
|
21
23
|
configurable: true,
|
|
22
24
|
writable: true,
|
|
23
|
-
value:
|
|
25
|
+
value: void 0
|
|
24
26
|
});
|
|
27
|
+
Object.defineProperty(this, "accessRepo", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
configurable: true,
|
|
30
|
+
writable: true,
|
|
31
|
+
value: void 0
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(this, "profileRepo", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
configurable: true,
|
|
36
|
+
writable: true,
|
|
37
|
+
value: void 0
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(this, "identityRepo", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
configurable: true,
|
|
42
|
+
writable: true,
|
|
43
|
+
value: void 0
|
|
44
|
+
});
|
|
45
|
+
this.token = token;
|
|
46
|
+
this.accessRepo = new token_required_repository_js_1.TokenRequiredRepository("auth", contract_js_3.accessContract, this.token);
|
|
47
|
+
this.profileRepo = new token_required_repository_js_1.TokenRequiredRepository("profile", contract_js_1.profileContract, this.token);
|
|
48
|
+
this.identityRepo = new token_required_repository_js_1.TokenRequiredRepository("login", contract_js_2.identityContract, this.token);
|
|
25
49
|
}
|
|
26
50
|
/**
|
|
27
51
|
* Returns the stored token.
|
|
@@ -36,37 +60,60 @@ class ServerTokenHandler {
|
|
|
36
60
|
*/
|
|
37
61
|
setUserToken(token) {
|
|
38
62
|
this.token = token;
|
|
63
|
+
this.accessRepo.setToken(token);
|
|
64
|
+
this.profileRepo.setToken(token);
|
|
65
|
+
this.identityRepo.setToken(token);
|
|
39
66
|
}
|
|
40
|
-
/**
|
|
41
|
-
* Clears the stored token from memory.
|
|
42
|
-
*/
|
|
43
67
|
clearToken() {
|
|
44
|
-
this.token =
|
|
68
|
+
this.token = "";
|
|
69
|
+
this.accessRepo.setToken("");
|
|
70
|
+
this.profileRepo.setToken("");
|
|
71
|
+
this.identityRepo.setToken("");
|
|
45
72
|
}
|
|
46
73
|
/**
|
|
47
74
|
* Fetches and constructs the full user data
|
|
48
75
|
* @returns {Promise<User>}
|
|
49
76
|
*/
|
|
50
|
-
async constructUser() {
|
|
77
|
+
async constructUser(token) {
|
|
51
78
|
if (!this.token) {
|
|
52
79
|
throw new Error("Token is required to construct user");
|
|
53
80
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
81
|
+
this.setUserToken(token);
|
|
82
|
+
try {
|
|
83
|
+
// Fetch all data concurrently with Promise.all
|
|
84
|
+
const [access, profileResult, identityResult] = await Promise.all([
|
|
85
|
+
this.accessRepo.client.getAccessList(),
|
|
86
|
+
this.profileRepo.client.getCurrentProfile(),
|
|
87
|
+
this.identityRepo.client.getUserCredentials(),
|
|
88
|
+
]);
|
|
89
|
+
// Extract and validate response data
|
|
90
|
+
const accessList = this.accessRepo.handleResponse(access, 200);
|
|
91
|
+
const profileData = this.profileRepo.handleResponse(profileResult, 200);
|
|
92
|
+
const identityData = this.identityRepo.handleResponse(identityResult, 200);
|
|
93
|
+
// Create profile object
|
|
94
|
+
const profile = index_js_1.Profile.from(profileData);
|
|
95
|
+
if (!profile) {
|
|
96
|
+
throw new Error("Failed to create profile from response data");
|
|
97
|
+
}
|
|
98
|
+
// Construct and return user object
|
|
99
|
+
const user = index_js_1.User.from({
|
|
100
|
+
token: this.token,
|
|
101
|
+
profile,
|
|
102
|
+
access: accessList,
|
|
103
|
+
resetPassword: false,
|
|
104
|
+
...identityData,
|
|
105
|
+
});
|
|
106
|
+
if (!user) {
|
|
107
|
+
throw new Error("Failed to construct user");
|
|
108
|
+
}
|
|
109
|
+
return user;
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
const message = error instanceof Error
|
|
113
|
+
? error.message
|
|
114
|
+
: "Unknown error occurred";
|
|
115
|
+
throw new Error(`Error constructing user: ${message}`);
|
|
116
|
+
}
|
|
70
117
|
}
|
|
71
118
|
}
|
|
72
119
|
exports.ServerTokenHandler = ServerTokenHandler;
|
|
@@ -17,14 +17,14 @@ export declare const contract: {
|
|
|
17
17
|
channel: z.ZodString;
|
|
18
18
|
type: z.ZodEnum<["Bank", "Mobile"]>;
|
|
19
19
|
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
20
|
+
type: "Bank" | "Mobile";
|
|
20
21
|
displayName: string;
|
|
21
22
|
accountNo: string;
|
|
22
|
-
type: "Bank" | "Mobile";
|
|
23
23
|
channel: string;
|
|
24
24
|
}, {
|
|
25
|
+
type: "Bank" | "Mobile";
|
|
25
26
|
displayName: string;
|
|
26
27
|
accountNo: string;
|
|
27
|
-
type: "Bank" | "Mobile";
|
|
28
28
|
channel: string;
|
|
29
29
|
}>;
|
|
30
30
|
path: "/";
|
|
@@ -40,19 +40,19 @@ export declare const contract: {
|
|
|
40
40
|
createdAt: z.ZodDate;
|
|
41
41
|
updatedAt: z.ZodDate;
|
|
42
42
|
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
43
|
+
type: "Bank" | "Mobile";
|
|
43
44
|
id: string;
|
|
44
45
|
displayName: string;
|
|
45
46
|
accountNo: string;
|
|
46
|
-
type: "Bank" | "Mobile";
|
|
47
47
|
channel: string;
|
|
48
48
|
profileId: string;
|
|
49
49
|
createdAt: Date;
|
|
50
50
|
updatedAt: Date;
|
|
51
51
|
}, {
|
|
52
|
+
type: "Bank" | "Mobile";
|
|
52
53
|
id: string;
|
|
53
54
|
displayName: string;
|
|
54
55
|
accountNo: string;
|
|
55
|
-
type: "Bank" | "Mobile";
|
|
56
56
|
channel: string;
|
|
57
57
|
profileId: string;
|
|
58
58
|
createdAt: Date;
|
|
@@ -68,14 +68,14 @@ export declare const contract: {
|
|
|
68
68
|
channel: z.ZodString;
|
|
69
69
|
type: z.ZodEnum<["Bank", "Mobile"]>;
|
|
70
70
|
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
71
|
+
type: "Bank" | "Mobile";
|
|
71
72
|
displayName: string;
|
|
72
73
|
accountNo: string;
|
|
73
|
-
type: "Bank" | "Mobile";
|
|
74
74
|
channel: string;
|
|
75
75
|
}, {
|
|
76
|
+
type: "Bank" | "Mobile";
|
|
76
77
|
displayName: string;
|
|
77
78
|
accountNo: string;
|
|
78
|
-
type: "Bank" | "Mobile";
|
|
79
79
|
channel: string;
|
|
80
80
|
}>;
|
|
81
81
|
path: "/:id";
|
|
@@ -91,19 +91,19 @@ export declare const contract: {
|
|
|
91
91
|
createdAt: z.ZodDate;
|
|
92
92
|
updatedAt: z.ZodDate;
|
|
93
93
|
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
94
|
+
type: "Bank" | "Mobile";
|
|
94
95
|
id: string;
|
|
95
96
|
displayName: string;
|
|
96
97
|
accountNo: string;
|
|
97
|
-
type: "Bank" | "Mobile";
|
|
98
98
|
channel: string;
|
|
99
99
|
profileId: string;
|
|
100
100
|
createdAt: Date;
|
|
101
101
|
updatedAt: Date;
|
|
102
102
|
}, {
|
|
103
|
+
type: "Bank" | "Mobile";
|
|
103
104
|
id: string;
|
|
104
105
|
displayName: string;
|
|
105
106
|
accountNo: string;
|
|
106
|
-
type: "Bank" | "Mobile";
|
|
107
107
|
channel: string;
|
|
108
108
|
profileId: string;
|
|
109
109
|
createdAt: Date;
|
|
@@ -133,19 +133,19 @@ export declare const contract: {
|
|
|
133
133
|
createdAt: z.ZodDate;
|
|
134
134
|
updatedAt: z.ZodDate;
|
|
135
135
|
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
136
|
+
type: "Bank" | "Mobile";
|
|
136
137
|
id: string;
|
|
137
138
|
displayName: string;
|
|
138
139
|
accountNo: string;
|
|
139
|
-
type: "Bank" | "Mobile";
|
|
140
140
|
channel: string;
|
|
141
141
|
profileId: string;
|
|
142
142
|
createdAt: Date;
|
|
143
143
|
updatedAt: Date;
|
|
144
144
|
}, {
|
|
145
|
+
type: "Bank" | "Mobile";
|
|
145
146
|
id: string;
|
|
146
147
|
displayName: string;
|
|
147
148
|
accountNo: string;
|
|
148
|
-
type: "Bank" | "Mobile";
|
|
149
149
|
channel: string;
|
|
150
150
|
profileId: string;
|
|
151
151
|
createdAt: Date;
|
|
@@ -85,8 +85,8 @@ export declare const contract: {
|
|
|
85
85
|
identity: string;
|
|
86
86
|
} | null>>;
|
|
87
87
|
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
88
|
-
id: string;
|
|
89
88
|
status: import("../../models/payout/status.js").PAYOUT_STATUS;
|
|
89
|
+
id: string;
|
|
90
90
|
channel: string;
|
|
91
91
|
profileId: string;
|
|
92
92
|
createdAt: Date;
|
|
@@ -108,8 +108,8 @@ export declare const contract: {
|
|
|
108
108
|
identity: string;
|
|
109
109
|
} | undefined;
|
|
110
110
|
}, {
|
|
111
|
-
id: string;
|
|
112
111
|
status: import("../../models/payout/status.js").PAYOUT_STATUS;
|
|
112
|
+
id: string;
|
|
113
113
|
channel: string;
|
|
114
114
|
profileId: string;
|
|
115
115
|
createdAt: Date;
|
|
@@ -134,8 +134,8 @@ export declare const contract: {
|
|
|
134
134
|
total: z.ZodNumber;
|
|
135
135
|
}, "strip", z.ZodTypeAny, {
|
|
136
136
|
results: {
|
|
137
|
-
id: string;
|
|
138
137
|
status: import("../../models/payout/status.js").PAYOUT_STATUS;
|
|
138
|
+
id: string;
|
|
139
139
|
channel: string;
|
|
140
140
|
profileId: string;
|
|
141
141
|
createdAt: Date;
|
|
@@ -160,8 +160,8 @@ export declare const contract: {
|
|
|
160
160
|
total: number;
|
|
161
161
|
}, {
|
|
162
162
|
results: {
|
|
163
|
-
id: string;
|
|
164
163
|
status: import("../../models/payout/status.js").PAYOUT_STATUS;
|
|
164
|
+
id: string;
|
|
165
165
|
channel: string;
|
|
166
166
|
profileId: string;
|
|
167
167
|
createdAt: Date;
|
|
@@ -259,8 +259,8 @@ export declare const contract: {
|
|
|
259
259
|
identity: string;
|
|
260
260
|
} | null>>;
|
|
261
261
|
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
262
|
-
id: string;
|
|
263
262
|
status: import("../../models/payout/status.js").PAYOUT_STATUS;
|
|
263
|
+
id: string;
|
|
264
264
|
channel: string;
|
|
265
265
|
profileId: string;
|
|
266
266
|
createdAt: Date;
|
|
@@ -282,8 +282,8 @@ export declare const contract: {
|
|
|
282
282
|
identity: string;
|
|
283
283
|
} | undefined;
|
|
284
284
|
}, {
|
|
285
|
-
id: string;
|
|
286
285
|
status: import("../../models/payout/status.js").PAYOUT_STATUS;
|
|
286
|
+
id: string;
|
|
287
287
|
channel: string;
|
|
288
288
|
profileId: string;
|
|
289
289
|
createdAt: Date;
|
|
@@ -308,8 +308,8 @@ export declare const contract: {
|
|
|
308
308
|
total: z.ZodNumber;
|
|
309
309
|
}, "strip", z.ZodTypeAny, {
|
|
310
310
|
results: {
|
|
311
|
-
id: string;
|
|
312
311
|
status: import("../../models/payout/status.js").PAYOUT_STATUS;
|
|
312
|
+
id: string;
|
|
313
313
|
channel: string;
|
|
314
314
|
profileId: string;
|
|
315
315
|
createdAt: Date;
|
|
@@ -334,8 +334,8 @@ export declare const contract: {
|
|
|
334
334
|
total: number;
|
|
335
335
|
}, {
|
|
336
336
|
results: {
|
|
337
|
-
id: string;
|
|
338
337
|
status: import("../../models/payout/status.js").PAYOUT_STATUS;
|
|
338
|
+
id: string;
|
|
339
339
|
channel: string;
|
|
340
340
|
profileId: string;
|
|
341
341
|
createdAt: Date;
|
|
@@ -435,8 +435,8 @@ export declare const contract: {
|
|
|
435
435
|
identity: string;
|
|
436
436
|
} | null>>;
|
|
437
437
|
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
438
|
-
id: string;
|
|
439
438
|
status: import("../../models/payout/status.js").PAYOUT_STATUS;
|
|
439
|
+
id: string;
|
|
440
440
|
channel: string;
|
|
441
441
|
profileId: string;
|
|
442
442
|
createdAt: Date;
|
|
@@ -458,8 +458,8 @@ export declare const contract: {
|
|
|
458
458
|
identity: string;
|
|
459
459
|
} | undefined;
|
|
460
460
|
}, {
|
|
461
|
-
id: string;
|
|
462
461
|
status: import("../../models/payout/status.js").PAYOUT_STATUS;
|
|
462
|
+
id: string;
|
|
463
463
|
channel: string;
|
|
464
464
|
profileId: string;
|
|
465
465
|
createdAt: Date;
|
|
@@ -565,8 +565,8 @@ export declare const contract: {
|
|
|
565
565
|
identity: string;
|
|
566
566
|
} | null>>;
|
|
567
567
|
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
568
|
-
id: string;
|
|
569
568
|
status: import("../../models/payout/status.js").PAYOUT_STATUS;
|
|
569
|
+
id: string;
|
|
570
570
|
channel: string;
|
|
571
571
|
profileId: string;
|
|
572
572
|
createdAt: Date;
|
|
@@ -588,8 +588,8 @@ export declare const contract: {
|
|
|
588
588
|
identity: string;
|
|
589
589
|
} | undefined;
|
|
590
590
|
}, {
|
|
591
|
-
id: string;
|
|
592
591
|
status: import("../../models/payout/status.js").PAYOUT_STATUS;
|
|
592
|
+
id: string;
|
|
593
593
|
channel: string;
|
|
594
594
|
profileId: string;
|
|
595
595
|
createdAt: Date;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseRepository } from "../../shared/base_repository.js";
|
|
2
2
|
import { contract } from "./contract.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { Wallet, WalletStatementItem } from "../../models/wallet/index.js";
|
|
4
4
|
import type { AfloatAuth } from "../auth/manager.js";
|
|
5
5
|
/**
|
|
6
6
|
* Repository class for managing wallet operations including balance checking,
|
|
@@ -18,12 +18,6 @@ export declare class WalletRepo extends BaseRepository<typeof contract> {
|
|
|
18
18
|
root?: string;
|
|
19
19
|
auth?: AfloatAuth;
|
|
20
20
|
});
|
|
21
|
-
/**
|
|
22
|
-
* Gets an instance of the file generation repository.
|
|
23
|
-
* @private
|
|
24
|
-
* @returns {AfloatFilesRepo} A new instance of AfloatFilesRepo
|
|
25
|
-
*/
|
|
26
|
-
private get fileGenRepo();
|
|
27
21
|
/**
|
|
28
22
|
* Retrieves the current available balance for the wallet.
|
|
29
23
|
* @throws {PermissionError} If user lacks the ViewBalance permission
|
|
@@ -56,26 +50,5 @@ export declare class WalletRepo extends BaseRepository<typeof contract> {
|
|
|
56
50
|
};
|
|
57
51
|
accountNo?: string;
|
|
58
52
|
}): Promise<WalletStatementItem[]>;
|
|
59
|
-
/**
|
|
60
|
-
* Generates a statement file for the specified period and account.
|
|
61
|
-
* @param {STATEMENT_OUTPUT_TYPE} fileType - The desired output format type for the statement
|
|
62
|
-
* @param {Object} props - The statement generation properties
|
|
63
|
-
* @param {Date} props.startDate - Start date for the statement period
|
|
64
|
-
* @param {Date} props.endDate - End date for the statement period
|
|
65
|
-
* @param {string} [props.accountNo] - Optional account number to generate statement for
|
|
66
|
-
* @throws {PermissionError} If user lacks the ViewStatement permission
|
|
67
|
-
* @returns {Promise<StatementFile>} The generated statement file
|
|
68
|
-
*/
|
|
69
|
-
genStatement(fileType: STATEMENT_OUTPUT_TYPE, props: {
|
|
70
|
-
startDate: Date;
|
|
71
|
-
endDate: Date;
|
|
72
|
-
accountNo?: string;
|
|
73
|
-
}): Promise<StatementFile>;
|
|
74
|
-
/**
|
|
75
|
-
* Generates a PDF containing detailed wallet account information.
|
|
76
|
-
* @throws {PermissionError} If user lacks the ViewBalance permission
|
|
77
|
-
* @returns {Promise<StatementFile>} The generated PDF file containing wallet details
|
|
78
|
-
*/
|
|
79
|
-
genWalletDetailsPDF(): Promise<StatementFile>;
|
|
80
53
|
}
|
|
81
54
|
//# sourceMappingURL=repository.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../../src/src/features/wallet/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../../src/src/features/wallet/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,EACV,MAAM,EACN,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,cAAc,CAAC,OAAO,QAAQ,CAAC;IAC7D;;;;;OAKG;gBACS,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,UAAU,CAAA;KAAE;IAOxD;;;;;OAKG;IACG,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAoBnC;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAUrC;;;;;;;;;;;OAWG;IACG,YAAY,CAChB,KAAK,EAAE;QACL,KAAK,CAAC,EAAE;YAAE,SAAS,EAAE,IAAI,CAAC;YAAC,OAAO,EAAE,IAAI,CAAA;SAAE,CAAC;QAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GACA,OAAO,CAAC,mBAAmB,EAAE,CAAC;CA2BlC"}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.WalletRepo = void 0;
|
|
4
4
|
const base_repository_js_1 = require("../../shared/base_repository.js");
|
|
5
5
|
const contract_js_1 = require("./contract.js");
|
|
6
|
-
const repository_js_1 = require("../files-gen/repository.js");
|
|
7
6
|
const permission_js_1 = require("../../models/permission.js");
|
|
8
7
|
const index_js_1 = require("../../errors/index.js");
|
|
9
8
|
/**
|
|
@@ -24,14 +23,6 @@ class WalletRepo extends base_repository_js_1.BaseRepository {
|
|
|
24
23
|
auth: props?.auth,
|
|
25
24
|
});
|
|
26
25
|
}
|
|
27
|
-
/**
|
|
28
|
-
* Gets an instance of the file generation repository.
|
|
29
|
-
* @private
|
|
30
|
-
* @returns {AfloatFilesRepo} A new instance of AfloatFilesRepo
|
|
31
|
-
*/
|
|
32
|
-
get fileGenRepo() {
|
|
33
|
-
return new repository_js_1.AfloatFilesRepo({ auth: this.auth });
|
|
34
|
-
}
|
|
35
26
|
/**
|
|
36
27
|
* Retrieves the current available balance for the wallet.
|
|
37
28
|
* @throws {PermissionError} If user lacks the ViewBalance permission
|
|
@@ -99,47 +90,5 @@ class WalletRepo extends base_repository_js_1.BaseRepository {
|
|
|
99
90
|
}
|
|
100
91
|
throw new Error("An error occured while fetching statement");
|
|
101
92
|
}
|
|
102
|
-
/**
|
|
103
|
-
* Generates a statement file for the specified period and account.
|
|
104
|
-
* @param {STATEMENT_OUTPUT_TYPE} fileType - The desired output format type for the statement
|
|
105
|
-
* @param {Object} props - The statement generation properties
|
|
106
|
-
* @param {Date} props.startDate - Start date for the statement period
|
|
107
|
-
* @param {Date} props.endDate - End date for the statement period
|
|
108
|
-
* @param {string} [props.accountNo] - Optional account number to generate statement for
|
|
109
|
-
* @throws {PermissionError} If user lacks the ViewStatement permission
|
|
110
|
-
* @returns {Promise<StatementFile>} The generated statement file
|
|
111
|
-
*/
|
|
112
|
-
async genStatement(fileType, props) {
|
|
113
|
-
const auth = this.getAuthForPermissionCheck();
|
|
114
|
-
const requirePerm = permission_js_1.Permissions.Wallet.ViewStatement;
|
|
115
|
-
if (!auth.checkPermission(requirePerm)) {
|
|
116
|
-
throw new index_js_1.PermissionError({
|
|
117
|
-
message: "You are not authorized to view the statement.",
|
|
118
|
-
requiredPermissions: [requirePerm],
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
return await this.fileGenRepo.downloadStatement({
|
|
122
|
-
start_date: props.startDate,
|
|
123
|
-
end_date: props.endDate,
|
|
124
|
-
return_file_type: fileType,
|
|
125
|
-
account_no: props.accountNo,
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Generates a PDF containing detailed wallet account information.
|
|
130
|
-
* @throws {PermissionError} If user lacks the ViewBalance permission
|
|
131
|
-
* @returns {Promise<StatementFile>} The generated PDF file containing wallet details
|
|
132
|
-
*/
|
|
133
|
-
async genWalletDetailsPDF() {
|
|
134
|
-
const auth = this.getAuthForPermissionCheck();
|
|
135
|
-
const requirePerm = permission_js_1.Permissions.Wallet.ViewBalance;
|
|
136
|
-
if (!auth.checkPermission(requirePerm)) {
|
|
137
|
-
throw new index_js_1.PermissionError({
|
|
138
|
-
message: "You are not authorized to view the account details.",
|
|
139
|
-
requiredPermissions: [requirePerm],
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
return await this.fileGenRepo.genAccountDetailsPDF();
|
|
143
|
-
}
|
|
144
93
|
}
|
|
145
94
|
exports.WalletRepo = WalletRepo;
|
|
@@ -71,7 +71,7 @@ class Contact {
|
|
|
71
71
|
*/
|
|
72
72
|
get info() {
|
|
73
73
|
if (this.data.type === "Mobile") {
|
|
74
|
-
const phone = frontend_core_1.
|
|
74
|
+
const phone = frontend_core_1.TZPhoneNumber.from(this.data.accountNo);
|
|
75
75
|
if (phone) {
|
|
76
76
|
return new index_js_1.MobileContactInfo(this.data.displayName, phone);
|
|
77
77
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ContactType } from "../index.js";
|
|
2
|
-
import { Bank,
|
|
2
|
+
import { Bank, TZPhoneNumber } from "@temboplus/frontend-core";
|
|
3
3
|
/**
|
|
4
4
|
* Abstract base class that provides a common interface for different types of contact information.
|
|
5
5
|
* This class defines the structure and validation requirements for both mobile and bank contacts.
|
|
@@ -65,17 +65,17 @@ declare abstract class BaseContactInfo {
|
|
|
65
65
|
* @extends BaseContactInfo
|
|
66
66
|
* @class MobileContactInfo
|
|
67
67
|
* @property {string} name - The contact's personal name
|
|
68
|
-
* @property {
|
|
68
|
+
* @property {TZPhoneNumber} phoneNumber - The contact's phone number object
|
|
69
69
|
*/
|
|
70
70
|
export declare class MobileContactInfo extends BaseContactInfo {
|
|
71
71
|
readonly name: string;
|
|
72
|
-
readonly phoneNumber:
|
|
72
|
+
readonly phoneNumber: TZPhoneNumber;
|
|
73
73
|
/**
|
|
74
74
|
* Creates a new mobile contact
|
|
75
75
|
* @param {string} name - The contact's personal name
|
|
76
|
-
* @param {
|
|
76
|
+
* @param {TZPhoneNumber} phoneNumber - The contact's phone number
|
|
77
77
|
*/
|
|
78
|
-
constructor(name: string, phoneNumber:
|
|
78
|
+
constructor(name: string, phoneNumber: TZPhoneNumber);
|
|
79
79
|
/**
|
|
80
80
|
* Validates the mobile contact information
|
|
81
81
|
* Checks that:
|
|
@@ -96,14 +96,14 @@ export declare class MobileContactInfo extends BaseContactInfo {
|
|
|
96
96
|
* if (MobileContactInfo.is(maybeContact)) {
|
|
97
97
|
* // maybeContact is typed as MobileContactInfo
|
|
98
98
|
* console.log(maybeContact.name);
|
|
99
|
-
* console.log(maybeContact.
|
|
99
|
+
* console.log(maybeContact.TZPhoneNumber.label);
|
|
100
100
|
* }
|
|
101
101
|
*
|
|
102
102
|
* @remarks
|
|
103
103
|
* - Name must be a non-empty string
|
|
104
104
|
* - Phone number can be either:
|
|
105
|
-
* - A string that can be parsed into a valid
|
|
106
|
-
* - A
|
|
105
|
+
* - A string that can be parsed into a valid TZPhoneNumber
|
|
106
|
+
* - A TZPhoneNumber object with valid properties
|
|
107
107
|
* - Returns false if either property is invalid or missing
|
|
108
108
|
*/
|
|
109
109
|
static is(obj: unknown): obj is MobileContactInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact_info.d.ts","sourceRoot":"","sources":["../../../../../src/src/models/contact/derivatives/contact_info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,
|
|
1
|
+
{"version":3,"file":"contact_info.d.ts","sourceRoot":"","sources":["../../../../../src/src/models/contact/derivatives/contact_info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,IAAI,EAEJ,aAAa,EACd,MAAM,0BAA0B,CAAC;AAMlC;;;;;;;GAOG;AACH,uBAAe,eAAe;IAC5B,SAAgB,IAAI,EAAE,WAAW,CAAC;IAElC;;;OAGG;gBACS,IAAI,EAAE,WAAW;IAI7B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,IAAI,OAAO;IAE5B;;;;OAIG;IACH,QAAQ,KAAK,WAAW,IAAI,MAAM,CAAC;IAEnC;;;;OAIG;IACH,QAAQ,KAAK,SAAS,IAAI,MAAM,CAAC;IAEjC;;;;OAIG;IACH,QAAQ,KAAK,OAAO,IAAI,MAAM,CAAC;IAE/B;;;;OAIG;IACH,QAAQ,KAAK,gBAAgB,IAAI,MAAM,CAAC;IAExC;;;;OAIG;IACH,QAAQ,KAAK,cAAc,IAAI,MAAM,CAAC;IAEtC;;;;OAIG;IACH,QAAQ,KAAK,YAAY,IAAI,MAAM,CAAC;CACrC;AAED;;;;;;;;GAQG;AACH,qBAAa,iBAAkB,SAAQ,eAAe;aAOlC,IAAI,EAAE,MAAM;aACZ,WAAW,EAAE,aAAa;IAP5C;;;;OAIG;gBAEe,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,aAAa;IAK5C;;;;;;OAMG;IACH,QAAQ,IAAI,OAAO;IAMnB;;;;;;;;;;;;;;;;;;;;;OAqBG;WACW,EAAE,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,iBAAiB;IA6BxD,IAAa,WAAW,IAAI,MAAM,CAEjC;IAED;;;OAGG;IACH,IAAa,SAAS,IAAI,MAAM,CAE/B;IAED,IAAa,OAAO,IAAI,MAAM,CAE7B;IAED,IAAa,gBAAgB,IAAI,MAAM,CAEtC;IAED,IAAa,cAAc,IAAI,MAAM,CAEpC;IAED,IAAa,YAAY,IAAI,MAAM,CAElC;CACF;AAED;;;;;;;;;GASG;AACH,qBAAa,eAAgB,SAAQ,eAAe;aAQhC,OAAO,EAAE,MAAM;aACf,IAAI,EAAE,IAAI;aACV,KAAK,EAAE,MAAM;IAT/B;;;;;OAKG;gBAEe,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,MAAM;IAK/B;;;;;;;OAOG;IACH,QAAQ,IAAI,OAAO;IAMnB;;;;;;;;;;;;;;;;;;;;;;OAsBG;WACW,EAAE,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,eAAe;IA8BtD,IAAa,WAAW,IAAI,MAAM,CAEjC;IAED,IAAa,SAAS,IAAI,MAAM,CAE/B;IAED,IAAa,OAAO,IAAI,MAAM,CAE7B;IAED,IAAa,gBAAgB,IAAI,MAAM,CAEtC;IAED,IAAa,cAAc,IAAI,MAAM,CAEpC;IAED,IAAa,YAAY,IAAI,MAAM,CAElC;CACF;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,iBAAiB,GAAG,eAAe,CAAC"}
|
|
@@ -33,13 +33,13 @@ class BaseContactInfo {
|
|
|
33
33
|
* @extends BaseContactInfo
|
|
34
34
|
* @class MobileContactInfo
|
|
35
35
|
* @property {string} name - The contact's personal name
|
|
36
|
-
* @property {
|
|
36
|
+
* @property {TZPhoneNumber} phoneNumber - The contact's phone number object
|
|
37
37
|
*/
|
|
38
38
|
class MobileContactInfo extends BaseContactInfo {
|
|
39
39
|
/**
|
|
40
40
|
* Creates a new mobile contact
|
|
41
41
|
* @param {string} name - The contact's personal name
|
|
42
|
-
* @param {
|
|
42
|
+
* @param {TZPhoneNumber} phoneNumber - The contact's phone number
|
|
43
43
|
*/
|
|
44
44
|
constructor(name, phoneNumber) {
|
|
45
45
|
super("Mobile");
|
|
@@ -65,7 +65,7 @@ class MobileContactInfo extends BaseContactInfo {
|
|
|
65
65
|
*/
|
|
66
66
|
validate() {
|
|
67
67
|
return this.phoneNumber !== undefined &&
|
|
68
|
-
frontend_core_1.
|
|
68
|
+
frontend_core_1.TZPhoneNumber.canConstruct(this.phoneNumber.compactNumber) &&
|
|
69
69
|
this.name.length > 0;
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
@@ -80,14 +80,14 @@ class MobileContactInfo extends BaseContactInfo {
|
|
|
80
80
|
* if (MobileContactInfo.is(maybeContact)) {
|
|
81
81
|
* // maybeContact is typed as MobileContactInfo
|
|
82
82
|
* console.log(maybeContact.name);
|
|
83
|
-
* console.log(maybeContact.
|
|
83
|
+
* console.log(maybeContact.TZPhoneNumber.label);
|
|
84
84
|
* }
|
|
85
85
|
*
|
|
86
86
|
* @remarks
|
|
87
87
|
* - Name must be a non-empty string
|
|
88
88
|
* - Phone number can be either:
|
|
89
|
-
* - A string that can be parsed into a valid
|
|
90
|
-
* - A
|
|
89
|
+
* - A string that can be parsed into a valid TZPhoneNumber
|
|
90
|
+
* - A TZPhoneNumber object with valid properties
|
|
91
91
|
* - Returns false if either property is invalid or missing
|
|
92
92
|
*/
|
|
93
93
|
static is(obj) {
|
|
@@ -98,14 +98,14 @@ class MobileContactInfo extends BaseContactInfo {
|
|
|
98
98
|
if (typeof mobileContactInfo.name !== "string")
|
|
99
99
|
return false;
|
|
100
100
|
const name = mobileContactInfo.name;
|
|
101
|
-
// checks if
|
|
101
|
+
// checks if TZPhoneNumber exists and is valid
|
|
102
102
|
let phone_number = undefined;
|
|
103
103
|
if (typeof mobileContactInfo.phoneNumber === "string") {
|
|
104
|
-
phone_number = frontend_core_1.
|
|
104
|
+
phone_number = frontend_core_1.TZPhoneNumber.from(mobileContactInfo.phoneNumber);
|
|
105
105
|
}
|
|
106
106
|
if (typeof mobileContactInfo.phoneNumber === "object") {
|
|
107
107
|
const obj = mobileContactInfo.phoneNumber;
|
|
108
|
-
const isValidPhone = frontend_core_1.
|
|
108
|
+
const isValidPhone = frontend_core_1.TZPhoneNumber.is(obj);
|
|
109
109
|
if (isValidPhone) {
|
|
110
110
|
phone_number = obj;
|
|
111
111
|
}
|
|
@@ -122,7 +122,7 @@ class MobileContactInfo extends BaseContactInfo {
|
|
|
122
122
|
* @returns {string} Formatted phone number
|
|
123
123
|
*/
|
|
124
124
|
get accNumber() {
|
|
125
|
-
return this.phoneNumber.
|
|
125
|
+
return this.phoneNumber.getWithFormat(frontend_core_1.PhoneNumberFormat.INTERNATIONAL);
|
|
126
126
|
}
|
|
127
127
|
get channel() {
|
|
128
128
|
return this.phoneNumber.networkOperator.mobileMoneyService;
|
|
@@ -224,7 +224,7 @@ class BankContactInfo extends BaseContactInfo {
|
|
|
224
224
|
if (typeof bankContactInfo.accNumber !== "string")
|
|
225
225
|
return false;
|
|
226
226
|
const accNumber = bankContactInfo.accNumber;
|
|
227
|
-
// checks if
|
|
227
|
+
// checks if TZPhoneNumber exists and is valid
|
|
228
228
|
let bank = undefined;
|
|
229
229
|
if (typeof bankContactInfo.bank === "object") {
|
|
230
230
|
const obj = bankContactInfo.bank;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TZPhoneNumber } from "@temboplus/frontend-core";
|
|
2
2
|
/**
|
|
3
3
|
* Represents the available channels through which payouts can be processed.
|
|
4
4
|
* @enum {string}
|
|
@@ -48,11 +48,11 @@ export declare const createPayoutChannelCode: {
|
|
|
48
48
|
verto: () => "TZ-VERTO-B2C";
|
|
49
49
|
/**
|
|
50
50
|
* Creates a mobile money channel code based on the telecom provider
|
|
51
|
-
* @param {
|
|
51
|
+
* @param {TZPhoneNumber} phoneNumber - Phone number object containing telecom information
|
|
52
52
|
* @returns {PayoutChannelCode} Channel code in format "TZ-{TELECOM}-B2C"
|
|
53
53
|
*
|
|
54
|
-
* @see {@link
|
|
54
|
+
* @see {@link TZPhoneNumber} from "@jsr/temboplus__tembo-core" for phone number structure
|
|
55
55
|
*/
|
|
56
|
-
mobile: (phoneNumber:
|
|
56
|
+
mobile: (phoneNumber: TZPhoneNumber) => PayoutChannelCode;
|
|
57
57
|
};
|
|
58
58
|
//# sourceMappingURL=channel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../../src/src/models/payout/channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../../src/src/models/payout/channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE7D;;;;GAIG;AACH,oBAAY,cAAc;IACxB,sDAAsD;IACtD,MAAM,WAAW;IACjB,6DAA6D;IAC7D,IAAI,SAAS;IACb,mDAAmD;IACnD,cAAc,mBAAmB;CAClC;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,iBAAiB,GACzB,aAAa,GACb,cAAc,GACd,MAAM,MAAM,MAAM,CAAC;AAEvB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB;IAClC;;;OAGG;gBACO,aAAa;IAEvB;;;OAGG;iBACQ,cAAc;IAEzB;;;;;;OAMG;0BACmB,aAAa,KAAG,iBAAiB;CAExD,CAAC"}
|
|
@@ -40,10 +40,10 @@ exports.createPayoutChannelCode = {
|
|
|
40
40
|
verto: () => "TZ-VERTO-B2C",
|
|
41
41
|
/**
|
|
42
42
|
* Creates a mobile money channel code based on the telecom provider
|
|
43
|
-
* @param {
|
|
43
|
+
* @param {TZPhoneNumber} phoneNumber - Phone number object containing telecom information
|
|
44
44
|
* @returns {PayoutChannelCode} Channel code in format "TZ-{TELECOM}-B2C"
|
|
45
45
|
*
|
|
46
|
-
* @see {@link
|
|
46
|
+
* @see {@link TZPhoneNumber} from "@jsr/temboplus__tembo-core" for phone number structure
|
|
47
47
|
*/
|
|
48
48
|
mobile: (phoneNumber) => `TZ-${phoneNumber.networkOperator.id.toString().toUpperCase()}-B2C`,
|
|
49
49
|
};
|