45 lines
939 B
PHP
45 lines
939 B
PHP
<?php
|
|
|
|
namespace App\Domains\Notification\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
#[Fillable([
|
|
'idempotency_key',
|
|
'email_type',
|
|
'tenant_code',
|
|
'status',
|
|
'attempts',
|
|
'context',
|
|
'recipient_fingerprint',
|
|
'claim_token',
|
|
'claimed_at',
|
|
'lease_expires_at',
|
|
'sent_at',
|
|
'failed_at',
|
|
'last_error',
|
|
])]
|
|
class EmailDelivery extends Model
|
|
{
|
|
public const STATUS_PENDING = 'pending';
|
|
|
|
public const STATUS_PROCESSING = 'processing';
|
|
|
|
public const STATUS_SENT = 'sent';
|
|
|
|
public const STATUS_FAILED = 'failed';
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'attempts' => 'integer',
|
|
'context' => 'array',
|
|
'claimed_at' => 'datetime',
|
|
'lease_expires_at' => 'datetime',
|
|
'sent_at' => 'datetime',
|
|
'failed_at' => 'datetime',
|
|
];
|
|
}
|
|
}
|