diff --git a/app/dao/service_inbound_api_dao.py b/app/dao/service_inbound_api_dao.py index bc26db584..15dad1415 100644 --- a/app/dao/service_inbound_api_dao.py +++ b/app/dao/service_inbound_api_dao.py @@ -30,3 +30,7 @@ def reset_service_inbound_api(service_inbound_api, updated_by_id, url=None, bear def get_service_inbound_api(service_inbound_api_id, service_id): return ServiceInboundApi.query.filter_by(id=service_inbound_api_id, service_id=service_id).first() + + +def get_service_inbound_api_for_service(service_id): + return ServiceInboundApi.query.filter_by(service_id=service_id).first() diff --git a/app/service/rest.py b/app/service/rest.py index 31d553b12..4857d7063 100644 --- a/app/service/rest.py +++ b/app/service/rest.py @@ -591,3 +591,9 @@ def handle_sql_errror(e): return jsonify(result='error', message="No result found"), 404 else: raise e + + +@service_blueprint.route('//inbound-sms', methods=["POST"]) +def push_inbound_sms_to_service(service_id): + + pass diff --git a/tests/app/dao/test_service_inbound_api_dao.py b/tests/app/dao/test_service_inbound_api_dao.py index 68b804d23..d924c2a70 100644 --- a/tests/app/dao/test_service_inbound_api_dao.py +++ b/tests/app/dao/test_service_inbound_api_dao.py @@ -7,9 +7,10 @@ from app import encryption from app.dao.service_inbound_api_dao import ( save_service_inbound_api, reset_service_inbound_api, - get_service_inbound_api -) + get_service_inbound_api, + get_service_inbound_api_for_service) from app.models import ServiceInboundApi +from tests.app.db import create_service_inbound_api def test_save_service_inbound_api(sample_service): @@ -115,3 +116,14 @@ def test_get_service_inbound_api(sample_service): assert inbound_api.bearer_token == "some_unique_string" assert inbound_api._bearer_token != "some_unique_string" assert inbound_api.updated_at is None + + +def test_get_service_inbound_api_for_service(sample_service): + service_inbound_api = create_service_inbound_api(service=sample_service) + result = get_service_inbound_api_for_service(sample_service.id) + assert result.id == service_inbound_api.id + assert result.url == service_inbound_api.url + assert result.bearer_token == service_inbound_api.bearer_token + assert result.created_at == service_inbound_api.created_at + assert result.updated_at == service_inbound_api.updated_at + assert result.updated_by_id == service_inbound_api.updated_by_id