1. 新增員工卡 (staff_cards) 與員工卡感應日誌 (staff_card_logs) 模型與遷移檔。 2. 實作 StaffCardController 與相關管理介面,支援狀態切換與 CRUD。 3. 擴充 routes/web.php 加入員工卡管理路由。 4. 更新 api-docs.php 文檔,補全 B012 (Unified Sync) 的商品同步回應範例。 5. 實作 PaymentTypeSeeder 並整合至 DatabaseSeeder 以標準化支付類型。 6. 優化銷售中心訂單標籤與倉庫機台庫存顯示邏輯。 7. 側邊欄選單加入員工卡管理入口。 8. 重構 TransactionService 以支援員工卡工作階段 (session_token) 驗證。
29 lines
586 B
PHP
29 lines
586 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use App\Models\Transaction\PaymentType;
|
|
use App\Models\Transaction\Order;
|
|
|
|
class PaymentTypeSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
$types = Order::getPaymentTypeLabels();
|
|
|
|
foreach ($types as $code => $name) {
|
|
PaymentType::updateOrCreate(
|
|
['code' => $code],
|
|
[
|
|
'name' => $name,
|
|
'is_active' => true,
|
|
]
|
|
);
|
|
}
|
|
}
|
|
}
|