Details
-
Story
-
Status: Closed (View Workflow)
-
P2
-
Resolution: Done
-
None
-
-
ACQ Sprint 85
-
3
-
Thunderjet
Description
Overview
At the moment, validation of transaction existence does not occur before budget deletion.
According with new requirements : The user should only be able to delete a budget that has 0 transactions. It does not matter if it is for the current fiscal year, past year or upcoming year.
Additionally, the link between the group_fund_fiscal_year and the budget tables must be removed before deleting, to be able to delete the budget.
Approach:
Upon budget deletion:
- find all transactions : query = ((transaction.toFundId=budget.fundId or transaction.fromFundId=budget.fundId) and transaction.fiscalYearId=budget.fiscalYearID) and get number of returned transactions. If the number is greater than 0, then deleting the budget is prohibited.
- find all groupFundFiscalYear by budget.fundId and budget.fiscalYearId and clear groupFundFiscalYear.budgetId field
Notes
Logic should be implemented in storage module to minimize data inconsistency in case below:
Deleting a budget is not an atomic operation, since we must first check for transactions and only then delete the budget.
There is a a slight chance, that between these two operations the transaction will be created by someone else and it will remain tied to a nonexistent budget.
Acceptance criteria:
The business logic described above has been added
Unit tests are updated
API tests are updated (mod-finance)
TestRail: Results
Attachments
Issue Links
- blocks
-
MODFISTO-93 Create MODFISTO Bugfix release
-
- Closed
-
- has to be done before
-
MODFIN-117 Return meaningful error message upon failed budget deletion
-
- Closed
-
- is duplicated by
-
MODFIN-116 Remove the link of the group_fund_fiscal_year to the budget when deleting this budget
-
- Closed
-
- relates to
-
UXPROD-2295 Value management through transactions Part 3 - Fixes and committing/encumbering money for approved invoices
-
- Closed
-
-
UIF-187 Can not delete a budget
-
- Closed
-