# Property Management Overview

Understand how buildings, apartments, rooms, and equipment are organized in the FairePlace API.

## Property hierarchy

```
Place (building/site)
 ├── Service (chargeable building services — heating, elevator, water)
 ├── Equipment ← can be attached at any level
 └── Estate (apartment/unit)
      ├── Equipment ← can be attached at any level
      └── Room (individual room)
           ├── Equipment (fixed installations — for État des Lieux)
           └── Inventory (moveable items — for furnished lease inventory, rooms only)
```

Every rental property follows this hierarchy:

| Level | Resource | Description |
|-------|----------|-------------|
| **Place** | `/api/places` | A building, house, or property site. Contains address, country, and owner. |
| **Service** | `/api/places/{id}/services` | A chargeable building service — heating, elevator, water supply. Links to distribution keys. |
| **Estate** | `/api/places/{id}/estates` | A rentable unit — apartment, studio, commercial space. Has area, floor, room count. |
| **Room** | `/api/places/{id}/estates/{id}/rooms` | Interior rooms — living room, bedroom, kitchen, bathroom. Used in lease documents. |
| **Equipment** | `/api/places/{id}/estates/{id}/equipment` | Fixed installations — radiators, doors, plumbing. Used in the **État des Lieux**. |
| **Inventory** | `/api/inventory/items` | Moveable items — furniture, appliances. Used in the **Inventaire Mobilier** for furnished leases. |

### Equipment vs Inventory

These are two distinct concepts that serve different legal documents:

| | Equipment | Inventory |
|--|-----------|-----------|
| **Purpose** | Track **fixed/permanent installations** for the **État des Lieux** (property inspection report) | Track **moveable/furnished items** for the **Inventaire Mobilier** (furnished lease inventory) |
| **Required for** | All lease types | Furnished leases only (`bail meublé`) |
| **Typical items** | Radiators, doors, windows, plumbing, electrical outlets, shutters | Bed, table, sofa, refrigerator, washing machine, cookware, bedding |
| **Legal basis** | Decree 2016-382 (État des Lieux) | Decree 2015-981 (mandatory furnished items list) |
| **Condition tracking** | Status + notes (structured) | Status + notes + financial value + maintenance history |
| **Scope** | Attachable to rooms, estates, or places | Attached to rooms only (via room inventory) |

> **In short:** If it's "in the walls" → **Equipment**. If you can move it out → **Inventory**.

## How it works

### 1. Create a Place

A place is always the top-level container. It requires:
- An **owner** (individual or SCI company)
- A **place type** (apartment building, house, commercial building, etc.)
- A **country** — determines which rent regulation and compliance rules apply

```bash
curl -X POST https://api.faireplace.com/api/places \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Residence Les Jardins",
    "type_id": "<place_type_uuid>",
    "country_id": "<zone_uuid>",
    "owner_id": "<owner_uuid>",
    "country": "France",
    "street_number": "24",
    "street_name": "rue du Faubourg Saint-Antoine",
    "postal_code": "75012",
    "city": "Paris",
    "place_category": "Collective",
    "legal_regime": "Copropriete"
  }'
```

### 2. Add Estates

Each estate is a rentable unit within the place. An apartment building with 10 apartments has 10 estates.

```bash
curl -X POST https://api.faireplace.com/api/places/<place_id>/estates \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "T2 - Apt 301",
    "estate_type_id": "<estate_type_uuid>",
    "area": 45.0,
    "fiscal_identifier": "75012-B-0301",
    "number_of_room": 2,
    "floor": 3
  }'
```

### 3. Define Rooms

Rooms describe the interior layout. This information appears on the lease document and is required by French rental law.

```bash
curl -X POST https://api.faireplace.com/api/places/<place_id>/estates/<estate_id>/rooms \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type_room_id": "<room_type_uuid>", "carrez_surface": 18.5, "habitable_surface": 18.5, "designation": "Sejour"}'
```

### 4. Add Equipment (fixed installations)

Equipment tracks fixed installations with their condition for the État des Lieux.

```bash
curl -X POST https://api.faireplace.com/api/rooms/<room_id>/equipment \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "equipment_id": "<equipment_type_uuid>",
    "quantity": 1,
    "condition_status": "GOOD",
    "condition_notes": "Fonctionnel, légères traces d usure"
  }'
```

### 5. Add Inventory (furnished leases only)

For furnished leases, inventory tracks all moveable items required by Decree 2015-981.

```bash
curl -X POST https://api.faireplace.com/api/places/<place_id>/estates/<estate_id>/rooms/<room_id>/inventory \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inventory_id": "<inventory_item_uuid>",
    "quantity_in_room": 1,
    "condition_in_room": "GOOD"
  }'
```

## Place categories

| Category | Description |
|----------|-------------|
| `Individual` | Single-unit property (house, villa) |
| `Collective` | Multi-unit building (apartment complex) |

## Legal regimes

| Regime | Description |
|--------|-------------|
| `Copropriete` | Co-ownership (most apartment buildings) |
| `MonoPropriete` | Sole ownership |

## Countries

Every place must be linked to a country. The country determines:
- Whether rent control (**encadrement des loyers**) applies
- Reference rents per m² for the area
- Whether the property is in a **zone tendue** (high-demand area)
- Notice period requirements

See [Rent Regulation & Rent Control](/compliance/legislative-zones) for the full reference.

## Types

Place types, estate types, and room types are predefined resources:

```bash
# Get all place types
GET /api/types/places

# Get all estate types
GET /api/types/estates

# Get all room types
GET /api/types/rooms
```

See the [API Reference](/api) for available type values.

---

## Related

- **[Places API](/properties/places)** — Full endpoint reference for places
- **[Estates API](/properties/estates)** — Manage rental units
- **[Rooms API](/properties/rooms)** — Define room layouts
- **[Equipment API](/properties/equipment)** — Fixed installations and condition tracking (État des Lieux)
- **[Inventory API](/properties/inventory)** — Moveable items for furnished leases (Inventaire Mobilier)
- **[Services API](/properties/services)** — Chargeable building services (heating, elevator, water)
- **[Keys](/properties/keys)** — Key lifecycle management
- **[Rent Regulation & Rent Control](/compliance/legislative-zones)** — Country-level compliance
