mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Ensure that the primary provider is used in all tasks
This commit is contained in:
22
app/dao/provider_details_dao.py
Normal file
22
app/dao/provider_details_dao.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from sqlalchemy import asc
|
||||
from app.dao.dao_utils import transactional
|
||||
from app.models import ProviderDetails
|
||||
from app import db
|
||||
|
||||
def get_provider_details():
|
||||
return ProviderDetails.query.order_by(asc(ProviderDetails.priority)).all()
|
||||
|
||||
|
||||
def get_provider_details_by_id(provider_details_id):
|
||||
return ProviderDetails.query.get(provider_details_id)
|
||||
|
||||
|
||||
def get_provider_details_by_notification_type(notification_type):
|
||||
return ProviderDetails.query.filter_by(
|
||||
notification_type=notification_type
|
||||
).order_by(asc(ProviderDetails.priority)).all()
|
||||
|
||||
|
||||
@transactional
|
||||
def dao_update_provider_details(provider_details):
|
||||
db.session.add(provider_details)
|
||||
Reference in New Issue
Block a user