Feat: Adding Shippment Tracking
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user