# Lots

# Nouveau lot créé

Création d'un nouveau lot

{
    "event": "lot:created",
    "emitted_at": "2022-11-30T15:22:11.000000Z", 
    "data": {
        "id": 13025,
        "primpromo_id": null,
        "reference": "A01",
        "is_primary": true,
        "type": "apartment",
        "type_display": "Appartement",
        "typology": "T4",
        "typology_display": "4 pièces",
        "subtype": null,
        "subtype_display": null,
        "price_excluding_vat": 208333.33,
        "price_with_secondary_excluding_vat": 208333.33,
        "vat_rate": 20,
        "price_including_vat": 250000,
        "price_with_secondary_including_vat": 250000,
        "reduced_vat_eligibility": false,
        "price_reduced_vat": null,
        "price_with_secondary_reduced_vat": null,
        "parent_lot": null,
        "children_lots": [],
        "status": "available",
        "context": {
            "tenant_key": "espace-client",
            "program_id": 100
        }
    }
}

# Lot mis à jour

Mise à jour d'un lot

IMPORTANT

Attention, cet événement peut générer un très grand nombre de requêtes.

{
    "event": "lot:updated",
    "emitted_at": "2022-11-30T15:22:11.000000Z", 
    "data": {
        "id": 8116,
        "primpromo_id": null,
        "reference": "M04",
        "is_primary": true,
        "type": "house",
        "type_display": "Maison",
        "typology": "T4",
        "typology_display": "4 pièces",
        "subtype": null,
        "subtype_display": null,
        "price_excluding_vat": 307500,
        "price_with_secondary_excluding_vat": 314166.67,
        "vat_rate": 20,
        "price_including_vat": 369000,
        "price_with_secondary_including_vat": 377000,
        "reduced_vat_eligibility": false,
        "price_reduced_vat": null,
        "price_with_secondary_reduced_vat": null,
        "parent_lot": null,
        "children_lots": [
            {
                "id": 8120,
                "primpromo_id": null,
                "reference": "P01",
                "type": "parking",
                "typology": "underground",
                "subtype": null
            }
        ],
        "status": "available",
        "context": {
            "tenant_key": "espace-client",
            "program_id": 120
        }
    }
}

# Statut d'un lot mis à jour

Mise à jour du statut d'un lot

{
    "event": "lot:status-updated",
    "emitted_at": "2022-11-30T15:22:11.000000Z", 
    "data": {
        "id": 8116,
        "primpromo_id": null,
        "reference": "M04",
        "is_primary": true,
        "status": "available",
        "context": {
            "tenant_key": "espace-client",
            "program_id": 120
        }
    }
}

# Lot supprimé

Suppression d'un lot

{
    "event": "lot:deleted",
    "emitted_at": "2022-11-30T15:22:11.000000Z", 
    "data": {
        "id": 8121,
        "context": {
            "tenant_key": "espace-client",
            "program_id": 120
        }
    }
}

# Modèle

Champ Type Description Exemple
id int ID du lot 15

Se référer à la section modèle des lots

# Contexte

Champ Type Description Exemple
tenant_key string Clé de l'espace client espace-client
program_id int ID du programme 100
program_primpromo_id string ID Primpromo du programme (si PPM connecté) 09141