All checks were successful
Build frontend / build (push) Successful in 57s
- Add separate enum files: BuildingType, PropertyStatus, BookingStatus, CommissionType, IdentityType, UserRole, City, LoginMethod, OwnerType, CustomerType - Add AuthService (addToken/getToken/deleteToken) - Update api.js: use AuthService, add Owner/Add and Customer/Add endpoints - Update login page to use AuthService for token storage - Rewrite owner register: 3-step flow with OwnerType dropdown, backend integration, OTP verification - Rewrite tenant register: 2-step flow with CustomerType dropdown, backend integration, OTP verification - Update homepage and property detail to use enums instead of hardcoded maps - Update AddPropertyForm to import from enums directly - Add console logs and status toasts linked to API response messages
34 lines
867 B
JavaScript
34 lines
867 B
JavaScript
/**
|
|
* BuildingType Enum
|
|
* Backend values are numeric (0, 1, 2)
|
|
* Used in: PropertyInformation.buildingType
|
|
*/
|
|
const BuildingType = Object.freeze({
|
|
APARTMENT: 0,
|
|
VILLA: 1,
|
|
HOUSE: 2,
|
|
});
|
|
|
|
// Map numeric value → Arabic label
|
|
const BuildingTypeLabels = Object.freeze({
|
|
[BuildingType.APARTMENT]: 'شقة',
|
|
[BuildingType.VILLA]: 'فيلا',
|
|
[BuildingType.HOUSE]: 'بيت',
|
|
});
|
|
|
|
// Map numeric value → English key (for UI filters)
|
|
const BuildingTypeKeys = Object.freeze({
|
|
[BuildingType.APARTMENT]: 'apartment',
|
|
[BuildingType.VILLA]: 'villa',
|
|
[BuildingType.HOUSE]: 'house',
|
|
});
|
|
|
|
// Reverse map: English key → numeric value
|
|
const BuildingTypeByKey = Object.freeze({
|
|
apartment: BuildingType.APARTMENT,
|
|
villa: BuildingType.VILLA,
|
|
house: BuildingType.HOUSE,
|
|
});
|
|
|
|
export { BuildingType, BuildingTypeLabels, BuildingTypeKeys, BuildingTypeByKey };
|