feat: add importance property to category breakdown and update team stats structure

This commit is contained in:
Julien Froidefond
2025-10-12 16:03:11 +02:00
parent 7d12a66c12
commit ad5d954182
3 changed files with 9 additions and 4 deletions

View File

@@ -23,6 +23,7 @@ interface CategoryBreakdownProps {
id: string;
name: string;
icon?: string;
importance: "incontournable" | "majeure" | "standard";
}>;
}>;
}

View File

@@ -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) {

View File

@@ -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"