UNPKG

react-native-unit-components

Version:

Unit React Native components

174 lines (163 loc) 3.69 kB
import { UNIndividualCustomer } from './customer.types'; import type { Permissible, UNAddress } from './types'; export type UNAccount = UNDepositAccount | UNBatchAccount | UNCreditAccount export type UNDepositAccount = { id: string type: UNAccountType.DepositAccount attributes: { createdAt: Date updatedAt?: Date name: string depositProduct: string routingNumber: string accountNumber: Permissible<string> maskedAccountNumber?: string secondaryAccountNumber?: { routingNumber: string accountNumber: string } balance: number hold: number reserve: number available: number overdraftLimit?: number currency: string tags: { [key: string]: string } status: UNAccountStatus closeReason?: string fraudReason?: UNFraudReason closeReasonText?: string freezeReason?: string isOverdrawnWithinLimit?: boolean bankDetails?: UNBankDetails } relationships: { customer?: { data: { type: 'customer' id: string } } customers?: { data: [ { type: 'customer' id: string } ] } org: { data: { type: 'org' id: string } } } included?: UNIndividualCustomer[] } export type UNBatchAccount = { id: string type: UNAccountType.BatchAccount attributes: { createdAt: Date updatedAt?: Date name: string depositProduct: string routingNumber: string accountNumber: Permissible<string> maskedAccountNumber?: string balance: number hold: number reserve: number available: number currency: string status: UNAccountStatus closeReason?: string fraudReason?: UNFraudReason closeReasonText?: string freezeReason?: string tags?: { [key: string]: string } } relationships: { org: { data: { type: 'org' id: string } } } } export type UNCreditAccount = { type: UNAccountType.CreditAccount id: string attributes: { createdAt: Date updatedAt?: Date name: string creditTerms: string balance: number hold: number reserve: number available: number creditLimit: number currency: string tags: { [key: string]: string } status: UNAccountStatus closeReason?: UNCloseReason fraudReason?: UNFraudReason closeReasonText?: string freezeReason?: string } relationships: { customer: { data: { type: 'customer' id: string } } org: { data: { type: 'org' id: string } } } } export const enum UNAccountType { DepositAccount = 'depositAccount', BatchAccount = 'batchAccount', CreditAccount = 'creditAccount', } enum UNAccountStatus { Open = 'Open', Closed = 'Closed', Frozen = 'Frozen', } export enum UNCloseReason { Fraud = 'Fraud', ByCustomer = 'ByCustomer', } export enum UNFraudReason { ACHActivity = 'ACHActivity', CardActivity = 'CardActivity', CheckActivity = 'CheckActivity', ApplicationHistory = 'ApplicationHistory', AccountActivity = 'AccountActivity', ClientIdentified = 'ClientIdentified', IdentityTheft = 'IdentityTheft', LinkedToFraudulentCustomer = 'LinkedToFraudulentCustomer', } export enum UNAccountMenuAction { OpenAccountDetails = 'OpenAccountDetails', OpenAccountStatements = 'OpenAccountStatements', DownloadBankVerificationLetter = 'DownloadBankVerificationLetter', } export enum UNAccountMenuItem { details = 'details', statements = 'statements', bankVerification = 'bankVerification', } export interface UNBankDetails { name: string address: UNAddress }