Add callback_type column to service_callback_api table

Also add service_callback_type table with allowed types
This commit is contained in:
Pea Tyczynska
2018-07-17 16:15:57 +01:00
parent 9c99e45008
commit 183aa160c6
4 changed files with 51 additions and 2 deletions

View File

@@ -11,7 +11,8 @@ from app.errors import (
)
from app.models import (
ServiceInboundApi,
ServiceCallbackApi
ServiceCallbackApi,
DELIVERY_STATUS_CALLBACK_TYPE,
)
from app.schema_validation import validate
from app.service.service_callback_api_schema import (
@@ -88,6 +89,7 @@ def create_service_callback_api(service_id):
data = request.get_json()
validate(data, create_service_callback_api_schema)
data["service_id"] = service_id
data["callback_type"] = DELIVERY_STATUS_CALLBACK_TYPE
callback_api = ServiceCallbackApi(**data)
try:
save_service_callback_api(callback_api)