Files
hado/core/app/Models/Delivery.php
nikita.hohlov e48e48aa4a feat: due resolution and cascade math
Also: StoresUtc trait normalizes datetime casts to UTC (controller ruling).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BCrwHHnGCB5XH968Nxokqw
2026-09-04 06:19:00 -03:00

38 lines
777 B
PHP

<?php
namespace App\Models;
use App\Enums\DeliveryResult;
use App\Models\Concerns\StoresUtc;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Delivery extends Model
{
use StoresUtc;
protected $guarded = [];
protected $attributes = ['meta' => '{}'];
protected function casts(): array
{
return [
'result' => DeliveryResult::class,
'window_start' => 'immutable_datetime',
'sent_at' => 'immutable_datetime',
'meta' => 'array',
];
}
public function event(): BelongsTo
{
return $this->belongsTo(Event::class);
}
public function channel(): BelongsTo
{
return $this->belongsTo(Channel::class);
}
}