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 |
Liste des propriétés
Nom | Type | DerniÚre version modifiée | Description | Getter | Setter | Deprecated |
|---|---|---|---|---|---|---|
category | String | 2.2.0 | Catégorie (DécÚs, Invalidité) | getProtectionNeedCategory | setProtectionNeedCategory | - |
createdAt | Date | ï»ż | Date de crĂ©ation de l'entitĂ© ProtectionNeed | getProtectionNeedCreatedAt | Lecture seule | - |
createdBy | String | ï»ż | Utilisateur Ă l'origine de la crĂ©ation de l'entitĂ© ProtectionNeed | getProtectionNeedCreatedBy | Lecture seule | - |
guarantee | String | 2.2.0 | Garantie (Double accident, Rente d'invalidité permanente, ...) | getProtectionNeedGuarantee | setProtectionNeedGuarantee | - |
id | String | ï»ż | Identifiant unique de l'entitĂ© ProtectionNeed | getProtectionNeedId | Lecture seule | - |
isSelected | Boolean | 2.2.0 | Est sélectionné ? | getProtectionNeedIsSelected | setProtectionNeedIsSelected | - |
level | levelEnum | 2.6.0 | Niveau de la garantie ou du module | getProtectionNeedLevel | setProtectionNeedLevel | - |
updatedAt | Date | ï»ż | Date de modification de l'entitĂ© ProtectionNeed | getProtectionNeedUpdatedAt | Lecture seule | - |
updatedBy | String | ï»ż | Utilisateur Ă l'origine de la modification de l'entitĂ© ProtectionNeed | getProtectionNeedUpdatedBy | Lecture seule | - |
Enums
levelEnum
- levelEnum.ONE
- levelEnum.TWO
- levelEnum.THREE
- levelEnum.FOUR
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, getProtectionNeedGuarantee, getProtectionNeedIsSelected, getProtectionNeedLevel, getprotectionNeedId, setProtectionNeedCategory, setProtectionNeedGuarantee, setProtectionNeedIsSelected, setProtectionNeedLevel } from '@fasstech/oip-core/entities/protectionNeed';
import { levelEnum } from '@fasstech/oip-core/entities/protectionNeed/enums';
(async () => {
let ProjectEntity = await Entities('Project').get({ id: projectId });
let CollectionNeedEntity = await Entities('CollectionNeed').create();
const ProtectionNeedEntity = await Entities('ProtectionNeed').create();
setProtectionNeedCategory('category', ProtectionNeedEntity);
setProtectionNeedGuarantee('guarantee', ProtectionNeedEntity);
setProtectionNeedIsSelected(false, ProtectionNeedEntity);
setProtectionNeedLevel(levelEnum.FOUR, ProtectionNeedEntity);
CollectionNeedEntity = await Entities('ProtectionNeed').save(CollectionNeedEntity, ProtectionNeedEntity);
ProjectEntity = await Entities('CollectionNeed').save(ProjectEntity, CollectionNeedEntity);
await Entities('Project').save(ProjectEntity);
const ProjectEntityToTest = await Entities('Project').get({ id: getProjectId(ProjectEntity) });
const CollectionNeedEntityToTest = await Entities('CollectionNeed').get(ProjectEntityToTest, getCollectionNeedId(CollectionNeedEntity));
const ProtectionNeedEntityToTest = await Entities('ProtectionNeed').get(CollectionNeedEntityToTest, getProtectionNeedId(ProtectionNeedEntity));
getProtectionNeedCategory(ProtectionNeedEntityToTest); // 'category'
getProtectionNeedGuarantee(ProtectionNeedEntityToTest); // 'guarantee'
getProtectionNeedIsSelected(ProtectionNeedEntityToTest); // false
getProtectionNeedLevel(ProtectionNeedEntityToTest); // levelEnum.FOUR
})();