mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 08:12:17 +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
@@ -52,6 +52,7 @@ class ProjectStoreRequest extends FormRequest
|
||||
'integer',
|
||||
'min:0',
|
||||
],
|
||||
// ID of the client
|
||||
'client_id' => [
|
||||
'nullable',
|
||||
new ExistsEloquent(Client::class, null, function (Builder $builder): Builder {
|
||||
@@ -59,6 +60,12 @@ class ProjectStoreRequest extends FormRequest
|
||||
return $builder->whereBelongsTo($this->organization, 'organization');
|
||||
}),
|
||||
],
|
||||
// Estimated time in seconds
|
||||
'estimated_time' => [
|
||||
'nullable',
|
||||
'integer',
|
||||
'min:0',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -68,4 +75,11 @@ class ProjectStoreRequest extends FormRequest
|
||||
|
||||
return $input !== null && $input !== 0 ? (int) $this->input('billable_rate') : null;
|
||||
}
|
||||
|
||||
public function getEstimatedTime(): ?int
|
||||
{
|
||||
$input = $this->input('estimated_time');
|
||||
|
||||
return $input !== null && $input !== 0 ? (int) $this->input('estimated_time') : null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user