File tree Expand file tree Collapse file tree 5 files changed +43
-7
lines changed Expand file tree Collapse file tree 5 files changed +43
-7
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @unit-finance/unit-node-sdk" ,
3
- "version" : " 1.2.1 " ,
3
+ "version" : " 1.2.2 " ,
4
4
"description" : " " ,
5
5
"main" : " dist/unit.js" ,
6
6
"types" : " dist/unit.d.ts" ,
Original file line number Diff line number Diff line change 8
8
AccountDepositProduct ,
9
9
CloseAccountRequest ,
10
10
FreezeAccountRequest ,
11
- AccountOwnersRequest
11
+ AccountOwnersRequest ,
12
+ RepaymentInformation
12
13
} from "../types/account"
13
14
import { BaseResource } from "./baseResource"
14
15
@@ -98,6 +99,10 @@ export class Accounts extends BaseResource {
98
99
public async deactivateDaca ( accountId : string ) : Promise < UnitResponse < Account > > {
99
100
return this . httpGet < UnitResponse < Account > > ( `/${ accountId } /deactivate-daca` )
100
101
}
102
+
103
+ public async getRepaymentInformation ( accountId : string ) : Promise < UnitResponse < RepaymentInformation > > {
104
+ return this . httpGet < UnitResponse < RepaymentInformation > > ( `/${ accountId } /repayment-information` )
105
+ }
101
106
}
102
107
103
108
export interface AccountListParams extends BaseListParams {
Original file line number Diff line number Diff line change 1
- import { Unit } from "../unit"
1
+ import { StatementsListParams , Unit } from "../unit"
2
2
import dotenv from "dotenv"
3
- import { createIndividualAccount } from "./testHelpers"
3
+ import { createIndividualAccount } from "./testHelpers"
4
4
dotenv . config ( )
5
5
const unit = new Unit ( process . env . UNIT_TOKEN || "test" , process . env . UNIT_API_URL || "test" )
6
6
const statementId : string [ ] = [ ]
7
7
8
8
describe ( "Statements List" , ( ) => {
9
9
test ( "Get Statements List" , async ( ) => {
10
- const res = await unit . statements . list ( )
10
+ const params : StatementsListParams = { limit : 50 }
11
+ const res = await unit . statements . list ( params )
11
12
expect ( res . data . length ) . toBeGreaterThan ( 0 )
12
13
res . data . forEach ( element => {
13
14
if ( element . relationships . customer ) {
Original file line number Diff line number Diff line change @@ -170,6 +170,36 @@ export interface CreditAccount {
170
170
} & UnimplementedFields
171
171
}
172
172
173
+ export interface RepaymentInformation {
174
+ type : "creditAccountRepaymentInformation"
175
+ attributes : {
176
+ /**
177
+ * The amount (cents) of the total amount due, including the remainingAmountOverdue.
178
+ */
179
+ remainingAmountDue : number
180
+ /**
181
+ * The amount (cents) of the amount overdue for the current payment period.
182
+ */
183
+ remainingAmountOverdue : number
184
+ /**
185
+ * The number of repayments that have been initiated but not yet settled to a final state.
186
+ */
187
+ initiatedRepayments : number
188
+ /**
189
+ * The start date in YYYY-MM-DD format for the current statement period.
190
+ */
191
+ statementPeriodStart : string
192
+ /**
193
+ * The end date in YYYY-MM-DD format for the current statement period.
194
+ */
195
+ statementPeriodEnd : string
196
+ /**
197
+ * The date in YYYY-MM-DD format for the expected repayment for the statement period start and end.
198
+ */
199
+ nextRepaymentDueDate : string
200
+ }
201
+ }
202
+
173
203
export type CreateAccountRequest = CreateDepositAccountRequest | CreateBatchAccountRequest | CreateCreditAccountRequest
174
204
175
205
export interface CreateDepositAccountRequest {
You can’t perform that action at this time.
0 commit comments