@frontend_royalties
@ows_royalties
@ows_abacus_contract
Feature: Abacus Contract Mechanical Deductions

  Background: Clear browser
    Given I have a clear browser

  @id_e4b73084495a7c0681c32bd8c5d3ce1078b357dfab8b25544d172855768141e9
  Scenario: add Worldwide mechanical deductions
    Given an orchard employee label_7123_admin_1 for Abacus
    And I log in to Abacus silently
    And I am successfully logged in to Abacus
    And I prepare an abacus account data:
      | Key              | Value                   |
      | companyBrandName | awal                    |
      | paidBy           | AWAL-US                 |
      | agreementType    | AWAL Core               |
      | currency         | USD                     |
      | owner            | awal                    |
      | paymentMinimum   | 123                     |
      | paymentSchedule  | 45 days after month end |
    And I create 1 new active account via API
    And I have a Distribution runcontroller created
    When I have a new Distribution contract lifecycle created with accounts created for AWAL Recordings America, Inc.
    And I have mechanical deductions data:
      | Key           | Value     |
      | deductionType | Worldwide |
      | productTypes  | Physical  |
      | whoPays       | Business  |
      | adminFee      | No        |
    Then I should be able to add a Contract Mechanical Deductions

  @id_4e8e40fa389db763d81edd08b98403cbe87b428132bf9730af14fbf03b25df2f
  Scenario: add Individual Territory mechanical deductions
    Given an orchard employee label_7123_admin_1 for Abacus
    And I log in to Abacus silently
    And I am successfully logged in to Abacus
    And I prepare an abacus account data:
      | Key              | Value                   |
      | companyBrandName | awal                    |
      | paidBy           | AWAL-US                 |
      | agreementType    | AWAL Core               |
      | currency         | USD                     |
      | owner            | awal                    |
      | paymentMinimum   | 123                     |
      | paymentSchedule  | 45 days after month end |
    And I create 1 new active account via API
    And I have a Distribution runcontroller created
    When I have a new Distribution contract lifecycle created with accounts created for AWAL Recordings America, Inc.
    And I have mechanical deductions data:
      | Key           | Value                |
      | deductionType | Individual Territory |
      | territory     | Canada               |
      | productTypes  | Physical             |
      | whoPays       | Business             |
      | adminFee      | No                   |
    Then I should be able to add a Contract Mechanical Deductions

  @id_ae357519ecb504f5698a23e8b232c49dd0b090752c5885c7108cece19d85335e
  Scenario: add Digital mechanical deductions
    Given an orchard employee label_7123_admin_1 for Abacus
    And I log in to Abacus silently
    And I am successfully logged in to Abacus
    And I prepare an abacus account data:
      | Key              | Value                   |
      | companyBrandName | awal                    |
      | paidBy           | AWAL-US                 |
      | agreementType    | AWAL Core               |
      | currency         | USD                     |
      | owner            | awal                    |
      | paymentMinimum   | 123                     |
      | paymentSchedule  | 45 days after month end |
    And I create 1 new active account via API
    And I have a Distribution runcontroller created
    When I have a new Distribution contract lifecycle created with accounts created for AWAL Recordings America, Inc.
    And I have mechanical deductions data:
      | Key           | Value     |
      | deductionType | Worldwide |
      | productTypes  | Digital   |
      | whoPays       | Customer  |
      | adminFee      | No        |
    Then I should be able to add a Contract Mechanical Deductions

  @id_018213881f859538779bb30b8a88ee88bc2f6741d0ac76aad728f20ea3c10e98
  Scenario: add mechanical deductions with admin fee
    Given an orchard employee label_7123_admin_1 for Abacus
    And I log in to Abacus silently
    And I am successfully logged in to Abacus
    And I prepare an abacus account data:
      | Key              | Value                   |
      | companyBrandName | awal                    |
      | paidBy           | AWAL-US                 |
      | agreementType    | AWAL Core               |
      | currency         | USD                     |
      | owner            | awal                    |
      | paymentMinimum   | 123                     |
      | paymentSchedule  | 45 days after month end |
    And I create 1 new active account via API
    And I have a Distribution runcontroller created
    When I have a new Distribution contract lifecycle created with accounts created for AWAL Recordings America, Inc.
    And I have mechanical deductions data:
      | Key           | Value     |
      | deductionType | Worldwide |
      | productTypes  | Both      |
      | whoPays       | Both      |
      | adminFee      | Yes       |
    Then I should be able to add a Contract Mechanical Deductions

  @id_b6dadecd6ceba9dedad0f9be7fd68ed6f4f54fc6ad26e33c678e175150711cc8
  Scenario: delete mechanical deductions
    Given an orchard employee label_7123_admin_1 for Abacus
    And I log in to Abacus silently
    And I am successfully logged in to Abacus
    And I prepare an abacus account data:
      | Key              | Value                   |
      | companyBrandName | awal                    |
      | paidBy           | AWAL-US                 |
      | agreementType    | AWAL Core               |
      | currency         | USD                     |
      | owner            | awal                    |
      | paymentMinimum   | 123                     |
      | paymentSchedule  | 45 days after month end |
    And I create 1 new active account via API
    And I have a Distribution runcontroller created
    When I have a new Distribution contract lifecycle created with accounts created for AWAL Recordings America, Inc.
    And I have mechanical deductions data:
      | Key           | Value                |
      | deductionType | Individual Territory |
      | territory     | Canada               |
      | productTypes  | Physical             |
      | whoPays       | Business             |
      | adminFee      | No                   |
    Then I should be able to add a Contract Mechanical Deductions
    And I should be able to delete Mechanical Deductions

  @id_c4a59e39737bf3b0c151ea30ab3bc29898634e0d22dac598755e75f8d61b87ce
  Scenario: edit mechanical deductions
    Given an orchard employee label_7123_admin_1 for Abacus
    And I log in to Abacus silently
    And I am successfully logged in to Abacus
    And I prepare an abacus account data:
      | Key              | Value                   |
      | companyBrandName | awal                    |
      | paidBy           | AWAL-US                 |
      | agreementType    | AWAL Core               |
      | currency         | USD                     |
      | owner            | awal                    |
      | paymentMinimum   | 123                     |
      | paymentSchedule  | 45 days after month end |
    And I create 1 new active account via API
    And I have a Distribution runcontroller created
    When I have a new Distribution contract lifecycle created with accounts created for AWAL Recordings America, Inc.
    And I have mechanical deductions data:
      | Key           | Value                |
      | deductionType | Individual Territory |
      | territory     | US                   |
      | productTypes  | Physical             |
      | whoPays       | Business             |
      | adminFee      | No                   |
    Then I should be able to add a Contract Mechanical Deductions
    And I should be able to edit mechanical deductions
