Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
maxLevel4

...

  • TBD - This is a WIP and is subject to change.
  • funds can be associated with one or more acquisitions units via the assignment APIs.  This indicates the acquisitions unit(s) for the fund.
  • The general approach is very similar to that of orders... 
    • For search, we're inserting a prefix to queries
    • For get by id, we're retrieving the record from storage, and then making a decision on whether to return it the user or not
    • For put/post also work the same way
  • A new schema needs to be introduced which combines fund and an acquisitionUnits field containing an array of acquisition unit UUIDs. 
    • This will be used in POST/PUT and can be phased into the GET APIs
    • The business logic layer (not implemented yet) will be responsible for making calls to both finance-storage.funds and finance-storage.acquisitions-unit-assignments APIs
  • Views will need to be created in the storage module and will be used when querying funds.
    • Join the fund and acqUnitAssignments tables on fund.id == recordId (Requires DISTINCT ON)

Fund Use Cases

Acq. UnitprotectCreateprotectReadprotectUpdateprotectDelete
AllowFundViewAcqUnit
FundAllowFundViewAcqUnitfalsefalsetruetrue
RestrictFundViewAcqUnittruetruefalsetrue
Effectivefalsefalsefalsetrue


FundAcqUnits
FundRistrictView1RestrictFundViewAcqUnit
FundRistrictView2RestrictFundViewAcqUnit, FundAllowFundViewAcqUnit
FundAllowViewFundAllowFundViewAcqUnit
FundWithoutAcqUnits

Fund view 

 1. Scenario - Show funds on Fund View

    • Given UserRestrictFundView user belongs to RestrictFundViewAcqUnit
    • When open "Fund View"
    • Then all existed funds are shownFund(s) are displayed :
          1. WITHOUT ANY acq units (FundWithoutAcqUnits)
          2. Have at least one of acq unit(s) as the user (FundRistrictView1, FundRistrictView2)
          3. Haveacq unit(s) which DON'T protect read (FundAllowView)

2. Scenario - Show funds on Fund View

    • Given UserRestrictFundView  user belongs to RestrictFundViewAcqUnit
    • And "Fund View" opened
    • When user select RestrictFundViewAcqUnit in the filter "Acquisition units"
    • Then Only Fund(s) with acquisition unit RestrictFundViewAcqUnit are displayed (FundRistrictView1, FundRistrictView2)

Add/Update PO line

Show funds in filter list 

...

          1. WITHOUT ANY acq units (FundWithoutAcqUnits)
          2. Have at least one of acq unit(s) as the user (FundRistrictView1, FundRistrictView2)
          3. Haveacq unit(s) which DON'T protect read (FundAllowView)

 2. Scenario

    • Given user belongs to AllowFundViewAcqUnit FundAllowFundViewAcqUnit
    • And Open "Add PO Line" form
    • When Selecting Funds from the filter list
    • Then Fund(s) are displayed :
          1. WITHOUT ANY acq units (FundWithoutAcqUnits)
          2. Have at least one of acq unit(s) as the user (FundRistrictView2)
          3. Haveacq unit(s) which DON'T protect read (FundAllowView)

...

          1. WITHOUT ANY acq units (FundWithoutAcqUnits)
          2. Have at least one of acq unit(s) as the user (FundRistrictView1, FundRistrictView2)
          3. Haveacq unit(s) which DON'T protect read (FundAllowView)

...

4. Scenario

    • Given user belongs to AllowFundViewAcqUnit FundAllowFundViewAcqUnit
    • And fundDistributions contain FundAllowView, FundWithoutAcqUnits
    • When Save PO line
    • Then PO line save successfully

5. Scenario

    • Given user belongs to AllowFundViewAcqUnit FundAllowFundViewAcqUnit
    • And fundDistributions contain FundRistrictView2
    • When Save PO line
    • Then PO line save successfully

6. Scenario

    • Given user belongs to AllowFundViewAcqUnit FundAllowFundViewAcqUnit
    • And fundDistributions contain FundRistrictView1
    • When Save PO line
    • Then Error must be return "Not allowed to add funds : FundRistrictView1"

7. Scenario

    • Given user belongs to AllowFundViewAcqUnit FundAllowFundViewAcqUnit
    • And fundDistributions contain FundAllowView, FundRistrictView1
    • When Save PO line
    • Then Error must be return "Not allowed to add funds : FundRistrictView1"

...

A convenient place to put links to relevant JIRA epics/features/stories/bugs/etc.

  • Jira Legacy
    serverSystem JiraJIRA
    serverId01505d01-b853-3c2e-90f1-ee9b165564fc
    keyUXPROD-979
  • Jira Legacy
    serverSystem JiraJIRA
    serverId01505d01-b853-3c2e-90f1-ee9b165564fc
    keyUXPROD-1687

...

Order of Operations / Chicken & Egg Problem

While implementing MODORDERS-251 - Restrict creation of PO, POL, Piece records based upon acquisition unit, we ran into a sort of chicken/egg problem with creation of the order record and the acquisition unit assignment record.  Additional context can be found in the comments section of the PR PR #183.  Note that this also affects PUT and DELETE or orders/assignments.  Here I'll lay out several options for consideration:

...

In this approach we remove the acquisition unit assignments API/table and store the assignments directly in the purchase order record.  See the comments section for details.

(error) Option #4 - Handle this in a transaction at the storage layer

...