27 lines
621 B
JavaScript
27 lines
621 B
JavaScript
|
|
/**
|
||
|
|
* UserRole Enum
|
||
|
|
* User account roles in the system
|
||
|
|
* Used in: JWT payload, registration, routing
|
||
|
|
*/
|
||
|
|
const UserRole = Object.freeze({
|
||
|
|
OWNER: 'owner',
|
||
|
|
TENANT: 'tenant',
|
||
|
|
ADMIN: 'admin',
|
||
|
|
});
|
||
|
|
|
||
|
|
// Map role → Arabic label
|
||
|
|
const UserRoleLabels = Object.freeze({
|
||
|
|
[UserRole.OWNER]: 'مالك عقار',
|
||
|
|
[UserRole.TENANT]: 'مستأجر',
|
||
|
|
[UserRole.ADMIN]: 'مدير النظام',
|
||
|
|
});
|
||
|
|
|
||
|
|
// Map role → color theme (used in UI)
|
||
|
|
const UserRoleColors = Object.freeze({
|
||
|
|
[UserRole.OWNER]: 'amber',
|
||
|
|
[UserRole.TENANT]: 'blue',
|
||
|
|
[UserRole.ADMIN]: 'red',
|
||
|
|
});
|
||
|
|
|
||
|
|
export { UserRole, UserRoleLabels, UserRoleColors };
|