19c7b9989d
CI / Build, lint & test (push) Failing after 1m37s
- GET /chemistry-styles — lists 18 FUT-style chemistry styles with stat boost breakdowns - POST /collection/:id/chemistry-style — apply a style (Shadow, Hunter, Anchor, etc.) - POST /collection/:id/position — override a player's position for 500 coins - POST /collection/:id/training — add +1/+2/+3 OVR training bonus (max +3 total) - GET /collection now includes chemistry_style, position_override, training_bonus, effective_overall and effective_position fields per owned card - Migration 0007 adds three columns to owned_cards with safe defaults - 10 new integration tests — all 55 pass, clippy clean Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
49 lines
1.1 KiB
Rust
49 lines
1.1 KiB
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
|
|
#[serde(rename_all = "lowercase")]
|
|
pub enum Rarity {
|
|
#[default]
|
|
Bronze,
|
|
Silver,
|
|
Gold,
|
|
RareGold,
|
|
Totw,
|
|
Hero,
|
|
Icon,
|
|
}
|
|
|
|
/// A card definition loaded from JSON data files.
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct CardDefinition {
|
|
pub id: String,
|
|
pub name: String,
|
|
pub overall: u8,
|
|
pub position: String,
|
|
pub nation: String,
|
|
pub league: String,
|
|
pub club: String,
|
|
pub pace: u8,
|
|
pub shooting: u8,
|
|
pub passing: u8,
|
|
pub dribbling: u8,
|
|
pub defending: u8,
|
|
pub physical: u8,
|
|
pub rarity: Rarity,
|
|
pub image_path: Option<String>,
|
|
}
|
|
|
|
/// A card instance owned by a club (stored in DB).
|
|
#[derive(Debug, Clone, Serialize, Deserialize, sqlx::FromRow)]
|
|
pub struct OwnedCard {
|
|
pub id: String,
|
|
pub club_id: String,
|
|
pub card_id: String,
|
|
pub is_loan: bool,
|
|
pub loan_matches_remaining: Option<i64>,
|
|
pub acquired_at: String,
|
|
pub chemistry_style: String,
|
|
pub position_override: Option<String>,
|
|
pub training_bonus: i64,
|
|
}
|