File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
src/allocation/entrypoints Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 11from datetime import datetime
2- from flask import Flask , request
2+ from flask import Flask , jsonify , request
33
44from allocation .domain import commands
55from allocation .adapters import orm
66from allocation .service_layer import messagebus , unit_of_work
77from allocation .service_layer .handlers import InvalidSku
8+ from allocation import views
89
910app = Flask (__name__ )
1011orm .start_mappers ()
@@ -35,4 +36,13 @@ def allocate_endpoint():
3536 except InvalidSku as e :
3637 return {"message" : str (e )}, 400
3738
38- return {"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
You can’t perform that action at this time.
0 commit comments