Skip to content

[HOLD for payment 2024-08-07] [QBO Export] Implement offline pattern B for manual report exports #43040

Description

@arosiclair

Part of QBO Export and Error Handling in NewDot

Doc section: https://docs.google.com/document/d/1aQl-AK_F6IqszWYG2aEllTsD5x3h4b8Zu0XEG0LuQ08/edit#heading=h.xw0s9oqvo44s
Project: [#whatsnext] #wave-collect

Feature Description

During review for the detailed design, we decided we should support offline pattern B when manually exporting reports here. To implement that we need to

  • Create an optimistic EXPORTINTEGRATION action in our Report.exportToIntegration and Report.markAsManuallyExported actions
    • The text should say started exporting this report to {integration}...
  • Pass the optimisticReportActionID to both Report_Export and MarkAsExported APIs
  • Use the ID to create the action in Auth
    • Auth will queue updates for the report action with the final text: exported this report to {integration}. [View out-of-pocket expenses].
  • On failure
    • create the INTEGRATIONSMESSAGE action with the error message like normal (using a different ID)
    • delete the optimistic action on the frontend using failureData

Manual Test Steps

Sucessful offline export

  1. Submit an expense report
  2. Log in as the workspace admin
  3. Approve the report
  4. Go offline
  5. 3-dot menu > Export > Quickbooks Online
  6. Verify a semi-transparent started exporting this report to QuickBooks Online... message shows
  7. Go online
  8. Verify the action becomes fully opaque
  9. Wait a few seconds
  10. Verify the action updates to exported this report to QuickBooks Online. [View out-of-pocket expenses].

Failed offline export

Prerequisites

  • Add a chart of account (category) to QBO that you can delete later

Steps

  1. Create a report with an expense
  2. Categorize the expense using the new QBO category
  3. Submit it
  4. Log in as the workspace admin and approve the report
  5. Log into QBO and deactivate the chart of account for the category (Menu > Transactions > Chart of accounts > {account} menu > Make inactive)
  6. Go offline in NewDot
  7. Export the report to QBO (3-dot menu > Export > Quickbooks Online)
  8. Verify a semi-transparent started exporting this report to QuickBooks Online... message shows
  9. Go online
  10. Verify the action becomes fully opaque
  11. Wait a few seconds
  12. Verify a report export error message is added the report

Automated Tests

  • Verify optimisticData for the INTEGRATIONSMESSAGE is merged for both Report.exportToIntegration and Report.markAsManuallyExported actions
  • Verify failureData removes the action
Issue OwnerCurrent Issue Owner: @dylanexpensify

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2NewFeatureSomething to build that is a new item.

Type

No type

Fields

No fields configured for issues without a type.

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions