Files
star-erp/app/Modules/Sales/Models/SalesImportItem.php
sky121113 deef3baacc
All checks were successful
ERP-Deploy-Demo / deploy-demo (push) Successful in 57s
refactor: 重構模組通訊與調整儀表板功能
- 依循跨模組通訊規範,將 Sales 與 Production 模組中對 Inventory 的直接模型關聯改為透過 InventoryServiceInterface 取得
- 於 InventoryService 實作獲取最高庫存價值、即將過期商品等方法,供儀表板使用
- 確保所有跨模組調用皆採用手動水和(Manual Hydration)方式組合資料
- 移除本地已歸檔的 .agent 規範檔案
2026-02-25 11:48:52 +08:00

41 lines
862 B
PHP

<?php
namespace App\Modules\Sales\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class SalesImportItem extends Model
{
use HasFactory;
protected $table = 'sales_import_items';
protected $fillable = [
'batch_id',
'machine_id',
'slot',
'product_code',
'product_id',
'transaction_at',
'transaction_serial',
'quantity',
'amount',
'original_status',
];
protected $casts = [
'transaction_at' => 'datetime',
'quantity' => 'integer',
'amount' => 'decimal:4',
'original_status' => 'string',
];
public function batch(): BelongsTo
{
return $this->belongsTo(SalesImportBatch::class, 'batch_id');
}
}