@frontend_royalties_adjustments_ecs
@ecs_only
@abacus_adjustments
@ows_abacus_worksheet
@frontend_royalties_closing_balances_and_adjustments
@cleanup_adjustments_1_files
Feature: Abacus Adjustments 1

  @id_d31f1f4a106302a0e02c960dbb0af6d671e59a0feb3cd0a5c81341f34bc6742f
  Scenario: Search for adjustments by status/batch_id/filename/statement_period/added_by
    Given an orchard employee label_7123_admin_5 for abacus
    When I log in
    And I reopen closed balance for current statement period for payment entity: KNR_UK
    And I reopen closed balance for current statement period for payment entity: KNR_NL
    # applied adjustments file
    And I should be able to upload valid_adjustments_file adjustments file
    And I should be able to import the adjustments
    And I should be able to approve the adjustments
    And I should be able to apply the adjustments
    Then I should be able to search for an adjustment by batch id
    # not approved file
    And I should be able to upload valid_adjustments_file adjustments file
    And I should be able to import the adjustments
    Then I should be able to search for an adjustment by status
    Then I should be able to search for an adjustment by filename
    Then I should be able to search for an adjustment by statementPeriod
    Then I should be able to search for an adjustment by addedBy

  @id_e3cf3c03095921520a5ee01b26aff4cafab40fa67df0708d1fcb43cd4499c12d
  Scenario: Approve and apply adjustments
    Given an orchard employee label_7123_admin_5 for abacus
    When I log in
    And I reopen closed balance for current statement period for payment entity: KNR_UK
    And I reopen closed balance for current statement period for payment entity: KNR_NL
    Then I should be able to upload valid_adjustments_file adjustments file
    And I should be able to import the adjustments
    And I should be able to approve the adjustments
    And I should be able to apply the adjustments

  @id_08ab6edc317c8908a9ab47ef5528af03768782abda9545044445d29bcf1504ca
  Scenario: Filter particular adjustments batch by account or contract
    Given an orchard employee label_7123_admin_5 for abacus
    When I log in
    And I reopen closed balance for current statement period for payment entity: KNR_UK
    And I reopen closed balance for current statement period for payment entity: KNR_NL
    Then I should be able to upload valid_adjustments_file adjustments file
    And I should be able to import the adjustments
    Then I filter adjustments by account or contract

  @id_66ae0ee9a0381bc086b3d86946931ab42d806de9e8df63b885512eb66f128c93
  Scenario Outline: Upload different adjustments files
    Given an orchard employee label_7123_admin_5 for abacus
    When I log in
    And I reopen closed balance for current statement period for payment entity: KNR_UK
    Then I should be able to upload <file> adjustments file

    Examples:
      | file                        |
      | valid_adjustments_file      |
      | invalid_adj_invalid_headers |
      | invalid_adj_content_error   |
