Enhance task management with start dates and improved visibility

Introduce task start dates, allowing for future task scheduling and better visibility for managers and employees. Admins can now see all tasks, while other roles only see tasks that have started or have no start date. Includes UI updates to visually distinguish future tasks and a new form for creating tasks with start and due dates.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: cc2d271b-82f0-4d6a-9302-a0b067ffb429
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/cc2d271b-82f0-4d6a-9302-a0b067ffb429/kX6A8MG
This commit is contained in:
michaelschal committed 2025-08-19 07:23:52 +00:00
1 parent 87cc2a0f88
commit aa1906a9bb
7 files changed
+701 -512

No files matched your search

+6 -3
View File
@@ -248,6 +248,7 @@ export const tasks = pgTable("tasks", {
id: serial("id").primaryKey(),
title: varchar("title").notNull(), // Titre de la tâche (requis)
description: text("description"), // Description de la tâche (optionnel)
startDate: timestamp("start_date"), // Date de départ (optionnel) - aligné avec production
dueDate: date("due_date"), // Date d'échéance (optionnel)
priority: varchar("priority").notNull().default("medium"), // low, medium, high
status: varchar("status").notNull().default("pending"), // pending, completed
@@ -532,7 +533,8 @@ export const insertTaskSchema = createInsertSchema(tasks).omit({
completedAt: true,
completedBy: true,
}).extend({
dueDate: z.coerce.date().optional().nullable(), // Convertit automatiquement les chaînes en Date
startDate: z.coerce.date().optional().nullable(), // Date de départ (optionnel)
dueDate: z.coerce.date().optional().nullable(), // Date d'échéance (optionnel)
});
export const insertDashboardMessageSchema = createInsertSchema(dashboardMessages).omit({
@@ -648,8 +650,9 @@ export type InvoiceVerificationCache = typeof invoiceVerificationCache.$inferSel
// Task with relations type
export type TaskWithRelations = Task & {
creator: User;
group: Group;
creator?: User;
group?: Group;
isFutureTask?: boolean; // Pour distinguer les tâches futures (admin/directeur)
};
// Dashboard Message with relations type