Daedalus and Talos integration test
All checks were successful
CI / backend-tests (push) Successful in 26s
CI / frontend-tests (push) Successful in 29s

This commit is contained in:
Julian Tabel
2026-03-20 16:31:19 +01:00
parent 5106e57685
commit c9d42b091f
44 changed files with 8345 additions and 31 deletions

View File

@@ -1,3 +1,4 @@
from app.models.ability import Ability
from app.models.boss_battle import BossBattle
from app.models.boss_pokemon import BossPokemon
from app.models.boss_result import BossResult
@@ -6,6 +7,8 @@ from app.models.evolution import Evolution
from app.models.game import Game
from app.models.genlocke import Genlocke, GenlockeLeg
from app.models.genlocke_transfer import GenlockeTransfer
from app.models.journal_entry import JournalEntry
from app.models.move import Move
from app.models.nuzlocke_run import NuzlockeRun
from app.models.pokemon import Pokemon
from app.models.route import Route
@@ -13,6 +16,7 @@ from app.models.route_encounter import RouteEncounter
from app.models.version_group import VersionGroup
__all__ = [
"Ability",
"BossBattle",
"BossPokemon",
"BossResult",
@@ -22,6 +26,8 @@ __all__ = [
"Genlocke",
"GenlockeLeg",
"GenlockeTransfer",
"JournalEntry",
"Move",
"NuzlockeRun",
"Pokemon",
"Route",

View File

@@ -0,0 +1,15 @@
from sqlalchemy import SmallInteger, String
from sqlalchemy.orm import Mapped, mapped_column
from app.core.database import Base
class Ability(Base):
__tablename__ = "abilities"
id: Mapped[int] = mapped_column(primary_key=True)
name: Mapped[str] = mapped_column(String(50), unique=True)
introduced_gen: Mapped[int] = mapped_column(SmallInteger)
def __repr__(self) -> str:
return f"<Ability(id={self.id}, name='{self.name}', gen={self.introduced_gen})>"

View File

@@ -0,0 +1,37 @@
from datetime import datetime
from uuid import UUID
from sqlalchemy import DateTime, ForeignKey, String, Text, func
from sqlalchemy.orm import Mapped, mapped_column, relationship
from app.core.database import Base
class JournalEntry(Base):
__tablename__ = "journal_entries"
id: Mapped[UUID] = mapped_column(
primary_key=True, server_default=func.gen_random_uuid()
)
run_id: Mapped[int] = mapped_column(
ForeignKey("nuzlocke_runs.id", ondelete="CASCADE"), index=True
)
boss_result_id: Mapped[int | None] = mapped_column(
ForeignKey("boss_results.id", ondelete="SET NULL"), index=True
)
title: Mapped[str] = mapped_column(String(200))
body: Mapped[str] = mapped_column(Text)
created_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True), server_default=func.now()
)
updated_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True), server_default=func.now(), onupdate=func.now()
)
run: Mapped[NuzlockeRun] = relationship(back_populates="journal_entries")
boss_result: Mapped[BossResult | None] = relationship()
def __repr__(self) -> str:
return (
f"<JournalEntry(id={self.id}, run_id={self.run_id}, title='{self.title}')>"
)

View File

@@ -0,0 +1,16 @@
from sqlalchemy import SmallInteger, String
from sqlalchemy.orm import Mapped, mapped_column
from app.core.database import Base
class Move(Base):
__tablename__ = "moves"
id: Mapped[int] = mapped_column(primary_key=True)
name: Mapped[str] = mapped_column(String(50), unique=True)
introduced_gen: Mapped[int] = mapped_column(SmallInteger)
type: Mapped[str | None] = mapped_column(String(20))
def __repr__(self) -> str:
return f"<Move(id={self.id}, name='{self.name}', gen={self.introduced_gen})>"

View File

@@ -27,6 +27,7 @@ class NuzlockeRun(Base):
game: Mapped[Game] = relationship(back_populates="runs")
encounters: Mapped[list[Encounter]] = relationship(back_populates="run")
boss_results: Mapped[list[BossResult]] = relationship(back_populates="run")
journal_entries: Mapped[list[JournalEntry]] = relationship(back_populates="run")
def __repr__(self) -> str:
return (