espace-paie-odentas/supabase/migrations
odentas 5b72941777 feat: Système complet de gestion des avenants avec signatures électroniques
 Nouvelles fonctionnalités
- Page de gestion des avenants (/staff/avenants)
- Page de détail d'un avenant (/staff/avenants/[id])
- Création d'avenants (objet, durée, rémunération)
- Génération automatique de PDF d'avenant
- Signature électronique via DocuSeal (employeur puis salarié)
- Changement manuel du statut d'un avenant
- Suppression d'avenants

🔧 Routes API
- POST /api/staff/amendments/create - Créer un avenant
- POST /api/staff/amendments/generate-pdf - Générer le PDF
- POST /api/staff/amendments/[id]/send-signature - Envoyer en signature
- POST /api/staff/amendments/[id]/change-status - Changer le statut
- POST /api/webhooks/docuseal-amendment - Webhook après signature employeur
- GET /api/signatures-electroniques/avenants - Liste des avenants en signature

📧 Système email universel v2
- Migration vers le système universel v2 pour les emails d'avenants
- Template 'signature-request-employee-amendment' pour salariés
- Insertion automatique dans DynamoDB pour la Lambda
- Mise à jour automatique du statut dans Supabase

🗄️ Base de données
- Table 'avenants' avec tous les champs (objet, durée, rémunération)
- Colonnes de notification (last_employer_notification_at, last_employee_notification_at)
- Liaison avec cddu_contracts

🎨 Composants
- AvenantDetailPageClient - Détail complet d'un avenant
- ChangeStatusModal - Changement de statut manuel
- SendSignatureModal - Envoi en signature
- DeleteAvenantModal - Suppression avec confirmation
- AvenantSuccessModal - Confirmation de création

📚 Documentation
- AVENANT_EMAIL_SYSTEM_MIGRATION.md - Guide complet de migration

🐛 Corrections
- Fix parsing défensif dans Lambda AWS
- Fix récupération des données depuis DynamoDB
- Fix statut MFA !== 'verified' au lieu de === 'unverified'
2025-10-23 15:30:11 +02:00
..
001_create_email_logs.sql Initial commit 2025-10-12 17:05:46 +02:00
0001_tickets.sql Initial commit - TypeScript errors fixed, build working 2025-10-07 14:51:56 +02:00
002_backfill_contract_ids_in_email_logs.sql feat: Add notification tracking system with smart reminders 2025-10-22 21:49:35 +02:00
0002_notes_functions.sql Initial commit - TypeScript errors fixed, build working 2025-10-07 14:51:56 +02:00
002_update_email_logs_safe.sql Initial commit 2025-10-12 17:05:46 +02:00
003_add_html_content_to_email_logs.sql Initial commit 2025-10-12 17:05:46 +02:00
0003_maintenance_status_customization.sql Initial commit - TypeScript errors fixed, build working 2025-10-07 14:51:56 +02:00
0003_professions_feminisations.sql Initial commit 2025-10-12 17:05:46 +02:00
0004_search_index_policies.sql Initial commit 2025-10-12 17:05:46 +02:00
20251009_documents_rls.sql Initial commit 2025-10-12 17:05:46 +02:00
20251023_add_avenants_notification_columns.sql feat: Système complet de gestion des avenants avec signatures électroniques 2025-10-23 15:30:11 +02:00
20251023_create_avenants_table.sql feat: Système complet de gestion des avenants avec signatures électroniques 2025-10-23 15:30:11 +02:00
20241007000000_create_auto_declaration_tokens.sql Initial commit 2025-10-12 17:05:46 +02:00
add_bulk_signature_notification_email_type.sql Ajout filtre org Virements salaires 2025-10-13 02:21:23 +02:00
add_notification_timestamps_to_contracts.sql feat: Add notification tracking system with smart reminders 2025-10-22 21:49:35 +02:00
add_salaires_payes_column.sql Modification virements salaires staff 2025-10-14 17:33:43 +02:00
add_signature_b64_column.sql Signature préremplie B64 2025-10-14 19:23:14 +02:00
alternative_policy.sql Initial commit 2025-10-12 17:05:46 +02:00
debug_auth_uid.sql Initial commit 2025-10-12 17:05:46 +02:00
debug_disable_rls.sql Initial commit 2025-10-12 17:05:46 +02:00
diagnostic_email_logs.sql Initial commit 2025-10-12 17:05:46 +02:00
final_rls_fix.sql Initial commit 2025-10-12 17:05:46 +02:00
fix_contribution_notifications_id.sql Cotis mensuelles et notifs 2025-10-13 20:56:34 +02:00
fix_message_count_trigger.sql Initial commit - TypeScript errors fixed, build working 2025-10-07 14:51:56 +02:00
fix_rls_policies.sql Initial commit 2025-10-12 17:05:46 +02:00
fix_staff_access.sql Initial commit 2025-10-12 17:05:46 +02:00
remove_resolved_status.sql Initial commit - TypeScript errors fixed, build working 2025-10-07 14:51:56 +02:00
temporary_policy_fix.sql Initial commit 2025-10-12 17:05:46 +02:00
transpose_callsheet_to_num_appel.sql Modification virements salaires staff 2025-10-14 17:33:43 +02:00