Commit 1c77d0f8 authored by Jordan Grossemy's avatar Jordan Grossemy
Browse files

API : adressage messagerie par personnage, main courante opérationnelle, presse & skins

- Messagerie : compose adresse des personnages ; remise directe si joueur actif,
  sinon repli vers l'animation (avec personnage cible) ; remise rétroactive ;
  contacts = tous les personnages ; profil joueur.
- Main courante : source + suivi (responsable/échéance/statut) des décisions/actions,
  PATCH staff & joueur, événement temps réel log:update, export CSV enrichi.
- Presse : champ outlet (média) à la publication.
- Exercice : playerSkin dans le DTO de mise à jour ; skin exposé dans la session joueur.

Co-Authored-By: Claude (RCA)
parent 33f4a0be
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -11,8 +11,8 @@ export class DirectoryController {
  constructor(private readonly prisma: PrismaService) {}

  @Get()
  list(@CurrentPlayer() player: PlayerContext) {
    return this.prisma.forTenant(player.tenantId).character.findMany({
  async list(@CurrentPlayer() player: PlayerContext) {
    const rows = await this.prisma.forTenant(player.tenantId).character.findMany({
      where: { exerciseId: player.exerciseId },
      orderBy: { name: 'asc' },
      select: {
@@ -23,7 +23,13 @@ export class DirectoryController {
        simEmail: true,
        kind: true,
        avatarColor: true,
        // participantId : present si un joueur a un acces actif (donc joignable).
        participant: { select: { id: true } },
      },
    });
    return rows.map(({ participant, ...rest }) => ({
      ...rest,
      participantId: participant?.id ?? null,
    }));
  }
}
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ export class ComposeDto {
  @IsOptional()
  @IsArray()
  @IsString({ each: true })
  toParticipantIds?: string[];
  toCharacterIds?: string[];

  @IsOptional()
  @IsBoolean()
+5 −1
Original line number Diff line number Diff line
import { IsOptional, IsString, MaxLength, MinLength } from 'class-validator';
import { IsIn, IsOptional, IsString, MaxLength, MinLength } from 'class-validator';

export class CreateArticleDto {
  @IsOptional()
  @IsIn(['GENERIC', 'LEMONDE', 'FIGARO', 'FRANCEINFO', 'OUESTFRANCE'])
  outlet?: 'GENERIC' | 'LEMONDE' | 'FIGARO' | 'FRANCEINFO' | 'OUESTFRANCE';

  @IsString()
  @MinLength(1)
  @MaxLength(240)
+21 −1
Original line number Diff line number Diff line
import { IsIn, IsString, MaxLength, MinLength } from 'class-validator';
import { IsIn, IsOptional, IsString, MaxLength, MinLength } from 'class-validator';

export class CreateLogEntryDto {
  @IsIn(['FAIT', 'DECISION', 'ACTION', 'ALERTE'])
@@ -8,4 +8,24 @@ export class CreateLogEntryDto {
  @MinLength(1)
  @MaxLength(2000)
  message!: string;

  // Suivi operationnel (facultatif ; responsable/echeance surtout pour decisions & actions).
  @IsOptional()
  @IsString()
  @MaxLength(120)
  source?: string;

  @IsOptional()
  @IsString()
  @MaxLength(120)
  assignee?: string;

  @IsOptional()
  @IsString()
  @MaxLength(60)
  dueLabel?: string;

  @IsOptional()
  @IsIn(['TODO', 'IN_PROGRESS', 'DONE'])
  status?: 'TODO' | 'IN_PROGRESS' | 'DONE';
}
+23 −0
Original line number Diff line number Diff line
import { IsIn, IsOptional, IsString, MaxLength } from 'class-validator';

/** Mise a jour du suivi d'une entree (le message et l'horodatage restent immuables). */
export class UpdateLogEntryDto {
  @IsOptional()
  @IsString()
  @MaxLength(120)
  source?: string;

  @IsOptional()
  @IsString()
  @MaxLength(120)
  assignee?: string;

  @IsOptional()
  @IsString()
  @MaxLength(60)
  dueLabel?: string;

  @IsOptional()
  @IsIn(['TODO', 'IN_PROGRESS', 'DONE'])
  status?: 'TODO' | 'IN_PROGRESS' | 'DONE';
}
Loading