<turbo-stream action="replace" target="content"><template><turbo-frame id="content"><h5 class="strong">Group</h5><div class="row"><div class="small-6 columns"><p class="slim">Group allow multiple groups who play at a Club or Course and have quotas computed based on their preferences. One group may used a different point scoring system, play from different tees etc.</p><pre><code class="ruby">class Group < ActiveRecord::Base
  has_many :players, :dependent => :destroy
  has_many :games, :dependent => :destroy
  has_many :rounds, through: :games
  has_many :users, :dependent => :destroy
  belongs_to :club
end</code></pre><div class="strong">Purpose</div><ul class="classic"><li>To separate  Players, Games, Rounds, etc from other Groups</li><li>To provide preference/options used to compute quotas.</li></ul></div><div class="small-6 columns"><div class="strong">Data Elements</div><dl class="indent-dd"><dt>club_id</dt><dt>name</dt><dd>Unique name for group in a club</dd><dt>rounds_used</dt><dd>The number of rounds used to compute quotas</dd><dt>use_hi_lo_rule</dt><dd>An optional method that throws out the high and low points pulled for a player before computing the quota</dd><dt>tees</dt><dd>A string of space delimited tee colors used by the group, e.g. "White Teal Blue Red"</dd><dt>options (preferences)</dt><dd><dl class="indent-dd"><dt>par_in: :string</dt><dd>Can override club settings</dd><dt>par_out: :string</dt><dd>Can override club settings</dd><dt>welcome: :text</dt><dd>A text message that will display on the Groups home page if entered.</dd><dt>alert: :text</dt><dd>A text alert message that will display on the Groups home page if entered.</dd><dt>notice: :text</dt><dd>A text notice message that will display on the Groups home page if entered.</dd><dt>tee_time: :string</dt><dd>NOT USED</dd><dt>play_days: :string</dt><dd>NOT Used</dd><dt>dues: :integer</dt><dd>Round game entry fee</dd><dt>skins_dues: :integer</dt><dd>Skins or Birdies side game dues, optional</dd><dt>par3_dues: :integer</dt><dd>Par3 closest to pin side game dues, optional</dd><dt>other_dues: :integer</dt><dd>Other game (best sides) side game dues, optional</dd><dt>truncate_quota: :boolean</dt><dd>When a qouta is computed, it is a decimal number. The default quota is set to round that number to the nearest interger. Setting truncate_quota to True will truncate (round down) the raw quota</dd><dt>pay: :string</dt><dd>Wealth is redistributed by either Sides or Places, the two valid options for the 'pay' preference.</dd><dd>Pay Side divides the collected entry fee into three pots, front, back and total. Those pots are distributed to the winner(s)</dd><dd>Pay Places divides the collected entry fee into pots equal to half of number of teams in the game. If there are 8 teams, there will be 4 pots or 4 places. Most groups that use this method will have a cheat sheet to lookup what each place will pay.PtGofp computes a 60/40 split between places. In this example of paying 4 places, the percentage of each place is [0.4154, 0.2769, 0.1846, 0.1231]!</dd><dt>limit_new_player: :boolean</dt><dd>The Micky Mantle rule. A new players who has not played a certain number of rounds (limit_rounds:) with the group will have a star (*) by their quota to remind the team that their points are limited to +- (limit_points). GolfGaggle would actually use this to compute a gross and net points pulled and use net to pay teams and gross to compute quotas. PtGolf leave that up to the group to handle.</dd><dt>limit_rounds: :integer</dt><dt>limit_points: :integer</dt></dl></dd></dl></div></div></turbo-frame></template></turbo-stream>