process letters from api traffic

there are three steps to this

1. Create a job
  * Starts in status 'ready to send'
  * Created by None, since it's from the API
  * original file name 'letter submitted via api'
2. Create a single notification for that job
  * job_row_number 0
  * client reference if provided
  * address line 1 as recipient
3. Trigger the build_dvla_file task
  we know that all the notifications have been created for this job
  (since we just created them ourselves synchronously), so this will
  just create the dvla-format file for the job, and upload it to s3.
This commit is contained in:
Leo Hemsted
2017-07-26 15:57:30 +01:00
parent 3d089bf7f1
commit 2746bf0318
4 changed files with 58 additions and 11 deletions

View File

@@ -55,7 +55,7 @@ def persist_notification(
created_by_id=None
):
notification_created_at = created_at or datetime.utcnow()
if not notification_id and simulated:
if not notification_id:
notification_id = uuid.uuid4()
notification = Notification(
id=notification_id,