From 0e1a442a5a894ff46f44da876b5aeb1c22f0f598 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 30 Aug 2023 13:17:21 -1000 Subject: [PATCH 1/4] Change Card to Fund --- src/types/onyx/{Card.ts => Fund.ts} | 4 ++-- src/types/onyx/index.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename src/types/onyx/{Card.ts => Fund.ts} (94%) diff --git a/src/types/onyx/Card.ts b/src/types/onyx/Fund.ts similarity index 94% rename from src/types/onyx/Card.ts rename to src/types/onyx/Fund.ts index 71ef3d4d98e7..7c7c0445081a 100644 --- a/src/types/onyx/Card.ts +++ b/src/types/onyx/Fund.ts @@ -20,7 +20,7 @@ type AccountData = { fundID?: number; }; -type Card = { +type Fund = { accountData?: AccountData; accountType?: string; description?: string; @@ -29,4 +29,4 @@ type Card = { title?: string; }; -export default Card; +export default Fund; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 8d48eccf1464..eafc0af26032 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -23,7 +23,7 @@ import WalletOnfido from './WalletOnfido'; import WalletAdditionalDetails from './WalletAdditionalDetails'; import WalletTerms from './WalletTerms'; import BankAccount from './BankAccount'; -import Card from './Card'; +import Card from './Fund'; import WalletStatement from './WalletStatement'; import PersonalBankAccount from './PersonalBankAccount'; import FrequentlyUsedEmoji from './FrequentlyUsedEmoji'; From 12eb7c4695d96c72b936ec35fcda9c869cec3350 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 30 Aug 2023 13:28:43 -1000 Subject: [PATCH 2/4] Add Onyx type for Card --- src/types/onyx/Card.ts | 22 ++++++++++++++++++++++ src/types/onyx/index.ts | 4 +++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/Card.ts diff --git a/src/types/onyx/Card.ts b/src/types/onyx/Card.ts new file mode 100644 index 000000000000..8ac5ee2350e0 --- /dev/null +++ b/src/types/onyx/Card.ts @@ -0,0 +1,22 @@ +type FraudState = 'none' | 'domain' | 'individual'; +type State = +3 /* OPEN */ | +4 /* NOT_ACTIVATED */ | +5 /* STATE_DEACTIVATED */ | +6 /* CLOSED */ | +7 /* STATE_SUSPENDED */; + +type Card = { + cardID: number, + isVirtual: boolean, + domainName: string, + cardholderFirstName: string, + cardholderLastName: string, + fraud: FraudState, + bank: string, + state: State, + availableSpend: number, + maskedPan: string, +}; + +export default Card; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index eafc0af26032..ea7630c86bd5 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -23,7 +23,8 @@ import WalletOnfido from './WalletOnfido'; import WalletAdditionalDetails from './WalletAdditionalDetails'; import WalletTerms from './WalletTerms'; import BankAccount from './BankAccount'; -import Card from './Fund'; +import Fund from './Fund'; +import Card from './Card'; import WalletStatement from './WalletStatement'; import PersonalBankAccount from './PersonalBankAccount'; import FrequentlyUsedEmoji from './FrequentlyUsedEmoji'; @@ -70,6 +71,7 @@ export type { WalletTerms, BankAccount, Card, + Fund, WalletStatement, PersonalBankAccount, ReimbursementAccount, From 1d633ebf0f264e8988d753621970d1271280db6f Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Fri, 1 Sep 2023 11:49:33 -1000 Subject: [PATCH 3/4] Remove extra Fund.ts import --- src/types/onyx/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index bd6a0613546e..039448fac531 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -23,7 +23,6 @@ import WalletOnfido from './WalletOnfido'; import WalletAdditionalDetails from './WalletAdditionalDetails'; import WalletTerms from './WalletTerms'; import BankAccount from './BankAccount'; -import Fund from './Fund'; import Card from './Card'; import Fund from './Fund'; import WalletStatement from './WalletStatement'; From 060d6c1193fefe54964ab508aeb65ecd8428987d Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Tue, 5 Sep 2023 14:52:28 -1000 Subject: [PATCH 4/4] Fix style --- src/types/onyx/Card.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/types/onyx/Card.ts b/src/types/onyx/Card.ts index 01c7772bd86f..1efa5906360e 100644 --- a/src/types/onyx/Card.ts +++ b/src/types/onyx/Card.ts @@ -1,16 +1,11 @@ import {ValueOf} from 'type-fest'; import CONST from '../../CONST'; -type State = -3 /* OPEN */ | -4 /* NOT_ACTIVATED */ | -5 /* STATE_DEACTIVATED */ | -6 /* CLOSED */ | -7 /* STATE_SUSPENDED */; +type State = 3 /* OPEN */ | 4 /* NOT_ACTIVATED */ | 5 /* STATE_DEACTIVATED */ | 6 /* CLOSED */ | 7 /* STATE_SUSPENDED */; type Card = { cardID: number; - state: State, + state: State; bank: string; availableSpend: number; domainName: string;