Skip to content
/ api Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 0 additions & 13 deletions src/matches/events/MatchMapResetRoundEvent.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
import MatchEventProcessor from "./abstracts/MatchEventProcessor";
import { HasuraService } from "../../hasura/hasura.service";
import { MatchAssistantService } from "../match-assistant/match-assistant.service";
import { Logger } from "@nestjs/common";
import { ChatService } from "../../chat/chat.service";

export default class MatchMapResetRoundEvent extends MatchEventProcessor<{
round: string;
match_map_id: string;
}> {
constructor(
logger: Logger,
hasura: HasuraService,
matchAssistant: MatchAssistantService,
chat: ChatService,
) {
super(logger, hasura, matchAssistant, chat);
}

public async process() {
const statsRound = parseInt(this.data.round);

Expand Down
15 changes: 0 additions & 15 deletions src/matches/events/MatchMapStatusEvent.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
import MatchEventProcessor from "./abstracts/MatchEventProcessor";
import { e_match_map_status_enum } from "../../../generated";
import { HasuraService } from "../../hasura/hasura.service";
import { MatchAssistantService } from "../match-assistant/match-assistant.service";
import { Logger } from "@nestjs/common";
import { ChatService } from "../../chat/chat.service";
import { NotificationsService } from "../../notifications/notifications.service";

export default class MatchMapStatusEvent extends MatchEventProcessor<{
status: e_match_map_status_enum;
winning_lineup_id?: string;
}> {
constructor(
logger: Logger,
hasura: HasuraService,
matchAssistant: MatchAssistantService,
chat: ChatService,
private readonly notifications: NotificationsService,
) {
super(logger, hasura, matchAssistant, chat);
}

public async process() {
const { matches_by_pk: match } = await this.hasura.query({
matches_by_pk: {
Expand Down
2 changes: 2 additions & 0 deletions src/matches/events/abstracts/MatchEventProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Injectable, Logger, Scope } from "@nestjs/common";
import { HasuraService } from "../../../hasura/hasura.service";
import { MatchAssistantService } from "../../match-assistant/match-assistant.service";
import { ChatService } from "../../../chat/chat.service";
import { NotificationsService } from "../../../notifications/notifications.service";

@Injectable({ scope: Scope.REQUEST })
export default abstract class MatchEventProcessor<T> {
Expand All @@ -13,6 +14,7 @@ export default abstract class MatchEventProcessor<T> {
protected readonly hasura: HasuraService,
protected readonly matchAssistant: MatchAssistantService,
protected readonly chat: ChatService,
protected readonly notifications: NotificationsService,
) {}

public setData(matchId: string, data: T) {
Expand Down
Loading