feat: Product API에 FormRequest 및 i18n 적용
- ProductStoreRequest, ProductUpdateRequest 생성 - ProductController에 FormRequest 적용 - 하드코딩된 메시지를 i18n 키로 변경 - lang/ko/message.php에 product 관련 메시지 키 추가 - SAM API Development Rules 준수 Phase 3-1: ProductApi.php Swagger 점검 완료
This commit is contained in:
29
app/Http/Requests/Product/ProductUpdateRequest.php
Normal file
29
app/Http/Requests/Product/ProductUpdateRequest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?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',
|
||||
'category_id' => 'sometimes|integer',
|
||||
'product_type' => 'sometimes|string|max:30',
|
||||
'attributes' => 'nullable|array',
|
||||
'description' => 'nullable|string|max:255',
|
||||
'is_sellable' => 'nullable|in:0,1',
|
||||
'is_purchasable' => 'nullable|in:0,1',
|
||||
'is_producible' => 'nullable|in:0,1',
|
||||
'is_active' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user