remove free_sms_fragment_limit from service

* remove from model
* still required when calling POST /service - we just call through
  from dao_create_service to add a new annual billing entry.
* removed from POST /service/<id> update_service - if you want to
  update/add a new one, use POST /service/<id>/free-sms-fragment-limit
* made sure tests create services with default 250k limit.
This commit is contained in:
Leo Hemsted
2017-12-06 14:45:43 +00:00
parent f0ba491d04
commit b0d4044ff5
8 changed files with 58 additions and 125 deletions
+2 -2
View File
@@ -61,12 +61,12 @@ def dao_get_all_free_sms_fragment_limit(service_id):
).order_by(AnnualBilling.financial_year_start).all()
def dao_insert_annual_billing(service):
def dao_insert_annual_billing_for_this_year(service, free_sms_fragment_limit):
"""
This method is called from create_service which is wrapped in a transaction.
"""
annual_billing = AnnualBilling(
free_sms_fragment_limit=service.free_sms_fragment_limit,
free_sms_fragment_limit=free_sms_fragment_limit,
financial_year_start=get_current_financial_year_start_year(),
service=service,
)