Restructure into full project layout

This commit is contained in:
2026-06-16 23:06:16 -06:00
parent de4862b2d1
commit 57765496a6
74 changed files with 4441 additions and 3 deletions
+178
View File
@@ -0,0 +1,178 @@
// ─── Auth & Users ────────────────────────────────────────────────────────────
export type UserRole = 'pending' | 'approved' | 'admin'
export interface User {
id: number
email: string
display_name: string | null
role: UserRole
is_active: boolean
created_at: string
}
export interface AuthTokens {
access_token: string
refresh_token: string
token_type: string
}
// ─── Decks ───────────────────────────────────────────────────────────────────
export type DeckMode = 'generate' | 'complete' | 'cull'
export type CardSlot =
| 'creature'
| 'instant'
| 'sorcery'
| 'enchantment'
| 'artifact'
| 'planeswalker'
| 'land'
| 'battle'
export type BudgetScope = 'purchase' | 'total'
export interface DeckConstraints {
prefer_owned: boolean
budget_enabled: boolean
budget_amount: number | null
budget_scope: BudgetScope
}
export interface DeckCard {
id: number
deck_id: number
card_name: string
slot: CardSlot
quantity: number
is_owned: boolean
is_commander: boolean
ai_reasoning: string | null
scryfall_id: string
scryfall_data: ScryfallCard | null
}
export interface DeckCut {
name: string
reasoning: string
}
export interface Deck {
id: number
owner_id: number
name: string
commander: string
description: string | null
mode: DeckMode
playstyle: string | null
prefer_owned: boolean
budget_enabled: boolean
budget_amount: number | null
budget_scope: BudgetScope
created_at: string
updated_at: string
cards: DeckCard[]
ai_reasoning: {
strategy_summary: string
unresolved_cards: string[]
cuts: DeckCut[]
}
}
export interface DeckSummary {
id: number
name: string
commander: string
mode: DeckMode
playstyle: string | null
created_at: string
card_count: number
}
// ─── Deck Builder Requests ───────────────────────────────────────────────────
export interface ExistingCard {
card_name: string
slot?: CardSlot
quantity?: number
}
export interface GenerateRequest {
commander: string
playstyle?: string
name?: string
description?: string
constraints: DeckConstraints
}
export interface CompleteRequest {
commander: string
playstyle?: string
name?: string
existing_cards: ExistingCard[]
constraints: DeckConstraints
}
export interface CullRequest {
commander: string
name?: string
existing_cards: ExistingCard[]
target_count: number
constraints: DeckConstraints
}
// ─── Collection ──────────────────────────────────────────────────────────────
export interface CollectionCard {
id: number
card_name: string
set_code: string
collector_number: string
quantity: number
foil_quantity: number
scryfall_id: string
scryfall_data: ScryfallCard | null
}
export interface CollectionStats {
total_cards: number
unique_cards: number
foil_cards: number
estimated_value: number | null
}
// ─── Scryfall ────────────────────────────────────────────────────────────────
export interface ScryfallCard {
id: string
name: string
mana_cost?: string
cmc?: number
type_line?: string
oracle_text?: string
colors?: string[]
color_identity?: string[]
legalities?: Record<string, string>
prices?: { usd?: string; usd_foil?: string }
image_uris?: { small?: string; normal?: string; large?: string; art_crop?: string }
card_faces?: Array<{ image_uris?: { small?: string; normal?: string; art_crop?: string } }>
set: string
set_name?: string
collector_number?: string
rarity?: string
}
// ─── API Responses ───────────────────────────────────────────────────────────
export interface PaginatedResponse<T> {
items: T[]
total: number
page: number
page_size: number
pages: number
}
export interface ApiError {
detail: string | Array<{ loc: string[]; msg: string; type: string }>
}