Files
OpenFUT-Core/src/models/club.rs
T
funman300 a749fba93c
CI / Build, lint & test (push) Failing after 1m42s
Phase 9: division/season tracking, club customization, pack history, notifications
- GET /division returns live season stats (points, record, promotion threshold)
- PUT /club allows updating club name and manager_name
- GET /packs/history returns opened packs with full card definitions
- GET /notifications dynamically surfaces completed objectives, expiring loans, season end
- Club model gains manager_name column (migration 0006 already added it)
- Pack model gains opened_cards and opened_at; pack SELECT queries updated
- 9 new integration tests — all 45 pass, clippy clean

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 16:50:35 -07:00

32 lines
832 B
Rust

use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use uuid::Uuid;
#[derive(Debug, Clone, Serialize, Deserialize, sqlx::FromRow)]
pub struct Club {
pub id: String,
pub profile_id: String,
pub name: String,
pub coins: i64,
pub level: i64,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub manager_name: Option<String>,
}
impl Club {
pub fn new(profile_id: impl Into<String>, name: impl Into<String>, coins: i64) -> Self {
let now = Utc::now();
Self {
id: Uuid::new_v4().to_string(),
profile_id: profile_id.into(),
name: name.into(),
coins,
level: 1,
created_at: now,
updated_at: now,
manager_name: Some("Player Manager".to_string()),
}
}
}