Added billable and project_id to time entry endpoints; Enhanced api docs; Added pagination

This commit is contained in:
Constantin Graf
2024-03-19 17:19:12 +01:00
parent 7cc686f230
commit 2133eb0c16
22 changed files with 616 additions and 309 deletions

View File

@@ -34,10 +34,25 @@ class TimeEntryFactory extends Factory
'billable' => $this->faker->boolean(),
'tags' => [],
'user_id' => User::factory(),
'task_id' => null,
'project_id' => null,
'organization_id' => Organization::factory(),
];
}
public function withTask(Organization $organization): self
{
return $this->state(function (array $attributes) use (&$organization): array {
$project = Project::factory()->forOrganization($organization)->create();
$task = Task::factory()->forProject($project)->forOrganization($organization)->create();
return [
'task_id' => $task->getKey(),
'project_id' => $task->project->getKey(),
];
});
}
public function withTags(Organization $organization): self
{
return $this->state(function (array $attributes) use ($organization): array {