Contact
Contact
Description
L'entité Contact permet la gestion des différents contacts liés au projet :destinataire de mail, signataire, représentant légal, etc.
Relations
Ascendantes
Entité | Propriété |
|---|---|
Project | contacts |
Descendantes
Entité | Propriété |
|---|---|
GDPR | GDPRs |
Address | address |
Address | addresses |
Aml | aml |
BankAccount | bankAccounts |
emails | |
History | history |
Phone | phones |
SocialSecurity | socialSecurity |
Liste des propriétés
Nom | Type | DerniÚre version modifiée | Description | Getter | Setter | Deprecated |
|---|---|---|---|---|---|---|
civility | CivilityEnum | 2.1.0 | Civilité | getContactCivility | setContactCivility | - |
companyName | String | 2.6.0 | Nom de la société du contact | getContactCompanyName | setContactCompanyName | - |
createdAt | Date | ï»ż | Date de crĂ©ation de l'entitĂ© Contact | getContactCreatedAt | Lecture seule | - |
createdBy | String | ï»ż | Utilisateur Ă l'origine de la crĂ©ation de l'entitĂ© Contact | getContactCreatedBy | Lecture seule | - |
String | 2.1.0 | Email du contact | getContactEmail | setContactEmail | Utiliser l'entité emails | |
externalId | String | 2.4.0 | Identifiant externe du contact | getContactExternalId | setContactExternalId | - |
firstName | String | 2.1.0 | Prénom du contact | getContactFirstName | setContactFirstName | - |
id | String | ï»ż | Identifiant unique de l'entitĂ© Contact | getContactId | Lecture seule | - |
isPEP | Boolean | 2.1.0 | Personne Politiquement Exposée | getContactIsPEP | setContactIsPEP | - |
isRecipient | Boolean | 2.1.0 | Permet de savoir si le contact est destinataire du mail | getContactIsRecipient | setContactIsRecipient | - |
isSignatory | Boolean | 2.1.0 | Permet de savoir si le contact est signataire | getContactIsSignatory | setContactIsSignatory | - |
lastName | String | 2.1.0 | Nom de famille du contact | getContactLastName | setContactLastName | - |
mobilePhoneIndicative | String | 2.1.0 | Indicatif téléphonique mobile | getContactMobilePhoneIndicative | setContactMobilePhoneIndicative | Utiliser l'entité phones |
mobilePhoneNumber | String | 2.1.0 | Numéro de téléphone mobile | getContactMobilePhoneNumber | setContactMobilePhoneNumber | Utiliser l'entité phones |
phoneIndicative | String | 2.1.0 | Indicatif téléphonique | getContactPhoneIndicative | setContactPhoneIndicative | Utiliser l'entité phones |
phoneNumber | String | 2.1.0 | Numéro de téléphone | getContactPhoneNumber | setContactPhoneNumber | Utiliser l'entité phones |
role | RoleEnum | 2.1.0 | RĂŽle du contact | getContactRole | setContactRole | - |
updatedAt | Date | ï»ż | Date de modification de l'entitĂ© Contact | getContactUpdatedAt | Lecture seule | - |
updatedBy | String | ï»ż | Utilisateur Ă l'origine de la modification de l'entitĂ© Contact | getContactUpdatedBy | Lecture seule | - |
Enums
CivilityEnum
- CivilityEnum.MISS
- CivilityEnum.MISTER
RoleEnum
- RoleEnum.ACCOUNTANT
- RoleEnum.ADMINISTRATIVE_MANAGER
- RoleEnum.BROKER
- RoleEnum.COMMERCIAL
- RoleEnum.FINANCIAL_OFFICER
- RoleEnum.HEAD_MANAGER
- RoleEnum.HR_MANAGER
- RoleEnum.LEGAL_REPRESENTATIVE
- RoleEnum.MANAGER
- RoleEnum.OTHER
Exemple
import { Entities } from '@fasstech/oip-core';
import { getContactCivility, getContactCompanyName, getContactEmail, getContactExternalId, getContactFirstName, getContactIsPEP, getContactIsRecipient, getContactIsSignatory, getContactLastName, getContactMobilePhoneIndicative, getContactMobilePhoneNumber, getContactPhoneIndicative, getContactPhoneNumber, getContactRole, getcontactId, setContactCivility, setContactCompanyName, setContactEmail, setContactExternalId, setContactFirstName, setContactIsPEP, setContactIsRecipient, setContactIsSignatory, setContactLastName, setContactMobilePhoneIndicative, setContactMobilePhoneNumber, setContactPhoneIndicative, setContactPhoneNumber, setContactRole } from '@fasstech/oip-core/entities/contact';
import { CivilityEnum, RoleEnum } from '@fasstech/oip-core/entities/contact/enums';
import { getProjectId } from '@fasstech/oip-core/entities/project';
(async () => {
let ProjectEntity = await Entities('Project').get({ id: projectId });
const ContactEntity = await Entities('Contact').create();
setContactCivility(CivilityEnum.MISTER, ContactEntity);
setContactCompanyName('companyName', ContactEntity);
setContactEmail('email', ContactEntity);
setContactExternalId('externalId', ContactEntity);
setContactFirstName('firstName', ContactEntity);
setContactIsPEP(false, ContactEntity);
setContactIsRecipient(false, ContactEntity);
setContactIsSignatory(false, ContactEntity);
setContactLastName('lastName', ContactEntity);
setContactMobilePhoneIndicative('mobilePhoneIndicative', ContactEntity);
setContactMobilePhoneNumber('mobilePhoneNumber', ContactEntity);
setContactPhoneIndicative('phoneIndicative', ContactEntity);
setContactPhoneNumber('phoneNumber', ContactEntity);
setContactRole(RoleEnum.FINANCIAL_OFFICER, ContactEntity);
ProjectEntity = await Entities('Contact').save(ProjectEntity, ContactEntity);
await Entities('Project').save(ProjectEntity);
const ProjectEntityToTest = await Entities('Project').get({ id: getProjectId(ProjectEntity) });
const ContactEntityToTest = await Entities('Contact').get(ProjectEntityToTest, getContactId(ContactEntity));
getContactCivility(ContactEntityToTest); // CivilityEnum.MISTER
getContactCompanyName(ContactEntityToTest); // 'companyName'
getContactEmail(ContactEntityToTest); // 'email'
getContactExternalId(ContactEntityToTest); // 'externalId'
getContactFirstName(ContactEntityToTest); // 'firstName'
getContactIsPEP(ContactEntityToTest); // false
getContactIsRecipient(ContactEntityToTest); // false
getContactIsSignatory(ContactEntityToTest); // false
getContactLastName(ContactEntityToTest); // 'lastName'
getContactMobilePhoneIndicative(ContactEntityToTest); // 'mobilePhoneIndicative'
getContactMobilePhoneNumber(ContactEntityToTest); // 'mobilePhoneNumber'
getContactPhoneIndicative(ContactEntityToTest); // 'phoneIndicative'
getContactPhoneNumber(ContactEntityToTest); // 'phoneNumber'
getContactRole(ContactEntityToTest); // RoleEnum.FINANCIAL_OFFICER
})();