Budget Generation Process¶
This document provides a high-level sequence diagram of how the NGSB application generates budgets based on the district’s previous year budget files, district settings, and user-provided input from our Budget Wizard.
Step 1: Upload Previous Year Budget Files¶
In order for us to effectively generate budget files for the current year, we need to pull in data from the past 2 previous year budget files and (optionally) last year’s desegregation budget file.
When districts upload budget files, an asynchronous job will be started that extracts information from the file to be used later. This works by pulling down a Scribe “extraction” template from the bucket, injecting it with any necessary data, and then letting Scribe run the file.
The “extraction” templates should always include a series of COPY commands to gather data from the file, followed by a DUMP command. This command will export all of the currently copied values into a JSON file. This JSON file will then be read into memory and saved on the file itself. This allows the data to be easily accessible by the wizard for display/manipulation by the user.
Step 2: The Wizard¶
The wizard UI will begin by prompting the user to upload any missing files (if there are any missing), and then use the data extracted from the previous budget files to prompt the user with values to change.
As the user makes changes and navigates through the wizard, their answers are being recorded in the database and their current location in the wizard is being saved to their local storage. This guarantees that users can stop and come back whenever they like without losing their place.
Step 3: Generate Budget¶
Once the user has completed the wizard and resolved each of the questions, they are presented with a final button to generate the budget. When they click this, an asynchronous job is started to fill out the current year’s budget template with the values determined in the wizard.
The job pulls down the district’s previous year budget files, the current year budget template, and the current year’s Scribe template for generating the budget file. It then injects the Scribe template with district data and filepaths, and sends it over to Scribe to populate the budget template. From there, it adds the completed budget file to the district and uploads it to the Google Cloud bucket for later downloading by the user.