migrate to gtea from bistbucket
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Booking\Http\Requests\Booking;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class BookingStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'hotel_id' => 'required|exists:hotels,id',
|
||||
'customer_id' => 'required|exists:customers,id',
|
||||
'check_in' => 'required|date',
|
||||
'check_out' => 'required|date|after_or_equal:check_in',
|
||||
'check_in_time' => 'nullable|date_format:H:i:s',
|
||||
'check_out_time' => 'nullable|date_format:H:i:s',
|
||||
'total_adults' => 'required|integer|min:1',
|
||||
'total_children' => 'required|integer|min:0',
|
||||
'subtotal_amount' => 'required|numeric|min:0',
|
||||
'tax_amount' => 'nullable|numeric|min:0',
|
||||
'discount_amount' => 'nullable|numeric|min:0',
|
||||
'total_amount' => 'required|numeric|min:0',
|
||||
'payment_status' => 'required|in:pending,paid,refunded',
|
||||
'payment_method' => 'nullable|in:cash,card,online,bank',
|
||||
'channel' => 'nullable|string',
|
||||
'status' => 'required|in:pending,confirmed,checked_in,checked_out,canceled',
|
||||
'remarks' => 'nullable|string',
|
||||
'booking_items' => 'required|array|min:1',
|
||||
'booking_items.*.room_id' => 'required|exists:rooms,id',
|
||||
'booking_items.*.adults' => 'required|integer|min:1',
|
||||
'booking_items.*.children' => 'required|integer|min:0',
|
||||
'booking_items.*.room_price' => 'required|numeric|min:0',
|
||||
'booking_items.*.nights' => 'required|integer|min:1',
|
||||
'booking_items.*.tax_amount' => 'nullable|numeric|min:0',
|
||||
'booking_items.*.total_amount' => 'required|numeric|min:0',
|
||||
'booking_items.*.status' => 'required|in:reserved,occupied,cleaning,completed,canceled',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'booking_items.required' => 'At least one room must be added.',
|
||||
'booking_items.*.room_id.exists' => 'The selected room does not exist.',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Booking\Http\Requests\Booking;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class BookingUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'hotel_id' => 'nullable|exists:hotels,id',
|
||||
'customer_id' => 'nullable|exists:customers,id',
|
||||
'check_in' => 'nullable|date',
|
||||
'check_out' => 'nullable|date|after_or_equal:check_in',
|
||||
'check_in_time' => 'nullable|date_format:H:i:s',
|
||||
'check_out_time' => 'nullable|date_format:H:i:s',
|
||||
'total_adults' => 'nullable|integer|min:1',
|
||||
'total_children' => 'nullable|integer|min:0',
|
||||
'subtotal_amount' => 'nullable|numeric|min:0',
|
||||
'tax_amount' => 'nullable|numeric|min:0',
|
||||
'discount_amount' => 'nullable|numeric|min:0',
|
||||
'total_amount' => 'nullable|numeric|min:0',
|
||||
'payment_status' => 'nullable|in:pending,paid,refunded',
|
||||
'payment_method' => 'nullable|in:cash,card,online,bank',
|
||||
'channel' => 'nullable|string',
|
||||
'status' => 'nullable|in:pending,confirmed,checked_in,checked_out,canceled',
|
||||
'remarks' => 'nullable|string',
|
||||
'booking_items' => 'nullable|array|min:1',
|
||||
'booking_items.*.room_id' => 'required_with:booking_items|exists:rooms,id',
|
||||
'booking_items.*.adults' => 'required_with:booking_items|integer|min:1',
|
||||
'booking_items.*.children' => 'required_with:booking_items|integer|min:0',
|
||||
'booking_items.*.room_price' => 'required_with:booking_items|numeric|min:0',
|
||||
'booking_items.*.nights' => 'required_with:booking_items|integer|min:1',
|
||||
'booking_items.*.tax_amount' => 'nullable|numeric|min:0',
|
||||
'booking_items.*.total_amount' => 'required_with:booking_items|numeric|min:0',
|
||||
'booking_items.*.status' => 'required_with:booking_items|in:reserved,occupied,cleaning,completed,canceled',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Booking\Http\Requests\Booking;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CustomerBookingStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'hotel_id' => 'required|exists:hotels,id',
|
||||
// 'customer_id' => 'required|exists:customers,id',
|
||||
'check_in' => 'required|date',
|
||||
'check_out' => 'required|date|after_or_equal:check_in',
|
||||
'check_in_time' => 'nullable|date_format:H:i:s',
|
||||
'check_out_time' => 'nullable|date_format:H:i:s',
|
||||
'total_adults' => 'required|integer|min:1',
|
||||
'total_children' => 'required|integer|min:0',
|
||||
'subtotal_amount' => 'required|numeric|min:0',
|
||||
'tax_amount' => 'nullable|numeric|min:0',
|
||||
'discount_amount' => 'nullable|numeric|min:0',
|
||||
'total_amount' => 'required|numeric|min:0',
|
||||
'payment_status' => 'required|in:pending,paid,refunded',
|
||||
'payment_method' => 'nullable|in:cash,card,online,bank',
|
||||
'channel' => 'nullable|string',
|
||||
'status' => 'required|in:pending,confirmed,checked_in,checked_out,canceled',
|
||||
'remarks' => 'nullable|string',
|
||||
'booking_items' => 'required|array|min:1',
|
||||
'booking_items.*.room_id' => 'required|exists:rooms,id',
|
||||
'booking_items.*.adults' => 'required|integer|min:1',
|
||||
'booking_items.*.children' => 'required|integer|min:0',
|
||||
'booking_items.*.room_price' => 'required|numeric|min:0',
|
||||
'booking_items.*.nights' => 'required|integer|min:1',
|
||||
'booking_items.*.tax_amount' => 'nullable|numeric|min:0',
|
||||
'booking_items.*.total_amount' => 'required|numeric|min:0',
|
||||
'booking_items.*.status' => 'required|in:reserved,occupied,cleaning,completed,canceled',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'booking_items.required' => 'At least one room must be added.',
|
||||
'booking_items.*.room_id.exists' => 'The selected room does not exist.',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user