---
title: Turnover
slug: oip-next/rt8bwgtas2q1ftdcse1al
icon: {"lucideIcon":"📘"}
createdAt: 2024-04-08T10:17:29.000Z
---

# Turnover

## Description

L'entité Turnover contient le paramétrage des taux de turnover.

## Relations

### Ascendantes

| Entité  | Propriété |
| ------- | --------- |
| Project | turnovers |

### Descendantes

| Entité         | Propriété       |
| -------------- | --------------- |
| History        | history         |
| TurnoverDetail | turnoverDetails |

## Propriétés

| Nom          | Type     | Description                                                                        | Validateur | Lecture seule ? | Dépréciée ? | Dernière version modifiée |
| ------------ | -------- | ---------------------------------------------------------------------------------- | ---------- | --------------- | ----------- | ------------------------- |
| id           | `String` | Identifiant de l'entité `Turnover`                                                 |            | X               |             |                           |
| code         | `String` | Codification fonctionnelle de l'entité `Turnover`                                  |            |                 |             |                           |
| externalId   | `String` | Identifiant de l'entité `Turnover` dans le système client                          |            |                 |             |                           |
| externalCode | `String` | Codification fonctionnelle de l'entité `Turnover` dans le système client           |            |                 |             |                           |
| turnoverId   | `String` | Identifiant public de l'entité `Turnover` dans l'OIP                               |            |                 |             |                           |
| label        | `String` | Information relative au nom de l'entité `Turnover` dans son contexte d'utilisation |            |                 |             |                           |
| createdAt    | `Date`   | Date de création de l'entité `Turnover`                                            |            | X               |             |                           |
| updatedAt    | `Date`   | Date de modification de l'entité `Turnover`                                        |            | X               |             |                           |

## Enumérations

Aucune enumération.

## Enumérations génériques

Aucune enumération générique.

## Exemple

```javascript
import { Entities } from '@fasstech/oip-core';
import { getProjectId } from '@fasstech/oip-core/entities/Project';
import { getTurnoverCode, getTurnoverExternalCode, getTurnoverExternalId, getTurnoverId, getTurnoverLabel, getTurnoverTurnoverId, setTurnoverCode, setTurnoverExternalCode, setTurnoverExternalId, setTurnoverLabel, setTurnoverTurnoverId } from '@fasstech/oip-core/entities/Turnover';

(async () => {
  let project = await Entities('Project').create();
  const turnover = await Entities('Turnover').create();
  
  setTurnoverCode('code', turnover);
  setTurnoverExternalId('externalId', turnover);
  setTurnoverExternalCode('externalCode', turnover);
  setTurnoverTurnoverId('turnoverId', turnover);
  setTurnoverLabel('label', turnover);
  
  project = await Entities('Turnover').save(project, turnover);
  await Entities('Project').save(project);
  
  const projectToTest = await Entities('Project').get({ id: getProjectId(project) });
  const turnoverToTest = await Entities('Turnover').get(projectToTest, { filter: ({ id }) => id === getTurnoverId(turnover) });
  
  getTurnoverCode(turnoverToTest); // 'code'
  getTurnoverExternalId(turnoverToTest); // 'externalId'
  getTurnoverExternalCode(turnoverToTest); // 'externalCode'
  getTurnoverTurnoverId(turnoverToTest); // 'turnoverId'
  getTurnoverLabel(turnoverToTest); // 'label'
})();
```
