Units Mutation
Create or update properties in Everreal
Mutation Types
Mutations are responsible to insert or update a specific register, the operation insert or update is defined by externalId
, in case this unit was imported previously, this mutation will updated the resource, otherwise will create the unit.
type Mutation {
upsertUnit(unit: UnitInput): Unit
deleteUnit(externalId: String): Boolean
}
Here are details on the capabilities of different mutations
The
upsertUnit
mutation is used to create or update a unit in Everreal system and unit added to the system cannot be modified by Everreal and if needs to be modified it should be done via the same endpoint itself.The
deleteUnit
mutation is used to delete the unit relation with the external integration source, doing this will not delete the unit but instead it will remain as a detached unit from integration and can be modified using Everreal.
Schema Definition
items with ! notation are required
input UnitInput {
externalUnitId: String! #externalId by which the unit will be identified
propertyId: String! #propertyId by which the unit will be attached to. You have to either pass propertyId or exteranalpropertyId
externalPropertyId: String! #externalPropertyId by which the unit will be attached to. You have t
ownerId: String! #ownerId by which the unit will be attached to. You have to either pass ownerId or exteranalOwnerId
externalOwnerId: String! #externalOwnerId by which the unit will be attached to. You have to either pass ownerId or exteranalOwnerId
category: UNIT_CATEGORY!
type: UNIT_TYPE!
name: String
subtype: UNIT_SUBTYPES!
netFloorSurface: Float
livingSurface: Float
rooms: UnitRoomsInput
mainStorage: Boolean!
floorNo: Int!
amenities: AmenitiesInput
descriptions: IUnitDescriptionInput
financingType: UNIT_FINANCING_TYPE!
targetRent: Float!
surcharges: Float
currentRent: Float
availableFrom: Date # date in YYYY-MM-DD fromat
onHoldStatus: Boolean
onHoldReason: UNIT_ON_HOLD_REASON
unitResponsibleId: String
meta: MetaInformation!
}
input UnitParkingTypeInput {
type: PARKING_TYPES
quantity: Int
}
input UnitRoomsInput {
rooms: Float
bathrooms: Float
bedrooms: Float
}
input IUnitDescriptionInput {
object: String
amenities: String
location: String
other: String
}
input MetaInformation {
source: String!
}
enum UNIT_ON_HOLD_REASON {
FIRST_TIME_USE
CONSTRUCTION_MEASURES
OCCUPANCY_RIGHT
INTERNAL_USE
RESERVED
OTHER
}
enum UNIT_FINANCING_TYPE {
PRIVATELY_FINANCED
PUBLICLY_SUBSIDIZED
}
enum AMENITIES_INCLUDED {
BUILTIN_KITCHEN
ELEVATOR
GOODS_LIFT
BALCONY_OR_TERRACE
GUEST_TOILET
GARDEN
BASEMENT
STEPLESS_ENTRY
LIVING_QUALIFICATION_CERTIFICATE
SUITABLE_FOR_SHARED_APARTMENT
SUITABLE_FOR_HOLIDAY
CAFETERIA
HIGH_VOLTAGE
RAMP
HYDRAULIC_RAMP
TERRACE
HAS_CRANE_RUNWAY
}
input AmenitiesInput {
amenitiesIncluded: [AMENITIES_INCLUDED]
hasParking: Boolean
parking: UnitParkingType
qualityOfAmenities: QUALITY_OF_AMENITIES
condition: AMENITIES_CONDITION
lastRenovationYear: Int
heatingType: HEATING_TYPE
mainEnergySource: ENERGY_SOURCE_TYPE
energyPerformanceCertificateAvailability: ENERGY_PERFORMANCE_CERTIFICATE_AVAILABILITY
energyCertificateCreationDate: ENERGY_CERTIFICATE_CREATION_DATE
buildingEnergyRatingType: BUILDING_ENERGY_RATING_TYPE
thermalCharacteristic: Float
energyConsumptionContainsWarmWater: Boolean
energyEfficiencyClass: ENERGY_EFFICIENCY_CLASS
hasLanCables: YES_NO_BYAPPOINTMENT
hasAirConditioning: YES_NO_BYAPPOINTMENT
floorType: COMMERCIAL_UNIT_FLOORTYPE
goodsLiftLoad: Float
floorLoad: Float
supplyType: STORE_SUPPLY_TYPE
powerSupplyLoad: Float
craneRunwayLoad: Float
}
type Amenities {
amenitiesIncluded: [AMENITIES_INCLUDED]
hasParking: Boolean
parking: UnitParkingType
qualityOfAmenities: QUALITY_OF_AMENITIES
condition: AMENITIES_CONDITION
lastRenovationYear: Int
heatingType: HEATING_TYPE
mainEnergySource: ENERGY_SOURCE_TYPE
energyPerformanceCertificateAvailability: ENERGY_PERFORMANCE_CERTIFICATE_AVAILABILITY
energyCertificateCreationDate: ENERGY_CERTIFICATE_CREATION_DATE
buildingEnergyRatingType: BUILDING_ENERGY_RATING_TYPE
thermalCharacteristic: Float
energyConsumptionContainsWarmWater: Boolean
energyEfficiencyClass: ENERGY_EFFICIENCY_CLASS
hasLanCables: YES_NO_BYAPPOINTMENT
hasAirConditioning: YES_NO_BYAPPOINTMENT
floorType: COMMERCIAL_UNIT_FLOORTYPE
goodsLiftLoad: Float
floorLoad: Float
supplyType: STORE_SUPPLY_TYPE
powerSupplyLoad: Float
craneRunwayLoad: Float
}
enum STORE_SUPPLY_TYPE {
DIRECT_APPROACH
NO_DIRECT_APPROACH
CAR_APPROACH
APPROACH_TO_THE_FRONT
APPROACH_TO_THE_BACK
FULL_TIME
FORENOON
NO_INFORMATION
}
enum ENERGY_SOURCE_TYPE {
NO_INFORMATION
GEOTHERMAL
SOLAR_HEATING
PELLET_HEATING
GAS
OIL
DISTRICT_HEATING
ELECTRICITY
COAL
ACID_GAS
SOUR_GAS
LIQUID_GAS
STEAM_DISTRICT_HEATING
WOOD
WOOD_CHIPS
COAL_COKE
LOCAL_HEATING
HEAT_SUPPLY
BIO_ENERGY
HYDRO_ENERGY
ENVIRONMENTAL_THERMAL_ENERGY
COMBINED_HEAT_AND_POWER_FOSSIL_FUELS
COMBINED_HEAT_AND_POWER_RENEWABLE_ENERGY
COMBINED_HEAT_AND_POWER_REGENERATIVE_ENERGY
COMBINED_HEAT_AND_POWER_BIO_ENERGY
}
enum PARKING_TYPES {
GARAGE
OUTSIDE_PARKING_SPOT
CARPORT
DUPLEX
PARKING_GARAGE
UNDERGROUND_PARKING
NO_INFORMATION
}
enum HEATING_TYPE {
BLOCK_HEATING_STATION
ELECTRIC_HEATING
SELF_CONTAINED_CENTRAL_HEATING
TELEHEATING
FLOOR_HEATING
GAS_HEATING
WOOD_PELLET_HEATER
NIGHT_STORAGE_HEATER
STOVE_HEATING
OIL_HEATING
SOLAR_HEATING
HEAT_PUMP
CENTRAL_HEATING
}
enum QUALITY_OF_AMENITIES {
LUXURIOUS
UPSCALE
NORMAL
BASIC
}
Enum table maps
Field sub_type
use the following table
Other enum fields
Below we are providing a full example how to create or update a unit, all this information is not required, only the ones that was using ! notation previously.
mutation {
upsertUnit(
unit: {
meta: { source: "INTEGRATION_TYPE" }
name: "Appartmert"
externalUnitId: "910011000009"
propertyId: "b7ecfa0c-6dfc-4236-abac-0a92d90ce032"
externalOwnerId: "2255"
category: RESIDENTIAL
type: APARTMENT
subtype: APARTMENT
rooms: {
bedrooms: 0
rooms: 4
}
amenities:{
condition: FULLY_RENOVATED
lastRenovationYear: 2012
qualityOfAmenities: LUXURIOUS,
energyConsumptionContainsWarmWater: true
energyEfficiencyClass: A_PLUS
energyCertificateCreationDate: FROM_01_MAY_2014
hasLanCables: YES
}
descriptions: {
object: "Property Group 01: child-rich parts of the city.ss",
amenities: "Property Group 01: Completely furnished with high-quality custom-made fittings",
location: "Property Group 01: Langenhagen The city of Langenhagen connects directly to the settlement area of Hanover in the north.",
other: "Property Group 01: See more Infosys at www.myclimate.org and in Kundenportal."
}
}
) {
id
}
}
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer ....");
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Cookie", "accept-language=de-DE");
var graphql = JSON.stringify({
query: "\r\nmutation {\r\n upsertUnit(\r\n unit: {\r\n meta: { source: \"INTEGRATION_TYPE\" }\r\n name: \"Appartmert\"\r\n externalUnitId: \"910011000009\"\r\n propertyId: \"b7ecfa0c-6dfc-4236-abac-0a92d90ce032\"\r\n externalOwnerId: \"2255\"\r\n category: RESIDENTIAL\r\n type: APARTMENT\r\n subtype: APARTMENT\r\n rooms: {\r\n bedrooms: 0\r\n rooms: 4\r\n }\r\n amenities:{\r\n condition: FULLY_RENOVATED\r\n lastRenovationYear: 2012\r\n qualityOfAmenities: \"LUXURIOUS\",\r\n energyConsumptionContainsWarmWater: true\r\n energyEfficiencyClass: A_PLUS\r\n energyCertificateCreationDate: FROM_01_MAY_2014\r\n hasLanCables: YES\r\n }\r\n descriptions: {\r\n object: \"Property Group 01: child-rich parts of the city.ss\",\r\n amenities: \"Property Group 01: Completely furnished with high-quality custom-made fittings\",\r\n location: \"Property Group 01: Langenhagen The city of Langenhagen connects directly to the settlement area of Hanover in the north.\",\r\n other: \"Property Group 01: See more Infosys at www.myclimate.org and in Kundenportal.\"\r\n }\r\n }\r\n ) {\r\n id\r\n }\r\n}",
variables: {}
})
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: graphql,
redirect: 'follow'
};
fetch("https://acme-qa.everreal.co/api/reporting/graphql", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
Last updated