-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLDC-3852 Add some BU documentation #2920
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
has_children: true | ||
nav_order: 11 | ||
nav_order: 12 | ||
--- | ||
|
||
# Architecture decisions | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
nav_order: 11 | ||
--- | ||
|
||
# Bulk Upload | ||
|
||
Bulk upload functionality allows users to upload multiple logs using a csv file. | ||
|
||
## How Bulk Upload works | ||
|
||
Bulk upload file can be uploaded for a specific log type (sales or lettings) for a specific year. During crossover period we ask which collection year the file is for, otherwise we assume the Bulk Upload is for the current year. | ||
|
||
When a bulk upload file is successfully uploaded on the service, it: | ||
|
||
- Saves a BulkUpload record in the database | ||
- Uploads the file to S3 | ||
- Schedules `ProcessBulkUploadJob` | ||
|
||
### Bulk upload service | ||
|
||
There are several outcomes to a bulk upload: | ||
|
||
- Successful upload | ||
- Partial upload: upload has errors but partial logs can be created, need a user approval | ||
- Errors in bulk upload: errors on important fields, or in the template. Logs can't be created and email with errors is sent to the user | ||
|
||
![Bulk Upload Flow](https://raw.githubusercontent.com/communitiesuk/submit-social-housing-lettings-and-sales-data/main/docs/images/bu_flow_diagram.png) | ||
|
||
### Bulk upload processing | ||
|
||
Most of BU processing logic is in `BulkUpload::Processor`. It chooses the correct `Validator` and `LogCreator` classes for the log type and uses them to process the file. | ||
|
||
![Bulk Upload Processing](https://raw.githubusercontent.com/communitiesuk/submit-social-housing-lettings-and-sales-data/main/docs/images/bu_processor.png) | ||
|
||
Main differences between different collection years would be in `CsvParsers` and `RowParsers`. | ||
|
||
#### Row parser | ||
|
||
- Maps any values from a csv row into values saved internally | ||
- Maps any validations into errors for bulk uploads by associating them with relevant fields | ||
- Adds any additional validations that might only make sense in BU (for example, validation that might not relevant in single log submission due to routing) | ||
|
||
### Csv parser | ||
|
||
- Holds template specific information | ||
- Header information | ||
- Row and field information |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
nav_order: 12 | ||
nav_order: 13 | ||
--- | ||
|
||
# This documentation website | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might imply that an email with errors is only sent when there are important errors, don't we also send emails for partial uploads. In both cases we do direct the user to an error report, maybe worth mentioning that? Also, the email doesn't actually include the errors just a message that there are some.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's a good point. I updated it a bit now.
I think in some cases we do send the errors directly in the email (if there's an issue with the template), I've updated it to include both