32 lines
822 B
PHP
32 lines
822 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace Modules\Core\Shipping\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Casts\AsArrayObject;
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
use Modules\Core\Shipping\Enums\TrackingStatus;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* One recorded checkpoint in a Shipment's carrier-reported tracking
|
||
|
|
* history. Append-only — never updated in place, so the full history is
|
||
|
|
* preserved rather than overwriting the last-known status.
|
||
|
|
*/
|
||
|
|
class ShipmentInfo extends Model
|
||
|
|
{
|
||
|
|
protected $table = 'shipment_info';
|
||
|
|
|
||
|
|
protected $guarded = [];
|
||
|
|
|
||
|
|
protected $casts = [
|
||
|
|
'status' => TrackingStatus::class,
|
||
|
|
'occurred_at' => 'datetime',
|
||
|
|
'meta' => AsArrayObject::class,
|
||
|
|
];
|
||
|
|
|
||
|
|
public function shipment(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Shipment::class);
|
||
|
|
}
|
||
|
|
}
|