mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
Add a new data model LETTER_BRANDING to store the letters. Add a new data model SERVICE_LETTER_BRANDING to map the service to the letter brand.
This will replace services.dvla_organisation_id and dvla_organisation.
This commit is contained in:
@@ -249,6 +249,23 @@ class DVLAOrganisation(db.Model):
|
||||
filename = db.Column(db.String(255), nullable=False)
|
||||
|
||||
|
||||
class LetterBranding(db.Model):
|
||||
__tablename__ = 'letter_branding'
|
||||
id = db.Column(UUID(as_uuid=True), primary_key=True)
|
||||
name = db.Column(db.String(255), unique=True, nullable=False)
|
||||
filename = db.Column(db.String(255), unique=True, nullable=False)
|
||||
domain = db.Column(db.Text, unique=True, nullable=True)
|
||||
|
||||
|
||||
service_letter_branding = db.Table(
|
||||
'service_letter_branding',
|
||||
db.Model.metadata,
|
||||
# service_id is a primary key as you can only have one letter branding per service
|
||||
db.Column('service_id', UUID(as_uuid=True), db.ForeignKey('services.id'), primary_key=True, nullable=False),
|
||||
db.Column('letter_branding_id', UUID(as_uuid=True), db.ForeignKey('letter_branding.id'), nullable=False),
|
||||
)
|
||||
|
||||
|
||||
INTERNATIONAL_SMS_TYPE = 'international_sms'
|
||||
INBOUND_SMS_TYPE = 'inbound_sms'
|
||||
SCHEDULE_NOTIFICATIONS = 'schedule_notifications'
|
||||
|
||||
Reference in New Issue
Block a user