Skip to content

Commit

Permalink
Fixed conflicts and linter issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
fvlvte committed Oct 5, 2023
1 parent 5b93413 commit 0589037
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
34 changes: 18 additions & 16 deletions src/libs/models/BankAccount.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import Str from 'expensify-common/lib/str';
import {ValueOf} from 'type-fest';
import CONST from '../../CONST';
import { ValueOf } from "type-fest";
import BankAccountJSON, {AdditionalData} from "../../types/onyx/BankAccount";
import BankAccountJSON, {AdditionalData} from '../../types/onyx/BankAccount';

type State = ValueOf<typeof BankAccount.STATE>;

type BankAccountType = "withdrawal" | "direct-deposit";
type BankAccountType = 'withdrawal' | 'direct-deposit';

type ACHData = {
routingNumber: string,
accountNumber: string,
addressName: string,
isSavings: boolean,
bankAccountID: number,
state: State,
validateCodeExpectedDate: string,
needsToUpgrade: boolean,
routingNumber: string;
accountNumber: string;
addressName: string;
isSavings: boolean;
bankAccountID: number;
state: State;
validateCodeExpectedDate: string;
needsToUpgrade: boolean;
};

class BankAccount {
Expand All @@ -27,7 +27,9 @@ class BankAccount {
SETUP: 'SETUP',
VERIFYING: 'VERIFYING',
};

private readonly json: BankAccountJSON;

constructor(accountJSON: BankAccountJSON) {
this.json = accountJSON;
}
Expand Down Expand Up @@ -146,7 +148,7 @@ class BankAccount {
*/
getClientID() {
// eslint-disable-next-line max-len
return `${Str.makeID(this.getMaskedAccountNumber() || "")}${Str.makeID(this.getAddressName() || "")}${Str.makeID(this.getRoutingNumber() || "")}${this.getType()}`;
return `${Str.makeID(this.getMaskedAccountNumber() ?? '')}${Str.makeID(this.getAddressName() ?? '')}${Str.makeID(this.getRoutingNumber() ?? '')}${this.getType()}`;
}

/**
Expand Down Expand Up @@ -175,7 +177,7 @@ class BankAccount {
* @returns - date when the 3 micro amounts for validation were supposed to reach the bank account.
*/
getValidateCodeExpectedDate(): string {
return this.json.validateCodeExpectedDate || '';
return this.json.validateCodeExpectedDate ?? '';
}

/**
Expand All @@ -189,14 +191,14 @@ class BankAccount {
* @returns - currency of the bank account.
*/
getCurrency(): string {
return this.json.accountData?.additionalData?.currency ?? "USD";
return this.json.accountData?.additionalData?.currency ?? 'USD';
}

/**
* @returns - bank name of the bank account.
*/
getBankName(): string {
return this.json.accountData?.additionalData?.bankName ?? "";
return this.json.accountData?.additionalData?.bankName ?? '';
}

/**
Expand All @@ -210,7 +212,7 @@ class BankAccount {
* @returns - Additional data of a bankAccount.
*/
getAdditionalData(): Partial<AdditionalData> {
return this.json.accountData?.additionalData || {};
return this.json.accountData?.additionalData ?? {};
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/types/onyx/BankAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ type BankAccount = {
};

export default BankAccount;
export type { AdditionalData };
export type {AdditionalData};

0 comments on commit 0589037

Please sign in to comment.