New table and endpoints for service contact lists.

- Table to store meta data for the emergency contact list for a service.
- Endpoint for fetching contact lists for service
- Endpoint for saving contact list for service.

The list will be stored in S3. The service will then be able to send emergency announcements to staff.
This commit is contained in:
Rebecca Law
2020-03-12 13:53:57 +00:00
parent 7636c4225d
commit 654e6fc657
8 changed files with 243 additions and 2 deletions

View File

@@ -0,0 +1,16 @@
from app import db
from app.models import ServiceContactList
def dao_get_contact_lists(service_id):
contact_lists = ServiceContactList.query.filter_by(
service_id=service_id
).order_by(
ServiceContactList.created_at.desc()
)
return contact_lists.all()
def save_service_contact_list(service_contact_list):
db.session.add(service_contact_list)
db.session.commit()