feat(integration): 擴充產品同步 API 欄位與驗證強化
1. ProductSync API 新增防護機制,為既有欄位加上字串長度與金額上限限制 2. 開放並接收 ERP Product Model 實用欄位(品牌、規格、成本價、會員價、批發價) 3. 更新 ProductService 寫入邏輯以支援新增的可選欄位 4. 同步更新 api-integration.md 手冊,加入新欄位說明與 JSON 範例
This commit is contained in:
@@ -19,12 +19,17 @@ class ProductSyncController extends Controller
|
||||
public function upsert(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'external_pos_id' => 'required|string',
|
||||
'name' => 'required|string',
|
||||
'price' => 'nullable|numeric|min:0',
|
||||
'barcode' => 'nullable|string',
|
||||
'category' => 'nullable|string',
|
||||
'unit' => 'nullable|string',
|
||||
'external_pos_id' => 'required|string|max:255',
|
||||
'name' => 'required|string|max:255',
|
||||
'price' => 'nullable|numeric|min:0|max:99999999.99',
|
||||
'barcode' => 'nullable|string|max:100',
|
||||
'category' => 'nullable|string|max:100',
|
||||
'unit' => 'nullable|string|max:100',
|
||||
'brand' => 'nullable|string|max:100',
|
||||
'specification' => 'nullable|string|max:255',
|
||||
'cost_price' => 'nullable|numeric|min:0|max:99999999.99',
|
||||
'member_price' => 'nullable|numeric|min:0|max:99999999.99',
|
||||
'wholesale_price' => 'nullable|numeric|min:0|max:99999999.99',
|
||||
'updated_at' => 'nullable|date',
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user