feat(audit) : filtres Employé et Utilisateur en champ texte (recherche libre)
Employé = recherche partielle sur nom/prénom (nouveau filtre back 'employee', LIKE via join) ; Utilisateur = recherche partielle sur username. Remplace les selects par des champs texte. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -46,6 +46,7 @@ final class AuditLogProviderTest extends TestCase
|
||||
$repo = $this->spyRepository();
|
||||
$this->provideWith($repo, [
|
||||
'employeeId' => '5',
|
||||
'employee' => 'dupont',
|
||||
'username' => 'usine',
|
||||
'ip' => '10.0.',
|
||||
'device' => 'android',
|
||||
@@ -56,6 +57,7 @@ final class AuditLogProviderTest extends TestCase
|
||||
]);
|
||||
|
||||
self::assertSame(5, $repo->findArgs['employeeId']);
|
||||
self::assertSame('dupont', $repo->findArgs['employeeName']);
|
||||
self::assertSame('usine', $repo->findArgs['username']);
|
||||
self::assertSame('10.0.', $repo->findArgs['ip']);
|
||||
self::assertSame('android', $repo->findArgs['device']);
|
||||
@@ -103,16 +105,16 @@ final class AuditLogProviderTest extends TestCase
|
||||
|
||||
public function __construct(private array $items, private int $count) {}
|
||||
|
||||
public function findByFilters(?int $employeeId = null, ?DateTimeImmutable $from = null, ?DateTimeImmutable $to = null, ?array $entityTypes = null, ?array $actions = null, ?string $username = null, ?string $ip = null, ?string $device = null, int $limit = 50, int $offset = 0): array
|
||||
public function findByFilters(?int $employeeId = null, ?DateTimeImmutable $from = null, ?DateTimeImmutable $to = null, ?array $entityTypes = null, ?array $actions = null, ?string $username = null, ?string $ip = null, ?string $device = null, ?string $employeeName = null, int $limit = 50, int $offset = 0): array
|
||||
{
|
||||
$this->findArgs = compact('employeeId', 'from', 'to', 'entityTypes', 'actions', 'username', 'ip', 'device', 'limit', 'offset');
|
||||
$this->findArgs = compact('employeeId', 'from', 'to', 'entityTypes', 'actions', 'username', 'ip', 'device', 'employeeName', 'limit', 'offset');
|
||||
|
||||
return $this->items;
|
||||
}
|
||||
|
||||
public function countByFilters(?int $employeeId = null, ?DateTimeImmutable $from = null, ?DateTimeImmutable $to = null, ?array $entityTypes = null, ?array $actions = null, ?string $username = null, ?string $ip = null, ?string $device = null): int
|
||||
public function countByFilters(?int $employeeId = null, ?DateTimeImmutable $from = null, ?DateTimeImmutable $to = null, ?array $entityTypes = null, ?array $actions = null, ?string $username = null, ?string $ip = null, ?string $device = null, ?string $employeeName = null): int
|
||||
{
|
||||
$this->countArgs = compact('employeeId', 'from', 'to', 'entityTypes', 'actions', 'username', 'ip', 'device');
|
||||
$this->countArgs = compact('employeeId', 'from', 'to', 'entityTypes', 'actions', 'username', 'ip', 'device', 'employeeName');
|
||||
|
||||
return $this->count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user