Table of Contents | ||
---|---|---|
|
...
- 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. Unit | protectCreate | protectRead | protectUpdate | protectDelete |
---|
FundAllowFundViewAcqUnit | false | false | true | true |
RestrictFundViewAcqUnit | true | true | false | true |
Effective | false | false | false | true |
Fund | AcqUnits |
---|---|
FundRistrictView1 | RestrictFundViewAcqUnit |
FundRistrictView2 | RestrictFundViewAcqUnit, FundAllowFundViewAcqUnit |
FundAllowView | FundAllowFundViewAcqUnit |
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 shown
- "Fund View"
- Then Fund(s) are displayed :
- WITHOUT ANY acq units (FundWithoutAcqUnits)
- Have at least one of acq unit(s) as the user (FundRistrictView1, FundRistrictView2)
- 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
...
- WITHOUT ANY acq units (FundWithoutAcqUnits)
- Have at least one of acq unit(s) as the user (FundRistrictView1, FundRistrictView2)
- 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 :
- WITHOUT ANY acq units (FundWithoutAcqUnits)
- Have at least one of acq unit(s) as the user (FundRistrictView2)
- Haveacq unit(s) which DON'T protect read (FundAllowView)
...
- WITHOUT ANY acq units (FundWithoutAcqUnits)
- Have at least one of acq unit(s) as the user (FundRistrictView1, FundRistrictView2)
- 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"
Add/Update Invoice line
Show funds in filter list
The same as for PO line
Save invoice line from back-end perspective like a POST operation
The same as for PO line
JIRA
A convenient place to put links to relevant JIRA epics/features/stories/bugs/etc.
Jira Legacy server System JiraJIRA serverId 01505d01-b853-3c2e-90f1-ee9b165564fc key UXPROD-979 Jira Legacy server System JiraJIRA serverId 01505d01-b853-3c2e-90f1-ee9b165564fc key UXPROD-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.
Option #4 - Handle this in a transaction at the storage layer
...