Add ability to update billable rate of existing time entries

This commit is contained in:
Constantin Graf
2024-06-14 16:46:39 +02:00
committed by Gregor Vostrak
parent 7c26cee1ea
commit 2184b3c835
22 changed files with 1001 additions and 25 deletions

View File

@@ -40,9 +40,29 @@ class TimeEntryFactory extends Factory
'task_id' => null,
'project_id' => null,
'organization_id' => Organization::factory(),
'billable_rate' => null,
];
}
public function notBillable(): self
{
return $this->state(function (array $attributes): array {
return [
'billable' => false,
];
});
}
public function billableRate(int $billableRate): self
{
return $this->state(function (array $attributes) use ($billableRate): array {
return [
'billable' => true,
'billable_rate' => $billableRate,
];
});
}
public function withTask(Organization $organization): self
{
return $this->state(function (array $attributes) use (&$organization): array {