feat: [stock] 재고 조정 API 추가

- GET /stocks/{id}/adjustments: 조정 이력 조회
- POST /stocks/{id}/adjustments: 조정 등록 (증감 수량 + 사유)
- StockTransaction에 adjustment reason 추가
- StoreStockAdjustmentRequest 검증 추가
This commit is contained in:
김보곤
2026-03-17 20:42:53 +09:00
parent ba8fc0834c
commit bba8f6c0a0
5 changed files with 134 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
<?php
namespace App\Http\Requests\V1\Stock;
use Illuminate\Foundation\Http\FormRequest;
class StoreStockAdjustmentRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'quantity' => ['required', 'numeric', 'not_in:0'],
'remark' => ['nullable', 'string', 'max:500'],
];
}
public function messages(): array
{
return [
'quantity.required' => __('error.stock.adjustment_qty_required'),
'quantity.not_in' => __('error.stock.adjustment_qty_zero'),
];
}
}