-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Aaron Chong <[email protected]>
- Loading branch information
1 parent
4d75109
commit d2a7d58
Showing
6 changed files
with
35 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 4 additions & 13 deletions
17
packages/api-server/api_server/models/tortoise_models/alerts.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,17 @@ | ||
from tortoise.fields import CharField, ForeignKeyField, JSONField, ReverseRelation | ||
from tortoise.fields import BooleanField, CharField, JSONField, OneToOneField | ||
from tortoise.models import Model | ||
|
||
|
||
class AlertResponse(Model): | ||
id = CharField(255, pk=True) | ||
alert_request = ForeignKeyField( | ||
"models.AlertRequest", null=True, related_name="alert_response" | ||
alert_request = OneToOneField( | ||
"models.AlertRequest", null=False, related_name="alert_response" | ||
) | ||
data = JSONField() | ||
|
||
|
||
class AlertRequest(Model): | ||
id = CharField(255, pk=True) | ||
data = JSONField() | ||
response_expected = BooleanField(null=False, index=True) | ||
task_id = CharField(255, null=True, index=True) | ||
alert_response = ReverseRelation["FleetAlertResponse"] | ||
|
||
|
||
# how to let backend know that the robot is ready for handling | ||
# how does the backend save this information such that the smart cart API server can query it | ||
# new location and destination model | ||
# when an alert comes in with task id, and with alert parameters | ||
# reached: xx, we update new model for task, so SCAS queries and can update | ||
|
||
# how do we change destinations? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters