Files
Toiminnanohjaus/app/Modules/Sales/Infrastructure/Persistence/Eloquent/QuickSaleOrderLineModel.php
2026-11-26 17:11:54 +02:00

47 lines
1.6 KiB
PHP

<?php
namespace App\Modules\Sales\Infrastructure\Persistence\Eloquent;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Attributes\Table;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Carbon;
/**
* Persistence model, used only inside the Sales Infrastructure layer.
*
* @property int $id
* @property int $quick_sale_order_id
* @property int $product_id
* @property string $product_name
* @property int $quantity
* @property int $unit_price_cents
* @property int $vat_basis_points
* @property list<array{machineId?: ?int, durationQuarters?: int, workTypeId?: int, materials?: list<array{stockItemId: int, quantityMilli: int}>}> $production_steps
* @property int|null $current_step
* @property Carbon|null $made_at
* @property int $sort_order
*/
#[Table('quick_sale_order_lines')]
#[Fillable(['quick_sale_order_id', 'product_id', 'product_name', 'quantity', 'unit_price_cents', 'vat_basis_points', 'production_steps', 'current_step', 'made_at', 'sort_order'])]
class QuickSaleOrderLineModel extends Model
{
/**
* @return array<string, string>
*/
protected function casts(): array
{
return [
'quick_sale_order_id' => 'integer',
'product_id' => 'integer',
'quantity' => 'integer',
'unit_price_cents' => 'integer',
'vat_basis_points' => 'integer',
'production_steps' => 'array',
'current_step' => 'integer',
'made_at' => 'immutable_datetime',
'sort_order' => 'integer',
];
}
}