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

# Pricing

## Description

L'entité Pricing correspond à la structure tarifaire de la formule.

## Relations

### Ascendantes

| Entité | Propriété |
| ------ | --------- |
| Pack   | pricings  |

### Descendantes

| Entité        | Propriété      |
| ------------- | -------------- |
| History       | history        |
| Price         | prices         |
| WaiverRequest | waiverRequests |

## Propriétés

| Nom                | Type                         | Description                                                                                                                     | Validateur | Lecture seule ? | Dépréciée ? | Dernière version modifiée |
| ------------------ | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ---------- | --------------- | ----------- | ------------------------- |
| defaultPrice       | `Number`                     | Tarif total de la structure  avant la prise en compte des dérogations.                                                          |            |                 |             | 2.8.0                     |
| defaultRate        | `Number`                     | Taux total de la structure  avant la prise en compte des dérogations.                                                           |            |                 |             | 2.8.0                     |
| derogatedAmount    | `Number`                     | Montant total dérogé de la structure. Il prend en compte l'ensemble des dérogations.                                            |            |                 |             | 2.8.0                     |
| derogatedRate      | `Number`                     | Taux total dérogé de la structure. Il prend en compte l'ensemble des dérogations.                                               |            |                 |             | 2.8.0                     |
| guaranteeCode      | `String`                     | Code de la garantie. Cela peut être la référence de classification ou bien un code interne.                                     |            |                 |             | 2.8.0                     |
| guaranteeLabel     | `String`                     | Libellé de la garantie flexiproduct.                                                                                            |            |                 |             | 2.8.0                     |
| isPreSelected      | `Boolean`                    | Il s'agit d'identifier les formules et/ou garanties présélectionnées pour l'utilisateur pour permettre de faire une comparaison |            |                 |             | 3.7.0                     |
| isSelected         | `Boolean`                    | Indique si le client a sélectionné cette structure tarifaire.                                                                   |            |                 |             | 2.6.0                     |
| level              | `String`                     | Niveau du module                                                                                                                |            |                 |             | 2.4.0                     |
| moduleCode         | `String`                     | Code du module                                                                                                                  |            |                 |             | 2.4.0                     |
| moduleId           | `String`                     | Identifiant unique du module                                                                                                    |            |                 |             | 2.4.0                     |
| moduleLabel        | `String`                     | Libellé du module flexiproduct                                                                                                  |            |                 |             | 2.8.0                     |
| price              | `Number`                     | Tarif total de la structure en tenant compte des dérogations.                                                                   |            |                 |             | 2.8.0                     |
| rate               | `Number`                     | Taux total de la structure en tenant compte des dérogations.                                                                    |            |                 |             | 2.8.0                     |
| regime             | `RegimeEnum`                 | Régime                                                                                                                          |            |                 |             | 2.4.0                     |
| supplementaryCover | `String`                     | Code de la surcomplémentaire si celle-ci est sélectionnée dans le parcours                                                      |            |                 |             | 2.4.0                     |
| tariffStructure    | `PricingTariffStructureEnum` | Structure tarifaire sur laquelle on va appliquer un tarif                                                                       |            |                 |             | 2.7.0                     |
| id                 | `String`                     | Identifiant de l'entité `Pricing`                                                                                               |            | X               |             |                           |
| code               | `String`                     | Codification fonctionnelle de l'entité `Pricing`                                                                                |            |                 |             |                           |
| externalId         | `String`                     | Identifiant de l'entité `Pricing` dans le système client                                                                        |            |                 |             |                           |
| externalCode       | `String`                     | Codification fonctionnelle de l'entité `Pricing` dans le système client                                                         |            |                 |             |                           |
| pricingId          | `String`                     | Identifiant public de l'entité `Pricing` dans l'OIP                                                                             |            |                 |             |                           |
| label              | `String`                     | Information relative au nom de l'entité `Pricing` dans son contexte d'utilisation                                               |            |                 |             |                           |
| createdAt          | `Date`                       | Date de création de l'entité `Pricing`                                                                                          |            | X               |             |                           |
| updatedAt          | `Date`                       | Date de modification de l'entité `Pricing`                                                                                      |            | X               |             |                           |

## Enumérations

### PricingTariffStructureEnum

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

## Enumérations génériques

- RegimeEnum

## Exemple

```javascript
import { Entities } from '@fasstech/oip-core';
import { getOfferId } from '@fasstech/oip-core/entities/Offer';
import { getPackId } from '@fasstech/oip-core/entities/Pack';
import { getPricingCode, getPricingDefaultPrice, getPricingDefaultRate, getPricingDerogatedAmount, getPricingDerogatedRate, getPricingExternalCode, getPricingExternalId, getPricingGuaranteeCode, getPricingGuaranteeLabel, getPricingId, getPricingIsPreSelected, getPricingIsSelected, getPricingLabel, getPricingLevel, getPricingModuleCode, getPricingModuleId, getPricingModuleLabel, getPricingPrice, getPricingPricingId, getPricingRate, getPricingRegime, getPricingSupplementaryCover, getPricingTariffStructure, setPricingCode, setPricingDefaultPrice, setPricingDefaultRate, setPricingDerogatedAmount, setPricingDerogatedRate, setPricingExternalCode, setPricingExternalId, setPricingGuaranteeCode, setPricingGuaranteeLabel, setPricingIsPreSelected, setPricingIsSelected, setPricingLabel, setPricingLevel, setPricingModuleCode, setPricingModuleId, setPricingModuleLabel, setPricingPrice, setPricingPricingId, setPricingRate, setPricingRegime, setPricingSupplementaryCover, setPricingTariffStructure } from '@fasstech/oip-core/entities/Pricing';
import { PricingTariffStructureEnum } from '@fasstech/oip-core/entities/Pricing/enums';
import { getProjectId } from '@fasstech/oip-core/entities/Project';
import { RegimeEnum } from '@fasstech/oip-core/entities/enums';

(async () => {
  let project = await Entities('Project').create();
  let offer = await Entities('Offer').create();
  let pack = await Entities('Pack').create();
  const pricing = await Entities('Pricing').create();
  
  setPricingDefaultPrice(100, pricing);
  setPricingDefaultRate(100, pricing);
  setPricingDerogatedAmount(100, pricing);
  setPricingDerogatedRate(100, pricing);
  setPricingGuaranteeCode('guaranteeCode', pricing);
  setPricingGuaranteeLabel('guaranteeLabel', pricing);
  setPricingIsPreSelected(false, pricing);
  setPricingIsSelected(false, pricing);
  setPricingLevel('level', pricing);
  setPricingModuleCode('moduleCode', pricing);
  setPricingModuleId('moduleId', pricing);
  setPricingModuleLabel('moduleLabel', pricing);
  setPricingPrice(112, pricing);
  setPricingRate(114, pricing);
  setPricingRegime(RegimeEnum.REGIME_INDEPENDANT, pricing);
  setPricingSupplementaryCover('supplementaryCover', pricing);
  setPricingTariffStructure(PricingTariffStructureEnum.TA, pricing);
  setPricingCode('code', pricing);
  setPricingExternalId('externalId', pricing);
  setPricingExternalCode('externalCode', pricing);
  setPricingPricingId('pricingId', pricing);
  setPricingLabel('label', pricing);
  
  pack = await Entities('Pricing').save(pack, pricing);
  offer = await Entities('Pack').save(offer, pack);
  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 packToTest = await Entities('Pack').get(offerToTest, { filter: ({ id }) => id === getPackId(pack) });
  const pricingToTest = await Entities('Pricing').get(packToTest, { filter: ({ id }) => id === getPricingId(pricing) });
  
  getPricingDefaultPrice(pricingToTest); // 100
  getPricingDefaultRate(pricingToTest); // 100
  getPricingDerogatedAmount(pricingToTest); // 100
  getPricingDerogatedRate(pricingToTest); // 100
  getPricingGuaranteeCode(pricingToTest); // 'guaranteeCode'
  getPricingGuaranteeLabel(pricingToTest); // 'guaranteeLabel'
  getPricingIsPreSelected(pricingToTest); // false
  getPricingIsSelected(pricingToTest); // false
  getPricingLevel(pricingToTest); // 'level'
  getPricingModuleCode(pricingToTest); // 'moduleCode'
  getPricingModuleId(pricingToTest); // 'moduleId'
  getPricingModuleLabel(pricingToTest); // 'moduleLabel'
  getPricingPrice(pricingToTest); // 112
  getPricingRate(pricingToTest); // 114
  getPricingRegime(pricingToTest); // RegimeEnum.REGIME_INDEPENDANT
  getPricingSupplementaryCover(pricingToTest); // 'supplementaryCover'
  getPricingTariffStructure(pricingToTest); // PricingTariffStructureEnum.TA
  getPricingCode(pricingToTest); // 'code'
  getPricingExternalId(pricingToTest); // 'externalId'
  getPricingExternalCode(pricingToTest); // 'externalCode'
  getPricingPricingId(pricingToTest); // 'pricingId'
  getPricingLabel(pricingToTest); // 'label'
})();
```
