migrate to gtea from bistbucket
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Addon;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class AddonStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'price' => 'required|numeric|min:0|max:999999.99',
|
||||
'vat' => 'nullable|numeric|min:0|max:99.99',
|
||||
'pst' => 'nullable|numeric|min:0|max:99.99',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Addon;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class AddonUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'price' => 'required|numeric|min:0|max:999999.99',
|
||||
'vat' => 'nullable|numeric|min:0|max:99.99',
|
||||
'pst' => 'nullable|numeric|min:0|max:99.99',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\AddonFood;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class AddonFoodStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'addon_id' => 'required|integer|exists:addons,id',
|
||||
'food_item_id' => 'required|integer|exists:food_items,id',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\AddonFood;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class AddonFoodUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'addon_id' => 'required|integer|exists:addons,id',
|
||||
'food_item_id' => 'required|integer|exists:food_items,id',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Customer;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CustomerStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'email' => 'nullable|email|max:255',
|
||||
'phone' => 'nullable|string|max:20',
|
||||
'address' => 'nullable|string|max:255',
|
||||
'avatar' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg|max:2048',
|
||||
'status' => 'nullable|boolean',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Customer;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CustomerUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'email' => 'nullable|email|max:255',
|
||||
'phone' => 'nullable|string|max:20',
|
||||
'address' => 'nullable|string|max:255',
|
||||
'avatar' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg|max:2048',
|
||||
'status' => 'nullable|boolean',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\CustomerAddress;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CustomerAddressStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// validation rules
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\CustomerAddress;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CustomerAddressUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// validation rules
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\DeliveryCharge;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class DeliveryChargeStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// validation rules
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\DeliveryCharge;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class DeliveryChargeUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// validation rules
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\FoodAvailability;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class FoodAvailabilityStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'food_item_id' => 'required|exists:food_items,id',
|
||||
'availability' => 'required|array|min:1',
|
||||
'availability.*.day' => 'required|in:Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday',
|
||||
'availability.*.times' => 'required|array|min:1',
|
||||
'availability.*.times.*.open_time' => 'required|date_format:H:i',
|
||||
'availability.*.times.*.close_time' => 'required|date_format:H:i|after:availability.*.times.*.open_time',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\FoodAvailability;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class FoodAvailabilityUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'availability' => 'required|array|min:1',
|
||||
'availability.*.day' => 'required|in:Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday',
|
||||
'availability.*.times' => 'required|array|min:1',
|
||||
'availability.*.times.*.open_time' => 'required|date_format:H:i',
|
||||
'availability.*.times.*.close_time' => 'required|date_format:H:i|after:availability.*.times.*.open_time',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\FoodCategory;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class FoodCategoryStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'image' => 'nullable|image|mimes:jpeg,png,jpg,webp|max:2048', // for file upload
|
||||
'parent_id' => 'nullable|exists:food_categories,id',
|
||||
'is_offer' => 'nullable|boolean',
|
||||
'start_date' => 'nullable|date|before_or_equal:end_date',
|
||||
'end_date' => 'nullable|date|after_or_equal:start_date',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\FoodCategory;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class FoodCategoryUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'image' => 'nullable|image|mimes:jpeg,png,jpg,webp|max:2048', // for file upload
|
||||
'parent_id' => 'nullable|exists:food_categories,id',
|
||||
'is_offer' => 'nullable|boolean',
|
||||
'start_date' => 'nullable|date|before_or_equal:end_date',
|
||||
'end_date' => 'nullable|date|after_or_equal:start_date',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\FoodItem;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class FoodItemStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'category_id' => 'required|exists:food_categories,id',
|
||||
'menu_category_id' => 'nullable|exists:menu_categories,id',
|
||||
'menu_section_id' => 'nullable|exists:menu_sections,id',
|
||||
'name' => 'required|string|max:255',
|
||||
'slug' => 'nullable|string|max:255|unique:food_items,slug',
|
||||
'description' => 'nullable|string',
|
||||
'points' => 'nullable',
|
||||
'food_type' => 'required|in:Veg,Non-Veg',
|
||||
'is_featured' => 'nullable',
|
||||
'is_party' => 'nullable',
|
||||
'is_dinner' => 'nullable',
|
||||
'is_lunch' => 'nullable',
|
||||
'is_popular_item' => 'nullable',
|
||||
'is_chef_special' => 'nullable',
|
||||
'prep_time' => [
|
||||
'nullable',
|
||||
'regex:/^\d{2}:\d{2}(:\d{2})?$/',
|
||||
],
|
||||
'cooking_time' => [
|
||||
'nullable',
|
||||
'regex:/^\d{2}:\d{2}(:\d{2})?$/',
|
||||
],
|
||||
'vat' => 'nullable',
|
||||
'pst' => 'nullable',
|
||||
'ingredients_cost' => 'nullable',
|
||||
'allergens' => 'nullable|string|max:255',
|
||||
'notes' => 'nullable|string',
|
||||
'image' => 'nullable|image|mimes:jpg,jpeg,png|max:2048',
|
||||
|
||||
'variants' => 'required|array|min:1',
|
||||
'variants.*.name' => 'required|string|max:255',
|
||||
'variants.*.price' => 'required',
|
||||
'variants.*.offer_price' => 'nullable',
|
||||
'variants.*.discount' => 'nullable',
|
||||
'variants.*.unit_id' => [
|
||||
'required',
|
||||
Rule::exists('units', 'id')->whereNull('deleted_at'),
|
||||
],
|
||||
'variants.*.is_default' => 'required',
|
||||
'variants.*.stock_tracking' => 'nullable',
|
||||
'variants.*.ingredients_cost' => 'nullable',
|
||||
'variants.*.profit_margin' => 'nullable',
|
||||
'variants.*.alert_stock_quantity' => 'nullable',
|
||||
'variants.*.combo_type' => 'nullable|in:single,combo,add-on',
|
||||
'variants.*.is_active_offer' => 'nullable',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\FoodItem;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class FoodItemUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'category_id' => 'required|exists:food_categories,id',
|
||||
'menu_category_id' => 'nullable|exists:menu_categories,id',
|
||||
'menu_section_id' => 'nullable|exists:menu_sections,id',
|
||||
'name' => 'required|string|max:255',
|
||||
'points' => 'nullable',
|
||||
'food_type' => 'required|in:Veg,Non-Veg',
|
||||
'is_party' => 'nullable',
|
||||
'is_dinner' => 'nullable',
|
||||
'is_lunch' => 'nullable',
|
||||
'is_popular_item' => 'nullable',
|
||||
'is_chef_special' => 'nullable',
|
||||
'cooking_time' => 'required',
|
||||
'components' => 'nullable|string',
|
||||
'variants' => 'required|array|min:1',
|
||||
'variants.*.name' => 'required|string|max:255',
|
||||
'variants.*.price' => 'required',
|
||||
'variants.*.unit_id' => [
|
||||
'required',
|
||||
Rule::exists('units', 'id')->whereNull('deleted_at'),
|
||||
],
|
||||
'variants.*.is_default' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\FoodReview;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class FoodReviewStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'food_item_id' => 'required|integer|exists:food_items,id',
|
||||
'rating' => 'required|integer|min:1|max:5',
|
||||
'review' => 'required|string',
|
||||
'images.*' => 'nullable|image|max:2048',
|
||||
'video_url' => 'nullable|url',
|
||||
'video_file' => 'nullable|mimes:mp4,webm,mov|max:20480',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\FoodReview;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class FoodReviewUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'rating' => 'required|integer|min:1|max:5',
|
||||
'review' => 'required|string',
|
||||
'images.*' => 'nullable|image|max:2048',
|
||||
'video_url' => 'nullable|url',
|
||||
'video_file' => 'nullable|mimes:mp4,webm,mov|max:20480',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\FoodReviewReply;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class FoodReviewReplyStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'review_id' => 'required|exists:food_reviews,id',
|
||||
'message' => 'nullable|string',
|
||||
'attachments.*' => 'nullable|file|mimes:jpg,jpeg,png,pdf,docx,mp4,webm|max:20480', // 20MB max
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\FoodReviewReply;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class FoodReviewReplyUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'message' => 'nullable|string',
|
||||
'attachments.*' => 'nullable|file|mimes:jpg,jpeg,png,pdf,docx,mp4,webm|max:20480',
|
||||
'remove_attachments' => 'nullable|array', // names of attachments to remove
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\FoodVariant;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class FoodVariantStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'food_item_id' => 'required|integer|exists:food_items,id',
|
||||
'unit_id' => 'required|exists:units,id',
|
||||
'name' => 'required|string|max:255',
|
||||
'price' => 'required|numeric|min:0|max:999999.99',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\FoodVariant;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class FoodVariantUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'food_item_id' => 'required|integer|exists:food_items,id',
|
||||
'unit_id' => 'required|exists:units,id',
|
||||
'name' => 'required|string|max:255',
|
||||
'price' => 'required|numeric|min:0|max:999999.99',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\FoodVariantIngredient;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class FoodVariantIngredientStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'food_variant_id' => 'required|exists:food_variants,id',
|
||||
'ingredients' => 'required|array|min:1',
|
||||
'ingredients.*.ingredient_id' => 'required|exists:ingredients,id',
|
||||
'ingredients.*.quantity' => 'required|numeric|min:0',
|
||||
'ingredients.*.wastage_percentage' => 'nullable|numeric|min:0',
|
||||
'ingredients.*.unit_conversion_factor' => 'nullable|numeric|min:0',
|
||||
'ingredients.*.optional' => 'nullable|in:Y,N',
|
||||
'ingredients.*.notes' => 'nullable|string',
|
||||
'ingredients.*.status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\FoodVariantIngredient;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class FoodVariantIngredientUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'food_variant_id' => 'sometimes|required|exists:food_variants,id',
|
||||
'ingredient_id' => 'sometimes|required|exists:ingredients,id',
|
||||
'quantity' => 'sometimes|required|numeric|min:0',
|
||||
'wastage_percentage' => 'nullable|numeric|min:0',
|
||||
'unit_conversion_factor' => 'nullable|numeric|min:0',
|
||||
'optional' => 'nullable|in:Y,N',
|
||||
'notes' => 'nullable|string',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\FoodWaste;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class FoodWasteStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'food_item_id' => 'required|exists:food_items,id',
|
||||
'food_variant_id' => 'nullable|exists:food_variants,id',
|
||||
'quantity' => 'required|numeric|min:0.01',
|
||||
'reason' => 'required|string|max:255',
|
||||
'notes' => 'nullable|string',
|
||||
'wasted_at' => 'nullable|date',
|
||||
'approve' => 'nullable|boolean',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\FoodWaste;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class FoodWasteUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'food_item_id' => 'required|exists:food_items,id',
|
||||
'food_variant_id' => 'nullable|exists:food_variants,id',
|
||||
'quantity' => 'required|numeric|min:0.01',
|
||||
'reason' => 'required|string|max:255',
|
||||
'notes' => 'nullable|string',
|
||||
'wasted_at' => 'nullable|date',
|
||||
'approve' => 'nullable|boolean',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Ingredient;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class IngredientStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// ===== Basic Info =====
|
||||
'name' => 'required|string|max:255',
|
||||
'unit_id' => 'required|exists:units,id',
|
||||
'stock_quantity' => 'nullable|numeric|min:0',
|
||||
'cost_per_unit' => 'nullable|numeric|min:0',
|
||||
'low_stock_alert' => 'nullable|numeric|min:0',
|
||||
'image' => 'nullable|image',
|
||||
|
||||
// ===== Supplier & Purchase Info =====
|
||||
'supplier_id' => 'nullable|exists:suppliers,id',
|
||||
'last_purchase_price' => 'nullable|numeric|min:0',
|
||||
'last_purchase_date' => 'nullable|date',
|
||||
|
||||
// ===== Units & Conversions =====
|
||||
'conversion_factor' => 'nullable|numeric|min:0.01',
|
||||
|
||||
// ===== Stock & Inventory =====
|
||||
'reserved_quantity' => 'nullable|numeric|min:0',
|
||||
'wastage_quantity' => 'nullable|numeric|min:0',
|
||||
|
||||
// ===== Categorization =====
|
||||
'category' => 'nullable|string|max:100',
|
||||
'notes' => 'nullable|string|max:2000',
|
||||
|
||||
// ===== Status =====
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Ingredient;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class IngredientUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// ===== Basic Info =====
|
||||
'name' => 'required|string|max:255',
|
||||
'unit_id' => 'required|exists:units,id',
|
||||
'stock_quantity' => 'nullable|numeric|min:0',
|
||||
'cost_per_unit' => 'nullable|numeric|min:0',
|
||||
'low_stock_alert' => 'nullable|numeric|min:0',
|
||||
'image' => 'nullable|image',
|
||||
|
||||
// ===== Supplier & Purchase Info =====
|
||||
'supplier_id' => 'nullable|exists:suppliers,id',
|
||||
'last_purchase_price' => 'nullable|numeric|min:0',
|
||||
'last_purchase_date' => 'nullable|date',
|
||||
|
||||
// ===== Units & Conversions =====
|
||||
'conversion_factor' => 'nullable|numeric|min:0.01',
|
||||
|
||||
// ===== Stock & Inventory =====
|
||||
'reserved_quantity' => 'nullable|numeric|min:0',
|
||||
'wastage_quantity' => 'nullable|numeric|min:0',
|
||||
|
||||
// ===== Categorization =====
|
||||
'category' => 'nullable|string|max:100',
|
||||
'notes' => 'nullable|string|max:2000',
|
||||
|
||||
// ===== Status =====
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\IngredientDamage;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class IngredientDamageStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'purchase_id' => ['required', 'exists:purchases,id'],
|
||||
'ingredient_id' => ['required', 'exists:ingredients,id'],
|
||||
'batch_no' => ['nullable', 'string'],
|
||||
'quantity' => ['required', 'numeric', 'min:0.01'],
|
||||
'unit_cost' => ['nullable', 'numeric', 'min:0'],
|
||||
'reason' => ['nullable', 'string'],
|
||||
'damage_date' => ['nullable', 'date'],
|
||||
'reported_by' => ['nullable', 'exists:users,id'],
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\IngredientDamage;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class IngredientDamageUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// validation rules
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Kitchen;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class KitchenStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:100'],
|
||||
'serial' => ['required', 'integer', 'min:0'],
|
||||
'status' => ['nullable', 'in:0,1'],
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Kitchen;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class KitchenUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:100'],
|
||||
'serial' => ['required', 'integer', 'min:0'],
|
||||
'status' => ['nullable', 'in:0,1'],
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\KitchenAssign;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class KitchenAssignStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'kitchen_id' => ['required', 'integer', 'exists:kitchens,id'],
|
||||
'user_id' => ['required', 'integer', 'exists:users,id'],
|
||||
'status' => ['nullable', 'in:0,1'],
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\KitchenAssign;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class KitchenAssignUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'kitchen_id' => ['required', 'integer', 'exists:kitchens,id'],
|
||||
'user_id' => ['required', 'integer', 'exists:users,id'],
|
||||
'status' => ['nullable', 'in:0,1'],
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\LoyaltyPoint;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class LoyaltyPointStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'order_id' => 'nullable|exists:orders,id',
|
||||
'food_item_id' => 'nullable|exists:food_items,id',
|
||||
'points' => 'required',
|
||||
'type' => 'required|in:earned,redeemed,manual',
|
||||
'reason' => 'nullable|string|max:255',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\LoyaltyPoint;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class LoyaltyPointUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'order_id' => 'nullable|exists:orders,id',
|
||||
'food_item_id' => 'nullable|exists:food_items,id',
|
||||
'points' => 'required',
|
||||
'type' => 'required|in:earned,redeemed,manual',
|
||||
'reason' => 'nullable|string|max:255',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\LoyaltyPointSetting;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class LoyaltyPointSettingStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:12'],
|
||||
'from_amount' => ['nullable', 'numeric', 'min:0'],
|
||||
'to_amount' => ['nullable', 'numeric', 'min:0', 'gte:from_amount'],
|
||||
'amount' => ['nullable', 'numeric', 'min:0'],
|
||||
'earn_point' => ['required', 'integer', 'min:0'],
|
||||
'status' => ['nullable', 'integer', 'in:0,1'], // 1=Active, 2=InActive
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\LoyaltyPointSetting;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class LoyaltyPointSettingUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:12'],
|
||||
'from_amount' => ['nullable', 'numeric', 'min:0'],
|
||||
'to_amount' => ['nullable', 'numeric', 'min:0', 'gte:from_amount'],
|
||||
'amount' => ['nullable', 'numeric', 'min:0'],
|
||||
'earn_point' => ['required', 'integer', 'min:0'],
|
||||
'status' => ['nullable', 'integer', 'in:0,1'], // 1=Active, 2=InActive
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\LoyaltyRedemption;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class LoyaltyRedemptionStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'food_item_id' => 'nullable|exists:food_items,id',
|
||||
'points_used' => 'required',
|
||||
'price' => 'nullable|numeric|min:0',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\LoyaltyRedemption;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class LoyaltyRedemptionUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'food_item_id' => 'nullable|exists:food_items,id',
|
||||
'points_used' => 'required',
|
||||
'price' => 'nullable|numeric|min:0',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\MenuCategory;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class MenuCategoryStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:100',
|
||||
'slug' => 'nullable|string|max:150',
|
||||
'icon' => 'nullable|image',
|
||||
'description' => 'nullable|string|max:500',
|
||||
'status' => 'required|boolean',
|
||||
'priority' => 'nullable|integer|min:0',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'name.required' => 'Category name is required.',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\MenuCategory;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class MenuCategoryUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:100',
|
||||
'slug' => 'nullable|string|max:150',
|
||||
'icon' => 'nullable|image',
|
||||
'description' => 'nullable|string|max:500',
|
||||
'status' => 'required|boolean',
|
||||
'priority' => 'nullable|integer|min:0',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'name.required' => 'Category name is required.',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\MenuSection;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class MenuSectionStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'menu_category_id' => 'required|exists:menu_categories,id',
|
||||
'name' => 'required|string|max:100',
|
||||
'slug' => 'nullable|string|max:150',
|
||||
'description' => 'nullable|string|max:500',
|
||||
'priority' => 'nullable|integer|min:0',
|
||||
'status' => 'required|boolean',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'menu_category_id.required' => 'Please select a menu category.',
|
||||
'menu_category_id.exists' => 'The selected category does not exist.',
|
||||
'name.required' => 'Section name is required.',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\MenuSection;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class MenuSectionUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'menu_category_id' => 'required|exists:menu_categories,id',
|
||||
'name' => 'required|string|max:100',
|
||||
'slug' => 'nullable|string|max:150',
|
||||
'description' => 'nullable|string|max:500',
|
||||
'priority' => 'nullable|integer|min:0',
|
||||
'status' => 'required|boolean',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'menu_category_id.required' => 'Please select a menu category.',
|
||||
'menu_category_id.exists' => 'The selected category does not exist.',
|
||||
'name.required' => 'Section name is required.',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\MenuType;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class MenuTypeStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'icon' => 'nullable|image|mimes:jpeg,png,jpg,webp|max:2048', // for file upload
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\MenuType;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class MenuTypeUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'icon' => 'nullable|image|mimes:jpeg,png,jpg,webp|max:2048', // for file upload
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Order;
|
||||
|
||||
use App\Enum\OrderStatus;
|
||||
use App\Enum\OrderType;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CustomerOrderStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// 🔹 Core order fields
|
||||
'order_type' => 'required|in:'.implode(',', OrderType::values()),
|
||||
'status' => 'nullable|in:'.implode(',', OrderStatus::values()),
|
||||
|
||||
'table_id' => 'nullable|exists:tables,id',
|
||||
'waiter_id' => 'nullable|exists:users,id',
|
||||
'driver_id' => 'nullable|exists:users,id',
|
||||
'customer_id' => 'nullable|exists:customers,id',
|
||||
|
||||
// 🔹 Order identification
|
||||
'order_number' => 'nullable|string|max:50|unique:orders,order_number',
|
||||
'reference' => 'nullable|string|max:100',
|
||||
|
||||
// 🔹 Customer info
|
||||
'customer_name' => 'nullable|string|max:255',
|
||||
'customer_phone' => 'nullable|string|max:20',
|
||||
'delivery_address' => 'nullable|string|max:500',
|
||||
|
||||
// 🔹 Financials
|
||||
'subtotal' => 'nullable|numeric|min:0',
|
||||
'discount' => 'nullable|numeric|min:0',
|
||||
'tax' => 'nullable|numeric|min:0',
|
||||
'service_charge' => 'nullable|numeric|min:0',
|
||||
'tip_amount' => 'nullable|numeric|min:0',
|
||||
'grand_total' => 'required|numeric|min:0',
|
||||
|
||||
// 🔹 Payment
|
||||
'payment_method_id' => 'required|exists:payment_methods,id',
|
||||
'payment_status' => 'nullable|boolean',
|
||||
'payment_reference' => 'nullable|string|max:100',
|
||||
'paid_at' => 'nullable|date',
|
||||
|
||||
// 🔹 Operational
|
||||
'order_source' => 'nullable|in:POS,Web,MobileApp,ThirdParty',
|
||||
'estimated_ready_time' => 'nullable|date',
|
||||
'delivered_at' => 'nullable|date',
|
||||
|
||||
// 🔹 Items (nested validation)
|
||||
'items.*.food_variant_id' => 'nullable|exists:food_variants,id',
|
||||
'items.*.addons' => 'nullable|array',
|
||||
'items.*.addons.*.name' => 'nullable|string|max:255',
|
||||
'items.*.addons.*.price' => 'nullable|numeric|min:0',
|
||||
|
||||
// 🔹 Audit
|
||||
'added_by' => 'nullable|exists:users,id',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Order;
|
||||
|
||||
use App\Enum\OrderStatus;
|
||||
use App\Enum\OrderType;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CustomerOrderUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// 🔹 Core order fields
|
||||
'order_type' => 'required|in:'.implode(',', OrderType::values()),
|
||||
'status' => 'nullable|in:'.implode(',', OrderStatus::values()),
|
||||
|
||||
'table_id' => 'nullable|exists:tables,id',
|
||||
'waiter_id' => 'nullable|exists:users,id',
|
||||
'driver_id' => 'nullable|exists:users,id',
|
||||
'customer_id' => 'nullable|exists:customers,id',
|
||||
|
||||
// 🔹 Order identification
|
||||
'order_number' => 'nullable|string|max:50|unique:orders,order_number',
|
||||
'reference' => 'nullable|string|max:100',
|
||||
|
||||
// 🔹 Customer info
|
||||
'customer_name' => 'nullable|string|max:255',
|
||||
'customer_phone' => 'nullable|string|max:20',
|
||||
'delivery_address' => 'nullable|string|max:500',
|
||||
|
||||
// 🔹 Financials
|
||||
'subtotal' => 'nullable|numeric|min:0',
|
||||
'discount' => 'nullable|numeric|min:0',
|
||||
'tax' => 'nullable|numeric|min:0',
|
||||
'service_charge' => 'nullable|numeric|min:0',
|
||||
'tip_amount' => 'nullable|numeric|min:0',
|
||||
'grand_total' => 'required|numeric|min:0',
|
||||
|
||||
// 🔹 Payment
|
||||
'payment_method_id' => 'required|exists:payment_methods,id',
|
||||
'payment_status' => 'nullable|boolean',
|
||||
'payment_reference' => 'nullable|string|max:100',
|
||||
'paid_at' => 'nullable|date',
|
||||
|
||||
// 🔹 Operational
|
||||
'order_source' => 'nullable|in:POS,Web,MobileApp,ThirdParty',
|
||||
'estimated_ready_time' => 'nullable|date',
|
||||
'delivered_at' => 'nullable|date',
|
||||
|
||||
// 🔹 Items (nested validation)
|
||||
'items' => 'required|array|min:1',
|
||||
'items.*.food_item_id' => 'required|exists:food_items,id',
|
||||
'items.*.quantity' => 'required|integer|min:1',
|
||||
'items.*.price' => 'required|numeric|min:0',
|
||||
|
||||
// 🔹 Audit
|
||||
'updated_by' => 'nullable|exists:users,id',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Order;
|
||||
|
||||
use App\Enum\OrderStatus;
|
||||
use App\Enum\OrderType;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class OrderStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// 🔹 Core order fields
|
||||
'order_type' => 'required|in:'.implode(',', OrderType::values()),
|
||||
'status' => 'required|in:'.implode(',', OrderStatus::values()),
|
||||
|
||||
'table_id' => 'nullable|exists:tables,id',
|
||||
'waiter_id' => 'nullable|exists:users,id',
|
||||
'driver_id' => 'nullable|exists:users,id',
|
||||
'customer_id' => 'nullable|exists:customers,id',
|
||||
|
||||
// 🔹 Order identification
|
||||
'order_number' => 'nullable|string|max:50|unique:orders,order_number',
|
||||
'reference' => 'nullable|string|max:100',
|
||||
|
||||
// 🔹 Customer info
|
||||
'customer_name' => 'nullable|string|max:255',
|
||||
'customer_phone' => 'nullable|string|max:20',
|
||||
'delivery_address' => 'nullable|string|max:500',
|
||||
|
||||
// 🔹 Financials
|
||||
'subtotal' => 'nullable|numeric|min:0',
|
||||
'discount' => 'nullable|numeric|min:0',
|
||||
'tax' => 'nullable|numeric|min:0',
|
||||
'service_charge' => 'nullable|numeric|min:0',
|
||||
'tip_amount' => 'nullable|numeric|min:0',
|
||||
'grand_total' => 'required|numeric|min:0',
|
||||
|
||||
// 🔹 Payment
|
||||
'payment_method_id' => 'required|exists:payment_methods,id',
|
||||
'payment_status' => 'nullable|boolean',
|
||||
'payment_reference' => 'nullable|string|max:100',
|
||||
'paid_at' => 'nullable|date',
|
||||
|
||||
// 🔹 Operational
|
||||
'order_source' => 'nullable|in:POS,Web,MobileApp,ThirdParty',
|
||||
'estimated_ready_time' => 'nullable|date',
|
||||
'delivered_at' => 'nullable|date',
|
||||
|
||||
// 🔹 Items (nested validation)
|
||||
'items.*.food_variant_id' => 'nullable|exists:food_variants,id',
|
||||
'items.*.addons' => 'nullable|array',
|
||||
'items.*.addons.*.name' => 'nullable|string|max:255',
|
||||
'items.*.addons.*.price' => 'nullable|numeric|min:0',
|
||||
|
||||
// 🔹 Audit
|
||||
'added_by' => 'nullable|exists:users,id',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Order;
|
||||
|
||||
use App\Enum\OrderStatus;
|
||||
use App\Enum\OrderType;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class OrderUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// 🔹 Core order fields
|
||||
'order_type' => 'required|in:'.implode(',', OrderType::values()),
|
||||
'status' => 'required|in:'.implode(',', OrderStatus::values()),
|
||||
|
||||
'table_id' => 'nullable|exists:tables,id',
|
||||
'waiter_id' => 'nullable|exists:users,id',
|
||||
'driver_id' => 'nullable|exists:users,id',
|
||||
'customer_id' => 'nullable|exists:customers,id',
|
||||
|
||||
// 🔹 Order identification
|
||||
'order_number' => 'nullable|string|max:50|unique:orders,order_number',
|
||||
'reference' => 'nullable|string|max:100',
|
||||
|
||||
// 🔹 Customer info
|
||||
'customer_name' => 'nullable|string|max:255',
|
||||
'customer_phone' => 'nullable|string|max:20',
|
||||
'delivery_address' => 'nullable|string|max:500',
|
||||
|
||||
// 🔹 Financials
|
||||
'subtotal' => 'nullable|numeric|min:0',
|
||||
'discount' => 'nullable|numeric|min:0',
|
||||
'tax' => 'nullable|numeric|min:0',
|
||||
'service_charge' => 'nullable|numeric|min:0',
|
||||
'tip_amount' => 'nullable|numeric|min:0',
|
||||
'grand_total' => 'required|numeric|min:0',
|
||||
|
||||
// 🔹 Payment
|
||||
'payment_method_id' => 'required|exists:payment_methods,id',
|
||||
'payment_status' => 'nullable|boolean',
|
||||
'payment_reference' => 'nullable|string|max:100',
|
||||
'paid_at' => 'nullable|date',
|
||||
|
||||
// 🔹 Operational
|
||||
'order_source' => 'nullable|in:POS,Web,MobileApp,ThirdParty',
|
||||
'estimated_ready_time' => 'nullable|date',
|
||||
'delivered_at' => 'nullable|date',
|
||||
|
||||
// 🔹 Items (nested validation)
|
||||
'items' => 'required|array|min:1',
|
||||
'items.*.food_item_id' => 'required|exists:food_items,id',
|
||||
'items.*.quantity' => 'required|integer|min:1',
|
||||
'items.*.price' => 'required|numeric|min:0',
|
||||
|
||||
// 🔹 Audit
|
||||
'updated_by' => 'nullable|exists:users,id',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\OrderItem;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class OrderItemStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// validation rules
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\OrderItem;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class OrderItemUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// validation rules
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\OrderTracking;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class OrderTrackingStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// validation rules
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\OrderTracking;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class OrderTrackingUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// validation rules
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\PaymentMethod;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class PaymentMethodStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'type' => 'nullable|in:gateway,cash,card,wallet',
|
||||
'credentials' => 'nullable|array', // since it's JSON, validate as array
|
||||
'is_default' => 'nullable|boolean',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\PaymentMethod;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class PaymentMethodUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'type' => 'nullable|in:gateway,cash,card,wallet',
|
||||
'credentials' => 'nullable|array', // since it's JSON, validate as array
|
||||
'is_default' => 'nullable|boolean',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Purchase;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class PurchaseStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'supplier_id' => ['nullable', 'exists:suppliers,id'],
|
||||
'purchase_date' => ['required', 'date'],
|
||||
|
||||
// Financials
|
||||
'sub_total' => ['required', 'numeric', 'min:0'],
|
||||
'discount_amount' => ['nullable', 'numeric', 'min:0'],
|
||||
'tax_amount' => ['nullable', 'numeric', 'min:0'],
|
||||
'total_amount' => ['required', 'numeric', 'min:0'],
|
||||
'payment_status' => ['nullable', Rule::in(['paid', 'unpaid', 'partial'])],
|
||||
'payment_method' => ['nullable', Rule::in(['cash', 'bank', 'credit'])],
|
||||
'purchase_type' => ['nullable', Rule::in(['ingredient', 'equipment', 'others'])],
|
||||
'created_by' => ['nullable', 'exists:users,id'],
|
||||
'notes' => ['nullable', 'string'],
|
||||
|
||||
// Items array
|
||||
'items' => ['required', 'array', 'min:1'],
|
||||
'items.*.ingredient_id' => ['required', 'exists:ingredients,id'],
|
||||
'items.*.food_variant_id' => ['nullable', 'exists:food_variants,id'],
|
||||
'items.*.quantity' => ['required', 'numeric', 'min:0.01'],
|
||||
'items.*.unit_price' => ['required', 'numeric', 'min:0'],
|
||||
'items.*.total_cost' => ['required', 'numeric', 'min:0'],
|
||||
'items.*.tax_amount' => ['nullable', 'numeric', 'min:0'],
|
||||
'items.*.discount_amount' => ['nullable', 'numeric', 'min:0'],
|
||||
'items.*.batch_no' => ['nullable', 'string'],
|
||||
'items.*.expiry_date' => ['nullable', 'date'],
|
||||
'items.*.received_quantity' => ['nullable', 'numeric', 'min:0'],
|
||||
'items.*.wastage_quantity' => ['nullable', 'numeric', 'min:0'],
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Purchase;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class PurchaseUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'supplier_id' => ['nullable', 'exists:suppliers,id'],
|
||||
'purchase_date' => ['required', 'date'],
|
||||
|
||||
// Financials
|
||||
'sub_total' => ['required', 'numeric', 'min:0'],
|
||||
'discount_amount' => ['nullable', 'numeric', 'min:0'],
|
||||
'tax_amount' => ['nullable', 'numeric', 'min:0'],
|
||||
'total_amount' => ['required', 'numeric', 'min:0'],
|
||||
|
||||
'payment_status' => ['nullable', Rule::in(['paid', 'unpaid', 'partial'])],
|
||||
'payment_method' => ['nullable', Rule::in(['cash', 'bank', 'credit'])],
|
||||
'purchase_type' => ['nullable', Rule::in(['ingredient', 'equipment', 'others'])],
|
||||
'created_by' => ['nullable', 'exists:users,id'],
|
||||
'notes' => ['nullable', 'string'],
|
||||
|
||||
// Items
|
||||
'items' => ['required', 'array', 'min:1'],
|
||||
|
||||
// id is optional — if present = update, if missing = create
|
||||
'items.*.id' => ['nullable', 'exists:purchase_items,id'],
|
||||
|
||||
'items.*.ingredient_id' => ['required', 'exists:ingredients,id'],
|
||||
'items.*.food_variant_id' => ['nullable', 'exists:food_variants,id'],
|
||||
'items.*.quantity' => ['required', 'numeric', 'min:0.01'],
|
||||
'items.*.unit_price' => ['required', 'numeric', 'min:0'],
|
||||
'items.*.total_cost' => ['required', 'numeric', 'min:0'],
|
||||
'items.*.tax_amount' => ['nullable', 'numeric', 'min:0'],
|
||||
'items.*.discount_amount' => ['nullable', 'numeric', 'min:0'],
|
||||
'items.*.batch_no' => ['nullable', 'string'],
|
||||
'items.*.expiry_date' => ['nullable', 'date'],
|
||||
'items.*.received_quantity' => ['nullable', 'numeric', 'min:0'],
|
||||
'items.*.wastage_quantity' => ['nullable', 'numeric', 'min:0'],
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\PurchaseItem;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class PurchaseItemStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// validation rules
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\PurchaseItem;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class PurchaseItemUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// validation rules
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\QRMenuSetting;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class QRMenuSettingStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:100'],
|
||||
'menu_title' => ['nullable', 'string', 'max:150'],
|
||||
'logo' => ['nullable'],
|
||||
'menu_url' => ['nullable'],
|
||||
'primary_color' => ['nullable', 'regex:/^#([A-Fa-f0-9]{6})$/'],
|
||||
'secondary_color' => ['nullable', 'regex:/^#([A-Fa-f0-9]{6})$/'],
|
||||
'bg_color' => ['nullable', 'regex:/^#([A-Fa-f0-9]{6})$/'],
|
||||
'template' => ['nullable', 'string', 'max:50'],
|
||||
'description' => ['nullable', 'string'],
|
||||
'qr_code_url' => ['nullable'],
|
||||
'wifi_name' => ['nullable', 'string', 'max:50'],
|
||||
'wifi_ssid' => ['nullable', 'string', 'max:50'],
|
||||
'wifi_password' => ['nullable', 'string', 'max:50'],
|
||||
'status' => ['nullable'],
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\QRMenuSetting;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class QRMenuSettingUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:100'],
|
||||
'menu_title' => ['nullable', 'string', 'max:150'],
|
||||
'logo' => ['nullable'],
|
||||
'menu_url' => ['nullable'],
|
||||
'primary_color' => ['nullable', 'regex:/^#([A-Fa-f0-9]{6})$/'],
|
||||
'secondary_color' => ['nullable', 'regex:/^#([A-Fa-f0-9]{6})$/'],
|
||||
'bg_color' => ['nullable', 'regex:/^#([A-Fa-f0-9]{6})$/'],
|
||||
'template' => ['nullable', 'string', 'max:50'],
|
||||
'description' => ['nullable', 'string'],
|
||||
'qr_code_url' => ['nullable'],
|
||||
'wifi_name' => ['nullable', 'string', 'max:50'],
|
||||
'wifi_ssid' => ['nullable', 'string', 'max:50'],
|
||||
'wifi_password' => ['nullable', 'string', 'max:50'],
|
||||
'status' => ['nullable'],
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Reservation;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ReservationStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// validation rules
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Reservation;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ReservationUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// validation rules
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\ReservationSetting;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ReservationSettingStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'start_time' => ['required', 'date_format:H:i'],
|
||||
'end_time' => ['required', 'date_format:H:i', 'after:start_time'],
|
||||
'max_reservation' => ['required'],
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\ReservationSetting;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ReservationSettingUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'start_time' => ['required', 'date_format:H:i'],
|
||||
'end_time' => ['required', 'date_format:H:i', 'after:start_time'],
|
||||
'max_reservation' => ['required'],
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\ReservationUnavailable;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ReservationUnavailableStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// validation rules
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\ReservationUnavailable;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ReservationUnavailableUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// validation rules
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\RestaurantSchedule;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class RestaurantScheduleStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'schedules' => 'required|array|min:1',
|
||||
'schedules.*.day' => 'required|string|in:Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday',
|
||||
'schedules.*.is_open' => 'boolean',
|
||||
'schedules.*.times' => 'required|array|min:1',
|
||||
'schedules.*.times.*.open_time' => 'required|date_format:H:i',
|
||||
'schedules.*.times.*.close_time' => 'required|date_format:H:i|after:schedules.*.times.*.open_time',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\RestaurantSchedule;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class RestaurantScheduleUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'schedules' => 'required|array|min:1',
|
||||
'schedules.*.day' => 'required|string|in:Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday',
|
||||
'schedules.*.is_open' => 'boolean',
|
||||
'schedules.*.times' => 'required|array|min:1',
|
||||
'schedules.*.times.*.open_time' => 'required|date_format:H:i',
|
||||
'schedules.*.times.*.close_time' => 'required|date_format:H:i|after:schedules.*.times.*.open_time',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Stock;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StockStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// validation rules
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Stock;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StockUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// validation rules
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Supplier;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class SupplierStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// ===== Basic Info =====
|
||||
'name' => 'required|string|max:255',
|
||||
'phone' => 'required|string|max:20',
|
||||
'company_name' => 'nullable|string|max:255',
|
||||
'contact_person' => 'nullable|string|max:255',
|
||||
'alternate_phone' => 'nullable|string|max:20',
|
||||
'email' => 'nullable|email|max:255',
|
||||
'website' => 'nullable|url|max:255',
|
||||
'image' => 'nullable|image',
|
||||
|
||||
// ===== Address Info =====
|
||||
'address' => 'nullable|string|max:1000',
|
||||
'city' => 'nullable|string|max:255',
|
||||
'state' => 'nullable|string|max:255',
|
||||
'country' => 'nullable|string|max:255',
|
||||
'postal_code' => 'nullable|string|max:20',
|
||||
|
||||
// ===== Financial / Business Info =====
|
||||
'tax_number' => 'nullable|string|max:100',
|
||||
'bank_name' => 'nullable|string|max:255',
|
||||
'bank_account_name' => 'nullable|string|max:255',
|
||||
'bank_account_number' => 'nullable|string|max:50',
|
||||
'ifsc_code' => 'nullable|string|max:20',
|
||||
'opening_balance' => 'nullable|numeric|min:0',
|
||||
'opening_balance_date' => 'nullable|date',
|
||||
'due' => 'nullable|numeric|min:0',
|
||||
'balance' => 'nullable|numeric|min:0',
|
||||
|
||||
// ===== Relationship Info =====
|
||||
'supply_type' => 'nullable|string|max:255',
|
||||
'payment_terms' => 'nullable|string|max:50',
|
||||
'credit_limit' => 'nullable|numeric|min:0',
|
||||
|
||||
// ===== Ratings & Notes =====
|
||||
'rating' => 'nullable|numeric|between:0,5',
|
||||
'notes' => 'nullable|string|max:2000',
|
||||
|
||||
// ===== Documents =====
|
||||
'contract_file' => 'nullable|string|max:255',
|
||||
'trade_license' => 'nullable|string|max:255',
|
||||
'nid_number' => 'nullable|string|max:50',
|
||||
|
||||
// ===== Status =====
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Supplier;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class SupplierUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// ===== Basic Info =====
|
||||
'name' => 'required|string|max:255',
|
||||
'phone' => 'required|string|max:20',
|
||||
'company_name' => 'nullable|string|max:255',
|
||||
'contact_person' => 'nullable|string|max:255',
|
||||
'alternate_phone' => 'nullable|string|max:20',
|
||||
'email' => 'nullable|email|max:255',
|
||||
'website' => 'nullable|url|max:255',
|
||||
'image' => 'nullable|image',
|
||||
|
||||
// ===== Address Info =====
|
||||
'address' => 'nullable|string|max:1000',
|
||||
'city' => 'nullable|string|max:255',
|
||||
'state' => 'nullable|string|max:255',
|
||||
'country' => 'nullable|string|max:255',
|
||||
'postal_code' => 'nullable|string|max:20',
|
||||
|
||||
// ===== Financial / Business Info =====
|
||||
'tax_number' => 'nullable|string|max:100',
|
||||
'bank_name' => 'nullable|string|max:255',
|
||||
'bank_account_name' => 'nullable|string|max:255',
|
||||
'bank_account_number' => 'nullable|string|max:50',
|
||||
'ifsc_code' => 'nullable|string|max:20',
|
||||
'opening_balance' => 'nullable|numeric|min:0',
|
||||
'opening_balance_date' => 'nullable|date',
|
||||
'due' => 'nullable|numeric|min:0',
|
||||
'balance' => 'nullable|numeric|min:0',
|
||||
|
||||
// ===== Relationship Info =====
|
||||
'supply_type' => 'nullable|string|max:255',
|
||||
'payment_terms' => 'nullable|string|max:50',
|
||||
'credit_limit' => 'nullable|numeric|min:0',
|
||||
|
||||
// ===== Ratings & Notes =====
|
||||
'rating' => 'nullable|numeric|between:0,5',
|
||||
'notes' => 'nullable|string|max:2000',
|
||||
|
||||
// ===== Documents =====
|
||||
'contract_file' => 'nullable|string|max:255',
|
||||
'trade_license' => 'nullable|string|max:255',
|
||||
'nid_number' => 'nullable|string|max:50',
|
||||
|
||||
// ===== Status =====
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Table;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class TableStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'serial' => 'nullable|string|max:50', // optional unique table code
|
||||
'location' => 'nullable|string|max:255',
|
||||
'section' => 'nullable|string|max:255', // e.g., VIP, Main Floor
|
||||
'table_type' => 'nullable|in:regular,vip,outdoor,booth',
|
||||
'capacity' => 'required',
|
||||
'is_bookable' => 'nullable|boolean',
|
||||
'qr_code' => 'nullable|string|max:255',
|
||||
'image' => 'nullable|image|mimes:jpeg,png,jpg,gif,webp',
|
||||
'position_x' => 'nullable',
|
||||
'position_y' => 'nullable',
|
||||
'rotation' => 'nullable|numeric|min:0|max:360',
|
||||
'z_index' => 'nullable',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Table;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class TableUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'serial' => 'nullable|string|max:50', // optional unique table code
|
||||
'location' => 'nullable|string|max:255',
|
||||
'section' => 'nullable|string|max:255', // e.g., VIP, Main Floor
|
||||
'table_type' => 'nullable|in:regular,vip,outdoor,booth',
|
||||
'capacity' => 'required',
|
||||
'is_bookable' => 'nullable|boolean',
|
||||
'qr_code' => 'nullable|string|max:255',
|
||||
'image' => 'nullable|image|mimes:jpeg,png,jpg,gif,webp',
|
||||
'position_x' => 'nullable',
|
||||
'position_y' => 'nullable',
|
||||
'rotation' => 'nullable|numeric|min:0|max:360',
|
||||
'z_index' => 'nullable',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\TaxSetting;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class TaxSettingStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:100'],
|
||||
'reg_no' => ['nullable', 'string', 'max:100'],
|
||||
'type' => ['required', 'in:percentage,fixed'],
|
||||
'value' => ['required', 'numeric', 'min:0'],
|
||||
'is_default' => ['boolean'],
|
||||
'status' => ['nullable', 'integer', 'in:0,1'],
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\TaxSetting;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class TaxSettingUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:100'],
|
||||
'reg_no' => ['nullable', 'string', 'max:100'],
|
||||
'type' => ['required', 'in:percentage,fixed'],
|
||||
'value' => ['required', 'numeric', 'min:0'],
|
||||
'is_default' => ['boolean'],
|
||||
'status' => ['nullable', 'integer', 'in:0,1'],
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Unit;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UnitStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'short_name' => 'required|string|max:50',
|
||||
'type' => 'required|in:weight,volume,count,length',
|
||||
'base_unit_id' => 'nullable|integer|exists:units,id',
|
||||
'operator' => 'nullable|in:*,/',
|
||||
'operator_value' => 'nullable|numeric|min:0',
|
||||
'priority' => 'nullable|integer|min:0',
|
||||
'version' => 'nullable|integer|min:1',
|
||||
'is_default' => 'nullable|boolean',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'name.required' => 'Unit name is required.',
|
||||
'short_name.required' => 'Unit short name is required.',
|
||||
'type.required' => 'Unit type is required.',
|
||||
'type.in' => 'Unit type must be one of weight, volume, count, or length.',
|
||||
'base_unit_id.exists' => 'Selected base unit does not exist.',
|
||||
'operator.in' => 'Operator must be * or /.',
|
||||
'operator_value.numeric' => 'Operator value must be a number.',
|
||||
'status.in' => 'Status must be 0 (inactive) or 1 (active).',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Unit;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UnitUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'short_name' => 'required|string|max:50',
|
||||
'type' => 'required|in:weight,volume,count,length',
|
||||
'base_unit_id' => 'nullable|integer|exists:units,id',
|
||||
'operator' => 'nullable|in:*,/',
|
||||
'operator_value' => 'nullable|numeric|min:0',
|
||||
'priority' => 'nullable|integer|min:0',
|
||||
'version' => 'nullable|integer|min:1',
|
||||
'is_default' => 'nullable|boolean',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'name.required' => 'Unit name is required.',
|
||||
'short_name.required' => 'Unit short name is required.',
|
||||
'type.required' => 'Unit type is required.',
|
||||
'type.in' => 'Unit type must be one of weight, volume, count, or length.',
|
||||
'base_unit_id.exists' => 'Selected base unit does not exist.',
|
||||
'operator.in' => 'Operator must be * or /.',
|
||||
'operator_value.numeric' => 'Operator value must be a number.',
|
||||
'status.in' => 'Status must be 0 (inactive) or 1 (active).',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Zone;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ZoneStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// validation rules
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Restaurant\Http\Requests\Zone;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ZoneUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
// validation rules
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user