39 lines
1.2 KiB
JavaScript
39 lines
1.2 KiB
JavaScript
|
|
/**
|
||
|
|
* BookingStatus Enum
|
||
|
|
* Backend values are strings
|
||
|
|
* Used in: Reservation workflow
|
||
|
|
*/
|
||
|
|
const BookingStatus = Object.freeze({
|
||
|
|
PENDING: 'pending',
|
||
|
|
OWNER_APPROVED: 'owner_approved',
|
||
|
|
ADMIN_APPROVED: 'admin_approved',
|
||
|
|
ACTIVE: 'active',
|
||
|
|
COMPLETED: 'completed',
|
||
|
|
REJECTED: 'rejected',
|
||
|
|
CANCELLED: 'cancelled',
|
||
|
|
});
|
||
|
|
|
||
|
|
// Map status → Arabic label
|
||
|
|
const BookingStatusLabels = Object.freeze({
|
||
|
|
[BookingStatus.PENDING]: 'بانتظار الموافقة',
|
||
|
|
[BookingStatus.OWNER_APPROVED]: 'موافقة المالك',
|
||
|
|
[BookingStatus.ADMIN_APPROVED]: 'موافقة الإدارة',
|
||
|
|
[BookingStatus.ACTIVE]: 'إيجار نشط',
|
||
|
|
[BookingStatus.COMPLETED]: 'منتهي',
|
||
|
|
[BookingStatus.REJECTED]: 'مرفوض',
|
||
|
|
[BookingStatus.CANCELLED]: 'ملغي',
|
||
|
|
});
|
||
|
|
|
||
|
|
// Map status → color class (Tailwind bg)
|
||
|
|
const BookingStatusColors = Object.freeze({
|
||
|
|
[BookingStatus.PENDING]: 'yellow',
|
||
|
|
[BookingStatus.OWNER_APPROVED]: 'blue',
|
||
|
|
[BookingStatus.ADMIN_APPROVED]: 'green',
|
||
|
|
[BookingStatus.ACTIVE]: 'purple',
|
||
|
|
[BookingStatus.COMPLETED]: 'gray',
|
||
|
|
[BookingStatus.REJECTED]: 'red',
|
||
|
|
[BookingStatus.CANCELLED]: 'red',
|
||
|
|
});
|
||
|
|
|
||
|
|
export { BookingStatus, BookingStatusLabels, BookingStatusColors };
|