feat: implement Moving Motivators feature with session management, real-time event handling, and UI components for enhanced user experience
This commit is contained in:
148
src/lib/types.ts
148
src/lib/types.ts
@@ -152,3 +152,151 @@ export const STATUS_LABELS: Record<ActionStatus, string> = {
|
||||
done: 'Terminé',
|
||||
};
|
||||
|
||||
// ============================================
|
||||
// Moving Motivators - Type Definitions
|
||||
// ============================================
|
||||
|
||||
export type MotivatorType =
|
||||
| 'STATUS'
|
||||
| 'POWER'
|
||||
| 'ORDER'
|
||||
| 'ACCEPTANCE'
|
||||
| 'HONOR'
|
||||
| 'MASTERY'
|
||||
| 'SOCIAL'
|
||||
| 'FREEDOM'
|
||||
| 'CURIOSITY'
|
||||
| 'PURPOSE';
|
||||
|
||||
export interface MotivatorCard {
|
||||
id: string;
|
||||
type: MotivatorType;
|
||||
orderIndex: number; // 1-10, position horizontale (importance)
|
||||
influence: number; // -3 à +3, position verticale
|
||||
sessionId: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export interface MovingMotivatorsSession {
|
||||
id: string;
|
||||
title: string;
|
||||
participant: string;
|
||||
date: Date;
|
||||
userId: string;
|
||||
cards: MotivatorCard[];
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export interface CreateMotivatorSessionInput {
|
||||
title: string;
|
||||
participant: string;
|
||||
date?: Date;
|
||||
}
|
||||
|
||||
export interface UpdateMotivatorSessionInput {
|
||||
title?: string;
|
||||
participant?: string;
|
||||
date?: Date;
|
||||
}
|
||||
|
||||
export interface UpdateMotivatorCardInput {
|
||||
orderIndex?: number;
|
||||
influence?: number;
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Moving Motivators - UI Config
|
||||
// ============================================
|
||||
|
||||
export interface MotivatorConfig {
|
||||
type: MotivatorType;
|
||||
name: string;
|
||||
icon: string;
|
||||
description: string;
|
||||
color: string;
|
||||
}
|
||||
|
||||
export const MOTIVATORS_CONFIG: MotivatorConfig[] = [
|
||||
{
|
||||
type: 'STATUS',
|
||||
name: 'Statut',
|
||||
icon: '👑',
|
||||
description: 'Être reconnu et respecté pour sa position',
|
||||
color: '#8b5cf6', // purple
|
||||
},
|
||||
{
|
||||
type: 'POWER',
|
||||
name: 'Pouvoir',
|
||||
icon: '⚡',
|
||||
description: 'Avoir de l\'influence et du contrôle sur les décisions',
|
||||
color: '#ef4444', // red
|
||||
},
|
||||
{
|
||||
type: 'ORDER',
|
||||
name: 'Ordre',
|
||||
icon: '📋',
|
||||
description: 'Avoir un environnement stable et prévisible',
|
||||
color: '#6b7280', // gray
|
||||
},
|
||||
{
|
||||
type: 'ACCEPTANCE',
|
||||
name: 'Acceptation',
|
||||
icon: '🤝',
|
||||
description: 'Être accepté et approuvé par le groupe',
|
||||
color: '#f59e0b', // amber
|
||||
},
|
||||
{
|
||||
type: 'HONOR',
|
||||
name: 'Honneur',
|
||||
icon: '🏅',
|
||||
description: 'Agir en accord avec ses valeurs personnelles',
|
||||
color: '#eab308', // yellow
|
||||
},
|
||||
{
|
||||
type: 'MASTERY',
|
||||
name: 'Maîtrise',
|
||||
icon: '🎯',
|
||||
description: 'Développer ses compétences et exceller',
|
||||
color: '#22c55e', // green
|
||||
},
|
||||
{
|
||||
type: 'SOCIAL',
|
||||
name: 'Relations',
|
||||
icon: '👥',
|
||||
description: 'Créer des liens et appartenir à un groupe',
|
||||
color: '#ec4899', // pink
|
||||
},
|
||||
{
|
||||
type: 'FREEDOM',
|
||||
name: 'Liberté',
|
||||
icon: '🦅',
|
||||
description: 'Être autonome et indépendant',
|
||||
color: '#06b6d4', // cyan
|
||||
},
|
||||
{
|
||||
type: 'CURIOSITY',
|
||||
name: 'Curiosité',
|
||||
icon: '🔍',
|
||||
description: 'Explorer, apprendre et découvrir',
|
||||
color: '#3b82f6', // blue
|
||||
},
|
||||
{
|
||||
type: 'PURPOSE',
|
||||
name: 'But',
|
||||
icon: '🧭',
|
||||
description: 'Avoir un sens et contribuer à quelque chose de plus grand',
|
||||
color: '#14b8a6', // teal
|
||||
},
|
||||
];
|
||||
|
||||
export const MOTIVATOR_BY_TYPE: Record<MotivatorType, MotivatorConfig> =
|
||||
MOTIVATORS_CONFIG.reduce(
|
||||
(acc, config) => {
|
||||
acc[config.type] = config;
|
||||
return acc;
|
||||
},
|
||||
{} as Record<MotivatorType, MotivatorConfig>
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user