ErrorHistory
ErrorHistory
Description
L'entité ErrorHistory permet de stocker les détails d'une erreur liée à l'OAV. Elles sont à corréler directement avec l'impact métier pour le client. Elles sont la source de données du tableau de bord technique.
Relations
Ascendantes
Entité | Propriété |
|---|---|
Project | errorHistory |
Descendantes
Entité | Propriété |
|---|
Propriétés
Nom | Type | Description | Validateur | Lecture seule ? | Dépréciée ? | DerniÚre version modifiée |
|---|---|---|---|---|---|---|
criticality | ErrorHistoryCriticalityEnum | Niveau d'impact business. | ï»ż | ï»ż | ï»ż | 2.9.0 |
errorTime | Date | Date en millisecondes Ă laquelle l'erreur est survenue. | ï»ż | ï»ż | ï»ż | 2.9.0 |
metadata | Json | Informations additionnelles et/ou contextuelles. | ï»ż | ï»ż | ï»ż | 2.9.0 |
stack | Json | Erreur technique. | ï»ż | ï»ż | ï»ż | 2.9.0 |
status | Json | Statut du cycle impactĂ© par l'erreur. | ï»ż | ï»ż | ï»ż | 2.9.0 |
type | ErrorHistoryTypeEnum | Indique le type de l'erreur. | ï»ż | ï»ż | ï»ż | 2.9.0 |
id | String | Identifiant de l'entitĂ© ErrorHistory | ï»ż | X | ï»ż | ï»ż |
code | String | Codification fonctionnelle de l'entitĂ© ErrorHistory | ï»ż | ï»ż | ï»ż | ï»ż |
externalId | String | Identifiant de l'entitĂ© ErrorHistory dans le systĂšme client | ï»ż | ï»ż | ï»ż | ï»ż |
externalCode | String | Codification fonctionnelle de l'entitĂ© ErrorHistory dans le systĂšme client | ï»ż | ï»ż | ï»ż | ï»ż |
errorHistoryId | String | Identifiant public de l'entitĂ© ErrorHistory dans l'OIP | ï»ż | ï»ż | ï»ż | ï»ż |
label | String | Information relative au nom de l'entitĂ© ErrorHistory dans son contexte d'utilisation | ï»ż | ï»ż | ï»ż | ï»ż |
createdAt | Date | Date de crĂ©ation de l'entitĂ© ErrorHistory | ï»ż | X | ï»ż | ï»ż |
updatedAt | Date | Date de modification de l'entitĂ© ErrorHistory | ï»ż | X | ï»ż | ï»ż |
Enumérations
ErrorHistoryCriticalityEnum
- CRITICAL
- HIGH
- LOW
- MEDIUM
ErrorHistoryTypeEnum
- ERROR
- INFO
- WARNING
Enumérations génériques
Aucune enumération générique.
Exemple
import { Entities } from '@fasstech/oip-core';
import { getErrorHistoryCode, getErrorHistoryCriticality, getErrorHistoryErrorHistoryId, getErrorHistoryErrorTime, getErrorHistoryExternalCode, getErrorHistoryExternalId, getErrorHistoryId, getErrorHistoryLabel, getErrorHistoryMetadata, getErrorHistoryStack, getErrorHistoryStatus, getErrorHistoryType, setErrorHistoryCode, setErrorHistoryCriticality, setErrorHistoryErrorHistoryId, setErrorHistoryErrorTime, setErrorHistoryExternalCode, setErrorHistoryExternalId, setErrorHistoryLabel, setErrorHistoryMetadata, setErrorHistoryStack, setErrorHistoryStatus, setErrorHistoryType } from '@fasstech/oip-core/entities/ErrorHistory';
import { ErrorHistoryCriticalityEnum, ErrorHistoryTypeEnum } from '@fasstech/oip-core/entities/ErrorHistory/enums';
import { getProjectId } from '@fasstech/oip-core/entities/Project';
(async () => {
let project = await Entities('Project').create();
const errorHistory = await Entities('ErrorHistory').create();
setErrorHistoryCriticality(ErrorHistoryCriticalityEnum.MEDIUM, errorHistory);
setErrorHistoryErrorTime(new Date('2017-01-01'), errorHistory);
setErrorHistoryMetadata({ metadata: 'foo' }, errorHistory);
setErrorHistoryStack({ stack: 'foo' }, errorHistory);
setErrorHistoryStatus({ status: 'foo' }, errorHistory);
setErrorHistoryType(ErrorHistoryTypeEnum.WARNING, errorHistory);
setErrorHistoryCode('code', errorHistory);
setErrorHistoryExternalId('externalId', errorHistory);
setErrorHistoryExternalCode('externalCode', errorHistory);
setErrorHistoryErrorHistoryId('errorHistoryId', errorHistory);
setErrorHistoryLabel('label', errorHistory);
project = await Entities('ErrorHistory').save(project, errorHistory);
await Entities('Project').save(project);
const projectToTest = await Entities('Project').get({ id: getProjectId(project) });
const errorHistoryToTest = await Entities('ErrorHistory').get(projectToTest, { filter: ({ id }) => id === getErrorHistoryId(errorHistory) });
getErrorHistoryCriticality(errorHistoryToTest); // ErrorHistoryCriticalityEnum.MEDIUM
getErrorHistoryErrorTime(errorHistoryToTest); // new Date('2017-01-01')
getErrorHistoryMetadata(errorHistoryToTest); // { metadata: 'foo' }
getErrorHistoryStack(errorHistoryToTest); // { stack: 'foo' }
getErrorHistoryStatus(errorHistoryToTest); // { status: 'foo' }
getErrorHistoryType(errorHistoryToTest); // ErrorHistoryTypeEnum.WARNING
getErrorHistoryCode(errorHistoryToTest); // 'code'
getErrorHistoryExternalId(errorHistoryToTest); // 'externalId'
getErrorHistoryExternalCode(errorHistoryToTest); // 'externalCode'
getErrorHistoryErrorHistoryId(errorHistoryToTest); // 'errorHistoryId'
getErrorHistoryLabel(errorHistoryToTest); // 'label'
})();