---
title: GDPR
slug: oip-next/sfgdpxpbal53imakv801u
createdAt: 2024-02-21T13:33:51.000Z
---

# GDPR

## Description

L'entité GDPR regroupe les informations relatives au consentement RGPD d’une personne.

## Relations

### Ascendantes

| Entité   | Propriété |
| -------- | --------- |
| Company  | GDPRs     |
| Contact  | GDPRs     |
| Customer | GDPRs     |
| Employee | GDPRs     |
| Grantee  | GDPRs     |
| Tns      | GDPRs     |
| User     | GDPRs     |

### Descendantes

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

## Liste des propriétés

| Nom       | Type      | Dernière version modifiée | Description                                                   | Getter           | Setter           | Deprecated |
| --------- | --------- | ------------------------- | ------------------------------------------------------------- | ---------------- | ---------------- | ---------- |
| createdAt | `Date`    |                           | Date de création de l'entité `GDPR`                           | getGDPRCreatedAt | Lecture seule    | -          |
| createdBy | `String`  |                           | Utilisateur à l'origine de la création de l'entité `GDPR`     | getGDPRCreatedBy | Lecture seule    | -          |
| date      | `Date`    |                           | Date du consentement de l'utilisateur                         | getGDPRDate      | setGDPRDate      | -          |
| id        | `String`  |                           | Identifiant unique de l'entité `GDPR`                         | getGDPRId        | Lecture seule    | -          |
| isConsent | `Boolean` |                           | Indique si l'utilisateur donne son consentement RGPD          | getGDPRIsConsent | setGDPRIsConsent | -          |
| updatedAt | `Date`    |                           | Date de modification de l'entité `GDPR`                       | getGDPRUpdatedAt | Lecture seule    | -          |
| updatedBy | `String`  |                           | Utilisateur à l'origine de la modification de l'entité `GDPR` | getGDPRUpdatedBy | Lecture seule    | -          |

## Enums

Aucune enumération disponible pour cette entité.

## Exemple

```javascript
import { Entities } from '@fasstech/oip-core';
import { getGDPRDate, getGDPRId, getGDPRIsConsent, setGDPRDate, setGDPRIsConsent } from '@fasstech/oip-core/entities/GDPR';
import { getCompanyId } from '@fasstech/oip-core/entities/company';
import { getProjectId } from '@fasstech/oip-core/entities/project';

(async () => {
  let ProjectEntity = await Entities('Project').get({ id: projectId });
  let CompanyEntity = await Entities('Company').create();
  const GDPREntity = await Entities('GDPR').create();
  
  setGDPRDate(new Date('2017-01-01'), GDPREntity);
  setGDPRIsConsent(false, GDPREntity);
  
  CompanyEntity = await Entities('GDPR').save(CompanyEntity, GDPREntity);
  ProjectEntity = await Entities('Company').save(ProjectEntity, CompanyEntity);
  await Entities('Project').save(ProjectEntity);
  
  const ProjectEntityToTest = await Entities('Project').get({ id: getProjectId(ProjectEntity) });
  const CompanyEntityToTest = await Entities('Company').get(ProjectEntityToTest, getCompanyId(CompanyEntity));
  const GDPREntityToTest = await Entities('GDPR').get(CompanyEntityToTest, getGDPRId(GDPREntity));
  
  getGDPRDate(GDPREntityToTest); // new Date('2017-01-01')
  getGDPRIsConsent(GDPREntityToTest); // false
})();
```
