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

Add business logic to POST /finance/group-fund-fiscal-years

    XMLWordPrintable

Details

    • Story
    • Status: Closed (View Workflow)
    • P3
    • Resolution: Won't Do
    • None
    • 1.0.0
    • None
    • Thunderjet

    Description

      Overview

      In order to reduce the amount of work the UI needs to do, we're moving some of the logic for associating funds and groups into the business logic layer. Specifically, determining the appropriate fiscal year to use when persisting the groupFundFY record.

      MODFISTO-44 makes the groupFundFy.fiscalYearId field optional, allowing the UI to only specify a fundId and groupId. Using this, we need to gather additional information from the ledger that the fund is associated with, then query the fiscal year API.

      Approach

      1. given provided fund, get the associated ledger using fund.ledgerId
      2. guery fiscal years:

      • series = ledger.fiscalYearOne.series
      • currentDate >= startPeriod
      • currentDate < endPeriod

      3. if no fiscal year is returned for this period, look for next period
      query fiscal years:

      • series = ledger.fiscalYearOne.series
      • currentDate + 1 year >= startPeriod
      • currentDate + 1 year < endPeriod

      4. if still nothing, return an error
      5. Now that we have a fiscal year, fund and group, we can call storage to persist the relationship via the groupFundFY API.

      Acceptance Criteria

      • the group-fund-fiscal-years API implementation is updated as described above
      • unit tests are updated
      • API tests are updated

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                cmcnally Craig McNally
                Craig McNally Craig McNally
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases