Row numbers in Returned Letters Report to match user upload #4332
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.
Row numbers in Returned Letters Report to match row numbers in the spreadsheet with recipient data uploaded by service users when they sent the letters.
This far, there has been a mismatch:
When our service users send letters in bulk ia Notify page, they do so by uploading a spreadsheet with recipient data and persinalisation. Each row in the spreadsheet becomes a letter.
In such a spreadsheet, first row is for column headers - for example address_line_1, address_line_2, address_line_3, reference. Then recipient rows start from row 2.
When we save the rows in notifications table in our db, we start from index 0 for first recipient. That means that there is a mismatch of 2 rows between our db and the spreadsheet that has been uploaded.
When collating data for Returned Letters Report, for some reason we have been adding 1 to the db row number - which meant there was still a mismatch - this time by one row.
This commit fixes the mismatch - from now on, the row number we present in returned letters report will match the row number in the uploaded spreadsheet.
We will first send comms to our users telling them about this, and only them merge this PR.