docs+fix(#173): API cards sans couleur ; alignement evenements_agenda
Couleur = mapping front (type_code). Spec §32 / mini-spec bulles. Rebase sur develop (#205). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -80,7 +80,6 @@ describe('CardsService (#194)', () => {
|
||||
audience_resolver: 'couple_parents',
|
||||
response_mode: CardResponseModeType.ACCEPT_REFUSE,
|
||||
retention_days: 14,
|
||||
couleur: 'lavender',
|
||||
});
|
||||
amChildrenRepo.findOne.mockResolvedValue({
|
||||
id: 'pl-1',
|
||||
|
||||
@@ -53,9 +53,32 @@ export class CardsService {
|
||||
private readonly realtime: CardsRealtimeService,
|
||||
) {}
|
||||
|
||||
async listerTypes(role: RoleType): Promise<CardType[]> {
|
||||
async listerTypes(role: RoleType): Promise<
|
||||
Pick<
|
||||
CardType,
|
||||
| 'code'
|
||||
| 'system'
|
||||
| 'titre'
|
||||
| 'emitter_roles'
|
||||
| 'recipient_roles'
|
||||
| 'audience_resolver'
|
||||
| 'response_mode'
|
||||
| 'retention_days'
|
||||
>[]
|
||||
> {
|
||||
const all = await this.typesRepo.find({ where: { system: true } });
|
||||
return all.filter((t) => t.emitter_roles.includes(role));
|
||||
return all
|
||||
.filter((t) => t.emitter_roles.includes(role))
|
||||
.map((t) => ({
|
||||
code: t.code,
|
||||
system: t.system,
|
||||
titre: t.titre,
|
||||
emitter_roles: t.emitter_roles,
|
||||
recipient_roles: t.recipient_roles,
|
||||
audience_resolver: t.audience_resolver,
|
||||
response_mode: t.response_mode,
|
||||
retention_days: t.retention_days,
|
||||
}));
|
||||
}
|
||||
|
||||
async lister(
|
||||
@@ -469,7 +492,6 @@ export class CardsService {
|
||||
id: card.id,
|
||||
type_code: card.type_code,
|
||||
titre: card.type?.titre ?? card.type_code,
|
||||
couleur: card.type?.couleur ?? null,
|
||||
id_placement: card.id_placement,
|
||||
id_evenement: card.id_evenement ?? null,
|
||||
operation: card.operation,
|
||||
|
||||
@@ -91,9 +91,6 @@ export class CarteDto {
|
||||
@ApiProperty()
|
||||
titre: string;
|
||||
|
||||
@ApiPropertyOptional()
|
||||
couleur?: string | null;
|
||||
|
||||
@ApiProperty()
|
||||
id_placement: string;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user