Skip to content

Commit

Permalink
convert statuses to enum
Browse files Browse the repository at this point in the history
  • Loading branch information
kgirtxd committed Sep 30, 2023
1 parent f1965bf commit f96cd16
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions genshin/models/genshin/chronicle/notes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Genshin chronicle notes."""
import datetime
import enum
import typing

if typing.TYPE_CHECKING:
Expand Down Expand Up @@ -73,24 +74,32 @@ def seconds(self) -> int:
return self.timedata[3]


class TaskRewardStatus(str, enum.Enum):
"""Task Reward Statuses."""

UNFINISHED = "TaskRewardStatusUnfinished"
FINISHED = "TaskRewardStatusFinished"


class TaskReward(APIModel):
"""Status of the Commission/Task."""

status: typing.Literal[
"TaskRewardStatusTakenAward",
"TaskRewardStatusUnfinished"
]
status: TaskRewardStatus


class AttendanceRewardStatus(str, enum.Enum):
"""Attendance Reward Statuses."""

AVAILABLE = "AttendanceRewardStatusWaitTaken"
COLLECTED = "AttendanceRewardStatusTakenAward"
FORBIDDEN = "AttendanceRewardStatusForbid"
UNAVAILABLE = "AttendanceRewardStatusUnfinished"


class AttendanceReward(APIModel):
"""Status of the Encounter Point."""

status: typing.Literal[
"TaskRewardStatusTakenAward",
"AttendanceRewardStatusTakenAward",
"AttendanceRewardStatusWaitTaken",
"AttendanceRewardStatusUnfinished"
]
status: AttendanceRewardStatus
progress: int


Expand All @@ -102,9 +111,7 @@ class DailyTasks(APIModel):
claimed_commission_reward: bool = Aliased("is_extra_task_reward_received")

task_rewards: typing.Sequence[TaskReward]

attendance_rewards: typing.Sequence[AttendanceReward]

attendance_visible: bool


Expand Down

0 comments on commit f96cd16

Please sign in to comment.