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

# StockFunds

## Description

L'entité stockFunds contient les différentes informations liées à la liste des fonds choisis lors du parcours IFC. Ils peuvent être choisis dans le cas d'une gestion libre ou bien pré sélectionnés lors d'une gestion profilée ou guidée.

## Relations

### Ascendantes

| Entité       | Propriété  |
| ------------ | ---------- |
| SeverancePay | stockFunds |

### Descendantes

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

## Propriétés

| Nom          | Type     | Description                                                                          | Validateur | Lecture seule ? | Dépréciée ? | Dernière version modifiée |
| ------------ | -------- | ------------------------------------------------------------------------------------ | ---------- | --------------- | ----------- | ------------------------- |
| districution | `Number` | Il s'agit de la répartition en %                                                     |            |                 |             | 2.8.0                     |
| isin         | `String` | Il s'agit du code d'identification d'un titre financier                              |            |                 |             | 2.8.0                     |
| id           | `String` | Identifiant de l'entité `StockFunds`                                                 |            | X               |             |                           |
| code         | `String` | Codification fonctionnelle de l'entité `StockFunds`                                  |            |                 |             |                           |
| externalId   | `String` | Identifiant de l'entité `StockFunds` dans le système client                          |            |                 |             |                           |
| externalCode | `String` | Codification fonctionnelle de l'entité `StockFunds` dans le système client           |            |                 |             |                           |
| stockFundsId | `String` | Identifiant public de l'entité `StockFunds` dans l'OIP                               |            |                 |             |                           |
| label        | `String` | Information relative au nom de l'entité `StockFunds` dans son contexte d'utilisation |            |                 |             |                           |
| createdAt    | `Date`   | Date de création de l'entité `StockFunds`                                            |            | X               |             |                           |
| updatedAt    | `Date`   | Date de modification de l'entité `StockFunds`                                        |            | 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 { getOfferId } from '@fasstech/oip-core/entities/Offer';
import { getPensionId } from '@fasstech/oip-core/entities/Pension';
import { getProjectId } from '@fasstech/oip-core/entities/Project';
import { getSeverancePayId } from '@fasstech/oip-core/entities/SeverancePay';
import { getStockFundsCode, getStockFundsDistricution, getStockFundsExternalCode, getStockFundsExternalId, getStockFundsId, getStockFundsIsin, getStockFundsLabel, getStockFundsStockFundsId, setStockFundsCode, setStockFundsDistricution, setStockFundsExternalCode, setStockFundsExternalId, setStockFundsIsin, setStockFundsLabel, setStockFundsStockFundsId } from '@fasstech/oip-core/entities/StockFunds';

(async () => {
  let project = await Entities('Project').create();
  let offer = await Entities('Offer').create();
  let pension = await Entities('Pension').create();
  let severancePay = await Entities('SeverancePay').create();
  const stockFunds = await Entities('StockFunds').create();
  
  setStockFundsDistricution(100, stockFunds);
  setStockFundsIsin('isin', stockFunds);
  setStockFundsCode('code', stockFunds);
  setStockFundsExternalId('externalId', stockFunds);
  setStockFundsExternalCode('externalCode', stockFunds);
  setStockFundsStockFundsId('stockFundsId', stockFunds);
  setStockFundsLabel('label', stockFunds);
  
  severancePay = await Entities('StockFunds').save(severancePay, stockFunds);
  pension = await Entities('SeverancePay').save(pension, severancePay);
  offer = await Entities('Pension').save(offer, pension);
  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 pensionToTest = await Entities('Pension').get(offerToTest, { filter: ({ id }) => id === getPensionId(pension) });
  const severancePayToTest = await Entities('SeverancePay').get(pensionToTest, { filter: ({ id }) => id === getSeverancePayId(severancePay) });
  const stockFundsToTest = await Entities('StockFunds').get(severancePayToTest, { filter: ({ id }) => id === getStockFundsId(stockFunds) });
  
  getStockFundsDistricution(stockFundsToTest); // 100
  getStockFundsIsin(stockFundsToTest); // 'isin'
  getStockFundsCode(stockFundsToTest); // 'code'
  getStockFundsExternalId(stockFundsToTest); // 'externalId'
  getStockFundsExternalCode(stockFundsToTest); // 'externalCode'
  getStockFundsStockFundsId(stockFundsToTest); // 'stockFundsId'
  getStockFundsLabel(stockFundsToTest); // 'label'
})();
```
