feat(food): add endpoint to update historical stock and separate current and historical food variants
This commit is contained in:
@@ -122,7 +122,11 @@ class EventDate extends Model
|
||||
|
||||
public function endsAt(): CarbonInterface
|
||||
{
|
||||
return Carbon::parse($this->date->format('Y-m-d').' '.$this->time_end);
|
||||
$endsAt = Carbon::parse($this->date->format('Y-m-d').' '.$this->time_end);
|
||||
|
||||
return $endsAt->lessThanOrEqualTo($this->startsAt())
|
||||
? $endsAt->addDay()
|
||||
: $endsAt;
|
||||
}
|
||||
|
||||
public function getStatusAttribute(): EventDateStatus
|
||||
@@ -169,10 +173,6 @@ class EventDate extends Model
|
||||
$startsAt = $this->startsAt();
|
||||
$expiresAt = $this->endsAt();
|
||||
|
||||
if ($expiresAt->lessThanOrEqualTo($startsAt)) {
|
||||
$expiresAt = $expiresAt->addDay();
|
||||
}
|
||||
|
||||
$attributes = [
|
||||
'type' => ValidityTimeType::FixedWindow,
|
||||
'start_time' => null,
|
||||
|
||||
Reference in New Issue
Block a user