Vendor matching CC - R1: App Phase 2 (Default vendor row)#91880
Draft
Beamanator wants to merge 1 commit into
Draft
Vendor matching CC - R1: App Phase 2 (Default vendor row)#91880Beamanator wants to merge 1 commit into
Beamanator wants to merge 1 commit into
Conversation
Mirrors the existing Vendor Bill default vendor flow, gated by the `vendorMatching` beta + QBO Credit/Debit-card export config so the row only appears for workspaces where the Phase 1 fuzzy matcher can actually use it. Uses the `updateQuickbooksOnlineNonReimbursableCreditCardDefaultVendor` action shipped in Phase 1 (#91235).
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
62 tasks
Contributor
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
Phase 2 of Vendor matching CC - R1: App — adds the workspace-admin "Default vendor" row in QBO Company Card export settings for Credit/Debit-card export destinations. Mirrors the existing Vendor Bill default-vendor flow.
The new row appears in
DynamicQuickbooksCompanyCardExpenseAccountPagewheneverhasVendorFeature(policy, isBetaEnabled(BETAS.VENDOR_MATCHING))is true — i.e., the workspace has thevendorMatchingbeta enabled AND QBO is connected withnonReimbursableExpensesExportDestinationset toCREDIT_CARDorDEBIT_CARD. Tapping the row navigates to a newQuickbooksNonReimbursableCreditCardDefaultVendorSelectPage(RHP), which lets the admin pick a vendor fromconnections.qbo.data.vendors; selection calls theupdateQuickbooksOnlineNonReimbursableCreditCardDefaultVendoraction shipped in Phase 1.Why this looks small
Three pieces of the original Phase 2 plan have been intentionally deferred:
Policy.areVendorsEnabled+MORE_FEATURES.ARE_VENDORS_ENABLED+ locked More Features card — verified that neither Auth nor Web-Expensify has a server-sideareVendorsEnabledpolicy NVP today (only the transaction-levelvendorNVP from the Auth foundation PR) and the PHP fuzzy matcher in the Web-Expensify commands and event hooks PR gates onBETA_VENDOR_MATCHING+ QBO config alone, not on any per-workspace toggle. Adding the App-side toggle would be pure UI state with no server-side enforcement — would need a coordinated Auth + Web-E change first. Until that lands, the right gate ishasVendorFeature(policy, beta)(existing from Phase 1), which is what this PR consumes. The Vendors More Features card itself can be added in a future PR alongside the server-toggle work if/when the design calls for it.pushTransactionViolationsOnyxDatacallers (export-type change + vendor-list sync) —selectExportCompanyCarduses the genericupdateManyPolicyConnectionConfigsand atomically writes three fields in one API call, so threading the violation push into that flow requires either refactoring out of the generic helper or introducing a vendor-specific wrapper action. The vendor-list sync (callsite 2) has no existing hook pattern (no Onyx subscriber or server-push currently). Since zero workspaces are on thevendorMatchingbeta today and the client-side violation recompute happens lazily on any next transaction edit, the cost-of-delay is essentially nil. Worth handling properly in a focused Phase 2b PR rather than rushed here.The Phase 1 PR description called Phase 2 "workspace settings". This PR delivers the Default vendor settings — the only piece that doesn't require new server coordination, an Onyx subscriber, or a nav-config diff bigger than the actual logic.
Cross-PR dependencies
UpdateMoneyRequestVendorcommand +inactiveVendorviolation type. Not consumed by this PR directly, but the App Phase 1 PR consumed it.UpdateQuickbooksOnlineNonReimbursableCreditCardDefaultVendorPHP wrapper command this PR's UI will call. Until that deploys, the row renders and lets admins pick a vendor, but the API write will return a not-found-command error on prod.Fixed Issues
$ https://github.com/Expensify/Expensify/issues/638653
PROPOSAL: N/A (internal feature, no external proposal)
Tests
Prerequisite: a workspace with the
vendorMatchingbeta enabled, QBO connected, and non-reimbursable export destination set to either Credit Card or Debit Card.Settings > Accounting. ClickConnections > QuickBooks Online > Export > Company card expenses.Vendor Bill(back on the previous page). Verify the new CC/DC default vendor row disappears.Credit CardorDebit Card. Verify the row reappears with the previously-set value preserved.vendorMatchingbeta disabled on the workspace, verify the row is hidden regardless of export destination.Offline tests
Same as Tests, executed with the network disabled after step 1. Verify the row renders from cached Onyx state and that selecting a vendor surfaces the standard offline pending-action indicator (the same
OfflineWithFeedbackwrapping the existing Vendor Bill default-vendor row).QA Steps
Same as Tests, but requires
vendorMatchingbeta enablement on the QA workspace. The row has no end-user-visible effect outside of QBO admin workspace settings, so QA scope is limited to verifying the row's visibility branches and that the select-and-save round-trip lands on the workspace config.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps./** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)Screenshots/Videos
To be added once a local build is up — the row is structurally identical across platforms (single
MenuItemWithTopDescription+ RHPSelectionScreen) so platform-specific captures will be uniform.Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari