Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BC-5268 move alert api to nest #4929

Merged
merged 45 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
97d5d13
BC-5268 move alert api to nest
Apr 15, 2024
2c22c8c
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 15, 2024
c0e4279
add basic test
Apr 16, 2024
2ba863c
fix lint
Apr 16, 2024
08e5356
add api test
Apr 16, 2024
a49c032
fix api tests
Apr 16, 2024
171af12
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 16, 2024
d65eca9
fix api test
Apr 16, 2024
ad98528
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 17, 2024
9bb1044
fix test
Apr 17, 2024
ede9fac
fix test
Apr 17, 2024
6585352
add status adapter test
Apr 17, 2024
bf90fb9
add tests
Apr 18, 2024
f32f07c
fix tests
Apr 18, 2024
77ebd6f
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 18, 2024
27fdf30
fix tests
Apr 18, 2024
6101db9
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 19, 2024
107f0a1
restore configuration
Apr 19, 2024
e72ad6f
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 19, 2024
e2d9ddf
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 19, 2024
5760f43
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 19, 2024
ef30cdd
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 19, 2024
37cfb68
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 19, 2024
8b3470a
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 22, 2024
e83a823
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 22, 2024
98733df
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 22, 2024
6d16ede
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 22, 2024
7d40e95
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 22, 2024
bbaee96
Merge branch 'main' into BC-5268-move-alert-to-nest
Apr 22, 2024
fd1848c
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 22, 2024
1459d12
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 23, 2024
3928f1d
add alert config
Apr 24, 2024
574386d
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 24, 2024
a96e3ab
add test
Apr 24, 2024
fc4e04d
add handling diffrent status responses
Apr 24, 2024
a36b144
fix lint
Apr 24, 2024
a9cef24
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 25, 2024
175d7ca
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 25, 2024
94196e2
Merge branch 'main' into BC-5268-move-alert-to-nest
CeEv Apr 25, 2024
77190cd
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 25, 2024
077f97b
refactor
Apr 25, 2024
4616452
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 25, 2024
6ed9f65
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 26, 2024
787d688
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 26, 2024
7ad8c4c
Merge branch 'main' into BC-5268-move-alert-to-nest
wiaderwek Apr 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading