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
|
|
|
/**
|
|
|
|
|
* Constants — re-exports from enums for backward compatibility
|
|
|
|
|
*
|
|
|
|
|
* New code should import directly from:
|
|
|
|
|
* import { BuildingType, BookingStatus, City, ... } from '@/app/enums';
|
|
|
|
|
*
|
|
|
|
|
* Old imports from '@/app/utils/constants' continue to work.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// Re-export all enums
|
|
|
|
|
export {
|
|
|
|
|
BuildingType,
|
|
|
|
|
BuildingTypeLabels,
|
|
|
|
|
BuildingTypeKeys,
|
|
|
|
|
BuildingTypeByKey,
|
|
|
|
|
} from '../enums/BuildingType';
|
|
|
|
|
|
|
|
|
|
export {
|
|
|
|
|
PropertyStatus,
|
|
|
|
|
PropertyStatusLabels,
|
|
|
|
|
PropertyStatusKeys,
|
|
|
|
|
PropertyStatusByKey,
|
|
|
|
|
} from '../enums/PropertyStatus';
|
|
|
|
|
|
|
|
|
|
export {
|
|
|
|
|
BookingStatus,
|
|
|
|
|
BookingStatusLabels,
|
|
|
|
|
BookingStatusColors,
|
|
|
|
|
} from '../enums/BookingStatus';
|
|
|
|
|
|
|
|
|
|
export {
|
|
|
|
|
CommissionType,
|
|
|
|
|
CommissionTypeLabels,
|
|
|
|
|
} from '../enums/CommissionType';
|
|
|
|
|
|
|
|
|
|
export {
|
|
|
|
|
IdentityType,
|
|
|
|
|
IdentityTypeLabels,
|
|
|
|
|
IdentityTypeFlags,
|
|
|
|
|
} from '../enums/IdentityType';
|
|
|
|
|
|
|
|
|
|
export {
|
|
|
|
|
UserRole,
|
|
|
|
|
UserRoleLabels,
|
|
|
|
|
UserRoleColors,
|
|
|
|
|
} from '../enums/UserRole';
|
|
|
|
|
|
|
|
|
|
export {
|
|
|
|
|
City,
|
|
|
|
|
CitiesList,
|
|
|
|
|
extractCity,
|
|
|
|
|
} from '../enums/City';
|
|
|
|
|
|
|
|
|
|
export { LoginMethod } from '../enums/LoginMethod';
|
|
|
|
|
export { OwnerType, OwnerTypeLabels } from '../enums/OwnerType';
|
|
|
|
|
export { CustomerType, CustomerTypeLabels } from '../enums/CustomerType';
|
|
|
|
|
|
|
|
|
|
// ─── Legacy aliases (keep old imports working) ───
|
|
|
|
|
export const PROPERTY_STATUS = PropertyStatusKeys;
|
|
|
|
|
export const BOOKING_STATUS = BookingStatus;
|
|
|
|
|
export const COMMISSION_TYPE = CommissionType;
|
|
|
|
|
export const IDENTITY_TYPE = IdentityType;
|
|
|
|
|
export const CITIES = City;
|
|
|
|
|
|
|
|
|
|
// ─── Misc constants ───
|
|
|
|
|
export const PAYMENT_METHOD = Object.freeze({
|
2026-02-15 01:53:37 +03:00
|
|
|
CASH: 'cash',
|
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
|
|
|
ELECTRONIC: 'electronic',
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const DEFAULT_COMMISSION_RATE = 5;
|