feat: add new cast attributes for models including sewing_cost, other_cost, marketplace_settings_snapshot, year, month, stock, reject_stock, and retail_stock

This commit is contained in:
Yoga Pangestu 2026-08-04 11:17:25 +07:00
parent 38c486d11d
commit 26945160a2
5 changed files with 15 additions and 0 deletions

View File

@ -23,6 +23,8 @@ protected function casts(): array
'status' => CuttingStatus::class,
'total_material_cost' => 'integer',
'cost_per_unit' => 'integer',
'sewing_cost' => 'integer',
'other_cost' => 'integer',
];
}

View File

@ -35,6 +35,7 @@ protected function casts(): array
'nego_price' => 'integer',
'total_amount' => 'integer',
'cogs' => 'integer',
'marketplace_settings_snapshot' => 'array',
];
}

View File

@ -16,6 +16,7 @@ class OwnerVerificationRequest extends Model
protected function casts(): array
{
return [
'payload' => 'array',
'verified_at' => 'datetime',
];
}

View File

@ -22,6 +22,8 @@ protected function casts(): array
{
return [
'status' => PayrollPeriodStatus::class,
'year' => 'integer',
'month' => 'integer',
'closed_at' => 'datetime',
];
}

View File

@ -16,6 +16,15 @@ class ProductVariant extends Model implements HasMedia
{
use HasFactory, InteractsWithMedia, SoftDeletes;
protected function casts(): array
{
return [
'stock' => 'integer',
'reject_stock' => 'integer',
'retail_stock' => 'integer',
];
}
public function orderItems(): HasMany
{
return $this->hasMany(OrderItem::class);