chore: save current Ruby implementation state before Next.js rewrite

This commit is contained in:
2026-03-27 14:36:22 -07:00
parent e9365faa10
commit 96f7cb86d3
20 changed files with 894 additions and 106 deletions
@@ -4,16 +4,20 @@ module EuchreCamp
module Persistence
module Relations
class BracketMatchups < ROM::Relation[:sql]
schema(:bracket_matchups, infer: true) do
schema(:bracket_matchups) do
attribute :id, ROM::Types::Integer, primary_key: true
attribute :event_id, ROM::Types::Integer
attribute :round_id, ROM::Types::Integer
attribute :match_id, ROM::Types::Integer.optional
attribute :team_1_id, ROM::Types::Integer.optional
attribute :team_2_id, ROM::Types::Integer.optional
attribute :table_number, ROM::Types::Integer.optional
attribute :bracket_position, ROM::Types::Integer.optional
attribute :winner_team_id, ROM::Types::Integer.optional
attribute :loser_team_id, ROM::Types::Integer.optional
attribute :status, ROM::Types::String.optional
attribute :created_at, ROM::Types::DateTime.optional
attribute :updated_at, ROM::Types::DateTime.optional
associations do
belongs_to :event
@@ -4,14 +4,14 @@ module EuchreCamp
module Persistence
module Relations
class EloSnapshots < ROM::Relation[:sql]
schema(:elo_snapshots, infer: true) do
schema(:elo_snapshots) do
attribute :id, ROM::Types::Integer, primary_key: true
attribute :player_id, ROM::Types::Integer
attribute :match_id, ROM::Types::Integer
attribute :rating_before, ROM::Types::Integer
attribute :rating_after, ROM::Types::Integer
attribute :rating_change, ROM::Types::Integer
attribute :created_at, ROM::Types::DateTime
attribute :created_at, ROM::Types::DateTime.optional
end
end
end
@@ -4,14 +4,16 @@ module EuchreCamp
module Persistence
module Relations
class EventParticipants < ROM::Relation[:sql]
schema(:event_participants, infer: true) do
schema(:event_participants) do
attribute :id, ROM::Types::Integer, primary_key: true
attribute :event_id, ROM::Types::Integer
attribute :player_id, ROM::Types::Integer
attribute :team_id, ROM::Types::Integer.optional
attribute :status, ROM::Types::String.default('registered')
attribute :seed, ROM::Types::Integer.optional
attribute :registration_date, ROM::Types::DateTime
attribute :registration_date, ROM::Types::DateTime.optional
attribute :created_at, ROM::Types::DateTime.optional
attribute :updated_at, ROM::Types::DateTime.optional
associations do
belongs_to :event
@@ -4,7 +4,7 @@ module EuchreCamp
module Persistence
module Relations
class Events < ROM::Relation[:sql]
schema(:events, infer: true) do
schema(:events) do
attribute :id, ROM::Types::Integer, primary_key: true
attribute :event_id, ROM::Types::Integer.optional
attribute :name, ROM::Types::String
@@ -14,8 +14,8 @@ module EuchreCamp
attribute :format, ROM::Types::String.default('single_elim')
attribute :status, ROM::Types::String.default('planned')
attribute :max_participants, ROM::Types::Integer.optional
attribute :created_at, ROM::Types::DateTime
attribute :updated_at, ROM::Types::DateTime
attribute :created_at, ROM::Types::DateTime.optional
attribute :updated_at, ROM::Types::DateTime.optional
associations do
has_many :event_participants
@@ -4,7 +4,7 @@ module EuchreCamp
module Persistence
module Relations
class GoodJobs < ROM::Relation[:sql]
schema(:good_jobs, infer: true) do
schema(:good_jobs) do
attribute :id, ROM::Types::Integer
attribute :queue_name, ROM::Types::String
attribute :priority, ROM::Types::Integer
@@ -13,8 +13,8 @@ module EuchreCamp
attribute :performed_at, ROM::Types::DateTime.optional
attribute :finished_at, ROM::Types::DateTime.optional
attribute :error, ROM::Types::String.optional
attribute :created_at, ROM::Types::DateTime
attribute :updated_at, ROM::Types::DateTime
attribute :created_at, ROM::Types::DateTime.optional
attribute :updated_at, ROM::Types::DateTime.optional
attribute :active_job_id, ROM::Types::String.optional
attribute :concurrency_key, ROM::Types::String.optional
attribute :sequence, ROM::Types::Integer.optional
@@ -4,7 +4,7 @@ module EuchreCamp
module Persistence
module Relations
class Matches < ROM::Relation[:sql]
schema(:matches, infer: true) do
schema(:matches) do
attribute :id, ROM::Types::Integer, primary_key: true
attribute :event_id, ROM::Types::Integer.optional
attribute :played_at, ROM::Types::DateTime.optional
@@ -15,6 +15,8 @@ module EuchreCamp
attribute :team_1_score, ROM::Types::Integer
attribute :team_2_score, ROM::Types::Integer
attribute :status, ROM::Types::String.default('completed')
attribute :created_at, ROM::Types::DateTime.optional
attribute :updated_at, ROM::Types::DateTime.optional
associations do
belongs_to :team_1_player, relation: :players, foreign_key: :team_1_p1_id
@@ -4,14 +4,16 @@ module EuchreCamp
module Persistence
module Relations
class PartnershipGames < ROM::Relation[:sql]
schema(:partnership_games, infer: true) do
schema(:partnership_games) do
attribute :id, ROM::Types::Integer, primary_key: true
attribute :match_id, ROM::Types::Integer
attribute :player_1_id, ROM::Types::Integer
attribute :player_2_id, ROM::Types::Integer
attribute :team_number, ROM::Types::Integer
attribute :won_match, ROM::Types::Integer
attribute :created_at, ROM::Types::DateTime
attribute :team_number, ROM::Types::Integer.optional
attribute :won_match, ROM::Types::Integer.optional
attribute :player_1_elo_change, ROM::Types::Integer.optional
attribute :player_2_elo_change, ROM::Types::Integer.optional
attribute :created_at, ROM::Types::DateTime.optional
associations do
belongs_to :match
@@ -4,7 +4,7 @@ module EuchreCamp
module Persistence
module Relations
class PartnershipStats < ROM::Relation[:sql]
schema(:partnership_stats, infer: true) do
schema(:partnership_stats) do
attribute :id, ROM::Types::Integer, primary_key: true
attribute :player_1_id, ROM::Types::Integer
attribute :player_2_id, ROM::Types::Integer
@@ -13,8 +13,8 @@ module EuchreCamp
attribute :losses, ROM::Types::Integer.default(0)
attribute :total_elo_change, ROM::Types::Integer.default(0)
attribute :last_played, ROM::Types::DateTime.optional
attribute :created_at, ROM::Types::DateTime
attribute :updated_at, ROM::Types::DateTime
attribute :created_at, ROM::Types::DateTime.optional
attribute :updated_at, ROM::Types::DateTime.optional
associations do
belongs_to :player_1, relation: :players, foreign_key: :player_1_id
@@ -4,11 +4,13 @@ module EuchreCamp
module Persistence
module Relations
class Players < ROM::Relation[:sql]
schema(:players, infer: true) do
schema(:players) do
attribute :id, ROM::Types::Integer, primary_key: true
attribute :name, ROM::Types::String
attribute :rating, ROM::Types::Integer
attribute :current_elo, ROM::Types::Integer.default(1000)
attribute :created_at, ROM::Types::DateTime.optional
attribute :updated_at, ROM::Types::DateTime.optional
end
end
end
@@ -4,13 +4,14 @@ module EuchreCamp
module Persistence
module Relations
class Teams < ROM::Relation[:sql]
schema(:teams, infer: true) do
schema(:teams) do
attribute :id, ROM::Types::Integer, primary_key: true
attribute :event_id, ROM::Types::Integer
attribute :team_name, ROM::Types::String.optional
attribute :player_1_id, ROM::Types::Integer
attribute :player_2_id, ROM::Types::Integer
attribute :created_at, ROM::Types::DateTime
attribute :created_at, ROM::Types::DateTime.optional
attribute :updated_at, ROM::Types::DateTime.optional
associations do
belongs_to :event
@@ -4,7 +4,7 @@ module EuchreCamp
module Persistence
module Relations
class TournamentRounds < ROM::Relation[:sql]
schema(:tournament_rounds, infer: true) do
schema(:tournament_rounds) do
attribute :id, ROM::Types::Integer, primary_key: true
attribute :event_id, ROM::Types::Integer
attribute :round_number, ROM::Types::Integer
@@ -12,6 +12,8 @@ module EuchreCamp
attribute :scheduled_start, ROM::Types::DateTime.optional
attribute :actual_start, ROM::Types::DateTime.optional
attribute :completed_at, ROM::Types::DateTime.optional
attribute :created_at, ROM::Types::DateTime.optional
attribute :updated_at, ROM::Types::DateTime.optional
associations do
belongs_to :event
@@ -4,7 +4,7 @@ module EuchreCamp
module Persistence
module Relations
class Users < ROM::Relation[:sql]
schema(:users, infer: true) do
schema(:users) do
attribute :id, ROM::Types::Integer, primary_key: true
attribute :player_id, ROM::Types::Integer
attribute :email, ROM::Types::String
@@ -12,15 +12,15 @@ module EuchreCamp
attribute :role, ROM::Types::String
attribute :confirmed, ROM::Types::Bool
attribute :confirmation_token, ROM::Types::String.optional
attribute :confirmation_sent_at, ROM::Types::Time.optional
attribute :confirmation_sent_at, ROM::Types::DateTime.optional
attribute :reset_password_token, ROM::Types::String.optional
attribute :reset_password_sent_at, ROM::Types::Time.optional
attribute :reset_password_sent_at, ROM::Types::DateTime.optional
attribute :failed_login_attempts, ROM::Types::Integer
attribute :locked_until, ROM::Types::Time.optional
attribute :last_login_at, ROM::Types::Time.optional
attribute :locked_until, ROM::Types::DateTime.optional
attribute :last_login_at, ROM::Types::DateTime.optional
attribute :last_login_ip, ROM::Types::String.optional
attribute :created_at, ROM::Types::Time
attribute :updated_at, ROM::Types::Time
attribute :created_at, ROM::Types::DateTime.optional
attribute :updated_at, ROM::Types::DateTime.optional
end
end
end