@temboplus/tembo-dashboard 0.2.7 → 0.3.0-rc.1
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 +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/lib/api/common-schemas.d.ts.map +1 -1
- package/dist/lib/models/statement-entry.model.d.ts +2 -2
- package/dist/lib/models/statement-entry.model.d.ts.map +1 -1
- package/dist/lib/query/query.builder.d.ts +10 -10
- package/dist/lib/query/query.builder.d.ts.map +1 -1
- package/dist/lib/query/query.types.d.ts +1 -1
- package/dist/lib/query/query.types.d.ts.map +1 -1
- package/dist/modules/auth/auth.api-contract.d.ts +2 -1
- package/dist/modules/auth/auth.api-contract.d.ts.map +1 -1
- package/dist/modules/auth/auth.dtos.d.ts +12 -1
- package/dist/modules/auth/auth.dtos.d.ts.map +1 -1
- package/dist/modules/auth/user.model.d.ts +10 -2
- package/dist/modules/auth/user.model.d.ts.map +1 -1
- package/dist/modules/collection/collection.api-contract.d.ts +8 -8
- package/dist/modules/collection/collection.model.d.ts +3 -3
- package/dist/modules/collection/collection.model.d.ts.map +1 -1
- package/dist/modules/collection/collection.query.d.ts.map +1 -1
- package/dist/modules/collection/collection.types.d.ts +6 -6
- package/dist/modules/collection/collection.types.d.ts.map +1 -1
- package/dist/modules/payout/payout.api-contract.d.ts +6 -6
- package/dist/modules/payout/payout.model.d.ts +3 -3
- package/dist/modules/payout/payout.model.d.ts.map +1 -1
- package/dist/modules/payout/payout.query.d.ts.map +1 -1
- package/dist/modules/payout/payout.types.d.ts +6 -6
- package/dist/modules/payout/payout.types.d.ts.map +1 -1
- package/dist/modules/settlement/index.d.ts +5 -0
- package/dist/modules/settlement/index.d.ts.map +1 -0
- package/dist/modules/settlement/settlement.api-contract.d.ts +255 -0
- package/dist/modules/settlement/settlement.api-contract.d.ts.map +1 -0
- package/dist/modules/settlement/settlement.model.d.ts +106 -0
- package/dist/modules/settlement/settlement.model.d.ts.map +1 -0
- package/dist/modules/settlement/settlement.repository.d.ts +75 -0
- package/dist/modules/settlement/settlement.repository.d.ts.map +1 -0
- package/dist/modules/settlement/settlement.types.d.ts +140 -0
- package/dist/modules/settlement/settlement.types.d.ts.map +1 -0
- package/dist/modules/vendor/index.d.ts +5 -0
- package/dist/modules/vendor/index.d.ts.map +1 -0
- package/dist/modules/vendor/vendor.api-contract.d.ts +45 -0
- package/dist/modules/vendor/vendor.api-contract.d.ts.map +1 -0
- package/dist/modules/vendor/vendor.model.d.ts +76 -0
- package/dist/modules/vendor/vendor.model.d.ts.map +1 -0
- package/dist/modules/vendor/vendor.repository.d.ts +17 -0
- package/dist/modules/vendor/vendor.repository.d.ts.map +1 -0
- package/dist/modules/vendor/vendor.types.d.ts +17 -0
- package/dist/modules/vendor/vendor.types.d.ts.map +1 -0
- package/dist/modules/wallet/wallet.api-contract.d.ts +14 -2
- package/dist/modules/wallet/wallet.api-contract.d.ts.map +1 -1
- package/dist/modules/wallet/wallet.model.d.ts +8 -7
- package/dist/modules/wallet/wallet.model.d.ts.map +1 -1
- package/dist/modules/wallet/wallet.types.d.ts +7 -4
- package/dist/modules/wallet/wallet.types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const settlementContract: {
|
|
3
|
+
getSettlements: {
|
|
4
|
+
query: z.ZodObject<{
|
|
5
|
+
status: z.ZodOptional<z.ZodEnum<typeof import("./settlement.types.js").SETTLEMENT_STATUS>>;
|
|
6
|
+
accountNo: z.ZodOptional<z.ZodString>;
|
|
7
|
+
walletId: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, z.core.$catchall<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
9
|
+
summary: "List settlements";
|
|
10
|
+
description: "Retrieve settlements belonging to your vendor, with optional filtering and sorting via query params";
|
|
11
|
+
method: "GET";
|
|
12
|
+
path: "";
|
|
13
|
+
responses: {
|
|
14
|
+
200: z.ZodArray<z.ZodObject<{
|
|
15
|
+
id: z.ZodString;
|
|
16
|
+
date: z.ZodString;
|
|
17
|
+
initiatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
|
+
initiatedById: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
19
|
+
actionedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
|
+
actionedById: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
|
+
vendorId: z.ZodString;
|
|
22
|
+
walletId: z.ZodString;
|
|
23
|
+
accountNo: z.ZodString;
|
|
24
|
+
status: z.ZodEnum<typeof import("./settlement.types.js").SETTLEMENT_STATUS>;
|
|
25
|
+
statusCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
26
|
+
description: z.ZodString;
|
|
27
|
+
bankAccountNo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
|
+
bankAccountName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
29
|
+
bankCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
30
|
+
amount: z.ZodNumber;
|
|
31
|
+
payoutId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
32
|
+
transactionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
33
|
+
createdAt: z.ZodString;
|
|
34
|
+
updatedAt: z.ZodString;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
401: z.ZodObject<{
|
|
37
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
38
|
+
error: z.ZodOptional<z.ZodString>;
|
|
39
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
40
|
+
message: z.ZodOptional<z.ZodString>;
|
|
41
|
+
statusCode: z.ZodLiteral<401>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
403: z.ZodObject<{
|
|
44
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
45
|
+
error: z.ZodOptional<z.ZodString>;
|
|
46
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
47
|
+
message: z.ZodOptional<z.ZodString>;
|
|
48
|
+
statusCode: z.ZodLiteral<403>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
500: z.ZodObject<{
|
|
51
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
52
|
+
error: z.ZodOptional<z.ZodString>;
|
|
53
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
54
|
+
message: z.ZodOptional<z.ZodString>;
|
|
55
|
+
statusCode: z.ZodLiteral<500>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
getSettlement: {
|
|
60
|
+
pathParams: z.ZodObject<{
|
|
61
|
+
id: z.ZodString;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
summary: "Get settlement details";
|
|
64
|
+
description: "Retrieve detailed information about a specific settlement";
|
|
65
|
+
method: "GET";
|
|
66
|
+
path: "/:id";
|
|
67
|
+
responses: {
|
|
68
|
+
200: z.ZodObject<{
|
|
69
|
+
id: z.ZodString;
|
|
70
|
+
date: z.ZodString;
|
|
71
|
+
initiatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
72
|
+
initiatedById: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
73
|
+
actionedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
74
|
+
actionedById: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
75
|
+
vendorId: z.ZodString;
|
|
76
|
+
walletId: z.ZodString;
|
|
77
|
+
accountNo: z.ZodString;
|
|
78
|
+
status: z.ZodEnum<typeof import("./settlement.types.js").SETTLEMENT_STATUS>;
|
|
79
|
+
statusCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
80
|
+
description: z.ZodString;
|
|
81
|
+
bankAccountNo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
82
|
+
bankAccountName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
83
|
+
bankCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
84
|
+
amount: z.ZodNumber;
|
|
85
|
+
payoutId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
86
|
+
transactionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
87
|
+
createdAt: z.ZodString;
|
|
88
|
+
updatedAt: z.ZodString;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
401: z.ZodObject<{
|
|
91
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
92
|
+
error: z.ZodOptional<z.ZodString>;
|
|
93
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
94
|
+
message: z.ZodOptional<z.ZodString>;
|
|
95
|
+
statusCode: z.ZodLiteral<401>;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
403: z.ZodObject<{
|
|
98
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
99
|
+
error: z.ZodOptional<z.ZodString>;
|
|
100
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
101
|
+
message: z.ZodOptional<z.ZodString>;
|
|
102
|
+
statusCode: z.ZodLiteral<403>;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
404: z.ZodObject<{
|
|
105
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
106
|
+
error: z.ZodOptional<z.ZodString>;
|
|
107
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
108
|
+
message: z.ZodOptional<z.ZodString>;
|
|
109
|
+
statusCode: z.ZodLiteral<404>;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
500: z.ZodObject<{
|
|
112
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
113
|
+
error: z.ZodOptional<z.ZodString>;
|
|
114
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
115
|
+
message: z.ZodOptional<z.ZodString>;
|
|
116
|
+
statusCode: z.ZodLiteral<500>;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
createSettlement: {
|
|
121
|
+
summary: "Create settlement";
|
|
122
|
+
description: string;
|
|
123
|
+
method: "POST";
|
|
124
|
+
body: z.ZodObject<{
|
|
125
|
+
accountNo: z.ZodString;
|
|
126
|
+
description: z.ZodString;
|
|
127
|
+
amount: z.ZodNumber;
|
|
128
|
+
}, z.core.$strip>;
|
|
129
|
+
path: "";
|
|
130
|
+
responses: {
|
|
131
|
+
201: z.ZodObject<{
|
|
132
|
+
status: z.ZodEnum<typeof import("./settlement.types.js").CREATE_SETTLEMENT_STATUS>;
|
|
133
|
+
data: z.ZodOptional<z.ZodObject<{
|
|
134
|
+
id: z.ZodString;
|
|
135
|
+
date: z.ZodString;
|
|
136
|
+
initiatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
137
|
+
initiatedById: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
138
|
+
actionedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
139
|
+
actionedById: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
140
|
+
vendorId: z.ZodString;
|
|
141
|
+
walletId: z.ZodString;
|
|
142
|
+
accountNo: z.ZodString;
|
|
143
|
+
status: z.ZodEnum<typeof import("./settlement.types.js").SETTLEMENT_STATUS>;
|
|
144
|
+
statusCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
145
|
+
description: z.ZodString;
|
|
146
|
+
bankAccountNo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
147
|
+
bankAccountName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
148
|
+
bankCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
149
|
+
amount: z.ZodNumber;
|
|
150
|
+
payoutId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
151
|
+
transactionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
152
|
+
createdAt: z.ZodString;
|
|
153
|
+
updatedAt: z.ZodString;
|
|
154
|
+
}, z.core.$strip>>;
|
|
155
|
+
}, z.core.$strip>;
|
|
156
|
+
400: z.ZodObject<{
|
|
157
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
158
|
+
error: z.ZodOptional<z.ZodString>;
|
|
159
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
160
|
+
message: z.ZodOptional<z.ZodString>;
|
|
161
|
+
statusCode: z.ZodLiteral<400>;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
401: z.ZodObject<{
|
|
164
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
165
|
+
error: z.ZodOptional<z.ZodString>;
|
|
166
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
167
|
+
message: z.ZodOptional<z.ZodString>;
|
|
168
|
+
statusCode: z.ZodLiteral<401>;
|
|
169
|
+
}, z.core.$strip>;
|
|
170
|
+
403: z.ZodObject<{
|
|
171
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
172
|
+
error: z.ZodOptional<z.ZodString>;
|
|
173
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
174
|
+
message: z.ZodOptional<z.ZodString>;
|
|
175
|
+
statusCode: z.ZodLiteral<403>;
|
|
176
|
+
}, z.core.$strip>;
|
|
177
|
+
500: z.ZodObject<{
|
|
178
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
179
|
+
error: z.ZodOptional<z.ZodString>;
|
|
180
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
181
|
+
message: z.ZodOptional<z.ZodString>;
|
|
182
|
+
statusCode: z.ZodLiteral<500>;
|
|
183
|
+
}, z.core.$strip>;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
actionSettlement: {
|
|
187
|
+
pathParams: z.ZodObject<{
|
|
188
|
+
id: z.ZodString;
|
|
189
|
+
}, z.core.$strip>;
|
|
190
|
+
summary: "Action settlement";
|
|
191
|
+
description: string;
|
|
192
|
+
method: "POST";
|
|
193
|
+
body: z.ZodObject<{
|
|
194
|
+
status: z.ZodEnum<typeof import("./settlement.types.js").SETTLEMENT_ACTION>;
|
|
195
|
+
}, z.core.$strip>;
|
|
196
|
+
path: "/:id/action";
|
|
197
|
+
responses: {
|
|
198
|
+
201: z.ZodObject<{
|
|
199
|
+
status: z.ZodEnum<typeof import("./settlement.types.js").ACTION_SETTLEMENT_STATUS>;
|
|
200
|
+
data: z.ZodOptional<z.ZodObject<{
|
|
201
|
+
id: z.ZodString;
|
|
202
|
+
date: z.ZodString;
|
|
203
|
+
initiatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
204
|
+
initiatedById: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
205
|
+
actionedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
206
|
+
actionedById: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
207
|
+
vendorId: z.ZodString;
|
|
208
|
+
walletId: z.ZodString;
|
|
209
|
+
accountNo: z.ZodString;
|
|
210
|
+
status: z.ZodEnum<typeof import("./settlement.types.js").SETTLEMENT_STATUS>;
|
|
211
|
+
statusCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
212
|
+
description: z.ZodString;
|
|
213
|
+
bankAccountNo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
214
|
+
bankAccountName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
215
|
+
bankCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
216
|
+
amount: z.ZodNumber;
|
|
217
|
+
payoutId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
218
|
+
transactionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
219
|
+
createdAt: z.ZodString;
|
|
220
|
+
updatedAt: z.ZodString;
|
|
221
|
+
}, z.core.$strip>>;
|
|
222
|
+
}, z.core.$strip>;
|
|
223
|
+
400: z.ZodObject<{
|
|
224
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
225
|
+
error: z.ZodOptional<z.ZodString>;
|
|
226
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
227
|
+
message: z.ZodOptional<z.ZodString>;
|
|
228
|
+
statusCode: z.ZodLiteral<400>;
|
|
229
|
+
}, z.core.$strip>;
|
|
230
|
+
401: z.ZodObject<{
|
|
231
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
232
|
+
error: z.ZodOptional<z.ZodString>;
|
|
233
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
234
|
+
message: z.ZodOptional<z.ZodString>;
|
|
235
|
+
statusCode: z.ZodLiteral<401>;
|
|
236
|
+
}, z.core.$strip>;
|
|
237
|
+
403: z.ZodObject<{
|
|
238
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
239
|
+
error: z.ZodOptional<z.ZodString>;
|
|
240
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
241
|
+
message: z.ZodOptional<z.ZodString>;
|
|
242
|
+
statusCode: z.ZodLiteral<403>;
|
|
243
|
+
}, z.core.$strip>;
|
|
244
|
+
500: z.ZodObject<{
|
|
245
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
246
|
+
error: z.ZodOptional<z.ZodString>;
|
|
247
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
248
|
+
message: z.ZodOptional<z.ZodString>;
|
|
249
|
+
statusCode: z.ZodLiteral<500>;
|
|
250
|
+
}, z.core.$strip>;
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
export type SettlementContract = typeof settlementContract;
|
|
255
|
+
//# sourceMappingURL=settlement.api-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settlement.api-contract.d.ts","sourceRoot":"","sources":["../../../src/modules/settlement/settlement.api-contract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwE7B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { Amount } from "@temboplus/frontend-core";
|
|
2
|
+
import { SETTLEMENT_STATUS } from "./settlement.types.js";
|
|
3
|
+
export interface SettlementStatusInfo {
|
|
4
|
+
label: string;
|
|
5
|
+
description: string;
|
|
6
|
+
category: "success" | "pending" | "failed";
|
|
7
|
+
color: "success" | "warning" | "error";
|
|
8
|
+
userFriendlyMessage: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const SETTLEMENT_STATUS_INFO: Record<SETTLEMENT_STATUS, SettlementStatusInfo>;
|
|
11
|
+
/**
|
|
12
|
+
* Raw settlement data as returned by the API.
|
|
13
|
+
*/
|
|
14
|
+
export interface SettlementData {
|
|
15
|
+
id: string;
|
|
16
|
+
date: string;
|
|
17
|
+
initiatedAt?: string | null;
|
|
18
|
+
initiatedById?: string | null;
|
|
19
|
+
actionedAt?: string | null;
|
|
20
|
+
actionedById?: string | null;
|
|
21
|
+
vendorId: string;
|
|
22
|
+
walletId: string;
|
|
23
|
+
accountNo: string;
|
|
24
|
+
status: SETTLEMENT_STATUS;
|
|
25
|
+
statusCode?: string | null;
|
|
26
|
+
description: string;
|
|
27
|
+
bankAccountNo?: string | null;
|
|
28
|
+
bankAccountName?: string | null;
|
|
29
|
+
bankCode?: string | null;
|
|
30
|
+
amount: number;
|
|
31
|
+
payoutId?: string | null;
|
|
32
|
+
transactionId?: string | null;
|
|
33
|
+
createdAt: string;
|
|
34
|
+
updatedAt: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Represents a settlement — a movement of funds from a vendor's
|
|
38
|
+
* wallet to their bank account.
|
|
39
|
+
*/
|
|
40
|
+
export declare class Settlement {
|
|
41
|
+
readonly id: string;
|
|
42
|
+
readonly date: Date;
|
|
43
|
+
readonly initiatedAt?: Date;
|
|
44
|
+
readonly initiatedById?: string | null;
|
|
45
|
+
readonly actionedAt?: Date;
|
|
46
|
+
readonly actionedById?: string | null;
|
|
47
|
+
readonly vendorId: string;
|
|
48
|
+
readonly walletId: string;
|
|
49
|
+
readonly accountNo: string;
|
|
50
|
+
readonly status: SETTLEMENT_STATUS;
|
|
51
|
+
readonly statusCode?: string | null;
|
|
52
|
+
readonly description: string;
|
|
53
|
+
readonly bankAccountNo?: string | null;
|
|
54
|
+
readonly bankAccountName?: string | null;
|
|
55
|
+
readonly bankCode?: string | null;
|
|
56
|
+
readonly amount: Amount;
|
|
57
|
+
readonly payoutId?: string | null;
|
|
58
|
+
readonly transactionId?: string | null;
|
|
59
|
+
readonly createdAt: Date;
|
|
60
|
+
readonly updatedAt: Date;
|
|
61
|
+
private readonly _originalData;
|
|
62
|
+
constructor(data: SettlementData);
|
|
63
|
+
/**
|
|
64
|
+
* Get access to the original data used to create this settlement
|
|
65
|
+
*/
|
|
66
|
+
getOriginalData(): Readonly<SettlementData>;
|
|
67
|
+
/**
|
|
68
|
+
* Check if the settlement is awaiting approval
|
|
69
|
+
*/
|
|
70
|
+
isPending(): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Check if the settlement was approved
|
|
73
|
+
*/
|
|
74
|
+
isApproved(): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Check if the settlement was rejected
|
|
77
|
+
*/
|
|
78
|
+
isRejected(): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Check if the settlement can still be approved or rejected.
|
|
81
|
+
* Only PENDING settlements can be actioned, and never by the
|
|
82
|
+
* user who initiated them (enforced server-side).
|
|
83
|
+
*/
|
|
84
|
+
canBeActioned(): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Get status color and label
|
|
87
|
+
*/
|
|
88
|
+
getStatusInfo(): SettlementStatusInfo;
|
|
89
|
+
/**
|
|
90
|
+
* Create Settlement instance from raw API data
|
|
91
|
+
*/
|
|
92
|
+
static from(data: unknown): Settlement | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* Create multiple Settlement instances from raw API data
|
|
95
|
+
*/
|
|
96
|
+
static createMany(dataArray: unknown[]): Settlement[];
|
|
97
|
+
/**
|
|
98
|
+
* Create Settlement instance from JSON (same shape as SettlementData)
|
|
99
|
+
*/
|
|
100
|
+
static fromJSON(json: SettlementData): Settlement | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* Convert to JSON representation (same shape as SettlementData)
|
|
103
|
+
*/
|
|
104
|
+
toJSON(): SettlementData;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=settlement.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settlement.model.d.ts","sourceRoot":"","sources":["../../../src/modules/settlement/settlement.model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAI1D,MAAM,WAAW,oBAAoB;IACnC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G,UAAU,GAAG,SAAS;IAclD;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE;IAWrD;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,UAAU,GAAG,SAAS;IAI7D;;OAEG;IACH,MAAM,IAAI,cAAc;CAGzB"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { BaseRepository } from "../../lib/api/index.js";
|
|
2
|
+
import { settlementContract } from "./settlement.api-contract.js";
|
|
3
|
+
import { Settlement } from "./settlement.model.js";
|
|
4
|
+
import { type ACTION_SETTLEMENT_STATUS, type CREATE_SETTLEMENT_STATUS, SETTLEMENT_ACTION, type SettlementFilters } from "./settlement.types.js";
|
|
5
|
+
/**
|
|
6
|
+
* Input for creating a new settlement request.
|
|
7
|
+
*/
|
|
8
|
+
export interface CreateSettlementInput {
|
|
9
|
+
/** Source wallet account number — must belong to your vendor */
|
|
10
|
+
accountNo: string;
|
|
11
|
+
description: string;
|
|
12
|
+
/** Must not be 0 */
|
|
13
|
+
amount: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Outcome of a settlement creation request.
|
|
17
|
+
* `settlement` is only present when `status` is `SUCCESS`.
|
|
18
|
+
*/
|
|
19
|
+
export interface CreateSettlementResult {
|
|
20
|
+
status: CREATE_SETTLEMENT_STATUS;
|
|
21
|
+
settlement?: Settlement;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Outcome of a settlement approval/rejection request.
|
|
25
|
+
* `settlement` is present when `status` is `SUCCESS` (updated state)
|
|
26
|
+
* or `INVALID_STATE` (current state).
|
|
27
|
+
*/
|
|
28
|
+
export interface ActionSettlementResult {
|
|
29
|
+
status: ACTION_SETTLEMENT_STATUS;
|
|
30
|
+
settlement?: Settlement;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Repository class for managing settlements through API interactions.
|
|
34
|
+
* Handles listing, creating and actioning (approving/rejecting) settlements.
|
|
35
|
+
*
|
|
36
|
+
* The create and action endpoints report expected failures via a `status`
|
|
37
|
+
* field in the response body rather than HTTP errors — the corresponding
|
|
38
|
+
* methods return that status instead of throwing, so callers must inspect it.
|
|
39
|
+
*/
|
|
40
|
+
export declare class SettlementRepository extends BaseRepository<typeof settlementContract> {
|
|
41
|
+
constructor(options?: {
|
|
42
|
+
token?: string;
|
|
43
|
+
root?: string;
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Get all settlements belonging to your vendor, with optional
|
|
47
|
+
* filtering/sorting (e.g. `{ status: SETTLEMENT_STATUS.PENDING }`)
|
|
48
|
+
*/
|
|
49
|
+
getSettlements(filters?: SettlementFilters): Promise<Settlement[]>;
|
|
50
|
+
/**
|
|
51
|
+
* Get a specific settlement by ID
|
|
52
|
+
*/
|
|
53
|
+
getSettlement(id: string): Promise<Settlement>;
|
|
54
|
+
/**
|
|
55
|
+
* Create a new settlement request, initiated by the authenticated user.
|
|
56
|
+
* Inspect `status` on the result — expected failures (e.g.
|
|
57
|
+
* `WALLET_NOT_FOUND`, `MISSING_BANK_DETAILS`) do not throw.
|
|
58
|
+
*/
|
|
59
|
+
createSettlement(input: CreateSettlementInput): Promise<CreateSettlementResult>;
|
|
60
|
+
/**
|
|
61
|
+
* Approve or reject a PENDING settlement, actioned by the authenticated
|
|
62
|
+
* user. Inspect `status` on the result — expected failures (e.g.
|
|
63
|
+
* `INVALID_STATE`, `SELF_ACTION_NOT_ALLOWED`) do not throw.
|
|
64
|
+
*/
|
|
65
|
+
actionSettlement(id: string, action: SETTLEMENT_ACTION): Promise<ActionSettlementResult>;
|
|
66
|
+
/**
|
|
67
|
+
* Convenience wrapper for approving a settlement
|
|
68
|
+
*/
|
|
69
|
+
approveSettlement(id: string): Promise<ActionSettlementResult>;
|
|
70
|
+
/**
|
|
71
|
+
* Convenience wrapper for rejecting a settlement
|
|
72
|
+
*/
|
|
73
|
+
rejectSettlement(id: string): Promise<ActionSettlementResult>;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=settlement.repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settlement.repository.d.ts","sourceRoot":"","sources":["../../../src/modules/settlement/settlement.repository.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAuB,MAAM,uBAAuB,CAAC;AACxE,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,iBAAiB,EACjB,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AAE/B;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,wBAAwB,CAAC;IACjC,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,wBAAwB,CAAC;IACjC,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,qBAAa,oBAAqB,SAAQ,cAAc,CAAC,OAAO,kBAAkB,CAAC;gBACrE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE;IAIvD;;;OAGG;IACG,cAAc,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAMxE;;OAEG;IACG,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAUpD;;;;OAIG;IACG,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAarF;;;;OAIG;IACG,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAgB9F;;OAEG;IACG,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAIpE;;OAEG;IACG,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAGpE"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Lifecycle statuses of a settlement.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum SETTLEMENT_STATUS {
|
|
6
|
+
PENDING = "PENDING",
|
|
7
|
+
APPROVED = "APPROVED",
|
|
8
|
+
REJECTED = "REJECTED"
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Actions that can be taken on a `PENDING` settlement.
|
|
12
|
+
*/
|
|
13
|
+
export declare enum SETTLEMENT_ACTION {
|
|
14
|
+
APPROVED = "APPROVED",
|
|
15
|
+
REJECTED = "REJECTED"
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Outcome statuses returned in the body of `POST /settlement`.
|
|
19
|
+
* The API responds with HTTP success even for expected failures —
|
|
20
|
+
* callers must inspect this status, not just the HTTP status code.
|
|
21
|
+
*/
|
|
22
|
+
export declare enum CREATE_SETTLEMENT_STATUS {
|
|
23
|
+
SUCCESS = "SUCCESS",
|
|
24
|
+
WALLET_NOT_FOUND = "WALLET_NOT_FOUND",
|
|
25
|
+
INITIATOR_NOT_AUTHORIZED = "INITIATOR_NOT_AUTHORIZED",
|
|
26
|
+
MISSING_BANK_DETAILS = "MISSING_BANK_DETAILS",
|
|
27
|
+
UNSUPPORTED_BANK_CODE = "UNSUPPORTED_BANK_CODE",
|
|
28
|
+
FAILED = "FAILED"
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Outcome statuses returned in the body of `POST /settlement/:id/action`.
|
|
32
|
+
* The API responds with HTTP success even for expected failures —
|
|
33
|
+
* callers must inspect this status, not just the HTTP status code.
|
|
34
|
+
*/
|
|
35
|
+
export declare enum ACTION_SETTLEMENT_STATUS {
|
|
36
|
+
SUCCESS = "SUCCESS",
|
|
37
|
+
SETTLEMENT_NOT_FOUND = "SETTLEMENT_NOT_FOUND",
|
|
38
|
+
ACTIONER_NOT_AUTHORIZED = "ACTIONER_NOT_AUTHORIZED",
|
|
39
|
+
SELF_ACTION_NOT_ALLOWED = "SELF_ACTION_NOT_ALLOWED",
|
|
40
|
+
INVALID_STATE = "INVALID_STATE",
|
|
41
|
+
FAILED = "FAILED"
|
|
42
|
+
}
|
|
43
|
+
export declare const SettlementDTOSchemas: {
|
|
44
|
+
settlement: z.ZodObject<{
|
|
45
|
+
id: z.ZodString;
|
|
46
|
+
date: z.ZodString;
|
|
47
|
+
initiatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
48
|
+
initiatedById: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
49
|
+
actionedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
50
|
+
actionedById: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
51
|
+
vendorId: z.ZodString;
|
|
52
|
+
walletId: z.ZodString;
|
|
53
|
+
accountNo: z.ZodString;
|
|
54
|
+
status: z.ZodEnum<typeof SETTLEMENT_STATUS>;
|
|
55
|
+
statusCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
56
|
+
description: z.ZodString;
|
|
57
|
+
bankAccountNo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
58
|
+
bankAccountName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
59
|
+
bankCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
60
|
+
amount: z.ZodNumber;
|
|
61
|
+
payoutId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
62
|
+
transactionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
63
|
+
createdAt: z.ZodString;
|
|
64
|
+
updatedAt: z.ZodString;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
settlementStatus: z.ZodEnum<typeof SETTLEMENT_STATUS>;
|
|
67
|
+
settlementAction: z.ZodEnum<typeof SETTLEMENT_ACTION>;
|
|
68
|
+
settlementFilters: z.ZodObject<{
|
|
69
|
+
status: z.ZodOptional<z.ZodEnum<typeof SETTLEMENT_STATUS>>;
|
|
70
|
+
accountNo: z.ZodOptional<z.ZodString>;
|
|
71
|
+
walletId: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, z.core.$catchall<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
73
|
+
createSettlementRequest: z.ZodObject<{
|
|
74
|
+
accountNo: z.ZodString;
|
|
75
|
+
description: z.ZodString;
|
|
76
|
+
amount: z.ZodNumber;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
createSettlementStatus: z.ZodEnum<typeof CREATE_SETTLEMENT_STATUS>;
|
|
79
|
+
createSettlementResponse: z.ZodObject<{
|
|
80
|
+
status: z.ZodEnum<typeof CREATE_SETTLEMENT_STATUS>;
|
|
81
|
+
data: z.ZodOptional<z.ZodObject<{
|
|
82
|
+
id: z.ZodString;
|
|
83
|
+
date: z.ZodString;
|
|
84
|
+
initiatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
85
|
+
initiatedById: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
86
|
+
actionedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
87
|
+
actionedById: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
88
|
+
vendorId: z.ZodString;
|
|
89
|
+
walletId: z.ZodString;
|
|
90
|
+
accountNo: z.ZodString;
|
|
91
|
+
status: z.ZodEnum<typeof SETTLEMENT_STATUS>;
|
|
92
|
+
statusCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
93
|
+
description: z.ZodString;
|
|
94
|
+
bankAccountNo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
95
|
+
bankAccountName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
96
|
+
bankCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
97
|
+
amount: z.ZodNumber;
|
|
98
|
+
payoutId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
99
|
+
transactionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
100
|
+
createdAt: z.ZodString;
|
|
101
|
+
updatedAt: z.ZodString;
|
|
102
|
+
}, z.core.$strip>>;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
actionSettlementRequest: z.ZodObject<{
|
|
105
|
+
status: z.ZodEnum<typeof SETTLEMENT_ACTION>;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
actionSettlementStatus: z.ZodEnum<typeof ACTION_SETTLEMENT_STATUS>;
|
|
108
|
+
actionSettlementResponse: z.ZodObject<{
|
|
109
|
+
status: z.ZodEnum<typeof ACTION_SETTLEMENT_STATUS>;
|
|
110
|
+
data: z.ZodOptional<z.ZodObject<{
|
|
111
|
+
id: z.ZodString;
|
|
112
|
+
date: z.ZodString;
|
|
113
|
+
initiatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
114
|
+
initiatedById: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
115
|
+
actionedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
116
|
+
actionedById: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
117
|
+
vendorId: z.ZodString;
|
|
118
|
+
walletId: z.ZodString;
|
|
119
|
+
accountNo: z.ZodString;
|
|
120
|
+
status: z.ZodEnum<typeof SETTLEMENT_STATUS>;
|
|
121
|
+
statusCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
122
|
+
description: z.ZodString;
|
|
123
|
+
bankAccountNo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
124
|
+
bankAccountName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
125
|
+
bankCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
126
|
+
amount: z.ZodNumber;
|
|
127
|
+
payoutId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
128
|
+
transactionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
129
|
+
createdAt: z.ZodString;
|
|
130
|
+
updatedAt: z.ZodString;
|
|
131
|
+
}, z.core.$strip>>;
|
|
132
|
+
}, z.core.$strip>;
|
|
133
|
+
};
|
|
134
|
+
export type SettlementDTO = z.infer<typeof SettlementDTOSchemas.settlement>;
|
|
135
|
+
export type SettlementFilters = z.infer<typeof SettlementDTOSchemas.settlementFilters>;
|
|
136
|
+
export type CreateSettlementRequestDTO = z.infer<typeof SettlementDTOSchemas.createSettlementRequest>;
|
|
137
|
+
export type CreateSettlementResponseDTO = z.infer<typeof SettlementDTOSchemas.createSettlementResponse>;
|
|
138
|
+
export type ActionSettlementRequestDTO = z.infer<typeof SettlementDTOSchemas.actionSettlementRequest>;
|
|
139
|
+
export type ActionSettlementResponseDTO = z.infer<typeof SettlementDTOSchemas.actionSettlementResponse>;
|
|
140
|
+
//# sourceMappingURL=settlement.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settlement.types.d.ts","sourceRoot":"","sources":["../../../src/modules/settlement/settlement.types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,QAAQ,aAAa;CACtB;AAED;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,QAAQ,aAAa;IACrB,QAAQ,aAAa;CACtB;AAED;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AAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export declare const vendorContract: {
|
|
2
|
+
getMe: {
|
|
3
|
+
summary: "Get vendor profile";
|
|
4
|
+
description: "Retrieve the vendor profile of the authenticated user, including feature flags and bank details";
|
|
5
|
+
method: "GET";
|
|
6
|
+
path: "/me";
|
|
7
|
+
responses: {
|
|
8
|
+
200: import("zod").ZodObject<{
|
|
9
|
+
businessName: import("zod").ZodString;
|
|
10
|
+
tradeName: import("zod").ZodString;
|
|
11
|
+
enableCollections: import("zod").ZodNumber;
|
|
12
|
+
enablePayouts: import("zod").ZodNumber;
|
|
13
|
+
enableRemittance: import("zod").ZodNumber;
|
|
14
|
+
bankAccountNo: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
15
|
+
bankAccountName: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
16
|
+
bankCode: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
17
|
+
enableAutoSettlement: import("zod").ZodNumber;
|
|
18
|
+
disablePaymentApproval: import("zod").ZodNumber;
|
|
19
|
+
}, import("zod/v4/core").$strip>;
|
|
20
|
+
401: import("zod").ZodObject<{
|
|
21
|
+
reason: import("zod").ZodOptional<import("zod").ZodString>;
|
|
22
|
+
error: import("zod").ZodOptional<import("zod").ZodString>;
|
|
23
|
+
details: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
24
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
25
|
+
statusCode: import("zod").ZodLiteral<401>;
|
|
26
|
+
}, import("zod/v4/core").$strip>;
|
|
27
|
+
403: import("zod").ZodObject<{
|
|
28
|
+
reason: import("zod").ZodOptional<import("zod").ZodString>;
|
|
29
|
+
error: import("zod").ZodOptional<import("zod").ZodString>;
|
|
30
|
+
details: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
31
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
32
|
+
statusCode: import("zod").ZodLiteral<403>;
|
|
33
|
+
}, import("zod/v4/core").$strip>;
|
|
34
|
+
500: import("zod").ZodObject<{
|
|
35
|
+
reason: import("zod").ZodOptional<import("zod").ZodString>;
|
|
36
|
+
error: import("zod").ZodOptional<import("zod").ZodString>;
|
|
37
|
+
details: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
38
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
39
|
+
statusCode: import("zod").ZodLiteral<500>;
|
|
40
|
+
}, import("zod/v4/core").$strip>;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export type VendorContract = typeof vendorContract;
|
|
45
|
+
//# sourceMappingURL=vendor.api-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendor.api-contract.d.ts","sourceRoot":"","sources":["../../../src/modules/vendor/vendor.api-contract.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAczB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC"}
|