feat: enhance DailyCheckbox model and service for type management

- Added `DailyCheckboxType` to define checkbox types ('task' | 'meeting') in TypeScript.
- Updated `DailyCheckbox` model in Prisma schema to include `type` field with a default value of 'task'.
- Modified `DailyService` to handle checkbox type during creation and updates.
- Adjusted API route to accept checkbox type in requests.
- Refactored `DailyPageClient` to support type management in checkbox operations.
This commit is contained in:
Julien Froidefond
2025-09-15 22:16:34 +02:00
parent 08d344652f
commit adfef551ab
11 changed files with 744 additions and 211 deletions

View File

@@ -164,11 +164,14 @@ export class ValidationError extends Error {
}
// Types pour les dailies
export type DailyCheckboxType = 'task' | 'meeting';
export interface DailyCheckbox {
id: string;
date: Date;
text: string;
isChecked: boolean;
type: DailyCheckboxType;
order: number;
taskId?: string;
task?: Task; // Relation optionnelle vers une tâche
@@ -180,6 +183,7 @@ export interface DailyCheckbox {
export interface CreateDailyCheckboxData {
date: Date;
text: string;
type?: DailyCheckboxType;
taskId?: string;
order?: number;
isChecked?: boolean;
@@ -188,6 +192,7 @@ export interface CreateDailyCheckboxData {
export interface UpdateDailyCheckboxData {
text?: string;
isChecked?: boolean;
type?: DailyCheckboxType;
taskId?: string;
order?: number;
}