Commit 19b84376 authored by Jacob Priddy's avatar Jacob Priddy 👌
Browse files

Added duration to schedule creation

parent 0193b072
Pipeline #8942 passed with stages
in 2 minutes and 53 seconds
......@@ -56,6 +56,10 @@ class ScheduleCreate implements ScheduleCreateUseCase
try {
$this->rset->parse($attributes['rset']);
$end = $this->rset->endDate();
if ($end) {
$end->addRealMilliseconds($attributes['duration']);
}
$schedule = new Schedule(
0,
$attributes['group_id'],
......@@ -64,7 +68,7 @@ class ScheduleCreate implements ScheduleCreateUseCase
$attributes['duration'],
$attributes['description'],
$this->rset->beginDate() ?? Carbon::now(),
$this->rset->endDate()
$end
);
if (!$response->hasError()) {
......
......@@ -64,6 +64,10 @@ class ScheduleUpdate implements ScheduleUpdateUseCase
try {
$this->rset->parse($rset);
$end = $this->rset->endDate();
if ($end) {
$end->addRealMilliseconds($duration);
}
$schedule = new Schedule(
0,
$groupId,
......@@ -72,7 +76,7 @@ class ScheduleUpdate implements ScheduleUpdateUseCase
$duration,
$description,
$this->rset->beginDate() ?? Carbon::now(),
$this->rset->endDate(),
$end
);
if (!$response->hasError()) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment