mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 00:02:15 +01:00
Added time estimates for projects and tasks, fixes ST-283
This commit is contained in:
committed by
Gregor Vostrak
parent
78ea8a673b
commit
a820d8540f
@@ -33,9 +33,19 @@ class ProjectFactory extends Factory
|
||||
'archived_at' => null,
|
||||
'client_id' => null,
|
||||
'organization_id' => Organization::factory(),
|
||||
'estimated_time' => null,
|
||||
];
|
||||
}
|
||||
|
||||
public function withEstimatedTime(): self
|
||||
{
|
||||
return $this->state(function (array $attributes): array {
|
||||
return [
|
||||
'estimated_time' => $this->faker->randomNumber(3),
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
public function billable(): self
|
||||
{
|
||||
return $this->state(function (array $attributes): array {
|
||||
|
||||
@@ -26,6 +26,7 @@ class TaskFactory extends Factory
|
||||
'project_id' => Project::factory(),
|
||||
'organization_id' => Organization::factory(),
|
||||
'done_at' => null,
|
||||
'estimated_time' => null,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('projects', function (Blueprint $table): void {
|
||||
$table->integer('estimated_time')->unsigned()->nullable();
|
||||
});
|
||||
Schema::table('tasks', function (Blueprint $table): void {
|
||||
$table->integer('estimated_time')->unsigned()->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('projects', function (Blueprint $table): void {
|
||||
$table->dropColumn('estimated_time');
|
||||
});
|
||||
Schema::table('tasks', function (Blueprint $table): void {
|
||||
$table->dropColumn('estimated_time');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user