@temboplus/afloat 0.2.1-beta.1 → 0.2.1-beta.11

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.
@@ -200,7 +200,7 @@ export declare class PayoutQuery extends QueryBuilder {
200
200
  * .whereApproved()
201
201
  * .orderByDesc("createdAt")
202
202
  * .build();
203
- * // => { "approvalStatus:eq": "APPROVED", orderByDesc: "createdAt" }
203
+ * // => { "approvalStatus:eq": "Approved", orderByDesc: "createdAt" }
204
204
  * ```
205
205
  *
206
206
  * @returns An objection-find query object
@@ -2,20 +2,20 @@ import { BaseRepository } from "@/lib/api/index.js";
2
2
  import { Payout } from "@/modules/payout/payout.model.js";
3
3
  import { Amount } from "@temboplus/frontend-core";
4
4
  import { PayoutAPI } from "./payout.api-contract.js";
5
- import { PayoutChannel } from "./payout.dtos.js";
6
5
  import { PayoutQuery } from "./payout.query.js";
7
6
  import { PayoutFilters } from "./payout.dtos.js";
8
7
  import { Paged } from "@/lib/query/index.js";
9
8
  import { Wallet } from "../wallet/wallet.model.js";
10
9
  import { BeneficiaryInfo } from "../beneficiary/beneficiary-info.model.js";
11
10
  /**
12
- * Input type for payout creation mutation
11
+ * Input type for payout creation mutation.
12
+ *
13
+ * Consumers do not provide a payout channel. The repository resolves the
14
+ * upstream B2C channel from wallet, beneficiary, and amount details.
13
15
  */
14
16
  export interface CreatePayoutInput {
15
17
  /** The wallet to pay from */
16
18
  wallet: Wallet;
17
- /** The payout channel to use (MOBILE or BANK) */
18
- channel: PayoutChannel;
19
19
  /** Contact information for the payout receiver */
20
20
  receiver: BeneficiaryInfo;
21
21
  /** The amount to pay out */
@@ -123,9 +123,11 @@ export declare class PayoutRepository extends BaseRepository<PayoutAPI> {
123
123
  /**
124
124
  * Creates a new payout with the provided input data.
125
125
  *
126
+ * The upstream payout channel is resolved internally by the library before
127
+ * the API request is sent.
128
+ *
126
129
  * @param input - The payout creation data
127
130
  * @param input.wallet - The wallet to pay from
128
- * @param input.channel - The payout channel to use
129
131
  * @param input.receiver - Contact information for the payout receiver
130
132
  * @param input.amount - The amount to pay out
131
133
  * @param input.notes - Optional notes for the payout
@@ -136,7 +138,6 @@ export declare class PayoutRepository extends BaseRepository<PayoutAPI> {
136
138
  * ```typescript
137
139
  * const payout = await repo.pay({
138
140
  * wallet: selectedWallet,
139
- * channel: PayoutChannel.MOBILE,
140
141
  * receiver: { name: "John Doe", phone: "+255123456789" },
141
142
  * amount: Amount.from(10000, "TZS"),
142
143
  * notes: "Payment for services"
@@ -6,7 +6,7 @@ import { RoleDTO } from "./team-member.dtos.js";
6
6
  export declare const RoleJSONSchema: z.ZodObject<{
7
7
  id: z.ZodString;
8
8
  name: z.ZodString;
9
- description: z.ZodOptional<z.ZodString>;
9
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
10
10
  access: z.ZodArray<z.ZodString, "many">;
11
11
  createdAt: z.ZodString;
12
12
  updatedAt: z.ZodString;
@@ -18,7 +18,7 @@ export declare const RoleJSONSchema: z.ZodObject<{
18
18
  _version: string;
19
19
  updatedAt: string;
20
20
  access: string[];
21
- description?: string | undefined;
21
+ description?: string | null | undefined;
22
22
  }, {
23
23
  name: string;
24
24
  createdAt: string;
@@ -26,7 +26,7 @@ export declare const RoleJSONSchema: z.ZodObject<{
26
26
  updatedAt: string;
27
27
  access: string[];
28
28
  _version?: string | undefined;
29
- description?: string | undefined;
29
+ description?: string | null | undefined;
30
30
  }>;
31
31
  /**
32
32
  * Infer the RoleJSON type from the schema
@@ -35,7 +35,7 @@ export type RoleJSON = z.infer<typeof RoleJSONSchema>;
35
35
  export declare class Role {
36
36
  readonly id: string;
37
37
  readonly name: string;
38
- readonly description?: string;
38
+ readonly description?: string | null;
39
39
  readonly permissions: ReadonlySet<string>;
40
40
  readonly createdAt: Date;
41
41
  readonly updatedAt: Date;
@@ -59,7 +59,7 @@ export declare const teamManagementContract: {
59
59
  role: z.ZodOptional<z.ZodObject<{
60
60
  id: z.ZodString;
61
61
  name: z.ZodString;
62
- description: z.ZodOptional<z.ZodString>;
62
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
63
63
  access: z.ZodArray<z.ZodString, "many">;
64
64
  createdAt: z.ZodString;
65
65
  updatedAt: z.ZodString;
@@ -69,14 +69,14 @@ export declare const teamManagementContract: {
69
69
  id: string;
70
70
  updatedAt: string;
71
71
  access: string[];
72
- description?: string | undefined;
72
+ description?: string | null | undefined;
73
73
  }, {
74
74
  name: string;
75
75
  createdAt: string;
76
76
  id: string;
77
77
  updatedAt: string;
78
78
  access: string[];
79
- description?: string | undefined;
79
+ description?: string | null | undefined;
80
80
  }>>;
81
81
  createdAt: z.ZodString;
82
82
  updatedAt: z.ZodString;
@@ -98,7 +98,7 @@ export declare const teamManagementContract: {
98
98
  id: string;
99
99
  updatedAt: string;
100
100
  access: string[];
101
- description?: string | undefined;
101
+ description?: string | null | undefined;
102
102
  } | undefined;
103
103
  }, {
104
104
  type: string;
@@ -118,7 +118,7 @@ export declare const teamManagementContract: {
118
118
  id: string;
119
119
  updatedAt: string;
120
120
  access: string[];
121
- description?: string | undefined;
121
+ description?: string | null | undefined;
122
122
  } | undefined;
123
123
  }>, "many">;
124
124
  401: z.ZodObject<{
@@ -203,7 +203,7 @@ export declare const teamManagementContract: {
203
203
  role: z.ZodOptional<z.ZodObject<{
204
204
  id: z.ZodString;
205
205
  name: z.ZodString;
206
- description: z.ZodOptional<z.ZodString>;
206
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
207
207
  access: z.ZodArray<z.ZodString, "many">;
208
208
  createdAt: z.ZodString;
209
209
  updatedAt: z.ZodString;
@@ -213,14 +213,14 @@ export declare const teamManagementContract: {
213
213
  id: string;
214
214
  updatedAt: string;
215
215
  access: string[];
216
- description?: string | undefined;
216
+ description?: string | null | undefined;
217
217
  }, {
218
218
  name: string;
219
219
  createdAt: string;
220
220
  id: string;
221
221
  updatedAt: string;
222
222
  access: string[];
223
- description?: string | undefined;
223
+ description?: string | null | undefined;
224
224
  }>>;
225
225
  createdAt: z.ZodString;
226
226
  updatedAt: z.ZodString;
@@ -242,7 +242,7 @@ export declare const teamManagementContract: {
242
242
  id: string;
243
243
  updatedAt: string;
244
244
  access: string[];
245
- description?: string | undefined;
245
+ description?: string | null | undefined;
246
246
  } | undefined;
247
247
  }, {
248
248
  type: string;
@@ -262,7 +262,7 @@ export declare const teamManagementContract: {
262
262
  id: string;
263
263
  updatedAt: string;
264
264
  access: string[];
265
- description?: string | undefined;
265
+ description?: string | null | undefined;
266
266
  } | undefined;
267
267
  }>;
268
268
  401: z.ZodObject<{
@@ -428,7 +428,7 @@ export declare const teamManagementContract: {
428
428
  role: z.ZodOptional<z.ZodObject<{
429
429
  id: z.ZodString;
430
430
  name: z.ZodString;
431
- description: z.ZodOptional<z.ZodString>;
431
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
432
432
  access: z.ZodArray<z.ZodString, "many">;
433
433
  createdAt: z.ZodString;
434
434
  updatedAt: z.ZodString;
@@ -438,14 +438,14 @@ export declare const teamManagementContract: {
438
438
  id: string;
439
439
  updatedAt: string;
440
440
  access: string[];
441
- description?: string | undefined;
441
+ description?: string | null | undefined;
442
442
  }, {
443
443
  name: string;
444
444
  createdAt: string;
445
445
  id: string;
446
446
  updatedAt: string;
447
447
  access: string[];
448
- description?: string | undefined;
448
+ description?: string | null | undefined;
449
449
  }>>;
450
450
  createdAt: z.ZodString;
451
451
  updatedAt: z.ZodString;
@@ -467,7 +467,7 @@ export declare const teamManagementContract: {
467
467
  id: string;
468
468
  updatedAt: string;
469
469
  access: string[];
470
- description?: string | undefined;
470
+ description?: string | null | undefined;
471
471
  } | undefined;
472
472
  }, {
473
473
  type: string;
@@ -487,7 +487,7 @@ export declare const teamManagementContract: {
487
487
  id: string;
488
488
  updatedAt: string;
489
489
  access: string[];
490
- description?: string | undefined;
490
+ description?: string | null | undefined;
491
491
  } | undefined;
492
492
  }>;
493
493
  400: z.ZodObject<{
@@ -537,7 +537,7 @@ export declare const teamManagementContract: {
537
537
  body: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
538
538
  path: "/login/:id/archive";
539
539
  responses: {
540
- 200: z.ZodObject<{
540
+ 201: z.ZodObject<{
541
541
  id: z.ZodString;
542
542
  name: z.ZodString;
543
543
  identity: z.ZodString;
@@ -550,7 +550,7 @@ export declare const teamManagementContract: {
550
550
  role: z.ZodOptional<z.ZodObject<{
551
551
  id: z.ZodString;
552
552
  name: z.ZodString;
553
- description: z.ZodOptional<z.ZodString>;
553
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
554
554
  access: z.ZodArray<z.ZodString, "many">;
555
555
  createdAt: z.ZodString;
556
556
  updatedAt: z.ZodString;
@@ -560,14 +560,14 @@ export declare const teamManagementContract: {
560
560
  id: string;
561
561
  updatedAt: string;
562
562
  access: string[];
563
- description?: string | undefined;
563
+ description?: string | null | undefined;
564
564
  }, {
565
565
  name: string;
566
566
  createdAt: string;
567
567
  id: string;
568
568
  updatedAt: string;
569
569
  access: string[];
570
- description?: string | undefined;
570
+ description?: string | null | undefined;
571
571
  }>>;
572
572
  createdAt: z.ZodString;
573
573
  updatedAt: z.ZodString;
@@ -589,7 +589,7 @@ export declare const teamManagementContract: {
589
589
  id: string;
590
590
  updatedAt: string;
591
591
  access: string[];
592
- description?: string | undefined;
592
+ description?: string | null | undefined;
593
593
  } | undefined;
594
594
  }, {
595
595
  type: string;
@@ -609,7 +609,7 @@ export declare const teamManagementContract: {
609
609
  id: string;
610
610
  updatedAt: string;
611
611
  access: string[];
612
- description?: string | undefined;
612
+ description?: string | null | undefined;
613
613
  } | undefined;
614
614
  }>;
615
615
  401: z.ZodObject<{
@@ -633,6 +633,13 @@ export declare const teamManagementContract: {
633
633
  }, {
634
634
  message?: string | undefined;
635
635
  }>;
636
+ 409: z.ZodObject<{
637
+ message: z.ZodOptional<z.ZodString>;
638
+ }, "strip", z.ZodTypeAny, {
639
+ message?: string | undefined;
640
+ }, {
641
+ message?: string | undefined;
642
+ }>;
636
643
  };
637
644
  };
638
645
  unArchiveTeamMember: {
@@ -649,7 +656,7 @@ export declare const teamManagementContract: {
649
656
  body: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
650
657
  path: "/login/:id/unarchive";
651
658
  responses: {
652
- 200: z.ZodObject<{
659
+ 201: z.ZodObject<{
653
660
  id: z.ZodString;
654
661
  name: z.ZodString;
655
662
  identity: z.ZodString;
@@ -662,7 +669,7 @@ export declare const teamManagementContract: {
662
669
  role: z.ZodOptional<z.ZodObject<{
663
670
  id: z.ZodString;
664
671
  name: z.ZodString;
665
- description: z.ZodOptional<z.ZodString>;
672
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
666
673
  access: z.ZodArray<z.ZodString, "many">;
667
674
  createdAt: z.ZodString;
668
675
  updatedAt: z.ZodString;
@@ -672,14 +679,14 @@ export declare const teamManagementContract: {
672
679
  id: string;
673
680
  updatedAt: string;
674
681
  access: string[];
675
- description?: string | undefined;
682
+ description?: string | null | undefined;
676
683
  }, {
677
684
  name: string;
678
685
  createdAt: string;
679
686
  id: string;
680
687
  updatedAt: string;
681
688
  access: string[];
682
- description?: string | undefined;
689
+ description?: string | null | undefined;
683
690
  }>>;
684
691
  createdAt: z.ZodString;
685
692
  updatedAt: z.ZodString;
@@ -701,7 +708,7 @@ export declare const teamManagementContract: {
701
708
  id: string;
702
709
  updatedAt: string;
703
710
  access: string[];
704
- description?: string | undefined;
711
+ description?: string | null | undefined;
705
712
  } | undefined;
706
713
  }, {
707
714
  type: string;
@@ -721,7 +728,7 @@ export declare const teamManagementContract: {
721
728
  id: string;
722
729
  updatedAt: string;
723
730
  access: string[];
724
- description?: string | undefined;
731
+ description?: string | null | undefined;
725
732
  } | undefined;
726
733
  }>;
727
734
  401: z.ZodObject<{
@@ -745,6 +752,13 @@ export declare const teamManagementContract: {
745
752
  }, {
746
753
  message?: string | undefined;
747
754
  }>;
755
+ 409: z.ZodObject<{
756
+ message: z.ZodOptional<z.ZodString>;
757
+ }, "strip", z.ZodTypeAny, {
758
+ message?: string | undefined;
759
+ }, {
760
+ message?: string | undefined;
761
+ }>;
748
762
  };
749
763
  };
750
764
  resetPassword: {
@@ -770,7 +784,7 @@ export declare const teamManagementContract: {
770
784
  }>;
771
785
  path: "/login/:id/reset-password";
772
786
  responses: {
773
- 200: z.ZodObject<{
787
+ 201: z.ZodObject<{
774
788
  success: z.ZodBoolean;
775
789
  }, "strip", z.ZodTypeAny, {
776
790
  success: boolean;
@@ -816,7 +830,7 @@ export declare const teamManagementContract: {
816
830
  200: z.ZodArray<z.ZodObject<{
817
831
  id: z.ZodString;
818
832
  name: z.ZodString;
819
- description: z.ZodOptional<z.ZodString>;
833
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
820
834
  access: z.ZodArray<z.ZodString, "many">;
821
835
  createdAt: z.ZodString;
822
836
  updatedAt: z.ZodString;
@@ -826,14 +840,14 @@ export declare const teamManagementContract: {
826
840
  id: string;
827
841
  updatedAt: string;
828
842
  access: string[];
829
- description?: string | undefined;
843
+ description?: string | null | undefined;
830
844
  }, {
831
845
  name: string;
832
846
  createdAt: string;
833
847
  id: string;
834
848
  updatedAt: string;
835
849
  access: string[];
836
- description?: string | undefined;
850
+ description?: string | null | undefined;
837
851
  }>, "many">;
838
852
  401: z.ZodObject<{
839
853
  message: z.ZodOptional<z.ZodString>;
@@ -867,7 +881,7 @@ export declare const teamManagementContract: {
867
881
  200: z.ZodObject<{
868
882
  id: z.ZodString;
869
883
  name: z.ZodString;
870
- description: z.ZodOptional<z.ZodString>;
884
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
871
885
  access: z.ZodArray<z.ZodString, "many">;
872
886
  createdAt: z.ZodString;
873
887
  updatedAt: z.ZodString;
@@ -877,14 +891,14 @@ export declare const teamManagementContract: {
877
891
  id: string;
878
892
  updatedAt: string;
879
893
  access: string[];
880
- description?: string | undefined;
894
+ description?: string | null | undefined;
881
895
  }, {
882
896
  name: string;
883
897
  createdAt: string;
884
898
  id: string;
885
899
  updatedAt: string;
886
900
  access: string[];
887
- description?: string | undefined;
901
+ description?: string | null | undefined;
888
902
  }>;
889
903
  401: z.ZodObject<{
890
904
  message: z.ZodOptional<z.ZodString>;
@@ -7,7 +7,7 @@ export declare const TeamManagementDTOSchemas: {
7
7
  role: z.ZodObject<{
8
8
  id: z.ZodString;
9
9
  name: z.ZodString;
10
- description: z.ZodOptional<z.ZodString>;
10
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
11
  access: z.ZodArray<z.ZodString, "many">;
12
12
  createdAt: z.ZodString;
13
13
  updatedAt: z.ZodString;
@@ -17,14 +17,14 @@ export declare const TeamManagementDTOSchemas: {
17
17
  id: string;
18
18
  updatedAt: string;
19
19
  access: string[];
20
- description?: string | undefined;
20
+ description?: string | null | undefined;
21
21
  }, {
22
22
  name: string;
23
23
  createdAt: string;
24
24
  id: string;
25
25
  updatedAt: string;
26
26
  access: string[];
27
- description?: string | undefined;
27
+ description?: string | null | undefined;
28
28
  }>;
29
29
  teamMember: z.ZodObject<{
30
30
  id: z.ZodString;
@@ -39,7 +39,7 @@ export declare const TeamManagementDTOSchemas: {
39
39
  role: z.ZodOptional<z.ZodObject<{
40
40
  id: z.ZodString;
41
41
  name: z.ZodString;
42
- description: z.ZodOptional<z.ZodString>;
42
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
43
43
  access: z.ZodArray<z.ZodString, "many">;
44
44
  createdAt: z.ZodString;
45
45
  updatedAt: z.ZodString;
@@ -49,14 +49,14 @@ export declare const TeamManagementDTOSchemas: {
49
49
  id: string;
50
50
  updatedAt: string;
51
51
  access: string[];
52
- description?: string | undefined;
52
+ description?: string | null | undefined;
53
53
  }, {
54
54
  name: string;
55
55
  createdAt: string;
56
56
  id: string;
57
57
  updatedAt: string;
58
58
  access: string[];
59
- description?: string | undefined;
59
+ description?: string | null | undefined;
60
60
  }>>;
61
61
  createdAt: z.ZodString;
62
62
  updatedAt: z.ZodString;
@@ -78,7 +78,7 @@ export declare const TeamManagementDTOSchemas: {
78
78
  id: string;
79
79
  updatedAt: string;
80
80
  access: string[];
81
- description?: string | undefined;
81
+ description?: string | null | undefined;
82
82
  } | undefined;
83
83
  }, {
84
84
  type: string;
@@ -98,7 +98,7 @@ export declare const TeamManagementDTOSchemas: {
98
98
  id: string;
99
99
  updatedAt: string;
100
100
  access: string[];
101
- description?: string | undefined;
101
+ description?: string | null | undefined;
102
102
  } | undefined;
103
103
  }>;
104
104
  teamMemberQueryParams: z.ZodObject<{
@@ -31,7 +31,7 @@ export declare const TeamMemberJSONSchema: z.ZodObject<{
31
31
  role: z.ZodOptional<z.ZodObject<{
32
32
  id: z.ZodString;
33
33
  name: z.ZodString;
34
- description: z.ZodOptional<z.ZodString>;
34
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
35
35
  access: z.ZodArray<z.ZodString, "many">;
36
36
  createdAt: z.ZodString;
37
37
  updatedAt: z.ZodString;
@@ -43,7 +43,7 @@ export declare const TeamMemberJSONSchema: z.ZodObject<{
43
43
  _version: string;
44
44
  updatedAt: string;
45
45
  access: string[];
46
- description?: string | undefined;
46
+ description?: string | null | undefined;
47
47
  }, {
48
48
  name: string;
49
49
  createdAt: string;
@@ -51,7 +51,7 @@ export declare const TeamMemberJSONSchema: z.ZodObject<{
51
51
  updatedAt: string;
52
52
  access: string[];
53
53
  _version?: string | undefined;
54
- description?: string | undefined;
54
+ description?: string | null | undefined;
55
55
  }>>;
56
56
  createdAt: z.ZodString;
57
57
  updatedAt: z.ZodString;
@@ -76,7 +76,7 @@ export declare const TeamMemberJSONSchema: z.ZodObject<{
76
76
  _version: string;
77
77
  updatedAt: string;
78
78
  access: string[];
79
- description?: string | undefined;
79
+ description?: string | null | undefined;
80
80
  } | undefined;
81
81
  }, {
82
82
  type: string;
@@ -98,7 +98,7 @@ export declare const TeamMemberJSONSchema: z.ZodObject<{
98
98
  updatedAt: string;
99
99
  access: string[];
100
100
  _version?: string | undefined;
101
- description?: string | undefined;
101
+ description?: string | null | undefined;
102
102
  } | undefined;
103
103
  }>;
104
104
  export type TeamMemberJSON = z.infer<typeof TeamMemberJSONSchema>;
@@ -86,16 +86,16 @@ export declare const contract: {
86
86
  summary: "Get Wallet Statement";
87
87
  method: "POST";
88
88
  body: z.ZodObject<{
89
- endDate: z.ZodDate;
90
- startDate: z.ZodDate;
89
+ endDate: z.ZodString;
90
+ startDate: z.ZodString;
91
91
  accountNo: z.ZodOptional<z.ZodString>;
92
92
  }, "strip", z.ZodTypeAny, {
93
- startDate: Date;
94
- endDate: Date;
93
+ startDate: string;
94
+ endDate: string;
95
95
  accountNo?: string | undefined;
96
96
  }, {
97
- startDate: Date;
98
- endDate: Date;
97
+ startDate: string;
98
+ endDate: string;
99
99
  accountNo?: string | undefined;
100
100
  }>;
101
101
  path: "/statement";
@@ -102,6 +102,14 @@ declare const statementEntrySchema: z.ZodObject<{
102
102
  accountNo?: string | undefined;
103
103
  currencyCode?: string | undefined;
104
104
  }>;
105
+ /**
106
+ * Plain calendar date as a `YYYY-MM-DD` string. Used by endpoints that
107
+ * filter against a calendar day rather than a moment in time — e.g. the
108
+ * statement endpoint, which the server evaluates against EAT-anchored
109
+ * data. Validated by regex to avoid silently sending a full ISO
110
+ * timestamp where a date-only string is expected.
111
+ */
112
+ declare const plainDateSchema: z.ZodString;
105
113
  /**
106
114
  * Collection of wallet-related schemas for export.
107
115
  * Provides access to both wallet and statement entry validation schemas.
@@ -197,8 +205,10 @@ export declare const WalletDTOSchemas: {
197
205
  accountNo?: string | undefined;
198
206
  currencyCode?: string | undefined;
199
207
  }>;
208
+ plainDate: z.ZodString;
200
209
  };
201
210
  export type WalletDTO = z.infer<typeof walletSchema>;
202
211
  export type WalletQueryDTO = z.infer<typeof walletQuerySchema>;
203
212
  export type WalletStatementEntryDTO = z.infer<typeof statementEntrySchema>;
213
+ export type PlainDate = z.infer<typeof plainDateSchema>;
204
214
  export {};
@@ -144,52 +144,60 @@ export declare class WalletRepository extends BaseRepository<typeof contract> {
144
144
  * 1. Direct wallet object (preferred for performance and currency context)
145
145
  * 2. Account number lookup (requires additional API call to determine currency)
146
146
  *
147
- * If no date range is provided, defaults to the current month.
148
- * Returns statement entries with enhanced narration objects containing payout detection
149
- * and parsing capabilities.
147
+ * The statement endpoint filters by calendar day, evaluated against
148
+ * the EAT-anchored database. Bounds are therefore *plain* date strings
149
+ * (`YYYY-MM-DD`), not full timestamps — sending a datetime gets
150
+ * rejected upstream. If you have `Date` objects from a picker, format
151
+ * them with the exported `toPlainDate` helper.
150
152
  *
151
153
  * @param props - The statement request properties
152
154
  * @param props.wallet - The wallet to get statement for (preferred method)
153
155
  * @param props.accountNo - Alternative: account number to lookup wallet and fetch statement
154
- * @param props.range - Optional date range (defaults to current month)
155
- * @param props.range.startDate - Start date for statement period
156
- * @param props.range.endDate - End date for statement period
156
+ * @param props.range - Required date range. Both bounds are `YYYY-MM-DD`
157
+ * strings; they correspond to calendar days in EAT.
158
+ * @param props.range.startDate - Start of statement period (inclusive), `YYYY-MM-DD`
159
+ * @param props.range.endDate - End of statement period (inclusive), `YYYY-MM-DD`
157
160
  * @returns Promise that resolves to an array of validated WalletStatementEntry instances with Narration objects
158
161
  * @throws {Error} If neither wallet nor accountNo is provided
159
162
  * @throws {Error} If accountNo is provided but no matching wallet is found
163
+ * @throws {Error} If either `range` bound isn't a valid `YYYY-MM-DD` string
160
164
  * @throws {Error} If the statement fetch operation fails or data is invalid
161
165
  *
162
166
  * @example
163
167
  * ```typescript
164
168
  * // Method 1: Using wallet object (recommended)
165
169
  * const wallet = await repo.getWallets().then(w => w[0]);
166
- * const currentMonthEntries = await repo.getStatement({ wallet });
170
+ * const entries = await repo.getStatement({
171
+ * wallet,
172
+ * range: { startDate: "2024-01-01", endDate: "2024-01-31" },
173
+ * });
167
174
  *
168
175
  * // Method 2: Using account number
169
- * const entriesForAccount = await repo.getStatement({
170
- * accountNo: '123456789'
176
+ * const byAccount = await repo.getStatement({
177
+ * accountNo: '123456789',
178
+ * range: { startDate: "2024-01-01", endDate: "2024-01-31" },
171
179
  * });
172
180
  *
173
- * // Custom date range with wallet
174
- * const customRangeEntries = await repo.getStatement({
181
+ * // From a Date picker
182
+ * const entries = await repo.getStatement({
175
183
  * wallet,
176
184
  * range: {
177
- * startDate: new Date('2024-01-01'),
178
- * endDate: new Date('2024-01-31')
179
- * }
185
+ * startDate: toPlainDate(pickedFromDate),
186
+ * endDate: toPlainDate(pickedToDate),
187
+ * },
180
188
  * });
181
189
  *
182
190
  * // Process payout transactions
183
- * const payoutEntries = currentMonthEntries.filter(entry => entry.isPayout);
191
+ * const payoutEntries = entries.filter(entry => entry.isPayout);
184
192
  * payoutEntries.forEach(entry => {
185
193
  * console.log(`Payout ID: ${entry.payoutId}, Amount: ${entry.amountDebited.label}`);
186
194
  * });
187
195
  * ```
188
196
  */
189
197
  getStatement(props: {
190
- range?: {
191
- startDate: Date;
192
- endDate: Date;
198
+ range: {
199
+ startDate: string;
200
+ endDate: string;
193
201
  };
194
202
  wallet?: Wallet;
195
203
  accountNo?: string;
@@ -203,3 +211,15 @@ export declare class WalletRepository extends BaseRepository<typeof contract> {
203
211
  */
204
212
  count(query?: WalletQueryInput): Promise<number>;
205
213
  }
214
+ /**
215
+ * Format a `Date` as `YYYY-MM-DD` using its local (browser/runtime)
216
+ * Y/M/D fields. Use this to convert a picker-emitted `Date` into the
217
+ * plain-date string `getStatement` expects.
218
+ *
219
+ * The local-field choice is intentional: a `react-day-picker` (or any
220
+ * grid-based) calendar picks a wall-clock day in the runtime's clock,
221
+ * and that's the calendar day the user expects to filter against. If
222
+ * you need to bias the conversion toward a specific zone, pre-position
223
+ * the `Date` (e.g. via `@date-fns/tz`'s `TZDate`) before calling this.
224
+ */
225
+ export declare function toPlainDate(date: Date): string;