From 2ef086e5bb039dd2813fd50a4c209772256d84e7 Mon Sep 17 00:00:00 2001 From: Pedro Guerreiro Date: Tue, 11 Jun 2024 16:50:54 +0100 Subject: [PATCH] refactor: apply suggestions --- src/libs/TransactionUtils.ts | 2 +- src/types/onyx/OriginalMessage.ts | 16 ++++++++-------- src/types/onyx/TransactionViolation.ts | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/libs/TransactionUtils.ts b/src/libs/TransactionUtils.ts index 6e2ee68b4eff..dfdabff3666a 100644 --- a/src/libs/TransactionUtils.ts +++ b/src/libs/TransactionUtils.ts @@ -683,7 +683,7 @@ function hasViolation(transactionID: string, transactionViolations: OnyxCollecti * Checks if any violations for the provided transaction are of type 'notice' */ function hasNoticeTypeViolation(transactionID: string, transactionViolations: OnyxCollection): boolean { - return !!transactionViolations?.[ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS + transactionID]?.some((violation: TransactionViolation) => violation.type === 'notice'); + return !!transactionViolations?.[ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS + transactionID]?.some((violation: TransactionViolation) => violation.type === CONST.VIOLATION_TYPES.NOTICE); } /** diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index 8f645a411520..9b07d6212c91 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -44,13 +44,13 @@ type OriginalMessageApproved = { /** Content of the original message */ originalMessage: { - /** Approved expense amount */ + /** Approved expense report amount */ amount: number; - /** Currency of the approved expense amount */ + /** Currency of the approved expense report amount */ currency: string; - /** Report ID of the expense */ + /** Report ID of the expense report */ expenseReportID: string; }; }; @@ -91,7 +91,7 @@ type IOUDetails = { amount: number; /** Optional comment */ - comment?: string; + comment: string; /** Currency of the money sent */ currency: string; @@ -179,7 +179,7 @@ type Decision = { /** Name of the decision */ decision: DecisionName; - /** When was the decision name */ + /** When was the decision made */ timestamp?: string; }; @@ -283,13 +283,13 @@ type OriginalMessageSubmitted = { /** Content of the original message */ originalMessage: { - /** Approved expense amount */ + /** Approved expense report amount */ amount: number; - /** Currency of the approved expense amount */ + /** Currency of the approved expense report amount */ currency: string; - /** Report ID of the expense */ + /** Report ID of the expense report */ expenseReportID: string; }; }; diff --git a/src/types/onyx/TransactionViolation.ts b/src/types/onyx/TransactionViolation.ts index 745c3c260a1f..e42af30281af 100644 --- a/src/types/onyx/TransactionViolation.ts +++ b/src/types/onyx/TransactionViolation.ts @@ -66,8 +66,8 @@ type TransactionViolationData = { /** Model of a transaction violation */ type TransactionViolation = { - /** Type of transaction violation ('violation', 'notice', 'warning', ...) */ - type: string; + /** Type of transaction violation */ + type: ValueOf; /** Name of the transaction violation */ name: ViolationName;