@temboplus/afloat 0.1.77-beta.9 → 0.1.77
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/query/query.builder.d.ts +5 -1
- package/dist/modules/contact/contact-info.model.d.ts +3 -0
- package/dist/modules/payout/payout.dtos.d.ts +19 -17
- package/dist/modules/payout/payout.query.d.ts +4 -3
- package/dist/modules/payout/payout.repository.d.ts +35 -23
- package/package.json +2 -2
|
@@ -27,7 +27,11 @@ export declare class QueryBuilder {
|
|
|
27
27
|
whereLessThan(field: string, value: any): this;
|
|
28
28
|
whereLessThanOrEqual(field: string, value: any): this;
|
|
29
29
|
whereBetween(field: string, min: any, max: any): this;
|
|
30
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Filter by date range with support for Date objects, strings, and null
|
|
32
|
+
* Internally converts to createdAt:gte and createdAt:lte filters
|
|
33
|
+
*/
|
|
34
|
+
whereDateBetween(startDate?: string | Date | null, endDate?: string | Date | null): this;
|
|
31
35
|
addSort(criteria: SortCriteria): this;
|
|
32
36
|
orderBy(field: string, direction?: SortDirection): this;
|
|
33
37
|
orderByAsc(field: string): this;
|
|
@@ -208,6 +208,9 @@ declare abstract class BaseContactInfo {
|
|
|
208
208
|
* Converts the ContactInfo instance to a JSON string.
|
|
209
209
|
*/
|
|
210
210
|
toJSONString(): string;
|
|
211
|
+
get isMobile(): boolean;
|
|
212
|
+
get isBank(): boolean;
|
|
213
|
+
get displayName(): string;
|
|
211
214
|
}
|
|
212
215
|
/**
|
|
213
216
|
* Implementation of BaseContactInfo for mobile phone contacts.
|
|
@@ -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.
|
|
@@ -228,14 +230,14 @@ declare const PayoutFiltersSchema: z.ZodObject<{
|
|
|
228
230
|
id?: string | null | undefined;
|
|
229
231
|
profileId?: string | null | undefined;
|
|
230
232
|
search?: string | null | undefined;
|
|
231
|
-
startDate?: string | null | undefined;
|
|
232
|
-
endDate?: string | null | undefined;
|
|
233
233
|
channel?: string | null | undefined;
|
|
234
234
|
currencyCode?: string | null | undefined;
|
|
235
235
|
msisdn?: string | null | undefined;
|
|
236
236
|
payeeName?: string | null | undefined;
|
|
237
237
|
partnerReference?: string | null | undefined;
|
|
238
238
|
approvalStatus?: PayoutApprovalStatus | null | undefined;
|
|
239
|
+
startDate?: string | null | undefined;
|
|
240
|
+
endDate?: string | null | undefined;
|
|
239
241
|
minAmount?: number | null | undefined;
|
|
240
242
|
maxAmount?: number | null | undefined;
|
|
241
243
|
}, {
|
|
@@ -243,8 +245,6 @@ declare const PayoutFiltersSchema: z.ZodObject<{
|
|
|
243
245
|
id?: string | null | undefined;
|
|
244
246
|
profileId?: string | null | undefined;
|
|
245
247
|
search?: string | null | undefined;
|
|
246
|
-
startDate?: string | null | undefined;
|
|
247
|
-
endDate?: string | null | undefined;
|
|
248
248
|
page?: number | undefined;
|
|
249
249
|
limit?: number | undefined;
|
|
250
250
|
channel?: string | null | undefined;
|
|
@@ -255,6 +255,8 @@ declare const PayoutFiltersSchema: z.ZodObject<{
|
|
|
255
255
|
approvalStatus?: PayoutApprovalStatus | null | undefined;
|
|
256
256
|
sortBy?: string | undefined;
|
|
257
257
|
sortOrder?: "asc" | "desc" | undefined;
|
|
258
|
+
startDate?: string | null | undefined;
|
|
259
|
+
endDate?: string | null | undefined;
|
|
258
260
|
minAmount?: number | null | undefined;
|
|
259
261
|
maxAmount?: number | null | undefined;
|
|
260
262
|
}>;
|
|
@@ -286,8 +288,6 @@ declare const PayoutURLQueryParamsSchema: z.ZodObject<{
|
|
|
286
288
|
id?: string | undefined;
|
|
287
289
|
profileId?: string | undefined;
|
|
288
290
|
search?: string | undefined;
|
|
289
|
-
startDate?: string | undefined;
|
|
290
|
-
endDate?: string | undefined;
|
|
291
291
|
page?: number | undefined;
|
|
292
292
|
limit?: number | undefined;
|
|
293
293
|
channel?: string | undefined;
|
|
@@ -295,6 +295,8 @@ declare const PayoutURLQueryParamsSchema: z.ZodObject<{
|
|
|
295
295
|
payeeName?: string | undefined;
|
|
296
296
|
partnerReference?: string | undefined;
|
|
297
297
|
approvalStatus?: PayoutApprovalStatus | undefined;
|
|
298
|
+
startDate?: string | undefined;
|
|
299
|
+
endDate?: string | undefined;
|
|
298
300
|
minAmount?: number | undefined;
|
|
299
301
|
maxAmount?: number | undefined;
|
|
300
302
|
}, {
|
|
@@ -302,8 +304,6 @@ declare const PayoutURLQueryParamsSchema: z.ZodObject<{
|
|
|
302
304
|
id?: string | undefined;
|
|
303
305
|
profileId?: string | undefined;
|
|
304
306
|
search?: string | undefined;
|
|
305
|
-
startDate?: string | undefined;
|
|
306
|
-
endDate?: string | undefined;
|
|
307
307
|
page?: string | undefined;
|
|
308
308
|
limit?: string | undefined;
|
|
309
309
|
channel?: string | undefined;
|
|
@@ -313,6 +313,8 @@ declare const PayoutURLQueryParamsSchema: z.ZodObject<{
|
|
|
313
313
|
approvalStatus?: string | undefined;
|
|
314
314
|
sortBy?: string | undefined;
|
|
315
315
|
sortOrder?: "asc" | "desc" | undefined;
|
|
316
|
+
startDate?: string | undefined;
|
|
317
|
+
endDate?: string | undefined;
|
|
316
318
|
minAmount?: string | undefined;
|
|
317
319
|
maxAmount?: string | undefined;
|
|
318
320
|
}>;
|
|
@@ -512,14 +514,14 @@ export declare const PayoutDTOSchemas: {
|
|
|
512
514
|
id?: string | null | undefined;
|
|
513
515
|
profileId?: string | null | undefined;
|
|
514
516
|
search?: string | null | undefined;
|
|
515
|
-
startDate?: string | null | undefined;
|
|
516
|
-
endDate?: string | null | undefined;
|
|
517
517
|
channel?: string | null | undefined;
|
|
518
518
|
currencyCode?: string | null | undefined;
|
|
519
519
|
msisdn?: string | null | undefined;
|
|
520
520
|
payeeName?: string | null | undefined;
|
|
521
521
|
partnerReference?: string | null | undefined;
|
|
522
522
|
approvalStatus?: PayoutApprovalStatus | null | undefined;
|
|
523
|
+
startDate?: string | null | undefined;
|
|
524
|
+
endDate?: string | null | undefined;
|
|
523
525
|
minAmount?: number | null | undefined;
|
|
524
526
|
maxAmount?: number | null | undefined;
|
|
525
527
|
}, {
|
|
@@ -527,8 +529,6 @@ export declare const PayoutDTOSchemas: {
|
|
|
527
529
|
id?: string | null | undefined;
|
|
528
530
|
profileId?: string | null | undefined;
|
|
529
531
|
search?: string | null | undefined;
|
|
530
|
-
startDate?: string | null | undefined;
|
|
531
|
-
endDate?: string | null | undefined;
|
|
532
532
|
page?: number | undefined;
|
|
533
533
|
limit?: number | undefined;
|
|
534
534
|
channel?: string | null | undefined;
|
|
@@ -539,6 +539,8 @@ export declare const PayoutDTOSchemas: {
|
|
|
539
539
|
approvalStatus?: PayoutApprovalStatus | null | undefined;
|
|
540
540
|
sortBy?: string | undefined;
|
|
541
541
|
sortOrder?: "asc" | "desc" | undefined;
|
|
542
|
+
startDate?: string | null | undefined;
|
|
543
|
+
endDate?: string | null | undefined;
|
|
542
544
|
minAmount?: number | null | undefined;
|
|
543
545
|
maxAmount?: number | null | undefined;
|
|
544
546
|
}>;
|
|
@@ -567,8 +569,6 @@ export declare const PayoutDTOSchemas: {
|
|
|
567
569
|
id?: string | undefined;
|
|
568
570
|
profileId?: string | undefined;
|
|
569
571
|
search?: string | undefined;
|
|
570
|
-
startDate?: string | undefined;
|
|
571
|
-
endDate?: string | undefined;
|
|
572
572
|
page?: number | undefined;
|
|
573
573
|
limit?: number | undefined;
|
|
574
574
|
channel?: string | undefined;
|
|
@@ -576,6 +576,8 @@ export declare const PayoutDTOSchemas: {
|
|
|
576
576
|
payeeName?: string | undefined;
|
|
577
577
|
partnerReference?: string | undefined;
|
|
578
578
|
approvalStatus?: PayoutApprovalStatus | undefined;
|
|
579
|
+
startDate?: string | undefined;
|
|
580
|
+
endDate?: string | undefined;
|
|
579
581
|
minAmount?: number | undefined;
|
|
580
582
|
maxAmount?: number | undefined;
|
|
581
583
|
}, {
|
|
@@ -583,8 +585,6 @@ export declare const PayoutDTOSchemas: {
|
|
|
583
585
|
id?: string | undefined;
|
|
584
586
|
profileId?: string | undefined;
|
|
585
587
|
search?: string | undefined;
|
|
586
|
-
startDate?: string | undefined;
|
|
587
|
-
endDate?: string | undefined;
|
|
588
588
|
page?: string | undefined;
|
|
589
589
|
limit?: string | undefined;
|
|
590
590
|
channel?: string | undefined;
|
|
@@ -594,6 +594,8 @@ export declare const PayoutDTOSchemas: {
|
|
|
594
594
|
approvalStatus?: string | undefined;
|
|
595
595
|
sortBy?: string | undefined;
|
|
596
596
|
sortOrder?: "asc" | "desc" | undefined;
|
|
597
|
+
startDate?: string | undefined;
|
|
598
|
+
endDate?: string | undefined;
|
|
597
599
|
minAmount?: string | undefined;
|
|
598
600
|
maxAmount?: string | undefined;
|
|
599
601
|
}>;
|
|
@@ -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,7 +42,7 @@ 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;
|
|
@@ -57,7 +58,7 @@ export declare class PayoutQuery extends QueryBuilder {
|
|
|
57
58
|
*/
|
|
58
59
|
toFilters(): PayoutFilters;
|
|
59
60
|
/**
|
|
60
|
-
* Convert to
|
|
61
|
+
* Convert to user-friendly URL parameters (for browser URLs)
|
|
61
62
|
*/
|
|
62
63
|
toUrlParams(): Record<string, string>;
|
|
63
64
|
/**
|
|
@@ -79,7 +80,7 @@ export declare class PayoutQuery extends QueryBuilder {
|
|
|
79
80
|
/**
|
|
80
81
|
* Create new instance with date range
|
|
81
82
|
*/
|
|
82
|
-
withDateRange(startDate?: string, endDate?: string): PayoutQuery;
|
|
83
|
+
withDateRange(startDate?: string | Date, endDate?: string | Date): PayoutQuery;
|
|
83
84
|
/**
|
|
84
85
|
* Create new instance with status filter
|
|
85
86
|
*/
|
|
@@ -7,6 +7,29 @@ import { PayoutChannel } from "./payout.dtos.js";
|
|
|
7
7
|
import { PayoutQuery } from "./payout.query.js";
|
|
8
8
|
import { PayoutFilters } from "./payout.dtos.js";
|
|
9
9
|
import { Paged } from "@/lib/query/index.js";
|
|
10
|
+
/**
|
|
11
|
+
* Input type for payout creation mutation
|
|
12
|
+
*/
|
|
13
|
+
export interface CreatePayoutInput {
|
|
14
|
+
channel: PayoutChannel;
|
|
15
|
+
receiver: ContactInfo;
|
|
16
|
+
amount: Amount;
|
|
17
|
+
notes?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Input type for payout approval mutation
|
|
21
|
+
*/
|
|
22
|
+
export interface ApprovePayoutInput {
|
|
23
|
+
id: string;
|
|
24
|
+
notes?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Input type for payout rejection mutation
|
|
28
|
+
*/
|
|
29
|
+
export interface RejectPayoutInput {
|
|
30
|
+
id: string;
|
|
31
|
+
notes?: string;
|
|
32
|
+
}
|
|
10
33
|
/**
|
|
11
34
|
* Flexible query input type - supports the class, filters interface, URL params, etc.
|
|
12
35
|
*/
|
|
@@ -93,11 +116,11 @@ export declare class PayoutRepository extends BaseRepository<PayoutAPI> {
|
|
|
93
116
|
/**
|
|
94
117
|
* Creates a new payout with the provided input data.
|
|
95
118
|
*
|
|
96
|
-
* @param
|
|
97
|
-
* @param
|
|
98
|
-
* @param
|
|
99
|
-
* @param
|
|
100
|
-
* @param
|
|
119
|
+
* @param input - The payout creation data
|
|
120
|
+
* @param input.channel - The payout channel to use
|
|
121
|
+
* @param input.receiver - Contact information for the payout receiver
|
|
122
|
+
* @param input.amount - The amount to pay out
|
|
123
|
+
* @param input.notes - Optional notes for the payout
|
|
101
124
|
* @returns Promise that resolves to the created payout
|
|
102
125
|
* @throws {APIError} If the input is invalid or if the creation operation fails
|
|
103
126
|
*
|
|
@@ -111,18 +134,12 @@ export declare class PayoutRepository extends BaseRepository<PayoutAPI> {
|
|
|
111
134
|
* });
|
|
112
135
|
* ```
|
|
113
136
|
*/
|
|
114
|
-
pay(
|
|
115
|
-
channel: PayoutChannel;
|
|
116
|
-
receiver: ContactInfo;
|
|
117
|
-
amount: Amount;
|
|
118
|
-
notes?: string;
|
|
119
|
-
}): Promise<Payout>;
|
|
137
|
+
pay(input: CreatePayoutInput): Promise<Payout>;
|
|
120
138
|
/**
|
|
121
139
|
* Approves a payout with optional notes.
|
|
122
140
|
*
|
|
123
|
-
* @param id - The ID of the payout to approve
|
|
124
|
-
* @param
|
|
125
|
-
* @param args.notes - Optional notes for the approval
|
|
141
|
+
* @param input.id - The ID of the payout to approve
|
|
142
|
+
* @param input.notes - Optional notes for the approval
|
|
126
143
|
* @returns Promise that resolves to the approved payout
|
|
127
144
|
* @throws {APIError} If payout is not found, already approved, or if the operation fails
|
|
128
145
|
*
|
|
@@ -133,15 +150,12 @@ export declare class PayoutRepository extends BaseRepository<PayoutAPI> {
|
|
|
133
150
|
* });
|
|
134
151
|
* ```
|
|
135
152
|
*/
|
|
136
|
-
approve(
|
|
137
|
-
notes?: string;
|
|
138
|
-
}): Promise<Payout>;
|
|
153
|
+
approve(input: ApprovePayoutInput): Promise<Payout>;
|
|
139
154
|
/**
|
|
140
155
|
* Rejects a payout with optional notes.
|
|
141
156
|
*
|
|
142
|
-
* @param id - The ID of the payout to reject
|
|
143
|
-
* @param
|
|
144
|
-
* @param args.notes - Optional notes for the rejection
|
|
157
|
+
* @param input.id - The ID of the payout to reject
|
|
158
|
+
* @param input.notes - Optional notes for the rejection
|
|
145
159
|
* @returns Promise that resolves to the rejected payout
|
|
146
160
|
* @throws {APIError} If payout is not found, already rejected, or if the operation fails
|
|
147
161
|
*
|
|
@@ -152,9 +166,7 @@ export declare class PayoutRepository extends BaseRepository<PayoutAPI> {
|
|
|
152
166
|
* });
|
|
153
167
|
* ```
|
|
154
168
|
*/
|
|
155
|
-
reject(
|
|
156
|
-
notes?: string;
|
|
157
|
-
}): Promise<Payout>;
|
|
169
|
+
reject(input: RejectPayoutInput): Promise<Payout>;
|
|
158
170
|
/**
|
|
159
171
|
* Retrieves a payout by its ID.
|
|
160
172
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temboplus/afloat",
|
|
3
|
-
"version": "0.1.77
|
|
3
|
+
"version": "0.1.77",
|
|
4
4
|
"description": "A foundational library for Temboplus-Afloat projects.",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -58,6 +58,6 @@
|
|
|
58
58
|
"typescript": "^5.8.3"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@temboplus/frontend-core": "^0.2.20-beta.
|
|
61
|
+
"@temboplus/frontend-core": "^0.2.20-beta.3"
|
|
62
62
|
}
|
|
63
63
|
}
|