Skip to content

Commit 9f0c2fa

Browse files
authored
Merge pull request #24 from bernoullithedev/main
2 parents 5b82246 + b4fdd5b commit 9f0c2fa

2 files changed

Lines changed: 34 additions & 3 deletions

File tree

src/settlement/interface.ts

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import { CustomerSubAccount } from '../customer/interface';
1+
import { Authorization } from '../charge/interface';
2+
import { Customer, CustomerSubAccount } from '../customer/interface';
23
import { Meta, QueryParams, Response } from '../interface';
4+
import { SubAccount } from '../subaccounts/interface';
35

46
export interface SettlementQueryParams extends QueryParams {
57
subaccount?: string;
@@ -11,6 +13,7 @@ export interface Settlement {
1113
settlement_date: Date;
1214
domain: string;
1315
total_amount: number;
16+
total_processed: number;
1417
total_fees: number;
1518
status: string;
1619
id: number;
@@ -23,7 +26,31 @@ export interface ListSettlementsResponse extends Response {
2326
data: Settlement[];
2427
meta: Meta;
2528
}
26-
29+
type CustomerType = Pick<
30+
Customer,
31+
| 'id'
32+
| 'first_name'
33+
| 'last_name'
34+
| 'email'
35+
| 'phone'
36+
| 'metadata'
37+
| 'customer_code'
38+
| 'risk_action'
39+
>;
40+
type SubAccountType = Pick<
41+
SubAccount,
42+
| 'id'
43+
| 'subaccount_code'
44+
| 'business_name'
45+
| 'description'
46+
| 'primary_contact_name'
47+
| 'primary_contact_email'
48+
| 'primary_contact_phone'
49+
| 'metadata'
50+
| 'percentage_charge'
51+
| 'settlement_bank'
52+
| 'account_number'
53+
>;
2754
export interface SettlementTransaction {
2855
id: number;
2956
reference: string;
@@ -36,6 +63,10 @@ export interface SettlementTransaction {
3663
message?: string;
3764
gateway_response: string;
3865
fees: number;
66+
metadata: Record<string,unknown>;
67+
customer: CustomerType;
68+
authorization: Authorization
69+
subaccount: SubAccountType;
3970
}
4071

4172
export interface ListSettlementTransactionsResponse extends Response {

src/subaccounts/interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export interface CreateUpdateSubAccount {
5656
metadata?: string;
5757
}
5858

59-
interface SubAccount {
59+
export interface SubAccount {
6060
id: number;
6161
domain: string;
6262
subaccount_code: string;

0 commit comments

Comments
 (0)