32 lines
875 B
PHP
32 lines
875 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Qr;
|
|
|
|
use App\Models\QrCodeBatch;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class GenerateBatchRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'quantity' => ['required', 'integer', 'min:1', 'max:50000'],
|
|
'purpose' => ['required', Rule::in([
|
|
QrCodeBatch::PURPOSE_FREE,
|
|
QrCodeBatch::PURPOSE_STORE,
|
|
QrCodeBatch::PURPOSE_PROMO,
|
|
])],
|
|
'household_id' => ['required', 'string', 'exists:households,uuid'],
|
|
'target_store_id' => ['nullable', 'integer'],
|
|
'expires_at' => ['nullable', 'date', 'after:today'],
|
|
'notes' => ['nullable', 'string', 'max:1000'],
|
|
];
|
|
}
|
|
}
|