Files
sam-api/app/Http/Requests/Product/ProductUpdateRequest.php

43 lines
1.3 KiB
PHP
Raw Normal View History

2026-01-20 20:43:38 +09:00
<?php
namespace App\Http\Requests\Product;
use Illuminate\Foundation\Http\FormRequest;
class ProductUpdateRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
// 기본 필드
'code' => 'sometimes|string|max:30',
'name' => 'sometimes|string|max:100',
'unit' => 'nullable|string|max:10',
'category_id' => 'sometimes|integer',
'product_type' => 'sometimes|string|max:30',
'description' => 'nullable|string|max:255',
// 상태 플래그
'is_sellable' => 'nullable|boolean',
'is_purchasable' => 'nullable|boolean',
'is_producible' => 'nullable|boolean',
// 하이브리드 구조: 고정 필드
'safety_stock' => 'nullable|integer|min:0',
'lead_time' => 'nullable|integer|min:0',
'is_variable_size' => 'nullable|boolean',
'product_category' => 'nullable|string|max:20',
'part_type' => 'nullable|string|max:20',
// 하이브리드 구조: 동적 필드
'attributes' => 'nullable|array',
'attributes_archive' => 'nullable|array',
];
}
}