Report Generation ProcessΒΆ
This document provides a high-level sequence diagram of how the NGSB application generates reports against general ledger files after they have passed the code check.
sequenceDiagram
participant gcs
participant worker
participant db
activate db
critical process
option try
worker ->> db: delete report for year, state combo if exists?
worker ->> db: create report for year, state combo
critical fetch db information
worker ->> db: fetch general ledger, school information, and processed records
option No general ledger, school info, or processed records
worker ->> worker: Throw error
option
db ->> worker: general ledger, school information, and processed records
end
critical download afr template
worker ->> gcs: file.download(afr_template.xlsx)
activate gcs
gcs ->> worker: afr_template.xlsx
deactivate gcs
end
critical generate report
worker ->> worker: put processed records into afr_template.xlsx
option if school.deseg = true
worker ->> worker: put processed records into deseg section of afr_template.xlsx
option if school.food_service = true
worker ->> worker: put processed records into food service section of afr_template.xlsx
option if general_ledger.sped_file
worker ->> gcs: file.download(sped_file.csv)
activate gcs
gcs ->> worker: sped_file.csv
deactivate gcs
worker ->> worker: put sped_file info into afr_template.xlsx
end
critical upload report
worker ->> gcs: file.upload(populated_afr.xlsx)
activate gcs
gcs ->> worker: populated_afr.xlsx
deactivate gcs
worker ->> db: update report with file url and completed status
end
option catch
worker ->> db: update report with error details
worker ->> worker: exit process
end
deactivate db