Skip to content

Commit 6201579

Browse files
authored
fix: move NotificationsService to parent MatchEventProcessor (#135)
Co-authored-by: Flegma <Flegma@users.noreply.github.com>
1 parent e20cab6 commit 6201579

3 files changed

Lines changed: 2 additions & 28 deletions

File tree

src/matches/events/MatchMapResetRoundEvent.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
11
import MatchEventProcessor from "./abstracts/MatchEventProcessor";
2-
import { HasuraService } from "../../hasura/hasura.service";
3-
import { MatchAssistantService } from "../match-assistant/match-assistant.service";
4-
import { Logger } from "@nestjs/common";
5-
import { ChatService } from "../../chat/chat.service";
62

73
export default class MatchMapResetRoundEvent extends MatchEventProcessor<{
84
round: string;
95
match_map_id: string;
106
}> {
11-
constructor(
12-
logger: Logger,
13-
hasura: HasuraService,
14-
matchAssistant: MatchAssistantService,
15-
chat: ChatService,
16-
) {
17-
super(logger, hasura, matchAssistant, chat);
18-
}
19-
207
public async process() {
218
const statsRound = parseInt(this.data.round);
229

src/matches/events/MatchMapStatusEvent.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,10 @@
11
import MatchEventProcessor from "./abstracts/MatchEventProcessor";
22
import { e_match_map_status_enum } from "../../../generated";
3-
import { HasuraService } from "../../hasura/hasura.service";
4-
import { MatchAssistantService } from "../match-assistant/match-assistant.service";
5-
import { Logger } from "@nestjs/common";
6-
import { ChatService } from "../../chat/chat.service";
7-
import { NotificationsService } from "../../notifications/notifications.service";
83

94
export default class MatchMapStatusEvent extends MatchEventProcessor<{
105
status: e_match_map_status_enum;
116
winning_lineup_id?: string;
127
}> {
13-
constructor(
14-
logger: Logger,
15-
hasura: HasuraService,
16-
matchAssistant: MatchAssistantService,
17-
chat: ChatService,
18-
private readonly notifications: NotificationsService,
19-
) {
20-
super(logger, hasura, matchAssistant, chat);
21-
}
22-
238
public async process() {
249
const { matches_by_pk: match } = await this.hasura.query({
2510
matches_by_pk: {

src/matches/events/abstracts/MatchEventProcessor.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Injectable, Logger, Scope } from "@nestjs/common";
22
import { HasuraService } from "../../../hasura/hasura.service";
33
import { MatchAssistantService } from "../../match-assistant/match-assistant.service";
44
import { ChatService } from "../../../chat/chat.service";
5+
import { NotificationsService } from "../../../notifications/notifications.service";
56

67
@Injectable({ scope: Scope.REQUEST })
78
export default abstract class MatchEventProcessor<T> {
@@ -13,6 +14,7 @@ export default abstract class MatchEventProcessor<T> {
1314
protected readonly hasura: HasuraService,
1415
protected readonly matchAssistant: MatchAssistantService,
1516
protected readonly chat: ChatService,
17+
protected readonly notifications: NotificationsService,
1618
) {}
1719

1820
public setData(matchId: string, data: T) {

0 commit comments

Comments
 (0)