Pré-saisie du formulaire¶
Pré-remplir les champs des formulaires¶
Vous pouvez pré-remplir les formulaires des étapes suivantes:
- bien immobilier
- propriétaire du bien immobilier et adresse de facturation
Pour transmettre vos données vous devez écouter l'évènement mounted
et transmettre un JSON
en utilisant l'API contentWindow.postMessage
.
Exemple d'usage
addEventListener('message', function(event){
if ('mounted' === event.data.eventName) {
iframeSelector.contentWindow.postMessage({
eventName: 'fillData',
data: {
...
}
}, '*');
}
});
L'objet JSON
ayant la structure suivante (non exhaustive):
{
estate: {
forRent: true,
estateType: '/estate-type/1',
surface: '/surface/1',
squareMeters: 92,
buildingPermitEnum: 'before_1949',
gasEnum: 'over_15_years',
electricityEnum: 'over_15_years',
waterDrainage: 'septical_tank',
address: '1 Place Pey Berland, Bordeaux',
},
appointmentContact: {
estateOwnerLastName: 'Dupont',
estateOwnerFirstName: 'Charles',
estateOwnerAddressLine1: '182 rue camille corot, 33150 cenon',
billingAddressLastName: 'Dupont',
billingAddressFirstName: 'Charles',
billingAddressLine1: '182 rue camille corot, 33150 cenon',
billingAddressPhone: '+03020302032',
billingAddressEmail: 'charles@dupont.ex',
appointmentContactName: 'Heisenberg Walter White',
appointmentContactPhone: '+330102030405',
appointmentContactEmail: 'Walter.White@Heisenberg.bad',
appointmentContactComment: 'Ne amicis adsit semper exspectemus amicorum vero ne aperte monendum ad valeat ut consilium non.',
}
}
Descriptions des champs¶
Toutes les clefs ci-dessous sont optionnelles
Bien immobilier¶
clef | Type | Choix | Description |
---|---|---|---|
forRent | boolean | true / false | A louer |
estateType | URI | See table below | Type de bien |
surface | URI | See table below | Surface |
squareMeters | integer | Surface m² | |
buildingPermitEnum | string | before_1949 / between_1949_1997 / after_1997 / don_t_know | Année de construction |
gasEnum | string | over_15_years / under_15_years / no_gas / don_t_know | Installation Gaz |
electricityEnum | string | over_15_years / under_15_years / don_t_know | Installation électricité |
waterDrainage | string | septical_tank / all_in_sewer | Evacuation des eaux |
address | string | Adresse complète | |
floor | integer | Étage | |
needsDiagnotics | boolean | true / false | Type de prestations |
needsInventory | boolean | true / false | Type de prestations |
hasInventory | boolean | true / false | Inventaire existant |
inventoryType | string | ongoing / outgoing | Type d'état des lieux |
leaseType | string | empty / furnished | Type de bail |
lotNumber | string | Numéro de lot | |
annex | object | see object structure below | Cave / Parking... |
Surfaces¶
Valeur | Description | Local commercial |
---|---|---|
/surface/1 | STUDIO | Non |
/surface/2 | T2 | Non |
/surface/3 | T3 | Non |
/surface/4 | T4 | Non |
/surface/5 | T5 | Non |
/surface/6 | T6 | Non |
/surface/7 | 20m2 | Oui |
/surface/8 | 40m2 | Oui |
/surface/9 | 60m2 | Oui |
/surface/10 | 80m2 | Oui |
/surface/11 | 120m2 | Oui |
/surface/12 | 150m2 | Oui |
Type de bien¶
Valeur | Description |
---|---|
/estate-type/1 | Appartement |
/estate-type/2 | Maison |
/estate-type/3 | Local commercial |
Annex¶
clef | Type | Choix |
---|---|---|
parking | integer | Nombre de parking |
cellar | integer | Nombre de cave |
other | string | Autre informations à propos du bien |
propriétaire du bien immobilier et adresse de facturation¶
clef | Type | Description |
---|---|---|
estateOwnerLastName | string | Nom de famille du propriétaire |
estateOwnerFirstName | string | Prénom du propriétaire |
estateOwnerAddressLine1 | string | Adresse complète du bien immobilier |
billingAddressLastName | string | Nom de famille à facturer |
billingAddressFirstName | string | Prénom à facturer |
billingAddressLine1 | string | Adresse complète de facturation |
billingAddressPhone | string | Téléphone de facturation |
billingAddressEmail | string | Email de facturation |
appointmentContactName | string | Nom de la personne présente au rendez-vous |
appointmentContactPhone | string | Téléphone de la personne présente au rendez-vous |
appointmentContactEmail | string | Email de la personne présente au rendez-vous |
appointmentContactComment | string | Commentaire |
Exemple d'utilisation¶
const iframeSelector = document.querySelector('iframe#embed_wizard');
addEventListener('message', function(event){
if ('mounted' === event.data.eventName) {
iframeSelector.contentWindow.postMessage({
eventName: 'fillData',
data: {
estate: {
forRent: true,
estateType: '/estate-type/1',
surface: '/surface/1',
squareMeters: 92,
floor: 4,
buildingPermitEnum: 'before_1949',
gasEnum: 'over_15_years',
electricityEnum: 'over_15_years',
waterDrainage: 'septical_tank',
address: '182 rue camille corot, 33150 cenon',
lotNumber: '10',
annex: {
parking: 3,
cellar: 2,
other: 'Please be careful with the door',
}
},
appointmentContact: {
estateOwnerLastName: 'Dupont',
estateOwnerFirstName: 'Charles',
estateOwnerAddressLine1: '1 Place Pey Berland, Bordeaux',
billingAddressLastName: 'Dupont',
billingAddressFirstName: 'Charles',
billingAddressLine1: '1 Place Pey Berland, Bordeaux',
billingAddressPhone: '+03020302032',
billingAddressEmail: 'charles@dupont.ex',
appointmentContactName: 'Heisenberg Walter White',
appointmentContactPhone: '+330102030405',
appointmentContactEmail: 'walter.white@Heisenberg.bad',
appointmentContactComment: 'Ne amicis adsit semper exspectemus amicorum vero ne aperte monendum ad valeat ut consilium non.',
}
}
}, '*');
}
});