Skip to content

[HOLD for payment 2024-06-03] [Violations - Pending Receipts] Display the rter Violation with the Pending Pattern #39533

Description

@yuwenmemon

Design Doc: https://docs.google.com/document/d/1zJqlTe_RajuBtfQYvbMx8PpXgA9CEnUGVyuqZihQ-ok/edit
Tracking GH: https://github.com/Expensify/Expensify/issues/372206

HOLD ON https://github.com/Expensify/Expensify/issues/384996


Similar to how we have TransactionUtils.isPending and TransactionUtils.isReceiptBeingScanned in NewDot to help us with other pending UI flows, we'll add a new method: TransactionUtils.hasPendingRTERViolation:

TransactionUtils.hasPendingRTERViolation

This will have a similar structure to the current TransactionUtils methods that check for / retrieve violations.

  • Params:
    • transactionID: string
    • transactionViolations: TransactionViolation[] - the set of violations for that specific transaction. For components where we are subscribing to all violations we can use the output of TransactionUtils.getTransactionViolations
  • Returns:
    • A boolean: If any of the violations for that transactionID in Onyx are the rter violation, with pendingPattern set to true

Additionally, because this will be called frequently with TransactionUtils.isPending and TransactionUtils.isReceiptBeingScanned let's also make and utilize a method that returns true if any of those return true: hasPendingUI()

We'll outline this in further detail below, but we'll call this method in:

  1. MoneyRequestPreviewContent.tsx
  2. ReportPreview.tsx
  3. MoneyRequestHeader.tsx

The first two already have access to the transactionViolations onyx collection key. However, we will need to add it to MoneyRequestHeader.tsx.

Updates to ReportActionItems: MoneyRequestPreview / ReportPreview

Now that we know if our transaction has the "7-Day Hold" rter violation, we can adjust the UI to reflect that it's "Pending". For ReportActionItem rows, we will do the same thing that was outlined for pending transactions and scanning receipts in the Update how we display / report expenses doc.
Screenshot 2024-04-03 at 11 27 42 AM

We will show the "pending" hover/message/icon UI for these two cases:

Updates to MoneyReportHeader

Similar to what we're doing for the Report Preview above, if the report contains only transactions with the rter violation (which again, we'll alias as hasPendingRTERViolation) we'll show the Next Steps banner indicating that the receipts are pending match with a credit card.

We'll also hide the Submit/Approve/Pay buttons in this case as well (i.e. all transactions are pending).

In the case of the "One-Expense" Chat, we'll use the same pattern as the MoneyRequestHeader as described below.

Updates to MoneyRequestHeader

If hasPendingRTERViolation is true, we'll show a MoneyRequestHeaderStatusBar in the MoneyRequestHeader here. This will be similar to what we already do for isPending and isScanning. The message will utilize the same hourglass icon and have the copy as seen below.

Let's also refactor this to be a bit less repetitive. We can create a getPendingType() method that checks if the transaction is RTER vs SCANNING vs PENDING and returns the translations keyed by that type.

Screenshot 2024-04-03 at 11 34 09 AM

"Mark as cash" Button

This will be covered in a separate issue

Issue OwnerCurrent Issue Owner: @mallenexpensify

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringInternalRequires API changes or must be handled by Expensify staffNewFeatureSomething to build that is a new item.

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions