Added the random string reference to the letter

- uses the reference field on the notifications table to store a 16char random string used to cross reference DVLA letters back to the notification
- used as letter barcode does not have space for a UUID notification id

Depends on https://github.com/alphagov/notifications-utils/pull/149

Renamed the numeric_id to notification_reference in utils and changed validation rules to match this

Note also the persist_notification method set "reference" to be "client_reference" which is confusing and they are different things, so fixed this too.
This commit is contained in:
Martyn Inglis
2017-04-12 17:56:55 +01:00
parent b55b1007d0
commit b0e5062df2
6 changed files with 30 additions and 16 deletions

View File

@@ -179,7 +179,7 @@ def test_persist_notification_with_optionals(sample_job, sample_api_key, mocker)
created_at=created_at,
job_id=sample_job.id,
job_row_number=10,
reference="ref from client",
client_reference="ref from client",
notification_id=n_id)
assert Notification.query.count() == 1
assert NotificationHistory.query.count() == 1