Added time entry api endpoints; Increased phpstan level; renamed to solidtime

This commit is contained in:
Constantin Graf
2024-02-26 14:27:12 +01:00
parent e60e502612
commit 9c5a238dda
36 changed files with 1716 additions and 461 deletions

View File

@@ -6,6 +6,7 @@ namespace Database\Factories;
use App\Models\Organization;
use App\Models\Project;
use App\Models\Tag;
use App\Models\Task;
use App\Models\TimeEntry;
use App\Models\User;
@@ -36,6 +37,18 @@ class TimeEntryFactory extends Factory
];
}
public function withTags(Organization $organization): self
{
return $this->state(function (array $attributes) use ($organization): array {
return [
'tags' => [
Tag::factory()->forOrganization($organization)->create()->getKey(),
Tag::factory()->forOrganization($organization)->create()->getKey(),
],
];
});
}
public function forUser(User $user): self
{
return $this->state(function (array $attributes) use ($user) {