Lease Termination, Finalisation & Archival
Manage the full end-of-lease workflow: notice → finalisation → exit inspection → deposit settlement → termination → archival.
Quick Example
Code
Code
Termination Workflows
FairePlace supports three termination paths:
Standard termination (via notice)
Code
- Tenant or landlord sends a notice (congé)
POST /leases/{id}/termination— initiates the process, lease moves toNOTICE- When the effective date is reached:
PUT /leases/{id}/termination/start-finalisation— moves toFINALISATION - Complete the exit checklist (EDL, keys, charges, deposit)
PUT /leases/{id}/termination/complete— moves toTERMINATEDPUT /leases/{id}/archive— removes from default listings (manual or auto after 90 days)
Natural expiration (fixed-term lease)
Code
For mobility, seasonal, or fixed-term leases with no renewal:
POST /leases/{id}/termination/from-expiration— skipsNOTICE, goes directly toFINALISATION- Same exit checklist as standard (adapted for lease type)
PUT /leases/{id}/termination/complete→PUT /leases/{id}/archive
Force terminate (out-of-app process)
Code
When the termination was handled outside the application:
Code
No LeaseTermination or checklist is created. The reason is stored for audit.
Termination Status
| Status | Description |
|---|---|
INITIATED | Process started (notice effective or expiration detected) |
EXIT_PENDING | Waiting for exit inspection + key return |
SETTLEMENT_PENDING | Waiting for charge settlement + deposit return |
COMPLETED | All done — lease can be TERMINATED |
Checklist
The checklist is a JSONB list of items adapted to the lease type. Each item has:
| Field | Type | Description |
|---|---|---|
key | string | Unique identifier (keys_returned, deposit_settled, etc.) |
label | string | Human-readable label |
required_for_completion | boolean | If true, must be checked to complete termination |
completed | boolean | Whether the item is done |
completed_at | datetime | When it was checked |
completed_by | uuid | Who checked it |
Default checklist by lease type
Residential (7 items, 5 required):
notice_effective, exit_condition_report_done, keys_returned, meters_read, charges_regularized, deposit_settled, final_rent_paid
Commercial (9 items):
Residential + commercial_handover, signage_removed
Seasonal (4 items):
exit_condition_report_done, keys_returned, deposit_settled, cleaning_done*
* = optional
Check/uncheck items
Code
Exit Inspection (EDL de sortie)
After the exit condition report is signed:
Code
This automatically:
- Checks
exit_condition_report_doneandkeys_returnedin the checklist - Calculates the deposit restitution deadline (Art. 22): 1 month if conformity, 2 months otherwise
- Updates the security deposit
restitution_due_date - Transitions to
SETTLEMENT_PENDING
Deposit Settlement
Apply retentions on the security deposit:
Code
The system validates:
- Co-ownership charges: max 20% of deposit (Art. 22)
- Total retentions cannot exceed deposit amount
- Computes
amount_returned = deposit - retentions - If restitution deadline passed: 10% monthly rent penalty per month of delay
See Security Deposit for detailed rules.
Archival
Archived leases are excluded from default listings but remain queryable.
Code
Rules:
- Only
TERMINATEDorEXPIREDleases can be archived - Cannot archive if security deposit is in
DISPUTEDstatus - Idempotent — archiving twice is a no-op
- Auto-archival: 90 days after termination (via scheduler)
change_lease_status Behavior
The generic PUT /leases/{id}/status endpoint only handles pre-Active transitions:
DRAFT → PENDING_SIGNATUREPENDING_SIGNATURE → ACTIVEDRAFT → ACTIVE
Post-Active transitions (NOTICE, FINALISATION, TERMINATED) return a 400 error with a message indicating the correct endpoint to use.
Endpoints Summary
| Method | Endpoint | Action |
|---|---|---|
| POST | /leases/{id}/termination | Initiate from notice |
| POST | /leases/{id}/termination/from-expiration | Initiate from expiration |
| GET | /leases/{id}/termination | Get termination status |
| PUT | /leases/{id}/termination/start-finalisation | Notice → Finalisation |
| PUT | /leases/{id}/termination/exit-report | Register exit inspection |
| PUT | /leases/{id}/termination/checklist/{key} | Check item |
| DELETE | /leases/{id}/termination/checklist/{key} | Uncheck item |
| PUT | /leases/{id}/termination/settlement | Deposit settlement |
| PUT | /leases/{id}/termination/complete | Complete termination |
| PUT | /leases/{id}/force-terminate | Force terminate (bypass) |
| PUT | /leases/{id}/archive | Archive lease |
| GET | /leases/archived | List archived leases |
Legal Reference
Art. 15, Loi n°89-462 : Le congé doit être notifié par LRAR, huissier, ou remise en main propre. Le délai de préavis est de 6 mois pour le bailleur, 3 mois pour le locataire (1 mois en zone tendue ou situations spécifiques).
Art. 22, Loi n°89-462 : Le dépôt de garantie est restitué sous 1 mois (EDL conforme) ou 2 mois. Retenue charges copropriété limitée à 20%. Pénalité de retard : 10% du loyer HC par mois.
Art. 3-2, Loi n°89-462 : L'état des lieux de sortie est établi contradictoirement entre les parties lors de la remise des clés.
Related
- Lease Overview — Full lifecycle
- Security Deposit — Deposit rules and settlement
- Charges — Charge regularisation at lease end
- Amendments — Modify active leases