Initial commit: OpenFUT Core

Offline Ultimate Team backend — game-independent REST API.

- 19 API endpoints: auth, profiles, clubs, cards, packs, squads,
  objectives, SBCs, match rewards, NPC market, statistics
- Axum + SQLite + SQLx with full migrations
- Weighted pack generator, SBC validation engine
- JSON-driven mod data (cards, packs, objectives, SBCs)
- 5 integration tests passing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-06-25 14:52:06 -07:00
commit 1ffe0ffa9f
60 changed files with 6152 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize, sqlx::FromRow)]
pub struct Statistics {
pub profile_id: String,
pub matches_played: i64,
pub matches_won: i64,
pub matches_drawn: i64,
pub matches_lost: i64,
pub goals_scored: i64,
pub goals_conceded: i64,
pub packs_opened: i64,
pub sbcs_completed: i64,
pub total_coins_earned: i64,
pub updated_at: String,
}
impl Statistics {
pub fn new(profile_id: impl Into<String>) -> Self {
Self {
profile_id: profile_id.into(),
matches_played: 0,
matches_won: 0,
matches_drawn: 0,
matches_lost: 0,
goals_scored: 0,
goals_conceded: 0,
packs_opened: 0,
sbcs_completed: 0,
total_coins_earned: 0,
updated_at: chrono::Utc::now().to_rfc3339(),
}
}
}