Commit f1cafdb6 authored by Jordan Grossemy's avatar Jordan Grossemy
Browse files

Merge branch 'feat/kits-immersif-exercices'

Intègre : lisibilité des titres/objets des kits ANSSI ; suppression
d'exercice réservée à l'admin après archivage + parcours de
personnalisation à la création ; purge des kits non-ANSSI, canaux
presse/appel, kit « Global (immersif) » + injects de bruit.

Co-Authored-By: Claude (RCA)
parents 2458d1b2 77d51465
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
-- Purge des kits non-ANSSI retirés du catalogue (contenus rédigés pour Cythin,
-- destinés à être refaits). Les enfants (KitInject, KitCharacter, KitChannel,
-- KitDocument) sont supprimés automatiquement via ON DELETE CASCADE.
DELETE FROM "Kit"
WHERE "builtinId" IN (
  'rancongiciel-massifie',
  'enseignement-superieur',
  'agroalimentaire',
  'audiovisuel'
);
+4 −0
Original line number Diff line number Diff line
-- Personnalisation d'exercice : contexte de mise en situation (organisation,
-- ville, EDR, partenaire, média, date de démarrage) + support des variables
-- {{...}} substituées à l'installation d'un kit.
ALTER TABLE "Exercise" ADD COLUMN "context" JSONB;
+6 −0
Original line number Diff line number Diff line
-- Support presse (NEWS) et appel (CALL) dans les injects de kit :
-- champs spécifiques (qui appeler ; média / source / rubrique de presse).
ALTER TABLE "KitInject" ADD COLUMN "to" TEXT;
ALTER TABLE "KitInject" ADD COLUMN "outlet" TEXT;
ALTER TABLE "KitInject" ADD COLUMN "newsSource" TEXT;
ALTER TABLE "KitInject" ADD COLUMN "newsCategory" TEXT;
+8 −0
Original line number Diff line number Diff line
@@ -92,6 +92,8 @@ model Exercise {
  sector      String?
  status      ExerciseStatus @default(DRAFT)
  playerSkin  PlayerSkin     @default(DEFAULT)
  /// Personnalisation (mise en situation) : { organisation, ville, edr, partenaire, media, startAt }.
  context     Json?

  // Horloge d'exercice pilotable (pilotage au lot 3, cf. spec-technique §1.4).
  clockRunning       Boolean   @default(false)
@@ -577,6 +579,12 @@ model KitInject {
  authorName     String?
  authorHandle   String?
  likes          Int?
  /// Appel (CALL) : qui appeler.
  to             String?
  /// Presse (NEWS) : media, source, rubrique.
  outlet         String?
  newsSource     String?
  newsCategory   String?

  @@index([kitId])
}
+39 −0
Original line number Diff line number Diff line
import { IsEnum, IsOptional, IsString, MaxLength } from 'class-validator';
import { PlayerSkin } from '@prisma/client';

/** Champs de personnalisation communs à la création d'exercice et à l'installation d'un kit. */
export class PersonalizationDto {
  @IsOptional()
  @IsEnum(PlayerSkin)
  playerSkin?: PlayerSkin;

  @IsOptional()
  @IsString()
  @MaxLength(160)
  organisation?: string;

  @IsOptional()
  @IsString()
  @MaxLength(160)
  ville?: string;

  @IsOptional()
  @IsString()
  @MaxLength(160)
  edr?: string;

  @IsOptional()
  @IsString()
  @MaxLength(160)
  partenaire?: string;

  @IsOptional()
  @IsString()
  @MaxLength(160)
  media?: string;

  @IsOptional()
  @IsString()
  @MaxLength(40)
  startAt?: string;
}
Loading