export type CampaignStatus = 'deposit' | 'voting' | 'closed'; export interface Campaign { id: string; title: string; description: string; // Support markdown status: CampaignStatus; budget_per_user: number; spending_tiers: string; // Montants séparés par des virgules slug?: string; // Slug unique pour les liens courts created_at: string; updated_at: string; } export interface CampaignWithStats extends Campaign { stats: { propositions: number; participants: number; }; } export interface Proposition { id: string; campaign_id: string; title: string; description: string; // Support markdown author_first_name: string; author_last_name: string; author_email: string; created_at: string; } export interface Participant { id: string; campaign_id: string; first_name: string; last_name: string; email: string; short_id?: string; // Identifiant court unique pour les liens de vote created_at: string; } export interface Vote { id: string; participant_id: string; proposition_id: string; amount: number; created_at: string; updated_at: string; } export interface PropositionWithVote extends Proposition { vote?: Vote; } export interface ParticipantWithVoteStatus extends Participant { has_voted: boolean; total_voted_amount?: number; } export interface Setting { id: string; key: string; value: string; category: string; description?: string; created_at: string; updated_at: string; } export interface SmtpSettings { host: string; port: number; username: string; password: string; secure: boolean; from_email: string; from_name: string; } export interface Database { public: { Tables: { campaigns: { Row: Campaign; Insert: Omit; Update: Partial>; }; propositions: { Row: Proposition; Insert: Omit; Update: Partial>; }; participants: { Row: Participant; Insert: Omit; Update: Partial>; }; settings: { Row: Setting; Insert: Omit; Update: Partial>; }; }; }; }