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

    • Type: Story
    • Status: Closed (View Workflow)
    • Priority: P3
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 4.0.0
    • Labels:
      None
    • Template:
      Thunderjet/Firebird Back-end Story Template
    • Sprint:
      ACQ Sprint 93
    • Story Points:
      3
    • Development Team:
      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

        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

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

                Dates

                Created:
                Updated:
                Resolved: