Add new enums to match Flutter project structure
All checks were successful
Build frontend / build (push) Successful in 39s
All checks were successful
Build frontend / build (push) Successful in 39s
- Add RentPropertyCondition (WithFurniture/WithoutFurniture) - Add RentPropertyType (Furnished/Unfurnished/SemiFurnished) - Add RentType (Monthly/Daily) - Add PropertyService (13 services for detailsJSON) - Add PropertyTerm (NoSmoking/NoAnimals/NoParties) - Add Currency (SYP/USD) - Update enums barrel file
This commit is contained in:
20
app/enums/Currency.js
Normal file
20
app/enums/Currency.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
/**
|
||||||
|
* Currency Enum
|
||||||
|
* Currency IDs used in the backend
|
||||||
|
*/
|
||||||
|
const Currency = Object.freeze({
|
||||||
|
SYP: 1,
|
||||||
|
USD: 2,
|
||||||
|
});
|
||||||
|
|
||||||
|
const CurrencyLabels = Object.freeze({
|
||||||
|
[Currency.SYP]: 'ليرة سورية',
|
||||||
|
[Currency.USD]: 'دولار أمريكي',
|
||||||
|
});
|
||||||
|
|
||||||
|
const CurrencySymbols = Object.freeze({
|
||||||
|
[Currency.SYP]: 'SYP',
|
||||||
|
[Currency.USD]: 'USD',
|
||||||
|
});
|
||||||
|
|
||||||
|
export { Currency, CurrencyLabels, CurrencySymbols };
|
||||||
41
app/enums/PropertyService.js
Normal file
41
app/enums/PropertyService.js
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
/**
|
||||||
|
* PropertyService Enum
|
||||||
|
* Services available at the property
|
||||||
|
* Used in detailsJSON.services array
|
||||||
|
*/
|
||||||
|
const PropertyService = Object.freeze({
|
||||||
|
ELECTRICITY: 'Electricity',
|
||||||
|
INTERNET: 'Internet',
|
||||||
|
HEATING: 'Heating',
|
||||||
|
WATER: 'Water',
|
||||||
|
POOL: 'Pool',
|
||||||
|
PRIVATE_GARDEN: 'PrivateGarden',
|
||||||
|
PARKING: 'Parking',
|
||||||
|
SECURITY_247: 'Security247',
|
||||||
|
CENTRAL_HEATING: 'CentralHeating',
|
||||||
|
CENTRAL_AIR_CONDITIONING: 'CentralAirConditioning',
|
||||||
|
EQUIPPED_KITCHEN: 'EquippedKitchen',
|
||||||
|
MAIDS_ROOM: 'MaidsRoom',
|
||||||
|
ELEVATOR: 'Elevator',
|
||||||
|
});
|
||||||
|
|
||||||
|
const PropertyServiceLabels = Object.freeze({
|
||||||
|
[PropertyService.ELECTRICITY]: 'كهرباء',
|
||||||
|
[PropertyService.INTERNET]: 'إنترنت',
|
||||||
|
[PropertyService.HEATING]: 'تدفئة',
|
||||||
|
[PropertyService.WATER]: 'ماء',
|
||||||
|
[PropertyService.POOL]: 'مسبح',
|
||||||
|
[PropertyService.PRIVATE_GARDEN]: 'حديقة خاصة',
|
||||||
|
[PropertyService.PARKING]: 'موقف سيارات',
|
||||||
|
[PropertyService.SECURITY_247]: 'حراسة 24 ساعة',
|
||||||
|
[PropertyService.CENTRAL_HEATING]: 'تدفئة مركزية',
|
||||||
|
[PropertyService.CENTRAL_AIR_CONDITIONING]: 'تكييف مركزي',
|
||||||
|
[PropertyService.EQUIPPED_KITCHEN]: 'مطبخ مجهز',
|
||||||
|
[PropertyService.MAIDS_ROOM]: 'غرفة خادمة',
|
||||||
|
[PropertyService.ELEVATOR]: 'مصعد',
|
||||||
|
});
|
||||||
|
|
||||||
|
// All services as array
|
||||||
|
const PropertyServicesList = Object.freeze(Object.values(PropertyService));
|
||||||
|
|
||||||
|
export { PropertyService, PropertyServiceLabels, PropertyServicesList };
|
||||||
21
app/enums/PropertyTerm.js
Normal file
21
app/enums/PropertyTerm.js
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
/**
|
||||||
|
* PropertyTerm Enum
|
||||||
|
* Usage terms/conditions for the property
|
||||||
|
* Used in detailsJSON.terms array
|
||||||
|
*/
|
||||||
|
const PropertyTerm = Object.freeze({
|
||||||
|
NO_SMOKING: 'NoSmoking',
|
||||||
|
NO_ANIMALS: 'NoAnimals',
|
||||||
|
NO_PARTIES: 'NoParties',
|
||||||
|
});
|
||||||
|
|
||||||
|
const PropertyTermLabels = Object.freeze({
|
||||||
|
[PropertyTerm.NO_SMOKING]: 'ممنوع التدخين',
|
||||||
|
[PropertyTerm.NO_ANIMALS]: 'ممنوع الحيوانات',
|
||||||
|
[PropertyTerm.NO_PARTIES]: 'ممنوع الحفلات',
|
||||||
|
});
|
||||||
|
|
||||||
|
// All terms as array
|
||||||
|
const PropertyTermsList = Object.freeze(Object.values(PropertyTerm));
|
||||||
|
|
||||||
|
export { PropertyTerm, PropertyTermLabels, PropertyTermsList };
|
||||||
16
app/enums/RentPropertyCondition.js
Normal file
16
app/enums/RentPropertyCondition.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/**
|
||||||
|
* RentPropertyCondition Enum
|
||||||
|
* Furniture condition of the property
|
||||||
|
* Sent as `propertyType` field in API
|
||||||
|
*/
|
||||||
|
const RentPropertyCondition = Object.freeze({
|
||||||
|
WITH_FURNITURE: 0,
|
||||||
|
WITHOUT_FURNITURE: 1,
|
||||||
|
});
|
||||||
|
|
||||||
|
const RentPropertyConditionLabels = Object.freeze({
|
||||||
|
[RentPropertyCondition.WITH_FURNITURE]: 'مفروش',
|
||||||
|
[RentPropertyCondition.WITHOUT_FURNITURE]: 'غير مفروش',
|
||||||
|
});
|
||||||
|
|
||||||
|
export { RentPropertyCondition, RentPropertyConditionLabels };
|
||||||
17
app/enums/RentPropertyType.js
Normal file
17
app/enums/RentPropertyType.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/**
|
||||||
|
* RentPropertyType Enum
|
||||||
|
* Sent as `type` field in RentPropertyDto
|
||||||
|
*/
|
||||||
|
const RentPropertyType = Object.freeze({
|
||||||
|
FURNISHED: 0,
|
||||||
|
UNFURNISHED: 1,
|
||||||
|
SEMI_FURNISHED: 2,
|
||||||
|
});
|
||||||
|
|
||||||
|
const RentPropertyTypeLabels = Object.freeze({
|
||||||
|
[RentPropertyType.FURNISHED]: 'مفروش بالكامل',
|
||||||
|
[RentPropertyType.UNFURNISHED]: 'غير مفروش',
|
||||||
|
[RentPropertyType.SEMI_FURNISHED]: 'مفروش جزئياً',
|
||||||
|
});
|
||||||
|
|
||||||
|
export { RentPropertyType, RentPropertyTypeLabels };
|
||||||
16
app/enums/RentType.js
Normal file
16
app/enums/RentType.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/**
|
||||||
|
* RentType Enum
|
||||||
|
* Rental period type
|
||||||
|
* Sent as `rentType` field in API
|
||||||
|
*/
|
||||||
|
const RentType = Object.freeze({
|
||||||
|
MONTHLY: 0,
|
||||||
|
DAILY: 1,
|
||||||
|
});
|
||||||
|
|
||||||
|
const RentTypeLabels = Object.freeze({
|
||||||
|
[RentType.MONTHLY]: 'شهري',
|
||||||
|
[RentType.DAILY]: 'يومي',
|
||||||
|
});
|
||||||
|
|
||||||
|
export { RentType, RentTypeLabels };
|
||||||
@ -13,3 +13,9 @@ export { City, CitiesList, extractCity } from './City';
|
|||||||
export { LoginMethod } from './LoginMethod';
|
export { LoginMethod } from './LoginMethod';
|
||||||
export { OwnerType, OwnerTypeLabels } from './OwnerType';
|
export { OwnerType, OwnerTypeLabels } from './OwnerType';
|
||||||
export { CustomerType, CustomerTypeLabels } from './CustomerType';
|
export { CustomerType, CustomerTypeLabels } from './CustomerType';
|
||||||
|
export { RentPropertyCondition, RentPropertyConditionLabels } from './RentPropertyCondition';
|
||||||
|
export { RentPropertyType, RentPropertyTypeLabels } from './RentPropertyType';
|
||||||
|
export { RentType, RentTypeLabels } from './RentType';
|
||||||
|
export { PropertyService, PropertyServiceLabels, PropertyServicesList } from './PropertyService';
|
||||||
|
export { PropertyTerm, PropertyTermLabels, PropertyTermsList } from './PropertyTerm';
|
||||||
|
export { Currency, CurrencyLabels, CurrencySymbols } from './Currency';
|
||||||
|
|||||||
Reference in New Issue
Block a user