Fix CustomerType and OwnerType enums: send int instead of string
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:
Claw AI
2026-03-28 14:15:40 +00:00
parent 9cddee841b
commit 6394f1d71a
12 changed files with 166 additions and 100 deletions

View File

@ -4,8 +4,8 @@
* Used in: Customer registration (Customer/Add)
*/
const CustomerType = Object.freeze({
PERSONAL: 'Personal',
FAMILY: 'Family',
PERSONAL: 0,
FAMILY: 1,
});
// Map value → Arabic label

View File

@ -4,8 +4,8 @@
* Used in: Owner registration (Owner/Add)
*/
const OwnerType = Object.freeze({
PERSON: 'peerson',
REAL_ESTATE_AGENCY: 'RealEstateAgency',
PERSON: 0,
REAL_ESTATE_AGENCY: 1,
});
// Map value → Arabic label

View File

@ -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',
});