migrate to gtea from bistbucket
This commit is contained in:
117
public/restaurant/app/Enum/ActionStatus.php
Normal file
117
public/restaurant/app/Enum/ActionStatus.php
Normal file
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enum;
|
||||
|
||||
enum ActionStatus: string
|
||||
{
|
||||
case Create = 'create';
|
||||
case Update = 'update';
|
||||
case View = 'view';
|
||||
case Delete = 'delete';
|
||||
|
||||
case OrderCreate = 'order_create';
|
||||
case OrderUpdate = 'order_update';
|
||||
case OrderCancel = 'order_cancel';
|
||||
case OrderStatusUpdate = 'order_status_update';
|
||||
|
||||
case PaymentSuccess = 'payment_success';
|
||||
case PaymentFailed = 'payment_failed';
|
||||
case RefundIssued = 'refund_issued';
|
||||
|
||||
case KitchenAccept = 'kitchen_accept';
|
||||
case KitchenPreparing = 'kitchen_preparing';
|
||||
case KitchenReady = 'kitchen_ready';
|
||||
case KitchenServed = 'kitchen_served';
|
||||
|
||||
case PrintReceipt = 'print_receipt';
|
||||
case ReportGenerate = 'report_generate';
|
||||
|
||||
case Login = 'login';
|
||||
case Logout = 'logout';
|
||||
|
||||
case StatusChange = 'status_change'; // generic status updates
|
||||
|
||||
// Optional constants
|
||||
public const CREATE = 'create';
|
||||
|
||||
public const UPDATE = 'update';
|
||||
|
||||
public const VIEW = 'view';
|
||||
|
||||
public const DELETE = 'delete';
|
||||
|
||||
public const ORDER_CREATE = 'order_create';
|
||||
|
||||
public const ORDER_UPDATE = 'order_update';
|
||||
|
||||
public const ORDER_CANCEL = 'order_cancel';
|
||||
|
||||
public const ORDER_STATUS_UPDATE = 'order_status_update';
|
||||
|
||||
public const PAYMENT_SUCCESS = 'payment_success';
|
||||
|
||||
public const PAYMENT_FAILED = 'payment_failed';
|
||||
|
||||
public const REFUND_ISSUED = 'refund_issued';
|
||||
|
||||
public const KITCHEN_ACCEPT = 'kitchen_accept';
|
||||
|
||||
public const KITCHEN_PREPARING = 'kitchen_preparing';
|
||||
|
||||
public const KITCHEN_READY = 'kitchen_ready';
|
||||
|
||||
public const KITCHEN_SERVED = 'kitchen_served';
|
||||
|
||||
public const PRINT_RECEIPT = 'print_receipt';
|
||||
|
||||
public const REPORT_GENERATE = 'report_generate';
|
||||
|
||||
public const LOGIN = 'login';
|
||||
|
||||
public const LOGOUT = 'logout';
|
||||
|
||||
public const STATUS_CHANGE = 'status_change';
|
||||
|
||||
/**
|
||||
* Return all action values
|
||||
*/
|
||||
public static function values(): array
|
||||
{
|
||||
return array_column(self::cases(), 'value');
|
||||
}
|
||||
|
||||
/**
|
||||
* Human-friendly labels for UI
|
||||
*/
|
||||
public static function labels(): array
|
||||
{
|
||||
return [
|
||||
self::Create->value => 'Create',
|
||||
self::Update->value => 'Update',
|
||||
self::View->value => 'View',
|
||||
self::Delete->value => 'Delete',
|
||||
|
||||
self::OrderCreate->value => 'Order Created',
|
||||
self::OrderUpdate->value => 'Order Updated',
|
||||
self::OrderCancel->value => 'Order Cancelled',
|
||||
self::OrderStatusUpdate->value => 'Order Status Updated',
|
||||
|
||||
self::PaymentSuccess->value => 'Payment Success',
|
||||
self::PaymentFailed->value => 'Payment Failed',
|
||||
self::RefundIssued->value => 'Refund Issued',
|
||||
|
||||
self::KitchenAccept->value => 'Kitchen Accepted',
|
||||
self::KitchenPreparing->value => 'Kitchen Preparing',
|
||||
self::KitchenReady->value => 'Kitchen Ready',
|
||||
self::KitchenServed->value => 'Kitchen Served',
|
||||
|
||||
self::PrintReceipt->value => 'Receipt Printed',
|
||||
self::ReportGenerate->value => 'Report Generated',
|
||||
|
||||
self::Login->value => 'Login',
|
||||
self::Logout->value => 'Logout',
|
||||
|
||||
self::StatusChange->value => 'Status Changed',
|
||||
];
|
||||
}
|
||||
}
|
||||
73
public/restaurant/app/Enum/OrderStatus.php
Normal file
73
public/restaurant/app/Enum/OrderStatus.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enum;
|
||||
|
||||
enum OrderStatus: string
|
||||
{
|
||||
case Pending = 'pending';
|
||||
case Confirmed = 'confirmed';
|
||||
case Preparing = 'preparing';
|
||||
case Ready = 'ready';
|
||||
case Served = 'served';
|
||||
case OutForDelivery = 'out_for_delivery';
|
||||
case Completed = 'completed';
|
||||
case Cancelled = 'cancelled';
|
||||
case Refunded = 'refunded';
|
||||
case Online = 'online';
|
||||
case QrOrder = 'qr_order';
|
||||
case TodayOrder = 'today_order';
|
||||
|
||||
// Optional: static constants for non-enum usage
|
||||
public const PENDING = 'pending';
|
||||
|
||||
public const CONFIRMED = 'confirmed';
|
||||
|
||||
public const PREPARING = 'preparing';
|
||||
|
||||
public const READY = 'ready';
|
||||
|
||||
public const SERVED = 'served';
|
||||
|
||||
public const OUT_FOR_DELIVERY = 'out_for_delivery';
|
||||
|
||||
public const COMPLETED = 'completed';
|
||||
|
||||
public const CANCELLED = 'cancelled';
|
||||
|
||||
public const REFUNDED = 'refunded';
|
||||
|
||||
public const ONLINE = 'online';
|
||||
|
||||
public const QR_ORDER = 'qr_order';
|
||||
|
||||
public const TODAY_ORDER = 'today_order';
|
||||
|
||||
/**
|
||||
* Get all status values as array
|
||||
*/
|
||||
public static function values(): array
|
||||
{
|
||||
return array_column(self::cases(), 'value');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display labels for UI
|
||||
*/
|
||||
public static function labels(): array
|
||||
{
|
||||
return [
|
||||
self::Pending->value => 'Pending',
|
||||
self::Confirmed->value => 'Confirmed',
|
||||
self::Preparing->value => 'Preparing',
|
||||
self::Ready->value => 'Ready',
|
||||
self::Served->value => 'Served',
|
||||
self::OutForDelivery->value => 'Out For Delivery',
|
||||
self::Completed->value => 'Completed',
|
||||
self::Cancelled->value => 'Cancelled',
|
||||
self::Refunded->value => 'Refunded',
|
||||
self::Online->value => 'Online',
|
||||
self::QrOrder->value => 'QR Order',
|
||||
self::TodayOrder->value => 'Today Order',
|
||||
];
|
||||
}
|
||||
}
|
||||
45
public/restaurant/app/Enum/OrderType.php
Normal file
45
public/restaurant/app/Enum/OrderType.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enum;
|
||||
|
||||
enum OrderType: string
|
||||
{
|
||||
case DineIn = 'dine_in';
|
||||
case Takeaway = 'takeaway';
|
||||
case Delivery = 'delivery';
|
||||
case DriveThru = 'drive_thru';
|
||||
case Curbside = 'curbside';
|
||||
|
||||
// Optional: constants for non-enum usage
|
||||
public const DINE_IN = 'dine_in';
|
||||
|
||||
public const TAKEAWAY = 'takeaway';
|
||||
|
||||
public const DELIVERY = 'delivery';
|
||||
|
||||
public const DRIVE_THRU = 'drive_thru';
|
||||
|
||||
public const CURBSIDE = 'curbside';
|
||||
|
||||
/**
|
||||
* Get all order type values as array.
|
||||
*/
|
||||
public static function values(): array
|
||||
{
|
||||
return array_column(self::cases(), 'value');
|
||||
}
|
||||
|
||||
/**
|
||||
* Labels for UI.
|
||||
*/
|
||||
public static function labels(): array
|
||||
{
|
||||
return [
|
||||
self::DineIn->value => 'Dine In',
|
||||
self::Takeaway->value => 'Takeaway',
|
||||
self::Delivery->value => 'Delivery',
|
||||
self::DriveThru->value => 'Drive Thru',
|
||||
self::Curbside->value => 'Curbside',
|
||||
];
|
||||
}
|
||||
}
|
||||
49
public/restaurant/app/Enum/TrackingStatus.php
Normal file
49
public/restaurant/app/Enum/TrackingStatus.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enum;
|
||||
|
||||
enum TrackingStatus: string
|
||||
{
|
||||
case Placed = 'placed';
|
||||
case Accepted = 'accepted';
|
||||
case Preparing = 'preparing';
|
||||
case Dispatched = 'dispatched';
|
||||
case Delivered = 'delivered';
|
||||
case Cancelled = 'cancelled';
|
||||
|
||||
// Optional constants
|
||||
public const PLACED = 'placed';
|
||||
|
||||
public const ACCEPTED = 'accepted';
|
||||
|
||||
public const PREPARING = 'preparing';
|
||||
|
||||
public const DISPATCHED = 'dispatched';
|
||||
|
||||
public const DELIVERED = 'delivered';
|
||||
|
||||
public const CANCELLED = 'cancelled';
|
||||
|
||||
/**
|
||||
* Get all enum values
|
||||
*/
|
||||
public static function values(): array
|
||||
{
|
||||
return array_column(self::cases(), 'value');
|
||||
}
|
||||
|
||||
/**
|
||||
* UI Labels
|
||||
*/
|
||||
public static function labels(): array
|
||||
{
|
||||
return [
|
||||
self::Placed->value => 'Placed',
|
||||
self::Accepted->value => 'Accepted',
|
||||
self::Preparing->value => 'Preparing',
|
||||
self::Dispatched->value => 'Dispatched',
|
||||
self::Delivered->value => 'Delivered',
|
||||
self::Cancelled->value => 'Cancelled',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user