mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-16 20:48:37 -04:00
Create DAO for daily sorted letter model
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from datetime import datetime
|
||||
from datetime import datetime, date
|
||||
import uuid
|
||||
|
||||
from app import db
|
||||
@@ -9,6 +9,7 @@ from app.dao.service_sms_sender_dao import update_existing_sms_sender_with_inbou
|
||||
from app.dao.invited_org_user_dao import save_invited_org_user
|
||||
from app.models import (
|
||||
ApiKey,
|
||||
DailySortedLetter,
|
||||
InboundSms,
|
||||
InboundNumber,
|
||||
Job,
|
||||
@@ -506,3 +507,16 @@ def create_invited_org_user(organisation, invited_by, email_address='invite@exam
|
||||
)
|
||||
save_invited_org_user(invited_org_user)
|
||||
return invited_org_user
|
||||
|
||||
|
||||
def create_daily_sorted_letter(billing_day=date(2018, 1, 18), unsorted_count=0, sorted_count=0):
|
||||
daily_sorted_letter = DailySortedLetter(
|
||||
billing_day=billing_day,
|
||||
unsorted_count=unsorted_count,
|
||||
sorted_count=sorted_count
|
||||
)
|
||||
|
||||
db.session.add(daily_sorted_letter)
|
||||
db.session.commit()
|
||||
|
||||
return daily_sorted_letter
|
||||
|
||||
Reference in New Issue
Block a user