fix tests

This commit is contained in:
root
2026-06-11 11:46:12 -04:00
parent c91fa2ce4d
commit 5ead80fdc7
1489 changed files with 11349 additions and 10305 deletions
+6 -8
View File
@@ -10,9 +10,7 @@ use RuntimeException;
class StaffCommandService
{
public function __construct(private GlobalConfigService $configService)
{
}
public function __construct(private GlobalConfigService $configService) {}
public function create(array $payload): Staff
{
@@ -21,7 +19,7 @@ class StaffCommandService
$roleName = (string) ($payload['role_name'] ?? '');
$activeRole = strtolower($roleName);
if (!empty($payload['status']) && strtolower((string) $payload['status']) === 'inactive') {
if (! empty($payload['status']) && strtolower((string) $payload['status']) === 'inactive') {
$activeRole = 'inactive';
}
@@ -40,7 +38,7 @@ class StaffCommandService
'updated_at' => now(),
]);
if (!$staff) {
if (! $staff) {
throw new RuntimeException('Failed to create staff member.');
}
@@ -61,13 +59,13 @@ class StaffCommandService
if (array_key_exists('role_name', $updates)) {
$updates['active_role'] = strtolower((string) $updates['role_name']);
}
if (!empty($payload['status']) && strtolower((string) $payload['status']) === 'inactive') {
if (! empty($payload['status']) && strtolower((string) $payload['status']) === 'inactive') {
$updates['active_role'] = 'inactive';
}
$updates['updated_at'] = now();
if (!empty($updates)) {
if (! empty($updates)) {
$staff->fill($updates);
$staff->save();
}
@@ -83,7 +81,7 @@ class StaffCommandService
private function resolveUserId(array $payload): int
{
if (!empty($payload['user_id'])) {
if (! empty($payload['user_id'])) {
return (int) $payload['user_id'];
}