@frontend_royalties_adjustments_ecs
@frontend_royalties_closing_balances_and_adjustments
@ecs_only
@abacus_adjustments
@ows_abacus_worksheet
Feature: Abacus Flowthrough Adjustments

  @clean_ledger_entries
  @abacus_delete_non_applied_adj_files_for_awal_tests
  @delete_closing_balance_for_awal_us
  @id_5960981e528ef18ec4f654348b7015299f44681a7c161de0551ba4625689ac2b
  Scenario: Flowthrough batch filters and entries land in corresponding tables based on flowthrough value
    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: AWAL_US
    Then I should be able to upload flowthrough_adjustments_file adjustments file
    And I should be able to import the adjustments
    Then I should be able to search for an adjustment by Flowthrough
    And I should be able to approve the adjustments
    And I should be able to apply the adjustments
    Then entries should land in corresponding tables based on flowthrough value
    Then I should be able to close the balance for payment entity: AWAL_US
    Then payment_allocation table records should be present for flowthrough contracts
    Then payment_allocation table records should be absent for non-flowthrough contracts
