Daniel Schädler
03d7369a1c
Remove link between team.owner and tournament
2019-05-22 09:25:07 +02:00
Thor77
37b63cace2
Use methods instead of attributes
...
because each attribute is only used once and updating a Stage should
reflect those changes
2019-05-16 20:53:05 +02:00
Thor77
d6a691fe5a
Add documentation to sort_group_scores
2019-05-16 20:53:05 +02:00
Thor77
99bfe6ed70
Add StatisticsController
2019-05-16 20:53:04 +02:00
Thor77
bdcfbe934b
Add StatisticsService
2019-05-16 20:53:04 +02:00
Thor77
894608c19e
Fix Stage.teams returning nil on error
2019-05-16 20:53:03 +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
Thor77
1b9db61c22
Add owner method to Stage, Group and Match
2019-05-07 18:41:52 +02:00
Daniel Schädler
f7ed4b549d
Destroying all Readability.
...
Noone will ever be able to read this code again.
2019-05-04 20:54:08 +02:00
Daniel Schädler
23249ee93b
Build Matches without saving directly to database
2019-05-04 20:34:57 +02:00
Daniel Schädler
6a2c71bad7
Fix stage.team method not returning teams for playoff stages
2019-05-04 20:34:57 +02:00
Daniel Schädler
db1518bdbd
Raise exceptions upon error in group_stage_service
2019-05-04 20:34:57 +02:00
Daniel Schädler
bfadc7a6af
Dry out Tournaments Controller
2019-05-04 20:34:57 +02:00
Daniel Schädler
fdac71a9f1
Unnecessary variable assignment
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
Daniel Schädler
a842e0db3c
Add group stage service
...
This service is responsible for all actions concerning the group stage
It returns false if no groups are given to generate_group_stage method
This prevents dividing by zero in the next line
2019-05-04 20:34:57 +02:00
Daniel Schädler
f7919ec0c6
Adds Organizer to Add a group stage to a tournament and save it
2019-05-04 20:34:57 +02:00
Daniel Schädler
83cd4ed340
Let Context Fail if there are any stages already in the tournament
2019-05-04 20:34:57 +02:00
Daniel Schädler
548d9241c4
Add Interactor to add group stage to a tournament
2019-05-04 20:34:57 +02:00
Daniel Schädler
26b8ff96c9
Add teams method to group,match,stage
...
It returns the unique teams that compete within the object
2019-05-04 20:34:57 +02:00
Thor77
2b72d0457e
Implement type parameter for tournaments index
2019-04-24 22:49:48 +02:00
Daniel Schädler
d3d572ea1b
Change return for 0 teams to exception
2019-04-23 14:21:29 +02:00
Daniel Schädler
a30ff860e9
Return a valid list of matches for 1 team
2019-04-23 14:19:36 +02:00
Daniel Schädler
38425df823
Only support stage count calculation for 1+ teams
2019-04-23 14:19:36 +02:00
Daniel Schädler
49a6545af9
Fix start point for stages with matchnumbers that are not powers of 2
2019-04-23 14:19:36 +02:00
Daniel Schädler
1c2d051364
Subtract one off required stages if the number of teams is a power of 2
...
This way we now calculate the right amount of stages for every number.
(I would test every number, but Jonas won't let me write tests for all of them..)
2019-04-23 14:19:36 +02:00
Thor77
22e547befa
Add validatable attribute to User model
...
to get email and password (existence) validation
2019-04-23 10:47:50 +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
Daniel Schädler
7f87ce9230
Add documentation for all services
2019-04-03 15:33:59 +02:00
Thor77
d7910c093b
Update user model to extend devise models
2019-04-03 09:43:04 +02:00
Thor77
5126e5ae76
Add position to MatchSerializer
2018-12-11 17:14:43 +01:00
Thor77
d1bc3de6b0
Add owner_username attribute to Tournament
...
displaying the username of the user owning the tournament
2018-12-11 17:14:43 +01: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
2f828542ef
Alias recieved_points to received_points
...
to avoid a change of the db schema for now
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
Thor77
e3bbe2b773
Include description only in full Tournament
2018-12-11 17:12:55 +01:00
Thor77
baf1acc10b
Include team-relation in MatchScoreSerializer
2018-12-11 17:12:55 +01:00
Thor77
2f4df349c0
Add GroupScore, Group and StageSerializer
2018-12-11 17:12:55 +01:00
Thor77
bfe1c07fdc
Include id-attribute for all serializers
2018-12-11 17:12:55 +01:00
Thor77
dc17cad154
Ensure uniqueness of generated Tournament.code
2018-12-02 13:51:54 +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
Thor77
25b558105a
Serialize has_one match relation
2018-11-30 14:42:12 +01:00
Thor77
7f59d6fb0e
Delegate Score.owner to parent team
2018-11-30 14:38:56 +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
Daniel Schädler
27a0d9c4b2
Add Organizer for Tournament creation
2018-11-29 11:58:33 +01:00
Daniel Schädler
7ba1f98fb4
Implements Adding Tournaments to Database
2018-11-29 11:58:27 +01:00
Daniel Schädler
26bcc3dc88
Implement Adding Playoffs to a tournament
2018-11-29 11:10:15 +01:00
Daniel Schädler
7f243b06a2
Implement Utils Class
2018-11-29 11:03:44 +01:00
Daniel Schädler
1c318cde1a
Add State to Model
2018-11-29 10:47:17 +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
Thor77
9d4d39c135
Make Team.belongs_to :tournament optional
...
necessary for testing TeamController building relationship on create
2018-11-25 22:55:49 +01:00
Thor77
e81ef81150
Add TournamentsController
2018-11-25 22:55:48 +01:00
Thor77
d1f66b18d4
Add tournament serializers
...
SimpleTournamentSerializer excludes relationships and should be used for
listings
2018-11-25 22:55:48 +01:00
Thor77
fecdb7db2d
Add deserialize_params helper
2018-11-25 22:55:48 +01:00
Thor77
92de7b8a57
Fix rubocop Style/MethodDefParentheses
2018-11-24 19:20:53 +01:00
Thor77
0308dc121f
Add TeamsController and corresponding specs
2018-11-24 19:18:03 +01:00
Thor77
8b3b8352e5
Delegate owner attribute to tournament
2018-11-24 19:16:04 +01:00
Thor77
668584c68b
Add require_owner! filter action
2018-11-24 19:14:31 +01:00
Thor77
bc88ddc54d
Add serializer for Match, Score and Team
2018-11-21 18:57:59 +01:00
Thor77
6c24180715
Add MatchesController and specs for it
2018-11-21 18:57:16 +01:00
Thor77
673e12c052
Validate Stage xor Group present in match
2018-11-20 16:03:58 +01:00
Thor77
552566dd2e
Validate match has only 2 scores
2018-11-19 14:57:55 +01:00
Thor77
0bcd3a88a9
Validate presence of name
2018-11-19 14:45:01 +01:00
Thor77
65abada8b2
Modify model associations to map to new schema
2018-11-19 11:47:14 +01:00
Thor77
03f362a7fe
Add Score and Stage model
2018-11-19 11:47:14 +01:00
Thor77
21103588a2
Remove unused Group- and PlayoffStage models
...
because they are now both represented by the Stage model
2018-11-19 11:47:13 +01:00
Thor77
556f326acd
Alias Tournament.user to Tournament.owner
2018-11-19 11:47:12 +01:00
Thor77
b742b3ed67
Move group scores into separate table
2018-11-19 11:47:12 +01:00
Thor77
07eb561f77
Implement Tournament-Team relation
2018-11-19 11:47:12 +01:00
Thor77
20fafab009
Generate tournament code if not given
2018-11-19 11:47:11 +01:00
Thor77
d89c24a645
Add relation between Tournament and User
2018-11-19 11:47:11 +01:00
Daniel Schädler
a13b8e0c72
Change neededGames to needed_games
2018-11-12 16:45:51 +01:00
Thor77
c9421e6d42
Add Tournament model
2018-11-11 21:31:47 +01:00
Thor77
5774b2463a
Format imported code
2018-11-11 19:39:13 +01:00
Daniel Schädler
d5d61ec0a2
Add some Models
2018-11-11 18:52:15 +01:00
Thor77
2a20c02f56
Apply rubocop formatting
2018-11-10 15:50:27 +01:00
Thor77
3f8ca715cc
Add devise token authentication
2018-11-10 15:46:02 +01:00
Thor77
9d51a36b0a
Initial commit
2018-10-30 15:52:46 +01:00