@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.
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +7 -6
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/lib/api/index.d.ts +0 -1
- package/dist/lib/error/error.permission.d.ts +1 -1
- package/dist/lib/query/index.d.ts +2 -0
- package/dist/lib/query/pagination/pagination.d.ts +73 -0
- package/dist/lib/query/pagination/pagination.schemas.d.ts +83 -0
- package/dist/{features → modules}/auth/auth.contract.d.ts +2 -9
- package/dist/{features → modules}/auth/auth.manager.d.ts +2 -2
- package/dist/{features → modules}/auth/auth.repository.d.ts +18 -1
- package/dist/{features → modules}/auth/auth.store.d.ts +1 -1
- package/dist/modules/auth/index.d.ts +4 -0
- package/dist/{features → modules}/auth/storage/client-store.d.ts +1 -1
- package/dist/{features → modules}/auth/storage/types.d.ts +1 -1
- package/dist/{models → modules/auth}/user.model.d.ts +4 -3
- package/dist/{models → modules/contact}/contact-info.model.d.ts +2 -2
- package/dist/{features → modules}/contact/contact-input-handler.d.ts +1 -1
- package/dist/{models → modules/contact}/contact.model.d.ts +1 -1
- package/dist/{features → modules}/contact/contact.repository.d.ts +2 -2
- package/dist/modules/contact/index.d.ts +4 -0
- package/dist/modules/login/index.d.ts +2 -0
- package/dist/modules/login/login.model.d.ts +1 -0
- package/dist/{features/auth/identity/identity.repository.d.ts → modules/login/login.repository.d.ts} +1 -1
- package/dist/{features → modules}/payout/index.d.ts +2 -0
- package/dist/{features → modules}/payout/payout-channel-handler.d.ts +2 -2
- package/dist/{models → modules/payout}/payout.model.d.ts +2 -2
- package/dist/{features → modules}/payout/payout.repository.d.ts +28 -16
- package/dist/modules/profile/index.d.ts +3 -0
- package/dist/{models → modules/profile}/profile.model.d.ts +1 -1
- package/dist/{features/auth → modules}/profile/profile.repository.d.ts +1 -1
- package/dist/modules/user/index.d.ts +4 -0
- package/dist/{models → modules/user}/role.model.d.ts +1 -1
- package/dist/{features/admin/admin.contract.d.ts → modules/user/user.contract.d.ts} +9 -9
- package/dist/{models/managed-user.model.d.ts → modules/user/user.model.d.ts} +1 -1
- package/dist/{features/admin/admin.repository.d.ts → modules/user/user.repository.d.ts} +4 -4
- package/dist/{features → modules}/wallet/index.d.ts +5 -2
- package/dist/{models → modules/wallet}/narration.model.d.ts +1 -1
- package/dist/{models → modules/wallet}/statement-entry.model.d.ts +1 -1
- package/dist/{features → modules}/wallet/wallet-manager.session.d.ts +2 -2
- package/dist/{models → modules/wallet}/wallet.model.d.ts +1 -1
- package/dist/{features → modules}/wallet/wallet.repository.d.ts +2 -2
- package/dist/{features → modules}/wallet/wallet.utils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/features/admin/index.d.ts +0 -2
- package/dist/features/auth/access/access.api-contract.d.ts +0 -13
- package/dist/features/auth/access/access.repository.d.ts +0 -55
- package/dist/features/auth/index.d.ts +0 -5
- package/dist/features/contact/index.d.ts +0 -2
- package/dist/lib/api/common-schemas.d.ts +0 -49
- package/dist/models/index.d.ts +0 -11
- package/dist/{models/permission.d.ts → modules/auth/permission.type.d.ts} +0 -0
- package/dist/{features → modules}/auth/storage/client-token-handler.d.ts +0 -0
- package/dist/{features → modules}/contact/contact.api-contract.d.ts +8 -8
- package/dist/{features → modules}/contact/contact.dtos.d.ts +2 -2
- package/dist/{features/auth/identity/identity.api-contract.d.ts → modules/login/login.api-contract.d.ts} +0 -0
- package/dist/{features → modules}/payout/payout.api-contract.d.ts +35 -35
- package/dist/{features → modules}/payout/payout.dtos.d.ts +22 -22
- package/dist/{features → modules}/payout/payout.query.d.ts +0 -0
- package/dist/{features/auth → modules}/profile/profile.api-contract.d.ts +0 -0
- package/dist/{features/auth → modules}/profile/profile.dtos.d.ts +0 -0
- package/dist/{features/admin/admin.dtos.d.ts → modules/user/user.dtos.d.ts} +0 -0
- package/dist/{features → modules}/wallet/wallet.contract.d.ts +6 -6
- package/dist/{features → modules}/wallet/wallet.dtos.d.ts +12 -12
package/dist/lib/api/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Permission } from "@/
|
|
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.
|
|
@@ -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 "@/
|
|
2
|
-
import { User } from "@/
|
|
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 "@/
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import { type StoreApi, type UseBoundStore } from "zustand";
|
|
2
2
|
import type { AuthStore } from "./types.js";
|
|
3
|
-
import { User } from "@/
|
|
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,5 @@
|
|
|
1
|
-
import {
|
|
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:
|
|
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:
|
|
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 "@/
|
|
2
|
-
import { PayoutDTO } from "@/
|
|
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 "@/
|
|
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 "@/
|
|
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 "@/
|
|
3
|
-
import { Contact } from "@/
|
|
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 @@
|
|
|
1
|
+
export {};
|
package/dist/{features/auth/identity/identity.repository.d.ts → modules/login/login.repository.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { identityContract } from "./
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import { ContactInfo, BankContactInfo } from "@/
|
|
2
|
-
import { Wallet } from "@/
|
|
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 "@/
|
|
1
|
+
import { PayoutDTO, PayoutStatus, PayoutApprovalStatus, PayoutAuthorizer } from "@/modules/payout/payout.dtos.js";
|
|
2
2
|
import { Amount } from "@temboplus/frontend-core";
|
|
3
|
-
import { ContactInfo } from "
|
|
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
|
|
2
|
-
import { ContactInfo } from "@/
|
|
3
|
-
import { Payout } from "@/
|
|
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
|
|
49
|
-
*
|
|
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
|
|
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
|
-
*
|
|
75
|
-
*
|
|
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
|
*
|
|
@@ -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 "
|
|
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.
|
|
@@ -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("./
|
|
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("./
|
|
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("./
|
|
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("./
|
|
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("./
|
|
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,8 +1,8 @@
|
|
|
1
1
|
import { BaseRepository } from "@/lib/api/base-repository.js";
|
|
2
|
-
import { ManagedUser } from "@/
|
|
3
|
-
import { Role } from "@/
|
|
4
|
-
import { userManagementContract } from "./
|
|
5
|
-
import { CreateUserRequestDTO, CreateUserResponseDTO, UpdateUserRequestDTO, ResetPasswordRequestDTO, ManagedUserQueryParamsDTO } from "./
|
|
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 "
|
|
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 "@/
|
|
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 "
|
|
3
|
-
import { User } from "
|
|
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 "@/
|
|
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 "
|
|
3
|
-
import { Wallet } from "
|
|
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";
|