Skip to content

Commit

Permalink
BC-5268 move alert api to nest (#4929)
Browse files Browse the repository at this point in the history
* BC-5268 move alert api to nest

---------

Co-authored-by: Tomasz Wiaderek <[email protected]>
Co-authored-by: Cedric Evers <[email protected]>
  • Loading branch information
3 people authored Apr 29, 2024
1 parent 2cba8e4 commit 30fbd28
Show file tree
Hide file tree
Showing 47 changed files with 1,004 additions and 458 deletions.
53 changes: 53 additions & 0 deletions apps/server/src/modules/alert/adapter/dto/component.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
export class ComponentDto {
constructor(
id: number,
name: string,
description: string,
link: string,
status: number,
order: number,
group_id: number,
created_at: Date,
updated_at: Date,
deleted_at: Date,
enabled: boolean,
status_name: string
) {
this.id = id;
this.name = name;
this.description = description;
this.link = link;
this.status = status;
this.order = order;
this.group_id = group_id;
this.created_at = created_at;
this.updated_at = updated_at;
this.deleted_at = deleted_at;
this.enabled = enabled;
this.status_name = status_name;
}

id: number;

name: string;

description: string;

link: string;

status: number;

order: number;

group_id: number;

created_at: Date;

updated_at: Date;

deleted_at: Date;

enabled: boolean;

status_name: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { ComponentDto } from './component.dto';

export class ComponentResponse {
constructor(data: ComponentDto) {
this.data = data;
}

data: ComponentDto;
}
89 changes: 89 additions & 0 deletions apps/server/src/modules/alert/adapter/dto/incident.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
export class IncidentDto {
constructor(
id: number,
component_id: number,
name: string,
status: number,
message: string,
created_at: Date,
updated_at: Date,
deleted_at: Date,
visible: number,
stickied: boolean,
occurred_at: Date,
user_id: number,
notifications: boolean,
is_resolved: boolean,
human_status: string,
latest_update_id: number,
latest_status: number,
latest_human_status: string,
latest_icon: string,
permalink: string,
duration: number
) {
this.id = id;
this.component_id = component_id;
this.name = name;
this.status = status;
this.message = message;
this.created_at = created_at;
this.updated_at = updated_at;
this.deleted_at = deleted_at;
this.visible = visible;
this.stickied = stickied;
this.occurred_at = occurred_at;
this.user_id = user_id;
this.notifications = notifications;
this.is_resolved = is_resolved;
this.human_status = human_status;
this.latest_update_id = latest_update_id;
this.latest_status = latest_status;
this.latest_human_status = latest_human_status;
this.latest_icon = latest_icon;
this.permalink = permalink;
this.duration = duration;
}

id: number;

component_id: number;

name: string;

status: number;

message: string;

created_at: Date;

updated_at: Date;

deleted_at: Date;

visible: number;

stickied: boolean;

occurred_at: Date;

user_id: number;

notifications: boolean;

is_resolved: boolean;

human_status: string;

latest_update_id: number;

latest_status: number;

latest_human_status: string;

latest_icon: string;

permalink: string;

duration: number;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { IncidentDto } from './incident.dto';

export class IncidentsResponse {
constructor(data: IncidentDto[]) {
this.data = data;
}

data: IncidentDto[];
}
5 changes: 5 additions & 0 deletions apps/server/src/modules/alert/adapter/dto/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export * from './component.dto';
export * from './component.response';
export * from './incident.dto';
export * from './incidents.response';
export * from './messages.dto';
12 changes: 12 additions & 0 deletions apps/server/src/modules/alert/adapter/dto/messages.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Message } from '../../controller/dto';

export class MessagesDto {
constructor(messages: [], success: boolean) {
this.messages = messages;
this.success = success;
}

messages: Message[];

success: boolean;
}
5 changes: 5 additions & 0 deletions apps/server/src/modules/alert/adapter/enum/importance.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export enum Importance {
INGORE = -1,
ALL_INSTANCES = 0,
CURRENT_INSTANCE = 1,
}
1 change: 1 addition & 0 deletions apps/server/src/modules/alert/adapter/enum/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './importance';
1 change: 1 addition & 0 deletions apps/server/src/modules/alert/adapter/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './status.adapter';
Loading

0 comments on commit 30fbd28

Please sign in to comment.