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 11{
22 "name" : " @unit-finance/unit-node-sdk" ,
3- "version" : " 1.2.1 " ,
3+ "version" : " 1.2.2 " ,
44 "description" : " " ,
55 "main" : " dist/unit.js" ,
66 "types" : " dist/unit.d.ts" ,
Original file line number Diff line number Diff line change 88 AccountDepositProduct ,
99 CloseAccountRequest ,
1010 FreezeAccountRequest ,
11- AccountOwnersRequest
11+ AccountOwnersRequest ,
12+ RepaymentInformation
1213} from "../types/account"
1314import { BaseResource } from "./baseResource"
1415
@@ -98,6 +99,10 @@ export class Accounts extends BaseResource {
9899 public async deactivateDaca ( accountId : string ) : Promise < UnitResponse < Account > > {
99100 return this . httpGet < UnitResponse < Account > > ( `/${ accountId } /deactivate-daca` )
100101 }
102+
103+ public async getRepaymentInformation ( accountId : string ) : Promise < UnitResponse < RepaymentInformation > > {
104+ return this . httpGet < UnitResponse < RepaymentInformation > > ( `/${ accountId } /repayment-information` )
105+ }
101106}
102107
103108export 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"
22import dotenv from "dotenv"
3- import { createIndividualAccount } from "./testHelpers"
3+ import { createIndividualAccount } from "./testHelpers"
44dotenv . config ( )
55const unit = new Unit ( process . env . UNIT_TOKEN || "test" , process . env . UNIT_API_URL || "test" )
66const statementId : string [ ] = [ ]
77
88describe ( "Statements List" , ( ) => {
99 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 )
1112 expect ( res . data . length ) . toBeGreaterThan ( 0 )
1213 res . data . forEach ( element => {
1314 if ( element . relationships . customer ) {
Original file line number Diff line number Diff line change @@ -170,6 +170,36 @@ export interface CreditAccount {
170170 } & UnimplementedFields
171171}
172172
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+
173203export type CreateAccountRequest = CreateDepositAccountRequest | CreateBatchAccountRequest | CreateCreditAccountRequest
174204
175205export interface CreateDepositAccountRequest {
You can’t perform that action at this time.
0 commit comments