<turbo-stream action="replace" target="content"><template><turbo-frame id="content"><h5 class="strong">Group Players</h5><div class="row"><div class="small-6 columns"><p class="slim">Group Players contains names, optional contacts and quotas for players in the group.</p><pre><code>class GroupPlayer < ActiveRecord::Base
 belongs_to :group
 has_one :user
 has_many :scored_rounds
 has_many :rounds, dependent: :destroy
end</code></pre><div class="strong">Purpose</div><ul class="classic ml-4"><li>To store basic information on a Player (name, phone, primary tee)</li><li>To store quotas and date last played from last computed quota.</li><li>Quotas are computed when:</li><ul class="classic"><li>An Game is scored</li><li>An Game is deleted</li><li>A groups preferences are changed and the coordinator recomputes quotas</li><li>Rounds or Games are trimmed, removing old rounds and events.</li><li>The primary tee is changed.</li></ul></ul></div><div class="small-6 columns"><div class="strong">Data Elements</div><dl class="indent-dd"><dt>group_id</dt><dt>player_id</dt><dd>The old_pin has be duplicated from old_pin.  It will be renamed pin at some point</dd><dt>tee</dt><dd>Primary tee (color name from group tees). Quotas are computed by Tee. If a player moves up or down a Tee, their quota starts from the base quota which is the computed quota of the last (group rounds_used) rounds regardless of tee or group. </dd><dt>quota</dt><dd>The last computed quota (rounded or truncated) from the primary tee</dd><dt>last_played</dt><dd>The date that the player last played.</dd><dt>rquota</dt><dd>The last computed raw quota (decimal value before rounding or truncating). This quota is used in seeding players for teams,</dd><dt>first_name</dt><dt>last_name</dt><dt>full_name</dt><dd>Full name is set from first_name and last_name applying some formating rules.</dd><dt>nickname</dt><dd>If a player use usually referred to by a nickname, enter that name here and there name will be displayed (and sorted by) "nickname first_name last_name" </dd><dt>phone</dt><dd>Optional phone number of player. Only displayed if there is a user logged into the group.</dd><dt>old_pin</dt><dd>When players were imported from PTGOLFER.EXE, the record number was copied during the import process and used as a lookup since names were all screwed up. It is now duplicated as a pin number and must be unique within a Club.</dd></dl></div></div></turbo-frame></template></turbo-stream>