enabling instant evaluation of the traffic state upon POST and PUT of shipcalls
This commit is contained in:
parent
ad7439467b
commit
5c1fcec490
@ -146,7 +146,7 @@ def PostShipcalls(schemaModel):
|
|||||||
commands.execute(pquery, param={"shipcall_id" : new_id, "participant_id" : participant_assignment["participant_id"], "type" : participant_assignment["type"]})
|
commands.execute(pquery, param={"shipcall_id" : new_id, "participant_id" : participant_assignment["participant_id"], "type" : participant_assignment["type"]})
|
||||||
|
|
||||||
# apply 'Traffic Light' evaluation to obtain 'GREEN', 'YELLOW' or 'RED' evaluation state. The function internally updates the mysql database
|
# apply 'Traffic Light' evaluation to obtain 'GREEN', 'YELLOW' or 'RED' evaluation state. The function internally updates the mysql database
|
||||||
# evaluate_shipcall_state(mysql_connector_instance=pooledConnection, shipcall_id=new_id) # new_id (last insert id) refers to the shipcall id
|
evaluate_shipcall_state(mysql_connector_instance=pooledConnection, shipcall_id=new_id) # new_id (last insert id) refers to the shipcall id
|
||||||
|
|
||||||
# save history data
|
# save history data
|
||||||
# TODO: set ETA properly
|
# TODO: set ETA properly
|
||||||
@ -260,6 +260,9 @@ def PutShipcalls(schemaModel):
|
|||||||
dquery = "DELETE FROM shipcall_participant_map WHERE id = ?existing_id?"
|
dquery = "DELETE FROM shipcall_participant_map WHERE id = ?existing_id?"
|
||||||
commands.execute(dquery, param={"existing_id" : elem["id"]})
|
commands.execute(dquery, param={"existing_id" : elem["id"]})
|
||||||
|
|
||||||
|
# re-evaluate the shipcall
|
||||||
|
evaluate_shipcall_state(mysql_connector_instance=pooledConnection, shipcall_id=schemaModel["id"])
|
||||||
|
|
||||||
# save history data
|
# save history data
|
||||||
# TODO: set ETA properly
|
# TODO: set ETA properly
|
||||||
# query = SQLQuery.create_sql_query_history_put()
|
# query = SQLQuery.create_sql_query_history_put()
|
||||||
|
|||||||
Reference in New Issue
Block a user