Add enums, AuthService, and integrate backend registration endpoints
- 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
2026-03-27 18:01:42 +00:00
|
|
|
/**
|
|
|
|
|
* PropertyStatus Enum
|
|
|
|
|
* Backend values are numeric (0, 1, 2)
|
|
|
|
|
* Used in: PropertyInformation.status
|
|
|
|
|
*/
|
|
|
|
|
const PropertyStatus = Object.freeze({
|
|
|
|
|
AVAILABLE: 0,
|
2026-05-25 21:27:39 +03:00
|
|
|
NOT_AVAILABLE: 1,
|
|
|
|
|
BOOKED: 2,
|
Add enums, AuthService, and integrate backend registration endpoints
- 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
2026-03-27 18:01:42 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const PropertyStatusLabels = Object.freeze({
|
|
|
|
|
[PropertyStatus.AVAILABLE]: 'متاح',
|
2026-05-25 21:27:39 +03:00
|
|
|
[PropertyStatus.NOT_AVAILABLE]: 'غير متاح',
|
Add enums, AuthService, and integrate backend registration endpoints
- 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
2026-03-27 18:01:42 +00:00
|
|
|
[PropertyStatus.BOOKED]: 'محجوز',
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const PropertyStatusKeys = Object.freeze({
|
|
|
|
|
[PropertyStatus.AVAILABLE]: 'available',
|
2026-05-25 21:27:39 +03:00
|
|
|
[PropertyStatus.NOT_AVAILABLE]: 'notAvailable',
|
Add enums, AuthService, and integrate backend registration endpoints
- 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
2026-03-27 18:01:42 +00:00
|
|
|
[PropertyStatus.BOOKED]: 'booked',
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const PropertyStatusByKey = Object.freeze({
|
|
|
|
|
available: PropertyStatus.AVAILABLE,
|
2026-05-25 21:27:39 +03:00
|
|
|
notAvailable: PropertyStatus.NOT_AVAILABLE,
|
Add enums, AuthService, and integrate backend registration endpoints
- 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
2026-03-27 18:01:42 +00:00
|
|
|
booked: PropertyStatus.BOOKED,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export { PropertyStatus, PropertyStatusLabels, PropertyStatusKeys, PropertyStatusByKey };
|