mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 15:31:15 -05:00
When SES callback is for a complaint save that to the new complaints table.
When handling the complaint we don't want to throw an exception if the message is missing fields. Only log an exception if we are unable to tie a complaint to a notification.
This commit is contained in:
12
app/dao/complaint_dao.py
Normal file
12
app/dao/complaint_dao.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from app import db
|
||||
from app.dao.dao_utils import transactional
|
||||
from app.models import Complaint
|
||||
|
||||
|
||||
@transactional
|
||||
def save_complaint(complaint):
|
||||
db.session.add(complaint)
|
||||
|
||||
|
||||
def fetch_complaints_by_service(service_id):
|
||||
return Complaint.query.filter_by(service_id=service_id).all()
|
||||
Reference in New Issue
Block a user