@temboplus/afloat 0.1.76-beta.0 → 0.1.77-beta.10

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.
Files changed (44) hide show
  1. package/dist/index.cjs.js +1 -1
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.d.ts +1 -1
  4. package/dist/index.esm.js +1 -1
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/lib/error/error.permission.d.ts +1 -1
  7. package/dist/modules/auth/auth.contract.d.ts +6 -6
  8. package/dist/modules/auth/auth.manager.d.ts +1 -1
  9. package/dist/modules/auth/company-membership.model.d.ts +171 -0
  10. package/dist/modules/auth/index.d.ts +1 -1
  11. package/dist/modules/auth/user.model.d.ts +330 -33
  12. package/dist/modules/contact/contact-info.model.d.ts +183 -533
  13. package/dist/modules/contact/contact.api-contract.d.ts +16 -16
  14. package/dist/modules/contact/contact.dtos.d.ts +4 -4
  15. package/dist/modules/contact/contact.model.d.ts +309 -32
  16. package/dist/modules/login/index.d.ts +2 -0
  17. package/dist/modules/login/login.api-contract.d.ts +34 -5
  18. package/dist/modules/login/login.dtos.d.ts +85 -0
  19. package/dist/modules/login/login.model.d.ts +168 -1
  20. package/dist/modules/{auth → login}/permission.type.d.ts +8 -8
  21. package/dist/modules/payout/payout.api-contract.d.ts +46 -46
  22. package/dist/modules/payout/payout.dtos.d.ts +30 -24
  23. package/dist/modules/payout/payout.model.d.ts +242 -2
  24. package/dist/modules/payout/payout.query.d.ts +7 -0
  25. package/dist/modules/profile/profile.model.d.ts +65 -30
  26. package/dist/modules/team-member/index.d.ts +4 -0
  27. package/dist/modules/team-member/role.model.d.ts +61 -0
  28. package/dist/modules/{user/user.contract.d.ts → team-member/team-member.contract.d.ts} +238 -127
  29. package/dist/modules/team-member/team-member.dtos.d.ts +261 -0
  30. package/dist/modules/team-member/team-member.model.d.ts +237 -0
  31. package/dist/modules/team-member/team-member.repository.d.ts +179 -0
  32. package/dist/modules/wallet/narration.model.d.ts +34 -38
  33. package/dist/modules/wallet/statement-entry.model.d.ts +172 -73
  34. package/dist/modules/wallet/wallet.contract.d.ts +4 -4
  35. package/dist/modules/wallet/wallet.dtos.d.ts +8 -8
  36. package/dist/modules/wallet/wallet.model.d.ts +56 -19
  37. package/dist/modules/wallet/wallet.query.d.ts +95 -0
  38. package/dist/modules/wallet/wallet.repository.d.ts +45 -13
  39. package/package.json +2 -2
  40. package/dist/modules/user/index.d.ts +0 -4
  41. package/dist/modules/user/role.model.d.ts +0 -13
  42. package/dist/modules/user/user.dtos.d.ts +0 -145
  43. package/dist/modules/user/user.model.d.ts +0 -108
  44. package/dist/modules/user/user.repository.d.ts +0 -179
@@ -1,4 +1,5 @@
1
1
  import { ContactInfo, MobileContactInfo, BankContactInfo } from "../contact/contact-info.model.js";
2
+ import z from "zod";
2
3
  /** Prefix for Ecobank mobile transfer narrations */
3
4
  export declare const ECOBANK_PREFIX = "MOBILE TRANSFER ";
4
5
  /** V2 format prefix for payout narrations using contact details */
@@ -12,12 +13,19 @@ export declare const MOBILE_NARR_PREFIX: string;
12
13
  /** Legacy format prefix for mobile money payout narrations */
13
14
  export declare const LEGACY_MOBILE_NARR_PREFIX: string;
14
15
  /**
15
- * Interface for the JSON representation of Narration
16
+ * Zod schema for Narration JSON serialization
16
17
  */
17
- export interface NarrationJson {
18
+ export declare const NarrationJSONSchema: z.ZodObject<{
19
+ text: z.ZodString;
20
+ version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
21
+ }, "strip", z.ZodTypeAny, {
22
+ version: string;
18
23
  text: string;
19
- version?: string;
20
- }
24
+ }, {
25
+ text: string;
26
+ version?: string | undefined;
27
+ }>;
28
+ export type NarrationJSON = z.infer<typeof NarrationJSONSchema>;
21
29
  /**
22
30
  * Handles payout narration generation and parsing for the Afloat platform.
23
31
  *
@@ -184,46 +192,34 @@ export declare class Narration {
184
192
  */
185
193
  getMobileContactDetails: () => MobileContactInfo | undefined;
186
194
  /**
187
- * Serializes the Narration instance to a JSON-compatible object.
188
- *
189
- * @returns {NarrationJson} A plain object containing the narration data
195
+ * Type guard to check if an unknown object is a valid Narration instance.
190
196
  *
191
- * @example
192
- * ```typescript
193
- * const narration = new Narration("PAYOUT +255123456789 JOHN DOE");
194
- * const json = narration.toJson();
195
- * // Returns: { text: "PAYOUT +255123456789 JOHN DOE", version: "2.0" }
196
- * ```
197
+ * @param obj - The object to check
198
+ * @returns Type predicate indicating if the object is a Narration instance
197
199
  */
198
- toJson(): NarrationJson;
200
+ static is(obj: unknown): obj is Narration;
199
201
  /**
200
- * Creates a Narration instance from a JSON-compatible object.
201
- *
202
- * @param {NarrationJson | string} json - Either a NarrationJson object or a JSON string
203
- * @returns {Narration | undefined} A Narration instance if valid, undefined otherwise
204
- *
205
- * @example
206
- * ```typescript
207
- * // From object
208
- * const narration = Narration.fromJson({ text: "PAYOUT +255123456789 JOHN DOE" });
209
- *
210
- * // From JSON string
211
- * const narration = Narration.fromJson('{"text":"PAYOUT +255123456789 JOHN DOE"}');
212
- * ```
202
+ * Serializes the Narration instance to a JSON-compatible object
203
+ */
204
+ toJSON(): NarrationJSON;
205
+ /**
206
+ * Serializes the Narration instance to a JSON string
213
207
  */
214
- static fromJson(json: NarrationJson | string): Narration | undefined;
208
+ toJSONString(): string;
215
209
  /**
216
- * Type guard to check if an object is a valid NarrationJson
217
- *
218
- * @param obj - The object to validate
219
- * @returns True if the object conforms to NarrationJson structure
210
+ * Creates a Narration instance from a JSON-compatible object or string
220
211
  */
221
- static isNarrationJson(obj: unknown): obj is NarrationJson;
212
+ static fromJSON(json: NarrationJSON | string): Narration | undefined;
222
213
  /**
223
- * Type guard to check if an unknown object is a valid Narration instance.
224
- *
225
- * @param obj - The object to check
226
- * @returns Type predicate indicating if the object is a Narration instance
214
+ * Type guard using Zod schema validation
227
215
  */
228
- static is(obj: unknown): obj is Narration;
216
+ static isNarrationJSON(obj: unknown): obj is NarrationJSON;
217
+ /**
218
+ * @deprecated Use toJSON() instead
219
+ */
220
+ toJson(): NarrationJSON;
221
+ /**
222
+ * @deprecated Use fromJSON() instead
223
+ */
224
+ static fromJson(json: NarrationJSON | string): Narration | undefined;
229
225
  }
@@ -1,22 +1,137 @@
1
- import { WalletStatementEntryDTO } from "@/modules/wallet/wallet.dtos.js";
2
- import { Amount, AmountJson } from "@temboplus/frontend-core";
3
- import { NarrationJson, Narration } from "./narration.model.js";
1
+ import { Amount } from "@temboplus/frontend-core";
2
+ import { Narration } from "./narration.model.js";
3
+ import z from "zod";
4
4
  /**
5
- * Interface for the JSON representation of WalletStatementEntry
5
+ * Zod schema for WalletStatementEntry JSON serialization
6
6
  */
7
- export interface WalletStatementEntryJson {
8
- accountNo?: string;
7
+ export declare const WalletStatementEntryJSONSchema: z.ZodObject<{
8
+ accountNo: z.ZodOptional<z.ZodString>;
9
+ debitOrCredit: z.ZodString;
10
+ tranRefNo: z.ZodString;
11
+ narration: z.ZodObject<{
12
+ text: z.ZodString;
13
+ version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
14
+ }, "strip", z.ZodTypeAny, {
15
+ version: string;
16
+ text: string;
17
+ }, {
18
+ text: string;
19
+ version?: string | undefined;
20
+ }>;
21
+ txnDate: z.ZodString;
22
+ valueDate: z.ZodString;
23
+ amountCredited: z.ZodObject<{
24
+ value: z.ZodNumber;
25
+ text: z.ZodString;
26
+ currencyCode: z.ZodString;
27
+ version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ version: string;
30
+ value: number;
31
+ text: string;
32
+ currencyCode: string;
33
+ }, {
34
+ value: number;
35
+ text: string;
36
+ currencyCode: string;
37
+ version?: string | undefined;
38
+ }>;
39
+ amountDebited: z.ZodObject<{
40
+ value: z.ZodNumber;
41
+ text: z.ZodString;
42
+ currencyCode: z.ZodString;
43
+ version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
44
+ }, "strip", z.ZodTypeAny, {
45
+ version: string;
46
+ value: number;
47
+ text: string;
48
+ currencyCode: string;
49
+ }, {
50
+ value: number;
51
+ text: string;
52
+ currencyCode: string;
53
+ version?: string | undefined;
54
+ }>;
55
+ balance: z.ZodObject<{
56
+ value: z.ZodNumber;
57
+ text: z.ZodString;
58
+ currencyCode: z.ZodString;
59
+ version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
60
+ }, "strip", z.ZodTypeAny, {
61
+ version: string;
62
+ value: number;
63
+ text: string;
64
+ currencyCode: string;
65
+ }, {
66
+ value: number;
67
+ text: string;
68
+ currencyCode: string;
69
+ version?: string | undefined;
70
+ }>;
71
+ currencyCode: z.ZodString;
72
+ version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
73
+ }, "strip", z.ZodTypeAny, {
74
+ version: string;
75
+ currencyCode: string;
9
76
  debitOrCredit: string;
10
77
  tranRefNo: string;
11
- narration: NarrationJson;
78
+ narration: {
79
+ version: string;
80
+ text: string;
81
+ };
12
82
  txnDate: string;
13
83
  valueDate: string;
14
- amountCredited: AmountJson;
15
- amountDebited: AmountJson;
16
- balance: AmountJson;
84
+ amountCredited: {
85
+ version: string;
86
+ value: number;
87
+ text: string;
88
+ currencyCode: string;
89
+ };
90
+ amountDebited: {
91
+ version: string;
92
+ value: number;
93
+ text: string;
94
+ currencyCode: string;
95
+ };
96
+ balance: {
97
+ version: string;
98
+ value: number;
99
+ text: string;
100
+ currencyCode: string;
101
+ };
102
+ accountNo?: string | undefined;
103
+ }, {
17
104
  currencyCode: string;
18
- version?: string;
19
- }
105
+ debitOrCredit: string;
106
+ tranRefNo: string;
107
+ narration: {
108
+ text: string;
109
+ version?: string | undefined;
110
+ };
111
+ txnDate: string;
112
+ valueDate: string;
113
+ amountCredited: {
114
+ value: number;
115
+ text: string;
116
+ currencyCode: string;
117
+ version?: string | undefined;
118
+ };
119
+ amountDebited: {
120
+ value: number;
121
+ text: string;
122
+ currencyCode: string;
123
+ version?: string | undefined;
124
+ };
125
+ balance: {
126
+ value: number;
127
+ text: string;
128
+ currencyCode: string;
129
+ version?: string | undefined;
130
+ };
131
+ accountNo?: string | undefined;
132
+ version?: string | undefined;
133
+ }>;
134
+ export type WalletStatementEntryJSON = z.infer<typeof WalletStatementEntryJSONSchema>;
20
135
  /**
21
136
  * Represents a single entry in a Wallet's statement history.
22
137
  *
@@ -38,18 +153,18 @@ export declare class WalletStatementEntry {
38
153
  /**
39
154
  * Gets the statement entry schema used for validation.
40
155
  */
41
- static get schema(): import("zod").ZodObject<{
42
- accountNo: import("zod").ZodEffects<import("zod").ZodOptional<import("zod").ZodString>, string | undefined, string | undefined>;
43
- debitOrCredit: import("zod").ZodString;
44
- tranRefNo: import("zod").ZodString;
45
- narration: import("zod").ZodString;
46
- txnDate: import("zod").ZodDate;
47
- valueDate: import("zod").ZodDate;
48
- amountCredited: import("zod").ZodNumber;
49
- amountDebited: import("zod").ZodNumber;
50
- balance: import("zod").ZodNumber;
51
- currencyCode: import("zod").ZodDefault<import("zod").ZodEffects<import("zod").ZodOptional<import("zod").ZodString>, string | undefined, string | undefined>>;
52
- }, "strip", import("zod").ZodTypeAny, {
156
+ static get schema(): z.ZodObject<{
157
+ accountNo: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
158
+ debitOrCredit: z.ZodString;
159
+ tranRefNo: z.ZodString;
160
+ narration: z.ZodString;
161
+ txnDate: z.ZodDate;
162
+ valueDate: z.ZodDate;
163
+ amountCredited: z.ZodNumber;
164
+ amountDebited: z.ZodNumber;
165
+ balance: z.ZodNumber;
166
+ currencyCode: z.ZodDefault<z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>>;
167
+ }, "strip", z.ZodTypeAny, {
53
168
  currencyCode: string;
54
169
  debitOrCredit: string;
55
170
  tranRefNo: string;
@@ -108,28 +223,6 @@ export declare class WalletStatementEntry {
108
223
  get amountDebited(): Amount;
109
224
  get balance(): Amount;
110
225
  get currencyCode(): string;
111
- /**
112
- * Serializes the WalletStatementEntry instance to a JSON-compatible object.
113
- * Dates are converted to ISO strings, amounts are serialized using Amount.toJson(),
114
- * and narration is serialized using Narration.toJson().
115
- *
116
- * @returns {WalletStatementEntryJson} A plain object containing all necessary data
117
- */
118
- toJson(): WalletStatementEntryJson;
119
- /**
120
- * Creates a WalletStatementEntry instance from a JSON-compatible object.
121
- *
122
- * @param {WalletStatementEntryJson | string} json - Either a WalletStatementEntryJson object or a JSON string
123
- * @returns {WalletStatementEntry | undefined} A WalletStatementEntry instance if valid, undefined otherwise
124
- */
125
- static fromJson(json: WalletStatementEntryJson | string): WalletStatementEntry | undefined;
126
- /**
127
- * Type guard to check if an object is a valid WalletStatementEntryJson
128
- *
129
- * @param obj - The object to validate
130
- * @returns True if the object conforms to WalletStatementEntryJson structure
131
- */
132
- static isWalletStatementEntryJson(obj: unknown): obj is WalletStatementEntryJson;
133
226
  /**
134
227
  * Validates the current statement entry instance data against the schema.
135
228
  * @returns True if the statement entry instance data is valid, false otherwise.
@@ -159,42 +252,48 @@ export declare class WalletStatementEntry {
159
252
  */
160
253
  toString(): string;
161
254
  /**
162
- * Serializes an array of WalletStatementEntry instances to JSON-compatible objects
163
- *
164
- * @param entries - Array of WalletStatementEntry instances to serialize
165
- * @returns Array of WalletStatementEntryJson objects
255
+ * Legacy method for backwards compatibility - creates from plain object
256
+ * @deprecated Use fromJson() for serialized data or create() for raw data
166
257
  */
167
- static toJsonArray(entries: WalletStatementEntry[]): WalletStatementEntryJson[];
258
+ static from(data: any): WalletStatementEntry | undefined;
168
259
  /**
169
- * Creates WalletStatementEntry instances from an array of JSON-compatible objects
170
- *
171
- * @param jsonArray - Array of WalletStatementEntryJson objects or JSON string
172
- * @returns Array of WalletStatementEntry instances (invalid items are filtered out)
260
+ * Serializes the WalletStatementEntry instance to a JSON-compatible object
261
+ */
262
+ toJSON(): WalletStatementEntryJSON;
263
+ /**
264
+ * Serializes the WalletStatementEntry instance to a JSON string
173
265
  */
174
- static fromJsonArray(jsonArray: WalletStatementEntryJson[] | string): WalletStatementEntry[];
266
+ toJSONString(): string;
175
267
  /**
176
- * Legacy method for backwards compatibility - creates object representation
177
- * @deprecated Use toJson() instead for proper serialization
268
+ * Creates a WalletStatementEntry instance from a JSON-compatible object or string
178
269
  */
179
- toObject(): Omit<WalletStatementEntryDTO, "amountCredited" | "amountDebited" | "balance" | "narration"> & {
180
- amountCredited: AmountJson;
181
- amountDebited: AmountJson;
182
- balance: AmountJson;
183
- narration: string;
184
- };
270
+ static fromJSON(json: WalletStatementEntryJSON | string): WalletStatementEntry | undefined;
185
271
  /**
186
- * Legacy method for backwards compatibility - converts to JSON string
187
- * @deprecated Use JSON.stringify(entry.toJson()) instead
272
+ * Type guard using Zod schema validation
188
273
  */
189
- toJSON(): string;
274
+ static isWalletStatementEntryJSON(obj: unknown): obj is WalletStatementEntryJSON;
190
275
  /**
191
- * Legacy method for backwards compatibility
192
- * @deprecated Use fromJson() instead
276
+ * Creates WalletStatementEntry instances from a JSON array
193
277
  */
194
- static fromJSON(jsonString: string): WalletStatementEntry | undefined;
278
+ static fromJSONArray(jsonArray: WalletStatementEntryJSON[] | string): WalletStatementEntry[];
195
279
  /**
196
- * Legacy method for backwards compatibility - creates from plain object
197
- * @deprecated Use fromJson() for serialized data or create() for raw data
280
+ * Serializes an array of WalletStatementEntry instances to JSON
198
281
  */
199
- static from(data: any): WalletStatementEntry | undefined;
282
+ static toJSONArray(entries: WalletStatementEntry[]): WalletStatementEntryJSON[];
283
+ /**
284
+ * @deprecated Use toJSON() instead
285
+ */
286
+ toJson(): WalletStatementEntryJSON;
287
+ /**
288
+ * @deprecated Use fromJSON() instead
289
+ */
290
+ static fromJson(json: WalletStatementEntryJSON | string): WalletStatementEntry | undefined;
291
+ /**
292
+ * @deprecated Use fromJSONArray() instead
293
+ */
294
+ static fromJsonArray(jsonArray: WalletStatementEntryJSON[] | string): WalletStatementEntry[];
295
+ /**
296
+ * @deprecated Use toJSONArray() instead
297
+ */
298
+ static toJsonArray(entries: WalletStatementEntry[]): WalletStatementEntryJSON[];
200
299
  }
@@ -42,21 +42,21 @@ export declare const contract: {
42
42
  }, "strip", z.ZodTypeAny, {
43
43
  id: string;
44
44
  accountNo: string;
45
- createdAt: string;
46
45
  profileId: string;
46
+ createdAt: string;
47
+ updatedAt: string;
47
48
  accountName: string;
48
49
  channel: string;
49
50
  countryCode: import("@temboplus/frontend-core").ISO2CountryCode;
50
51
  currencyCode: import("@temboplus/frontend-core").CurrencyCode;
51
- updatedAt: string;
52
52
  }, {
53
53
  id: string;
54
54
  accountNo: string;
55
- createdAt: string;
56
55
  profileId: string;
56
+ createdAt: string;
57
+ updatedAt: string;
57
58
  accountName: string;
58
59
  channel: string;
59
- updatedAt: string;
60
60
  countryCode?: string | undefined;
61
61
  currencyCode?: string | undefined;
62
62
  }>, "many">;
@@ -17,21 +17,21 @@ declare const walletSchema: z.ZodObject<{
17
17
  }, "strip", z.ZodTypeAny, {
18
18
  id: string;
19
19
  accountNo: string;
20
- createdAt: string;
21
20
  profileId: string;
21
+ createdAt: string;
22
+ updatedAt: string;
22
23
  accountName: string;
23
24
  channel: string;
24
25
  countryCode: import("@temboplus/frontend-core").ISO2CountryCode;
25
26
  currencyCode: import("@temboplus/frontend-core").CurrencyCode;
26
- updatedAt: string;
27
27
  }, {
28
28
  id: string;
29
29
  accountNo: string;
30
- createdAt: string;
31
30
  profileId: string;
31
+ createdAt: string;
32
+ updatedAt: string;
32
33
  accountName: string;
33
34
  channel: string;
34
- updatedAt: string;
35
35
  countryCode?: string | undefined;
36
36
  currencyCode?: string | undefined;
37
37
  }>;
@@ -120,21 +120,21 @@ export declare const WalletDTOSchemas: {
120
120
  }, "strip", z.ZodTypeAny, {
121
121
  id: string;
122
122
  accountNo: string;
123
- createdAt: string;
124
123
  profileId: string;
124
+ createdAt: string;
125
+ updatedAt: string;
125
126
  accountName: string;
126
127
  channel: string;
127
128
  countryCode: import("@temboplus/frontend-core").ISO2CountryCode;
128
129
  currencyCode: import("@temboplus/frontend-core").CurrencyCode;
129
- updatedAt: string;
130
130
  }, {
131
131
  id: string;
132
132
  accountNo: string;
133
- createdAt: string;
134
133
  profileId: string;
134
+ createdAt: string;
135
+ updatedAt: string;
135
136
  accountName: string;
136
137
  channel: string;
137
- updatedAt: string;
138
138
  countryCode?: string | undefined;
139
139
  currencyCode?: string | undefined;
140
140
  }>;
@@ -1,5 +1,44 @@
1
1
  import { type CurrencyCode, type ISO2CountryCode } from "@temboplus/frontend-core";
2
- import { WalletDTO, WalletDTOSchemas } from "@/modules/wallet/wallet.dtos.js";
2
+ import { WalletDTOSchemas } from "@/modules/wallet/wallet.dtos.js";
3
+ import z from "zod";
4
+ /**
5
+ * Zod schema for Wallet JSON serialization
6
+ */
7
+ export declare const WalletJSONSchema: z.ZodObject<{
8
+ id: z.ZodString;
9
+ profileId: z.ZodString;
10
+ accountNo: z.ZodString;
11
+ accountName: z.ZodString;
12
+ channel: z.ZodString;
13
+ countryCode: z.ZodString;
14
+ currencyCode: z.ZodString;
15
+ createdAt: z.ZodString;
16
+ updatedAt: z.ZodString;
17
+ version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ id: string;
20
+ accountNo: string;
21
+ version: string;
22
+ profileId: string;
23
+ createdAt: string;
24
+ updatedAt: string;
25
+ accountName: string;
26
+ channel: string;
27
+ countryCode: string;
28
+ currencyCode: string;
29
+ }, {
30
+ id: string;
31
+ accountNo: string;
32
+ profileId: string;
33
+ createdAt: string;
34
+ updatedAt: string;
35
+ accountName: string;
36
+ channel: string;
37
+ countryCode: string;
38
+ currencyCode: string;
39
+ version?: string | undefined;
40
+ }>;
41
+ export type WalletJSON = z.infer<typeof WalletJSONSchema>;
3
42
  /**
4
43
  * Represents a digital Wallet entity.
5
44
  *
@@ -63,30 +102,12 @@ export declare class Wallet {
63
102
  * @returns The last update Date object.
64
103
  */
65
104
  get updatedAtDate(): Date;
66
- /**
67
- * Creates a plain data object representation of the Wallet instance.
68
- * Suitable for serialization or validation.
69
- * @returns A plain object conforming to the WalletDataType structure.
70
- */
71
- toObject(): WalletDTO;
72
- /**
73
- * Serializes the Wallet instance into a JSON string.
74
- * @returns A JSON string representation of the wallet data.
75
- */
76
- toJSON(): string;
77
105
  /**
78
106
  * Validates the Wallet instance's current data against the defined schema.
79
107
  * This includes checking the countryCode against ISO2CountryCodesSet.
80
108
  * @returns True if the current instance data is valid, otherwise false.
81
109
  */
82
110
  validate(): boolean;
83
- /**
84
- * Creates a Wallet instance from a JSON string.
85
- * Performs parsing and validation, including the countryCode runtime check.
86
- * @param jsonString - A JSON string containing wallet data.
87
- * @returns A new Wallet instance if parsing and validation succeed, otherwise undefined.
88
- */
89
- static fromJSON(jsonString: string): Wallet | undefined;
90
111
  /**
91
112
  * Creates a Wallet instance from a plain JavaScript object.
92
113
  * Validates the input object using the Wallet schema, including the countryCode runtime check.
@@ -101,4 +122,20 @@ export declare class Wallet {
101
122
  * @returns True if the object resembles a Wallet instance, false otherwise.
102
123
  */
103
124
  static is(obj: unknown): obj is Wallet;
125
+ /**
126
+ * Serializes the Wallet instance to a JSON-compatible object
127
+ */
128
+ toJSON(): WalletJSON;
129
+ /**
130
+ * Serializes the Wallet instance to a JSON string
131
+ */
132
+ toJSONString(): string;
133
+ /**
134
+ * Creates a Wallet instance from a JSON-compatible object or string
135
+ */
136
+ static fromJSON(json: WalletJSON | string): Wallet | undefined;
137
+ /**
138
+ * Type guard using Zod schema validation
139
+ */
140
+ static isWalletJSON(obj: unknown): obj is WalletJSON;
104
141
  }
@@ -0,0 +1,95 @@
1
+ import { QueryBuilder } from "@/lib/query/index.js";
2
+ import { WalletQueryDTO } from "./wallet.dtos.js";
3
+ /**
4
+ * Wallet-specific query builder that extends the base QueryBuilder
5
+ * and handles all possible input conversions (DTOs, URL params, etc.)
6
+ */
7
+ export declare class WalletQuery extends QueryBuilder {
8
+ /**
9
+ * Create empty wallet query with defaults
10
+ */
11
+ static create(): WalletQuery;
12
+ /**
13
+ * Create from typed DTO/filters object
14
+ */
15
+ static fromFilters(filters: WalletQueryDTO): WalletQuery;
16
+ /**
17
+ * Create from URL search parameters (strings)
18
+ */
19
+ static fromUrlParams(params: Record<string, string>): WalletQuery;
20
+ /**
21
+ * Create from URLSearchParams object
22
+ */
23
+ static fromSearchParams(searchParams: URLSearchParams): WalletQuery;
24
+ /**
25
+ * Create from Next.js Request object
26
+ */
27
+ static fromRequest(request: Request): WalletQuery;
28
+ /**
29
+ * Create from any supported input type
30
+ */
31
+ static from(input: QueryBuilder | WalletQueryDTO | Record<string, string> | URLSearchParams | null | undefined): WalletQuery;
32
+ /**
33
+ * Type guard for string records
34
+ */
35
+ private static isStringRecord;
36
+ whereId(id: string): this;
37
+ whereProfileId(profileId: string): this;
38
+ whereAccountNo(accountNo: string): this;
39
+ whereAccountName(accountName: string): this;
40
+ whereChannel(channel: string): this;
41
+ whereCountryCode(countryCode: string): this;
42
+ whereCurrencyCode(currencyCode: string): this;
43
+ /**
44
+ * Apply all filters from WalletQueryDTO object
45
+ */
46
+ private applyFilters;
47
+ /**
48
+ * Convert to WalletQueryDTO
49
+ */
50
+ toFilters(): WalletQueryDTO;
51
+ /**
52
+ * Convert to URL-safe string parameters
53
+ */
54
+ toUrlParams(): Record<string, string>;
55
+ /**
56
+ * Convert to URLSearchParams
57
+ */
58
+ toSearchParams(): URLSearchParams;
59
+ /**
60
+ * Convert to query string
61
+ */
62
+ toQueryString(): string;
63
+ /**
64
+ * Create new instance with wallet ID filter
65
+ */
66
+ withId(id: string): WalletQuery;
67
+ /**
68
+ * Create new instance with profile ID filter
69
+ */
70
+ withProfileId(profileId: string): WalletQuery;
71
+ /**
72
+ * Create new instance with account number filter
73
+ */
74
+ withAccountNo(accountNo: string): WalletQuery;
75
+ /**
76
+ * Create new instance with country code filter
77
+ */
78
+ withCountryCode(countryCode: string): WalletQuery;
79
+ /**
80
+ * Create new instance with currency code filter
81
+ */
82
+ withCurrencyCode(currencyCode: string): WalletQuery;
83
+ /**
84
+ * Check if any filters are applied
85
+ */
86
+ hasFilters(): boolean;
87
+ /**
88
+ * Get human-readable filter descriptions
89
+ */
90
+ getActiveFilters(): string[];
91
+ /**
92
+ * Extract filter values from QueryBuilder options
93
+ */
94
+ private extractFilterValues;
95
+ }