Now we can have multiple patients with the same NHS number (#324) we can be a bit safer in how we handle CSV uploads.
If we move the code to delete the old submission to after we have fully validated the CSV and written all the data, an unhandled error during the process would lead to the new submission being inactive but with the old one preserved. With the behaviour as it stands you'll end up with only the potentially half uploaded new submission.
I wonder if for full safety we want to delete the old submission after a given period of time rather than straight away? This is potentially easier said than done given we don't have a periodic scheduled task system set up yet.
We certainly want to retain the last but one CSV upload.
Now we can have multiple patients with the same NHS number (#324) we can be a bit safer in how we handle CSV uploads.
If we move the code to delete the old submission to after we have fully validated the CSV and written all the data, an unhandled error during the process would lead to the new submission being inactive but with the old one preserved. With the behaviour as it stands you'll end up with only the potentially half uploaded new submission.
I wonder if for full safety we want to delete the old submission after a given period of time rather than straight away? This is potentially easier said than done given we don't have a periodic scheduled task system set up yet.
We certainly want to retain the last but one CSV upload.