feat(#214): migration Agenda B0 — lots, soft-cancel, prefs

Ajoute agenda_lots versionnés, colonnes soft-cancel / heure / id_lot
sur evenements_agenda, soft-cancel + remonte_le sur card_instances,
revision_lot sur card_responses, preferences JSONB utilisateurs.
Met à jour BDD.sql, ENUMS, verify.sql et entités TypeORM.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-16 16:16:34 +02:00
co-authored by Cursor
parent 38af471054
commit d84cc7e13e
9 changed files with 416 additions and 9 deletions
@@ -9,6 +9,7 @@ import {
} from 'typeorm';
import { AmChildren } from './am_children.entity';
import { Users } from './users.entity';
import { AgendaLots } from './agenda_lots.entity';
export enum TypeEvenementAgendaType {
ABSENCE_ENFANT = 'absence_enfant',
@@ -21,12 +22,13 @@ export enum StatutEvenementAgendaType {
EN_ATTENTE = 'en_attente',
ACCEPTE = 'accepte',
REFUSE = 'refuse',
ANNULE = 'annule',
}
/**
* Vérité métier agenda par couple AM↔enfant (placement).
* Types V1 : absences / congés / arrêts ; extensible (soins, école, mairie…).
* Les cartes collectent ; cette table historise. Ticket #205.
* Les cartes collectent ; cette table historise. Tickets #205 / #214.
*/
@Entity('evenements_agenda', { schema: 'public' })
export class EvenementsAgenda {
@@ -74,13 +76,40 @@ export class EvenementsAgenda {
@JoinColumn({ name: 'cree_par', referencedColumnName: 'id' })
createdBy?: Users;
/** Réf. carte de collecte (FK quand module Cartes existera). */
/** Réf. carte de collecte (module Cartes). */
@Column({ name: 'id_card_instance', type: 'uuid', nullable: true })
id_card_instance?: string;
@Column({ name: 'motif', type: 'text', nullable: true })
motif?: string;
/** Heure métier (soin) — durable hors payload carte. */
@Column({ name: 'heure', type: 'time', nullable: true })
heure?: string;
@Column({ name: 'id_lot', type: 'uuid', nullable: true })
id_lot?: string;
@ManyToOne(() => AgendaLots, { nullable: true, onDelete: 'SET NULL' })
@JoinColumn({ name: 'id_lot', referencedColumnName: 'id' })
lot?: AgendaLots;
@Column({ name: 'verrouille_le', type: 'timestamptz', nullable: true })
verrouille_le?: Date;
@Column({ name: 'refuse_le', type: 'timestamptz', nullable: true })
refuse_le?: Date;
@Column({ name: 'annule_le', type: 'timestamptz', nullable: true })
annule_le?: Date;
@Column({ name: 'annule_par', type: 'uuid', nullable: true })
annule_par?: string;
@ManyToOne(() => Users, { nullable: true, onDelete: 'SET NULL' })
@JoinColumn({ name: 'annule_par', referencedColumnName: 'id' })
annulePar?: Users;
@CreateDateColumn({ name: 'cree_le', type: 'timestamptz' })
cree_le: Date;