initial commit
This commit is contained in:
58
src/types/index.ts
Normal file
58
src/types/index.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
export type CampaignStatus = 'deposit' | 'voting' | 'closed';
|
||||
|
||||
export interface Campaign {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
status: CampaignStatus;
|
||||
budget_per_user: number;
|
||||
spending_tiers: string; // Montants séparés par des virgules
|
||||
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;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export interface Participant {
|
||||
id: string;
|
||||
campaign_id: string;
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
email: string;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export interface Database {
|
||||
public: {
|
||||
Tables: {
|
||||
campaigns: {
|
||||
Row: Campaign;
|
||||
Insert: Omit<Campaign, 'id' | 'created_at' | 'updated_at'>;
|
||||
Update: Partial<Omit<Campaign, 'id' | 'created_at' | 'updated_at'>>;
|
||||
};
|
||||
propositions: {
|
||||
Row: Proposition;
|
||||
Insert: Omit<Proposition, 'id' | 'created_at'>;
|
||||
Update: Partial<Omit<Proposition, 'id' | 'created_at'>>;
|
||||
};
|
||||
participants: {
|
||||
Row: Participant;
|
||||
Insert: Omit<Participant, 'id' | 'created_at'>;
|
||||
Update: Partial<Omit<Participant, 'id' | 'created_at'>>;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user