Skip to content

Commit

Permalink
Update ZZZNotes to include new Hollow Zero info
Browse files Browse the repository at this point in the history
  • Loading branch information
seriaati committed Sep 26, 2024
1 parent 4286588 commit 5e6a3e1
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions genshin/models/zzz/chronicle/notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,36 @@ class ZZZEngagement(APIModel):
max: int


class BountyCommission(APIModel):
"""ZZZ sticky notes, Hollow Zero bounty commission model."""

num: int
total: int


class SurveyPoints(APIModel):
"""ZZZ sticky notes, Hollow Zero investigation points model."""

num: int
total: int
is_max_level: bool # Not sure what this means


class HollowZero(APIModel):
"""Hollow Zero in ZZZ sticky notes model."""

bounty_commission: BountyCommission
investigation_point: SurveyPoints = Aliased("survey_points")


class ZZZNotes(APIModel):
"""Zenless Zone Zero sticky notes model."""

battery_charge: BatteryCharge = Aliased("energy")
engagement: ZZZEngagement = Aliased("vitality")
scratch_card_completed: bool = Aliased("card_sign")
video_store_state: VideoStoreState
hollow_zero: HollowZero

@pydantic.field_validator("scratch_card_completed", mode="before")
def __transform_value(cls, v: typing.Literal["CardSignDone", "CardSignNotDone"]) -> bool:
Expand All @@ -63,4 +86,8 @@ def __transform_value(cls, v: typing.Literal["CardSignDone", "CardSignNotDone"])
@pydantic.model_validator(mode="before")
def __unnest_value(cls, values: dict[str, typing.Any]) -> dict[str, typing.Any]:
values["video_store_state"] = values["vhs_sale"]["sale_state"]
values["hollow_zero"] = {
"bounty_commission": values["bounty_commission"],
"survey_points": values["survey_points"],
}
return values

0 comments on commit 5e6a3e1

Please sign in to comment.