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

# Waiver

## Description

L'entité Waiver contient la structure tarifaire sur laquelle une dérogation sera appliquée.

## Relations

### Ascendantes

| Entité        | Propriété |
| ------------- | --------- |
| WaiverRequest | waivers   |

### Descendantes

| Entité       | Propriété     |
| ------------ | ------------- |
| History      | history       |
| WaiverDetail | waiverDetails |

## Propriétés

| Nom             | Type                        | Description                                                                      | Validateur | Lecture seule ? | Dépréciée ? | Dernière version modifiée |
| --------------- | --------------------------- | -------------------------------------------------------------------------------- | ---------- | --------------- | ----------- | ------------------------- |
| tariffStructure | `WaiverTariffStructureEnum` | Structure tarifaire sur laquelle on va appliquer la remise ou la majoration      |            |                 |             | 2.7.0                     |
| id              | `String`                    | Identifiant de l'entité `Waiver`                                                 |            | X               |             |                           |
| code            | `String`                    | Codification fonctionnelle de l'entité `Waiver`                                  |            |                 |             |                           |
| externalId      | `String`                    | Identifiant de l'entité `Waiver` dans le système client                          |            |                 |             |                           |
| externalCode    | `String`                    | Codification fonctionnelle de l'entité `Waiver` dans le système client           |            |                 |             |                           |
| waiverId        | `String`                    | Identifiant public de l'entité `Waiver` dans l'OIP                               |            |                 |             |                           |
| label           | `String`                    | Information relative au nom de l'entité `Waiver` dans son contexte d'utilisation |            |                 |             |                           |
| createdAt       | `Date`                      | Date de création de l'entité `Waiver`                                            |            | X               |             |                           |
| updatedAt       | `Date`                      | Date de modification de l'entité `Waiver`                                        |            | X               |             |                           |

## Enumérations

### WaiverTariffStructureEnum

- `ADULT_CHILD`
- `EMPLOYEE`
- `EMPLOYEE_CHILD`
- `EMPLOYEE_DUO_FAMILY`
- `EMPLOYEE_FAMILY`
- `FAMILY`
- `TA`
- `TA_TB`
- `TA_TB_TC`

## Enumérations génériques

Aucune enumération générique.

## Exemple

```javascript
import { Entities } from '@fasstech/oip-core';
import { getHypothesisId } from '@fasstech/oip-core/entities/Hypothesis';
import { getOfferId } from '@fasstech/oip-core/entities/Offer';
import { getProjectId } from '@fasstech/oip-core/entities/Project';
import { getWaiverCode, getWaiverExternalCode, getWaiverExternalId, getWaiverId, getWaiverLabel, getWaiverTariffStructure, getWaiverWaiverId, setWaiverCode, setWaiverExternalCode, setWaiverExternalId, setWaiverLabel, setWaiverTariffStructure, setWaiverWaiverId } from '@fasstech/oip-core/entities/Waiver';
import { WaiverTariffStructureEnum } from '@fasstech/oip-core/entities/Waiver/enums';
import { getWaiverRequestId } from '@fasstech/oip-core/entities/WaiverRequest';

(async () => {
  let project = await Entities('Project').create();
  let offer = await Entities('Offer').create();
  let hypothesis = await Entities('Hypothesis').create();
  let waiverRequest = await Entities('WaiverRequest').create();
  const waiver = await Entities('Waiver').create();
  
  setWaiverTariffStructure(WaiverTariffStructureEnum.TA_TB_TC, waiver);
  setWaiverCode('code', waiver);
  setWaiverExternalId('externalId', waiver);
  setWaiverExternalCode('externalCode', waiver);
  setWaiverWaiverId('waiverId', waiver);
  setWaiverLabel('label', waiver);
  
  waiverRequest = await Entities('Waiver').save(waiverRequest, waiver);
  hypothesis = await Entities('WaiverRequest').save(hypothesis, waiverRequest);
  offer = await Entities('Hypothesis').save(offer, hypothesis);
  project = await Entities('Offer').save(project, offer);
  await Entities('Project').save(project);
  
  const projectToTest = await Entities('Project').get({ id: getProjectId(project) });
  const offerToTest = await Entities('Offer').get(projectToTest, { filter: ({ id }) => id === getOfferId(offer) });
  const hypothesisToTest = await Entities('Hypothesis').get(offerToTest, { filter: ({ id }) => id === getHypothesisId(hypothesis) });
  const waiverRequestToTest = await Entities('WaiverRequest').get(hypothesisToTest, { filter: ({ id }) => id === getWaiverRequestId(waiverRequest) });
  const waiverToTest = await Entities('Waiver').get(waiverRequestToTest, { filter: ({ id }) => id === getWaiverId(waiver) });
  
  getWaiverTariffStructure(waiverToTest); // WaiverTariffStructureEnum.TA_TB_TC
  getWaiverCode(waiverToTest); // 'code'
  getWaiverExternalId(waiverToTest); // 'externalId'
  getWaiverExternalCode(waiverToTest); // 'externalCode'
  getWaiverWaiverId(waiverToTest); // 'waiverId'
  getWaiverLabel(waiverToTest); // 'label'
})();
```
