@temboplus/afloat 0.1.75-0 → 0.1.76-beta.0

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 (66) 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 +7 -6
  4. package/dist/index.esm.js +1 -1
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/lib/api/index.d.ts +0 -1
  7. package/dist/lib/error/error.permission.d.ts +1 -1
  8. package/dist/lib/query/index.d.ts +2 -0
  9. package/dist/lib/query/pagination/pagination.d.ts +73 -0
  10. package/dist/lib/query/pagination/pagination.schemas.d.ts +83 -0
  11. package/dist/{features → modules}/auth/auth.contract.d.ts +2 -9
  12. package/dist/{features → modules}/auth/auth.manager.d.ts +2 -2
  13. package/dist/{features → modules}/auth/auth.repository.d.ts +18 -1
  14. package/dist/{features → modules}/auth/auth.store.d.ts +1 -1
  15. package/dist/modules/auth/index.d.ts +4 -0
  16. package/dist/{features → modules}/auth/storage/client-store.d.ts +1 -1
  17. package/dist/{features → modules}/auth/storage/types.d.ts +1 -1
  18. package/dist/{models → modules/auth}/user.model.d.ts +4 -3
  19. package/dist/{models → modules/contact}/contact-info.model.d.ts +2 -2
  20. package/dist/{features → modules}/contact/contact-input-handler.d.ts +1 -1
  21. package/dist/{models → modules/contact}/contact.model.d.ts +1 -1
  22. package/dist/{features → modules}/contact/contact.repository.d.ts +2 -2
  23. package/dist/modules/contact/index.d.ts +4 -0
  24. package/dist/modules/login/index.d.ts +2 -0
  25. package/dist/modules/login/login.model.d.ts +1 -0
  26. package/dist/{features/auth/identity/identity.repository.d.ts → modules/login/login.repository.d.ts} +1 -1
  27. package/dist/{features → modules}/payout/index.d.ts +2 -0
  28. package/dist/{features → modules}/payout/payout-channel-handler.d.ts +2 -2
  29. package/dist/{models → modules/payout}/payout.model.d.ts +2 -2
  30. package/dist/{features → modules}/payout/payout.repository.d.ts +28 -16
  31. package/dist/modules/profile/index.d.ts +3 -0
  32. package/dist/{models → modules/profile}/profile.model.d.ts +1 -1
  33. package/dist/{features/auth → modules}/profile/profile.repository.d.ts +1 -1
  34. package/dist/modules/user/index.d.ts +4 -0
  35. package/dist/{models → modules/user}/role.model.d.ts +1 -1
  36. package/dist/{features/admin/admin.contract.d.ts → modules/user/user.contract.d.ts} +9 -9
  37. package/dist/{models/managed-user.model.d.ts → modules/user/user.model.d.ts} +1 -1
  38. package/dist/{features/admin/admin.repository.d.ts → modules/user/user.repository.d.ts} +4 -4
  39. package/dist/{features → modules}/wallet/index.d.ts +5 -2
  40. package/dist/{models → modules/wallet}/narration.model.d.ts +1 -1
  41. package/dist/{models → modules/wallet}/statement-entry.model.d.ts +1 -1
  42. package/dist/{features → modules}/wallet/wallet-manager.session.d.ts +2 -2
  43. package/dist/{models → modules/wallet}/wallet.model.d.ts +1 -1
  44. package/dist/{features → modules}/wallet/wallet.repository.d.ts +2 -2
  45. package/dist/{features → modules}/wallet/wallet.utils.d.ts +1 -1
  46. package/package.json +1 -1
  47. package/dist/features/admin/index.d.ts +0 -2
  48. package/dist/features/auth/access/access.api-contract.d.ts +0 -13
  49. package/dist/features/auth/access/access.repository.d.ts +0 -55
  50. package/dist/features/auth/index.d.ts +0 -5
  51. package/dist/features/contact/index.d.ts +0 -2
  52. package/dist/lib/api/common-schemas.d.ts +0 -49
  53. package/dist/models/index.d.ts +0 -11
  54. package/dist/{models/permission.d.ts → modules/auth/permission.type.d.ts} +0 -0
  55. package/dist/{features → modules}/auth/storage/client-token-handler.d.ts +0 -0
  56. package/dist/{features → modules}/contact/contact.api-contract.d.ts +8 -8
  57. package/dist/{features → modules}/contact/contact.dtos.d.ts +2 -2
  58. package/dist/{features/auth/identity/identity.api-contract.d.ts → modules/login/login.api-contract.d.ts} +0 -0
  59. package/dist/{features → modules}/payout/payout.api-contract.d.ts +35 -35
  60. package/dist/{features → modules}/payout/payout.dtos.d.ts +22 -22
  61. package/dist/{features → modules}/payout/payout.query.d.ts +0 -0
  62. package/dist/{features/auth → modules}/profile/profile.api-contract.d.ts +0 -0
  63. package/dist/{features/auth → modules}/profile/profile.dtos.d.ts +0 -0
  64. package/dist/{features/admin/admin.dtos.d.ts → modules/user/user.dtos.d.ts} +0 -0
  65. package/dist/{features → modules}/wallet/wallet.contract.d.ts +6 -6
  66. package/dist/{features → modules}/wallet/wallet.dtos.d.ts +12 -12
@@ -1,2 +1 @@
1
- export * from "./common-schemas.js";
2
1
  export * from "./base-repository.js";
@@ -1,4 +1,4 @@
1
- import { Permission } from "@/models/permission.js";
1
+ import { Permission } from "@/modules/auth/permission.type.js";
2
2
  /**
3
3
  * Custom error class representing an error caused by missing required permissions.
4
4
  * Extends the built-in {@link Error} class to include the `requiredPermissions` property.
@@ -1,2 +1,4 @@
1
1
  export * from "./query.builder.js";
2
2
  export * from "./query.types.js";
3
+ export * from "./pagination/pagination.schemas.js";
4
+ export * from "./pagination/pagination.js";
@@ -0,0 +1,73 @@
1
+ /** Serialized pagination metadata for API responses */
2
+ export type PaginationJson = {
3
+ page: number;
4
+ limit: number;
5
+ total: number;
6
+ totalPages: number;
7
+ hasNext: boolean;
8
+ hasPrev: boolean;
9
+ };
10
+ /**
11
+ * Represents pagination metadata for paginated API responses.
12
+ * Provides computed properties for navigation and page calculations.
13
+ */
14
+ export declare class Pagination {
15
+ readonly page: number;
16
+ readonly limit: number;
17
+ readonly total: number;
18
+ /**
19
+ * @param page - Current page number (1-based)
20
+ * @param limit - Number of items per page
21
+ * @param total - Total number of items across all pages
22
+ */
23
+ constructor(page: number, limit: number, total: number);
24
+ /** Total number of pages */
25
+ get totalPages(): number;
26
+ /** Whether there is a next page available */
27
+ get hasNext(): boolean;
28
+ /** Whether there is a previous page available */
29
+ get hasPrev(): boolean;
30
+ /** Offset for database queries (0-based) */
31
+ get offset(): number;
32
+ /** Whether this is the first page */
33
+ get isFirstPage(): boolean;
34
+ /** Whether this is the last page */
35
+ get isLastPage(): boolean;
36
+ /**
37
+ * Creates a Pagination instance for the next page.
38
+ * @returns New Pagination instance or null if no next page exists
39
+ */
40
+ nextPage(): Pagination | null;
41
+ /**
42
+ * Creates a Pagination instance for the previous page.
43
+ * @returns New Pagination instance or null if no previous page exists
44
+ */
45
+ prevPage(): Pagination | null;
46
+ /** Converts to a plain object for JSON serialization */
47
+ toJSON(): {
48
+ page: number;
49
+ limit: number;
50
+ total: number;
51
+ totalPages: number;
52
+ hasNext: boolean;
53
+ hasPrev: boolean;
54
+ };
55
+ }
56
+ /** Generic paginated response structure */
57
+ export interface Paged<T> {
58
+ results: T[];
59
+ pagination: Pagination;
60
+ }
61
+ /** Type for paginated responses after JSON serialization */
62
+ export type PaginatedApiResponse<T> = {
63
+ results: T[];
64
+ pagination: PaginationJson;
65
+ };
66
+ /**
67
+ * Creates a paginated response from query results.
68
+ */
69
+ export declare function createPaginatedResponse<T>(results: T[], page: number, limit: number, total: number): Paged<T>;
70
+ /**
71
+ * Creates an empty paginated response.
72
+ */
73
+ export declare function emptyPaginatedResponse<T>(page?: number, limit?: number): Paged<T>;
@@ -0,0 +1,83 @@
1
+ import { z } from "zod";
2
+ /** Zod schema for validating pagination query parameters */
3
+ export declare const PaginationParamsSchema: z.ZodObject<{
4
+ page: z.ZodDefault<z.ZodNumber>;
5
+ limit: z.ZodDefault<z.ZodNumber>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ page: number;
8
+ limit: number;
9
+ }, {
10
+ page?: number | undefined;
11
+ limit?: number | undefined;
12
+ }>;
13
+ /** Zod schema for validating pagination metadata */
14
+ export declare const PaginationSchema: z.ZodObject<{
15
+ page: z.ZodNumber;
16
+ limit: z.ZodNumber;
17
+ total: z.ZodNumber;
18
+ totalPages: z.ZodNumber;
19
+ hasNext: z.ZodBoolean;
20
+ hasPrev: z.ZodBoolean;
21
+ }, "strip", z.ZodTypeAny, {
22
+ page: number;
23
+ limit: number;
24
+ total: number;
25
+ totalPages: number;
26
+ hasNext: boolean;
27
+ hasPrev: boolean;
28
+ }, {
29
+ page: number;
30
+ limit: number;
31
+ total: number;
32
+ totalPages: number;
33
+ hasNext: boolean;
34
+ hasPrev: boolean;
35
+ }>;
36
+ /**
37
+ * Creates a Zod schema for a paginated response with typed results.
38
+ */
39
+ export declare function createPaginatedResponseSchema<T extends z.ZodTypeAny>(itemSchema: T): z.ZodObject<{
40
+ results: z.ZodArray<T, "many">;
41
+ pagination: z.ZodObject<{
42
+ page: z.ZodNumber;
43
+ limit: z.ZodNumber;
44
+ total: z.ZodNumber;
45
+ totalPages: z.ZodNumber;
46
+ hasNext: z.ZodBoolean;
47
+ hasPrev: z.ZodBoolean;
48
+ }, "strip", z.ZodTypeAny, {
49
+ page: number;
50
+ limit: number;
51
+ total: number;
52
+ totalPages: number;
53
+ hasNext: boolean;
54
+ hasPrev: boolean;
55
+ }, {
56
+ page: number;
57
+ limit: number;
58
+ total: number;
59
+ totalPages: number;
60
+ hasNext: boolean;
61
+ hasPrev: boolean;
62
+ }>;
63
+ }, "strip", z.ZodTypeAny, {
64
+ results: T["_output"][];
65
+ pagination: {
66
+ page: number;
67
+ limit: number;
68
+ total: number;
69
+ totalPages: number;
70
+ hasNext: boolean;
71
+ hasPrev: boolean;
72
+ };
73
+ }, {
74
+ results: T["_input"][];
75
+ pagination: {
76
+ page: number;
77
+ limit: number;
78
+ total: number;
79
+ totalPages: number;
80
+ hasNext: boolean;
81
+ hasPrev: boolean;
82
+ };
83
+ }>;
@@ -87,13 +87,6 @@ export declare const authContract: {
87
87
  access: {
88
88
  method: "GET";
89
89
  path: "/access";
90
- headers: z.ZodObject<{
91
- token: z.ZodString;
92
- }, "strip", z.ZodTypeAny, {
93
- token: string;
94
- }, {
95
- token: string;
96
- }>;
97
90
  responses: {
98
91
  200: z.ZodArray<z.ZodString, "many">;
99
92
  };
@@ -104,11 +97,11 @@ export declare const authContract: {
104
97
  currentPassword: z.ZodString;
105
98
  newPassword: z.ZodString;
106
99
  }, "strip", z.ZodTypeAny, {
107
- newPassword: string;
108
100
  currentPassword: string;
109
- }, {
110
101
  newPassword: string;
102
+ }, {
111
103
  currentPassword: string;
104
+ newPassword: string;
112
105
  }>;
113
106
  path: "/password";
114
107
  responses: {};
@@ -1,5 +1,5 @@
1
- import { Permission } from "@/models/permission.js";
2
- import { User } from "@/models/user.model.js";
1
+ import { Permission } from "@/modules/auth/permission.type.js";
2
+ import { User } from "@/modules/auth/user.model.js";
3
3
  /**
4
4
  * Clean authentication manager for client-side usage only.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import { BaseRepository } from "@/lib/api/base-repository.js";
2
- import { User } from "@/models/user.model.js";
2
+ import { User } from "@/modules/auth/user.model.js";
3
3
  import { authContract } from "./auth.contract.js";
4
4
  /**
5
5
  * Repository class for handling authentication-related operations.
@@ -63,4 +63,21 @@ export declare class AuthRepository extends BaseRepository<typeof authContract>
63
63
  * ```
64
64
  */
65
65
  updatePassword(currentPassword: string, newPassword: string): Promise<boolean>;
66
+ /**
67
+ * Retrieves the current user's access list.
68
+ *
69
+ * @returns Promise that resolves to an array of access permissions/roles
70
+ * @throws {APIError} If the request fails or returns an unexpected status
71
+ *
72
+ * @example
73
+ * ```typescript
74
+ * try {
75
+ * const accessList = await repo.getAccessList();
76
+ * console.log("User has access to:", accessList);
77
+ * } catch (error) {
78
+ * console.error("Failed to get access list:", error.message);
79
+ * }
80
+ * ```
81
+ */
82
+ getAccessList(): Promise<string[]>;
66
83
  }
@@ -1,5 +1,5 @@
1
1
  import { type StoreApi, type UseBoundStore } from "zustand";
2
- import { User } from "@/models/user.model.js";
2
+ import { User } from "@/modules/auth/user.model.js";
3
3
  /** Type definition for the store's internal state */
4
4
  type AuthState = {
5
5
  user: string | undefined;
@@ -0,0 +1,4 @@
1
+ export * from "./auth.manager.js";
2
+ export * from "./auth.repository.js";
3
+ export * from "./permission.type.js";
4
+ export * from "./user.model.js";
@@ -1,6 +1,6 @@
1
1
  import { type StoreApi, type UseBoundStore } from "zustand";
2
2
  import type { AuthStore } from "./types.js";
3
- import { User } from "@/models/user.model.js";
3
+ import { User } from "@/modules/auth/user.model.js";
4
4
  /** Type definition for the store's state */
5
5
  type State = {
6
6
  user: string | undefined;
@@ -1,4 +1,4 @@
1
- import type { User } from "@/models/user.model";
1
+ import { User } from "../user.model.js";
2
2
  /**
3
3
  * Interface defining the contract for auth storage implementations.
4
4
  * This allows for different storage strategies in different environments.
@@ -1,4 +1,5 @@
1
- import { Profile } from "./profile.model.js";
1
+ import { Permission } from "./permission.type.js";
2
+ import { Profile } from "../profile/profile.model.js";
2
3
  /**
3
4
  * Represents a user in Afloat.
4
5
  *
@@ -29,7 +30,7 @@ export declare class User {
29
30
  /**
30
31
  * A list of granted access keys (permissions).
31
32
  */
32
- access: string[];
33
+ access: Permission[];
33
34
  /**
34
35
  * A map of access keys to boolean values for fast permission checks.
35
36
  */
@@ -44,7 +45,7 @@ export declare class User {
44
45
  * @param key - The access key to check.
45
46
  * @returns `true` if the user has the specified access, otherwise `false`.
46
47
  */
47
- can(key: string): boolean;
48
+ can(key: Permission): boolean;
48
49
  /**
49
50
  * Returns a plain object representation of the user.
50
51
  * This can safely be embedded in a JWT payload.
@@ -1,5 +1,5 @@
1
- import { ContactType, ContactDTO } from "@/features/contact/contact.dtos.js";
2
- import { PayoutDTO } from "@/features/payout/payout.dtos.js";
1
+ import { ContactType, ContactDTO } from "@/modules/contact/contact.dtos.js";
2
+ import { PayoutDTO } from "@/modules/payout/payout.dtos.js";
3
3
  import { Bank, ISO2CountryCode, PhoneNumber } from "@temboplus/frontend-core";
4
4
  import type { BankSwiftCode, MNOId } from "@temboplus/frontend-core";
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { ContactInfo } from "@/models/contact-info.model.js";
1
+ import { ContactInfo } from "@/modules/contact/contact-info.model.js";
2
2
  import { ContactInputDTO } from "./contact.dtos.js";
3
3
  /**
4
4
  * Factory for resolving and validating a raw `ContactInput` into a typed and valid version.
@@ -1,4 +1,4 @@
1
- import { ContactDTO, ContactType } from "@/features/contact/contact.dtos.js";
1
+ import { ContactDTO, ContactType } from "@/modules/contact/contact.dtos.js";
2
2
  import { ContactInfo } from "./contact-info.model.js";
3
3
  /**
4
4
  * Contact class that wraps the Zod schema and provides additional functionality
@@ -1,6 +1,6 @@
1
1
  import { BaseRepository } from "@/lib/api/base-repository.js";
2
- import { ContactInfo } from "@/models/contact-info.model.js";
3
- import { Contact } from "@/models/contact.model.js";
2
+ import { ContactInfo } from "@/modules/contact/contact-info.model.js";
3
+ import { Contact } from "@/modules/contact/contact.model.js";
4
4
  import { contract } from "./contact.api-contract.js";
5
5
  /**
6
6
  * Repository class for managing Contact data through API interactions.
@@ -0,0 +1,4 @@
1
+ export * from "./contact.repository.js";
2
+ export * from "./contact.dtos.js";
3
+ export * from "./contact-info.model.js";
4
+ export * from "./contact.model.js";
@@ -0,0 +1,2 @@
1
+ export * from "./login.model.js";
2
+ export * from "./login.repository.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { identityContract } from "./identity.api-contract.js";
1
+ import { identityContract } from "./login.api-contract.js";
2
2
  import type { ClientInferResponseBody } from "@ts-rest/core";
3
3
  import { BaseRepository } from "@/lib/api/base-repository.js";
4
4
  type GetUserIdentityResponse = ClientInferResponseBody<typeof identityContract.getUserCredentials>;
@@ -1,3 +1,5 @@
1
1
  export * from "./payout.repository.js";
2
2
  export * from "./payout.dtos.js";
3
3
  export * from "./payout-channel-handler.js";
4
+ export * from "./payout.model.js";
5
+ export * from "./payout.query.js";
@@ -1,5 +1,5 @@
1
- import { ContactInfo, BankContactInfo } from "@/models/contact-info.model.js";
2
- import { Wallet } from "@/models/wallet.model.js";
1
+ import { ContactInfo, BankContactInfo } from "@/modules/contact/contact-info.model.js";
2
+ import { Wallet } from "@/modules/wallet/wallet.model.js";
3
3
  import { Amount, MNOId, PhoneNumber } from "@temboplus/frontend-core";
4
4
  import { PayoutChannel, PayoutInputDTO } from "./payout.dtos.js";
5
5
  /**
@@ -1,6 +1,6 @@
1
- import { PayoutDTO, PayoutStatus, PayoutApprovalStatus, PayoutAuthorizer } from "@/features/payout/payout.dtos.js";
1
+ import { PayoutDTO, PayoutStatus, PayoutApprovalStatus, PayoutAuthorizer } from "@/modules/payout/payout.dtos.js";
2
2
  import { Amount } from "@temboplus/frontend-core";
3
- import { ContactInfo } from "./contact-info.model.js";
3
+ import { ContactInfo } from "../contact/contact-info.model.js";
4
4
  /**
5
5
  * Payout class that wraps the Zod schema and provides additional functionality
6
6
  */
@@ -1,11 +1,12 @@
1
- import { BaseRepository, PaginationDTO } from "@/lib/api/index.js";
2
- import { ContactInfo } from "@/models/contact-info.model.js";
3
- import { Payout } from "@/models/payout.model.js";
1
+ import { BaseRepository } from "@/lib/api/index.js";
2
+ import { ContactInfo } from "@/modules/contact/contact-info.model.js";
3
+ import { Payout } from "@/modules/payout/payout.model.js";
4
4
  import { Amount } from "@temboplus/frontend-core";
5
5
  import { PayoutAPI } from "./payout.api-contract.js";
6
6
  import { PayoutChannel } from "./payout.dtos.js";
7
7
  import { PayoutQuery } from "./payout.query.js";
8
8
  import { PayoutFilters } from "./payout.dtos.js";
9
+ import { Paged } from "@/lib/query/index.js";
9
10
  /**
10
11
  * Flexible query input type - supports the class, filters interface, URL params, etc.
11
12
  */
@@ -45,11 +46,11 @@ export declare class PayoutRepository extends BaseRepository<PayoutAPI> {
45
46
  root?: string;
46
47
  });
47
48
  /**
48
- * Get all payouts with filtering and pagination.
49
- * Accepts flexible input types and normalizes them to PayoutQuery.
49
+ * Get paginated payouts with filtering.
50
+ * Always returns paginated results with metadata.
50
51
  *
51
52
  * @param query - Query parameters in any supported format
52
- * @returns Promise resolving to payouts and pagination info
53
+ * @returns Promise resolving to paginated payouts
53
54
  *
54
55
  * @example
55
56
  * ```typescript
@@ -66,18 +67,29 @@ export declare class PayoutRepository extends BaseRepository<PayoutAPI> {
66
67
  * const result3 = await repo.getPayouts(query);
67
68
  * ```
68
69
  */
69
- getPayouts(query?: PayoutQueryInput): Promise<{
70
- payouts: Payout[];
71
- pagination: PaginationDTO;
72
- }>;
70
+ getPayouts(query?: PayoutQueryInput): Promise<Paged<Payout>>;
73
71
  /**
74
- * Convenience method for Next.js API routes
75
- * Extracts search params directly from Request object
72
+ * Get all payouts without pagination.
73
+ * Returns a plain array of all matching results.
74
+ *
75
+ * @param query - Query parameters (pagination params will be ignored)
76
+ * @returns Promise resolving to array of all payouts
77
+ *
78
+ * @example
79
+ * ```typescript
80
+ * // Get all pending payouts for a dropdown
81
+ * const allPending = await repo.getAllPayouts({ approvalStatus: 'Pending' });
82
+ *
83
+ * // Get all payouts without any filters
84
+ * const allPayouts = await repo.getAllPayouts();
85
+ * ```
86
+ */
87
+ getAllPayouts(query?: PayoutQueryInput): Promise<Payout[]>;
88
+ /**
89
+ * Convenience method for Next.js API routes.
90
+ * Extracts search params directly from Request object and returns paginated results.
76
91
  */
77
- getPayoutsFromRequest(req: Request): Promise<{
78
- payouts: Payout[];
79
- pagination: PaginationDTO;
80
- }>;
92
+ getPayoutsFromRequest(req: Request): Promise<Paged<Payout>>;
81
93
  /**
82
94
  * Creates a new payout with the provided input data.
83
95
  *
@@ -0,0 +1,3 @@
1
+ export * from "./profile.dtos.js";
2
+ export * from "./profile.model.js";
3
+ export * from "./profile.repository.js";
@@ -1,4 +1,4 @@
1
- import { ProfileDTO } from "@/features/auth/profile/profile.dtos.js";
1
+ import { ProfileDTO } from "./profile.dtos.js";
2
2
  /**
3
3
  * Represents a user profile in the system.
4
4
  *
@@ -1,6 +1,6 @@
1
1
  import { BaseRepository } from "@/lib/api/base-repository.js";
2
2
  import { profileContract } from "./profile.api-contract.js";
3
- import { Profile } from "@/models/profile.model.js";
3
+ import { Profile } from "./profile.model.js";
4
4
  /**
5
5
  * Repository class for managing user profile operations.
6
6
  * Handles retrieving and updating user profile information from the API.
@@ -0,0 +1,4 @@
1
+ export * from "./user.repository.js";
2
+ export * from "./user.dtos.js";
3
+ export * from "./user.model.js";
4
+ export * from "./role.model.js";
@@ -1,4 +1,4 @@
1
- import { RoleDTO } from "@/features/admin/admin.dtos.js";
1
+ import { RoleDTO } from "@/modules/user/user.dtos.js";
2
2
  export declare class Role {
3
3
  readonly id: string;
4
4
  readonly name: string;
@@ -56,7 +56,7 @@ export declare const userManagementContract: {
56
56
  resetPassword: z.ZodBoolean;
57
57
  isActive: z.ZodBoolean;
58
58
  isArchived: z.ZodBoolean;
59
- role: z.ZodOptional<z.ZodType<import("./admin.dtos.js").RoleDTO>>;
59
+ role: z.ZodOptional<z.ZodType<import("./user.dtos.js").RoleDTO>>;
60
60
  createdAt: z.ZodString;
61
61
  updatedAt: z.ZodString;
62
62
  }, z.UnknownKeysParam, z.ZodTypeAny, {
@@ -179,7 +179,7 @@ export declare const userManagementContract: {
179
179
  resetPassword: z.ZodBoolean;
180
180
  isActive: z.ZodBoolean;
181
181
  isArchived: z.ZodBoolean;
182
- role: z.ZodOptional<z.ZodType<import("./admin.dtos.js").RoleDTO>>;
182
+ role: z.ZodOptional<z.ZodType<import("./user.dtos.js").RoleDTO>>;
183
183
  createdAt: z.ZodString;
184
184
  updatedAt: z.ZodString;
185
185
  }, z.UnknownKeysParam, z.ZodTypeAny, {
@@ -260,14 +260,14 @@ export declare const userManagementContract: {
260
260
  name: string;
261
261
  identity: string;
262
262
  resetPassword?: boolean | undefined;
263
- roleId?: string | undefined;
264
263
  password?: string | undefined;
264
+ roleId?: string | undefined;
265
265
  }, {
266
266
  name: string;
267
267
  identity: string;
268
268
  resetPassword?: boolean | undefined;
269
- roleId?: string | undefined;
270
269
  password?: string | undefined;
270
+ roleId?: string | undefined;
271
271
  }>;
272
272
  path: "/login";
273
273
  responses: {
@@ -355,15 +355,15 @@ export declare const userManagementContract: {
355
355
  }, z.UnknownKeysParam, z.ZodTypeAny, {
356
356
  name?: string | undefined;
357
357
  resetPassword?: boolean | undefined;
358
+ password?: string | undefined;
358
359
  roleId?: string | undefined;
359
360
  isActive?: boolean | undefined;
360
- password?: string | undefined;
361
361
  }, {
362
362
  name?: string | undefined;
363
363
  resetPassword?: boolean | undefined;
364
+ password?: string | undefined;
364
365
  roleId?: string | undefined;
365
366
  isActive?: boolean | undefined;
366
- password?: string | undefined;
367
367
  }>;
368
368
  path: "/login/:id";
369
369
  responses: {
@@ -377,7 +377,7 @@ export declare const userManagementContract: {
377
377
  resetPassword: z.ZodBoolean;
378
378
  isActive: z.ZodBoolean;
379
379
  isArchived: z.ZodBoolean;
380
- role: z.ZodOptional<z.ZodType<import("./admin.dtos.js").RoleDTO>>;
380
+ role: z.ZodOptional<z.ZodType<import("./user.dtos.js").RoleDTO>>;
381
381
  createdAt: z.ZodString;
382
382
  updatedAt: z.ZodString;
383
383
  }, z.UnknownKeysParam, z.ZodTypeAny, {
@@ -478,7 +478,7 @@ export declare const userManagementContract: {
478
478
  resetPassword: z.ZodBoolean;
479
479
  isActive: z.ZodBoolean;
480
480
  isArchived: z.ZodBoolean;
481
- role: z.ZodOptional<z.ZodType<import("./admin.dtos.js").RoleDTO>>;
481
+ role: z.ZodOptional<z.ZodType<import("./user.dtos.js").RoleDTO>>;
482
482
  createdAt: z.ZodString;
483
483
  updatedAt: z.ZodString;
484
484
  }, z.UnknownKeysParam, z.ZodTypeAny, {
@@ -569,7 +569,7 @@ export declare const userManagementContract: {
569
569
  resetPassword: z.ZodBoolean;
570
570
  isActive: z.ZodBoolean;
571
571
  isArchived: z.ZodBoolean;
572
- role: z.ZodOptional<z.ZodType<import("./admin.dtos.js").RoleDTO>>;
572
+ role: z.ZodOptional<z.ZodType<import("./user.dtos.js").RoleDTO>>;
573
573
  createdAt: z.ZodString;
574
574
  updatedAt: z.ZodString;
575
575
  }, z.UnknownKeysParam, z.ZodTypeAny, {
@@ -1,4 +1,4 @@
1
- import { RoleDTO } from "@/features/admin/admin.dtos.js";
1
+ import { RoleDTO } from "@/modules/user/user.dtos.js";
2
2
  import { Role } from "./role.model.js";
3
3
  export interface UserEntityData {
4
4
  id: string;
@@ -1,8 +1,8 @@
1
1
  import { BaseRepository } from "@/lib/api/base-repository.js";
2
- import { ManagedUser } from "@/models/managed-user.model.js";
3
- import { Role } from "@/models/role.model.js";
4
- import { userManagementContract } from "./admin.contract.js";
5
- import { CreateUserRequestDTO, CreateUserResponseDTO, UpdateUserRequestDTO, ResetPasswordRequestDTO, ManagedUserQueryParamsDTO } from "./admin.dtos.js";
2
+ import { ManagedUser } from "@/modules/user/user.model.js";
3
+ import { Role } from "@/modules/user/role.model.js";
4
+ import { userManagementContract } from "./user.contract.js";
5
+ import { CreateUserRequestDTO, CreateUserResponseDTO, UpdateUserRequestDTO, ResetPasswordRequestDTO, ManagedUserQueryParamsDTO } from "./user.dtos.js";
6
6
  /**
7
7
  * Repository class for managing user accounts through API interactions.
8
8
  * Handles user creation, updates, archiving, and role management.
@@ -1,4 +1,7 @@
1
- export * from "./wallet.repository.js";
2
- export * from "./wallet-manager.session.js";
3
1
  export * from "./wallet.dtos.js";
2
+ export * from "./wallet.model.js";
3
+ export * from "./statement-entry.model.js";
4
+ export * from "./narration.model.js";
5
+ export * from "./wallet.repository.js";
4
6
  export * from "./wallet.utils.js";
7
+ export * from "./wallet-manager.session.js";
@@ -1,4 +1,4 @@
1
- import { ContactInfo, MobileContactInfo, BankContactInfo } from "./contact-info.model.js";
1
+ import { ContactInfo, MobileContactInfo, BankContactInfo } from "../contact/contact-info.model.js";
2
2
  /** Prefix for Ecobank mobile transfer narrations */
3
3
  export declare const ECOBANK_PREFIX = "MOBILE TRANSFER ";
4
4
  /** V2 format prefix for payout narrations using contact details */
@@ -1,4 +1,4 @@
1
- import { WalletStatementEntryDTO } from "@/features/wallet/wallet.dtos.js";
1
+ import { WalletStatementEntryDTO } from "@/modules/wallet/wallet.dtos.js";
2
2
  import { Amount, AmountJson } from "@temboplus/frontend-core";
3
3
  import { NarrationJson, Narration } from "./narration.model.js";
4
4
  /**
@@ -1,6 +1,6 @@
1
1
  import { Country, type CountryCode } from "@temboplus/frontend-core";
2
- import { Wallet } from "../../models/wallet.model.js";
3
- import { User } from "../../models/user.model.js";
2
+ import { Wallet } from "./wallet.model.js";
3
+ import { User } from "../auth/user.model.js";
4
4
  /**
5
5
  * Defines the shape of the persisted wallet session state.
6
6
  * IMPORTANT: Properties like selectedWalletId/selectedCountryCode are guaranteed
@@ -1,5 +1,5 @@
1
1
  import { type CurrencyCode, type ISO2CountryCode } from "@temboplus/frontend-core";
2
- import { WalletDTO, WalletDTOSchemas } from "@/features/wallet/wallet.dtos.js";
2
+ import { WalletDTO, WalletDTOSchemas } from "@/modules/wallet/wallet.dtos.js";
3
3
  /**
4
4
  * Represents a digital Wallet entity.
5
5
  *
@@ -1,6 +1,6 @@
1
1
  import { Amount } from "@temboplus/frontend-core";
2
- import { WalletStatementEntry } from "../../models/statement-entry.model.js";
3
- import { Wallet } from "../../models/wallet.model.js";
2
+ import { WalletStatementEntry } from "./statement-entry.model.js";
3
+ import { Wallet } from "./wallet.model.js";
4
4
  import { WalletDTOSchemas } from "./wallet.dtos.js";
5
5
  import { z } from "zod";
6
6
  import { contract } from "./wallet.contract.js";