Skip to end of banner
Go to start of banner

Preview Ledger Fiscal Year Rollover

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 26 Next »

AuthorAndrei Makaranka
JIRA task

UXPROD-2899 - Getting issue details... STATUS

Business Requirements
Architects Review

IN PROGRESS

PO review

IN PROGRESS

Revision History

VersionDateOwnerDescriptionReason
v1.006.14.2022Andrei Makaranka Initial version
v2.006.22.2022Andrei Makaranka Schema changed and WBS added

Overview

Allow user to generate a rollover report that will tell the user what errors may occur if rolling over with current data.

Preview report should contain : finance rollover errors (budget errors) and clone of new generated budgets.

Constraints

  • The current approach can cover rollover for the only one ledger though in real life there can be several ledgers - but this needs to be considered (warning)

Assumptions, dependencies

  • Ledger Fiscal Year Rollover already implemented.
  • It is likely that we will be creating upwards of 75000 - 100000 encumbrances during this process. (statistics from Library). 
  • Prepare report with Unpaid invoices is UI responsibility.

Out of Scope

  • Prepare report for orders rollover.
  • Prepare report for encumbrances rollover.
  • Support exchange rate.

Architecturally Significant Requirements

  • The preview process should not make changes in real tables, but store the results in a temporary or separate tables.
  • Finance rollover preview should be done by the same SQL script as used for Real rollover process.
  • Must be compatible with PostgreSQL 10.x

Solution Design

  • Current scheme for rollover records - add a column/flag to mark every rollover if it is a real or a preview one - this will also keep the history of completed previews
  • mod-finance-storage-master\src\main\resources\templates\db_scripts\budget_encumbrances_rollover.sql - make this script parameterizable; pass a real/preview flag as the input parameter; use different tables depending on the flag value. This will allow not to duplicate the SQL script, but to use the same script for both the real rollover and the preview, and thereby get the correct results for the preview.
  • Add another table to store preview data, including Export budget and errors that have occurred; data from this table can then be exported to any convenient format or displayed on the UI

Data Model

Update schema "ledger_fiscal_year_rollover" with new "action" field

PropertyTypeRead OnlyDefaultRequiredNotes

action

enum ["Preview", "Commit", "Rollback"]


trueCommit

Y

  • Current scheme for rollover records - add a column/flag to mark every rollover if it is a real or a preview one - this will also keep the history of completed previews

Create duplicate of the Budget schema

New schema name : preview_rollover_budget

Schema should be copy of ramls/acq-models/mod-finance/schemas/budget.json where all amounts are "persistent"(remove readOnly flag from all amounts).

Create new table "preview_ledger_fiscal_year_rollover"

Schema for the table "preview_ledger_fiscal_year_rollover"

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Preview ledger fiscal year rollover",
  "type": "object",
  "properties": {
    "id": {
      "description": "The unique id of this category",
      "$ref": "../../common/schemas/uuid.json"
    },
     "ledgerFiscalYearRollover": {
      "description": "Fiscal year rollover",
      "type": "object",
      "$ref": "ledger_fiscal_year_rollover.json"
    },
    "previewResult": {
      "description": "Result of preview run",
      "type": "object",
      "$ref": "preview_ledger_fiscal_year_rollover_result.json"
    },
    "totalRecords": {
      "description": "The number of records contained in this collection",
      "type": "integer",
      "minimum": 0
    }
  },
  "additionalProperties": false,
  "required": [
    "ledgerFiscalYearRollover",
    "totalRecords"
  ]
}


Schema for the preview result "preview_ledger_fiscal_year_rollover_result"

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Preview ledger fiscal year rollover result",
  "type": "object",
  "properties": {
    "errors": {
      "description": "The list of fiscal year rollover errors",
      "type": "array",
      "items": {
        "$ref": "ledger_fiscal_year_rollover_error.json"
      }
    },
    "budgets": {
      "description": "The list of planned budgets",
      "type": "array",
      "items": {
        "$ref": "preview_rollover_budget.json"
      }
    },
    "totalRecords": {
      "description": "The number of records contained in this collection",
      "type": "integer",
      "minimum": 0
    }
  },
  "additionalProperties": false,
  "required": [
    "totalRecords"
  ]
}

APIs

Preview Ledger Rollover Business API

Method

Path

Request

Response

Description

Interface

Notes

POST/finance/ledger-rollovers/previews

ramls/acq-models/mod-finance/schemas/ledger_fiscal_year_rollover.json

preview_ledger_fiscal_year_rolloverRun preview of the ledger fiscal year rolloversfinance.ledger-rollovers.previews.collection.postStatus : 201
GET/finance/ledger-rollovers/previews/{id}NA

preview_ledger_fiscal_year_rollover

GET preview of the ledger fiscal year rollover by idfinance.ledger-rollovers.previews.item.getStatus : 200
GET/finance/ledger-rollovers/previewsNApreview_ledger_fiscal_year_rollover_collectionGET previews of the ledger fiscal year rolloversfinance.ledger-rollovers.previews.collection.getStatus : 200
DELETE/finance-storage/ledger-rollovers/previews/{id}NANADELETE  preview of the ledger fiscal year rollover by idfinance.ledger-rollovers.previews.item.deleteStatus : 204

Preview Ledger Rollover Storage API

Method

Path

Request

Response

Description

Interface

Notes

POST/finance-storage/ledger-rollovers/previews

ramls/acq-models/mod-finance/schemas/ledger_fiscal_year_rollover.json

preview_ledger_fiscal_year_rolloverPOST previews of the ledger fiscal year rolloversfinance-storage.ledger-rollovers.previews.collection.postStatus : 201
GET

/finance-storage/ledger-rollovers/previews/{id}

NApreview_ledger_fiscal_year_rolloverGET preview of the ledger fiscal year rollover by idfinance-storage.ledger-rollovers.previews.item.getStatus : 200
GET/finance-storage/ledger-rollovers/previewsNApreview_ledger_fiscal_year_rollover_collectionGET previews of the ledger fiscal year rolloversfinance-storage.ledger-rollovers.previews.collection.getStatus : 200
DELETE/finance-storage/ledger-rollovers/previews/{id}NANADELETE previews of the ledger fiscal year rollover by idfinance-storage.ledger-rollovers.previews.item.deleteStatus : 204

Design


Work Breakdown Structure


WorkCommentsStory~ Estimate
1
  1. Update schema "ledger_fiscal_year_rollover" with new "action" field
  2. Create duplicate of the Budget schema where all amounts are "persistent"
  3. Define schema and table for preview rollover results → Define schema and table for preview rollover results
acq-models, mod-finance-storage, mod-finance

MODFISTO-319 - Getting issue details... STATUS

1
2
  1. Define Storage API : Preview Ledger Rollover → Storage API : Preview Ledger Rollover
  2. Implement API → Should be without any logic.
  3. Business logic for POST will be implemented in scope of MODFISTO-318
 mod-finance-storage

MODFISTO-320 - Getting issue details... STATUS

1
3
  1. Define API : Preview Ledger Rollover → Business API : Preview Ledger Rollover
  2. Implement API → Should be Proxy to storage layer without any logic
mod-finance

MODFIN-256 - Getting issue details... STATUS

1
4
  1. Spike : Implement POC with storing preview result in the temporary tables and after that upload results in the preview rollover table

mod-finance-storage

All all open technical questions should be resolved

MODFISTO-322 - Getting issue details... STATUS

5
5
  1. Implement logic for storing preview result in the temporary tables and after that upload results in the preview rollover table
mod-finance-storage

MODFISTO-323 - Getting issue details... STATUS


6

Implement Preview rollover flow and update budgets with all calculated amounts

  1. Steps should be run in scope of one DB transaction :

1.1 Rollover script run,

1.2. Calculation budgets amounts,

1.3. Storing them in the rollover preview table  → preview_ledger_fiscal_year_rollover

mod-finance-storage

MODFISTO-318 - Getting issue details... STATUS


7
  1. Spike : To gain knowledge about mod-email and implement example with usage email sending
mod-finance

MODFIN-258 - Getting issue details... STATUS


8
  1. Implement sending email and include it in the preview ledger rollover flow
mod-finance

MODFIN-257 - Getting issue details... STATUS




Open Items

QuestionAnswerStory
  • No labels