@temboplus/afloat 0.1.74-0 → 0.1.74
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/features/contact/contact.api-contract.d.ts +5 -0
- package/dist/features/payout/payout.api-contract.d.ts +26 -5
- package/dist/features/payout/payout.dtos.d.ts +1 -235
- package/dist/features/payout/payout.repository.d.ts +49 -41
- package/dist/features/wallet/wallet.contract.d.ts +2 -2
- 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/common-responses.d.ts +12 -0
- package/dist/lib/api/index.d.ts +1 -1
- package/dist/models/statement-entry.model.d.ts +4 -4
- package/package.json +1 -1
- package/dist/features/payout/payout.query.d.ts +0 -126
- package/dist/lib/api/common-schemas.d.ts +0 -49
- package/dist/lib/query/index.d.ts +0 -2
- package/dist/lib/query/query.builder.d.ts +0 -71
- package/dist/lib/query/query.types.d.ts +0 -36
|
@@ -29,6 +29,7 @@ export declare const contract: {
|
|
|
29
29
|
}>;
|
|
30
30
|
path: "/";
|
|
31
31
|
responses: {
|
|
32
|
+
[x: number]: import("@ts-rest/core").AppRouteResponse;
|
|
32
33
|
201: z.ZodObject<{
|
|
33
34
|
id: z.ZodString;
|
|
34
35
|
profileId: z.ZodString;
|
|
@@ -80,6 +81,7 @@ export declare const contract: {
|
|
|
80
81
|
}>;
|
|
81
82
|
path: "/:id";
|
|
82
83
|
responses: {
|
|
84
|
+
[x: number]: import("@ts-rest/core").AppRouteResponse;
|
|
83
85
|
200: z.ZodObject<{
|
|
84
86
|
id: z.ZodString;
|
|
85
87
|
profileId: z.ZodString;
|
|
@@ -122,6 +124,7 @@ export declare const contract: {
|
|
|
122
124
|
method: "GET";
|
|
123
125
|
path: "/";
|
|
124
126
|
responses: {
|
|
127
|
+
[x: number]: import("@ts-rest/core").AppRouteResponse;
|
|
125
128
|
200: z.ZodArray<z.ZodObject<{
|
|
126
129
|
id: z.ZodString;
|
|
127
130
|
profileId: z.ZodString;
|
|
@@ -157,6 +160,7 @@ export declare const contract: {
|
|
|
157
160
|
method: "GET";
|
|
158
161
|
path: "/:id";
|
|
159
162
|
responses: {
|
|
163
|
+
[x: number]: import("@ts-rest/core").AppRouteResponse;
|
|
160
164
|
200: z.ZodObject<{
|
|
161
165
|
id: z.ZodString;
|
|
162
166
|
profileId: z.ZodString;
|
|
@@ -193,6 +197,7 @@ export declare const contract: {
|
|
|
193
197
|
body: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
194
198
|
path: "/:id";
|
|
195
199
|
responses: {
|
|
200
|
+
[x: number]: import("@ts-rest/core").AppRouteResponse;
|
|
196
201
|
200: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
197
202
|
};
|
|
198
203
|
};
|
|
@@ -14,7 +14,28 @@ export declare const DEFAULT_ORDER_BY_DESC = "createdAt";
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const contract: {
|
|
16
16
|
getPayouts: {
|
|
17
|
-
query: z.ZodObject<{
|
|
17
|
+
query: z.ZodObject<{
|
|
18
|
+
rangeStart: z.ZodNumber;
|
|
19
|
+
rangeEnd: z.ZodNumber;
|
|
20
|
+
eager: z.ZodString;
|
|
21
|
+
approvalStatus: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof import("./payout.dtos.js").PayoutApprovalStatus>>>;
|
|
22
|
+
orderByDesc: z.ZodString;
|
|
23
|
+
msisdn: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
eager: string;
|
|
26
|
+
orderByDesc: string;
|
|
27
|
+
rangeStart: number;
|
|
28
|
+
rangeEnd: number;
|
|
29
|
+
msisdn?: string | undefined;
|
|
30
|
+
approvalStatus?: import("./payout.dtos.js").PayoutApprovalStatus | null | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
eager: string;
|
|
33
|
+
orderByDesc: string;
|
|
34
|
+
rangeStart: number;
|
|
35
|
+
rangeEnd: number;
|
|
36
|
+
msisdn?: string | undefined;
|
|
37
|
+
approvalStatus?: import("./payout.dtos.js").PayoutApprovalStatus | null | undefined;
|
|
38
|
+
}>;
|
|
18
39
|
method: "GET";
|
|
19
40
|
path: "";
|
|
20
41
|
responses: {
|
|
@@ -123,7 +144,6 @@ export declare const contract: {
|
|
|
123
144
|
}>, "many">;
|
|
124
145
|
total: z.ZodNumber;
|
|
125
146
|
}, "strip", z.ZodTypeAny, {
|
|
126
|
-
total: number;
|
|
127
147
|
results: {
|
|
128
148
|
status: import("./payout.dtos.js").PayoutStatus;
|
|
129
149
|
id: string;
|
|
@@ -153,8 +173,8 @@ export declare const contract: {
|
|
|
153
173
|
identity: string;
|
|
154
174
|
} | null | undefined;
|
|
155
175
|
}[];
|
|
156
|
-
}, {
|
|
157
176
|
total: number;
|
|
177
|
+
}, {
|
|
158
178
|
results: {
|
|
159
179
|
status: import("./payout.dtos.js").PayoutStatus;
|
|
160
180
|
id: string;
|
|
@@ -184,6 +204,7 @@ export declare const contract: {
|
|
|
184
204
|
identity: string;
|
|
185
205
|
} | null | undefined;
|
|
186
206
|
}[];
|
|
207
|
+
total: number;
|
|
187
208
|
}>;
|
|
188
209
|
};
|
|
189
210
|
};
|
|
@@ -315,7 +336,6 @@ export declare const contract: {
|
|
|
315
336
|
}>, "many">;
|
|
316
337
|
total: z.ZodNumber;
|
|
317
338
|
}, "strip", z.ZodTypeAny, {
|
|
318
|
-
total: number;
|
|
319
339
|
results: {
|
|
320
340
|
status: import("./payout.dtos.js").PayoutStatus;
|
|
321
341
|
id: string;
|
|
@@ -345,8 +365,8 @@ export declare const contract: {
|
|
|
345
365
|
identity: string;
|
|
346
366
|
} | null | undefined;
|
|
347
367
|
}[];
|
|
348
|
-
}, {
|
|
349
368
|
total: number;
|
|
369
|
+
}, {
|
|
350
370
|
results: {
|
|
351
371
|
status: import("./payout.dtos.js").PayoutStatus;
|
|
352
372
|
id: string;
|
|
@@ -376,6 +396,7 @@ export declare const contract: {
|
|
|
376
396
|
identity: string;
|
|
377
397
|
} | null | undefined;
|
|
378
398
|
}[];
|
|
399
|
+
total: number;
|
|
379
400
|
}>;
|
|
380
401
|
};
|
|
381
402
|
};
|
|
@@ -197,122 +197,6 @@ declare const PayoutDTOSchema: z.ZodObject<{
|
|
|
197
197
|
identity: string;
|
|
198
198
|
} | null | undefined;
|
|
199
199
|
}>;
|
|
200
|
-
/**
|
|
201
|
-
* Lightweight filters interface for payout queries
|
|
202
|
-
*/
|
|
203
|
-
declare const PayoutFiltersSchema: z.ZodObject<{
|
|
204
|
-
page: z.ZodDefault<z.ZodNumber>;
|
|
205
|
-
limit: z.ZodDefault<z.ZodNumber>;
|
|
206
|
-
sortBy: z.ZodDefault<z.ZodString>;
|
|
207
|
-
sortOrder: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
|
|
208
|
-
startDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
209
|
-
endDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
210
|
-
payeeName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
211
|
-
msisdn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
212
|
-
profileId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
213
|
-
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
214
|
-
partnerReference: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
215
|
-
channel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
216
|
-
status: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof PayoutStatus>>>;
|
|
217
|
-
approvalStatus: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof PayoutApprovalStatus>>>;
|
|
218
|
-
minAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
219
|
-
maxAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
220
|
-
search: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
221
|
-
}, "strip", z.ZodTypeAny, {
|
|
222
|
-
page: number;
|
|
223
|
-
limit: number;
|
|
224
|
-
sortBy: string;
|
|
225
|
-
sortOrder: "asc" | "desc";
|
|
226
|
-
status?: PayoutStatus | null | undefined;
|
|
227
|
-
id?: string | null | undefined;
|
|
228
|
-
profileId?: string | null | undefined;
|
|
229
|
-
channel?: string | null | undefined;
|
|
230
|
-
msisdn?: string | null | undefined;
|
|
231
|
-
payeeName?: string | null | undefined;
|
|
232
|
-
partnerReference?: string | null | undefined;
|
|
233
|
-
approvalStatus?: PayoutApprovalStatus | null | undefined;
|
|
234
|
-
startDate?: string | null | undefined;
|
|
235
|
-
endDate?: string | null | undefined;
|
|
236
|
-
minAmount?: number | null | undefined;
|
|
237
|
-
maxAmount?: number | null | undefined;
|
|
238
|
-
search?: string | null | undefined;
|
|
239
|
-
}, {
|
|
240
|
-
status?: PayoutStatus | null | undefined;
|
|
241
|
-
id?: string | null | undefined;
|
|
242
|
-
profileId?: string | null | undefined;
|
|
243
|
-
channel?: string | null | undefined;
|
|
244
|
-
msisdn?: string | null | undefined;
|
|
245
|
-
payeeName?: string | null | undefined;
|
|
246
|
-
partnerReference?: string | null | undefined;
|
|
247
|
-
approvalStatus?: PayoutApprovalStatus | null | undefined;
|
|
248
|
-
page?: number | undefined;
|
|
249
|
-
limit?: number | undefined;
|
|
250
|
-
sortBy?: string | undefined;
|
|
251
|
-
sortOrder?: "asc" | "desc" | undefined;
|
|
252
|
-
startDate?: string | null | undefined;
|
|
253
|
-
endDate?: string | null | undefined;
|
|
254
|
-
minAmount?: number | null | undefined;
|
|
255
|
-
maxAmount?: number | null | undefined;
|
|
256
|
-
search?: string | null | undefined;
|
|
257
|
-
}>;
|
|
258
|
-
/**
|
|
259
|
-
* URL-safe schema for query parameters (all strings)
|
|
260
|
-
*/
|
|
261
|
-
declare const PayoutURLQueryParamsSchema: z.ZodObject<{
|
|
262
|
-
page: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
|
|
263
|
-
limit: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
|
|
264
|
-
sortBy: z.ZodDefault<z.ZodString>;
|
|
265
|
-
sortOrder: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
|
|
266
|
-
startDate: z.ZodOptional<z.ZodString>;
|
|
267
|
-
endDate: z.ZodOptional<z.ZodString>;
|
|
268
|
-
payeeName: z.ZodOptional<z.ZodString>;
|
|
269
|
-
msisdn: z.ZodOptional<z.ZodString>;
|
|
270
|
-
profileId: z.ZodOptional<z.ZodString>;
|
|
271
|
-
id: z.ZodOptional<z.ZodString>;
|
|
272
|
-
partnerReference: z.ZodOptional<z.ZodString>;
|
|
273
|
-
channel: z.ZodOptional<z.ZodString>;
|
|
274
|
-
status: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, PayoutStatus, string>>;
|
|
275
|
-
approvalStatus: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, PayoutApprovalStatus, string>>;
|
|
276
|
-
minAmount: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
|
|
277
|
-
maxAmount: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
|
|
278
|
-
search: z.ZodOptional<z.ZodString>;
|
|
279
|
-
}, "strip", z.ZodTypeAny, {
|
|
280
|
-
sortBy: string;
|
|
281
|
-
sortOrder: "asc" | "desc";
|
|
282
|
-
status?: PayoutStatus | undefined;
|
|
283
|
-
id?: string | undefined;
|
|
284
|
-
profileId?: string | undefined;
|
|
285
|
-
channel?: string | undefined;
|
|
286
|
-
msisdn?: string | undefined;
|
|
287
|
-
payeeName?: string | undefined;
|
|
288
|
-
partnerReference?: string | undefined;
|
|
289
|
-
approvalStatus?: PayoutApprovalStatus | undefined;
|
|
290
|
-
page?: number | undefined;
|
|
291
|
-
limit?: number | undefined;
|
|
292
|
-
startDate?: string | undefined;
|
|
293
|
-
endDate?: string | undefined;
|
|
294
|
-
minAmount?: number | undefined;
|
|
295
|
-
maxAmount?: number | undefined;
|
|
296
|
-
search?: string | undefined;
|
|
297
|
-
}, {
|
|
298
|
-
status?: string | undefined;
|
|
299
|
-
id?: string | undefined;
|
|
300
|
-
profileId?: string | undefined;
|
|
301
|
-
channel?: string | undefined;
|
|
302
|
-
msisdn?: string | undefined;
|
|
303
|
-
payeeName?: string | undefined;
|
|
304
|
-
partnerReference?: string | undefined;
|
|
305
|
-
approvalStatus?: string | undefined;
|
|
306
|
-
page?: string | undefined;
|
|
307
|
-
limit?: string | undefined;
|
|
308
|
-
sortBy?: string | undefined;
|
|
309
|
-
sortOrder?: "asc" | "desc" | undefined;
|
|
310
|
-
startDate?: string | undefined;
|
|
311
|
-
endDate?: string | undefined;
|
|
312
|
-
minAmount?: string | undefined;
|
|
313
|
-
maxAmount?: string | undefined;
|
|
314
|
-
search?: string | undefined;
|
|
315
|
-
}>;
|
|
316
200
|
/**
|
|
317
201
|
* Type definition inferred from AuthorizerSchema
|
|
318
202
|
* Represents the structure of a user who actions the payout
|
|
@@ -328,14 +212,6 @@ type PayoutInputDTO = z.infer<typeof PayoutInputDTOSchema>;
|
|
|
328
212
|
* Represents the complete payout record structure
|
|
329
213
|
*/
|
|
330
214
|
type PayoutDTO = z.infer<typeof PayoutDTOSchema>;
|
|
331
|
-
/**
|
|
332
|
-
* Type definition for payout filters
|
|
333
|
-
*/
|
|
334
|
-
type PayoutFilters = z.infer<typeof PayoutFiltersSchema>;
|
|
335
|
-
/**
|
|
336
|
-
* Type definition for URL query parameters
|
|
337
|
-
*/
|
|
338
|
-
type PayoutURLQueryParams = z.infer<typeof PayoutURLQueryParamsSchema>;
|
|
339
215
|
/**
|
|
340
216
|
* Export object containing all payout-related schemas
|
|
341
217
|
* Used for validation and type checking throughout the application
|
|
@@ -481,119 +357,9 @@ export declare const PayoutDTOSchemas: {
|
|
|
481
357
|
id: string;
|
|
482
358
|
identity: string;
|
|
483
359
|
}>;
|
|
484
|
-
readonly PayoutFilters: z.ZodObject<{
|
|
485
|
-
page: z.ZodDefault<z.ZodNumber>;
|
|
486
|
-
limit: z.ZodDefault<z.ZodNumber>;
|
|
487
|
-
sortBy: z.ZodDefault<z.ZodString>;
|
|
488
|
-
sortOrder: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
|
|
489
|
-
startDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
490
|
-
endDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
491
|
-
payeeName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
492
|
-
msisdn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
493
|
-
profileId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
494
|
-
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
495
|
-
partnerReference: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
496
|
-
channel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
497
|
-
status: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof PayoutStatus>>>;
|
|
498
|
-
approvalStatus: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof PayoutApprovalStatus>>>;
|
|
499
|
-
minAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
500
|
-
maxAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
501
|
-
search: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
502
|
-
}, "strip", z.ZodTypeAny, {
|
|
503
|
-
page: number;
|
|
504
|
-
limit: number;
|
|
505
|
-
sortBy: string;
|
|
506
|
-
sortOrder: "asc" | "desc";
|
|
507
|
-
status?: PayoutStatus | null | undefined;
|
|
508
|
-
id?: string | null | undefined;
|
|
509
|
-
profileId?: string | null | undefined;
|
|
510
|
-
channel?: string | null | undefined;
|
|
511
|
-
msisdn?: string | null | undefined;
|
|
512
|
-
payeeName?: string | null | undefined;
|
|
513
|
-
partnerReference?: string | null | undefined;
|
|
514
|
-
approvalStatus?: PayoutApprovalStatus | null | undefined;
|
|
515
|
-
startDate?: string | null | undefined;
|
|
516
|
-
endDate?: string | null | undefined;
|
|
517
|
-
minAmount?: number | null | undefined;
|
|
518
|
-
maxAmount?: number | null | undefined;
|
|
519
|
-
search?: string | null | undefined;
|
|
520
|
-
}, {
|
|
521
|
-
status?: PayoutStatus | null | undefined;
|
|
522
|
-
id?: string | null | undefined;
|
|
523
|
-
profileId?: string | null | undefined;
|
|
524
|
-
channel?: string | null | undefined;
|
|
525
|
-
msisdn?: string | null | undefined;
|
|
526
|
-
payeeName?: string | null | undefined;
|
|
527
|
-
partnerReference?: string | null | undefined;
|
|
528
|
-
approvalStatus?: PayoutApprovalStatus | null | undefined;
|
|
529
|
-
page?: number | undefined;
|
|
530
|
-
limit?: number | undefined;
|
|
531
|
-
sortBy?: string | undefined;
|
|
532
|
-
sortOrder?: "asc" | "desc" | undefined;
|
|
533
|
-
startDate?: string | null | undefined;
|
|
534
|
-
endDate?: string | null | undefined;
|
|
535
|
-
minAmount?: number | null | undefined;
|
|
536
|
-
maxAmount?: number | null | undefined;
|
|
537
|
-
search?: string | null | undefined;
|
|
538
|
-
}>;
|
|
539
|
-
readonly PayoutURLQueryParams: z.ZodObject<{
|
|
540
|
-
page: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
|
|
541
|
-
limit: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
|
|
542
|
-
sortBy: z.ZodDefault<z.ZodString>;
|
|
543
|
-
sortOrder: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
|
|
544
|
-
startDate: z.ZodOptional<z.ZodString>;
|
|
545
|
-
endDate: z.ZodOptional<z.ZodString>;
|
|
546
|
-
payeeName: z.ZodOptional<z.ZodString>;
|
|
547
|
-
msisdn: z.ZodOptional<z.ZodString>;
|
|
548
|
-
profileId: z.ZodOptional<z.ZodString>;
|
|
549
|
-
id: z.ZodOptional<z.ZodString>;
|
|
550
|
-
partnerReference: z.ZodOptional<z.ZodString>;
|
|
551
|
-
channel: z.ZodOptional<z.ZodString>;
|
|
552
|
-
status: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, PayoutStatus, string>>;
|
|
553
|
-
approvalStatus: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, PayoutApprovalStatus, string>>;
|
|
554
|
-
minAmount: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
|
|
555
|
-
maxAmount: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
|
|
556
|
-
search: z.ZodOptional<z.ZodString>;
|
|
557
|
-
}, "strip", z.ZodTypeAny, {
|
|
558
|
-
sortBy: string;
|
|
559
|
-
sortOrder: "asc" | "desc";
|
|
560
|
-
status?: PayoutStatus | undefined;
|
|
561
|
-
id?: string | undefined;
|
|
562
|
-
profileId?: string | undefined;
|
|
563
|
-
channel?: string | undefined;
|
|
564
|
-
msisdn?: string | undefined;
|
|
565
|
-
payeeName?: string | undefined;
|
|
566
|
-
partnerReference?: string | undefined;
|
|
567
|
-
approvalStatus?: PayoutApprovalStatus | undefined;
|
|
568
|
-
page?: number | undefined;
|
|
569
|
-
limit?: number | undefined;
|
|
570
|
-
startDate?: string | undefined;
|
|
571
|
-
endDate?: string | undefined;
|
|
572
|
-
minAmount?: number | undefined;
|
|
573
|
-
maxAmount?: number | undefined;
|
|
574
|
-
search?: string | undefined;
|
|
575
|
-
}, {
|
|
576
|
-
status?: string | undefined;
|
|
577
|
-
id?: string | undefined;
|
|
578
|
-
profileId?: string | undefined;
|
|
579
|
-
channel?: string | undefined;
|
|
580
|
-
msisdn?: string | undefined;
|
|
581
|
-
payeeName?: string | undefined;
|
|
582
|
-
partnerReference?: string | undefined;
|
|
583
|
-
approvalStatus?: string | undefined;
|
|
584
|
-
page?: string | undefined;
|
|
585
|
-
limit?: string | undefined;
|
|
586
|
-
sortBy?: string | undefined;
|
|
587
|
-
sortOrder?: "asc" | "desc" | undefined;
|
|
588
|
-
startDate?: string | undefined;
|
|
589
|
-
endDate?: string | undefined;
|
|
590
|
-
minAmount?: string | undefined;
|
|
591
|
-
maxAmount?: string | undefined;
|
|
592
|
-
search?: string | undefined;
|
|
593
|
-
}>;
|
|
594
360
|
};
|
|
595
361
|
/**
|
|
596
362
|
* Export types for use in other parts of the application
|
|
597
363
|
* These types can be used for type checking and documentation
|
|
598
364
|
*/
|
|
599
|
-
export type { PayoutAuthorizerDTO as PayoutAuthorizer, PayoutDTO, PayoutInputDTO
|
|
365
|
+
export type { PayoutAuthorizerDTO as PayoutAuthorizer, PayoutDTO, PayoutInputDTO };
|
|
@@ -1,15 +1,39 @@
|
|
|
1
|
-
import { BaseRepository
|
|
1
|
+
import { BaseRepository } from "@/lib/api/base-repository.js";
|
|
2
2
|
import { ContactInfo } from "@/models/contact-info.model.js";
|
|
3
3
|
import { Payout } from "@/models/payout.model.js";
|
|
4
4
|
import { Amount } from "@temboplus/frontend-core";
|
|
5
5
|
import { PayoutAPI } from "./payout.api-contract.js";
|
|
6
6
|
import { PayoutChannel } from "./payout.dtos.js";
|
|
7
|
-
import { PayoutQuery } from "./payout.query.js";
|
|
8
|
-
import { PayoutFilters } from "./payout.dtos.js";
|
|
9
7
|
/**
|
|
10
|
-
*
|
|
8
|
+
* Arguments for retrieving payouts from the API.
|
|
9
|
+
*
|
|
10
|
+
* @interface GetPayoutsAPIArgs
|
|
11
|
+
*
|
|
12
|
+
* @property {number} [rangeStart] - The starting index for pagination. Defaults to 0.
|
|
13
|
+
* @property {number} [rangeEnd] - The ending index for pagination. Defaults to 10.
|
|
14
|
+
* @property {boolean} [pending] - Filter for pending payouts only. If true, returns only pending payouts.
|
|
15
|
+
* @property {string} [msisdn] - Filter for msisdn. Should be properly formatted. {country_code}{compact_number} for phone numbers and {SWIFT_CODE}:{account_no}
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* // Get first 10 payouts
|
|
20
|
+
* const args: GetPayoutsAPIArgs = {
|
|
21
|
+
* rangeStart: 0,
|
|
22
|
+
* rangeEnd: 10
|
|
23
|
+
* };
|
|
24
|
+
*
|
|
25
|
+
* // Get only pending payouts
|
|
26
|
+
* const pendingArgs: GetPayoutsAPIArgs = {
|
|
27
|
+
* pending: true
|
|
28
|
+
* };
|
|
29
|
+
* ```
|
|
11
30
|
*/
|
|
12
|
-
export
|
|
31
|
+
export interface GetPayoutsAPIArgs {
|
|
32
|
+
rangeStart?: number;
|
|
33
|
+
rangeEnd?: number;
|
|
34
|
+
pending?: boolean;
|
|
35
|
+
msisdn?: string;
|
|
36
|
+
}
|
|
13
37
|
/**
|
|
14
38
|
* Repository class for managing payout operations including creation, approval,
|
|
15
39
|
* rejection, and retrieval of payouts.
|
|
@@ -22,7 +46,7 @@ export type PayoutQueryInput = PayoutQuery | PayoutFilters | Record<string, stri
|
|
|
22
46
|
* @example
|
|
23
47
|
* ```typescript
|
|
24
48
|
* const repo = new PayoutRepository({ token: userToken });
|
|
25
|
-
* const payouts = await repo.
|
|
49
|
+
* const payouts = await repo.getAll();
|
|
26
50
|
* ```
|
|
27
51
|
*/
|
|
28
52
|
export declare class PayoutRepository extends BaseRepository<PayoutAPI> {
|
|
@@ -45,38 +69,31 @@ export declare class PayoutRepository extends BaseRepository<PayoutAPI> {
|
|
|
45
69
|
root?: string;
|
|
46
70
|
});
|
|
47
71
|
/**
|
|
48
|
-
*
|
|
49
|
-
* Accepts flexible input types and normalizes them to PayoutQuery.
|
|
72
|
+
* Retrieves a paginated list of payouts with optional filtering for pending status.
|
|
50
73
|
*
|
|
51
|
-
* @param
|
|
52
|
-
* @
|
|
74
|
+
* @param args - Optional arguments for filtering and pagination
|
|
75
|
+
* @param args.rangeStart - Starting index for pagination (default: 0)
|
|
76
|
+
* @param args.rangeEnd - Ending index for pagination (default: 10)
|
|
77
|
+
* @param args.pending - Filter for pending payouts only
|
|
78
|
+
* @param args.msisdn - Filter by MSISDN
|
|
79
|
+
* @returns Promise that resolves to paginated payout results and total count
|
|
80
|
+
* @throws {APIError} If range is invalid or if the fetch operation fails
|
|
53
81
|
*
|
|
54
82
|
* @example
|
|
55
83
|
* ```typescript
|
|
56
|
-
* //
|
|
57
|
-
* const
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* const filters: PayoutFilters = { page: 1, limit: 20, approvalStatus: 'Pending' };
|
|
62
|
-
* const result2 = await repo.getPayouts(filters);
|
|
84
|
+
* // Get first 20 payouts
|
|
85
|
+
* const result = await repo.getAll({
|
|
86
|
+
* rangeStart: 0,
|
|
87
|
+
* rangeEnd: 20
|
|
88
|
+
* });
|
|
63
89
|
*
|
|
64
|
-
* //
|
|
65
|
-
* const
|
|
66
|
-
* const result3 = await repo.getPayouts(query);
|
|
90
|
+
* // Get only pending payouts
|
|
91
|
+
* const pendingResult = await repo.getAll({ pending: true });
|
|
67
92
|
* ```
|
|
68
93
|
*/
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}>;
|
|
73
|
-
/**
|
|
74
|
-
* Convenience method for Next.js API routes
|
|
75
|
-
* Extracts search params directly from Request object
|
|
76
|
-
*/
|
|
77
|
-
getPayoutsFromRequest(req: Request): Promise<{
|
|
78
|
-
payouts: Payout[];
|
|
79
|
-
pagination: PaginationDTO;
|
|
94
|
+
getAll(args?: GetPayoutsAPIArgs): Promise<{
|
|
95
|
+
results: Payout[];
|
|
96
|
+
total: number;
|
|
80
97
|
}>;
|
|
81
98
|
/**
|
|
82
99
|
* Creates a new payout with the provided input data.
|
|
@@ -92,7 +109,7 @@ export declare class PayoutRepository extends BaseRepository<PayoutAPI> {
|
|
|
92
109
|
* @example
|
|
93
110
|
* ```typescript
|
|
94
111
|
* const payout = await repo.pay({
|
|
95
|
-
* channel: PayoutChannel.
|
|
112
|
+
* channel: PayoutChannel.MOBILE_MONEY,
|
|
96
113
|
* receiver: { name: "John Doe", phone: "+255123456789" },
|
|
97
114
|
* amount: Amount.from(10000, "TZS"),
|
|
98
115
|
* notes: "Payment for services"
|
|
@@ -157,13 +174,4 @@ export declare class PayoutRepository extends BaseRepository<PayoutAPI> {
|
|
|
157
174
|
* ```
|
|
158
175
|
*/
|
|
159
176
|
getByID(id: string): Promise<Payout>;
|
|
160
|
-
/**
|
|
161
|
-
* Get count of payouts matching a query
|
|
162
|
-
* Uses the same query syntax as getPayouts but only returns the count
|
|
163
|
-
*/
|
|
164
|
-
count(query?: PayoutQueryInput): Promise<number>;
|
|
165
|
-
/**
|
|
166
|
-
* Check if any payouts exist matching a query
|
|
167
|
-
*/
|
|
168
|
-
exists(query?: PayoutQueryInput): Promise<boolean>;
|
|
169
177
|
}
|
|
@@ -90,12 +90,12 @@ export declare const contract: {
|
|
|
90
90
|
startDate: z.ZodDate;
|
|
91
91
|
accountNo: z.ZodOptional<z.ZodString>;
|
|
92
92
|
}, "strip", z.ZodTypeAny, {
|
|
93
|
-
startDate: Date;
|
|
94
93
|
endDate: Date;
|
|
94
|
+
startDate: Date;
|
|
95
95
|
accountNo?: string | undefined;
|
|
96
96
|
}, {
|
|
97
|
-
startDate: Date;
|
|
98
97
|
endDate: Date;
|
|
98
|
+
startDate: Date;
|
|
99
99
|
accountNo?: string | undefined;
|
|
100
100
|
}>;
|
|
101
101
|
path: "/statement";
|