Completa multi-sport su web, API score_action e controlli Android board-aware.
Allinea i form società/squadra al catalogo sport, espone score_action per basket/timed e corregge bug namespace Sports e Result nel period engine; l'app nativa gestisce overlay e punteggio per board con wizard regole esteso. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -39,6 +39,20 @@ module Api
|
||||
render json: session_json(@session, detail: true)
|
||||
end
|
||||
|
||||
def score_action
|
||||
action = params[:score_action].presence
|
||||
raise ArgumentError, "Azione mancante" if action.blank?
|
||||
|
||||
result = Scoring::ApplyAction.new(session: @session, action: action).call
|
||||
render json: session_json(@session, detail: true).merge(
|
||||
set_won: result.set_won,
|
||||
match_won: result.match_won,
|
||||
winner: result.winner&.to_s
|
||||
)
|
||||
rescue ArgumentError => e
|
||||
render json: { error: e.message }, status: :unprocessable_entity
|
||||
end
|
||||
|
||||
def events
|
||||
events = @session.stream_events.recent.limit(100)
|
||||
render json: events.map { |e| event_json(e) }
|
||||
|
||||
Reference in New Issue
Block a user