mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
add new service whitelist table
services can have a whitelist of phone numbers and email addresses that they can send to in addition to team members when in trial mode. email_address and mobile_number are nullable and app level checks will be in place to prevent inserting blank rows. they have a created_at date so that we can [potentially] delete them a week later to avoid keeping personally identifying data any longer than necessary
This commit is contained in:
@@ -132,6 +132,17 @@ class Service(db.Model, Versioned):
|
||||
)
|
||||
|
||||
|
||||
class ServiceWhitelist(db.Model):
|
||||
__tablename__ = 'service_whitelist'
|
||||
|
||||
id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||
service_id = db.Column(UUID(as_uuid=True), db.ForeignKey('services.id'), index=True, nullable=False)
|
||||
service = db.relationship('Service', backref='whitelist')
|
||||
email_address = db.Column(db.String(255), nullable=True)
|
||||
mobile_number = db.Column(db.String, nullable=True)
|
||||
created_at = db.Column(db.DateTime, default=datetime.datetime.utcnow)
|
||||
|
||||
|
||||
class ApiKey(db.Model, Versioned):
|
||||
__tablename__ = 'api_keys'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user