Uploaded image for project: 'mod-finance'
  1. mod-finance
  2. MODFIN-137

Define and implement GET /finance/groups/id/expense-classes-totals API

    XMLWordPrintable

Details

    • Story
    • Status: Closed (View Workflow)
    • P3
    • Resolution: Done
    • None
    • 4.0.0
    • None
    • ACQ Sprint 94, ACQ Sprint 95
    • 3
    • Thunderjet

    Description

      Purpose/Overview:
      To support ability to summarize the amounts associated with an expense class for all funds in given group with that type we need to provide GET /finance/groups/id/expense-classes-totals API

      Requirements/Scope:

      1. create schema group_expense_class_totals
        • expenseClassName
        • expended
        • percentageExpended
      2. define and implement GET /finance/groups/id/expense-classes-totals API

      Approach:
      Retrieve group-fund-fiscal-year records by groupId
      Retrieve expense-classes for each budgetId from above request using GET /finance-storage/expense-classes?query=budgetExpenseClass.budgetId==id
      For each expense-class get transactions using GET /finance-storage/transactions?query=expenseClassId==expense-class.id AND
      Calculate for each expense-class:

      • expended sum of (transaction.amount where transactionType==Payment) and (-transaction.amount where transactionType==Credit)
      • percentageExpended = expended/ (sum of all expense classes expended related to given group) * 100

      Acceptance criteria:

      • schema created
      • GET /finance/groups/id/expense-classes-totals API defined and implemented
      • unit tests updated
      • API tests updated

      TestRail: Results

        Attachments

          1. screenshot-1.png
            49 kB
            Aliaksandr Pautau
          2. screenshot-2.png
            196 kB
            Aliaksandr Pautau
          3. snapshot_test.png
            117 kB
            Andrei Makaranka

          Issue Links

            Activity

              People

                Andrei_Makaranka Andrei Makaranka
                aliaksandr_pautau Aliaksandr Pautau
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases