feat: complete Phase 4 of service refactoring
- Marked tasks in `TODO.md` as completed for moving task-related files to the `task-management` directory and correcting imports across the codebase. - Updated imports in `seed-data.ts`, `seed-tags.ts`, API routes, and various components to reflect the new structure. - Removed obsolete `daily.ts`, `tags.ts`, and `tasks.ts` files to streamline the codebase. - Added new tasks in `TODO.md` for future cleaning and organization of service imports.
This commit is contained in:
21
TODO.md
21
TODO.md
@@ -126,13 +126,16 @@ src/services/
|
|||||||
- [x] Corriger import dans script backup-manager.ts
|
- [x] Corriger import dans script backup-manager.ts
|
||||||
- [x] Corriger imports relatifs entre services
|
- [x] Corriger imports relatifs entre services
|
||||||
|
|
||||||
### Phase 4: Task Management
|
### Phase 4: Task Management ✅
|
||||||
- [ ] **Déplacer `tasks.ts`** → `task-management/tasks.ts`
|
- [x] **Déplacer `tasks.ts`** → `task-management/tasks.ts`
|
||||||
- [ ] Corriger imports dans actions/tasks, hooks/useTasks
|
- [x] Corriger 7 imports externes (pages, API routes, actions)
|
||||||
- [ ] **Déplacer `tags.ts`** → `task-management/tags.ts`
|
- [x] Corriger import dans script seed-data.ts
|
||||||
- [ ] Corriger import dans `actions/tags.ts`
|
- [x] **Déplacer `tags.ts`** → `task-management/tags.ts`
|
||||||
- [ ] **Déplacer `daily.ts`** → `task-management/daily.ts`
|
- [x] Corriger 8 imports externes (pages, API routes, actions)
|
||||||
- [ ] Corriger imports dans hooks/useDaily, actions/daily
|
- [x] Corriger import dans script seed-tags.ts
|
||||||
|
- [x] **Déplacer `daily.ts`** → `task-management/daily.ts`
|
||||||
|
- [x] Corriger 6 imports externes (pages, API routes, actions)
|
||||||
|
- [x] Corriger imports relatifs vers ../core/database
|
||||||
|
|
||||||
### Phase 5: Intégrations (déjà partiellement fait)
|
### Phase 5: Intégrations (déjà partiellement fait)
|
||||||
- [ ] **Déplacer `tfs.ts`** → `integrations/tfs.ts`
|
- [ ] **Déplacer `tfs.ts`** → `integrations/tfs.ts`
|
||||||
@@ -147,8 +150,8 @@ src/services/
|
|||||||
- [ ] Corriger tous les imports Jira dans actions, API routes, hooks
|
- [ ] Corriger tous les imports Jira dans actions, API routes, hooks
|
||||||
|
|
||||||
## phase 6: cleaning
|
## phase 6: cleaning
|
||||||
- [ ] Les imports des services dans les services : pourquoi ne pas utiliser @services/... ?
|
- [ ] Les imports des services dans les services : pourquoi ne pas utiliser @/services/... ?
|
||||||
- [ ] Les types & interfaces dans services : j'aimerai isoler les types et revoir les imports; par dossier un par un.
|
- [ ] Les types & interfaces dans services : j'aimerai isoler les types dans des fihiers séparés et revoir les imports; par dossier un par un. Tant qu'à faire, il faudrait qu'on fasse toujours des "import type {} from ..." (ajouter le mot type sur l'import des types)
|
||||||
|
|
||||||
### Points d'attention pour chaque service:
|
### Points d'attention pour chaque service:
|
||||||
1. **Identifier tous les imports du service** (grep)
|
1. **Identifier tous les imports du service** (grep)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { tasksService } from '../src/services/tasks';
|
import { tasksService } from '../src/services/task-management/tasks';
|
||||||
import { TaskStatus, TaskPriority } from '../src/lib/types';
|
import { TaskStatus, TaskPriority } from '../src/lib/types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { tagsService } from '../src/services/tags';
|
import { tagsService } from '../src/services/task-management/tags';
|
||||||
|
|
||||||
async function seedTags() {
|
async function seedTags() {
|
||||||
console.log('🏷️ Création des tags de test...');
|
console.log('🏷️ Création des tags de test...');
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use server';
|
'use server';
|
||||||
|
|
||||||
import { dailyService } from '@/services/daily';
|
import { dailyService } from '@/services/task-management/daily';
|
||||||
import { UpdateDailyCheckboxData, DailyCheckbox, CreateDailyCheckboxData } from '@/lib/types';
|
import { UpdateDailyCheckboxData, DailyCheckbox, CreateDailyCheckboxData } from '@/lib/types';
|
||||||
import { revalidatePath } from 'next/cache';
|
import { revalidatePath } from 'next/cache';
|
||||||
import { getToday, getPreviousWorkday, parseDate, normalizeDate } from '@/lib/date-utils';
|
import { getToday, getPreviousWorkday, parseDate, normalizeDate } from '@/lib/date-utils';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use server';
|
'use server';
|
||||||
|
|
||||||
import { tagsService } from '@/services/tags';
|
import { tagsService } from '@/services/task-management/tags';
|
||||||
import { revalidatePath } from 'next/cache';
|
import { revalidatePath } from 'next/cache';
|
||||||
import { Tag } from '@/lib/types';
|
import { Tag } from '@/lib/types';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use server'
|
'use server'
|
||||||
|
|
||||||
import { tasksService } from '@/services/tasks';
|
import { tasksService } from '@/services/task-management/tasks';
|
||||||
import { revalidatePath } from 'next/cache';
|
import { revalidatePath } from 'next/cache';
|
||||||
import { TaskStatus, TaskPriority } from '@/lib/types';
|
import { TaskStatus, TaskPriority } from '@/lib/types';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { NextRequest, NextResponse } from 'next/server';
|
import { NextRequest, NextResponse } from 'next/server';
|
||||||
import { dailyService } from '@/services/daily';
|
import { dailyService } from '@/services/task-management/daily';
|
||||||
|
|
||||||
export async function PATCH(
|
export async function PATCH(
|
||||||
request: NextRequest,
|
request: NextRequest,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { NextResponse } from 'next/server';
|
import { NextResponse } from 'next/server';
|
||||||
import { dailyService } from '@/services/daily';
|
import { dailyService } from '@/services/task-management/daily';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API route pour récupérer toutes les dates avec des dailies
|
* API route pour récupérer toutes les dates avec des dailies
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { NextRequest, NextResponse } from 'next/server';
|
import { NextRequest, NextResponse } from 'next/server';
|
||||||
import { dailyService } from '@/services/daily';
|
import { dailyService } from '@/services/task-management/daily';
|
||||||
import { DailyCheckboxType } from '@/lib/types';
|
import { DailyCheckboxType } from '@/lib/types';
|
||||||
|
|
||||||
export async function GET(request: NextRequest) {
|
export async function GET(request: NextRequest) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { NextResponse } from 'next/server';
|
import { NextResponse } from 'next/server';
|
||||||
import { dailyService } from '@/services/daily';
|
import { dailyService } from '@/services/task-management/daily';
|
||||||
import { getToday, parseDate, isValidAPIDate, createDateFromParts } from '@/lib/date-utils';
|
import { getToday, parseDate, isValidAPIDate, createDateFromParts } from '@/lib/date-utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { NextRequest, NextResponse } from 'next/server';
|
import { NextRequest, NextResponse } from 'next/server';
|
||||||
import { tagsService } from '@/services/tags';
|
import { tagsService } from '@/services/task-management/tags';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GET /api/tags/[id] - Récupère un tag par son ID
|
* GET /api/tags/[id] - Récupère un tag par son ID
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { NextRequest, NextResponse } from 'next/server';
|
import { NextRequest, NextResponse } from 'next/server';
|
||||||
import { tagsService } from '@/services/tags';
|
import { tagsService } from '@/services/task-management/tags';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GET /api/tags - Récupère tous les tags ou recherche par query
|
* GET /api/tags - Récupère tous les tags ou recherche par query
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { NextRequest, NextResponse } from 'next/server';
|
import { NextRequest, NextResponse } from 'next/server';
|
||||||
import { tasksService } from '@/services/tasks';
|
import { tasksService } from '@/services/task-management/tasks';
|
||||||
|
|
||||||
export async function GET(
|
export async function GET(
|
||||||
request: NextRequest,
|
request: NextRequest,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { NextResponse } from 'next/server';
|
import { NextResponse } from 'next/server';
|
||||||
import { tasksService } from '@/services/tasks';
|
import { tasksService } from '@/services/task-management/tasks';
|
||||||
import { TaskStatus } from '@/lib/types';
|
import { TaskStatus } from '@/lib/types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Metadata } from 'next';
|
import { Metadata } from 'next';
|
||||||
import { DailyPageClient } from './DailyPageClient';
|
import { DailyPageClient } from './DailyPageClient';
|
||||||
import { dailyService } from '@/services/daily';
|
import { dailyService } from '@/services/task-management/daily';
|
||||||
import { getToday } from '@/lib/date-utils';
|
import { getToday } from '@/lib/date-utils';
|
||||||
|
|
||||||
// Force dynamic rendering (no static generation)
|
// Force dynamic rendering (no static generation)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { tasksService } from '@/services/tasks';
|
import { tasksService } from '@/services/task-management/tasks';
|
||||||
import { tagsService } from '@/services/tags';
|
import { tagsService } from '@/services/task-management/tags';
|
||||||
import { KanbanPageClient } from './KanbanPageClient';
|
import { KanbanPageClient } from './KanbanPageClient';
|
||||||
|
|
||||||
// Force dynamic rendering (no static generation)
|
// Force dynamic rendering (no static generation)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { tasksService } from '@/services/tasks';
|
import { tasksService } from '@/services/task-management/tasks';
|
||||||
import { tagsService } from '@/services/tags';
|
import { tagsService } from '@/services/task-management/tags';
|
||||||
import { HomePageClient } from '@/components/HomePageClient';
|
import { HomePageClient } from '@/components/HomePageClient';
|
||||||
|
|
||||||
// Force dynamic rendering (no static generation)
|
// Force dynamic rendering (no static generation)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { tasksService } from '@/services/tasks';
|
import { tasksService } from '@/services/task-management/tasks';
|
||||||
import { tagsService } from '@/services/tags';
|
import { tagsService } from '@/services/task-management/tags';
|
||||||
import { backupService } from '@/services/data-management/backup';
|
import { backupService } from '@/services/data-management/backup';
|
||||||
import { backupScheduler } from '@/services/data-management/backup-scheduler';
|
import { backupScheduler } from '@/services/data-management/backup-scheduler';
|
||||||
import { AdvancedSettingsPageClient } from '@/components/settings/AdvancedSettingsPageClient';
|
import { AdvancedSettingsPageClient } from '@/components/settings/AdvancedSettingsPageClient';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { tagsService } from '@/services/tags';
|
import { tagsService } from '@/services/task-management/tags';
|
||||||
import { GeneralSettingsPageClient } from '@/components/settings/GeneralSettingsPageClient';
|
import { GeneralSettingsPageClient } from '@/components/settings/GeneralSettingsPageClient';
|
||||||
|
|
||||||
// Force dynamic rendering for real-time data
|
// Force dynamic rendering for real-time data
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Header } from '@/components/ui/Header';
|
import { Header } from '@/components/ui/Header';
|
||||||
import { ManagerSummaryService } from '@/services/analytics/manager-summary';
|
import { ManagerSummaryService } from '@/services/analytics/manager-summary';
|
||||||
import { tasksService } from '@/services/tasks';
|
import { tasksService } from '@/services/task-management/tasks';
|
||||||
import { tagsService } from '@/services/tags';
|
import { tagsService } from '@/services/task-management/tags';
|
||||||
import { WeeklyManagerPageClient } from './WeeklyManagerPageClient';
|
import { WeeklyManagerPageClient } from './WeeklyManagerPageClient';
|
||||||
|
|
||||||
// Force dynamic rendering (no static generation)
|
// Force dynamic rendering (no static generation)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { prisma } from './core/database';
|
import { prisma } from '../core/database';
|
||||||
import { Prisma } from '@prisma/client';
|
import { Prisma } from '@prisma/client';
|
||||||
import { DailyCheckbox, DailyView, CreateDailyCheckboxData, UpdateDailyCheckboxData, BusinessError, DailyCheckboxType, TaskStatus, TaskPriority, TaskSource } from '@/lib/types';
|
import { DailyCheckbox, DailyView, CreateDailyCheckboxData, UpdateDailyCheckboxData, BusinessError, DailyCheckboxType, TaskStatus, TaskPriority, TaskSource } from '@/lib/types';
|
||||||
import { getPreviousWorkday, normalizeDate, formatDateForAPI, getToday, getYesterday } from '@/lib/date-utils';
|
import { getPreviousWorkday, normalizeDate, formatDateForAPI, getToday, getYesterday } from '@/lib/date-utils';
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { prisma } from './core/database';
|
import { prisma } from '../core/database';
|
||||||
import { Prisma } from '@prisma/client';
|
import { Prisma } from '@prisma/client';
|
||||||
import { Tag } from '@/lib/types';
|
import { Tag } from '@/lib/types';
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { prisma } from './core/database';
|
import { prisma } from '../core/database';
|
||||||
import { Task, TaskStatus, TaskPriority, TaskSource, BusinessError, DailyCheckbox, DailyCheckboxType } from '@/lib/types';
|
import { Task, TaskStatus, TaskPriority, TaskSource, BusinessError, DailyCheckbox, DailyCheckboxType } from '@/lib/types';
|
||||||
import { Prisma } from '@prisma/client';
|
import { Prisma } from '@prisma/client';
|
||||||
import { getToday } from '@/lib/date-utils';
|
import { getToday } from '@/lib/date-utils';
|
||||||
Reference in New Issue
Block a user