@temboplus/afloat 0.1.77-beta.2 → 0.1.77-beta.21
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/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/lib/api/base-repository.d.ts +3 -1
- package/dist/lib/query/query.builder.d.ts +5 -1
- package/dist/modules/auth/auth.contract.d.ts +2 -2
- package/dist/modules/auth/company-membership.model.d.ts +122 -9
- package/dist/modules/auth/index.d.ts +0 -1
- package/dist/modules/auth/user.model.d.ts +238 -15
- package/dist/modules/contact/contact-info.model.d.ts +183 -533
- package/dist/modules/contact/contact.api-contract.d.ts +8 -8
- package/dist/modules/contact/contact.dtos.d.ts +2 -2
- package/dist/modules/contact/contact.model.d.ts +309 -32
- package/dist/modules/login/login.api-contract.d.ts +2 -2
- package/dist/modules/login/login.dtos.d.ts +4 -4
- package/dist/modules/login/login.model.d.ts +54 -24
- package/dist/modules/payout/payout.api-contract.d.ts +37 -37
- package/dist/modules/payout/payout.dtos.d.ts +47 -39
- package/dist/modules/payout/payout.model.d.ts +242 -2
- package/dist/modules/payout/payout.query.d.ts +11 -3
- package/dist/modules/payout/payout.repository.d.ts +48 -25
- package/dist/modules/profile/profile.model.d.ts +65 -30
- package/dist/modules/team-member/role.model.d.ts +49 -1
- package/dist/modules/team-member/team-member.contract.d.ts +44 -44
- package/dist/modules/team-member/team-member.dtos.d.ts +14 -14
- package/dist/modules/team-member/team-member.model.d.ts +106 -6
- package/dist/modules/wallet/index.d.ts +0 -1
- package/dist/modules/wallet/narration.model.d.ts +34 -38
- package/dist/modules/wallet/statement-entry.model.d.ts +172 -73
- package/dist/modules/wallet/wallet.contract.d.ts +6 -6
- package/dist/modules/wallet/wallet.dtos.d.ts +12 -12
- package/dist/modules/wallet/wallet.model.d.ts +56 -19
- package/dist/modules/wallet/wallet.query.d.ts +95 -0
- package/dist/modules/wallet/wallet.repository.d.ts +45 -13
- package/package.json +2 -2
- package/dist/modules/auth/auth.manager.d.ts +0 -249
- package/dist/modules/auth/auth.store.d.ts +0 -139
- package/dist/modules/auth/storage/client-store.d.ts +0 -29
- package/dist/modules/auth/storage/client-token-handler.d.ts +0 -31
- package/dist/modules/auth/storage/types.d.ts +0 -41
- package/dist/modules/wallet/wallet-manager.session.d.ts +0 -143
|
@@ -27,7 +27,9 @@ export declare enum PayoutStatus {
|
|
|
27
27
|
/** Payout has been rejected */
|
|
28
28
|
REJECTED = "REJECTED",
|
|
29
29
|
/** Payout has been reversed */
|
|
30
|
-
REVERSED = "REVERSED"
|
|
30
|
+
REVERSED = "REVERSED",
|
|
31
|
+
/** Payout has been queued for processing */
|
|
32
|
+
QUEUED = "QUEUED"
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
35
|
* Represents the approval status for payouts that require authorization.
|
|
@@ -142,17 +144,17 @@ declare const PayoutDTOSchema: z.ZodObject<{
|
|
|
142
144
|
}>>>;
|
|
143
145
|
}, "strip", z.ZodTypeAny, {
|
|
144
146
|
status: PayoutStatus;
|
|
147
|
+
createdAt: Date;
|
|
145
148
|
id: string;
|
|
146
149
|
profileId: string;
|
|
147
|
-
createdAt: Date;
|
|
148
150
|
updatedAt: Date;
|
|
149
151
|
description: string;
|
|
150
152
|
channel: string;
|
|
151
|
-
countryCode: import("@temboplus/frontend-core").ISO2CountryCode;
|
|
152
|
-
currencyCode: import("@temboplus/frontend-core").CurrencyCode;
|
|
153
153
|
msisdn: string;
|
|
154
154
|
amount: number;
|
|
155
155
|
payeeName: string;
|
|
156
|
+
countryCode: import("@temboplus/frontend-core").ISO2CountryCode;
|
|
157
|
+
currencyCode: import("@temboplus/frontend-core").CurrencyCode;
|
|
156
158
|
statusMessage: string;
|
|
157
159
|
notes?: string | null | undefined;
|
|
158
160
|
partnerReference?: string | null | undefined;
|
|
@@ -170,9 +172,9 @@ declare const PayoutDTOSchema: z.ZodObject<{
|
|
|
170
172
|
} | null | undefined;
|
|
171
173
|
}, {
|
|
172
174
|
status: PayoutStatus;
|
|
175
|
+
createdAt: Date;
|
|
173
176
|
id: string;
|
|
174
177
|
profileId: string;
|
|
175
|
-
createdAt: Date;
|
|
176
178
|
updatedAt: Date;
|
|
177
179
|
description: string;
|
|
178
180
|
channel: string;
|
|
@@ -180,9 +182,9 @@ declare const PayoutDTOSchema: z.ZodObject<{
|
|
|
180
182
|
amount: number;
|
|
181
183
|
payeeName: string;
|
|
182
184
|
statusMessage: string;
|
|
185
|
+
notes?: string | null | undefined;
|
|
183
186
|
countryCode?: string | undefined;
|
|
184
187
|
currencyCode?: string | undefined;
|
|
185
|
-
notes?: string | null | undefined;
|
|
186
188
|
partnerReference?: string | null | undefined;
|
|
187
189
|
actionedAt?: Date | null | undefined;
|
|
188
190
|
approvalStatus?: PayoutApprovalStatus | null | undefined;
|
|
@@ -213,6 +215,7 @@ declare const PayoutFiltersSchema: z.ZodObject<{
|
|
|
213
215
|
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
214
216
|
partnerReference: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
215
217
|
channel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
218
|
+
currencyCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
216
219
|
status: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof PayoutStatus>>>;
|
|
217
220
|
approvalStatus: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof PayoutApprovalStatus>>>;
|
|
218
221
|
minAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
@@ -227,31 +230,33 @@ declare const PayoutFiltersSchema: z.ZodObject<{
|
|
|
227
230
|
id?: string | null | undefined;
|
|
228
231
|
profileId?: string | null | undefined;
|
|
229
232
|
search?: string | null | undefined;
|
|
230
|
-
startDate?: string | null | undefined;
|
|
231
|
-
endDate?: string | null | undefined;
|
|
232
233
|
channel?: string | null | undefined;
|
|
233
234
|
msisdn?: string | null | undefined;
|
|
234
235
|
payeeName?: string | null | undefined;
|
|
236
|
+
currencyCode?: string | null | undefined;
|
|
235
237
|
partnerReference?: string | null | undefined;
|
|
236
238
|
approvalStatus?: PayoutApprovalStatus | null | undefined;
|
|
239
|
+
startDate?: string | null | undefined;
|
|
240
|
+
endDate?: string | null | undefined;
|
|
237
241
|
minAmount?: number | null | undefined;
|
|
238
242
|
maxAmount?: number | null | undefined;
|
|
239
243
|
}, {
|
|
240
244
|
status?: PayoutStatus | null | undefined;
|
|
245
|
+
page?: number | undefined;
|
|
246
|
+
limit?: number | undefined;
|
|
241
247
|
id?: string | null | undefined;
|
|
242
248
|
profileId?: string | null | undefined;
|
|
243
249
|
search?: string | null | undefined;
|
|
244
|
-
startDate?: string | null | undefined;
|
|
245
|
-
endDate?: string | null | undefined;
|
|
246
|
-
page?: number | undefined;
|
|
247
|
-
limit?: number | undefined;
|
|
248
250
|
channel?: string | null | undefined;
|
|
249
251
|
msisdn?: string | null | undefined;
|
|
250
252
|
payeeName?: string | null | undefined;
|
|
253
|
+
currencyCode?: string | null | undefined;
|
|
251
254
|
partnerReference?: string | null | undefined;
|
|
252
255
|
approvalStatus?: PayoutApprovalStatus | null | undefined;
|
|
253
256
|
sortBy?: string | undefined;
|
|
254
257
|
sortOrder?: "asc" | "desc" | undefined;
|
|
258
|
+
startDate?: string | null | undefined;
|
|
259
|
+
endDate?: string | null | undefined;
|
|
255
260
|
minAmount?: number | null | undefined;
|
|
256
261
|
maxAmount?: number | null | undefined;
|
|
257
262
|
}>;
|
|
@@ -280,29 +285,27 @@ declare const PayoutURLQueryParamsSchema: z.ZodObject<{
|
|
|
280
285
|
sortBy: string;
|
|
281
286
|
sortOrder: "asc" | "desc";
|
|
282
287
|
status?: PayoutStatus | undefined;
|
|
288
|
+
page?: number | undefined;
|
|
289
|
+
limit?: number | undefined;
|
|
283
290
|
id?: string | undefined;
|
|
284
291
|
profileId?: string | undefined;
|
|
285
292
|
search?: string | undefined;
|
|
286
|
-
startDate?: string | undefined;
|
|
287
|
-
endDate?: string | undefined;
|
|
288
|
-
page?: number | undefined;
|
|
289
|
-
limit?: number | undefined;
|
|
290
293
|
channel?: string | undefined;
|
|
291
294
|
msisdn?: string | undefined;
|
|
292
295
|
payeeName?: string | undefined;
|
|
293
296
|
partnerReference?: string | undefined;
|
|
294
297
|
approvalStatus?: PayoutApprovalStatus | undefined;
|
|
298
|
+
startDate?: string | undefined;
|
|
299
|
+
endDate?: string | undefined;
|
|
295
300
|
minAmount?: number | undefined;
|
|
296
301
|
maxAmount?: number | undefined;
|
|
297
302
|
}, {
|
|
298
303
|
status?: string | undefined;
|
|
304
|
+
page?: string | undefined;
|
|
305
|
+
limit?: string | undefined;
|
|
299
306
|
id?: string | undefined;
|
|
300
307
|
profileId?: string | undefined;
|
|
301
308
|
search?: string | undefined;
|
|
302
|
-
startDate?: string | undefined;
|
|
303
|
-
endDate?: string | undefined;
|
|
304
|
-
page?: string | undefined;
|
|
305
|
-
limit?: string | undefined;
|
|
306
309
|
channel?: string | undefined;
|
|
307
310
|
msisdn?: string | undefined;
|
|
308
311
|
payeeName?: string | undefined;
|
|
@@ -310,6 +313,8 @@ declare const PayoutURLQueryParamsSchema: z.ZodObject<{
|
|
|
310
313
|
approvalStatus?: string | undefined;
|
|
311
314
|
sortBy?: string | undefined;
|
|
312
315
|
sortOrder?: "asc" | "desc" | undefined;
|
|
316
|
+
startDate?: string | undefined;
|
|
317
|
+
endDate?: string | undefined;
|
|
313
318
|
minAmount?: string | undefined;
|
|
314
319
|
maxAmount?: string | undefined;
|
|
315
320
|
}>;
|
|
@@ -388,17 +393,17 @@ export declare const PayoutDTOSchemas: {
|
|
|
388
393
|
}>>>;
|
|
389
394
|
}, "strip", z.ZodTypeAny, {
|
|
390
395
|
status: PayoutStatus;
|
|
396
|
+
createdAt: Date;
|
|
391
397
|
id: string;
|
|
392
398
|
profileId: string;
|
|
393
|
-
createdAt: Date;
|
|
394
399
|
updatedAt: Date;
|
|
395
400
|
description: string;
|
|
396
401
|
channel: string;
|
|
397
|
-
countryCode: import("@temboplus/frontend-core").ISO2CountryCode;
|
|
398
|
-
currencyCode: import("@temboplus/frontend-core").CurrencyCode;
|
|
399
402
|
msisdn: string;
|
|
400
403
|
amount: number;
|
|
401
404
|
payeeName: string;
|
|
405
|
+
countryCode: import("@temboplus/frontend-core").ISO2CountryCode;
|
|
406
|
+
currencyCode: import("@temboplus/frontend-core").CurrencyCode;
|
|
402
407
|
statusMessage: string;
|
|
403
408
|
notes?: string | null | undefined;
|
|
404
409
|
partnerReference?: string | null | undefined;
|
|
@@ -416,9 +421,9 @@ export declare const PayoutDTOSchemas: {
|
|
|
416
421
|
} | null | undefined;
|
|
417
422
|
}, {
|
|
418
423
|
status: PayoutStatus;
|
|
424
|
+
createdAt: Date;
|
|
419
425
|
id: string;
|
|
420
426
|
profileId: string;
|
|
421
|
-
createdAt: Date;
|
|
422
427
|
updatedAt: Date;
|
|
423
428
|
description: string;
|
|
424
429
|
channel: string;
|
|
@@ -426,9 +431,9 @@ export declare const PayoutDTOSchemas: {
|
|
|
426
431
|
amount: number;
|
|
427
432
|
payeeName: string;
|
|
428
433
|
statusMessage: string;
|
|
434
|
+
notes?: string | null | undefined;
|
|
429
435
|
countryCode?: string | undefined;
|
|
430
436
|
currencyCode?: string | undefined;
|
|
431
|
-
notes?: string | null | undefined;
|
|
432
437
|
partnerReference?: string | null | undefined;
|
|
433
438
|
actionedAt?: Date | null | undefined;
|
|
434
439
|
approvalStatus?: PayoutApprovalStatus | null | undefined;
|
|
@@ -494,6 +499,7 @@ export declare const PayoutDTOSchemas: {
|
|
|
494
499
|
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
495
500
|
partnerReference: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
496
501
|
channel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
502
|
+
currencyCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
497
503
|
status: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof PayoutStatus>>>;
|
|
498
504
|
approvalStatus: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof PayoutApprovalStatus>>>;
|
|
499
505
|
minAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
@@ -508,31 +514,33 @@ export declare const PayoutDTOSchemas: {
|
|
|
508
514
|
id?: string | null | undefined;
|
|
509
515
|
profileId?: string | null | undefined;
|
|
510
516
|
search?: string | null | undefined;
|
|
511
|
-
startDate?: string | null | undefined;
|
|
512
|
-
endDate?: string | null | undefined;
|
|
513
517
|
channel?: string | null | undefined;
|
|
514
518
|
msisdn?: string | null | undefined;
|
|
515
519
|
payeeName?: string | null | undefined;
|
|
520
|
+
currencyCode?: string | null | undefined;
|
|
516
521
|
partnerReference?: string | null | undefined;
|
|
517
522
|
approvalStatus?: PayoutApprovalStatus | null | undefined;
|
|
523
|
+
startDate?: string | null | undefined;
|
|
524
|
+
endDate?: string | null | undefined;
|
|
518
525
|
minAmount?: number | null | undefined;
|
|
519
526
|
maxAmount?: number | null | undefined;
|
|
520
527
|
}, {
|
|
521
528
|
status?: PayoutStatus | null | undefined;
|
|
529
|
+
page?: number | undefined;
|
|
530
|
+
limit?: number | undefined;
|
|
522
531
|
id?: string | null | undefined;
|
|
523
532
|
profileId?: string | null | undefined;
|
|
524
533
|
search?: string | null | undefined;
|
|
525
|
-
startDate?: string | null | undefined;
|
|
526
|
-
endDate?: string | null | undefined;
|
|
527
|
-
page?: number | undefined;
|
|
528
|
-
limit?: number | undefined;
|
|
529
534
|
channel?: string | null | undefined;
|
|
530
535
|
msisdn?: string | null | undefined;
|
|
531
536
|
payeeName?: string | null | undefined;
|
|
537
|
+
currencyCode?: string | null | undefined;
|
|
532
538
|
partnerReference?: string | null | undefined;
|
|
533
539
|
approvalStatus?: PayoutApprovalStatus | null | undefined;
|
|
534
540
|
sortBy?: string | undefined;
|
|
535
541
|
sortOrder?: "asc" | "desc" | undefined;
|
|
542
|
+
startDate?: string | null | undefined;
|
|
543
|
+
endDate?: string | null | undefined;
|
|
536
544
|
minAmount?: number | null | undefined;
|
|
537
545
|
maxAmount?: number | null | undefined;
|
|
538
546
|
}>;
|
|
@@ -558,29 +566,27 @@ export declare const PayoutDTOSchemas: {
|
|
|
558
566
|
sortBy: string;
|
|
559
567
|
sortOrder: "asc" | "desc";
|
|
560
568
|
status?: PayoutStatus | undefined;
|
|
569
|
+
page?: number | undefined;
|
|
570
|
+
limit?: number | undefined;
|
|
561
571
|
id?: string | undefined;
|
|
562
572
|
profileId?: string | undefined;
|
|
563
573
|
search?: string | undefined;
|
|
564
|
-
startDate?: string | undefined;
|
|
565
|
-
endDate?: string | undefined;
|
|
566
|
-
page?: number | undefined;
|
|
567
|
-
limit?: number | undefined;
|
|
568
574
|
channel?: string | undefined;
|
|
569
575
|
msisdn?: string | undefined;
|
|
570
576
|
payeeName?: string | undefined;
|
|
571
577
|
partnerReference?: string | undefined;
|
|
572
578
|
approvalStatus?: PayoutApprovalStatus | undefined;
|
|
579
|
+
startDate?: string | undefined;
|
|
580
|
+
endDate?: string | undefined;
|
|
573
581
|
minAmount?: number | undefined;
|
|
574
582
|
maxAmount?: number | undefined;
|
|
575
583
|
}, {
|
|
576
584
|
status?: string | undefined;
|
|
585
|
+
page?: string | undefined;
|
|
586
|
+
limit?: string | undefined;
|
|
577
587
|
id?: string | undefined;
|
|
578
588
|
profileId?: string | undefined;
|
|
579
589
|
search?: string | undefined;
|
|
580
|
-
startDate?: string | undefined;
|
|
581
|
-
endDate?: string | undefined;
|
|
582
|
-
page?: string | undefined;
|
|
583
|
-
limit?: string | undefined;
|
|
584
590
|
channel?: string | undefined;
|
|
585
591
|
msisdn?: string | undefined;
|
|
586
592
|
payeeName?: string | undefined;
|
|
@@ -588,6 +594,8 @@ export declare const PayoutDTOSchemas: {
|
|
|
588
594
|
approvalStatus?: string | undefined;
|
|
589
595
|
sortBy?: string | undefined;
|
|
590
596
|
sortOrder?: "asc" | "desc" | undefined;
|
|
597
|
+
startDate?: string | undefined;
|
|
598
|
+
endDate?: string | undefined;
|
|
591
599
|
minAmount?: string | undefined;
|
|
592
600
|
maxAmount?: string | undefined;
|
|
593
601
|
}>;
|
|
@@ -1,6 +1,119 @@
|
|
|
1
1
|
import { PayoutDTO, PayoutStatus, PayoutApprovalStatus, PayoutAuthorizer } from "@/modules/payout/payout.dtos.js";
|
|
2
2
|
import { Amount } from "@temboplus/frontend-core";
|
|
3
3
|
import { ContactInfo } from "../contact/contact-info.model.js";
|
|
4
|
+
import z from "zod";
|
|
5
|
+
/**
|
|
6
|
+
* Zod schema for Payout JSON serialization
|
|
7
|
+
* This mirrors the PayoutDTO structure but is specifically for JSON serialization
|
|
8
|
+
*/
|
|
9
|
+
export declare const PayoutJSONSchema: z.ZodObject<{
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
profileId: z.ZodString;
|
|
12
|
+
payeeName: z.ZodString;
|
|
13
|
+
channel: z.ZodString;
|
|
14
|
+
msisdn: z.ZodString;
|
|
15
|
+
amount: z.ZodNumber;
|
|
16
|
+
currencyCode: z.ZodString;
|
|
17
|
+
countryCode: z.ZodString;
|
|
18
|
+
description: z.ZodString;
|
|
19
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
|
+
status: z.ZodNativeEnum<typeof PayoutStatus>;
|
|
21
|
+
statusMessage: z.ZodString;
|
|
22
|
+
partnerReference: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
23
|
+
createdAt: z.ZodString;
|
|
24
|
+
updatedAt: z.ZodString;
|
|
25
|
+
actionedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
26
|
+
approvalStatus: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof PayoutApprovalStatus>>>;
|
|
27
|
+
createdBy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
28
|
+
id: z.ZodString;
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
identity: z.ZodString;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
name: string;
|
|
33
|
+
id: string;
|
|
34
|
+
identity: string;
|
|
35
|
+
}, {
|
|
36
|
+
name: string;
|
|
37
|
+
id: string;
|
|
38
|
+
identity: string;
|
|
39
|
+
}>>>;
|
|
40
|
+
actionedBy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
41
|
+
id: z.ZodString;
|
|
42
|
+
name: z.ZodString;
|
|
43
|
+
identity: z.ZodString;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
name: string;
|
|
46
|
+
id: string;
|
|
47
|
+
identity: string;
|
|
48
|
+
}, {
|
|
49
|
+
name: string;
|
|
50
|
+
id: string;
|
|
51
|
+
identity: string;
|
|
52
|
+
}>>>;
|
|
53
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
status: PayoutStatus;
|
|
56
|
+
createdAt: string;
|
|
57
|
+
id: string;
|
|
58
|
+
version: string;
|
|
59
|
+
profileId: string;
|
|
60
|
+
updatedAt: string;
|
|
61
|
+
description: string;
|
|
62
|
+
channel: string;
|
|
63
|
+
msisdn: string;
|
|
64
|
+
amount: number;
|
|
65
|
+
payeeName: string;
|
|
66
|
+
countryCode: string;
|
|
67
|
+
currencyCode: string;
|
|
68
|
+
statusMessage: string;
|
|
69
|
+
notes?: string | null | undefined;
|
|
70
|
+
partnerReference?: string | null | undefined;
|
|
71
|
+
actionedAt?: string | null | undefined;
|
|
72
|
+
approvalStatus?: PayoutApprovalStatus | null | undefined;
|
|
73
|
+
createdBy?: {
|
|
74
|
+
name: string;
|
|
75
|
+
id: string;
|
|
76
|
+
identity: string;
|
|
77
|
+
} | null | undefined;
|
|
78
|
+
actionedBy?: {
|
|
79
|
+
name: string;
|
|
80
|
+
id: string;
|
|
81
|
+
identity: string;
|
|
82
|
+
} | null | undefined;
|
|
83
|
+
}, {
|
|
84
|
+
status: PayoutStatus;
|
|
85
|
+
createdAt: string;
|
|
86
|
+
id: string;
|
|
87
|
+
profileId: string;
|
|
88
|
+
updatedAt: string;
|
|
89
|
+
description: string;
|
|
90
|
+
channel: string;
|
|
91
|
+
msisdn: string;
|
|
92
|
+
amount: number;
|
|
93
|
+
payeeName: string;
|
|
94
|
+
countryCode: string;
|
|
95
|
+
currencyCode: string;
|
|
96
|
+
statusMessage: string;
|
|
97
|
+
version?: string | undefined;
|
|
98
|
+
notes?: string | null | undefined;
|
|
99
|
+
partnerReference?: string | null | undefined;
|
|
100
|
+
actionedAt?: string | null | undefined;
|
|
101
|
+
approvalStatus?: PayoutApprovalStatus | null | undefined;
|
|
102
|
+
createdBy?: {
|
|
103
|
+
name: string;
|
|
104
|
+
id: string;
|
|
105
|
+
identity: string;
|
|
106
|
+
} | null | undefined;
|
|
107
|
+
actionedBy?: {
|
|
108
|
+
name: string;
|
|
109
|
+
id: string;
|
|
110
|
+
identity: string;
|
|
111
|
+
} | null | undefined;
|
|
112
|
+
}>;
|
|
113
|
+
/**
|
|
114
|
+
* Infer the PayoutJSON type from the schema
|
|
115
|
+
*/
|
|
116
|
+
export type PayoutJSON = z.infer<typeof PayoutJSONSchema>;
|
|
4
117
|
/**
|
|
5
118
|
* Payout class that wraps the Zod schema and provides additional functionality
|
|
6
119
|
*/
|
|
@@ -133,7 +246,134 @@ export declare class Payout {
|
|
|
133
246
|
*/
|
|
134
247
|
static is(obj: unknown): obj is Payout;
|
|
135
248
|
/**
|
|
136
|
-
|
|
249
|
+
* Serializes the Payout instance to a JSON-compatible object
|
|
250
|
+
*
|
|
251
|
+
* Converts all Date objects to ISO strings for proper JSON serialization.
|
|
252
|
+
* The resulting object can be safely stringified and stored or transmitted.
|
|
253
|
+
*
|
|
254
|
+
* @returns {PayoutJSON} A plain object containing all payout data
|
|
255
|
+
*
|
|
256
|
+
* @example
|
|
257
|
+
* ```typescript
|
|
258
|
+
* const payout = Payout.create(payoutData);
|
|
259
|
+
* const json = payout.toJSON();
|
|
260
|
+
* // {
|
|
261
|
+
* // id: "payout-123",
|
|
262
|
+
* // amount: 50000,
|
|
263
|
+
* // currencyCode: "TZS",
|
|
264
|
+
* // createdAt: "2024-01-15T10:30:00.000Z",
|
|
265
|
+
* // ...
|
|
266
|
+
* // }
|
|
267
|
+
* ```
|
|
268
|
+
*/
|
|
269
|
+
toJSON(): PayoutJSON;
|
|
270
|
+
/**
|
|
271
|
+
* Serializes the Payout instance to a JSON string
|
|
272
|
+
*
|
|
273
|
+
* @returns {string} JSON string representation of the payout
|
|
274
|
+
*
|
|
275
|
+
* @example
|
|
276
|
+
* ```typescript
|
|
277
|
+
* const payout = Payout.create(payoutData);
|
|
278
|
+
* const jsonString = payout.toJSONString();
|
|
279
|
+
*
|
|
280
|
+
* // Store in localStorage
|
|
281
|
+
* localStorage.setItem('pendingPayout', jsonString);
|
|
282
|
+
*
|
|
283
|
+
* // Or send to server
|
|
284
|
+
* await fetch('/api/cache-payout', {
|
|
285
|
+
* method: 'POST',
|
|
286
|
+
* body: jsonString
|
|
287
|
+
* });
|
|
288
|
+
* ```
|
|
289
|
+
*/
|
|
290
|
+
toJSONString(): string;
|
|
291
|
+
/**
|
|
292
|
+
* Creates a Payout instance from a JSON-compatible object or string
|
|
293
|
+
*
|
|
294
|
+
* This method reconstructs a Payout instance from data that was previously
|
|
295
|
+
* serialized using toJSON(). It validates the input data using Zod schema
|
|
296
|
+
* and converts ISO date strings back to Date objects.
|
|
297
|
+
*
|
|
298
|
+
* @param {PayoutJSON | string} json - Either a PayoutJSON object or a JSON string
|
|
299
|
+
* @returns {Payout | undefined} A Payout instance if valid, undefined otherwise
|
|
300
|
+
*
|
|
301
|
+
* @example
|
|
302
|
+
* ```typescript
|
|
303
|
+
* // From localStorage
|
|
304
|
+
* const stored = localStorage.getItem('pendingPayout');
|
|
305
|
+
* const payout = Payout.fromJSON(stored!);
|
|
306
|
+
*
|
|
307
|
+
* if (payout) {
|
|
308
|
+
* console.log(payout.amount.label); // "TSh 50,000.00"
|
|
309
|
+
* console.log(payout.status); // "PENDING"
|
|
310
|
+
* }
|
|
311
|
+
*
|
|
312
|
+
* // From object
|
|
313
|
+
* const payoutJson = {
|
|
314
|
+
* id: "payout-123",
|
|
315
|
+
* amount: 50000,
|
|
316
|
+
* currencyCode: "TZS",
|
|
317
|
+
* createdAt: "2024-01-15T10:30:00.000Z",
|
|
318
|
+
* ...
|
|
319
|
+
* };
|
|
320
|
+
* const payout = Payout.fromJSON(payoutJson);
|
|
321
|
+
* ```
|
|
322
|
+
*/
|
|
323
|
+
static fromJSON(json: PayoutJSON | string): Payout | undefined;
|
|
324
|
+
/**
|
|
325
|
+
* Type guard using Zod schema validation
|
|
326
|
+
*
|
|
327
|
+
* Checks if an unknown value conforms to the PayoutJSON structure
|
|
328
|
+
* without attempting to create a Payout instance.
|
|
329
|
+
*
|
|
330
|
+
* @param {unknown} obj - The object to validate
|
|
331
|
+
* @returns {boolean} True if the object is a valid PayoutJSON
|
|
332
|
+
*
|
|
333
|
+
* @example
|
|
334
|
+
* ```typescript
|
|
335
|
+
* const data = JSON.parse(localStorage.getItem('payout'));
|
|
336
|
+
*
|
|
337
|
+
* if (Payout.isPayoutJSON(data)) {
|
|
338
|
+
* const payout = Payout.fromJSON(data);
|
|
339
|
+
* // TypeScript knows data is PayoutJSON here
|
|
340
|
+
* }
|
|
341
|
+
* ```
|
|
342
|
+
*/
|
|
343
|
+
static isPayoutJSON(obj: unknown): obj is PayoutJSON;
|
|
344
|
+
/**
|
|
345
|
+
* Creates multiple Payout instances from a JSON array
|
|
346
|
+
*
|
|
347
|
+
* @param {PayoutJSON[] | string} jsonArray - Array of PayoutJSON objects or JSON string
|
|
348
|
+
* @returns {Payout[]} Array of Payout instances (invalid items are filtered out)
|
|
349
|
+
*
|
|
350
|
+
* @example
|
|
351
|
+
* ```typescript
|
|
352
|
+
* // From API response
|
|
353
|
+
* const response = await fetch('/api/payouts');
|
|
354
|
+
* const jsonArray = await response.json();
|
|
355
|
+
* const payouts = Payout.fromJSONArray(jsonArray);
|
|
356
|
+
*
|
|
357
|
+
* // From stored array
|
|
358
|
+
* const stored = localStorage.getItem('recentPayouts');
|
|
359
|
+
* const payouts = Payout.fromJSONArray(stored!);
|
|
360
|
+
* ```
|
|
361
|
+
*/
|
|
362
|
+
static fromJSONArray(jsonArray: PayoutJSON[] | string): Payout[];
|
|
363
|
+
/**
|
|
364
|
+
* Serializes an array of Payout instances to JSON
|
|
365
|
+
*
|
|
366
|
+
* @param {Payout[]} payouts - Array of Payout instances to serialize
|
|
367
|
+
* @returns {PayoutJSON[]} Array of PayoutJSON objects
|
|
368
|
+
*
|
|
369
|
+
* @example
|
|
370
|
+
* ```typescript
|
|
371
|
+
* const payouts = [payout1, payout2, payout3];
|
|
372
|
+
* const jsonArray = Payout.toJSONArray(payouts);
|
|
373
|
+
*
|
|
374
|
+
* // Store or transmit
|
|
375
|
+
* localStorage.setItem('recentPayouts', JSON.stringify(jsonArray));
|
|
376
|
+
* ```
|
|
137
377
|
*/
|
|
138
|
-
|
|
378
|
+
static toJSONArray(payouts: Payout[]): PayoutJSON[];
|
|
139
379
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { QueryBuilder } from "@/lib/query/index.js";
|
|
2
2
|
import { PayoutStatus, PayoutApprovalStatus, PayoutFilters } from "./payout.dtos.js";
|
|
3
|
+
import { Amount } from "@temboplus/frontend-core";
|
|
3
4
|
/**
|
|
4
5
|
* Payout-specific query builder that extends the base QueryBuilder
|
|
5
6
|
* and handles all possible input conversions (DTOs, URL params, etc.)
|
|
@@ -41,12 +42,13 @@ export declare class PayoutQuery extends QueryBuilder {
|
|
|
41
42
|
whereRejected(): this;
|
|
42
43
|
wherePaid(): this;
|
|
43
44
|
whereFailed(): this;
|
|
44
|
-
whereAmountBetween(min:
|
|
45
|
+
whereAmountBetween(min: Amount, max: Amount): this;
|
|
45
46
|
wherePayee(payeeName: string): this;
|
|
46
47
|
whereMsisdn(msisdn: string): this;
|
|
47
48
|
whereProfileId(profileId: string): this;
|
|
48
49
|
wherePartnerReference(partnerReference: string): this;
|
|
49
50
|
whereSearch(searchTerm: string): this;
|
|
51
|
+
whereCurrencyCode(currencyCode: string): this;
|
|
50
52
|
/**
|
|
51
53
|
* Apply all filters from PayoutFilters object
|
|
52
54
|
*/
|
|
@@ -56,7 +58,7 @@ export declare class PayoutQuery extends QueryBuilder {
|
|
|
56
58
|
*/
|
|
57
59
|
toFilters(): PayoutFilters;
|
|
58
60
|
/**
|
|
59
|
-
* Convert to
|
|
61
|
+
* Convert to user-friendly URL parameters (for browser URLs)
|
|
60
62
|
*/
|
|
61
63
|
toUrlParams(): Record<string, string>;
|
|
62
64
|
/**
|
|
@@ -78,7 +80,7 @@ export declare class PayoutQuery extends QueryBuilder {
|
|
|
78
80
|
/**
|
|
79
81
|
* Create new instance with date range
|
|
80
82
|
*/
|
|
81
|
-
withDateRange(startDate?: string, endDate?: string): PayoutQuery;
|
|
83
|
+
withDateRange(startDate?: string | Date, endDate?: string | Date): PayoutQuery;
|
|
82
84
|
/**
|
|
83
85
|
* Create new instance with status filter
|
|
84
86
|
*/
|
|
@@ -91,6 +93,12 @@ export declare class PayoutQuery extends QueryBuilder {
|
|
|
91
93
|
* Create new instance with channel filter
|
|
92
94
|
*/
|
|
93
95
|
withChannel(channel?: string): PayoutQuery;
|
|
96
|
+
/**
|
|
97
|
+
* Includes default relations for eager loading.
|
|
98
|
+
* This ensures that related data (createdBy, actionedBy) is fetched automatically.
|
|
99
|
+
* @returns The current query builder instance.
|
|
100
|
+
*/
|
|
101
|
+
includeDefaultRelations(): this;
|
|
94
102
|
/**
|
|
95
103
|
* Reset to first page
|
|
96
104
|
*/
|