diff --git a/src/classes/portals/FlowFact/v2/Estate.ts b/src/classes/portals/FlowFact/v2/Estate.ts index 11f393c..63e36d6 100644 --- a/src/classes/portals/FlowFact/v2/Estate.ts +++ b/src/classes/portals/FlowFact/v2/Estate.ts @@ -11,12 +11,12 @@ export class FlowFactEstateV2 extends Estate { protected async parse(): Promise { return { attachments: await this.getAttachments(), - attic: this.getBoolean('attic'), - balcony: this.getBoolean('balconyavailable.values[0'), + attic: this.getBoolean('attic')!, + balcony: this.getBoolean('balconyavailable.values[0')!, buildingEnergyRatingType: this.getTranslatableValue( 'buildingEnergyRatingType' ), - cellar: this.getBoolean('cellar.values[0]'), + cellar: this.getBoolean('cellar.values[0]')!, condition: this.getTranslatableValue('condition.values[0]'), constructionPhase: this.getTranslatableValue( 'constructionphase.values[0]' @@ -28,28 +28,28 @@ export class FlowFactEstateV2 extends Estate { descriptionNote: this.getValue('textEstate.values[0]'), energyCertificateAvailability: this.getBoolean( 'energy_certificate_availability.values[0]' - ), + )!, energyConsumptionContainsWarmWater: this.getBoolean( 'energywithwarmwater.values[0]' - ), + )!, energyPerformanceCertificate: this.getBoolean( 'energyCertificate.energy_performance_certificate.values[0]' - ), + )!, floor: this.getTranslatableValue('floor.values[0]'), freeFrom: this.getValue('freeFrom'), furnishingNote: this.getValue('textEnvironment.values[0]'), - garden: this.getBoolean('gardenarea.values[0]'), - guestBathroom: this.getBoolean('guesttoilet.values[0]'), - guestToilet: this.getBoolean('guesttoilet.values[0]'), - handicappedAccessible: this.getBoolean('barrierfree.values[0]'), + garden: this.getBoolean('gardenarea.values[0]')!, + guestBathroom: this.getBoolean('guesttoilet.values[0]')!, + guestToilet: this.getBoolean('guesttoilet.values[0]')!, + handicappedAccessible: this.getBoolean('barrierfree.values[0]')!, heatingType: this.getTranslatableValue('typeofheating.values[0]'), interiorQuality: this.getTranslatableValue('qualfitout.values[0]'), lastRefurbishment: this.getTranslatableValue( 'lastModernization.values[0]' ), - listed: this.getBoolean('monument.values[0]'), + listed: this.getBoolean('monument.values[0]')!, locationNote: this.getValue('textLocation.values[0]'), - lodgerFlat: this.getBoolean('lodger_flat.values[0]'), + lodgerFlat: this.getBoolean('lodger_flat.values[0]')!, numberOfApartments: this.getValue('numberOfApartments'), numberOfBathRooms: this.getTranslatableValue('numberbathrooms.values[0]'), numberOfBedRooms: this.getTranslatableValue('numberbedrooms.values[0]'), @@ -59,10 +59,10 @@ export class FlowFactEstateV2 extends Estate { otherNote: this.getValue('textFree.values[0]'), parkingSpacePrice: this.getValue('parkingSpacePrice'), parkingSpaceType: this.getTranslatableValue('parking.values[0]'), - patio: this.getBoolean('patio'), + patio: this.getBoolean('patio')!, plotArea: this.getTranslatableValue('plotarea.values[0]'), residentialUnits: this.getValue('residentialUnits'), - summerResidencePractical: this.getBoolean('summerResidencePractical'), + summerResidencePractical: this.getBoolean('summerResidencePractical')!, usableFloorSpace: this.getTranslatableValue('usablearea.values[0]'), active: this.getActive('status.values[0]'), address: this.getAddress(), @@ -81,10 +81,14 @@ export class FlowFactEstateV2 extends Estate { }; } - protected getBoolean(path: any | any[], defaultValue?: any): boolean { + protected getBoolean( + path: any | any[], + defaultValue?: any + ): boolean | undefined { const value = this.getValue(path, defaultValue); if (value === 1) return true; - return false; + if (value === 0) return false; + return undefined; } private getPreviewImage(): Attachment | undefined { diff --git a/src/commands/flowfact_commands/fetch-estates.ts b/src/commands/flowfact_commands/fetch-estates.ts index e5a2e47..e2bd1d6 100644 --- a/src/commands/flowfact_commands/fetch-estates.ts +++ b/src/commands/flowfact_commands/fetch-estates.ts @@ -47,7 +47,7 @@ exports.handler = async (argv: Arguments) => { if (!argv.normalize) { results = await flowFact.fetchResults(argv); } else { - results = await flowFact.fetchEstates(argv); + results = await flowFact.fetchEstates({ ...argv, detailed: true }); results = results.map(result => result.getProperties(argv.detailed, loadDictionary(argv.dictionary)) ); diff --git a/src/commands/immobilienscout24_commands/fetch-estates.ts b/src/commands/immobilienscout24_commands/fetch-estates.ts index cbc7360..35dc5bd 100644 --- a/src/commands/immobilienscout24_commands/fetch-estates.ts +++ b/src/commands/immobilienscout24_commands/fetch-estates.ts @@ -50,7 +50,7 @@ exports.handler = async (argv: Arguments) => { if (!argv.normalize) { results = await is24.fetchResults(argv); } else { - results = await is24.fetchEstates(argv); + results = await is24.fetchEstates({ ...argv, detailed: true }); results = results.map(result => result.getProperties(argv.detailed, loadDictionary(argv.dictionary)) ); diff --git a/src/translations/de.ts b/src/translations/de.ts index fc2a88d..4d43125 100644 --- a/src/translations/de.ts +++ b/src/translations/de.ts @@ -401,8 +401,8 @@ export default { energy_efficient_70: 'KfW-Effizienzhaus 70', energy_required: 'Endenergiebedarf', energycertificate: 'Energieausweis', - energycertificateavailability: 'Verfügbarkeit vom Energieausweis', - energycertificatecreationdate: 'Erstellungsdatum vom Energieausweis', + energycertificateavailability: 'Energieausweis verfügbar', + energycertificatecreationdate: 'Erstellungsdatum Energieausweis', energyconsumptioncontainswarmwater: 'Energieverbrauch für Warmwasser enthalten', energyconsumptionelectricity: 'Endenergieverbrauch Strom kWh/(m²*a)',