fix(core): update
This commit is contained in:
parent
282d2bdf24
commit
f0e27bf7c8
@ -1,6 +1,6 @@
|
|||||||
import * as plugins from './bunq.plugins';
|
import * as plugins from './bunq.plugins';
|
||||||
import * as paths from './bunq.paths';
|
import * as paths from './bunq.paths';
|
||||||
import { MonetaryAccount } from './bunq.classes.monetaryaccount';
|
import { BunqMonetaryAccount } from './bunq.classes.monetaryaccount';
|
||||||
|
|
||||||
export interface IBunqConstructorOptions {
|
export interface IBunqConstructorOptions {
|
||||||
deviceName: string;
|
deviceName: string;
|
||||||
@ -92,9 +92,9 @@ export class BunqAccount {
|
|||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
});
|
});
|
||||||
const accountsArray: MonetaryAccount[] = [];
|
const accountsArray: BunqMonetaryAccount[] = [];
|
||||||
for (const apiAccount of apiMonetaryAccounts) {
|
for (const apiAccount of apiMonetaryAccounts) {
|
||||||
accountsArray.push(MonetaryAccount.fromAPIObject(this, apiAccount));
|
accountsArray.push(BunqMonetaryAccount.fromAPIObject(this, apiAccount));
|
||||||
}
|
}
|
||||||
return accountsArray;
|
return accountsArray;
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import * as plugins from './bunq.plugins';
|
import * as plugins from './bunq.plugins';
|
||||||
import { BunqAccount } from './bunq.classes.account';
|
import { BunqAccount } from './bunq.classes.account';
|
||||||
import { Transaction } from './bunq.classes.transaction';
|
import { BunqTransaction } from './bunq.classes.transaction';
|
||||||
|
|
||||||
export type TAccountType = 'joint' | 'savings' | 'bank';
|
export type TAccountType = 'joint' | 'savings' | 'bank';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* a monetary account
|
* a monetary account
|
||||||
*/
|
*/
|
||||||
export class MonetaryAccount {
|
export class BunqMonetaryAccount {
|
||||||
public static fromAPIObject(bunqAccountRef: BunqAccount, apiObject: any) {
|
public static fromAPIObject(bunqAccountRef: BunqAccount, apiObject: any) {
|
||||||
const newMonetaryAccount = new this(bunqAccountRef);
|
const newMonetaryAccount = new this(bunqAccountRef);
|
||||||
|
|
||||||
@ -105,9 +105,9 @@ export class MonetaryAccount {
|
|||||||
this.id,
|
this.id,
|
||||||
paginationOptions
|
paginationOptions
|
||||||
);
|
);
|
||||||
const transactionsArray: Transaction[] = [];
|
const transactionsArray: BunqTransaction[] = [];
|
||||||
for (const apiTransaction of apiTransactions) {
|
for (const apiTransaction of apiTransactions) {
|
||||||
transactionsArray.push(Transaction.fromApiObject(this, apiTransaction));
|
transactionsArray.push(BunqTransaction.fromApiObject(this, apiTransaction));
|
||||||
}
|
}
|
||||||
return transactionsArray;
|
return transactionsArray;
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import * as plugins from './bunq.plugins';
|
import * as plugins from './bunq.plugins';
|
||||||
import { MonetaryAccount } from './bunq.classes.monetaryaccount';
|
import { BunqMonetaryAccount } from './bunq.classes.monetaryaccount';
|
||||||
|
|
||||||
export class Transaction {
|
export class BunqTransaction {
|
||||||
public static fromApiObject(monetaryAccountRefArg: MonetaryAccount, apiObjectArg: any) {
|
public static fromApiObject(monetaryAccountRefArg: BunqMonetaryAccount, apiObjectArg: any) {
|
||||||
const newTransaction = new this(monetaryAccountRefArg);
|
const newTransaction = new this(monetaryAccountRefArg);
|
||||||
Object.assign(newTransaction, apiObjectArg.Payment);
|
Object.assign(newTransaction, apiObjectArg.Payment);
|
||||||
return newTransaction;
|
return newTransaction;
|
||||||
@ -35,9 +35,9 @@ export class Transaction {
|
|||||||
value: string;
|
value: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
public monetaryAccountRef: MonetaryAccount;
|
public monetaryAccountRef: BunqMonetaryAccount;
|
||||||
|
|
||||||
constructor(monetaryAccountRefArg: MonetaryAccount) {
|
constructor(monetaryAccountRefArg: BunqMonetaryAccount) {
|
||||||
this.monetaryAccountRef = monetaryAccountRefArg;
|
this.monetaryAccountRef = monetaryAccountRefArg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user