@frontend_royalties
@ows_royalties
Feature: Tax Eligibility Re-evaluation on Paid By Change

  @id_99a9026074b3d1514ef0366df791b73ba2f5880c0dd3b7966cef97cab2875dd4
  Scenario: Re-evaluate payment method when Paid By changes (Wire to Payoneer)
    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-US              |
      | agreementType    | Orchard                 |
      | currency         | USD                     |
      | owner            | awal                    |
      | paymentMethod    | payoneer_wire           |
      | paymentMinimum   | 123                     |
      | paymentSchedule  | 45 days after month end |
    When I send request to create 1 account via API
    And I fill general details and update accounts to active
    Then tax_eligibility is set to "complete"
    And I have a Distribution runcontroller created
    And I have a new Distribution contract lifecycle created with accounts created for AWAL Recordings America, Inc.
    Then tax_eligibility is set to "init"
    Then payment_eligibility is set to "approved"
    Then I should be able to verify account generals details is changed and contain PAYONEER_WHITELABEL
    Then I should be able to verify account generals details is changed and contain AWAL-US

  @id_f8dc39480156990a465329e2967327b963fc4da7476ea7f37bd4402b3a5bffb8
  Scenario: Re-evaluate payment method when Paid By changes (preexisting_payoneer_account to Payoneer)
    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-US                   |
      | agreementType    | Orchard                      |
      | currency         | USD                          |
      | owner            | awal                         |
      | paymentMethod    | preexisting_payoneer_account |
      | paymentMinimum   | 123                          |
      | paymentSchedule  | 45 days after month end      |
    When I send request to create 1 account via API
    And I fill general details and update accounts to active
    Then tax_eligibility is set to "complete"
    And I have a Distribution runcontroller created
    And I have a new Distribution contract lifecycle created with accounts created for AWAL Recordings America, Inc.
    Then tax_eligibility is set to "init"
    Then payment_eligibility is set to "approved"
    Then I should be able to verify account generals details is changed and contain PAYONEER_WHITELABEL
    Then I should be able to verify account generals details is changed and contain AWAL-US
