mirror of
https://github.com/GSA/notifications-api.git
synced 2026-05-03 15:50:12 -04:00
- Add update dao_update_annual_billing_for_current_and_future_years
- moved get_current_financial_year_start_year from service.utils to dao.date_utils - Moved logic for data persistence from rest to dao when updating records in db
This commit is contained in:
@@ -26,7 +26,8 @@ from app.models import (
|
||||
EMAIL_TYPE,
|
||||
SMS_TYPE,
|
||||
INBOUND_SMS_TYPE,
|
||||
KEY_TYPE_NORMAL
|
||||
KEY_TYPE_NORMAL,
|
||||
AnnualBilling,
|
||||
)
|
||||
from app.dao.users_dao import save_model_user
|
||||
from app.dao.notifications_dao import dao_create_notification, dao_created_scheduled_notification
|
||||
@@ -407,3 +408,17 @@ def create_reply_to_email_for_notification(
|
||||
db.session.commit()
|
||||
|
||||
return reply_to
|
||||
|
||||
|
||||
def create_annual_billing(
|
||||
service_id, free_sms_fragment_limit, financial_year_start
|
||||
):
|
||||
annual_billing = AnnualBilling(
|
||||
service_id=service_id,
|
||||
free_sms_fragment_limit=free_sms_fragment_limit,
|
||||
financial_year_start=financial_year_start
|
||||
)
|
||||
db.session.add(annual_billing)
|
||||
db.session.commit()
|
||||
|
||||
return annual_billing
|
||||
|
||||
Reference in New Issue
Block a user