Resolve "Les utilisateurs désactivés apparaissent toujours dans les suggestions dans les échanges"

This commit is contained in:
2025-12-05 11:56:29 +00:00
committed by Julien Fastré
parent f32877b5cd
commit 4c1690313b
7 changed files with 22 additions and 21 deletions

View File

@@ -20,8 +20,7 @@ export interface TransportExceptionInterface {
name: string;
}
export interface ValidationExceptionInterface
extends TransportExceptionInterface {
export interface ValidationExceptionInterface extends TransportExceptionInterface {
name: "ValidationException";
error: object;
violations: string[];
@@ -41,8 +40,7 @@ export interface AccessExceptionInterface extends TransportExceptionInterface {
violations: string[];
}
export interface NotFoundExceptionInterface
extends TransportExceptionInterface {
export interface NotFoundExceptionInterface extends TransportExceptionInterface {
name: "NotFoundException";
}
@@ -53,8 +51,7 @@ export interface ServerExceptionInterface extends TransportExceptionInterface {
body: string;
}
export interface ConflictHttpExceptionInterface
extends TransportExceptionInterface {
export interface ConflictHttpExceptionInterface extends TransportExceptionInterface {
name: "ConflictHttpException";
violations: string[];
}

View File

@@ -41,6 +41,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware
'isAbsent' => false,
'absenceStart' => null,
'absenceEnd' => null,
'enabled' => true,
];
public function __construct(private readonly UserRender $userRender, private readonly ClockInterface $clock) {}
@@ -108,6 +109,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware
'isAbsent' => $object->isAbsent(),
'absenceStart' => $this->normalizer->normalize($object->getAbsenceStart(), $format, $absenceDatesContext),
'absenceEnd' => $this->normalizer->normalize($object->getAbsenceEnd(), $format, $absenceDatesContext),
'enabled' => $object->isEnabled(),
];
if ('docgen' === $format) {

View File

@@ -103,6 +103,7 @@ final class UserNormalizerTest extends TestCase
'main_center' => ['context' => Center::class],
'absenceStart' => ['context' => \DateTimeImmutable::class],
'absenceEnd' => ['context' => \DateTimeImmutable::class],
'enabled' => true,
]];
yield [$userNoPhone, 'docgen', ['docgen:expects' => User::class],
@@ -124,6 +125,7 @@ final class UserNormalizerTest extends TestCase
'main_center' => ['context' => Center::class],
'absenceStart' => ['context' => \DateTimeImmutable::class],
'absenceEnd' => ['context' => \DateTimeImmutable::class],
'enabled' => true,
]];
yield [null, 'docgen', ['docgen:expects' => User::class], [
@@ -144,6 +146,7 @@ final class UserNormalizerTest extends TestCase
'main_center' => ['context' => Center::class],
'absenceStart' => null,
'absenceEnd' => null,
'enabled' => true,
]];
}
}