summaryrefslogtreecommitdiff
path: root/entities/task_types.py
diff options
context:
space:
mode:
authorBotond Hende <nettingman@gmail.com>2024-09-02 00:21:13 +0200
committerBotond Hende <nettingman@gmail.com>2024-09-02 00:21:13 +0200
commit1638f40eccc4a1321ee1bf19e3756157b6c965e1 (patch)
tree99209de68ebcd4f42cafcdf14e563d7916d69e00 /entities/task_types.py
parent3a390ff218903b8665a99f94d7f3a65357b6e96d (diff)
refactored code, use get_ship dependency for ship related calls
Diffstat (limited to 'entities/task_types.py')
-rw-r--r--entities/task_types.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/entities/task_types.py b/entities/task_types.py
new file mode 100644
index 0000000..d23ce55
--- /dev/null
+++ b/entities/task_types.py
@@ -0,0 +1,21 @@
+from typing import Annotated
+from pydantic.functional_validators import AfterValidator
+
+IDLE = 'IDLE'
+MINING = 'MINING'
+
+MIA = 'MIA'
+ERROR = 'ERROR'
+
+task_types = [
+ IDLE,
+ MINING,
+]
+
+
+def is_task_type(task: str):
+ assert task in task_types, f"'{task}' is not a valid task type."
+ return task
+
+
+task_type = Annotated[str, AfterValidator(is_task_type)]