@documents
@lambda_documents_payee
Feature: EUR Bank Details - Payoneer and Abacus Approved for Spain

  Background:
    Given an orchard employee label_7123_admin_5 for abacus
    When I log in
    And I prepare an abacus account data:
      | Key              | Value                   |
      | companyBrandName | awal                    |
      | paidBy           | ORCHARD-ES              |
      | agreementType    | Orchard                 |
      | currency         | USD                     |
      | owner            | awal                    |
      | paymentMethod    | payoneer_whitelabel     |
      | paymentMinimum   | 123                     |
      | paymentSchedule  | 45 days after month end |
    When I send request to create 1 account via API
    When I grant payee_management access for label_6971 to the created account via API
    And I fill general details
    Then I update payoneer id in DB to 100246490

  @id_8a2b398b4d4fb03725ae86cffa6f2b0fd0079c292eb9d88e8e53477a33f2fbdd
  Scenario: Eur Bank Details approved for Personal Account and Company Bank Account type and I can edit Bank Details
    Given an orchard employee label_6971 for documents
    When I log in
    Then I see that documents page loads
    When I can see that documents Banking & Tax Settings page works for created account
    When I delete Payoneer account for created account
    Then I can see empty Bank Details
    When I add company details for Spain for Personal Account account type
    Then I set valid phone number 600123***
    Then I check that button Next is disabled
    When I set email for Personal account
    Then I click next on Bank Details form
    When I add Company bank account for Spain and EUR
    Then I submit the bank details form
    And I can see that status is changed to Bank details in review
    Given an orchard employee label_7123_admin_5 for abacus
    When I log in
    Then I should be able to search for an account by name with navigation true
    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
    Given an orchard employee label_6971 for documents
    When I log in
    When I can see that documents Banking & Tax Settings page works for created account
    And I can see that status is changed to Bank details were successfully approved. You can now dismiss this message
    When I check that Bank Details updated for account
