mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-22 00:11:16 -05:00
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:
@@ -619,7 +619,7 @@ class JobStatus(db.Model):
|
||||
class Job(db.Model):
|
||||
__tablename__ = 'jobs'
|
||||
|
||||
id = db.Column(UUID(as_uuid=True), primary_key=True)
|
||||
id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||
original_file_name = db.Column(db.String, nullable=False)
|
||||
service_id = db.Column(UUID(as_uuid=True), db.ForeignKey('services.id'), index=True, unique=False, nullable=False)
|
||||
service = db.relationship('Service', backref=db.backref('jobs', lazy='dynamic'))
|
||||
|
||||
Reference in New Issue
Block a user