Fix CustomerType and OwnerType enums: send int instead of string
Some checks failed
Build frontend / build (push) Failing after 45s
Some checks failed
Build frontend / build (push) Failing after 45s
- CustomerType: PERSONAL=0, FAMILY=1 (was 'Personal', 'Family') - OwnerType: PERSON=0, REAL_ESTATE_AGENCY=1 (was 'peerson', 'RealEstateAgency') - Backend Type column is int(11), sending strings caused 415 errors
This commit is contained in:
@ -1,25 +1,26 @@
|
||||
/**
|
||||
* UserRole Enum
|
||||
* User account roles in the system
|
||||
* Used in: JWT payload, registration, routing
|
||||
* Derived from JWT token claims
|
||||
*/
|
||||
const UserRole = Object.freeze({
|
||||
GUEST: 'guest',
|
||||
CUSTOMER: 'customer',
|
||||
OWNER: 'owner',
|
||||
TENANT: 'tenant',
|
||||
ADMIN: 'admin',
|
||||
});
|
||||
|
||||
// Map role → Arabic label
|
||||
const UserRoleLabels = Object.freeze({
|
||||
[UserRole.GUEST]: 'زائر',
|
||||
[UserRole.CUSTOMER]: 'مستأجر',
|
||||
[UserRole.OWNER]: 'مالك عقار',
|
||||
[UserRole.TENANT]: 'مستأجر',
|
||||
[UserRole.ADMIN]: 'مدير النظام',
|
||||
});
|
||||
|
||||
// Map role → color theme (used in UI)
|
||||
const UserRoleColors = Object.freeze({
|
||||
[UserRole.GUEST]: 'gray',
|
||||
[UserRole.CUSTOMER]: 'blue',
|
||||
[UserRole.OWNER]: 'amber',
|
||||
[UserRole.TENANT]: 'blue',
|
||||
[UserRole.ADMIN]: 'red',
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user