> ## Documentation Index
> Fetch the complete documentation index at: https://api-documentation.kare-app.fr/llms.txt
> Use this file to discover all available pages before exploring further.

# Références

* Les références sont PAR organisation (pour AD et RS)
* Pour le back office, on devra gérer avec les uuids.
* Préfixe figé à la création (**Immuabilité de la ref)**
* **Monotonie** : le soft-delete ne recycle **pas** les numéros
* **Garde-fou DB** : `@@unique([organizationId, ref])`
* table `reference_counters` à part pour le suivi, incrément atomique (`INSERT ... ON CONFLICT DO UPDATE`)

### Détail des références

| Entité                          | Préfixe                                          | Portée compteur | Exemple                                         |
| :------------------------------ | :----------------------------------------------- | :-------------- | :---------------------------------------------- |
| **User**                        | `USR`                                            | org             | `USR-12`                                        |
| **Intervention**                | `PREV` / `CUR` / `DEP` / `EXER` / `SESS` / `QLF` | org             | `INT-87`                                        |
| **Report**                      | `PV` / `RVRE` / `RVRAT`                          | org             | `RVRE-12`                                       |
| **Anomaly** (NC / prescription) | `NC` / `PRE`                                     | **rapport**     | `RVRE-12-NC-13`<br />`RVRE-12-PRE-1`            |
| **Anomaly** (observation)       | `OBS`                                            | org             | `OBS-1392`                                      |
| **Anomaly** (audit, AD)         | `AUD`                                            | **projet**      | `PRJ-4-AUD-7`                                   |
| **Commission**                  | `COM`                                            | org             | `COM-5`                                         |
| **Cellule**                     | `CELL`                                           | org             | `CELL-23`                                       |
| **Establishment**               | `ETB`                                            | org             | `ETB-3`                                         |
| **Equipment**                   | `EQP`                                            | org             | `EQP-145`                                       |
| **Project** (AD)                | `PRJ`                                            | org             | `PRJ-4`                                         |
| **BuildingWork**                | `TRV` (a déjà `authorizationNumber` externe)     | org             | `TRV-9`                                         |
| **Routine**                     | `RTN`                                            | org             | `RTN-6`                                         |
| **Document**                    | `DOC`                                            | org             | `DOC-42`                                        |
| **LogBook**                     | `LOG`                                            | org             | `LOG-6`                                         |
| **Plan**                        | `PLAN`                                           | org             | `PLAN-9`                                        |
| **Building**                    | `BLD`                                            | org             | `BLD-4`                                         |
| **Plan item**                   | `ZONE` / rien pour anomalie et équipement        | org             | `ZONE-15`                                       |
| **Company**                     | `PVD`                                            | org             | `PVD-8`                                         |
| **IT**                          | `IT`                                             | org             | `IT-21`                                         |
| **Attachment**                  | —                                                | —               | non implémenté                                  |
| **Contrat**                     | `CONT`                                           | org             | `CONT-11`                                       |
| **Budget**                      | `BUD`                                            | org             | schéma/compteur prêts, aucune route de création |

Y'a pas:

diplome, companyContact, tag, folder, label

**Avantages**: lisible, isolation tenant

**Technique**:

***

### Audit — 2026-07-24

Vérifié entité par entité contre le code (`src/lib/references/registry.ts`, `src/infra/db/extensions/ref-allocation.ts`). Tout conforme sauf : Attachment jamais implémenté (voulu), Budget prêt mais sans route de création (voulu).
