Introduce architettura multi-sport con catalogo, engine scoring e overlay.

Catalogo sport in YAML, board implicito, engine per volley/basket/timed/racket/timer/generic, regia e app Android allineate.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-09 20:11:21 +02:00
parent 53f9a6a884
commit e727069d43
56 changed files with 1783 additions and 223 deletions

View File

@@ -0,0 +1,18 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Scoring::Engines::GenericEngine do
let!(:club) { Club.create!(name: "C", sport: "volleyball", primary_color: "#e53935", secondary_color: "#ffffff") }
let!(:team) { club.teams.create!(name: "T", sport: "altro") }
let!(:match) { team.matches.create!(opponent_name: "Opp", sport: "altro") }
let!(:user) { User.create!(email: "g@example.com", password: "secret123", name: "Coach") }
let!(:session) { StreamSession.create!(match: match, user: user, status: "live", platform: "matchlivetv") }
it "incrementa solo il contatore senza chiudere set" do
engine = described_class.new(match: match)
result = engine.apply(session: session, action: "home_point")
expect(result.score.home_points).to eq(1)
expect(result.set_won).to be(false)
end
end