ProtectionNeed
ProtectionNeed
Description
L'entité ProtectionNeed regroupe les critÚres liés au recueil des besoins d'un parcours Prévoyance.
Relations
Ascendantes
Entité | Propriété |
|---|---|
CollectionNeed | protectionNeeds |
Descendantes
Entité | Propriété |
|---|---|
History | history |
Propriétés
Nom | Type | Description | Validateur | Lecture seule ? | Dépréciée ? | DerniÚre version modifiée |
|---|---|---|---|---|---|---|
category | String | CatĂ©gorie (DĂ©cĂšs, InvaliditĂ©) | ï»ż | ï»ż | ï»ż | 2.2.0 |
guarantee | String | Garantie (Double accident, Rente d'invaliditĂ© permanente, ...) | ï»ż | ï»ż | ï»ż | 2.2.0 |
isSelected | Boolean | Est sĂ©lectionnĂ© ? | ï»ż | ï»ż | ï»ż | 2.2.0 |
level | ProtectionNeedLevelEnum | Niveau de la garantie ou du module | ï»ż | ï»ż | ï»ż | 2.6.0 |
id | String | Identifiant de l'entitĂ© ProtectionNeed | ï»ż | X | ï»ż | ï»ż |
code | String | Codification fonctionnelle de l'entitĂ© ProtectionNeed | ï»ż | ï»ż | ï»ż | ï»ż |
externalId | String | Identifiant de l'entitĂ© ProtectionNeed dans le systĂšme client | ï»ż | ï»ż | ï»ż | ï»ż |
externalCode | String | Codification fonctionnelle de l'entitĂ© ProtectionNeed dans le systĂšme client | ï»ż | ï»ż | ï»ż | ï»ż |
protectionNeedId | String | Identifiant public de l'entitĂ© ProtectionNeed dans l'OIP | ï»ż | ï»ż | ï»ż | ï»ż |
label | String | Information relative au nom de l'entitĂ© ProtectionNeed dans son contexte d'utilisation | ï»ż | ï»ż | ï»ż | ï»ż |
createdAt | Date | Date de crĂ©ation de l'entitĂ© ProtectionNeed | ï»ż | X | ï»ż | ï»ż |
updatedAt | Date | Date de modification de l'entitĂ© ProtectionNeed | ï»ż | X | ï»ż | ï»ż |
Enumérations
ProtectionNeedLevelEnum
- ONE
- TWO
- THREE
- FOUR
Enumérations génériques
Aucune enumération générique.
Exemple
import { Entities } from '@fasstech/oip-core';
import { getCollectionNeedId } from '@fasstech/oip-core/entities/CollectionNeed';
import { getProjectId } from '@fasstech/oip-core/entities/Project';
import { getProtectionNeedCategory, getProtectionNeedCode, getProtectionNeedExternalCode, getProtectionNeedExternalId, getProtectionNeedGuarantee, getProtectionNeedId, getProtectionNeedIsSelected, getProtectionNeedLabel, getProtectionNeedLevel, getProtectionNeedProtectionNeedId, setProtectionNeedCategory, setProtectionNeedCode, setProtectionNeedExternalCode, setProtectionNeedExternalId, setProtectionNeedGuarantee, setProtectionNeedIsSelected, setProtectionNeedLabel, setProtectionNeedLevel, setProtectionNeedProtectionNeedId } from '@fasstech/oip-core/entities/ProtectionNeed';
import { ProtectionNeedLevelEnum } from '@fasstech/oip-core/entities/ProtectionNeed/enums';
(async () => {
let project = await Entities('Project').create();
let collectionNeed = await Entities('CollectionNeed').create();
const protectionNeed = await Entities('ProtectionNeed').create();
setProtectionNeedCategory('category', protectionNeed);
setProtectionNeedGuarantee('guarantee', protectionNeed);
setProtectionNeedIsSelected(false, protectionNeed);
setProtectionNeedLevel(ProtectionNeedLevelEnum.FOUR, protectionNeed);
setProtectionNeedCode('code', protectionNeed);
setProtectionNeedExternalId('externalId', protectionNeed);
setProtectionNeedExternalCode('externalCode', protectionNeed);
setProtectionNeedProtectionNeedId('protectionNeedId', protectionNeed);
setProtectionNeedLabel('label', protectionNeed);
collectionNeed = await Entities('ProtectionNeed').save(collectionNeed, protectionNeed);
project = await Entities('CollectionNeed').save(project, collectionNeed);
await Entities('Project').save(project);
const projectToTest = await Entities('Project').get({ id: getProjectId(project) });
const collectionNeedToTest = await Entities('CollectionNeed').get(projectToTest, { filter: ({ id }) => id === getCollectionNeedId(collectionNeed) });
const protectionNeedToTest = await Entities('ProtectionNeed').get(collectionNeedToTest, { filter: ({ id }) => id === getProtectionNeedId(protectionNeed) });
getProtectionNeedCategory(protectionNeedToTest); // 'category'
getProtectionNeedGuarantee(protectionNeedToTest); // 'guarantee'
getProtectionNeedIsSelected(protectionNeedToTest); // false
getProtectionNeedLevel(protectionNeedToTest); // ProtectionNeedLevelEnum.FOUR
getProtectionNeedCode(protectionNeedToTest); // 'code'
getProtectionNeedExternalId(protectionNeedToTest); // 'externalId'
getProtectionNeedExternalCode(protectionNeedToTest); // 'externalCode'
getProtectionNeedProtectionNeedId(protectionNeedToTest); // 'protectionNeedId'
getProtectionNeedLabel(protectionNeedToTest); // 'label'
})();