Refactor EventRelation: Fix query logic for byEvent, adjust insert fields, and update setFrom parameter handling. Update ResponseRelation to align with updated EventRelation structure.

This commit is contained in:
2025-09-28 10:28:24 +02:00
parent 56d34f0311
commit 21d628b338
2 changed files with 10 additions and 8 deletions
@@ -63,7 +63,8 @@ data class ResponseGroups(
@Serializable
data class ResponseRelation(
val id: Int,
val fight: ResponseEventFight,
val fight: Int,
val team: EventRelation.FightTeam,
val type: FromType,
val fromFight: ResponseEventFight? = null,
val fromGroup: ResponseGroups? = null,
@@ -71,7 +72,8 @@ data class ResponseRelation(
) {
constructor(relation: EventRelation) : this(
relation.id,
ResponseEventFight(relation.fight),
relation.fightId,
relation.fightTeam,
relation.fromType,
relation.fromFight.map { ResponseEventFight(it) }.orElse(null),
relation.fromGroup.map { ResponseGroups(it) }.orElse(null),