mirror of
https://github.com/GSA/notifications-api.git
synced 2026-07-13 01:44:21 -04:00
Add 'archived' column to the 3 reply_to models
Added a new boolean column, `archived`, with a default of False to the three models which are used to specify the 'reply to' address for notifications: * ServiceEmailReplyTo * ServiceSmsSender * ServiceLetterContact
This commit is contained in:
@@ -472,6 +472,7 @@ class ServiceSmsSender(db.Model):
|
||||
service_id = db.Column(UUID(as_uuid=True), db.ForeignKey('services.id'), index=True, nullable=False, unique=False)
|
||||
service = db.relationship(Service, backref=db.backref("service_sms_senders", uselist=True))
|
||||
is_default = db.Column(db.Boolean, nullable=False, default=True)
|
||||
archived = db.Column(db.Boolean, nullable=False, default=False)
|
||||
inbound_number_id = db.Column(UUID(as_uuid=True), db.ForeignKey('inbound_numbers.id'),
|
||||
unique=True, index=True, nullable=True)
|
||||
inbound_number = db.relationship(InboundNumber, backref=db.backref("inbound_number", uselist=False))
|
||||
@@ -487,6 +488,7 @@ class ServiceSmsSender(db.Model):
|
||||
"sms_sender": self.sms_sender,
|
||||
"service_id": str(self.service_id),
|
||||
"is_default": self.is_default,
|
||||
"archived": self.archived,
|
||||
"inbound_number_id": str(self.inbound_number_id) if self.inbound_number_id else None,
|
||||
"created_at": self.created_at.strftime(DATETIME_FORMAT),
|
||||
"updated_at": self.updated_at.strftime(DATETIME_FORMAT) if self.updated_at else None,
|
||||
@@ -1670,6 +1672,7 @@ class ServiceEmailReplyTo(db.Model):
|
||||
|
||||
email_address = db.Column(db.Text, nullable=False, index=False, unique=False)
|
||||
is_default = db.Column(db.Boolean, nullable=False, default=True)
|
||||
archived = db.Column(db.Boolean, nullable=False, default=False)
|
||||
created_at = db.Column(db.DateTime, nullable=False, default=datetime.datetime.utcnow)
|
||||
updated_at = db.Column(db.DateTime, nullable=True, onupdate=datetime.datetime.utcnow)
|
||||
|
||||
@@ -1679,6 +1682,7 @@ class ServiceEmailReplyTo(db.Model):
|
||||
'service_id': str(self.service_id),
|
||||
'email_address': self.email_address,
|
||||
'is_default': self.is_default,
|
||||
'archived': self.archived,
|
||||
'created_at': self.created_at.strftime(DATETIME_FORMAT),
|
||||
'updated_at': self.updated_at.strftime(DATETIME_FORMAT) if self.updated_at else None
|
||||
}
|
||||
@@ -1694,6 +1698,7 @@ class ServiceLetterContact(db.Model):
|
||||
|
||||
contact_block = db.Column(db.Text, nullable=False, index=False, unique=False)
|
||||
is_default = db.Column(db.Boolean, nullable=False, default=True)
|
||||
archived = db.Column(db.Boolean, nullable=False, default=False)
|
||||
created_at = db.Column(db.DateTime, nullable=False, default=datetime.datetime.utcnow)
|
||||
updated_at = db.Column(db.DateTime, nullable=True, onupdate=datetime.datetime.utcnow)
|
||||
|
||||
@@ -1703,6 +1708,7 @@ class ServiceLetterContact(db.Model):
|
||||
'service_id': str(self.service_id),
|
||||
'contact_block': self.contact_block,
|
||||
'is_default': self.is_default,
|
||||
'archived': self.archived,
|
||||
'created_at': self.created_at.strftime(DATETIME_FORMAT),
|
||||
'updated_at': self.updated_at.strftime(DATETIME_FORMAT) if self.updated_at else None
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user