Fixed time entries exports for employees

This commit is contained in:
Constantin Graf
2025-05-15 17:02:37 +02:00
committed by Constantin Graf
parent b4edcaa2dc
commit 36caadeb14
7 changed files with 246 additions and 14 deletions

View File

@@ -56,10 +56,12 @@ abstract class TestCaseWithDatabase extends TestCase
/**
* @return object{user: User, organization: Organization, member: Member, owner: User, ownerMember: Member}
*/
public function createUserWithRole(Role $role): object
public function createUserWithRole(Role $role, bool $employeesCanSeeBillableRates = false): object
{
$owner = User::factory()->create();
$organization = Organization::factory()->withOwner($owner)->create();
$organization = Organization::factory()->withOwner($owner)->create([
'employees_can_see_billable_rates' => $employeesCanSeeBillableRates,
]);
$ownerMember = Member::factory()->forUser($owner)->forOrganization($organization)->role(Role::Owner)->create();
$owner->currentOrganization()->associate($organization);
$owner->save();