@cache_warm
@slow
@accounting
@ows_accounting
@frontend_accounting
Feature: Accounting User - Workstation
  To ensure the accuracy and reliability of accounting data
  As a Workstation Accounting user
  I want to view current and historical accounting data

  # DRB = Digital Revenue Breakdown, on AccountingBreakdownPage
  @legacy
  @regression
  @oaworkstation
  @ows_features
  @id_e2c235c2cba06ad865dfdabba3262c7a2469d48390663c01235a01dad86e4a46
  Scenario: Accounting tab redirects to customer accounting app
    Given an orchard employee label_19405 for workstation
    And I log in to workstation silently
    Then The accounting tab should redirect to the customer accounting app

  # ACC-576
  #  AUT-930 Workstation accounting deprecation
  @wip
  @id_dcd824a81e5153fc7e4ba0e5c34a803144e270f864b62b182409139234354536
  Scenario: Physical Reserves tab should not be displayed for subaccounts
    Given an orchard employee subaccount_1 for workstation
    And I log in to workstation silently
    When I am on the workstation accounting page
    Then I should not see "Physical Reserves" tab in the subnavigation menu

  #  AUT-930 Workstation accounting deprecation
  @wip
  @id_3760aa217c4a12655979435cf123789ae193d5ed91f9f6bd91c335edb954d21b
  Scenario: Verify historical publishing deductions
    Given an orchard employee label_19405 for workstation
    And I log in to workstation silently
    And I am on the workstation accounting page
    When I view the accounting breakdown for "Jan 2014" to "Jan 2014"
    Then I should see a Ringtones publishing deduction of "£-0.06"
    And I should see a Full Tracks publishing deduction of "£-721.27"
    And I should see an Outstanding Balance of "£0.00"

  #  AUT-930 Workstation accounting deprecation
  @wip
  @id_70305b969ea20794e21ecb4d260c75f0ce8e3626af0e98805b9a60e57c36b21d
  Scenario: Previous/Penultimate period summary (NOTE: this used to validate the current period, but that breaks when the accounting run is applied to the QA env)
    Given an orchard employee label_19405 for workstation
    And I log in to workstation silently
    And I am on the workstation accounting page
    And I view the accounting breakdown for the penultimate period
    And I should see the correct Outstanding Balance
    When I get the penultimate period's Opening Balance
    Then the antepenultimate period's Outstanding Balance should match it

  # ACC-646, ACC-580
  #  AUT-930 Workstation accounting deprecation
  @legacy
  @oaworkstation
  @id_0974a387138a4d109ff7494e34ded8ac6ea35aa1d3158b31bc3dd246168447f5
  @wip
  Scenario: User should be able to navigate to Physical Reserves page
    Given an orchard employee label_21989 for workstation
    And I login silently to workstation and visit the home page
    When I am on the workstation accounting breakdown page
    Then I should see "Physical Reserves" tab in the subnavigation menu
    When I click on "Physical Reserves" tab
    Then I should be redirected to the statements page Physical Reserves page
    And I should see Expected Reserve Payouts table

  #  AUT-930 Workstation accounting deprecation
  @id_e5d90c5453ed502a95de9ff58d2165d2d666897a4186772d16eb7e86cca3bb3b
  @wip
  Scenario Outline: Apply views, verify totals match
    Given an orchard employee label_19405 for workstation
    And I log in to workstation silently
    And I am on the workstation accounting page
    When I view the accounting breakdown for "Dec 2024" to "Dec 2024"
    When I apply a <view> filter view to the accounting breakdown
    Then the DRB Revenue Total should match the Summary section Revenue
    And the view should show as applied

    Examples:
      | view            |
      | Activity Period |
      | Subaccount      |
      | Imprint         |
      | Artist          |
      | Product         |
      | Track           |
      | Source          |
      | Channel         |
      | Country         |

  # ACC-953
  #  AUT-930 Workstation accounting deprecation
  @first_statement_period_change
  @id_8bde0669d934f9308918835e6295dd6798e59420dab3729075beef2c07fcf6d4
  @wip
  Scenario: Suppress Workstation Accounting Before date should apply to the filter on View page
    Given an orchard employee label_7482 for workstation
    And I log in to workstation silently
    And I am on the workstation accounting page
    When I update the first statement period to "223"
    And I am on the accounting breakdown page for the current period
    Then I should see the starting from period to be "223" in dropdown filter
    When I view the accounting breakdown for "Q3 2017" to "Q4 2017"
    Then the DRB Revenue Total should match the Summary section Revenue
