feat: [stock] 재고 조정 API 추가
- GET /stocks/{id}/adjustments: 조정 이력 조회
- POST /stocks/{id}/adjustments: 조정 등록 (증감 수량 + 사유)
- StockTransaction에 adjustment reason 추가
- StoreStockAdjustmentRequest 검증 추가
This commit is contained in:
29
app/Http/Requests/V1/Stock/StoreStockAdjustmentRequest.php
Normal file
29
app/Http/Requests/V1/Stock/StoreStockAdjustmentRequest.php
Normal 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'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user