@frontend_royalties
@ows_royalties
@ows_abacus_contract
Feature: Abacus Contracts 3

  @ows_abacus_account
  @id_f760547e585eaf12600d311b71b34d3ba83ac05cfaeac16681b8a6c306543fab
  Scenario: Search for contract
    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           | AWAL-US                 |
      | agreementType    | AWAL Core               |
      | currency         | EUR                     |
      | owner            | awal                    |
      | paymentMinimum   | 123                     |
      | paymentSchedule  | 45 days after month end |
    And I create a new account via API
    And I have a Distribution runcontroller created
    And I prepare an abacus contract data:
      | Key           | Value                         |
      | contractType  | Distribution                  |
      | signingEntity | AWAL Recordings America, Inc. |
      | renewalRule   | Continuously Active           |
    And I should be able to create Active contract with this data via new flow
    Then I should be able to search for a contract by contract_name and contract_id
    And I should be able to search for a contract by account_name and account_id
    And recent searches should be present
    And I should be able to search for a contract by contract type: Distribution
    And I should be able to search for a contract by contract type: Performer Neighbouring Rights
    And I should be able to search for a contract by accounting run status: Excluded
    And I should be able to search for a contract by accounting run status: Included
    And I should be able to search for a contract by contract status: Terminated
    And I should be able to search for a contract by contract status: Active
    And I should be able to search for a contract by contract status: To Be Terminated
    And I should be able to search for a contract by runcontroller

  @id_2ff9097d3c61ce93ae86a32f76f5855c71da95f6e3ca681e0e58bc76303cecf1
  Scenario: Contract History Reports modal and links
    Given an orchard employee label_7123_admin_3 for abacus
    When I log in
    And I prepare an abacus account data:
      | Key              | Value                   |
      | companyBrandName | awal                    |
      | paidBy           | AWAL-US                 |
      | agreementType    | AWAL Core               |
      | currency         | EUR                     |
      | owner            | awal                    |
      | paymentMinimum   | 123                     |
      | paymentSchedule  | 45 days after month end |
    And I create a new account via API
    And I have a Distribution runcontroller created
    And I prepare an abacus contract data:
      | Key           | Value                         |
      | contractType  | Distribution                  |
      | signingEntity | AWAL Recordings America, Inc. |
      | renewalRule   | Continuously Active           |
    And I should be able to create Active contract with this data via new flow
    Then I should be able to view History Reports modal and links
