We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 40148af commit 7ac1cf4Copy full SHA for 7ac1cf4
1 file changed
src/allocation/entrypoints/flask_app.py
@@ -5,6 +5,7 @@
5
from allocation.adapters import orm
6
from allocation.service_layer import messagebus, unit_of_work
7
from allocation.service_layer.handlers import InvalidSku
8
+from allocation import views
9
10
app = Flask(__name__)
11
orm.start_mappers()
@@ -35,4 +36,13 @@ def allocate_endpoint():
35
36
except InvalidSku as e:
37
return jsonify({'message': str(e)}), 400
38
- return jsonify({'batchref': batchref}), 201
39
+ return 'OK', 202
40
+
41
42
+@app.route("/allocations/<orderid>", methods=['GET'])
43
+def allocations_view_endpoint(orderid):
44
+ uow = unit_of_work.SqlAlchemyUnitOfWork()
45
+ result = views.allocations(orderid, uow)
46
+ if not result:
47
+ return 'not found', 404
48
+ return jsonify(result), 200
0 commit comments