Skip to content

Commit 7f67bb4

Browse files
committed
feat: update version and add description field to IncidentEntityV2
1 parent 1afaa02 commit 7f67bb4

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/Services/Status.Entities.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const enum NameEnum {
2323
/**
2424
* @author Aloento
2525
* @since 1.0.0
26-
* @version 0.1.0
26+
* @version 0.2.0
2727
*/
2828
export interface IncidentEntityV2 {
2929
title: string;
@@ -35,6 +35,7 @@ export interface IncidentEntityV2 {
3535
start_date: string;
3636
updates?: UpdateEntityV2[];
3737
type: string;
38+
description?: string;
3839
}
3940

4041
interface UpdateEntityV2 {

src/Services/Status.Trans.V2.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ export function TransformerV2({ Components, Events }: { Components: StatusEntity
140140
Status: IsIncident(type) ? EventStatus.Analysing : EventStatus.Planned,
141141
Histories: new Set(),
142142
RegionServices: new Set(),
143+
Description: event.description
143144
};
144145

145146
if (event.end_date) {
@@ -237,6 +238,7 @@ export function TransformerV2({ Components, Events }: { Components: StatusEntity
237238

238239
if (dbEvent.End &&
239240
!IsIncident(type) &&
241+
dbEvent.Status !== EventStatus.Cancelled &&
240242
dayjs(dbEvent.End).isBefore(dayjs())) {
241243
dbEvent.Status = EventStatus.Completed;
242244
}

0 commit comments

Comments
 (0)