@frontend_royalties
@ows_abacus_contract
Feature: abacus contract lifecycle - renewal rules

  @id_19aff85bcda5002d7031e25894ec36515de8e4671bffa10c4b2d1280e63df957
  Scenario: Add contract with renewal rule: Continuously Active
    Given an orchard employee label_7123_admin_4 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 active 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

  @id_19a8329199d8127426dd2dcd7cc5a3f511a68044047fa7d1ec7f2d6650c5504b
  Scenario: Add contract with renewal rule: Renew After a Certain Date
    Given an orchard employee label_7123_admin_4 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 active 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   | Renew After a Certain Date    |
    And I should be able to create Active contract with this data via new flow

  @id_b38d85534275c5510a07b15a3570d109d12768329d0bcac74b72a4efaac63fdb
  Scenario: Add contract with renewal rule: Renew Periodically
    Given an orchard employee label_7123_admin_4 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 active 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   | Renew Periodically            |
    And I should be able to create Active contract with this data via new flow

  @id_95a7c3aac0a03250ec92b81e93d26d503e1fefed58924aa186dd9adcd416c1aa
  Scenario: Add contract with no renewal rules
    Given an orchard employee label_7123_admin_4 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 active account via API
    And I have a Distribution runcontroller created
    And I should be able to create contract with no renewal rules
    Then I should be able to add renewal rules
