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

# Aml

## Description

L'entité AML (Anti Money Laundering) permet de stocker les indicateurs de risque AML liés à la personne physique ou morale.

## Relations

### Ascendantes

| Entité   | Propriété |
| -------- | --------- |
| Company  | amls      |
| Contact  | amls      |
| Customer | amls      |
| Grantee  | amls      |
| Tns      | amls      |

### Descendantes

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

## Propriétés

| Nom                          | Type      | Description                                                                     | Validateur | Lecture seule ? | Dépréciée ? | Dernière version modifiée |
| ---------------------------- | --------- | ------------------------------------------------------------------------------- | ---------- | --------------- | ----------- | ------------------------- |
| isLegalEntity                | `Boolean` | Indique s'il s'agit d'une personne morale.                                      |            |                 |             | 2.4.0                     |
| isPoliticallyExposed         | `Boolean` | Est un bénéficiaire exposé politiquement.                                       |            |                 |             | 2.4.0                     |
| isRelationPoliticallyExposed | `Boolean` | Est un bénéficiaire ayant une relation avec une personne exposée politiquement. |            |                 |             | 2.4.0                     |
| id                           | `String`  | Identifiant de l'entité `Aml`                                                   |            | X               |             |                           |
| code                         | `String`  | Codification fonctionnelle de l'entité `Aml`                                    |            |                 |             |                           |
| externalId                   | `String`  | Identifiant de l'entité `Aml` dans le système client                            |            |                 |             |                           |
| externalCode                 | `String`  | Codification fonctionnelle de l'entité `Aml` dans le système client             |            |                 |             |                           |
| amlId                        | `String`  | Identifiant public de l'entité `Aml` dans l'OIP                                 |            |                 |             |                           |
| label                        | `String`  | Information relative au nom de l'entité `Aml` dans son contexte d'utilisation   |            |                 |             |                           |
| createdAt                    | `Date`    | Date de création de l'entité `Aml`                                              |            | X               |             |                           |
| updatedAt                    | `Date`    | Date de modification de l'entité `Aml`                                          |            | 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 { getAmlAmlId, getAmlCode, getAmlExternalCode, getAmlExternalId, getAmlId, getAmlIsLegalEntity, getAmlIsPoliticallyExposed, getAmlIsRelationPoliticallyExposed, getAmlLabel, setAmlAmlId, setAmlCode, setAmlExternalCode, setAmlExternalId, setAmlIsLegalEntity, setAmlIsPoliticallyExposed, setAmlIsRelationPoliticallyExposed, setAmlLabel } from '@fasstech/oip-core/entities/Aml';
import { getCompanyId } from '@fasstech/oip-core/entities/Company';
import { getProjectId } from '@fasstech/oip-core/entities/Project';

(async () => {
  let project = await Entities('Project').create();
  let company = await Entities('Company').create();
  const aml = await Entities('Aml').create();
  
  setAmlIsLegalEntity(false, aml);
  setAmlIsPoliticallyExposed(false, aml);
  setAmlIsRelationPoliticallyExposed(false, aml);
  setAmlCode('code', aml);
  setAmlExternalId('externalId', aml);
  setAmlExternalCode('externalCode', aml);
  setAmlAmlId('amlId', aml);
  setAmlLabel('label', aml);
  
  company = await Entities('Aml').save(company, aml);
  project = await Entities('Company').save(project, company);
  await Entities('Project').save(project);
  
  const projectToTest = await Entities('Project').get({ id: getProjectId(project) });
  const companyToTest = await Entities('Company').get(projectToTest, { filter: ({ id }) => id === getCompanyId(company) });
  const amlToTest = await Entities('Aml').get(companyToTest, { filter: ({ id }) => id === getAmlId(aml) });
  
  getAmlIsLegalEntity(amlToTest); // false
  getAmlIsPoliticallyExposed(amlToTest); // false
  getAmlIsRelationPoliticallyExposed(amlToTest); // false
  getAmlCode(amlToTest); // 'code'
  getAmlExternalId(amlToTest); // 'externalId'
  getAmlExternalCode(amlToTest); // 'externalCode'
  getAmlAmlId(amlToTest); // 'amlId'
  getAmlLabel(amlToTest); // 'label'
})();
```
