@temboplus/tembo-dashboard 0.0.2 → 0.0.4

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.
@@ -1,58 +1,7 @@
1
1
  import { z } from "zod";
2
2
  export declare const collectionContract: {
3
3
  getCollections: {
4
- query: z.ZodObject<{
5
- page: z.ZodDefault<z.ZodNumber>;
6
- limit: z.ZodDefault<z.ZodNumber>;
7
- sortBy: z.ZodDefault<z.ZodEnum<["transactionDate", "amount", "status", "createdAt"]>>;
8
- sortOrder: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
9
- startDate: z.ZodOptional<z.ZodString>;
10
- endDate: z.ZodOptional<z.ZodString>;
11
- msisdn: z.ZodOptional<z.ZodString>;
12
- id: z.ZodOptional<z.ZodString>;
13
- reference: z.ZodOptional<z.ZodString>;
14
- accountNo: z.ZodOptional<z.ZodString>;
15
- partnerReference: z.ZodOptional<z.ZodString>;
16
- channel: z.ZodOptional<z.ZodNativeEnum<typeof import("./collection.dtos").COLLECTION_CHANNEL>>;
17
- status: z.ZodOptional<z.ZodNativeEnum<typeof import("./collection.dtos").COLLECTION_STATUS>>;
18
- minAmount: z.ZodOptional<z.ZodNumber>;
19
- maxAmount: z.ZodOptional<z.ZodNumber>;
20
- search: z.ZodOptional<z.ZodString>;
21
- }, "strip", z.ZodTypeAny, {
22
- page: number;
23
- limit: number;
24
- sortBy: "status" | "transactionDate" | "amount" | "createdAt";
25
- sortOrder: "asc" | "desc";
26
- status?: import("./collection.dtos").COLLECTION_STATUS | undefined;
27
- search?: string | undefined;
28
- id?: string | undefined;
29
- accountNo?: string | undefined;
30
- msisdn?: string | undefined;
31
- channel?: import("./collection.dtos").COLLECTION_CHANNEL | undefined;
32
- reference?: string | undefined;
33
- partnerReference?: string | undefined;
34
- startDate?: string | undefined;
35
- endDate?: string | undefined;
36
- minAmount?: number | undefined;
37
- maxAmount?: number | undefined;
38
- }, {
39
- status?: import("./collection.dtos").COLLECTION_STATUS | undefined;
40
- page?: number | undefined;
41
- limit?: number | undefined;
42
- search?: string | undefined;
43
- id?: string | undefined;
44
- accountNo?: string | undefined;
45
- msisdn?: string | undefined;
46
- channel?: import("./collection.dtos").COLLECTION_CHANNEL | undefined;
47
- reference?: string | undefined;
48
- partnerReference?: string | undefined;
49
- sortBy?: "status" | "transactionDate" | "amount" | "createdAt" | undefined;
50
- sortOrder?: "asc" | "desc" | undefined;
51
- startDate?: string | undefined;
52
- endDate?: string | undefined;
53
- minAmount?: number | undefined;
54
- maxAmount?: number | undefined;
55
- }>;
4
+ query: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
56
5
  summary: "List collections";
57
6
  description: "Retrieve a paginated list of collections with optional filtering";
58
7
  method: "GET";
@@ -84,6 +33,7 @@ export declare const collectionContract: {
84
33
  currencyCode: z.ZodDefault<z.ZodString>;
85
34
  }, "strip", z.ZodTypeAny, {
86
35
  status: import("./collection.dtos").COLLECTION_STATUS;
36
+ createdAt: string;
87
37
  id: string;
88
38
  statusMessage: string;
89
39
  accountNo: string;
@@ -94,7 +44,6 @@ export declare const collectionContract: {
94
44
  channel: import("./collection.dtos").COLLECTION_CHANNEL;
95
45
  amount: number;
96
46
  reference: string;
97
- createdAt: string;
98
47
  updatedAt: string;
99
48
  currencyCode: string;
100
49
  serviceFee?: string | undefined;
@@ -107,6 +56,7 @@ export declare const collectionContract: {
107
56
  notes?: string | undefined;
108
57
  }, {
109
58
  status: import("./collection.dtos").COLLECTION_STATUS;
59
+ createdAt: string;
110
60
  id: string;
111
61
  statusMessage: string;
112
62
  accountNo: string;
@@ -117,7 +67,6 @@ export declare const collectionContract: {
117
67
  channel: import("./collection.dtos").COLLECTION_CHANNEL;
118
68
  amount: number;
119
69
  reference: string;
120
- createdAt: string;
121
70
  updatedAt: string;
122
71
  serviceFee?: string | undefined;
123
72
  postedAmount?: string | undefined;
@@ -134,6 +83,7 @@ export declare const collectionContract: {
134
83
  total: number;
135
84
  data: {
136
85
  status: import("./collection.dtos").COLLECTION_STATUS;
86
+ createdAt: string;
137
87
  id: string;
138
88
  statusMessage: string;
139
89
  accountNo: string;
@@ -144,7 +94,6 @@ export declare const collectionContract: {
144
94
  channel: import("./collection.dtos").COLLECTION_CHANNEL;
145
95
  amount: number;
146
96
  reference: string;
147
- createdAt: string;
148
97
  updatedAt: string;
149
98
  currencyCode: string;
150
99
  serviceFee?: string | undefined;
@@ -160,6 +109,7 @@ export declare const collectionContract: {
160
109
  total: number;
161
110
  data: {
162
111
  status: import("./collection.dtos").COLLECTION_STATUS;
112
+ createdAt: string;
163
113
  id: string;
164
114
  statusMessage: string;
165
115
  accountNo: string;
@@ -170,7 +120,6 @@ export declare const collectionContract: {
170
120
  channel: import("./collection.dtos").COLLECTION_CHANNEL;
171
121
  amount: number;
172
122
  reference: string;
173
- createdAt: string;
174
123
  updatedAt: string;
175
124
  serviceFee?: string | undefined;
176
125
  postedAmount?: string | undefined;
@@ -237,6 +186,7 @@ export declare const collectionContract: {
237
186
  currencyCode: z.ZodDefault<z.ZodString>;
238
187
  }, "strip", z.ZodTypeAny, {
239
188
  status: import("./collection.dtos").COLLECTION_STATUS;
189
+ createdAt: string;
240
190
  id: string;
241
191
  statusMessage: string;
242
192
  accountNo: string;
@@ -247,7 +197,6 @@ export declare const collectionContract: {
247
197
  channel: import("./collection.dtos").COLLECTION_CHANNEL;
248
198
  amount: number;
249
199
  reference: string;
250
- createdAt: string;
251
200
  updatedAt: string;
252
201
  currencyCode: string;
253
202
  serviceFee?: string | undefined;
@@ -260,6 +209,7 @@ export declare const collectionContract: {
260
209
  notes?: string | undefined;
261
210
  }, {
262
211
  status: import("./collection.dtos").COLLECTION_STATUS;
212
+ createdAt: string;
263
213
  id: string;
264
214
  statusMessage: string;
265
215
  accountNo: string;
@@ -270,7 +220,6 @@ export declare const collectionContract: {
270
220
  channel: import("./collection.dtos").COLLECTION_CHANNEL;
271
221
  amount: number;
272
222
  reference: string;
273
- createdAt: string;
274
223
  updatedAt: string;
275
224
  serviceFee?: string | undefined;
276
225
  postedAmount?: string | undefined;
@@ -52,6 +52,7 @@ export declare const CollectionDTOSchemas: {
52
52
  currencyCode: z.ZodDefault<z.ZodString>;
53
53
  }, "strip", z.ZodTypeAny, {
54
54
  status: COLLECTION_STATUS;
55
+ createdAt: string;
55
56
  id: string;
56
57
  statusMessage: string;
57
58
  accountNo: string;
@@ -62,7 +63,6 @@ export declare const CollectionDTOSchemas: {
62
63
  channel: COLLECTION_CHANNEL;
63
64
  amount: number;
64
65
  reference: string;
65
- createdAt: string;
66
66
  updatedAt: string;
67
67
  currencyCode: string;
68
68
  serviceFee?: string | undefined;
@@ -75,6 +75,7 @@ export declare const CollectionDTOSchemas: {
75
75
  notes?: string | undefined;
76
76
  }, {
77
77
  status: COLLECTION_STATUS;
78
+ createdAt: string;
78
79
  id: string;
79
80
  statusMessage: string;
80
81
  accountNo: string;
@@ -85,7 +86,6 @@ export declare const CollectionDTOSchemas: {
85
86
  channel: COLLECTION_CHANNEL;
86
87
  amount: number;
87
88
  reference: string;
88
- createdAt: string;
89
89
  updatedAt: string;
90
90
  serviceFee?: string | undefined;
91
91
  postedAmount?: string | undefined;
@@ -100,7 +100,7 @@ export declare const CollectionDTOSchemas: {
100
100
  collectionQueryParams: z.ZodObject<{
101
101
  page: z.ZodDefault<z.ZodNumber>;
102
102
  limit: z.ZodDefault<z.ZodNumber>;
103
- sortBy: z.ZodDefault<z.ZodEnum<["transactionDate", "amount", "status", "createdAt"]>>;
103
+ sortBy: z.ZodDefault<z.ZodString>;
104
104
  sortOrder: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
105
105
  startDate: z.ZodOptional<z.ZodString>;
106
106
  endDate: z.ZodOptional<z.ZodString>;
@@ -117,9 +117,11 @@ export declare const CollectionDTOSchemas: {
117
117
  }, "strip", z.ZodTypeAny, {
118
118
  page: number;
119
119
  limit: number;
120
- sortBy: "status" | "transactionDate" | "amount" | "createdAt";
120
+ sortBy: string;
121
121
  sortOrder: "asc" | "desc";
122
122
  status?: COLLECTION_STATUS | undefined;
123
+ startDate?: string | undefined;
124
+ endDate?: string | undefined;
123
125
  search?: string | undefined;
124
126
  id?: string | undefined;
125
127
  accountNo?: string | undefined;
@@ -127,12 +129,12 @@ export declare const CollectionDTOSchemas: {
127
129
  channel?: COLLECTION_CHANNEL | undefined;
128
130
  reference?: string | undefined;
129
131
  partnerReference?: string | undefined;
130
- startDate?: string | undefined;
131
- endDate?: string | undefined;
132
132
  minAmount?: number | undefined;
133
133
  maxAmount?: number | undefined;
134
134
  }, {
135
135
  status?: COLLECTION_STATUS | undefined;
136
+ startDate?: string | undefined;
137
+ endDate?: string | undefined;
136
138
  page?: number | undefined;
137
139
  limit?: number | undefined;
138
140
  search?: string | undefined;
@@ -142,10 +144,8 @@ export declare const CollectionDTOSchemas: {
142
144
  channel?: COLLECTION_CHANNEL | undefined;
143
145
  reference?: string | undefined;
144
146
  partnerReference?: string | undefined;
145
- sortBy?: "status" | "transactionDate" | "amount" | "createdAt" | undefined;
147
+ sortBy?: string | undefined;
146
148
  sortOrder?: "asc" | "desc" | undefined;
147
- startDate?: string | undefined;
148
- endDate?: string | undefined;
149
149
  minAmount?: number | undefined;
150
150
  maxAmount?: number | undefined;
151
151
  }>;
@@ -4,6 +4,9 @@ import { COLLECTION_STATUS, COLLECTION_CHANNEL, CollectionQueryParamsDTO } from
4
4
  * Specialized query builder for collection queries
5
5
  */
6
6
  export declare class CollectionQueryBuilder extends QueryBuilder {
7
+ static create(): CollectionQueryBuilder;
8
+ static forCollections(): CollectionQueryBuilder;
9
+ static fromDTO(dto: CollectionQueryParamsDTO): CollectionQueryBuilder;
7
10
  whereStatus(status: COLLECTION_STATUS): this;
8
11
  whereChannel(channel: COLLECTION_CHANNEL): this;
9
12
  wherePending(): this;
@@ -14,5 +17,11 @@ export declare class CollectionQueryBuilder extends QueryBuilder {
14
17
  whereAccount(accountNo: string): this;
15
18
  whereReference(reference: string): this;
16
19
  wherePartnerReference(partnerReference: string): this;
20
+ whereSearch(searchTerm: string): this;
17
21
  toCollectionQuery(): CollectionQueryParamsDTO;
22
+ private extractFilterValues;
23
+ private extractSortField;
24
+ private extractSortOrder;
25
+ private isValidChannel;
26
+ private isValidStatus;
18
27
  }
@@ -4,7 +4,7 @@ export declare const payoutContract: {
4
4
  query: z.ZodObject<{
5
5
  page: z.ZodDefault<z.ZodNumber>;
6
6
  limit: z.ZodDefault<z.ZodNumber>;
7
- sortBy: z.ZodDefault<z.ZodEnum<["transactionDate", "amount", "statusCodeText", "createdAt"]>>;
7
+ sortBy: z.ZodDefault<z.ZodString>;
8
8
  sortOrder: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
9
9
  startDate: z.ZodOptional<z.ZodString>;
10
10
  endDate: z.ZodOptional<z.ZodString>;
@@ -19,30 +19,30 @@ export declare const payoutContract: {
19
19
  }, "strip", z.ZodTypeAny, {
20
20
  page: number;
21
21
  limit: number;
22
- sortBy: "transactionDate" | "amount" | "createdAt" | "statusCodeText";
22
+ sortBy: string;
23
23
  sortOrder: "asc" | "desc";
24
24
  status?: import("./payout.dtos").PAYOUT_STATUS | undefined;
25
+ startDate?: string | undefined;
26
+ endDate?: string | undefined;
25
27
  search?: string | undefined;
26
28
  id?: string | undefined;
27
29
  msisdn?: string | undefined;
28
30
  channel?: import("./payout.dtos").MOBILE_PAYOUT_CHANNEL | import("./payout.dtos").BANK_PAYOUT_CHANNEL | undefined;
29
- startDate?: string | undefined;
30
- endDate?: string | undefined;
31
31
  minAmount?: number | undefined;
32
32
  maxAmount?: number | undefined;
33
33
  ref?: string | undefined;
34
34
  }, {
35
35
  status?: import("./payout.dtos").PAYOUT_STATUS | undefined;
36
+ startDate?: string | undefined;
37
+ endDate?: string | undefined;
36
38
  page?: number | undefined;
37
39
  limit?: number | undefined;
38
40
  search?: string | undefined;
39
41
  id?: string | undefined;
40
42
  msisdn?: string | undefined;
41
43
  channel?: import("./payout.dtos").MOBILE_PAYOUT_CHANNEL | import("./payout.dtos").BANK_PAYOUT_CHANNEL | undefined;
42
- sortBy?: "transactionDate" | "amount" | "createdAt" | "statusCodeText" | undefined;
44
+ sortBy?: string | undefined;
43
45
  sortOrder?: "asc" | "desc" | undefined;
44
- startDate?: string | undefined;
45
- endDate?: string | undefined;
46
46
  minAmount?: number | undefined;
47
47
  maxAmount?: number | undefined;
48
48
  ref?: string | undefined;
@@ -84,13 +84,13 @@ export declare const payoutContract: {
84
84
  updatedAt: z.ZodOptional<z.ZodString>;
85
85
  }, "strip", z.ZodTypeAny, {
86
86
  statusCode: string;
87
+ createdAt: string;
87
88
  id: string;
88
89
  transactionDate: string;
89
90
  narration: string;
90
91
  msisdn: string;
91
92
  amount: number;
92
93
  transactionId: string;
93
- createdAt: string;
94
94
  currencyCode: string;
95
95
  statusCodeText: import("./payout.dtos").PAYOUT_STATUS;
96
96
  statusDescription: string;
@@ -113,13 +113,13 @@ export declare const payoutContract: {
113
113
  isReconciled?: number | undefined;
114
114
  }, {
115
115
  statusCode: string;
116
+ createdAt: string;
116
117
  id: string;
117
118
  transactionDate: string;
118
119
  narration: string;
119
120
  msisdn: string;
120
121
  amount: number;
121
122
  transactionId: string;
122
- createdAt: string;
123
123
  currencyCode: string;
124
124
  statusCodeText: import("./payout.dtos").PAYOUT_STATUS;
125
125
  statusDescription: string;
@@ -146,13 +146,13 @@ export declare const payoutContract: {
146
146
  total: number;
147
147
  data: {
148
148
  statusCode: string;
149
+ createdAt: string;
149
150
  id: string;
150
151
  transactionDate: string;
151
152
  narration: string;
152
153
  msisdn: string;
153
154
  amount: number;
154
155
  transactionId: string;
155
- createdAt: string;
156
156
  currencyCode: string;
157
157
  statusCodeText: import("./payout.dtos").PAYOUT_STATUS;
158
158
  statusDescription: string;
@@ -178,13 +178,13 @@ export declare const payoutContract: {
178
178
  total: number;
179
179
  data: {
180
180
  statusCode: string;
181
+ createdAt: string;
181
182
  id: string;
182
183
  transactionDate: string;
183
184
  narration: string;
184
185
  msisdn: string;
185
186
  amount: number;
186
187
  transactionId: string;
187
- createdAt: string;
188
188
  currencyCode: string;
189
189
  statusCodeText: import("./payout.dtos").PAYOUT_STATUS;
190
190
  statusDescription: string;
@@ -267,13 +267,13 @@ export declare const payoutContract: {
267
267
  updatedAt: z.ZodOptional<z.ZodString>;
268
268
  }, "strip", z.ZodTypeAny, {
269
269
  statusCode: string;
270
+ createdAt: string;
270
271
  id: string;
271
272
  transactionDate: string;
272
273
  narration: string;
273
274
  msisdn: string;
274
275
  amount: number;
275
276
  transactionId: string;
276
- createdAt: string;
277
277
  currencyCode: string;
278
278
  statusCodeText: import("./payout.dtos").PAYOUT_STATUS;
279
279
  statusDescription: string;
@@ -296,13 +296,13 @@ export declare const payoutContract: {
296
296
  isReconciled?: number | undefined;
297
297
  }, {
298
298
  statusCode: string;
299
+ createdAt: string;
299
300
  id: string;
300
301
  transactionDate: string;
301
302
  narration: string;
302
303
  msisdn: string;
303
304
  amount: number;
304
305
  transactionId: string;
305
- createdAt: string;
306
306
  currencyCode: string;
307
307
  statusCodeText: import("./payout.dtos").PAYOUT_STATUS;
308
308
  statusDescription: string;
@@ -54,13 +54,13 @@ export declare const PayoutDTOSchemas: {
54
54
  updatedAt: z.ZodOptional<z.ZodString>;
55
55
  }, "strip", z.ZodTypeAny, {
56
56
  statusCode: string;
57
+ createdAt: string;
57
58
  id: string;
58
59
  transactionDate: string;
59
60
  narration: string;
60
61
  msisdn: string;
61
62
  amount: number;
62
63
  transactionId: string;
63
- createdAt: string;
64
64
  currencyCode: string;
65
65
  statusCodeText: PAYOUT_STATUS;
66
66
  statusDescription: string;
@@ -83,13 +83,13 @@ export declare const PayoutDTOSchemas: {
83
83
  isReconciled?: number | undefined;
84
84
  }, {
85
85
  statusCode: string;
86
+ createdAt: string;
86
87
  id: string;
87
88
  transactionDate: string;
88
89
  narration: string;
89
90
  msisdn: string;
90
91
  amount: number;
91
92
  transactionId: string;
92
- createdAt: string;
93
93
  currencyCode: string;
94
94
  statusCodeText: PAYOUT_STATUS;
95
95
  statusDescription: string;
@@ -114,7 +114,7 @@ export declare const PayoutDTOSchemas: {
114
114
  payoutQueryParams: z.ZodObject<{
115
115
  page: z.ZodDefault<z.ZodNumber>;
116
116
  limit: z.ZodDefault<z.ZodNumber>;
117
- sortBy: z.ZodDefault<z.ZodEnum<["transactionDate", "amount", "statusCodeText", "createdAt"]>>;
117
+ sortBy: z.ZodDefault<z.ZodString>;
118
118
  sortOrder: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
119
119
  startDate: z.ZodOptional<z.ZodString>;
120
120
  endDate: z.ZodOptional<z.ZodString>;
@@ -129,30 +129,30 @@ export declare const PayoutDTOSchemas: {
129
129
  }, "strip", z.ZodTypeAny, {
130
130
  page: number;
131
131
  limit: number;
132
- sortBy: "transactionDate" | "amount" | "createdAt" | "statusCodeText";
132
+ sortBy: string;
133
133
  sortOrder: "asc" | "desc";
134
134
  status?: PAYOUT_STATUS | undefined;
135
+ startDate?: string | undefined;
136
+ endDate?: string | undefined;
135
137
  search?: string | undefined;
136
138
  id?: string | undefined;
137
139
  msisdn?: string | undefined;
138
140
  channel?: MOBILE_PAYOUT_CHANNEL | BANK_PAYOUT_CHANNEL | undefined;
139
- startDate?: string | undefined;
140
- endDate?: string | undefined;
141
141
  minAmount?: number | undefined;
142
142
  maxAmount?: number | undefined;
143
143
  ref?: string | undefined;
144
144
  }, {
145
145
  status?: PAYOUT_STATUS | undefined;
146
+ startDate?: string | undefined;
147
+ endDate?: string | undefined;
146
148
  page?: number | undefined;
147
149
  limit?: number | undefined;
148
150
  search?: string | undefined;
149
151
  id?: string | undefined;
150
152
  msisdn?: string | undefined;
151
153
  channel?: MOBILE_PAYOUT_CHANNEL | BANK_PAYOUT_CHANNEL | undefined;
152
- sortBy?: "transactionDate" | "amount" | "createdAt" | "statusCodeText" | undefined;
154
+ sortBy?: string | undefined;
153
155
  sortOrder?: "asc" | "desc" | undefined;
154
- startDate?: string | undefined;
155
- endDate?: string | undefined;
156
156
  minAmount?: number | undefined;
157
157
  maxAmount?: number | undefined;
158
158
  ref?: string | undefined;
@@ -4,6 +4,8 @@ import { PAYOUT_STATUS, PAYOUT_CHANNEL, PayoutQueryParamsDTO } from "./payout.dt
4
4
  * Specialized query builder for payout queries
5
5
  */
6
6
  export declare class PayoutQueryBuilder extends QueryBuilder {
7
+ static create(): PayoutQueryBuilder;
8
+ static fromDTO(dto: PayoutQueryParamsDTO): PayoutQueryBuilder;
7
9
  whereStatus(status: PAYOUT_STATUS): this;
8
10
  whereChannel(channel: PAYOUT_CHANNEL): this;
9
11
  wherePending(): this;
@@ -11,5 +13,13 @@ export declare class PayoutQueryBuilder extends QueryBuilder {
11
13
  whereFailed(): this;
12
14
  whereAmountBetween(min: number, max: number): this;
13
15
  whereRecipient(msisdn: string): this;
16
+ whereReference(ref: string): this;
17
+ whereSearch(searchTerm: string): this;
14
18
  toPayoutQuery(): PayoutQueryParamsDTO;
19
+ private extractFilterValues;
20
+ private extractSortField;
21
+ private extractSortOrder;
22
+ private isValidChannel;
23
+ private isValidStatus;
24
+ static forPayouts(): PayoutQueryBuilder;
15
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@temboplus/tembo-dashboard",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "A foundational library for Temboplus-Dashboard projects providing type-safe data layer abstraction with API contracts, domain models, and repositories.",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.esm.js",