File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/allocation/entrypoints Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 5
5
from allocation .adapters import orm
6
6
from allocation .service_layer import messagebus , unit_of_work
7
7
from allocation .service_layer .handlers import InvalidSku
8
+ from allocation import views
8
9
9
10
app = Flask (__name__ )
10
11
orm .start_mappers ()
@@ -35,4 +36,13 @@ def allocate_endpoint():
35
36
except InvalidSku as e :
36
37
return jsonify ({'message' : str (e )}), 400
37
38
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
You can’t perform that action at this time.
0 commit comments