Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.47k stars 2.82k forks source link

[Workspace Feeds] Showing the request a limit increase button, despite the settlement account being set up with plaid. #48943

Closed kevinksullivan closed 1 week ago

kevinksullivan commented 1 month ago

we're showing the button to request a limit increase, despite the settlement account being set up with a plaid connection.

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Reproducible in production?: If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): kevinksullivan88+workspacefeed@gmail.com Slack conversation: https://expensify.slack.com/archives/C036QM0SLJK/p1725976051148139

Action Performed:

  1. Add account to workspaceFeeds beta
  2. Sign in with test account
  3. Select Manage my team’s expenses
  4. Enter any business name / personal name
  5. Navigate to the workspace editor of the newly created workspace
  6. Navigate to More features tab
  7. Toggle on the feature
  8. Navigate to the Expensify Card page
  9. Select Issue new card, give the user a $2 limit
  10. Follow the steps for an OPEN bank account (option 3) of this SO
  11. Finish the setup process
  12. Issue a card
  13. Navigate back to the Expensify Card page
  14. Select the remaining limit info

Expected Result:

The Request limit increase button should not be shown. From the doc:

Remaining limit will also have a Request limit increase button when a company’s settlement account is NOT connected via plaid. When clicked the admin should be redirected to their DM with concierge, and this should also trigger a message from concierge requesting next steps for getting a higher limit (this flow exists today).

Actual Result:

The Request limit increase button is shown even though the bank account is connected to plaid.

Platforms:

Screenshots/Videos

Add any screenshot/video evidence

Onyx data:

image

{
    "title": "Alberta Bobbeth Charleson",
    "description": "Account ending in 1111",
    "methodID": 5993587,
    "key": "bankAccount-5993587",
    "accountType": "bankAccount",
    "accountData": {
        "accountNumber": "XXXXXXXXXXXX1111",
        "additionalData": {
            "acceptTerms": true,
            "addressCity": "San Francisco",
            "addressState": "CA",
            "addressStreet": "88 Kearny Street",
            "addressZipCode": "94108",
            "approvedBy": "Automatic",
            "bankName": "Bank of America",
            "beneficialOwners": [],
            "certifyTrueInformation": true,
            "companyName": "Alberta Bobbeth Charleson",
            "companyPhone": "2035210374",
            "companyTaxID": "123456789",
            "country": "US",
            "currency": "USD",
            "currentStep": "EnableStep",
            "dateSigned": "2024-09-04 19:44:16",
            "dob": "2000-08-08",
            "fieldsType": "local",
            "firstName": "Alberta",
            "hasFullSSN": true,
            "hasNoConnectionToCannabis": true,
            "incorporationDate": "2017-08-02",
            "incorporationState": "AK",
            "incorporationType": "LLC",
            "industryCode": "325910",
            "isAuthorizedToUseBankAccount": true,
            "isControllingOfficer": true,
            "isOnfidoSetupComplete": true,
            "lastName": "Charleson",
            "lastUpdate": "2024-09-10 18:26:59",
            "mask": "1111",
            "ownsMoreThan25Percent": false,
            "plaidAccessToken": "access-sandbox-c01a8176-b985-4046-bc7e-121da4604351",
            "plaidAccountID": "7AaVzJ4AywcAzm9dX8KEiXeDeG31nAidyvWNM",
            "policyID": "57086C788336F9D3",
            "requestorAddressCity": "Kearny",
            "requestorAddressState": "NJ",
            "requestorAddressStreet": "88 Kearny Avenue",
            "requestorAddressZipCode": "07032",
            "setupType": "plaid",
            "ssnLast4": "3333",
            "verifications": {
                "blackListed": {
                    "isBankAccountCopy": false,
                    "isBlackListedAddress": false,
                    "isBlackListedName": false,
                    "isBlackListedUser": false,
                    "isFlagged": false
                }
            },
            "website": "https://www.company.com"
        },
        "addressName": "Alberta Bobbeth Charleson",
        "allowDebit": true,
        "bankAccountID": 5993587,
        "created": "2024-09-04 19:41:15",
        "defaultCredit": false,
        "expensifyCardDomain": "expensify-policy57086c788336f9d3.exfy",
        "isExpensifyCardSettlementAccount": true,
        "isSavings": true,
        "processor": "bancorp",
        "riskChecked": true,
        "routingNumber": "011401533",
        "sharees": [],
        "state": "OPEN",
        "type": "BUSINESS"
    },
    "isDefault": true
}

View all open jobs on GitHub

melvin-bot[bot] commented 1 month ago

Triggered auto assignment to @jliexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

koko57 commented 1 month ago

Hey, I'm Agata from Callstack, I've been working on this feature, I can take a look 😊

jliexpensify commented 1 month ago

Thanks, assigned you!

koko57 commented 1 month ago

ok, so it's still the problem with the bankAccount objects being different in AcceptACHContractForBankAccount and OpenPaymentsPage - after we're adding a bank account we don't have the additionalData object within the bankAccount - we have a flatter structure where plaidAccountID is the property of the accountData bankAccount object not additionalData. So it works ok when we remove additionalData and we check for accountData?.plaidAccountID instead of accountData?.additionalData?.plaidAccountID.

AcceptACHContractForBankAccount

Screenshot 2024-09-11 at 09 50 24

But, when we go to Wallet page response from OpenPaymentsPage is different and it has additionalData property and SET method for Onyx, so it overwrites the bankAccount data and when we go back to the Expensify Cards page this fix doesn't work anymore - without the fix it works ok (the button is not shown).

OpenPaymentsPage

Screenshot 2024-09-11 at 09 55 43

So we need to get the bankAccount object the very same from all the requests to either check for additionalData or not.

cc @mountiny @MariaHCD

MariaHCD commented 1 month ago

Hmmm, this discrepancy sounds similar to https://github.com/Expensify/Auth/pull/12043

Seems like we need to properly clean up the formats such that they are not different across commands cc: @nkuoch

For now, can we add the plaidAccountID prop to accountData in AcceptACHContractForBankAccount? Alternatively should we just have the FE look for the prop in both accountData?.plaidAccountID and accountData?.additionalData?.plaidAccountID?

mountiny commented 1 month ago

yeah lets fix this in App for now https://expensify.slack.com/archives/C036QM0SLJK/p1726058812587419?thread_ts=1725898727.642509&cid=C036QM0SLJK and then clean the data along with https://github.com/Expensify/App/issues/47944

trjExpensify commented 1 week ago

This hit prod two weeks ago, can we close it?

jliexpensify commented 1 week ago

I don't believe there are any payments, @mountiny feel free to close if this is fixed.