feat: enums, schema and models for hado core

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BCrwHHnGCB5XH968Nxokqw
This commit is contained in:
nikita.hohlov
2026-09-04 06:05:34 -03:00
parent 8d01b7050d
commit 774e0bce1a
18 changed files with 447 additions and 123 deletions

View File

@@ -0,0 +1,34 @@
<?php
namespace App\Models;
use App\Enums\DeliveryResult;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Delivery extends Model
{
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);
}
}