diff --git a/.agents/skills/mqtt-communication-specs/SKILL.md b/.agents/skills/mqtt-communication-specs/SKILL.md index e24c67c..0714e3b 100644 --- a/.agents/skills/mqtt-communication-specs/SKILL.md +++ b/.agents/skills/mqtt-communication-specs/SKILL.md @@ -284,14 +284,10 @@ Mqtt3Client client = MqttClient.builder() "command": "update_inventory", "command_id": "3", "payload": { - "data": [ - { - "slot_no": "3", - "stock": 6, - "expiry_date": null, - "batch_no": "B2026042201" - } - ] + "slot_no": "3", + "stock": 6, + "expiry_date": null, + "batch_no": "B2026042201" } } ``` diff --git a/app/Http/Controllers/Admin/ProductController.php b/app/Http/Controllers/Admin/ProductController.php index 879b801..cf18e7e 100644 --- a/app/Http/Controllers/Admin/ProductController.php +++ b/app/Http/Controllers/Admin/ProductController.php @@ -26,8 +26,8 @@ class ProductController extends Controller $productQuery = Product::with(['category.translations', 'translations', 'company']); // 搜尋 - if ($request->filled('product_search')) { - $search = $request->product_search; + if ($request->filled('search')) { + $search = $request->search; $productQuery->where(function($q) use ($search) { $q->where('name', 'like', "%{$search}%") ->orWhere('barcode', 'like', "%{$search}%") @@ -55,8 +55,8 @@ class ProductController extends Controller $categoryQuery->where('company_id', $request->category_company_id); } - if ($request->filled('category_search')) { - $search = $request->category_search; + if ($request->filled('search')) { + $search = $request->search; $categoryQuery->where(function($q) use ($search) { $q->where('name', 'like', "%{$search}%"); }); diff --git a/app/Models/Machine/Machine.php b/app/Models/Machine/Machine.php index 0f17f40..f5949dd 100644 --- a/app/Models/Machine/Machine.php +++ b/app/Models/Machine/Machine.php @@ -253,7 +253,7 @@ class Machine extends Model } public const PAGE_STATUSES = [ - '0' => 'Offline', + '0' => 'Standby', '1' => 'Home Page', '2' => 'Vending Page', '3' => 'Admin Page', diff --git a/app/Services/Machine/MachineService.php b/app/Services/Machine/MachineService.php index fe0f61f..6375f94 100644 --- a/app/Services/Machine/MachineService.php +++ b/app/Services/Machine/MachineService.php @@ -326,14 +326,10 @@ class MachineService // 4. 推播 MQTT $mqttPayload = [ - 'data' => [ - [ - 'slot_no' => $command->payload['slot_no'], - 'stock' => $command->payload['new']['stock'], - 'expiry_date' => $command->payload['new']['expiry_date'], - 'batch_no' => $command->payload['new']['batch_no'] ?? null, - ] - ] + 'slot_no' => $command->payload['slot_no'], + 'stock' => $command->payload['new']['stock'], + 'expiry_date' => $command->payload['new']['expiry_date'], + 'batch_no' => $command->payload['new']['batch_no'] ?? null, ]; app(\App\Services\Machine\MqttService::class)->pushCommand( diff --git a/config/api-docs.php b/config/api-docs.php index b823737..0ca01eb 100644 --- a/config/api-docs.php +++ b/config/api-docs.php @@ -678,24 +678,19 @@ return [ 'command' => ['type' => 'string', 'description' => '固定為 "update_inventory"'], 'command_id' => ['type' => 'string', 'description' => '指令唯一 ID'], 'payload' => ['type' => 'object', 'description' => '更新參數'], - 'payload.data' => ['type' => 'array', 'description' => '欲更新的貨道資料陣列'], - 'payload.data[].slot_no' => ['type' => 'string', 'description' => '貨道號碼'], - 'payload.data[].stock' => ['type' => 'integer', 'description' => '最新庫存量'], - 'payload.data[].expiry_date' => ['type' => 'string', 'description' => '最新效期 (YYYY-MM-DD)'], - 'payload.data[].batch_no' => ['type' => 'string', 'description' => '批號 (可為 null)'], + 'payload.slot_no' => ['type' => 'string', 'description' => '貨道號碼'], + 'payload.stock' => ['type' => 'integer', 'description' => '最新庫存量'], + 'payload.expiry_date' => ['type' => 'string', 'description' => '最新效期 (YYYY-MM-DD)'], + 'payload.batch_no' => ['type' => 'string', 'description' => '批號 (可為 null)'], ], 'payload_example' => [ 'command' => 'update_inventory', 'command_id' => '5566778899', 'payload' => [ - 'data' => [ - [ - 'slot_no' => '1', - 'stock' => 10, - 'expiry_date' => '2026-12-31', - 'batch_no' => null - ] - ] + 'slot_no' => '1', + 'stock' => 10, + 'expiry_date' => '2026-12-31', + 'batch_no' => null ] ], ], diff --git a/lang/zh_TW.json b/lang/zh_TW.json index cbba53e..12dcedf 100644 --- a/lang/zh_TW.json +++ b/lang/zh_TW.json @@ -31,7 +31,8 @@ "Action": "操作", "Action / Target": "操作 / 對象", "Actions": "操作", - "Active": "有效", + "Active": "已啟用", + "Are you sure you want to change the status of this item?": "您確定要變更此項目的狀態嗎?", "Active Slots": "使用中貨道", "Active Status": "啟用狀態", "Ad Settings": "廣告設置", @@ -277,8 +278,8 @@ "Confirm Delete": "確認刪除", "Confirm Deletion": "確認刪除資料", "Confirm Password": "確認新密碼", + "Confirm Status Change": "確認狀態變更", "Confirm Prepare": "確認備貨", - "Confirm Status Change": "確認變更狀態", "Confirm Stock-In": "確認進貨", "Confirm Stock-in Order": "確認進貨單", "Confirm Transfer": "確認調撥", @@ -706,6 +707,7 @@ "Items": "筆", "JKO_MERCHANT_ID": "街口支付 商店代號", "Japanese": "日文", + "Inactive": "已停用", "Joined": "加入日期", "Just now": "剛剛", "Key": "金鑰 (Key)", @@ -1441,10 +1443,10 @@ "Staff card created successfully": "員工識別卡建立成功", "Staff card deleted successfully": "員工識別卡刪除成功", "Staff card updated successfully": "員工識別卡更新成功", - "Standby": "待機廣告", "Standby Ad": "待機廣告", "Start Date": "起始日", "Start Delivery": "開始配送", + "Standby": "系統待機", "Start Time": "開始時間", "Statistics": "數據統計", "Status": "狀態",