feat: league tier system + retrained V25 models (48 quality leagues)
Deploy Iddaai Backend / build-and-deploy (push) Failing after 3m56s

- Add LeagueTier DB model and Prisma schema
- Add league-tiers service (CRUD, sync, retrain trigger)
- Add league-tiers controller with admin API endpoints
- Add /v1/admin/retrain endpoint in AI engine (extract→train→reload pipeline)
- Retrain V25 Pro with 48 quality leagues (MS accuracy: 26.9%→51.4%)
- Update qualified_leagues.json (443→48 leagues)
- Include V25 model files in repo for Docker deployment

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-20 21:57:15 +03:00
parent e001ce9ab5
commit 21e05148c8
58 changed files with 112323 additions and 897 deletions
+26
View File
@@ -35,6 +35,7 @@ model League {
country Country? @relation(fields: [countryId], references: [id])
liveMatches LiveMatch[]
matches Match[]
leagueTier LeagueTier?
@@unique([name, countryId, sport])
@@index([sport])
@@ -807,6 +808,31 @@ model Translation {
@@map("translations")
}
// ─────────────────────────────────────────────────────────────
// League Tier System — Controls which leagues are used for
// model training, live data fetching, and predictions.
// Managed from admin panel. When a league is added/removed,
// qualified_leagues.json is auto-regenerated and model
// retraining is triggered.
// ─────────────────────────────────────────────────────────────
model LeagueTier {
id Int @id @default(autoincrement())
leagueId String @map("league_id")
tier Int @default(1) // 1=Elmas, 2=Altın, 3=Gümüş
isActive Boolean @default(true) @map("is_active")
addedBy String? @map("added_by") // admin user id
notes String? // e.g. "Margin 0.138, 828 maç"
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
league League @relation(fields: [leagueId], references: [id], onDelete: Cascade)
@@unique([leagueId])
@@index([tier, isActive])
@@map("league_tiers")
}
// ─────────────────────────────────────────────────────────────
// Enums
// ─────────────────────────────────────────────────────────────