主要變更: - 實作 POS 與販賣機訂單同步邏輯,支援多租戶與 Sanctum 驗證。 - 修正多租戶識別中間件與 Sanctum 驗證順序問題。 - 切換快取驅動至 Redis 以支援 Tenancy 標籤功能。 - 新增商品同步 API (Upsert) 及相關單元測試。 - 新增手動測試腳本 tests/manual/test_integration_api.sh。 - 前端新增銷售訂單來源篩選與欄位顯示。
34 lines
677 B
PHP
34 lines
677 B
PHP
<?php
|
|
|
|
namespace App\Modules\Integration\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class SalesOrder extends Model
|
|
{
|
|
protected $table = 'sales_orders';
|
|
|
|
protected $fillable = [
|
|
'external_order_id',
|
|
'status',
|
|
'payment_method',
|
|
'total_amount',
|
|
'sold_at',
|
|
'raw_payload',
|
|
'source',
|
|
'source_label',
|
|
];
|
|
|
|
protected $casts = [
|
|
'sold_at' => 'datetime',
|
|
'raw_payload' => 'array',
|
|
'total_amount' => 'decimal:4',
|
|
];
|
|
|
|
public function items(): HasMany
|
|
{
|
|
return $this->hasMany(SalesOrderItem::class);
|
|
}
|
|
}
|