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

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

    XMLWordPrintable

Details

    • Story
    • Status: Closed (View Workflow)
    • P3
    • Resolution: Done
    • None
    • 4.0.0
    • None
    • Thunderjet/Firebird Back-end Story Template
    • ACQ Sprint 93
    • 3
    • Thunderjet

    Description

      Purpose/Overview:
      Provide API to retrieve collection of expense classes with totals within a given Budget.

      Requirements/Scope:

      1. create schema budget_expense_class_totals
        • expenseClassName
        • expenseClassStatus
        • encumbered
        • awaitingPayment
        • expended
        • percentageExpended
      • define and implement GET /finance/budgets/id/expense-classes API

      Approach:
      Retrieve expense-classes for given budget 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 fundId=budget.fundId AND fiscalYearId=budget.fiscalYearId
      Calculate for each expense-class:

      • encumbered sum of transaction.amount where transactionType==Encumbrance
      • awaitingPayment sum of transaction.amount where transactionType==Pending payment
      • expended sum of (transaction.amount where transactionType==Payment) and (-transaction.amount where transactionType==Credit)
      • percentageExpended = expended / (budget.expended+ budget.overExpened) * 100

      Acceptance criteria:

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

      TestRail: Results

        Attachments

          1. karate.zip
            17 kB
          2. karate-1.png
            karate-1.png
            34 kB
          3. karate-MODFIN-136.zip
            17 kB

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases