@frontend_royalties
@lambda_documents
@documents
@graphql_tax_payment
@lambda_documents_payee
Feature: ES Tax Form

  @id_dc92ee05b73d53b1f0b49ea554af8e520b867ea0f9282b82192e2756b41103f5
  Scenario: Add Spain as country of Tax Residence for Business account and mainland
    Given an orchard employee label_6971 for documents
    When I log in
    Then I can see that documents Banking & Tax Settings page works with whitelabel account name orchard_es_test_pw
    Then I update abacus_state table, action name banking_details_review to approved
    Then I update abacus_state table, action name payment_eligibility to approved
    Then I update abacus_state table, action name tax_eligibility to approved
    Then I'm able to delete tax details
    Then I'm able to add Tax details for Spain as Business Account type
    And I set Spanish area to Mainland, Balearic Islands
    And I submit ES Tax Details
    Given an orchard employee label_7123_admin_5 for abacus
    When I log in
    Then I can find account by account name and go to info tab orchard_es_test_pw
    And I can see Tax information with country of residence for es_eur as Business Account

  @id_d7fbea71bc8ef24efd0d0f03d3b1cc7cc79a98f85e3f875a14454726e6865835
  Scenario: Add Spain as country of Tax Residence for Personal account and Canary island
    Given an orchard employee label_6971 for documents
    When I log in
    Then I can see that documents Banking & Tax Settings page works with whitelabel account name orchard_es_test_pw
    Then I'm able to delete tax details
    Then I'm able to add Tax details for Spain as Personal Account type
    And I set Spanish area to Canary Islands, Ceuta, Melilla
    And I submit ES Tax Details
    And I'm able to see submitted Tax details as Personal Account type
    Then I edit Tax Details for es_eur as Business Account type
    And I'm able to see submitted Tax details as Business Account type
    Given an orchard employee label_7123_admin_5 for abacus
    When I log in
    Then I can find account by account name and go to info tab orchard_es_test_pw
    And I can see Tax information with country of residence for es_eur as Business Account

  @id_280698f901e0dcf92272e33f1c4784014eba4475d3d560d63eeb6bb0be043fmn
  Scenario: Not Spanish Tax resident
    Given an orchard employee label_6971 for documents
    When I log in
    Then I can see that documents Banking & Tax Settings page works with whitelabel account name orchard_es_test_pw
    Then I update abacus_state table, action name banking_details_review to approved
    Then I update abacus_state table, action name payment_eligibility to approved
    Then I update abacus_state table, action name tax_eligibility to approved
    Then I'm able to delete tax details
    Then I click on button I’m not a Spanish resident
    And I can see text in modal window If you are a resident of Spain
    Then I click on button confirm
    When I click on button I made a mistake, I'm a Spanish resident
    Then I can see text in modal window If you are not a resident of Spain
    And I click on button confirm

  @id_280698f901e0dcf92272e33f1c4784014eba4475d3dd60d63eeb6bb0be043fda
  Scenario: Not Spanish Tax with expired certificate
    Given an orchard employee label_6971 for documents
    When I log in
    Then I can see that documents Banking & Tax Settings page works with whitelabel account name orchard_es_test_pw
    Then I update abacus_state table, action name banking_details_review to approved
    Then I update abacus_state table, action name payment_eligibility to approved
    Then I update abacus_state table, action name tax_eligibility to approved
    Then I'm able to delete tax details
    Then I click on button I’m not a Spanish resident
    And I can see text in modal window If you are a resident of Spain
    Then I click on button confirm
    When I click on button I made a mistake, I'm a Spanish resident
    Then I can see text in modal window If you are not a resident of Spain
    And I click on button confirm
    Given an orchard employee label_7123_admin_5 for abacus
    When I log in
    Then I can find account by account name and go to info tab orchard_es_test_pw
    And I can add tax details from Abacus without expired certificate
    Then I edit submitted tax details
    Then I can add tax details from Abacus with expired certificate
    Given an orchard employee label_6971 for documents
    When I log in
    Then I can see that documents Banking & Tax Settings page works with whitelabel account name orchard_es_test_pw
    And I check eligibility status in documents as Ineligible
