Enforce Dupes Clause and Shiny Clause rules
Dupes Clause greys out Pokemon in the encounter modal whose evolution family has already been caught, preventing duplicate selections. Shiny Clause adds a dedicated Shiny Box and lets shiny catches bypass the one-per-route lock via a new is_shiny column on encounters and a /pokemon/families endpoint that computes evolution family groups. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import DateTime, ForeignKey, SmallInteger, String, func
|
||||
from sqlalchemy import Boolean, DateTime, ForeignKey, SmallInteger, String, func, text
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from app.core.database import Base
|
||||
@@ -21,6 +21,7 @@ class Encounter(Base):
|
||||
current_pokemon_id: Mapped[int | None] = mapped_column(
|
||||
ForeignKey("pokemon.id"), index=True
|
||||
)
|
||||
is_shiny: Mapped[bool] = mapped_column(Boolean, default=False, server_default=text("false"))
|
||||
caught_at: Mapped[datetime] = mapped_column(
|
||||
DateTime(timezone=True), server_default=func.now()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user