-
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add default poker and retro settings feature
Add UI for updating default retro settings Fix retro settings request body validation Add UI for updating default poker settings Start building UI for default retro and poker settings Add http handlers for retro and poker settings
- Loading branch information
1 parent
bcb1750
commit 9b0a189
Showing
21 changed files
with
9,185 additions
and
2,263 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
65 changes: 65 additions & 0 deletions
65
internal/db/migrations/20241014235301_create_poker_retro_settings_tables.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
-- +goose Up | ||
-- +goose StatementBegin | ||
|
||
CREATE TABLE thunderdome.poker_settings ( | ||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(), | ||
organization_id UUID REFERENCES thunderdome.organization(id) ON DELETE CASCADE, | ||
department_id UUID REFERENCES thunderdome.organization_department(id) ON DELETE CASCADE, | ||
team_id UUID REFERENCES thunderdome.team(id) ON DELETE CASCADE, | ||
auto_finish_voting BOOLEAN DEFAULT true, | ||
point_average_rounding VARCHAR(5) DEFAULT 'ceil', | ||
hide_voter_identity BOOLEAN DEFAULT false, | ||
estimation_scale_id UUID REFERENCES thunderdome.estimation_scale(id), | ||
join_code TEXT, | ||
facilitator_code TEXT, | ||
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, | ||
updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, | ||
CONSTRAINT check_id_not_null CHECK ( | ||
num_nonnulls(organization_id, department_id, team_id) = 1 | ||
), | ||
CONSTRAINT ps_unique_org_setting UNIQUE (organization_id), | ||
CONSTRAINT ps_unique_dept_setting UNIQUE (department_id), | ||
CONSTRAINT ps_unique_team_setting UNIQUE (team_id) | ||
); | ||
|
||
CREATE INDEX ON thunderdome.poker_settings (organization_id); | ||
CREATE INDEX ON thunderdome.poker_settings (department_id); | ||
CREATE INDEX ON thunderdome.poker_settings (team_id); | ||
|
||
CREATE TABLE thunderdome.retro_settings ( | ||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(), | ||
organization_id UUID REFERENCES thunderdome.organization(id) ON DELETE CASCADE, | ||
department_id UUID REFERENCES thunderdome.organization_department(id) ON DELETE CASCADE, | ||
team_id UUID REFERENCES thunderdome.team(id) ON DELETE CASCADE, | ||
max_votes INT2 DEFAULT 3, | ||
allow_multiple_votes BOOLEAN DEFAULT false, | ||
brainstorm_visibility VARCHAR(12) DEFAULT 'visible', | ||
phase_time_limit_min INT2 DEFAULT 0, | ||
phase_auto_advance BOOLEAN DEFAULT false, | ||
allow_cumulative_voting BOOLEAN DEFAULT false, | ||
template_id UUID REFERENCES thunderdome.retro_template(id), | ||
join_code TEXT, | ||
facilitator_code TEXT, | ||
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, | ||
updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, | ||
CONSTRAINT check_id_not_null CHECK ( | ||
num_nonnulls(organization_id, department_id, team_id) = 1 | ||
), | ||
CONSTRAINT rs_unique_org_setting UNIQUE (organization_id), | ||
CONSTRAINT rs_unique_dept_setting UNIQUE (department_id), | ||
CONSTRAINT rs_unique_team_setting UNIQUE (team_id) | ||
); | ||
|
||
CREATE INDEX ON thunderdome.retro_settings (organization_id); | ||
CREATE INDEX ON thunderdome.retro_settings (department_id); | ||
CREATE INDEX ON thunderdome.retro_settings (team_id); | ||
|
||
-- +goose StatementEnd | ||
|
||
-- +goose Down | ||
-- +goose StatementBegin | ||
|
||
DROP TABLE IF EXISTS thunderdome.poker_settings; | ||
DROP TABLE IF EXISTS thunderdome.retro_settings; | ||
|
||
-- +goose StatementEnd |
Oops, something went wrong.