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

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

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Closed (View Workflow)
    • Priority: P3
    • Resolution: Won't Do
    • Affects Version/s: None
    • Fix Version/s: 1.0.0
    • Labels:
      None
    • Template:
    • Development Team:
      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

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

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    TestRail: Runs

                      TestRail: Cases