initial commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\V1\Supervisor;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class LoginRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'email' => ['required', 'string', 'email'],
|
||||
'password' => ['required', 'string'],
|
||||
'device_name' => ['nullable', 'string', 'max:255'],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\V1\Supervisor;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class StorePricingRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'establishment_id' => ['required', 'integer', 'exists:establishments,id'],
|
||||
'machine_id' => ['nullable', 'integer', 'exists:machines,id'],
|
||||
'machine_type' => ['nullable', Rule::in(['washer_small', 'washer_large', 'dryer_small', 'dryer_large'])],
|
||||
'day_type' => ['required', Rule::in(['weekday', 'weekend', 'holiday', 'all'])],
|
||||
'slot_start' => ['required', 'date_format:H:i'],
|
||||
'slot_end' => ['required', 'date_format:H:i', 'after:slot_start'],
|
||||
'price' => ['required', 'numeric', 'min:0'],
|
||||
'label' => ['nullable', 'string', 'max:100'],
|
||||
'requires_app' => ['sometimes', 'boolean'],
|
||||
'priority' => ['sometimes', 'integer', 'min:1', 'max:999'],
|
||||
'is_active' => ['sometimes', 'boolean'],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\V1\Supervisor;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdatePricingRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'machine_id' => ['nullable', 'integer', 'exists:machines,id'],
|
||||
'machine_type' => ['nullable', Rule::in(['washer_small', 'washer_large', 'dryer_small', 'dryer_large'])],
|
||||
'day_type' => ['sometimes', Rule::in(['weekday', 'weekend', 'holiday', 'all'])],
|
||||
'slot_start' => ['sometimes', 'date_format:H:i'],
|
||||
'slot_end' => ['sometimes', 'date_format:H:i'],
|
||||
'price' => ['sometimes', 'numeric', 'min:0'],
|
||||
'label' => ['nullable', 'string', 'max:100'],
|
||||
'requires_app' => ['sometimes', 'boolean'],
|
||||
'priority' => ['sometimes', 'integer', 'min:1', 'max:999'],
|
||||
'is_active' => ['sometimes', 'boolean'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user