mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-13 10:42:16 +01:00
Add ability to set task to done, fixes ST-244
This commit is contained in:
committed by
Gregor Vostrak
parent
75e739f6fb
commit
364168debd
@@ -25,6 +25,7 @@ class TaskFactory extends Factory
|
||||
'name' => $this->faker->word(),
|
||||
'project_id' => Project::factory(),
|
||||
'organization_id' => Organization::factory(),
|
||||
'done_at' => null,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -37,6 +38,15 @@ class TaskFactory extends Factory
|
||||
});
|
||||
}
|
||||
|
||||
public function isDone(): self
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
'done_at' => $this->faker->dateTime('now', 'UTC'),
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
public function forOrganization(Organization $organization): self
|
||||
{
|
||||
return $this->state(function (array $attributes) use ($organization) {
|
||||
|
||||
Reference in New Issue
Block a user