From ad5d9541826500bface9763fc32cf436b43800c1 Mon Sep 17 00:00:00 2001 From: Julien Froidefond Date: Sun, 12 Oct 2025 16:03:11 +0200 Subject: [PATCH] feat: add importance property to category breakdown and update team stats structure --- components/home/category-breakdown.tsx | 1 + hooks/use-teams-management.ts | 8 ++++++-- services/team-review-service.ts | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/components/home/category-breakdown.tsx b/components/home/category-breakdown.tsx index 9ad3a51..15d405f 100644 --- a/components/home/category-breakdown.tsx +++ b/components/home/category-breakdown.tsx @@ -23,6 +23,7 @@ interface CategoryBreakdownProps { id: string; name: string; icon?: string; + importance: "incontournable" | "majeure" | "standard"; }>; }>; } diff --git a/hooks/use-teams-management.ts b/hooks/use-teams-management.ts index d68288b..220c762 100644 --- a/hooks/use-teams-management.ts +++ b/hooks/use-teams-management.ts @@ -61,7 +61,7 @@ export function useTeamsManagement( setTeams((prev) => [...prev, newLocalTeam]); // Ajouter les stats de la nouvelle équipe (avec les propriétés minimales) - const newTeamStats = { + const newTeamStats: TeamStats = { teamId: newTeam.id, teamName: newTeam.name, direction: newTeam.direction, @@ -70,7 +70,11 @@ export function useTeamsManagement( skillCoverage: 0, topSkills: [], members: [], - } as TeamStats; + criticalSkillsCoverage: { + incontournable: 0, + majeure: 0, + }, + }; setTeamStats((prev) => [...prev, newTeamStats]); return true; } catch (error: any) { diff --git a/services/team-review-service.ts b/services/team-review-service.ts index 08a624e..0e49ebe 100644 --- a/services/team-review-service.ts +++ b/services/team-review-service.ts @@ -7,7 +7,7 @@ import { TeamMember, TeamMemberSkill, } from "@/lib/team-review-types"; -import { SkillLevel, SKILL_LEVEL_VALUES } from "@/lib/types"; +import { SKILL_LEVEL_VALUES, SkillImportance } from "@/lib/types"; import { COVERAGE_OBJECTIVES, isCoverageBelowObjective, @@ -159,7 +159,7 @@ export class TeamReviewService { const coverage = calculateSkillCoverage(levels, totalTeamMembers); // Déterminer le niveau de risque en fonction de l'importance et de la couverture - const coverageObjective = COVERAGE_OBJECTIVES[skill.importance]; + const coverageObjective = COVERAGE_OBJECTIVES[skill.importance as SkillImportance]; const risk = skill.importance === "incontournable" && coverage < coverageObjective ? "high"