@temboplus/afloat 0.1.77-beta.2 → 0.1.77-beta.21

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 (42) hide show
  1. package/dist/index.cjs.js +1 -1
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +1 -1
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/lib/api/base-repository.d.ts +3 -1
  6. package/dist/lib/query/query.builder.d.ts +5 -1
  7. package/dist/modules/auth/auth.contract.d.ts +2 -2
  8. package/dist/modules/auth/company-membership.model.d.ts +122 -9
  9. package/dist/modules/auth/index.d.ts +0 -1
  10. package/dist/modules/auth/user.model.d.ts +238 -15
  11. package/dist/modules/contact/contact-info.model.d.ts +183 -533
  12. package/dist/modules/contact/contact.api-contract.d.ts +8 -8
  13. package/dist/modules/contact/contact.dtos.d.ts +2 -2
  14. package/dist/modules/contact/contact.model.d.ts +309 -32
  15. package/dist/modules/login/login.api-contract.d.ts +2 -2
  16. package/dist/modules/login/login.dtos.d.ts +4 -4
  17. package/dist/modules/login/login.model.d.ts +54 -24
  18. package/dist/modules/payout/payout.api-contract.d.ts +37 -37
  19. package/dist/modules/payout/payout.dtos.d.ts +47 -39
  20. package/dist/modules/payout/payout.model.d.ts +242 -2
  21. package/dist/modules/payout/payout.query.d.ts +11 -3
  22. package/dist/modules/payout/payout.repository.d.ts +48 -25
  23. package/dist/modules/profile/profile.model.d.ts +65 -30
  24. package/dist/modules/team-member/role.model.d.ts +49 -1
  25. package/dist/modules/team-member/team-member.contract.d.ts +44 -44
  26. package/dist/modules/team-member/team-member.dtos.d.ts +14 -14
  27. package/dist/modules/team-member/team-member.model.d.ts +106 -6
  28. package/dist/modules/wallet/index.d.ts +0 -1
  29. package/dist/modules/wallet/narration.model.d.ts +34 -38
  30. package/dist/modules/wallet/statement-entry.model.d.ts +172 -73
  31. package/dist/modules/wallet/wallet.contract.d.ts +6 -6
  32. package/dist/modules/wallet/wallet.dtos.d.ts +12 -12
  33. package/dist/modules/wallet/wallet.model.d.ts +56 -19
  34. package/dist/modules/wallet/wallet.query.d.ts +95 -0
  35. package/dist/modules/wallet/wallet.repository.d.ts +45 -13
  36. package/package.json +2 -2
  37. package/dist/modules/auth/auth.manager.d.ts +0 -249
  38. package/dist/modules/auth/auth.store.d.ts +0 -139
  39. package/dist/modules/auth/storage/client-store.d.ts +0 -29
  40. package/dist/modules/auth/storage/client-token-handler.d.ts +0 -31
  41. package/dist/modules/auth/storage/types.d.ts +0 -41
  42. package/dist/modules/wallet/wallet-manager.session.d.ts +0 -143
@@ -4,4 +4,3 @@ export * from "./statement-entry.model.js";
4
4
  export * from "./narration.model.js";
5
5
  export * from "./wallet.repository.js";
6
6
  export * from "./wallet.utils.js";
7
- export * from "./wallet-manager.session.js";
@@ -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
  }
@@ -13,18 +13,18 @@ export declare const contract: {
13
13
  id?: string | undefined;
14
14
  accountNo?: string | undefined;
15
15
  profileId?: string | undefined;
16
- accountName?: string | undefined;
17
16
  channel?: string | undefined;
18
17
  countryCode?: string | undefined;
19
18
  currencyCode?: string | undefined;
19
+ accountName?: string | undefined;
20
20
  }, {
21
21
  id?: string | undefined;
22
22
  accountNo?: string | undefined;
23
23
  profileId?: string | undefined;
24
- accountName?: string | undefined;
25
24
  channel?: string | undefined;
26
25
  countryCode?: string | undefined;
27
26
  currencyCode?: string | undefined;
27
+ accountName?: string | undefined;
28
28
  }>;
29
29
  method: "GET";
30
30
  path: "/";
@@ -40,23 +40,23 @@ export declare const contract: {
40
40
  createdAt: z.ZodString;
41
41
  updatedAt: z.ZodString;
42
42
  }, "strip", z.ZodTypeAny, {
43
+ createdAt: string;
43
44
  id: string;
44
45
  accountNo: string;
45
46
  profileId: string;
46
- createdAt: string;
47
47
  updatedAt: string;
48
- accountName: string;
49
48
  channel: string;
50
49
  countryCode: import("@temboplus/frontend-core").ISO2CountryCode;
51
50
  currencyCode: import("@temboplus/frontend-core").CurrencyCode;
51
+ accountName: string;
52
52
  }, {
53
+ createdAt: string;
53
54
  id: string;
54
55
  accountNo: string;
55
56
  profileId: string;
56
- createdAt: string;
57
57
  updatedAt: string;
58
- accountName: string;
59
58
  channel: string;
59
+ accountName: string;
60
60
  countryCode?: string | undefined;
61
61
  currencyCode?: string | undefined;
62
62
  }>, "many">;
@@ -15,23 +15,23 @@ declare const walletSchema: z.ZodObject<{
15
15
  createdAt: z.ZodString;
16
16
  updatedAt: z.ZodString;
17
17
  }, "strip", z.ZodTypeAny, {
18
+ createdAt: string;
18
19
  id: string;
19
20
  accountNo: string;
20
21
  profileId: string;
21
- createdAt: string;
22
22
  updatedAt: string;
23
- accountName: string;
24
23
  channel: string;
25
24
  countryCode: import("@temboplus/frontend-core").ISO2CountryCode;
26
25
  currencyCode: import("@temboplus/frontend-core").CurrencyCode;
26
+ accountName: string;
27
27
  }, {
28
+ createdAt: string;
28
29
  id: string;
29
30
  accountNo: string;
30
31
  profileId: string;
31
- createdAt: string;
32
32
  updatedAt: string;
33
- accountName: string;
34
33
  channel: string;
34
+ accountName: string;
35
35
  countryCode?: string | undefined;
36
36
  currencyCode?: string | undefined;
37
37
  }>;
@@ -52,18 +52,18 @@ declare const walletQuerySchema: z.ZodObject<{
52
52
  id?: string | undefined;
53
53
  accountNo?: string | undefined;
54
54
  profileId?: string | undefined;
55
- accountName?: string | undefined;
56
55
  channel?: string | undefined;
57
56
  countryCode?: string | undefined;
58
57
  currencyCode?: string | undefined;
58
+ accountName?: string | undefined;
59
59
  }, {
60
60
  id?: string | undefined;
61
61
  accountNo?: string | undefined;
62
62
  profileId?: string | undefined;
63
- accountName?: string | undefined;
64
63
  channel?: string | undefined;
65
64
  countryCode?: string | undefined;
66
65
  currencyCode?: string | undefined;
66
+ accountName?: string | undefined;
67
67
  }>;
68
68
  /**
69
69
  * Schema definition for a statement entry.
@@ -118,23 +118,23 @@ export declare const WalletDTOSchemas: {
118
118
  createdAt: z.ZodString;
119
119
  updatedAt: z.ZodString;
120
120
  }, "strip", z.ZodTypeAny, {
121
+ createdAt: string;
121
122
  id: string;
122
123
  accountNo: string;
123
124
  profileId: string;
124
- createdAt: string;
125
125
  updatedAt: string;
126
- accountName: string;
127
126
  channel: string;
128
127
  countryCode: import("@temboplus/frontend-core").ISO2CountryCode;
129
128
  currencyCode: import("@temboplus/frontend-core").CurrencyCode;
129
+ accountName: string;
130
130
  }, {
131
+ createdAt: string;
131
132
  id: string;
132
133
  accountNo: string;
133
134
  profileId: string;
134
- createdAt: string;
135
135
  updatedAt: string;
136
- accountName: string;
137
136
  channel: string;
137
+ accountName: string;
138
138
  countryCode?: string | undefined;
139
139
  currencyCode?: string | undefined;
140
140
  }>;
@@ -150,18 +150,18 @@ export declare const WalletDTOSchemas: {
150
150
  id?: string | undefined;
151
151
  accountNo?: string | undefined;
152
152
  profileId?: string | undefined;
153
- accountName?: string | undefined;
154
153
  channel?: string | undefined;
155
154
  countryCode?: string | undefined;
156
155
  currencyCode?: string | undefined;
156
+ accountName?: string | undefined;
157
157
  }, {
158
158
  id?: string | undefined;
159
159
  accountNo?: string | undefined;
160
160
  profileId?: string | undefined;
161
- accountName?: string | undefined;
162
161
  channel?: string | undefined;
163
162
  countryCode?: string | undefined;
164
163
  currencyCode?: string | undefined;
164
+ accountName?: string | undefined;
165
165
  }>;
166
166
  statementEntry: z.ZodObject<{
167
167
  accountNo: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
@@ -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
+ createdAt: string;
20
+ id: string;
21
+ accountNo: string;
22
+ version: string;
23
+ profileId: string;
24
+ updatedAt: string;
25
+ channel: string;
26
+ countryCode: string;
27
+ currencyCode: string;
28
+ accountName: string;
29
+ }, {
30
+ createdAt: string;
31
+ id: string;
32
+ accountNo: string;
33
+ profileId: string;
34
+ updatedAt: string;
35
+ channel: string;
36
+ countryCode: string;
37
+ currencyCode: string;
38
+ accountName: 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
  }