---
title: Mandate
slug: oip-next/e0hixvnqaeq31ox9toz8d
createdAt: 2024-02-21T13:33:30.000Z
---

# Mandate

## Description

L'entité Mandate regroupe les informations relatives au mandat de prélèvement.

## Relations

### Ascendantes

| Entité        | Propriété |
| ------------- | --------- |
| BankAccount   | mandates  |
| PaymentMethod | mandate   |

### Descendantes

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

## Liste des propriétés

| Nom               | Type      | Dernière version modifiée | Description                                                                     | Getter                      | Setter                      | Deprecated |
| ----------------- | --------- | ------------------------- | ------------------------------------------------------------------------------- | --------------------------- | --------------------------- | ---------- |
| ICS               | `String`  |                           | L'Identifiant Créancier SEPA (ICS)                                              | getMandateICS               | setMandateICS               | -          |
| RUM               | `String`  |                           | La Référence Unique de Mandat                                                   | getMandateRUM               | setMandateRUM               | -          |
| createdAt         | `Date`    |                           | Date de création de l'entité `Mandate`                                          | getMandateCreatedAt         | Lecture seule               | -          |
| createdBy         | `String`  |                           | Utilisateur à l'origine de la création de l'entité `Mandate`                    | getMandateCreatedBy         | Lecture seule               | -          |
| id                | `String`  |                           | Identifiant unique de l'entité `Mandate`                                        | getMandateId                | Lecture seule               | -          |
| isActive          | `Boolean` |                           | Indique si le mandat est actif                                                  | getMandateIsActive          | setMandateIsActive          | -          |
| label             | `String`  |                           | label Descriptif/commentaire qualifiant le mandat, apparait sur relevé bancaire | getMandateLabel             | setMandateLabel             | -          |
| signDate          | `Date`    |                           | Date de signature du mandat                                                     | getMandateSignDate          | setMandateSignDate          | -          |
| updatedAt         | `Date`    |                           | Date de modification de l'entité `Mandate`                                      | getMandateUpdatedAt         | Lecture seule               | -          |
| updatedBy         | `String`  |                           | Utilisateur à l'origine de la modification de l'entité `Mandate`                | getMandateUpdatedBy         | Lecture seule               | -          |
| validityEndDate   | `Date`    |                           | Date de fin de prélèvement                                                      | getMandateValidityEndDate   | setMandateValidityEndDate   | -          |
| validityStartDate | `Date`    |                           | Date de début de prélèvement                                                    | getMandateValidityStartDate | setMandateValidityStartDate | -          |

## Enums

Aucune enumération disponible pour cette entité.

## Exemple

```javascript
import { Entities } from '@fasstech/oip-core';
import { getCompanyId } from '@fasstech/oip-core/entities/company';
import { getMandateICS, getMandateIsActive, getMandateLabel, getMandateRUM, getMandateSignDate, getMandateValidityEndDate, getMandateValidityStartDate, getmandateId, setMandateICS, setMandateIsActive, setMandateLabel, setMandateRUM, setMandateSignDate, setMandateValidityEndDate, setMandateValidityStartDate } from '@fasstech/oip-core/entities/mandate';
import { getProjectId } from '@fasstech/oip-core/entities/project';

(async () => {
  let ProjectEntity = await Entities('Project').get({ id: projectId });
  let CompanyEntity = await Entities('Company').create();
  let BankAccountEntity = await Entities('BankAccount').get(CompanyEntity);
  const MandateEntity = await Entities('Mandate').create();
  
  setMandateICS('IIIIIIIIIIIII', MandateEntity);
  setMandateRUM('RRRRRRRRRRRRRRRRRRRRRRRRRRRRRR', MandateEntity);
  setMandateIsActive(false, MandateEntity);
  setMandateLabel('label', MandateEntity);
  setMandateSignDate(new Date('2017-01-01'), MandateEntity);
  setMandateValidityEndDate(new Date('2017-01-01'), MandateEntity);
  setMandateValidityStartDate(new Date('2017-01-01'), MandateEntity);
  
  BankAccountEntity = await Entities('Mandate').save(BankAccountEntity, MandateEntity);
  CompanyEntity = await Entities('BankAccount').save(CompanyEntity, BankAccountEntity);
  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 BankAccountEntityToTest = await Entities('BankAccount').get(CompanyEntityToTest);
  const MandateEntityToTest = await Entities('Mandate').get(BankAccountEntityToTest, getMandateId(MandateEntity));
  
  getMandateICS(MandateEntityToTest); // 'IIIIIIIIIIIII'
  getMandateRUM(MandateEntityToTest); // 'RRRRRRRRRRRRRRRRRRRRRRRRRRRRRR'
  getMandateIsActive(MandateEntityToTest); // false
  getMandateLabel(MandateEntityToTest); // 'label'
  getMandateSignDate(MandateEntityToTest); // new Date('2017-01-01')
  getMandateValidityEndDate(MandateEntityToTest); // new Date('2017-01-01')
  getMandateValidityStartDate(MandateEntityToTest); // new Date('2017-01-01')
})();
```
