Commit Graph

59 Commits

Author SHA1 Message Date
Thor77 d317585168
Add "simple" parameter to tournament show 2019-10-25 23:17:08 +02:00
Daniel Schädler b28561043e Implement stages controller (GET UPDATE) 2019-06-18 22:22:10 +02:00
Daniel Schädler 4925ea9d83 Make teams added to PlayoffStage configurable 2019-06-18 22:22:10 +02:00
Thor77 041ee4ab2c Include bets in match resource 2019-06-18 18:51:55 +02:00
Thor77 f3b8fd4184 Use collection serializer 2019-06-18 18:51:55 +02:00
Thor77 2baefb9ae6 Associate teams only on interactor success 2019-06-18 13:29:31 +02:00
Thor77 3109308817 Fix teams not associated with created tournament
when choosing a group stage
2019-06-18 13:29:31 +02:00
Thor77 76e301e920
Add BetsController 2019-06-17 13:48:49 +02:00
Daniel Schädler a74030a7ef Implement GroupsController 2019-06-16 13:22:15 +02:00
Daniel Schädler 5004dec39a Change playoff transition relevant attributes of tournament on update
They are only updated when playoff_teams_amount changed alone
2019-06-13 13:21:24 +02:00
Daniel Schädler e936fd40b2 Convert integer parameters to actual integers
Apparently rails thinks this is the way to do it.
2019-06-13 13:21:24 +02:00
Daniel Schädler b408d1dd37 Ignore validity of matching params if only playoff_teams_amount changed
If only playoff_teams_amount changed, the other two will be overwritten
anyways.
2019-06-13 13:21:24 +02:00
Daniel Schädler 6a060651a4 Validate update parameters
playoff_teams_amount, instant_finalists_amount and
intermediate_round_participants_amount need to make sense together
2019-06-13 13:21:24 +02:00
Daniel Schädler c1b2b72ca3 Simplify controller code
Matches update now gets rolled back via a Transaction
2019-06-05 17:05:58 +02:00
Daniel Schädler 68535b89fc Prevent matches from being stopped without a winner in playoffs 2019-06-05 17:05:58 +02:00
Daniel Schädler bd2af09339 Add field to tournament containing playoff_teams_amount
This field represents how many teams advance into playoff stage after
the group stage has ended.
2019-06-05 16:46:06 +02:00
Daniel Schädler 957788651c Update group_scores on match_score change if match is a group match 2019-06-05 09:49:21 +02:00
Thor77 b07447aaae Permit username key for account update 2019-06-04 09:55:45 +02:00
Thor77 12005b95fa
Fix group score not serialized correctly
when returned from statistics endpoint
2019-05-28 22:24:03 +02:00
Daniel Schädler 2b39bb1521 Move populating the match below to when the state is changed 2019-05-26 20:15:58 +02:00
Daniel Schädler 12daf53599 Check for errors while populating the match below 2019-05-26 20:15:16 +02:00
Daniel Schädler fc69c6e6e6 Implement PopulateMatchBelow Interactor & Organizer 2019-05-26 20:15:16 +02:00
Daniel Schädler 2c9e06946d Call populate_match_below when a match is finished 2019-05-26 20:14:13 +02:00
Daniel Schädler 280b0c1dec Change status of Match to only represent being finished
The winner will be a attribute of the Match instead of something
that is written in its status.
2019-05-26 20:14:13 +02:00
Daniel Schädler 8388af20f0 Generalize tournament save interactor
It now is responsible for saving all ApplicationRecord objects to the
database. This will reduce code duplication one we have other objects
that need to be saved. (As we will soon need to save individual matches)
2019-05-26 20:14:13 +02:00
Thor77 99bfe6ed70
Add StatisticsController 2019-05-16 20:53:04 +02:00
Thor77 27c4bcacc8
Respond with 501 for state param 'finished'
(501 = NOT IMPLEMENTED)
2019-05-07 18:41:53 +02:00
Thor77 3876f57d32
Add methods and specs to update a match 2019-05-07 18:41:53 +02:00
Thor77 436adde706
Set global match var for reuse by other methods 2019-05-07 18:41:52 +02:00
Daniel Schädler bfadc7a6af Dry out Tournaments Controller 2019-05-04 20:34:57 +02:00
Daniel Schädler 9053251706 Document group_stage generation parameter preparation 2019-05-04 20:34:57 +02:00
Daniel Schädler f9b96cbee2 Indicate the groups variable being changed within the method 2019-05-04 20:34:57 +02:00
Daniel Schädler 74e9139b33 Removes unnecessary check 2019-05-04 20:34:57 +02:00
Daniel Schädler acfc388da4 Implements group stage tournament creation 2019-05-04 20:34:57 +02:00
Daniel Schädler f9b1b603f0 Permits "group_stage" as valid parameter for a create request 2019-05-04 20:34:57 +02:00
Thor77 2b72d0457e Implement type parameter for tournaments index 2019-04-24 22:49:48 +02:00
Thor77 157844b4ae Catch missing parameter exceptions to render error 2019-04-16 13:24:58 +02:00
Thor77 08d2ae59a5 Check teams array before calling create method 2019-04-16 13:24:58 +02:00
Thor77 417b296d0e Override registration and session render methods
to remove wrapping data-element
2019-04-16 11:01:31 +02:00
Thor77 a2e35e1710 Create teams with only name attribute 2019-04-08 11:16:51 +02:00
Thor77 ec4e2797c2
Call tournament generation for create endpoint
and associate given team ids with the new tournament
2019-04-07 19:24:17 +02:00
Thor77 e78de72f3d
Fix id and model logged as unpermitted params
by slicing selected attributes from params and permitting them all.
2019-04-07 16:09:59 +02:00
Thor77 8b07c46acd
Permit parameters without root key 2019-04-07 14:00:06 +02:00
Thor77 32c012af32 Use plain params-hash instead of custom helper
for deserialization of create/update-data
2018-12-11 17:12:55 +01:00
Thor77 5076197f78 Recursively include all relations for a tournament 2018-12-11 17:12:55 +01:00
Daniel Schädler dd2f66f49d Score is now MatchScore & Score Attribute is Points Attribute 2018-11-30 15:10:33 +01:00
Thor77 e763f14719 Add ScoresController and their specs 2018-11-30 14:42:12 +01:00
Daniel Schädler 68f9b3b2b3 Change Score to MatchScore & MatchScore score attribute to points
This is done to improve the naming and therefore make things easier to understand.
2018-11-30 14:15:48 +01:00
Thor77 4c05a7222e
Use deserialize_params helper 2018-11-25 22:55:49 +01:00
Thor77 0a583ebe53
Remove unused match_params 2018-11-25 22:55:49 +01:00