chore: complete initial setup for Next.js project with TypeScript, Tailwind CSS, ESLint, and Prettier; remove unnecessary .DS_Store file

This commit is contained in:
Julien Froidefond
2025-11-27 12:57:36 +01:00
parent 5234428cc3
commit 6d95529579
26 changed files with 11424 additions and 5 deletions

154
src/lib/types.ts Normal file
View File

@@ -0,0 +1,154 @@
// ============================================
// SWOT Manager - Type Definitions
// ============================================
export type SwotCategory = 'STRENGTH' | 'WEAKNESS' | 'OPPORTUNITY' | 'THREAT';
export type ActionStatus = 'todo' | 'in_progress' | 'done';
export type ActionPriority = 0 | 1 | 2; // 0=low, 1=medium, 2=high
export interface User {
id: string;
email: string;
name: string | null;
createdAt: Date;
updatedAt: Date;
}
export interface Session {
id: string;
title: string;
collaborator: string;
date: Date;
userId: string;
items: SwotItem[];
actions: Action[];
createdAt: Date;
updatedAt: Date;
}
export interface SwotItem {
id: string;
content: string;
category: SwotCategory;
order: number;
sessionId: string;
createdAt: Date;
updatedAt: Date;
}
export interface Action {
id: string;
title: string;
description: string | null;
priority: ActionPriority;
status: ActionStatus;
dueDate: Date | null;
sessionId: string;
links: ActionLink[];
createdAt: Date;
updatedAt: Date;
}
export interface ActionLink {
id: string;
actionId: string;
swotItemId: string;
}
// ============================================
// Input Types (for creation/update)
// ============================================
export interface CreateSessionInput {
title: string;
collaborator: string;
date?: Date;
}
export interface UpdateSessionInput {
title?: string;
collaborator?: string;
date?: Date;
}
export interface CreateSwotItemInput {
content: string;
category: SwotCategory;
order?: number;
}
export interface UpdateSwotItemInput {
content?: string;
category?: SwotCategory;
order?: number;
}
export interface CreateActionInput {
title: string;
description?: string;
priority?: ActionPriority;
status?: ActionStatus;
dueDate?: Date;
linkedItemIds: string[];
}
export interface UpdateActionInput {
title?: string;
description?: string;
priority?: ActionPriority;
status?: ActionStatus;
dueDate?: Date;
}
// ============================================
// UI Helper Types
// ============================================
export interface SwotQuadrantConfig {
category: SwotCategory;
title: string;
icon: string;
colorClass: string;
}
export const SWOT_QUADRANTS: SwotQuadrantConfig[] = [
{
category: 'STRENGTH',
title: 'Forces',
icon: '💪',
colorClass: 'strength',
},
{
category: 'WEAKNESS',
title: 'Faiblesses',
icon: '⚠️',
colorClass: 'weakness',
},
{
category: 'OPPORTUNITY',
title: 'Opportunités',
icon: '🚀',
colorClass: 'opportunity',
},
{
category: 'THREAT',
title: 'Menaces',
icon: '🛡️',
colorClass: 'threat',
},
];
export const PRIORITY_LABELS: Record<ActionPriority, string> = {
0: 'Basse',
1: 'Moyenne',
2: 'Haute',
};
export const STATUS_LABELS: Record<ActionStatus, string> = {
todo: 'À faire',
in_progress: 'En cours',
done: 'Terminé',
};