feat: add importance property to category breakdown and update team stats structure
This commit is contained in:
@@ -23,6 +23,7 @@ interface CategoryBreakdownProps {
|
||||
id: string;
|
||||
name: string;
|
||||
icon?: string;
|
||||
importance: "incontournable" | "majeure" | "standard";
|
||||
}>;
|
||||
}>;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user