/*
openimmo.mjs - A library providing OpenImmo-like JSON objects.
(C) 2017-2020 HOMEINFO - Digitale Informationssysteme GmbH
All rights reserved.
OpenImmo™ is a trademark by OpenImmo e.V. .
Maintainer: Richard Neumann
*/
"use strict";
/*
Constructor for a real esate object.
*/
export class Immobilie {
constructor (
/* Mandatory arguments. */
objektkategorie, geo, kontaktperson, verwaltung_techn,
/* Optional arguments. */
preise, bieterverfahren, versteigerung, flaechen,
ausstattung, zustand_angaben, bewertung, infrastruktur,
freitexte, verwaltung_objekt, barrier_freeness) {
if (objektkategorie == null)
throw 'No objektkategorie specified.';
this.objektkategorie = objektkategorie;
if (geo == null)
throw 'No geo specified.';
this.geo = geo;
if (kontaktperson == null)
throw 'No kontaktperson specified.';
this.kontaktperson = kontaktperson;
if (verwaltung_techn == null)
throw 'No verwaltung_techn specified.';
this.verwaltung_techn = verwaltung_techn;
if (preise != null)
this.preise = preise;
if (bieterverfahren != null)
this.bieterverfahren = bieterverfahren;
if (versteigerung != null)
this.versteigerung = versteigerung;
if (flaechen != null)
this.flaechen = flaechen;
if (ausstattung != null)
this.ausstattung = ausstattung;
if (zustand_angaben != null)
this.zustand_angaben = zustand_angaben;
if (bewertung != null)
this.bewertung = bewertung;
if (infrastruktur != null)
this.infrastruktur = infrastruktur;
if (freitexte != null)
this.freitexte = freitexte;
if (verwaltung_objekt != null)
this.verwaltung_objekt = verwaltung_objekt;
if (barrier_freeness != null)
this.barrier_freeness = barrier_freeness;
}
}
/*
Constructor for an object category.
*/
export class Objektkategorie {
constructor (nutzungsart, objektart, vermarktungsart) {
if (nutzungsart == null)
throw 'No nutzungsart specified.';
this.nutzungsart = nutzungsart;
if (objektart == null)
throw 'No objektart specified.';
this.objektart = objektart;
if (vermarktungsart == null)
throw 'No vermarktungsart specified.';
this.vermarktungsart = vermarktungsart;
}
}
/*
Constructor for usage type.
*/
export class Nutzungsart {
constructor (WOHNEN, GEWERBE, ANLAGE, WAZ) {
if (WOHNEN != null)
this.WOHNEN = true ? WOHNEN : false;
if (GEWERBE != null)
this.GEWERBE = true ? GEWERBE : false;
if (ANLAGE != null)
this.ANLAGE = true ? ANLAGE : false;
if (WAZ != null)
this.WAZ = true ? WAZ : false;
}
}
/*
Constructor for object type.
*/
export class Objektart {
constructor (
zimmer, wohnung, haus, grundstueck, buero_praxen, einzelhandel,
gastgewerbe, hallen_lager_prod, land_und_forstwirtschaft, parken,
sonstige, freizeitimmobilie_gewerblich, zinshaus_renditeobjekt) {
if (zimmer != null) {
if (zimmer instanceof Array)
this.zimmer = zimmer;
else
this.zimmer = [zimmer];
}
if (wohnung != null) {
if (wohnung instanceof Array)
this.wohnung = wohnung;
else
this.wohnung = [wohnung];
}
if (haus != null) {
if (haus instanceof Array)
this.haus = haus;
else
this.haus = [haus];
}
if (grundstueck != null) {
if (grundstueck instanceof Array)
this.grundstueck = grundstueck;
else
this.grundstueck = [grundstueck];
}
if (buero_praxen != null) {
if (buero_praxen instanceof Array)
this.buero_praxen = buero_praxen;
else
this.buero_praxen = [buero_praxen];
}
if (einzelhandel != null) {
if (einzelhandel instanceof Array)
this.einzelhandel = einzelhandel;
else
this.einzelhandel = [einzelhandel];
}
if (gastgewerbe != null) {
if (gastgewerbe instanceof Array)
this.gastgewerbe = gastgewerbe;
else
this.gastgewerbe = [gastgewerbe];
}
if (hallen_lager_prod != null) {
if (hallen_lager_prod instanceof Array)
this.hallen_lager_prod = hallen_lager_prod;
else
this.hallen_lager_prod = [hallen_lager_prod];
}
if (land_und_forstwirtschaft != null) {
if (land_und_forstwirtschaft instanceof Array)
this.land_und_forstwirtschaft = land_und_forstwirtschaft;
else
this.land_und_forstwirtschaft = [land_und_forstwirtschaft];
}
if (parken != null) {
if (parken instanceof Array)
this.parken = parken;
else
this.parken = [parken];
}
if (sonstige != null) {
if (sonstige instanceof Array)
this.sonstige = sonstige;
else
this.sonstige = [sonstige];
}
if (freizeitimmobilie_gewerblich != null) {
if (freizeitimmobilie_gewerblich instanceof Array)
this.freizeitimmobilie_gewerblich = freizeitimmobilie_gewerblich;
else
this.freizeitimmobilie_gewerblich = [freizeitimmobilie_gewerblich];
}
if (zinshaus_renditeobjekt != null) {
if (zinshaus_renditeobjekt instanceof Array)
this.zinshaus_renditeobjekt = zinshaus_renditeobjekt;
else
this.zinshaus_renditeobjekt = [zinshaus_renditeobjekt];
}
}
}
/*
Object type flat.
*/
export class Wohnung {
constructor (wohnungtyp) {
if (wohnungtyp != null) {
if (!this.WOHNUNGTYP.includes(wohnungtyp))
throw 'Invalid wohnungtyp: "' + wohnungtyp + '".';
this.wohnungtyp = wohnungtyp;
}
}
get DACHGESCHOSS () {
return 'DACHGESCHOSS';
}
get MAISONETTE () {
return 'MAISONETTE';
}
get LOFT_STUDIO_ATELIER () {
return 'LOFT-STUDIO-ATELIER';
}
get PENTHOUSE () {
return 'PENTHOUSE';
}
get TERRASSEN () {
return 'TERRASSEN';
}
get ETAGE () {
return 'ETAGE';
}
get ERDGESCHOSS () {
return 'ERDGESCHOSS';
}
get SOUTERRAIN () {
return 'SOUTERRAIN';
}
get APARTMENT () {
return 'APARTMENT';
}
get FERIENWOHNUNG () {
return 'FERIENWOHNUNG';
}
get GALERIE () {
return 'GALERIE';
}
get ROHDACHBODEN () {
return 'ROHDACHBODEN';
}
get ATTIKAWOHNUNG () {
return 'ATTIKAWOHNUNG';
}
get KEINE_ANGABE () {
return 'KEINE_ANGABE';
}
get WOHNUNGTYP () {
return [
this.DACHGESCHOSS,
this.MAISONETTE,
this.LOFT_STUDIO_ATELIER,
this.PENTHOUSE,
this.TERRASSEN,
this.ETAGE,
this.ERDGESCHOSS,
this.SOUTERRAIN,
this.APARTMENT,
this.FERIENWOHNUNG,
this.GALERIE,
this.ROHDACHBODEN,
this.ATTIKAWOHNUNG,
this.KEINE_ANGABE
];
}
}
/*
Object type house.
*/
export class Haus {
constructor (haustyp) {
if (haustyp != null) {
if (!this.HAUSTYP.includes(haustyp))
throw 'Invalid haustyp: "' + haustyp + '".';
this.haustyp = haustyp;
}
}
get REIHENHAUS () {
return 'REIHENHAUS';
}
get REIHENEND () {
return 'REIHENEND';
}
get REIHENMITTEL () {
return 'REIHENMITTEL';
}
get REIHENECK () {
return 'REIHENECK';
}
get DOPPELHAUSHAELFTE () {
return 'DOPPELHAUSHAELFTE';
}
get EINFAMILIENHAUS () {
return 'EINFAMILIENHAUS';
}
get STADTHAUS () {
return 'STADTHAUS';
}
get BUNGALOW () {
return 'BUNGALOW';
}
get VILLA () {
return 'VILLA';
}
get RESTHOF () {
return 'RESTHOF';
}
get BAUERNHAUS () {
return 'BAUERNHAUS';
}
get LANDHAUS () {
return 'LANDHAUS';
}
get SCHLOSS () {
return 'SCHLOSS';
}
get ZWEIFAMILIENHAUS () {
return 'ZWEIFAMILIENHAUS';
}
get MEHRFAMILIENHAUS () {
return 'MEHRFAMILIENHAUS';
}
get FERIENHAUS () {
return 'FERIENHAUS';
}
get BERGHUETTE () {
return 'BERGHUETTE';
}
get CHALET () {
return 'CHALET';
}
get STRANDHAUS () {
return 'STRANDHAUS';
}
get LAUBE_DATSCHE_GARTENHAUS () {
return 'LAUBE-DATSCHE-GARTENHAUS';
}
get APARTMENTHAUS () {
return 'APARTMENTHAUS';
}
get BURG () {
return 'BURG';
}
get HERRENHAUS () {
return 'HERRENHAUS';
}
get FINCA () {
return 'FINCA';
}
get RUSTICO () {
return 'RUSTICO';
}
get FERTIGHAUS () {
return 'FERTIGHAUS';
}
get KEINE_ANGABE () {
return 'KEINE_ANGABE';
}
get HAUSTYP () {
return [
this.REIHENHAUS,
this.REIHENEND,
this.REIHENMITTEL,
this.REIHENECK,
this.DOPPELHAUSHAELFTE,
this.EINFAMILIENHAUS,
this.STADTHAUS,
this.BUNGALOW,
this.VILLA,
this.RESTHOF,
this.BAUERNHAUS,
this.LANDHAUS,
this.SCHLOSS,
this.ZWEIFAMILIENHAUS,
this.MEHRFAMILIENHAUS,
this.FERIENHAUS,
this.BERGHUETTE,
this.CHALET,
this.STRANDHAUS,
this.LAUBE_DATSCHE_GARTENHAUS,
this.APARTMENTHAUS,
this.BURG,
this.HERRENHAUS,
this.FINCA,
this.RUSTICO,
this.FERTIGHAUS,
this.KEINE_ANGABE
];
}
}