mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-12 18:22:16 +01:00
Added billable and project_id to time entry endpoints; Enhanced api docs; Added pagination
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user