@documents
@lambda_documents_payee
Feature: EUR Bank Details - Payoneer and Abacus Edit
  For edit flow we are using payee_id 1000001 and attached to account_id = 39
  https://github.com/theorchard/python-rds-utils/pull/346 for Payoneer, this payee_id already passed KYC

  @id_2e1a3148bf037faa99962ad2b74f25b87ccf1734e910cadbc475b25e8fb76f2f
  Scenario: Eur Bank Details for Personal Bank Account type edit flow ES
    Given an orchard employee label_6971 for documents
    When I log in to documents
    Then I am successfully logged in to documents
    Then I can see that documents Banking & Tax Settings page works with whitelabel account name orchard_es_test
    Then I update banking_details_review to approved
    Then I can see approved Bank Details
    Then I click to edit bank details
    And I edit bank account and Company details for Spain
    Then I log out of documents
    Given an orchard employee label_7123_admin_1 for abacus ignoring host override
    When I log in to Abacus
    And I am successfully logged in to Abacus
    Then I can find account by account name and go to info tab orchard_es
    Then I set bank details status as payoneer with webhook to approved
    And I can see that Payment details status is Received on
    And I can see that Payment details status is Bank details have passed KYC checks
    And I can see that Payment details status is Review Bank Details
    Then I approve Banking Details
    Then I log out of abacus
    Given an orchard employee label_6971 for documents
    When I log in to documents
    Then I am successfully logged in to documents
    Then I can see that documents Banking & Tax Settings page works with whitelabel account name orchard_es_test
    And I can see that status is changed to Bank details were successfully approved. You can now dismiss this message
    And I can see that Bank Details for Business account were updated with edit form for country Spain
    Then I log out of documents

  @id_5ee3aec3bae9dfbc9dc1aa6b1e09cc5c9e7aa9582b6a949fe257febf76998a47
  Scenario: Eur Bank Details for Business Account type edit flow US
    Given an orchard employee label_6971 for documents
    When I log in to documents
    Then I am successfully logged in to documents
    Then I can see that documents Banking & Tax Settings page works with whitelabel account name orchard_us_test
    Then I update banking_details_review to approved
    Then I can see approved Bank Details
    Then I click to edit bank details
    And I edit bank account and Personal details for US
    Then I log out of documents
    Given an orchard employee label_7123_admin_1 for abacus ignoring host override
    When I log in to Abacus
    And I am successfully logged in to Abacus
    Then I can find account by account name and go to info tab orchard_us
    Then I set bank details status as payoneer with webhook to approved
    And I can see that Payment details status is Received on
    And I can see that Payment details status is Bank details have passed KYC checks
    And I can see that Payment details status is Review Bank Details
    Then I approve Banking Details
    # Add and Edit W-8BEN Tax Form with Tax Rate
    # This test reuses a single seeded account across scenarios, so the account must be reset to a clean state
    And Prepare the test account tax form state for testing
    And The account eligibility status is Ineligible
    # Also verifies TreatyRateToggle and TaxFormExpirationDate
    And I can add a W-8BEN tax form with signed date 2022-01-05
    # Verify the account becomes active after tax form is added
    Then The account eligibility status is Active
    Then I can update the country of residence on a W-8BEN form
    Then I log out of abacus
    Given an orchard employee label_6971 for documents
    When I log in to documents
    Then I am successfully logged in to documents
    Then I can see that documents Banking & Tax Settings page works with whitelabel account name orchard_us_test
    And I can see that status is changed to Bank details were successfully approved. You can now dismiss this message
    And I can see that Bank Details for Personal account were updated with edit form for country US
    Then I log out of documents
