Add Discord event announcement functionality to backend
Some checks failed
CI / backend (push) Has been cancelled
CI / frontend (push) Has been cancelled
CI / compose (push) Has been cancelled

This commit introduces a new Discord event announcer to the backend, allowing for event announcements via Discord. It includes the addition of new environment variables for Discord configuration in `.env.example` and `compose.yaml`. The `main.go` file has been updated to initialize the announcer, and a new `discord` package has been created, containing the announcer logic and tests. Additionally, the service layer has been modified to support bracket draft management, enhancing the overall event workflow. Integration tests have been updated to ensure proper functionality of the new features.
This commit is contained in:
2026-07-19 11:21:11 +03:00
parent b7a78b4384
commit ae19c03542
31 changed files with 1632 additions and 88 deletions

View File

@@ -0,0 +1,26 @@
-- +mixmaker Up
ALTER TABLE events DROP CONSTRAINT IF EXISTS events_state_check;
ALTER TABLE events ADD CONSTRAINT events_state_check CHECK (state IN (
'RegistrationOpen', 'RegistrationClosed', 'Balancing',
'RostersDraft', 'RostersConfirmed', 'BracketDraft', 'Live', 'Completed', 'Cancelled'
));
ALTER TABLE tournaments ADD COLUMN IF NOT EXISTS version integer NOT NULL DEFAULT 0;
CREATE TABLE IF NOT EXISTS event_bracket_drafts (
event_id text PRIMARY KEY REFERENCES events(id) ON DELETE CASCADE,
body jsonb NOT NULL,
version integer NOT NULL DEFAULT 0,
confirmed boolean NOT NULL DEFAULT false,
updated_at timestamptz NOT NULL DEFAULT now()
);
-- +mixmaker Down
DROP TABLE IF EXISTS event_bracket_drafts;
ALTER TABLE tournaments DROP COLUMN IF EXISTS version;
UPDATE events SET state = 'RostersConfirmed' WHERE state = 'BracketDraft';
ALTER TABLE events DROP CONSTRAINT IF EXISTS events_state_check;
ALTER TABLE events ADD CONSTRAINT events_state_check CHECK (state IN (
'RegistrationOpen', 'RegistrationClosed', 'Balancing',
'RostersDraft', 'RostersConfirmed', 'Live', 'Completed', 'Cancelled'
));