From 197c48729984a2864633bfdbe7e7b16c81186d64 Mon Sep 17 00:00:00 2001 From: Axel Clark Date: Sun, 12 Nov 2023 12:47:20 -0800 Subject: [PATCH 01/18] Fix payouts for 2024 Div A & D plus formatter --- .../templates/page/2024_rules.html.md | 110 ++++++------------ 1 file changed, 33 insertions(+), 77 deletions(-) diff --git a/lib/ex338_web/templates/page/2024_rules.html.md b/lib/ex338_web/templates/page/2024_rules.html.md index c06fb1ae..c2fa6da8 100644 --- a/lib/ex338_web/templates/page/2024_rules.html.md +++ b/lib/ex338_web/templates/page/2024_rules.html.md @@ -1,6 +1,5 @@ # 338 Rules for 2023-24 Season - ## 1. Season The 2023-2024 338 Season includes sports with championships between August 15 2022 and July 31, 2023. There are 14 permanent sports and a 15th sport that changes each year. @@ -9,7 +8,6 @@ Permanent sports are: NCAA Football, NFL, NCAA Basketball, NBA, NCAA Hockey, NHL In 2023-24, the rotating sport will be the Euro Championship. Subsequent years are to be determined but may include: World Cup, Men’s 3000m Steeplechase in the Summer Olympics and Women’s College Basketball. - ## 2. Ownership Teams are allowed to have multiple owners and split the entry fee and winnings any way they choose. @@ -20,12 +18,10 @@ Owners are not allowed to own or have partial ownership in multiple 338 teams in If relegation/promotion puts 2 teams with the same owner or partial owner in the same league, owner(s) may drop ownership stake to a single team or else the lower ranked team(s) will be pushed down a league until all owners have a stake in only one team/league. - ## 3. Rosters Each Owner has 20 roster slots with one slot dedicated to each sport (15 slots) and 5 slots open to any sport. Roster slots may be left open at any time - ### Tennis/Golf You do not have to use the same player throughout the year. 2 players used in the same tournament will require 2 roster slots, but waivering/trading players for each tournament is allowed and the scores will be combined. If using multiple roster slots, Owner must declare which slot a newly acquired player will be in (separate from roster slots). Owners cannot use the same player in multiple slots, unless 2 or more rostered players have been used in the same slot. In that case, order is determined by the highest ranked player at the time of acquisition going into the roster slot with the most points. @@ -34,7 +30,6 @@ You do not have to use the same player throughout the year. 2 players used in th I have Tiger and Phil for The Masters, then trade them both for Rory and Scott prior to PGA. I must declare which players will be combined before the event. I choose Tiger/Scott & Phil/Rory. For the US Open, I trade Rory for Tiger and drop Scott for Stenson, making the combo Tiger/Scott/Tiger & Phil/Rory/Stenson. Then I claim Scott for British Open, keeping Tiger & Stenson. At time of claim, rankings are: #1-Scott, #3-Tiger, #7-Stenson. Combo becomes Tiger/Scott/Tiger/Scott, Phil/Rory/Stenson/Tiger, Stenson. - ### Injured Reserve Each Owner will have one IR slot per individual sport (MT, WT, PGA). If a player withdraws from an event prior to the start, Owner may move the player to IR and claim a new player. This will not cost a waiver claim, but the replacement player will be automatically dropped at the end of the tournament. @@ -43,29 +38,25 @@ IR claims may be submitted at any time before the start of each tournament but a If a player is suspended for rules violation or does not qualify for an event, the player is not eligible for IR and must be replaced by a waiver claim. - ## 4. Entry Fee -League A: $225, B: $250, C: $275, D: $300. Payment due by Dec 1st, 2023. Late payment may result in single sport disqualification(s) at the discretion of the Board of Directors. Entry fees and payouts only accepted from one user, regardless of the number of co-owners per team. - +League A: $225, B: $250, C: $275, D: $300. Payment due by Dec 1st, 2023. Late payment may result in single sport disqualification(s) at the discretion of the Board of Directors. Entry fees and payouts only accepted from one user, regardless of the number of co-owners per team. ## 5. Scoring Points are awarded to the top 8 of each sport. 8 points for winning the league, 5 points for runner-up, 3 points for reaching the semifinals, and 1 point for reaching the quarterfinals. See individual sport for details. If any team/player is later stripped of a standing, prior to relegation, due to violation of any kind, points will be adjusted. Any violation and resulting standings change post-relegation will have no impact on the 338. - ### College Football Top 4 teams will be determined by playoffs. The 4 highest ranked teams in the final AP Poll who are not in the playoffs will each get 1 point. - ### Tennis Tennis-only points are awarded for each of the 4 Grand Slam Events, immediately after the tournament. 1st=8, 2nd=5, SF=3, QF=1. Negative 2 points awarded to a Top 8 Seed losing in the 1st round and Negative 1 point for a Top 8 Seed losing in the 2nd round. If match is a walkover or player retires before the completion of the first set, negative points will not apply. Tennis points will be tallied individually, to an assigned tennis slot (e.g. Tennis-1, Tennis-2, etc). If a player is traded or dropped, the Owner retains any points they have earned. #### Example Scenario -I have Djokovic who wins the Aussie Open, scoring me 8 pts. I trade him for Nadal prior to the French Open. Nadal wins, so I now have 16 pts. If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W). League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8. Owner must score at least 1 point to be eligible). +I have Djokovic who wins the Aussie Open, scoring me 8 pts. I trade him for Nadal prior to the French Open. Nadal wins, so I now have 16 pts. If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W). League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8. Owner must score at least 1 point to be eligible). ### Golf @@ -75,76 +66,59 @@ Golf-only points are awarded for each of the 4 majors, immediately after the tou I have Tiger and Phil. Tiger wins the Masters (50pts) and Phil finishes 11th (29pts). I keep Tiger but drop Phil and Tiger wins the US Open. I now have 100pts for Tiger and still have 29pts for Phil. Prior to the British Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut. I now have 95 pts for Tiger and 79 pts combined for Phil/Rory. Following the four majors League points will be awarded to top 8 total scores. Each Owner may have multiple places in the top 8. Owner must score at least 1 pt to be eligible. - ### Tennis/Golf League Points Players may be dropped and traded throughout the year, resulting in multiple players earning points. Rosters will lock after the final major's deadline and in order for league points to be earned, a roster slot must be occupied by that sport for the number of players earning points. #### Example Scenario -If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points. If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player. +If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points. If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player. ### Tie Breaker:s Individual Sport Tennis and golf points will be split evenly among tied Owners at the end of the final major. Single event golf points awarded in full to each tied owner. Money split for 1st or 2nd place tie. League: Owners will split the winnings evenly. Relegation: See Below. - ## 6. Payout - ### League A: - - -* 1st: $1250 -* 2nd: $900 -* 3rd: $650 -* 4th: $450 -* 5th: $350 - +- 1st: $1175 +- 2nd: $850 +- 3rd: $625 +- 4th: $425 +- 5th: $325 ### League B: - - -* 1st: $950 -* 2nd: $700 -* 3rd: $500 -* 4th: $400 -* 5th: $300 - +- 1st: $950 +- 2nd: $700 +- 3rd: $500 +- 4th: $400 +- 5th: $300 ### League C: +- 1st: $850 +- 2nd: $600 +- 3rd: $450 +- 4th: $375 +- 5th: $300 +### League D: -* 1st: $850 -* 2nd: $600 -* 3rd: $450 -* 4th: $375 -* 5th: $300 - - -### League #: - - - -* 1st: $800 -* 2nd: $575 -* 3rd: $425 -* 4th: $350 - +- 1st: $775 +- 2nd: $550 +- 3rd: $400 +- 4th: $325 ### Single Sport Payouts 1st: $25 2nd: $10. If an un-owned team finishes 1st or 2nd, money goes into league pot and divided equally among top 5. If Owners tie, money is split evenly. - ### Payments Payments will only be sent to one user, regardless of the number of owners per team. - ## 7. Waiver Wire Originally set by reverse draft order. A successful claim drops you to the bottom. All non-rostered players are on waivers. Waiver claims are made by submission via the site’s Waivers Page. Select the player you want and hit submit. The league will be notified and there will be a 3-day waiting period where any other Owner may also claim the player. @@ -155,7 +129,6 @@ If no valid roster slots are available, the claim will process as invalid and go Claims may be canceled at any time during the wait period. - ### Waiting Periods Waiting Period is waived for College Basketball, College Hockey, Kentucky Derby, and LLWS. Due to the conference tournaments ending just before CBB and CHK brackets are announced, there will be no waiver period on claims in CBB and CHK. Instead, we will have a 1-week “quiet period” prior to the deadline. Claims will not be announced to the league and will process at the deadline based on waiver position. @@ -164,19 +137,16 @@ Extra draft picks at the end of KD & LLWS will be up for waiver claim until the New in 2023-24, all waiver claims submitted within 48 hours of the deadline will process at 11:59 pm Pacific the day after the deadline. - ### Golf/Tennis Owners do NOT receive credit for points earned in tournaments prior to waiver pickup. Teams may be dropped without a pick-up, leaving an open roster slot to be filled later. One roster slot must be dedicated to each sport and cannot be filled with a player from a different sport. Flex spots can be filled with players from any sport. - ### Waiver Deadline See each sport for waiver deadlines. After the deadline NO players may be claimed or dropped from roster, except for late drops and pending claims in the waiting period. After the deadline, there will be a an email sent with teams that were dropped within 12 hours of deadline or dropped after a successful claim and Owners will have an opportunity to claim them. This eliminates holding a team until the last minute to keep others from claiming. This also allows an Owner that put in a claim, but was trumped by a higher waiver to claim another team. - ## 8. Trades Trades of players and future round draft picks are allowed. Trades are submitted to another owner from the roster page. If the trade is accepted, the league will be notified. Trades are ineligible if they break any 338 rules stated herein or include any non-338 assets. @@ -187,49 +157,40 @@ Once a trade is submitted and the other owner accepts, the involved Owners are a Future Round Draft Picks may be traded, but only for the next draft to take place (if mid-draft, trades apply to that draft) and must be 1:1 (Owner-A trades 1st round pick to Owner-B for a player and 5th round pick.) - ### Golf/Tennis Points already earned by players that are traded stay with the former Owner. - ### Trade Deadline See Championships page for deadlines. After the deadline NO players for that sport may be traded. - ### Future Round Draft Picks Deadline for trading draft picks and players for future seasons is the trade deadline of the final sport - ## 9. Draft Draft order determined by random draw, with Owners placed in one bucket and draft position placed in a different bucket. The draft is conducted via website in Snake style. For leagues that have a smaller number of teams (e.g. KD, LLWS), every member must be able to draft a team from a league. Once the limit has been reached, only members without a team from that league will be allowed to draft from that sport. Once a draft pick has been emailed to the league, it cannot be changed. - ### Time Limit Each Owner will have a cumulative total of 25 hours to make all 20 picks. There is no time limit for each pick. If an Owner exceeds 25 hours in total, the draft queue must be utilized to make picks. If the draft queue is empty, the Owner is able to manually enter a pick, but the site will proceed with the draft and allow the next Owner to enter their pick. -Hours from 11pm - 6am local time will not count against draft time. If an owner is on the clock overnight, those hours will be deducted the following day by the commish. Default local time for each team is PST unless the team provides another time zone to the commish. Each team can identify one local time zone. - +Hours from 11pm - 6am local time will not count against draft time. If an owner is on the clock overnight, those hours will be deducted the following day by the commish. Default local time for each team is PST unless the team provides another time zone to the commish. Each team can identify one local time zone. ## 10. In-Season Drafts Some sports will include a secondary draft in-season. During the main League Draft, you will select a draft position rather than a specific player (i.e. With my first round pick in the League draft, I select the First Pick of the Kentucky Derby). The following sports will have a secondary in-season draft: - ### Kentucky Derby Draft will take place on race day, time TBD. There will be a 5 minute time limit per pick. After 5 minutes, if a pick is not in the draft queue and owner has not entered a pick they will be skipped. A skipped owner may pick at any time after that, but cannot take a horse already drafted. Draft limited to 18 horses so in the event of a late scratch Owner will be able to replace horse. If a horse is scratched after being drafted, a replacement may be picked at the completion of the draft and it will NOT count as a waiver claim. If multiple horses are scratched, replacements are chosen in original draft order. - ### LLWS The draft for the LLWS will be Tuesday August 15th. There will be a 5 minute time limit per pick. After 5 minutes, if a pick is not in the draft queue and owner has not entered a pick they will be skipped. A skipped owner may pick at any time after that, but cannot take a team already drafted. There are only 20 teams in the LLWS. - ## 11. Relegation Based on League Points, the bottom 4 Owners in A and B will be relegated down a league. The top 4 Owners in B and C will move up one League. @@ -248,17 +209,14 @@ If relegation results in Owners that traded draft picks in different leagues, th Example: I trade my 1st round pick away and get a 10th round pick in return and I get relegated to B. The Owner I traded with would get my 1st round pick at the end of the 1st round. I would get the 10th round pick I traded for at the end of the 10th round. If both teams involved in the trade stay in the same league, or both get relegated, they would swap actual picks. If multiple Owners have supplemental picks, the order will be in reverse of the picks in that round. - ## 12. Upper League Openings New Owners will be placed in the lowest league of the new season, unless joining as a partial owner to an existing team. Exceptions may be granted at the discretion of the Board of Directors - ## 13. Owner Departures If an Owner finishes in the top 10 or is promoted but does not play the following season or an Owner is forced to drop a team or move down a league due to ownership of multiple teams, the last Owner relegated (i.e. 11th place) will move back up. This rule will apply until any openings are in the lowest league at which point a new owner will be added. Exceptions may be made at the discretion of the 338 Board of Directors. - ## 14. Official Season In order for the season to be official and payouts made, 8 sports must be completed or have the league name official results by July 15th, 2024. If 8 or more sports are canceled or delayed beyond July 15th, the 338 season will be canceled and all entry fees refunded with no winnings paid out. Trades of future draft picks will also be canceled. @@ -267,17 +225,15 @@ If a sport is canceled or delayed beyond Aug 1st 2023, no points will be awarded In the event that a sport does not complete the season and the league declares an official champion but not a clear 2nd – 8th, the 338 will use the following rankings to award league points: - - -* MLB – 5 pts to best record in other league, 3 points to 2nd best record in each league and 1 pt to 3rd division leader and best record for a non-division leader. If the top 2 teams are in the same division, then 1 point to other 2 division leaders. -* CFB – AP Poll -* NFL – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. -* CBK – AP Poll -* NBA – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. -* CHK – Pairwise -* NHL – – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. -* NCAA Baseball – [D1Baseball.com](http://d1baseball.com/) Rankings -* Champions League – points split among tied teams +- MLB – 5 pts to best record in other league, 3 points to 2nd best record in each league and 1 pt to 3rd division leader and best record for a non-division leader. If the top 2 teams are in the same division, then 1 point to other 2 division leaders. +- CFB – AP Poll +- NFL – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. +- CBK – AP Poll +- NBA – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. +- CHK – Pairwise +- NHL – – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. +- NCAA Baseball – [D1Baseball.com](http://d1baseball.com/) Rankings +- Champions League – points split among tied teams Exceptions: If a league has partially completed the postseason at the time of cancellation/suspension, actual results will be used. From e5ed205b06d17b6b0556cf1a827a15445eb0e19d Mon Sep 17 00:00:00 2001 From: Axel Clark Date: Sun, 19 Nov 2023 21:46:22 -0800 Subject: [PATCH 02/18] Add button for commish to create future picks --- .../commish/fantasy_league_live/approval.ex | 23 ++++++++++++++--- .../commish/fantasy_league/approval.html.leex | 25 +++++++++++++++++++ .../live/commish/fantasy_league_live_test.exs | 22 ++++++++++++++++ 3 files changed, 67 insertions(+), 3 deletions(-) diff --git a/lib/ex338_web/live/commish/fantasy_league_live/approval.ex b/lib/ex338_web/live/commish/fantasy_league_live/approval.ex index 772e3619..90d47cbe 100644 --- a/lib/ex338_web/live/commish/fantasy_league_live/approval.ex +++ b/lib/ex338_web/live/commish/fantasy_league_live/approval.ex @@ -1,7 +1,7 @@ defmodule Ex338Web.Commish.FantasyLeagueLive.Approval do use Ex338Web, :live_view - alias Ex338.{Accounts, FantasyLeagues, InjuredReserves, Trades} + alias Ex338.{Accounts, DraftPicks, FantasyLeagues, InjuredReserves, Trades} @impl true def mount(_params, %{"current_user_id" => user_id}, socket) do @@ -31,6 +31,7 @@ defmodule Ex338Web.Commish.FantasyLeagueLive.Approval do :current_route, Routes.commish_fantasy_league_approval_path(socket, :index, fantasy_league) ) + |> assign(:future_picks, fetch_future_picks(socket.assigns)) {:noreply, socket} end @@ -46,7 +47,6 @@ defmodule Ex338Web.Commish.FantasyLeagueLive.Approval do {:noreply, socket} end - @impl true def handle_event("update_trade", %{"id" => id} = params, socket) do socket = id @@ -56,7 +56,6 @@ defmodule Ex338Web.Commish.FantasyLeagueLive.Approval do {:noreply, socket} end - @impl true def handle_event("toggle_league_filter", _params, socket) do socket = assign(socket, :filter, toggle_filter(socket)) @@ -68,6 +67,20 @@ defmodule Ex338Web.Commish.FantasyLeagueLive.Approval do {:noreply, socket} end + def handle_event("create_future_picks", _params, socket) do + %{fantasy_league: fantasy_league} = socket.assigns + rounds = 20 + + future_picks = FantasyLeagues.create_future_picks_for_league(fantasy_league.id, rounds) + + socket = + socket + |> assign(:future_picks, future_picks) + |> put_flash(:info, "Successfully created 20 rounds of future picks") + + {:noreply, socket} + end + @impl true def render(assigns) do Phoenix.View.render(Ex338Web.Commish.FantasyLeagueView, "approval.html", assigns) @@ -99,6 +112,10 @@ defmodule Ex338Web.Commish.FantasyLeagueLive.Approval do Trades.list_trades(query_for_commish_action) end + defp fetch_future_picks(%{fantasy_league: fantasy_league}) do + DraftPicks.list_future_picks_by_league(fantasy_league.id) + end + def toggle_filter(%{assigns: %{filter: :all}}), do: :league def toggle_filter(%{assigns: %{filter: :league}}), do: :all diff --git a/lib/ex338_web/templates/commish/fantasy_league/approval.html.leex b/lib/ex338_web/templates/commish/fantasy_league/approval.html.leex index 2253e359..df0372d3 100644 --- a/lib/ex338_web/templates/commish/fantasy_league/approval.html.leex +++ b/lib/ex338_web/templates/commish/fantasy_league/approval.html.leex @@ -20,3 +20,28 @@ <%= render "trade_table.html", assigns %> + +

+ Future Picks +

+ +
+
+

Manage future picks

+
+

There are currently <%= Enum.count(@future_picks) %> future picks created for this league.

+
+ <%= if @future_picks == [] do %> +
+ +
+ <% end %> +
+
diff --git a/test/ex338_web/live/commish/fantasy_league_live_test.exs b/test/ex338_web/live/commish/fantasy_league_live_test.exs index 904150cc..3ac1bd6b 100644 --- a/test/ex338_web/live/commish/fantasy_league_live_test.exs +++ b/test/ex338_web/live/commish/fantasy_league_live_test.exs @@ -335,6 +335,28 @@ defmodule Ex338Web.Commish.FantasyLeagueLiveTest do refute html =~ player_a.player_name end + test "allows commish to create future picks if none have been created", %{conn: conn} do + insert(:user, name: "test", email: "test@example.com", id: 1) + conn = put_in(conn.assigns.current_user.admin, true) + fantasy_league = insert(:fantasy_league) + + team_a = insert(:fantasy_team, fantasy_league: fantasy_league) + player_a = insert(:fantasy_player) + insert(:roster_position, fantasy_team: team_a, fantasy_player: player_a) + + {:ok, view, _html} = + live(conn, commish_fantasy_league_approval_path(conn, :index, fantasy_league.id)) + + assert has_element?(view, "h2", "Future Picks") + + view + |> element("button#create-future-picks") + |> render_click() + + assert has_element?(view, "p", "currently 20 future picks created for this league") + refute has_element?(view, "button#create-future-picks") + end + test "redirects if not admin", %{conn: conn} do conn = put_in(conn.assigns.current_user.admin, false) fantasy_league = insert(:fantasy_league) From 9592f88a3f2c02d83235bfd5ae3ee675c6ef948a Mon Sep 17 00:00:00 2001 From: Axel Clark Date: Sat, 3 Feb 2024 20:41:05 -0800 Subject: [PATCH 03/18] Bump Elixir and Erlang versions --- .github/workflows/main.yml | 13 +++++-------- .tool-versions | 4 ++-- config/test.exs | 2 +- elixir_buildpack.config | 4 ++-- mix.exs | 4 ++-- mix.lock | 6 +++--- test/ex338/draft_picks/draft_pick_test.exs | 2 +- 7 files changed, 16 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c8acc429..f0177cae 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,18 +4,16 @@ name: Elixir Testing CI # This workflow runs every push on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] # Jobs are run in parallel jobs: - # This is our one and only job test: runs-on: ubuntu-latest services: - # We need postgres for our tests postgres: image: postgres:14 @@ -27,7 +25,7 @@ jobs: POSTGRES_DB: postgres # Maps tcp port 5432 on service container to the host - ports: ['5432:5432'] + ports: ["5432:5432"] # Set health checks to wait until postgres has started options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 @@ -51,7 +49,6 @@ jobs: # A job has any number of steps: we will define them here # Each dash (-) represents a step. Sometimes we give them a custom name, sometimes we leave it if it's obvious. steps: - # Our OS filesystem has nothing on it - let's checkout our codebase using a pre-made Github step - uses: actions/checkout@v3 @@ -60,8 +57,8 @@ jobs: - name: Setup Elixir uses: erlef/setup-beam@v1 with: - otp-version: '25.3.2' - elixir-version: '1.14.4' + otp-version: "26.2.1" + elixir-version: "1.16.1" # We might as well re-use our deps instead of downloading them over and over. So let's use a cache. # Docs: https://github.com/actions/cache diff --git a/.tool-versions b/.tool-versions index dc09c857..53ee0b15 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,2 @@ -elixir 1.14.4-otp-25 -erlang 25.3.2 +elixir 1.16.1-otp-26 +erlang 26.2.1 diff --git a/config/test.exs b/config/test.exs index f9a50398..ba89013f 100644 --- a/config/test.exs +++ b/config/test.exs @@ -8,7 +8,7 @@ config :ex338, Ex338Web.Endpoint, pubsub_server: Ex338.PubSub # Print only warnings and errors during test -config :logger, level: :warn +config :logger, level: :warning # Configure your database config :ex338, Ex338.Repo, diff --git a/elixir_buildpack.config b/elixir_buildpack.config index 091646c1..bb40f067 100644 --- a/elixir_buildpack.config +++ b/elixir_buildpack.config @@ -1,8 +1,8 @@ # Erlang version -erlang_version=25.3.2 +erlang_version=26.2.1 # Elixir version -elixir_version=1.14.4 +elixir_version=1.16.1 config_vars_to_export=(SENDGRID_API_KEY) diff --git a/mix.exs b/mix.exs index 10cf2a48..7c603dc8 100644 --- a/mix.exs +++ b/mix.exs @@ -40,9 +40,9 @@ defmodule Ex338.Mixfile do {:canary, "~> 1.1.0"}, {:cowboy, "~> 2.0"}, {:csv, "~> 3.0.5"}, - {:ecto, "~> 3.8.4"}, + {:ecto, "~> 3.11.0"}, {:ecto_enum, "~> 1.4"}, - {:ecto_sql, "~> 3.8.3"}, + {:ecto_sql, "~> 3.11.0"}, {:ex_machina, "~> 2.7.0", only: :test}, {:exgravatar, "~> 2.0.0"}, {:floki, "~> 0.34.3", only: :test}, diff --git a/mix.lock b/mix.lock index 89ae01bd..ea5c10a3 100644 --- a/mix.lock +++ b/mix.lock @@ -11,12 +11,12 @@ "cowboy_telemetry": {:hex, :cowboy_telemetry, "0.3.1", "ebd1a1d7aff97f27c66654e78ece187abdc646992714164380d8a041eda16754", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3a6efd3366130eab84ca372cbd4a7d3c3a97bdfcfb4911233b035d117063f0af"}, "cowlib": {:hex, :cowlib, "2.12.1", "a9fa9a625f1d2025fe6b462cb865881329b5caff8f1854d1cbc9f9533f00e1e1", [:make, :rebar3], [], "hexpm", "163b73f6367a7341b33c794c4e88e7dbfe6498ac42dcd69ef44c5bc5507c8db0"}, "csv": {:hex, :csv, "3.0.5", "3c1455127e92de8845806db89554ad7d45e0212974be41dd9c38a5c881861713", [:mix], [], "hexpm", "cbbe5455c93df5f3f2943e995e28b7a8808361ba34cf3e44267d77a01eaf1609"}, - "db_connection": {:hex, :db_connection, "2.5.0", "bb6d4f30d35ded97b29fe80d8bd6f928a1912ca1ff110831edcd238a1973652c", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c92d5ba26cd69ead1ff7582dbb860adeedfff39774105a4f1c92cbb654b55aa2"}, + "db_connection": {:hex, :db_connection, "2.6.0", "77d835c472b5b67fc4f29556dee74bf511bbafecdcaf98c27d27fa5918152086", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c2f992d15725e721ec7fbc1189d4ecdb8afef76648c746a8e1cad35e3b8a35f3"}, "decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"}, "earmark": {:hex, :earmark, "1.3.2", "b840562ea3d67795ffbb5bd88940b1bed0ed9fa32834915125ea7d02e35888a5", [:mix], [], "hexpm", "e3be2bc3ae67781db529b80aa7e7c49904a988596e2dbff897425b48b3581161"}, - "ecto": {:hex, :ecto, "3.8.4", "e06b8b87e62b27fea17fd2ff6041572ddd10339fd16cdf58446e402c6c90a74b", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f9244288b8d42db40515463a008cf3f4e0e564bb9c249fe87bf28a6d79fe82d4"}, + "ecto": {:hex, :ecto, "3.11.1", "4b4972b717e7ca83d30121b12998f5fcdc62ba0ed4f20fd390f16f3270d85c3e", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ebd3d3772cd0dfcd8d772659e41ed527c28b2a8bde4b00fe03e0463da0f1983b"}, "ecto_enum": {:hex, :ecto_enum, "1.4.0", "d14b00e04b974afc69c251632d1e49594d899067ee2b376277efd8233027aec8", [:mix], [{:ecto, ">= 3.0.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:ecto_sql, "> 3.0.0", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:mariaex, ">= 0.0.0", [hex: :mariaex, repo: "hexpm", optional: true]}, {:postgrex, ">= 0.0.0", [hex: :postgrex, repo: "hexpm", optional: true]}], "hexpm", "8fb55c087181c2b15eee406519dc22578fa60dd82c088be376d0010172764ee4"}, - "ecto_sql": {:hex, :ecto_sql, "3.8.3", "a7d22c624202546a39d615ed7a6b784580391e65723f2d24f65941b4dd73d471", [:mix], [{:db_connection, "~> 2.5 or ~> 2.4.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.8.4", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.15.0 or ~> 0.16.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "348cb17fb9e6daf6f251a87049eafcb57805e2892e5e6a0f5dea0985d367329b"}, + "ecto_sql": {:hex, :ecto_sql, "3.11.1", "e9abf28ae27ef3916b43545f9578b4750956ccea444853606472089e7d169470", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.11.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16.0 or ~> 0.17.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ce14063ab3514424276e7e360108ad6c2308f6d88164a076aac8a387e1fea634"}, "elixir_make": {:hex, :elixir_make, "0.6.3", "bc07d53221216838d79e03a8019d0839786703129599e9619f4ab74c8c096eac", [:mix], [], "hexpm", "f5cbd651c5678bcaabdbb7857658ee106b12509cd976c2c2fca99688e1daf716"}, "ex_machina": {:hex, :ex_machina, "2.7.0", "b792cc3127fd0680fecdb6299235b4727a4944a09ff0fa904cc639272cd92dc7", [:mix], [{:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: true]}], "hexpm", "419aa7a39bde11894c87a615c4ecaa52d8f107bbdd81d810465186f783245bf8"}, "exgravatar": {:hex, :exgravatar, "2.0.3", "2349709832ee535f826f48db98cddd294ae62b01acb44d539a16419bd8ebc3e5", [:mix], [], "hexpm", "aca18ff9bd8991d3be3e5446d3bdefc051be084c1ffc9ab2d43b3e65339300e1"}, diff --git a/test/ex338/draft_picks/draft_pick_test.exs b/test/ex338/draft_picks/draft_pick_test.exs index deda57bf..01fc66cb 100644 --- a/test/ex338/draft_picks/draft_pick_test.exs +++ b/test/ex338/draft_picks/draft_pick_test.exs @@ -410,7 +410,7 @@ defmodule Ex338.DraftPicks.DraftPickTest do test "only allows update to fantasy player" do changeset = DraftPick.owner_changeset(%DraftPick{}, @valid_user_attrs) - assert Map.keys(changeset.changes) == [:drafted_at, :fantasy_player_id] + assert Map.keys(changeset.changes) == [:fantasy_player_id, :drafted_at] end test "with invalid attributes" do From 7f45a07ed0736c7d76021aab9178c5f571f56a41 Mon Sep 17 00:00:00 2001 From: Axel Clark Date: Sat, 3 Feb 2024 21:04:19 -0800 Subject: [PATCH 04/18] Resolves deps issue and mix format --- .../controllers/commish_email_controller.ex | 5 ++++- lib/ex338_web/templates/layout/root.html.eex | 4 ++-- mix.exs | 4 ++-- mix.lock | 22 +++++++++---------- test/ex338/championships_test.exs | 21 +++++++++++++++--- .../injured_reserve_controller_test.exs | 4 +++- 6 files changed, 40 insertions(+), 20 deletions(-) diff --git a/lib/ex338_web/controllers/commish_email_controller.ex b/lib/ex338_web/controllers/commish_email_controller.ex index 67281820..daa055a8 100644 --- a/lib/ex338_web/controllers/commish_email_controller.ex +++ b/lib/ex338_web/controllers/commish_email_controller.ex @@ -4,7 +4,10 @@ defmodule Ex338Web.CommishEmailController do alias Ex338Web.{CommishEmail} def new(conn, _params) do - render(conn, "new.html", fantasy_leagues: Repo.all(FantasyLeague), page_title: "Commish Email") + render(conn, "new.html", + fantasy_leagues: Repo.all(FantasyLeague), + page_title: "Commish Email" + ) end def create(conn, %{ diff --git a/lib/ex338_web/templates/layout/root.html.eex b/lib/ex338_web/templates/layout/root.html.eex index 4ff2c0c9..5a6cf069 100644 --- a/lib/ex338_web/templates/layout/root.html.eex +++ b/lib/ex338_web/templates/layout/root.html.eex @@ -2,9 +2,9 @@ <%= render "head.html", assigns %>
- <%= if show_nav_components?(@conn), do: render "sidebar.html", assigns %> + <%= if show_nav_components?(@conn), do: render("sidebar.html", assigns) %>
- <%= if show_nav_components?(@conn), do: render "navbar.html", assigns %> + <%= if show_nav_components?(@conn), do: render("navbar.html", assigns) %>
diff --git a/mix.exs b/mix.exs index 7c603dc8..c0d30da5 100644 --- a/mix.exs +++ b/mix.exs @@ -38,7 +38,7 @@ defmodule Ex338.Mixfile do {:bcrypt_elixir, "~> 3.0"}, {:calendar, "~> 1.0.0"}, {:canary, "~> 1.1.0"}, - {:cowboy, "~> 2.0"}, + {:cowboy, "~> 2.10"}, {:csv, "~> 3.0.5"}, {:ecto, "~> 3.11.0"}, {:ecto_enum, "~> 1.4"}, @@ -65,7 +65,7 @@ defmodule Ex338.Mixfile do {:phoenix_live_view, "~> 0.19.0"}, {:phoenix_view, "~> 2.0"}, {:phoenix_swoosh, "~> 1.2.0"}, - {:plug_cowboy, "~> 2.2"}, + {:plug_cowboy, "~> 2.7"}, {:postgrex, "~> 0.16.0"}, {:pow, "== 1.0.28"}, {:redix, "~> 1.2.3"}, diff --git a/mix.lock b/mix.lock index ea5c10a3..ceb439df 100644 --- a/mix.lock +++ b/mix.lock @@ -3,7 +3,7 @@ "calendar": {:hex, :calendar, "1.0.0", "f52073a708528482ec33d0a171954ca610fe2bd28f1e871f247dc7f1565fa807", [:mix], [{:tzdata, "~> 0.5.20 or ~> 0.1.201603 or ~> 1.0", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm", "990e9581920c82912a5ee50e62ff5ef96da6b15949a2ee4734f935fdef0f0a6f"}, "canada": {:hex, :canada, "1.0.2", "040e4c47609b0a67d5773ac1fbe5e99f840cef173d69b739beda7c98453e0770", [:mix], [], "hexpm", "4269f74153fe89583fe50bd4d5de57bfe01f31258a6b676d296f3681f1483c68"}, "canary": {:hex, :canary, "1.1.1", "4138d5e05db8497c477e4af73902eb9ae06e49dceaa13c2dd9f0b55525ded48b", [:mix], [{:canada, "~> 1.0.1", [hex: :canada, repo: "hexpm", optional: false]}, {:ecto, ">= 1.1.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "f348d9848693c830a65b707bba9e4dfdd6434e8c356a8d4477e4535afb0d653b"}, - "castore": {:hex, :castore, "1.0.3", "7130ba6d24c8424014194676d608cb989f62ef8039efd50ff4b3f33286d06db8", [:mix], [], "hexpm", "680ab01ef5d15b161ed6a95449fac5c6b8f60055677a8e79acf01b27baa4390b"}, + "castore": {:hex, :castore, "1.0.5", "9eeebb394cc9a0f3ae56b813459f990abb0a3dedee1be6b27fdb50301930502f", [:mix], [], "hexpm", "8d7c597c3e4a64c395980882d4bca3cebb8d74197c590dc272cfd3b6a6310578"}, "certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"}, "comeonin": {:hex, :comeonin, "5.3.3", "2c564dac95a35650e9b6acfe6d2952083d8a08e4a89b93a481acb552b325892e", [:mix], [], "hexpm", "3e38c9c2cb080828116597ca8807bb482618a315bfafd98c90bc22a821cc84df"}, "connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"}, @@ -13,7 +13,7 @@ "csv": {:hex, :csv, "3.0.5", "3c1455127e92de8845806db89554ad7d45e0212974be41dd9c38a5c881861713", [:mix], [], "hexpm", "cbbe5455c93df5f3f2943e995e28b7a8808361ba34cf3e44267d77a01eaf1609"}, "db_connection": {:hex, :db_connection, "2.6.0", "77d835c472b5b67fc4f29556dee74bf511bbafecdcaf98c27d27fa5918152086", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c2f992d15725e721ec7fbc1189d4ecdb8afef76648c746a8e1cad35e3b8a35f3"}, "decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"}, - "earmark": {:hex, :earmark, "1.3.2", "b840562ea3d67795ffbb5bd88940b1bed0ed9fa32834915125ea7d02e35888a5", [:mix], [], "hexpm", "e3be2bc3ae67781db529b80aa7e7c49904a988596e2dbff897425b48b3581161"}, + "earmark": {:hex, :earmark, "1.4.46", "8c7287bd3137e99d26ae4643e5b7ef2129a260e3dcf41f251750cb4563c8fb81", [:mix], [], "hexpm", "798d86db3d79964e759ddc0c077d5eb254968ed426399fbf5a62de2b5ff8910a"}, "ecto": {:hex, :ecto, "3.11.1", "4b4972b717e7ca83d30121b12998f5fcdc62ba0ed4f20fd390f16f3270d85c3e", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ebd3d3772cd0dfcd8d772659e41ed527c28b2a8bde4b00fe03e0463da0f1983b"}, "ecto_enum": {:hex, :ecto_enum, "1.4.0", "d14b00e04b974afc69c251632d1e49594d899067ee2b376277efd8233027aec8", [:mix], [{:ecto, ">= 3.0.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:ecto_sql, "> 3.0.0", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:mariaex, ">= 0.0.0", [hex: :mariaex, repo: "hexpm", optional: true]}, {:postgrex, ">= 0.0.0", [hex: :postgrex, repo: "hexpm", optional: true]}], "hexpm", "8fb55c087181c2b15eee406519dc22578fa60dd82c088be376d0010172764ee4"}, "ecto_sql": {:hex, :ecto_sql, "3.11.1", "e9abf28ae27ef3916b43545f9578b4750956ccea444853606472089e7d169470", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.11.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16.0 or ~> 0.17.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ce14063ab3514424276e7e360108ad6c2308f6d88164a076aac8a387e1fea634"}, @@ -41,9 +41,9 @@ "oban": {:hex, :oban, "2.15.1", "d49803174a4b564b1c90d107363d55a59e9e48aeb472ea364ea45d22a5c56997", [:mix], [{:ecto_sql, "~> 3.6", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:ecto_sqlite3, "~> 0.9", [hex: :ecto_sqlite3, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "60be616498db864a8fdd5e013b92f95d2a1d28a3f387c82bf05b35cdcb2af3e1"}, "parallel_stream": {:hex, :parallel_stream, "1.0.6", "b967be2b23f0f6787fab7ed681b4c45a215a81481fb62b01a5b750fa8f30f76c", [:mix], [], "hexpm", "639b2e8749e11b87b9eb42f2ad325d161c170b39b288ac8d04c4f31f8f0823eb"}, "parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"}, - "phoenix": {:hex, :phoenix, "1.7.7", "4cc501d4d823015007ba3cdd9c41ecaaf2ffb619d6fb283199fa8ddba89191e0", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "8966e15c395e5e37591b6ed0bd2ae7f48e961f0f60ac4c733f9566b519453085"}, + "phoenix": {:hex, :phoenix, "1.7.10", "02189140a61b2ce85bb633a9b6fd02dff705a5f1596869547aeb2b2b95edd729", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "cf784932e010fd736d656d7fead6a584a4498efefe5b8227e9f383bf15bb79d0"}, "phoenix_ecto": {:hex, :phoenix_ecto, "4.4.2", "b21bd01fdeffcfe2fab49e4942aa938b6d3e89e93a480d4aee58085560a0bc0d", [:mix], [{:ecto, "~> 3.5", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "70242edd4601d50b69273b057ecf7b684644c19ee750989fd555625ae4ce8f5d"}, - "phoenix_html": {:hex, :phoenix_html, "3.3.1", "4788757e804a30baac6b3fc9695bf5562465dd3f1da8eb8460ad5b404d9a2178", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "bed1906edd4906a15fd7b412b85b05e521e1f67c9a85418c55999277e553d0d3"}, + "phoenix_html": {:hex, :phoenix_html, "3.3.3", "380b8fb45912b5638d2f1d925a3771b4516b9a78587249cabe394e0a5d579dc9", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "923ebe6fec6e2e3b3e569dfbdc6560de932cd54b000ada0208b5f45024bdd76c"}, "phoenix_live_dashboard": {:hex, :phoenix_live_dashboard, "0.8.0", "0b3158b5b198aa444473c91d23d79f52fb077e807ffad80dacf88ce078fa8df2", [:mix], [{:ecto, "~> 3.6.2 or ~> 3.7", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_mysql_extras, "~> 0.5", [hex: :ecto_mysql_extras, repo: "hexpm", optional: true]}, {:ecto_psql_extras, "~> 0.7", [hex: :ecto_psql_extras, repo: "hexpm", optional: true]}, {:ecto_sqlite3_extras, "~> 1.1.7", [hex: :ecto_sqlite3_extras, repo: "hexpm", optional: true]}, {:mime, "~> 1.6 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.19.0", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.6 or ~> 1.0", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "87785a54474fed91a67a1227a741097eb1a42c2e49d3c0d098b588af65cd410d"}, "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.3.3", "3a53772a6118d5679bf50fc1670505a290e32a1d195df9e069d8c53ab040c054", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "766796676e5f558dbae5d1bdb066849673e956005e3730dfd5affd7a6da4abac"}, "phoenix_live_view": {:hex, :phoenix_live_view, "0.19.4", "dd9ffe3ca0683bdef4f340bcdd2c35a6ee0d581a2696033fc25f52e742618bdc", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "fd2c666d227476d63af7b8c20e6e61d16f07eb49f924cf4198fca7668156f15b"}, @@ -51,11 +51,11 @@ "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.3", "3168d78ba41835aecad272d5e8cd51aa87a7ac9eb836eabc42f6e57538e3731d", [:mix], [], "hexpm", "bba06bc1dcfd8cb086759f0edc94a8ba2bc8896d5331a1e2c2902bf8e36ee502"}, "phoenix_pubsub_redis": {:hex, :phoenix_pubsub_redis, "3.0.1", "d4d856b1e57a21358e448543e1d091e07e83403dde4383b8be04ed9d2c201cbc", [:mix], [{:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5.1 or ~> 1.6", [hex: :poolboy, repo: "hexpm", optional: false]}, {:redix, "~> 0.10.0 or ~> 1.0", [hex: :redix, repo: "hexpm", optional: false]}], "hexpm", "0b36a17ff6e9a56159f8df8933d62b5c1f0695eae995a02e0c86c035ace6a309"}, "phoenix_swoosh": {:hex, :phoenix_swoosh, "1.2.0", "a544d83fde4a767efb78f45404a74c9e37b2a9c5ea3339692e65a6966731f935", [:mix], [{:finch, "~> 0.8", [hex: :finch, repo: "hexpm", optional: true]}, {:hackney, "~> 1.10", [hex: :hackney, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6", [hex: :phoenix, repo: "hexpm", optional: true]}, {:phoenix_html, "~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_view, "~> 1.0 or ~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:swoosh, "~> 1.5", [hex: :swoosh, repo: "hexpm", optional: false]}], "hexpm", "e88d117251e89a16b92222415a6d87b99a96747ddf674fc5c7631de734811dba"}, - "phoenix_template": {:hex, :phoenix_template, "1.0.3", "32de561eefcefa951aead30a1f94f1b5f0379bc9e340bb5c667f65f1edfa4326", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "16f4b6588a4152f3cc057b9d0c0ba7e82ee23afa65543da535313ad8d25d8e2c"}, - "phoenix_view": {:hex, :phoenix_view, "2.0.2", "6bd4d2fd595ef80d33b439ede6a19326b78f0f1d8d62b9a318e3d9c1af351098", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}], "hexpm", "a929e7230ea5c7ee0e149ffcf44ce7cf7f4b6d2bfe1752dd7c084cdff152d36f"}, - "plug": {:hex, :plug, "1.14.2", "cff7d4ec45b4ae176a227acd94a7ab536d9b37b942c8e8fa6dfc0fff98ff4d80", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "842fc50187e13cf4ac3b253d47d9474ed6c296a8732752835ce4a86acdf68d13"}, - "plug_cowboy": {:hex, :plug_cowboy, "2.6.1", "9a3bbfceeb65eff5f39dab529e5cd79137ac36e913c02067dba3963a26efe9b2", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "de36e1a21f451a18b790f37765db198075c25875c64834bcc82d90b309eb6613"}, - "plug_crypto": {:hex, :plug_crypto, "1.2.5", "918772575e48e81e455818229bf719d4ab4181fcbf7f85b68a35620f78d89ced", [:mix], [], "hexpm", "26549a1d6345e2172eb1c233866756ae44a9609bd33ee6f99147ab3fd87fd842"}, + "phoenix_template": {:hex, :phoenix_template, "1.0.4", "e2092c132f3b5e5b2d49c96695342eb36d0ed514c5b252a77048d5969330d639", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "2c0c81f0e5c6753faf5cca2f229c9709919aba34fab866d3bc05060c9c444206"}, + "phoenix_view": {:hex, :phoenix_view, "2.0.3", "4d32c4817fce933693741deeb99ef1392619f942633dde834a5163124813aad3", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}], "hexpm", "cd34049af41be2c627df99cd4eaa71fc52a328c0c3d8e7d4aa28f880c30e7f64"}, + "plug": {:hex, :plug, "1.15.3", "712976f504418f6dff0a3e554c40d705a9bcf89a7ccef92fc6a5ef8f16a30a97", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "cc4365a3c010a56af402e0809208873d113e9c38c401cabd88027ef4f5c01fd2"}, + "plug_cowboy": {:hex, :plug_cowboy, "2.7.0", "3ae9369c60641084363b08fe90267cbdd316df57e3557ea522114b30b63256ea", [:mix], [{:cowboy, "~> 2.7.0 or ~> 2.8.0 or ~> 2.9.0 or ~> 2.10.0", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "d85444fb8aa1f2fc62eabe83bbe387d81510d773886774ebdcb429b3da3c1a4a"}, + "plug_crypto": {:hex, :plug_crypto, "2.0.0", "77515cc10af06645abbfb5e6ad7a3e9714f805ae118fa1a70205f80d2d70fe73", [:mix], [], "hexpm", "53695bae57cc4e54566d993eb01074e4d894b65a3766f1c43e2c61a1b0f45ea9"}, "poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm", "fec8660eb7733ee4117b85f55799fd3833eb769a6df71ccf8903e8dc5447cfce"}, "poolboy": {:hex, :poolboy, "1.5.2", "392b007a1693a64540cead79830443abf5762f5d30cf50bc95cb2c1aaafa006b", [:rebar3], [], "hexpm", "dad79704ce5440f3d5a3681c8590b9dc25d1a561e8f5a9c995281012860901e3"}, "postgrex": {:hex, :postgrex, "0.16.5", "fcc4035cc90e23933c5d69a9cd686e329469446ef7abba2cf70f08e2c4b69810", [:mix], [{:connection, "~> 1.1", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "edead639dc6e882618c01d8fc891214c481ab9a3788dfe38dd5e37fd1d5fb2e8"}, @@ -69,6 +69,6 @@ "telemetry_poller": {:hex, :telemetry_poller, "0.5.1", "21071cc2e536810bac5628b935521ff3e28f0303e770951158c73eaaa01e962a", [:rebar3], [{:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "4cab72069210bc6e7a080cec9afffad1b33370149ed5d379b81c7c5f0c663fd4"}, "tzdata": {:hex, :tzdata, "1.0.1", "f6027a331af7d837471248e62733c6ebee86a72e57c613aa071ebb1f750fc71a", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "cf1345dfbce6acdfd4e23cbb36e96e53d1981bc89181cd0b936f4f398f4c0b78"}, "unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"}, - "websock": {:hex, :websock, "0.5.2", "b3c08511d8d79ed2c2f589ff430bd1fe799bb389686dafce86d28801783d8351", [:mix], [], "hexpm", "925f5de22fca6813dfa980fb62fd542ec43a2d1a1f83d2caec907483fe66ff05"}, - "websock_adapter": {:hex, :websock_adapter, "0.5.3", "4908718e42e4a548fc20e00e70848620a92f11f7a6add8cf0886c4232267498d", [:mix], [{:bandit, ">= 0.6.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "cbe5b814c1f86b6ea002b52dd99f345aeecf1a1a6964e209d208fb404d930d3d"}, + "websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"}, + "websock_adapter": {:hex, :websock_adapter, "0.5.5", "9dfeee8269b27e958a65b3e235b7e447769f66b5b5925385f5a569269164a210", [:mix], [{:bandit, ">= 0.6.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "4b977ba4a01918acbf77045ff88de7f6972c2a009213c515a445c48f224ffce9"}, } diff --git a/test/ex338/championships_test.exs b/test/ex338/championships_test.exs index 4100db2e..cf49104e 100644 --- a/test/ex338/championships_test.exs +++ b/test/ex338/championships_test.exs @@ -126,7 +126,12 @@ defmodule Ex338.ChampionshipsTest do team_c = insert(:fantasy_team, fantasy_league: league, team_name: "C") player = insert(:fantasy_player) - insert(:championship_result, championship: event, rank: 1, points: 8, fantasy_player: player) + insert(:championship_result, + championship: event, + rank: 1, + points: 8, + fantasy_player: player + ) insert(:championship_result, championship: event_b, @@ -195,7 +200,12 @@ defmodule Ex338.ChampionshipsTest do team_c = insert(:fantasy_team, fantasy_league: league, team_name: "C") player = insert(:fantasy_player) - insert(:championship_result, championship: event, rank: 1, points: 8, fantasy_player: player) + insert(:championship_result, + championship: event, + rank: 1, + points: 8, + fantasy_player: player + ) insert(:championship_result, championship: event_b, @@ -324,7 +334,12 @@ defmodule Ex338.ChampionshipsTest do player = insert(:fantasy_player) player2 = insert(:fantasy_player) - insert(:championship_result, championship: event, rank: 1, points: 8, fantasy_player: player) + insert(:championship_result, + championship: event, + rank: 1, + points: 8, + fantasy_player: player + ) _2nd_place = insert(:championship_result, diff --git a/test/ex338_web/controllers/injured_reserve_controller_test.exs b/test/ex338_web/controllers/injured_reserve_controller_test.exs index 8ce64e31..6f3451ea 100644 --- a/test/ex338_web/controllers/injured_reserve_controller_test.exs +++ b/test/ex338_web/controllers/injured_reserve_controller_test.exs @@ -101,7 +101,9 @@ defmodule Ex338Web.InjuredReserveControllerTest do conn = post( conn, - fantasy_team_injured_reserve_path(conn, :create, team.id, injured_reserve: invalid_attrs) + fantasy_team_injured_reserve_path(conn, :create, team.id, + injured_reserve: invalid_attrs + ) ) assert html_response(conn, 200) =~ "Please check the errors below." From 694a800b92dffdf8dc292d0997f8420e1ae46e8f Mon Sep 17 00:00:00 2001 From: Axel Clark Date: Sat, 3 Feb 2024 21:28:59 -0800 Subject: [PATCH 05/18] Add Styler --- .formatter.exs | 5 +- .iex.exs | 72 +++++++++---------- lib/ex338/abilities.ex | 24 +++---- lib/ex338/accounts.ex | 7 +- lib/ex338/accounts/user.ex | 5 +- lib/ex338/autodraft.ex | 42 ++++------- lib/ex338/championships.ex | 28 ++++---- .../championships/champ_with_events_result.ex | 3 +- lib/ex338/championships/championship.ex | 15 ++-- .../championships/championship_result.ex | 15 ++-- lib/ex338/championships/championship_slot.ex | 1 + lib/ex338/championships/create_slot.ex | 8 ++- lib/ex338/draft_picks.ex | 7 +- lib/ex338/draft_picks/admin.ex | 9 +-- lib/ex338/draft_picks/clock.ex | 9 +-- lib/ex338/draft_picks/draft_pick.ex | 48 +++++++------ lib/ex338/draft_picks/future_pick.ex | 2 + lib/ex338/draft_queues.ex | 5 +- lib/ex338/draft_queues/admin.ex | 4 +- lib/ex338/draft_queues/draft_queue.ex | 11 +-- lib/ex338/fantasy_leagues.ex | 30 ++++---- lib/ex338/fantasy_leagues/fantasy_league.ex | 1 + .../fantasy_leagues/fantasy_league_admin.ex | 5 +- .../fantasy_leagues/historical_record.ex | 1 + .../fantasy_leagues/historical_winning.ex | 1 + lib/ex338/fantasy_leagues/league_sport.ex | 1 + lib/ex338/fantasy_players.ex | 14 ++-- lib/ex338/fantasy_players/fantasy_player.ex | 11 ++- lib/ex338/fantasy_players/sports_league.ex | 1 + lib/ex338/fantasy_teams.ex | 24 +++---- lib/ex338/fantasy_teams/fantasy_team.ex | 34 ++++----- lib/ex338/fantasy_teams/owner.ex | 2 + lib/ex338/fantasy_teams/standings.ex | 4 +- lib/ex338/in_season_draft_picks.ex | 14 ++-- lib/ex338/in_season_draft_picks/admin.ex | 9 +-- lib/ex338/in_season_draft_picks/clock.ex | 1 + .../in_season_draft_pick.ex | 1 + lib/ex338/injured_reserves.ex | 10 ++- lib/ex338/injured_reserves/admin.ex | 3 +- lib/ex338/injured_reserves/injured_reserve.ex | 1 + lib/ex338/jobs.ex | 1 + lib/ex338/roster_positions.ex | 14 ++-- lib/ex338/roster_positions/admin.ex | 6 +- lib/ex338/roster_positions/open_position.ex | 11 ++- lib/ex338/roster_positions/roster_position.ex | 1 + lib/ex338/trades.ex | 65 ++++++++--------- lib/ex338/trades/admin.ex | 4 +- lib/ex338/trades/trade.ex | 8 ++- lib/ex338/trades/trade_line_item.ex | 20 ++---- lib/ex338/trades/trade_vote.ex | 2 + lib/ex338/uploader.ex | 4 +- lib/ex338/validate_helpers.ex | 2 +- lib/ex338/waivers.ex | 17 +++-- lib/ex338/waivers/admin.ex | 22 +++--- lib/ex338/waivers/batch_process.ex | 12 ++-- lib/ex338/waivers/validate.ex | 36 +++++----- lib/ex338/waivers/waiver.ex | 21 +++--- .../workers/in_season_autodraft_worker.ex | 4 +- lib/ex338_web.ex | 32 ++++----- .../controllers/archived_league_controller.ex | 2 +- lib/ex338_web/controllers/authorization.ex | 9 +-- .../controllers/championship_controller.ex | 4 +- .../championship_slot_admin_controller.ex | 2 +- .../controllers/commish_email_controller.ex | 12 ++-- .../controllers/draft_pick_controller.ex | 16 ++--- .../controllers/draft_queue_controller.ex | 9 ++- .../controllers/fantasy_league_controller.ex | 3 +- .../controllers/fantasy_player_controller.ex | 3 +- .../controllers/fantasy_team_controller.ex | 8 ++- .../in_season_draft_order_controller.ex | 2 +- .../in_season_draft_pick_controller.ex | 8 ++- .../controllers/injured_reserve_controller.ex | 17 ++--- lib/ex338_web/controllers/owner_controller.ex | 5 +- lib/ex338_web/controllers/page_controller.ex | 2 +- .../controllers/table_upload_controller.ex | 3 +- lib/ex338_web/controllers/trade_controller.ex | 38 +++++----- .../controllers/trade_vote_controller.ex | 14 ++-- lib/ex338_web/controllers/user_controller.ex | 7 +- .../controllers/waiver_admin_controller.ex | 7 +- .../controllers/waiver_controller.ex | 11 ++- lib/ex338_web/emails/commish_email.ex | 7 +- lib/ex338_web/emails/draft_email.ex | 14 ++-- lib/ex338_web/emails/in_season_draft_email.ex | 9 ++- lib/ex338_web/emails/notification_email.ex | 9 ++- lib/ex338_web/live/championship_live.ex | 10 +-- .../commish/fantasy_league_live/approval.ex | 7 +- .../live/commish/fantasy_league_live/edit.ex | 1 + .../fantasy_league_live/form_component.ex | 1 + lib/ex338_web/live/draft_pick_live.ex | 6 +- lib/ex338_web/live/live_helpers.ex | 1 + lib/ex338_web/live/modal_component.ex | 1 + lib/ex338_web/live/rules_live.ex | 4 +- lib/ex338_web/mailer.ex | 2 +- lib/ex338_web/plugs/canonical_domain.ex | 2 +- lib/ex338_web/plugs/event.ex | 2 +- lib/ex338_web/plugs/load_leagues.ex | 2 +- lib/ex338_web/plugs/load_user_teams.ex | 2 +- lib/ex338_web/pow/redis_cache.ex | 14 ++-- lib/ex338_web/router.ex | 4 +- lib/ex338_web/telemetry.ex | 2 + lib/ex338_web/views/email_view.ex | 9 +-- lib/ex338_web/views/fantasy_team_view.ex | 16 ++--- lib/ex338_web/views/input_helpers.ex | 1 + lib/ex338_web/views/layout_view.ex | 6 +- lib/ex338_web/views/user_view.ex | 2 +- lib/ex338_web/views/view_helpers.ex | 24 +++---- mix.exs | 1 + mix.lock | 1 + priv/repo/seeds.exs | 21 +++--- test/ex338/accounts/user_test.exs | 3 +- test/ex338/accounts_test.exs | 1 + test/ex338/autodraft_test.exs | 12 ++-- test/ex338/calendar_assistant_test.exs | 11 +-- .../championship_result_test.exs | 3 +- .../championships/championship_slot_test.exs | 3 +- .../ex338/championships/championship_test.exs | 3 +- test/ex338/championships/create_slot_test.exs | 10 ++- test/ex338/championships_test.exs | 14 ++-- test/ex338/commish_email_test.exs | 5 +- test/ex338/draft_picks/clock_test.exs | 10 ++- test/ex338/draft_picks/draft_pick_test.exs | 6 +- test/ex338/draft_picks_test.exs | 4 +- test/ex338/draft_queues/admin_test.exs | 3 +- test/ex338/draft_queues_test.exs | 3 +- .../fantasy_leagues/fantasy_league_test.exs | 8 ++- test/ex338/fantasy_leagues_test.exs | 4 +- .../fantasy_players/fantasy_player_test.exs | 3 +- .../fantasy_players/sports_league_test.exs | 3 +- test/ex338/fantasy_players_test.exs | 4 +- test/ex338/fantasy_teams/deadlines_test.exs | 4 +- .../ex338/fantasy_teams/fantasy_team_test.exs | 3 +- .../fantasy_teams/standings_history_test.exs | 3 +- test/ex338/fantasy_teams/standings_test.exs | 3 +- test/ex338/fantasy_teams_test.exs | 4 +- .../in_season_draft_picks/admin_test.exs | 9 +-- .../in_season_draft_picks/clock_test.exs | 10 ++- .../in_season_draft_pick_test.exs | 4 +- test/ex338/in_season_draft_picks_test.exs | 10 ++- .../injured_reserves/injured_reserve_test.exs | 2 +- test/ex338/injured_reserves_test.exs | 10 ++- test/ex338/jobs_test.exs | 6 +- test/ex338/roster_positions/admin_test.exs | 4 +- .../roster_positions/ir_position_test.exs | 1 + .../roster_positions/open_position_test.exs | 3 +- .../roster_positions/roster_position_test.exs | 2 +- test/ex338/roster_positions_test.exs | 3 +- test/ex338/trades/admin_test.exs | 13 ++-- test/ex338/trades/trade_test.exs | 4 +- test/ex338/trades_test.exs | 5 +- test/ex338/uploader_test.exs | 5 +- test/ex338/validate_helpers_test.exs | 2 +- test/ex338/waivers/admin_test.exs | 4 +- test/ex338/waivers/batch_process_test.exs | 5 +- test/ex338/waivers/waiver_test.exs | 5 +- test/ex338/waivers_test.exs | 5 +- .../in_season_autodraft_worker_test.exs | 3 +- .../championship_controller_test.exs | 4 +- .../championship_slot_admin_test.exs | 4 +- .../commish_email_controller_test.exs | 6 +- .../draft_pick_controller_index_test.exs | 3 +- .../draft_pick_controller_test.exs | 8 +-- .../draft_queue_controller_test.exs | 3 +- .../fantasy_team_update_controller_test.exs | 10 ++- .../in_season_draft_order_controller_test.exs | 4 +- .../in_season_draft_pick_controller_test.exs | 10 ++- .../injured_reserve_controller_test.exs | 5 +- .../controllers/page_controller_test.exs | 1 + .../table_upload_controller_test.exs | 3 +- .../controllers/trade_controller_test.exs | 4 +- .../trade_vote_controller_test.exs | 7 +- .../controllers/user_controller_test.exs | 3 +- .../waiver_admin_controller_test.exs | 10 ++- .../controllers/waiver_controller_test.exs | 6 +- .../live/commish/fantasy_league_live_test.exs | 2 +- test/ex338_web/mailer_test.exs | 3 +- .../ex338_web/plugs/canonical_domain_test.exs | 2 +- test/ex338_web/plugs/load_leagues_test.exs | 2 +- test/ex338_web/plugs/load_user_teams_test.exs | 5 +- test/ex338_web/pow/pow_redis_cache_test.exs | 3 +- .../views/championship_view_test.exs | 15 ++-- .../views/commish_email_view_test.exs | 3 +- test/ex338_web/views/draft_pick_view_test.exs | 3 +- test/ex338_web/views/email_view_test.exs | 2 +- .../views/fantasy_team_view_test.exs | 5 +- .../views/in_season_draft_pick_view_test.exs | 5 +- test/ex338_web/views/layout_view_test.exs | 2 +- test/ex338_web/views/trade_view_test.exs | 5 +- test/ex338_web/views/user_view_test.exs | 3 +- test/ex338_web/views/view_helpers_test.exs | 23 +++--- test/ex338_web/views/waiver_view_test.exs | 6 +- test/support/channel_case.ex | 3 +- test/support/conn_case.ex | 11 ++- test/support/data_case.ex | 7 +- test/support/factory.ex | 4 +- 194 files changed, 832 insertions(+), 751 deletions(-) diff --git a/.formatter.exs b/.formatter.exs index ef8840ce..4635dd5f 100644 --- a/.formatter.exs +++ b/.formatter.exs @@ -1,6 +1,7 @@ [ import_deps: [:ecto, :ecto_sql, :phoenix], subdirectories: ["priv/*/migrations"], - plugins: [Phoenix.LiveView.HTMLFormatter], - inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}", "priv/*/seeds.exs"] + plugins: [Phoenix.LiveView.HTMLFormatter, Styler], + inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}", "priv/*/seeds.exs"], + line_length: 98 ] diff --git a/.iex.exs b/.iex.exs index 31ed8dc6..bdf5ff15 100644 --- a/.iex.exs +++ b/.iex.exs @@ -1,38 +1,36 @@ -alias Ex338.{ - Accounts.User, - CalendarAssistant, - Championships, - Championships.Championship, - Championships.ChampionshipResult, - Championships.ChampWithEventsResult, - Championships.ChampionshipSlot, - DraftPicks, - DraftPicks.Admin, - DraftPicks.DraftPick, - DraftQueues, - DraftQueues.DraftQueue, - FantasyLeagues, - FantasyLeagues.FantasyLeague, - FantasyPlayers, - FantasyPlayers.FantasyPlayer, - FantasyPlayers.SportsLeague, - FantasyTeams, - FantasyTeams.FantasyTeam, - FantasyTeams.Owner, - InSeasonDraftPicks, - InjuredReserves, - Mailer, - NotificationEmail, - Repo, - RosterPositions, - RosterPositions.Admin, - RosterPositions.RosterPosition, - Trades, - Trades.Trade, - Trades.TradeLineItem, - Waivers, - Waivers.Admin, - Waivers.Waiver -} - import Ecto.Query + +alias Ex338.Accounts.User +alias Ex338.CalendarAssistant +alias Ex338.Championships +alias Ex338.Championships.Championship +alias Ex338.Championships.ChampionshipResult +alias Ex338.Championships.ChampionshipSlot +alias Ex338.Championships.ChampWithEventsResult +alias Ex338.DraftPicks +alias Ex338.DraftPicks.Admin +alias Ex338.DraftPicks.DraftPick +alias Ex338.DraftQueues +alias Ex338.DraftQueues.DraftQueue +alias Ex338.FantasyLeagues +alias Ex338.FantasyLeagues.FantasyLeague +alias Ex338.FantasyPlayers +alias Ex338.FantasyPlayers.FantasyPlayer +alias Ex338.FantasyPlayers.SportsLeague +alias Ex338.FantasyTeams +alias Ex338.FantasyTeams.FantasyTeam +alias Ex338.FantasyTeams.Owner +alias Ex338.InjuredReserves +alias Ex338.InSeasonDraftPicks +alias Ex338.Mailer +alias Ex338.NotificationEmail +alias Ex338.Repo +alias Ex338.RosterPositions +alias Ex338.RosterPositions.Admin +alias Ex338.RosterPositions.RosterPosition +alias Ex338.Trades +alias Ex338.Trades.Trade +alias Ex338.Trades.TradeLineItem +alias Ex338.Waivers +alias Ex338.Waivers.Admin +alias Ex338.Waivers.Waiver diff --git a/lib/ex338/abilities.ex b/lib/ex338/abilities.ex index c0eab496..9a9f97aa 100644 --- a/lib/ex338/abilities.ex +++ b/lib/ex338/abilities.ex @@ -1,31 +1,25 @@ defimpl Canada.Can, for: Ex338.Accounts.User do - alias Ex338.{ - Accounts.User, - DraftPicks.DraftPick, - FantasyTeams.FantasyTeam, - Waivers.Waiver, - InSeasonDraftPicks.InSeasonDraftPick - } + alias Ex338.Accounts.User + alias Ex338.DraftPicks.DraftPick + alias Ex338.FantasyTeams.FantasyTeam + alias Ex338.InSeasonDraftPicks.InSeasonDraftPick + alias Ex338.Waivers.Waiver def can?(%User{admin: true}, _, _), do: true - def can?(%User{id: user_id}, action, %User{id: user_id}) - when action in [:edit, :update] do + def can?(%User{id: user_id}, action, %User{id: user_id}) when action in [:edit, :update] do true end - def can?(%User{}, action, %User{}) - when action in [:edit, :update] do + def can?(%User{}, action, %User{}) when action in [:edit, :update] do false end - def can?(%User{}, action, nil) - when action in [:edit, :update] do + def can?(%User{}, action, nil) when action in [:edit, :update] do false end - def can?(%User{id: user_id}, action, model) - when action in [:edit, :update, :create, :new] do + def can?(%User{id: user_id}, action, model) when action in [:edit, :update, :create, :new] do owner?(user_id, model) end diff --git a/lib/ex338/accounts.ex b/lib/ex338/accounts.ex index 2ec505a9..c78f16c5 100644 --- a/lib/ex338/accounts.ex +++ b/lib/ex338/accounts.ex @@ -1,9 +1,12 @@ defmodule Ex338.Accounts do @moduledoc false - alias Ex338.{FantasyTeams.FantasyTeam, Accounts.User, FantasyTeams, Repo} + alias Ex338.Accounts.User + alias Ex338.FantasyTeams + alias Ex338.FantasyTeams.FantasyTeam + alias Ex338.Repo - def get_admin_emails() do + def get_admin_emails do Repo.all(User.admin_emails()) end diff --git a/lib/ex338/accounts/user.ex b/lib/ex338/accounts/user.ex index 947ed503..915228f5 100644 --- a/lib/ex338/accounts/user.ex +++ b/lib/ex338/accounts/user.ex @@ -1,8 +1,6 @@ defmodule Ex338.Accounts.User do @moduledoc false use Ecto.Schema - import Ecto.Changeset - import Ecto.Query, warn: false use Pow.Ecto.Schema, password_min_length: 6, @@ -11,6 +9,9 @@ defmodule Ex338.Accounts.User do use Pow.Extension.Ecto.Schema, extensions: [PowResetPassword, PowPersistentSession, PowInvitation] + import Ecto.Changeset + import Ecto.Query, warn: false + alias Ex338.Accounts.User schema "users" do diff --git a/lib/ex338/autodraft.ex b/lib/ex338/autodraft.ex index 403a1182..11eafb4a 100644 --- a/lib/ex338/autodraft.ex +++ b/lib/ex338/autodraft.ex @@ -1,16 +1,14 @@ defmodule Ex338.AutoDraft do @moduledoc false - alias Ex338.{ - DraftPicks, - DraftPicks.DraftPick, - DraftQueues, - FantasyTeams, - InSeasonDraftPicks, - InSeasonDraftPicks.InSeasonDraftPick - } - - alias Ex338Web.{DraftEmail, InSeasonDraftEmail} + alias Ex338.DraftPicks + alias Ex338.DraftPicks.DraftPick + alias Ex338.DraftQueues + alias Ex338.FantasyTeams + alias Ex338.InSeasonDraftPicks + alias Ex338.InSeasonDraftPicks.InSeasonDraftPick + alias Ex338Web.DraftEmail + alias Ex338Web.InSeasonDraftEmail @next_pick 1 @@ -91,11 +89,9 @@ defmodule Ex338.AutoDraft do defp draft_status?(fantasy_league_id, championship) do with true <- draft_started?(championship), - available_picks <- InSeasonDraftPicks.available_picks(fantasy_league_id, championship), + available_picks = InSeasonDraftPicks.available_picks(fantasy_league_id, championship), true <- any_available_picks?(available_picks) do {:in_progress, available_picks} - else - other_status -> other_status end end @@ -109,9 +105,10 @@ defmodule Ex338.AutoDraft do end defp any_available_picks?(available_picks) do - case Enum.any?(available_picks, &(&1.available_to_pick? == true)) do - false -> :in_season_draft_picks_complete - true -> true + if Enum.any?(available_picks, &(&1.available_to_pick? == true)) do + true + else + :in_season_draft_picks_complete end end @@ -154,11 +151,7 @@ defmodule Ex338.AutoDraft do end end - defp make_picks_with_skips( - fantasy_league_id, - previous_picks, - sleep_before_pick - ) do + defp make_picks_with_skips(fantasy_league_id, previous_picks, sleep_before_pick) do available_picks = DraftPicks.get_picks_available_with_skips(fantasy_league_id) do_make_picks_with_skips( @@ -173,12 +166,7 @@ defmodule Ex338.AutoDraft do make_picks_from_queues(:no_pick, picks, sleep_before_pick) end - defp do_make_picks_with_skips( - fantasy_league_id, - available_picks, - picks, - sleep_before_pick - ) do + defp do_make_picks_with_skips(fantasy_league_id, available_picks, picks, sleep_before_pick) do new_picks = Enum.reduce(available_picks, picks, fn next_pick, picks -> with %{fantasy_player_id: queued_player_id, fantasy_team: fantasy_team} <- diff --git a/lib/ex338/championships.ex b/lib/ex338/championships.ex index 7362398e..73249c4a 100644 --- a/lib/ex338/championships.ex +++ b/lib/ex338/championships.ex @@ -1,14 +1,12 @@ defmodule Ex338.Championships do @moduledoc false - alias Ex338.{ - Championships.Championship, - Championships.CreateSlot, - FantasyTeams, - Jobs, - Repo, - InSeasonDraftPicks - } + alias Ex338.Championships.Championship + alias Ex338.Championships.CreateSlot + alias Ex338.FantasyTeams + alias Ex338.InSeasonDraftPicks + alias Ex338.Jobs + alias Ex338.Repo def all_for_league(fantasy_league_id) do Championship @@ -45,7 +43,7 @@ defmodule Ex338.Championships do |> Championship.preload_assocs_by_league(fantasy_league_id) |> Repo.get!(id) |> Championship.add_deadline_statuses() - |> update_next_in_season_pick + |> update_next_in_season_pick() |> preload_events_by_league(fantasy_league_id) |> get_slot_standings(fantasy_league_id) end @@ -70,7 +68,7 @@ defmodule Ex338.Championships do Championship |> Championship.sum_slot_points(championship.id, league_id) |> Repo.all() - |> rank_slots + |> rank_slots() Map.put(championship, :slot_standings, slots) end @@ -113,22 +111,22 @@ defmodule Ex338.Championships do end defp owned_after_championship?(%{active_at: active_at}, championship_at) do - DateTime.compare(active_at, championship_at) == :gt + DateTime.after?(active_at, championship_at) end defp released_before_championship?(%{released_at: nil}, _championship_at), do: false defp released_before_championship?(%{released_at: released_at}, championship_at) do - DateTime.compare(championship_at, released_at) == :gt + DateTime.after?(championship_at, released_at) end ## get_slot_standings defp rank_slots(slots) do slots - |> remove_nonscoring_slots - |> sort_by_points - |> add_rank_to_slots + |> remove_nonscoring_slots() + |> sort_by_points() + |> add_rank_to_slots() end defp remove_nonscoring_slots(slots) do diff --git a/lib/ex338/championships/champ_with_events_result.ex b/lib/ex338/championships/champ_with_events_result.ex index c2100a8e..01a0c482 100644 --- a/lib/ex338/championships/champ_with_events_result.ex +++ b/lib/ex338/championships/champ_with_events_result.ex @@ -2,6 +2,7 @@ defmodule Ex338.Championships.ChampWithEventsResult do @moduledoc false use Ecto.Schema + import Ecto.Changeset import Ecto.Query, warn: false @@ -52,6 +53,6 @@ defmodule Ex338.Championships.ChampWithEventsResult do def preload_ordered_assocs_by_league(query, league_id) do query |> preload_assocs_by_league(league_id) - |> order_by_rank + |> order_by_rank() end end diff --git a/lib/ex338/championships/championship.ex b/lib/ex338/championships/championship.ex index 39833a94..52f764e5 100644 --- a/lib/ex338/championships/championship.ex +++ b/lib/ex338/championships/championship.ex @@ -1,15 +1,14 @@ defmodule Ex338.Championships.Championship do @moduledoc false use Ecto.Schema + import Ecto.Changeset import Ecto.Query, warn: false - alias Ex338.{ - Championships.ChampionshipResult, - Championships.ChampionshipSlot, - Championships.ChampWithEventsResult, - InSeasonDraftPicks.InSeasonDraftPick - } + alias Ex338.Championships.ChampionshipResult + alias Ex338.Championships.ChampionshipSlot + alias Ex338.Championships.ChampWithEventsResult + alias Ex338.InSeasonDraftPicks.InSeasonDraftPick @categories ["overall", "event"] @@ -85,7 +84,7 @@ defmodule Ex338.Championships.Championship do def all_with_overall_waivers_open(query, fantasy_league_id) do query - |> all_with_overall_waivers_open + |> all_with_overall_waivers_open() |> all_for_league(fantasy_league_id) end @@ -130,7 +129,7 @@ defmodule Ex338.Championships.Championship do def future_championships(query, fantasy_league_id) do query |> all_for_league(fantasy_league_id) - |> future_championships + |> future_championships() end def future_championships(query) do diff --git a/lib/ex338/championships/championship_result.ex b/lib/ex338/championships/championship_result.ex index 7b4b75d8..955d117c 100644 --- a/lib/ex338/championships/championship_result.ex +++ b/lib/ex338/championships/championship_result.ex @@ -2,14 +2,13 @@ defmodule Ex338.Championships.ChampionshipResult do @moduledoc false use Ecto.Schema + import Ecto.Changeset import Ecto.Query, warn: false - alias Ex338.{ - FantasyPlayers.FantasyPlayer, - RosterPositions.RosterPosition, - FantasyTeams.FantasyTeam - } + alias Ex338.FantasyPlayers.FantasyPlayer + alias Ex338.FantasyTeams.FantasyTeam + alias Ex338.RosterPositions.RosterPosition schema "championship_results" do belongs_to(:championship, Ex338.Championships.Championship) @@ -61,13 +60,13 @@ defmodule Ex338.Championships.ChampionshipResult do def overall_from_range(query, start_datetime, end_datetime) do query - |> only_overall + |> only_overall() |> from_range(start_datetime, end_datetime) end def overall_before_date_in_year(query, datetime) do query - |> only_overall + |> only_overall() |> before_date_in_year(datetime) end @@ -92,6 +91,6 @@ defmodule Ex338.Championships.ChampionshipResult do def preload_ordered_assocs_by_league(query, league_id) do query |> preload_assocs_by_league(league_id) - |> order_by_points_rank + |> order_by_points_rank() end end diff --git a/lib/ex338/championships/championship_slot.ex b/lib/ex338/championships/championship_slot.ex index 2c991a8e..44fd430d 100644 --- a/lib/ex338/championships/championship_slot.ex +++ b/lib/ex338/championships/championship_slot.ex @@ -2,6 +2,7 @@ defmodule Ex338.Championships.ChampionshipSlot do @moduledoc false use Ecto.Schema + import Ecto.Changeset import Ecto.Query, warn: false diff --git a/lib/ex338/championships/create_slot.ex b/lib/ex338/championships/create_slot.ex index c4e47bc0..8d9e51a2 100644 --- a/lib/ex338/championships/create_slot.ex +++ b/lib/ex338/championships/create_slot.ex @@ -2,12 +2,14 @@ defmodule Ex338.Championships.CreateSlot do @moduledoc false alias Ecto.Multi - alias Ex338.{RosterPositions.Admin, Championships.ChampionshipSlot, Repo} + alias Ex338.Championships.ChampionshipSlot + alias Ex338.Repo + alias Ex338.RosterPositions.Admin def create_slots_from_positions(teams, championship_id) do teams |> Enum.map(&calculate_slots_for_team(&1)) - |> retrieve_positions_to_array + |> retrieve_positions_to_array() |> insert_slots(championship_id) |> Repo.transaction() end @@ -15,7 +17,7 @@ defmodule Ex338.Championships.CreateSlot do def calculate_slots_for_team(team) do team |> Admin.order_by_position() - |> add_slot_to_position + |> add_slot_to_position() end defp add_slot_to_position(team) do diff --git a/lib/ex338/draft_picks.ex b/lib/ex338/draft_picks.ex index cf89011d..2f18de33 100644 --- a/lib/ex338/draft_picks.ex +++ b/lib/ex338/draft_picks.ex @@ -5,12 +5,13 @@ defmodule Ex338.DraftPicks do import Ecto.Query, warn: false - alias Ex338.{DraftPicks, DraftPicks.DraftPick, Repo} + alias Ex338.DraftPicks + alias Ex338.DraftPicks.DraftPick + alias Ex338.DraftPicks.FuturePick + alias Ex338.Repo # future_pick - alias Ex338.DraftPicks.FuturePick - def change_future_pick(%FuturePick{} = future_pick, attrs \\ %{}) do FuturePick.changeset(future_pick, attrs) end diff --git a/lib/ex338/draft_picks/admin.ex b/lib/ex338/draft_picks/admin.ex index 95d05900..79a3d30e 100644 --- a/lib/ex338/draft_picks/admin.ex +++ b/lib/ex338/draft_picks/admin.ex @@ -2,12 +2,9 @@ defmodule Ex338.DraftPicks.Admin do @moduledoc false alias Ecto.Multi - - alias Ex338.{ - DraftQueues, - DraftPicks.DraftPick, - RosterPositions.RosterPosition - } + alias Ex338.DraftPicks.DraftPick + alias Ex338.DraftQueues + alias Ex338.RosterPositions.RosterPosition def draft_player(draft_pick, params) do Multi.new() diff --git a/lib/ex338/draft_picks/clock.ex b/lib/ex338/draft_picks/clock.ex index 10d11286..7d4e7edf 100644 --- a/lib/ex338/draft_picks/clock.ex +++ b/lib/ex338/draft_picks/clock.ex @@ -1,11 +1,12 @@ defmodule Ex338.DraftPicks.Clock do - alias Ex338.{DraftPicks.DraftPick} + @moduledoc false + alias Ex338.DraftPicks.DraftPick def calculate_team_data(draft_picks) do draft_picks - |> group_picks_by_team - |> calculate_data_for_teams - |> sort_by_avg_time_on_the_clock + |> group_picks_by_team() + |> calculate_data_for_teams() + |> sort_by_avg_time_on_the_clock() end def update_seconds_on_the_clock(draft_picks) do diff --git a/lib/ex338/draft_picks/draft_pick.ex b/lib/ex338/draft_picks/draft_pick.ex index c6d02f32..f71d87a1 100644 --- a/lib/ex338/draft_picks/draft_pick.ex +++ b/lib/ex338/draft_picks/draft_pick.ex @@ -2,10 +2,14 @@ defmodule Ex338.DraftPicks.DraftPick do @moduledoc false use Ecto.Schema + import Ecto.Changeset import Ecto.Query, warn: false - alias Ex338.{DraftPicks, FantasyPlayers, FantasyTeams, ValidateHelpers} + alias Ex338.DraftPicks + alias Ex338.FantasyPlayers + alias Ex338.FantasyTeams + alias Ex338.ValidateHelpers schema "draft_picks" do field(:draft_position, :float) @@ -84,8 +88,8 @@ defmodule Ex338.DraftPicks.DraftPick do def last_picks(query, league_id, picks) do query |> by_league(league_id) - |> preload_assocs - |> reverse_ordered_by_position + |> preload_assocs() + |> reverse_ordered_by_position() |> where([d], not is_nil(d.fantasy_player_id)) |> limit(^picks) end @@ -93,8 +97,8 @@ defmodule Ex338.DraftPicks.DraftPick do def next_picks(query, league_id, picks) do query |> by_league(league_id) - |> preload_assocs - |> ordered_by_position + |> preload_assocs() + |> ordered_by_position() |> where([d], is_nil(d.fantasy_player_id)) |> limit(^picks) end @@ -223,7 +227,7 @@ defmodule Ex338.DraftPicks.DraftPick do defp validate_pick_is_up(draft_pick_changeset) do with fantasy_league_id when not is_nil(fantasy_league_id) <- get_field(draft_pick_changeset, :fantasy_league_id), - next_pick_id <- get_next_pick_id(fantasy_league_id), + next_pick_id = get_next_pick_id(fantasy_league_id), :error <- is_next_pick?(draft_pick_changeset.data.id, next_pick_id), %{draft_picks: draft_picks} <- DraftPicks.get_picks_for_league(fantasy_league_id), false <- available_with_skipped_picks?(draft_pick_changeset.data.id, draft_picks) do @@ -254,16 +258,14 @@ defmodule Ex338.DraftPicks.DraftPick do end defp do_max_flex_slots(draft_pick_changeset, future_positions, max_flex_spots) do - case ValidateHelpers.slot_available?(future_positions, max_flex_spots) do - true -> - draft_pick_changeset - - false -> - add_error( - draft_pick_changeset, - :fantasy_player_id, - "No flex position available for this player" - ) + if ValidateHelpers.slot_available?(future_positions, max_flex_spots) do + draft_pick_changeset + else + add_error( + draft_pick_changeset, + :fantasy_player_id, + "No flex position available for this player" + ) end end @@ -294,9 +296,10 @@ defmodule Ex338.DraftPicks.DraftPick do teams_needing_players = FantasyTeams.without_player_from_sport(league_id, sport_id) - case drafting_team_needs_player?(teams_needing_players, team.id) do - false -> {:ok, teams_needing_players} - true -> {:error, :team_needs_player} + if drafting_team_needs_player?(teams_needing_players, team.id) do + {:error, :team_needs_player} + else + {:ok, teams_needing_players} end end @@ -314,9 +317,10 @@ defmodule Ex338.DraftPicks.DraftPick do player_count = count_avail_players(drafted_player, league_id, sport_id) teams_with_need_count = Enum.count(teams_needing_players) - case teams_with_need_count >= player_count do - true -> {:ok, :add_error_to_changeset} - false -> {:error, :enough_players_available} + if teams_with_need_count >= player_count do + {:ok, :add_error_to_changeset} + else + {:error, :enough_players_available} end end diff --git a/lib/ex338/draft_picks/future_pick.ex b/lib/ex338/draft_picks/future_pick.ex index 5148b6ad..6018ed90 100644 --- a/lib/ex338/draft_picks/future_pick.ex +++ b/lib/ex338/draft_picks/future_pick.ex @@ -1,5 +1,7 @@ defmodule Ex338.DraftPicks.FuturePick do + @moduledoc false use Ecto.Schema + import Ecto.Changeset import Ecto.Query, warn: false diff --git a/lib/ex338/draft_queues.ex b/lib/ex338/draft_queues.ex index b79f7036..df98f354 100644 --- a/lib/ex338/draft_queues.ex +++ b/lib/ex338/draft_queues.ex @@ -3,7 +3,10 @@ defmodule Ex338.DraftQueues do import Ecto.Query, only: [limit: 2] - alias Ex338.{Repo, DraftQueues, DraftQueues.DraftQueue, FantasyTeams} + alias Ex338.DraftQueues + alias Ex338.DraftQueues.DraftQueue + alias Ex338.FantasyTeams + alias Ex338.Repo def archive_pending_queues(fantasy_league_id) do DraftQueue diff --git a/lib/ex338/draft_queues/admin.ex b/lib/ex338/draft_queues/admin.ex index 2e19ade3..361ad032 100644 --- a/lib/ex338/draft_queues/admin.ex +++ b/lib/ex338/draft_queues/admin.ex @@ -1,8 +1,10 @@ defmodule Ex338.DraftQueues.Admin do @moduledoc false - alias Ex338.{DraftPicks.DraftPick, DraftQueues.DraftQueue, InSeasonDraftPicks.InSeasonDraftPick} alias Ecto.Multi + alias Ex338.DraftPicks.DraftPick + alias Ex338.DraftQueues.DraftQueue + alias Ex338.InSeasonDraftPicks.InSeasonDraftPick def reorder_for_league(league_queues) do league_queues diff --git a/lib/ex338/draft_queues/draft_queue.ex b/lib/ex338/draft_queues/draft_queue.ex index 472afc2e..38b991b6 100644 --- a/lib/ex338/draft_queues/draft_queue.ex +++ b/lib/ex338/draft_queues/draft_queue.ex @@ -1,10 +1,13 @@ defmodule Ex338.DraftQueues.DraftQueue do @moduledoc false use Ecto.Schema + import Ecto.Changeset import Ecto.Query, warn: false - import Ecto.Changeset - alias Ex338.{DraftQueues.DraftQueue, DraftPicks.DraftPick, FantasyTeams} + + alias Ex338.DraftPicks.DraftPick + alias Ex338.DraftQueues.DraftQueue + alias Ex338.FantasyTeams @owner_status_options ["pending", "cancelled"] @@ -57,7 +60,7 @@ defmodule Ex338.DraftQueues.DraftQueue do defp maybe_validate_max_flex_spots(changeset) do with team_id when not is_nil(team_id) <- fetch_field!(changeset, :fantasy_team_id), - team <- FantasyTeams.find(team_id), + team = FantasyTeams.find(team_id), nil <- team.fantasy_league.sport_draft_id do DraftPick.validate_max_flex_spots(changeset) else @@ -83,7 +86,7 @@ defmodule Ex338.DraftQueues.DraftQueue do from(q in query, preload: [:fantasy_team, :fantasy_player]) end - def status_options() do + def status_options do Enum.filter(DraftQueueStatusEnum.__valid_values__(), &is_binary(&1)) end diff --git a/lib/ex338/fantasy_leagues.ex b/lib/ex338/fantasy_leagues.ex index 3754022d..01fac802 100644 --- a/lib/ex338/fantasy_leagues.ex +++ b/lib/ex338/fantasy_leagues.ex @@ -1,14 +1,12 @@ defmodule Ex338.FantasyLeagues do @moduledoc false - alias Ex338.{ - DraftPicks, - FantasyLeagues.FantasyLeague, - FantasyLeagues.HistoricalRecord, - FantasyLeagues.HistoricalWinning, - FantasyTeams, - Repo - } + alias Ex338.DraftPicks + alias Ex338.FantasyLeagues.FantasyLeague + alias Ex338.FantasyLeagues.HistoricalRecord + alias Ex338.FantasyLeagues.HistoricalWinning + alias Ex338.FantasyTeams + alias Ex338.Repo def change_fantasy_league(%FantasyLeague{} = fantasy_league, attrs \\ %{}) do FantasyLeague.changeset(fantasy_league, attrs) @@ -30,13 +28,13 @@ defmodule Ex338.FantasyLeagues do Enum.map(list_leagues_by_status(status), &load_team_standings_data/1) end - def list_all_winnings() do + def list_all_winnings do HistoricalWinning |> HistoricalWinning.order_by_amount() |> Repo.all() end - def list_current_all_time_records() do + def list_current_all_time_records do HistoricalRecord |> HistoricalRecord.all_time_records() |> HistoricalRecord.current_records() @@ -44,7 +42,7 @@ defmodule Ex338.FantasyLeagues do |> Repo.all() end - def list_current_season_records() do + def list_current_season_records do HistoricalRecord |> HistoricalRecord.season_records() |> HistoricalRecord.current_records() @@ -61,7 +59,7 @@ defmodule Ex338.FantasyLeagues do |> Repo.all() end - def list_fantasy_leagues() do + def list_fantasy_leagues do FantasyLeague |> FantasyLeague.sort_most_recent() |> FantasyLeague.sort_by_draft_method() @@ -74,12 +72,12 @@ defmodule Ex338.FantasyLeagues do %{league | fantasy_teams: teams} end - def options_for_navbar_display() do - FantasyLeagueNavbarDisplayEnum.__valid_values__() |> Enum.filter(&is_atom(&1)) + def options_for_navbar_display do + Enum.filter(FantasyLeagueNavbarDisplayEnum.__valid_values__(), &is_atom(&1)) end - def options_for_draft_method() do - FantasyLeagueDraftMethodEnum.__valid_values__() |> Enum.filter(&is_atom(&1)) + def options_for_draft_method do + Enum.filter(FantasyLeagueDraftMethodEnum.__valid_values__(), &is_atom(&1)) end def update_fantasy_league(%FantasyLeague{} = fantasy_league, attrs) do diff --git a/lib/ex338/fantasy_leagues/fantasy_league.ex b/lib/ex338/fantasy_leagues/fantasy_league.ex index 072d5e7d..6c9a7733 100644 --- a/lib/ex338/fantasy_leagues/fantasy_league.ex +++ b/lib/ex338/fantasy_leagues/fantasy_league.ex @@ -2,6 +2,7 @@ defmodule Ex338.FantasyLeagues.FantasyLeague do @moduledoc false use Ecto.Schema + import Ecto.Changeset import Ecto.Query, warn: false diff --git a/lib/ex338/fantasy_leagues/fantasy_league_admin.ex b/lib/ex338/fantasy_leagues/fantasy_league_admin.ex index f5e5b29c..8c2b6635 100644 --- a/lib/ex338/fantasy_leagues/fantasy_league_admin.ex +++ b/lib/ex338/fantasy_leagues/fantasy_league_admin.ex @@ -1,4 +1,5 @@ defmodule Ex338.FantasyLeagues.FantasyLeagueAdmin do + @moduledoc false def form_fields(_) do [ fantasy_league_name: nil, @@ -19,11 +20,11 @@ defmodule Ex338.FantasyLeagues.FantasyLeagueAdmin do ] end - defp navbar_display_options() do + defp navbar_display_options do Enum.filter(FantasyLeagueNavbarDisplayEnum.__valid_values__(), &is_binary/1) end - defp draft_method_options() do + defp draft_method_options do Enum.filter(FantasyLeagueDraftMethodEnum.__valid_values__(), &is_binary/1) end end diff --git a/lib/ex338/fantasy_leagues/historical_record.ex b/lib/ex338/fantasy_leagues/historical_record.ex index 2eaad438..c24ca754 100644 --- a/lib/ex338/fantasy_leagues/historical_record.ex +++ b/lib/ex338/fantasy_leagues/historical_record.ex @@ -2,6 +2,7 @@ defmodule Ex338.FantasyLeagues.HistoricalRecord do @moduledoc false use Ecto.Schema + import Ecto.Changeset import Ecto.Query, warn: false diff --git a/lib/ex338/fantasy_leagues/historical_winning.ex b/lib/ex338/fantasy_leagues/historical_winning.ex index 2049cf93..7dc339f4 100644 --- a/lib/ex338/fantasy_leagues/historical_winning.ex +++ b/lib/ex338/fantasy_leagues/historical_winning.ex @@ -2,6 +2,7 @@ defmodule Ex338.FantasyLeagues.HistoricalWinning do @moduledoc false use Ecto.Schema + import Ecto.Changeset import Ecto.Query, warn: false diff --git a/lib/ex338/fantasy_leagues/league_sport.ex b/lib/ex338/fantasy_leagues/league_sport.ex index 0d7fac66..9d131645 100644 --- a/lib/ex338/fantasy_leagues/league_sport.ex +++ b/lib/ex338/fantasy_leagues/league_sport.ex @@ -1,6 +1,7 @@ defmodule Ex338.FantasyLeagues.LeagueSport do @moduledoc false use Ecto.Schema + import Ecto.Changeset import Ecto.Query, warn: false diff --git a/lib/ex338/fantasy_players.ex b/lib/ex338/fantasy_players.ex index e8ca8ad2..4f54d5bc 100644 --- a/lib/ex338/fantasy_players.ex +++ b/lib/ex338/fantasy_players.ex @@ -3,12 +3,10 @@ defmodule Ex338.FantasyPlayers do import Ecto.Query, warn: false - alias Ex338.{ - Championships.Championship, - FantasyPlayers.FantasyPlayer, - FantasyPlayers.SportsLeague, - Repo - } + alias Ex338.Championships.Championship + alias Ex338.FantasyPlayers.FantasyPlayer + alias Ex338.FantasyPlayers.SportsLeague + alias Ex338.Repo def all_players_for_league(league) do FantasyPlayer @@ -71,7 +69,7 @@ defmodule Ex338.FantasyPlayers do Repo.one(query) end - def list_sport_options() do + def list_sport_options do SportsLeague |> SportsLeague.abbrev_a_to_z() |> Repo.all() @@ -86,7 +84,7 @@ defmodule Ex338.FantasyPlayers do |> Repo.all() end - def list_sports_abbrevs() do + def list_sports_abbrevs do SportsLeague |> SportsLeague.abbrev_a_to_z() |> SportsLeague.select_abbrev() diff --git a/lib/ex338/fantasy_players/fantasy_player.ex b/lib/ex338/fantasy_players/fantasy_player.ex index b6281a18..df13c2df 100644 --- a/lib/ex338/fantasy_players/fantasy_player.ex +++ b/lib/ex338/fantasy_players/fantasy_player.ex @@ -2,15 +2,14 @@ defmodule Ex338.FantasyPlayers.FantasyPlayer do @moduledoc false use Ecto.Schema + import Ecto.Changeset import Ecto.Query, warn: false - alias Ex338.{ - Championships.Championship, - Championships.ChampionshipResult, - FantasyPlayers.SportsLeague, - RosterPositions.RosterPosition - } + alias Ex338.Championships.Championship + alias Ex338.Championships.ChampionshipResult + alias Ex338.FantasyPlayers.SportsLeague + alias Ex338.RosterPositions.RosterPosition schema "fantasy_players" do field(:player_name, :string) diff --git a/lib/ex338/fantasy_players/sports_league.ex b/lib/ex338/fantasy_players/sports_league.ex index 81ad57c6..470dec37 100644 --- a/lib/ex338/fantasy_players/sports_league.ex +++ b/lib/ex338/fantasy_players/sports_league.ex @@ -2,6 +2,7 @@ defmodule Ex338.FantasyPlayers.SportsLeague do @moduledoc false use Ecto.Schema + import Ecto.Changeset import Ecto.Query, warn: false diff --git a/lib/ex338/fantasy_teams.ex b/lib/ex338/fantasy_teams.ex index 61a88373..5fafa0ab 100644 --- a/lib/ex338/fantasy_teams.ex +++ b/lib/ex338/fantasy_teams.ex @@ -1,15 +1,13 @@ defmodule Ex338.FantasyTeams do @moduledoc false - alias Ex338.{ - FantasyTeams.FantasyTeam, - FantasyTeams.Owner, - FantasyTeams.Deadlines, - FantasyTeams.Standings, - FantasyTeams.StandingsHistory, - Repo, - RosterPositions - } + alias Ex338.FantasyTeams.Deadlines + alias Ex338.FantasyTeams.FantasyTeam + alias Ex338.FantasyTeams.Owner + alias Ex338.FantasyTeams.Standings + alias Ex338.FantasyTeams.StandingsHistory + alias Ex338.Repo + alias Ex338.RosterPositions def count_pending_draft_queues(team_id) do FantasyTeam @@ -30,7 +28,7 @@ defmodule Ex338.FantasyTeams do |> RosterPositions.OpenPosition.add_open_positions_to_teams(league_positions) |> Standings.rank_points_winnings_for_teams() |> FantasyTeam.sort_alphabetical() - |> load_slot_results + |> load_slot_results() end def find_all_for_standings(league) do @@ -79,7 +77,7 @@ defmodule Ex338.FantasyTeams do |> RosterPositions.OpenPosition.add_open_positions_to_team(league_positions) |> Standings.update_points_winnings() |> FantasyTeam.sort_queues_by_order() - |> load_slot_results + |> load_slot_results() end def find_for_edit(id) do @@ -149,14 +147,14 @@ defmodule Ex338.FantasyTeams do def load_slot_results([%FantasyTeam{fantasy_league_id: league_id} | _] = teams) do league_id - |> get_slot_results_for_league + |> get_slot_results_for_league() |> FantasyTeam.add_rankings_to_slot_results() |> FantasyTeam.add_slot_results(teams) end def load_slot_results(%FantasyTeam{fantasy_league_id: league_id} = team) do league_id - |> get_slot_results_for_league + |> get_slot_results_for_league() |> FantasyTeam.add_rankings_to_slot_results() |> FantasyTeam.add_slot_results(team) end diff --git a/lib/ex338/fantasy_teams/fantasy_team.ex b/lib/ex338/fantasy_teams/fantasy_team.ex index f17f4d0f..8b9bacf8 100644 --- a/lib/ex338/fantasy_teams/fantasy_team.ex +++ b/lib/ex338/fantasy_teams/fantasy_team.ex @@ -2,18 +2,17 @@ defmodule Ex338.FantasyTeams.FantasyTeam do @moduledoc false use Ecto.Schema + import Ecto.Changeset import Ecto.Query, warn: false - alias Ex338.{ - Championships.ChampionshipResult, - Championships.ChampWithEventsResult, - DraftQueues.DraftQueue, - FantasyLeagues.FantasyLeague, - FantasyPlayers.SportsLeague, - FantasyTeams.FantasyTeam, - RosterPositions.RosterPosition - } + alias Ex338.Championships.ChampionshipResult + alias Ex338.Championships.ChampWithEventsResult + alias Ex338.DraftQueues.DraftQueue + alias Ex338.FantasyLeagues.FantasyLeague + alias Ex338.FantasyPlayers.SportsLeague + alias Ex338.FantasyTeams.FantasyTeam + alias Ex338.RosterPositions.RosterPosition schema "fantasy_teams" do field(:team_name, :string) @@ -69,7 +68,7 @@ defmodule Ex338.FantasyTeams.FantasyTeam do Enum.reduce(slot_results, team, &do_add_slot_results(&2, &1)) end - def autodraft_setting_options() do + def autodraft_setting_options do [ [key: "On", value: "on"], [key: "Off", value: "off"], @@ -182,11 +181,7 @@ defmodule Ex338.FantasyTeams.FantasyTeam do do_preload_assocs_by_league(query, league_id, champ_results, champ_with_events) end - def preload_assocs_by_league_and_date( - query, - %FantasyLeague{id: league_id}, - datetime - ) do + def preload_assocs_by_league_and_date(query, %FantasyLeague{id: league_id}, datetime) do champ_results = ChampionshipResult.overall_before_date_in_year(ChampionshipResult, datetime) champ_with_events = ChampWithEventsResult.before_date_in_year(ChampWithEventsResult, datetime) @@ -314,8 +309,8 @@ defmodule Ex338.FantasyTeams.FantasyTeam do defp calculate_rankings({_sport_abbrev, slot_results}) do slot_results - |> sort_slots_by_points - |> add_rank_to_slots + |> sort_slots_by_points() + |> add_rank_to_slots() end defp sort_slots_by_points(slot_results) do @@ -338,10 +333,7 @@ defmodule Ex338.FantasyTeams.FantasyTeam do ## add_slot_results - defp do_add_slot_results( - %FantasyTeam{id: id} = team, - %{fantasy_team_id: id} = new_slot_result - ) do + defp do_add_slot_results(%FantasyTeam{id: id} = team, %{fantasy_team_id: id} = new_slot_result) do new_slot_results = team.slot_results ++ [new_slot_result] %{team | slot_results: new_slot_results} end diff --git a/lib/ex338/fantasy_teams/owner.ex b/lib/ex338/fantasy_teams/owner.ex index 5c8acc7e..329036e2 100644 --- a/lib/ex338/fantasy_teams/owner.ex +++ b/lib/ex338/fantasy_teams/owner.ex @@ -1,5 +1,7 @@ defmodule Ex338.FantasyTeams.Owner do + @moduledoc false use Ecto.Schema + import Ecto.Changeset import Ecto.Query, warn: false diff --git a/lib/ex338/fantasy_teams/standings.ex b/lib/ex338/fantasy_teams/standings.ex index a63b311a..90e7612a 100644 --- a/lib/ex338/fantasy_teams/standings.ex +++ b/lib/ex338/fantasy_teams/standings.ex @@ -6,8 +6,8 @@ defmodule Ex338.FantasyTeams.Standings do def rank_points_winnings_for_teams(teams) do teams |> Enum.map(&update_points_winnings(&1)) - |> sort_by_points - |> add_rank + |> sort_by_points() + |> add_rank() end def update_points_winnings(fantasy_team) do diff --git a/lib/ex338/in_season_draft_picks.ex b/lib/ex338/in_season_draft_picks.ex index 613591da..2ec6436f 100644 --- a/lib/ex338/in_season_draft_picks.ex +++ b/lib/ex338/in_season_draft_picks.ex @@ -3,14 +3,12 @@ defmodule Ex338.InSeasonDraftPicks do import Ecto.Query, only: [limit: 2] - alias Ex338.{ - Championships, - InSeasonDraftPicks, - InSeasonDraftPicks.InSeasonDraftPick, - FantasyPlayers, - Repo, - RosterPositions - } + alias Ex338.Championships + alias Ex338.FantasyPlayers + alias Ex338.InSeasonDraftPicks + alias Ex338.InSeasonDraftPicks.InSeasonDraftPick + alias Ex338.Repo + alias Ex338.RosterPositions @topic "in_season_draft_pick" diff --git a/lib/ex338/in_season_draft_picks/admin.ex b/lib/ex338/in_season_draft_picks/admin.ex index 6b916294..7e301b39 100644 --- a/lib/ex338/in_season_draft_picks/admin.ex +++ b/lib/ex338/in_season_draft_picks/admin.ex @@ -1,13 +1,10 @@ defmodule Ex338.InSeasonDraftPicks.Admin do @moduledoc false - alias Ex338.{ - InSeasonDraftPicks.InSeasonDraftPick, - RosterPositions.RosterPosition, - DraftQueues - } - alias Ecto.Multi + alias Ex338.DraftQueues + alias Ex338.InSeasonDraftPicks.InSeasonDraftPick + alias Ex338.RosterPositions.RosterPosition def generate_picks(roster_positions, championship_id) do Enum.reduce(roster_positions, Multi.new(), fn position, multi -> diff --git a/lib/ex338/in_season_draft_picks/clock.ex b/lib/ex338/in_season_draft_picks/clock.ex index 6f698d5d..caffdb03 100644 --- a/lib/ex338/in_season_draft_picks/clock.ex +++ b/lib/ex338/in_season_draft_picks/clock.ex @@ -1,4 +1,5 @@ defmodule Ex338.InSeasonDraftPicks.Clock do + @moduledoc false def update_in_season_draft_picks(in_season_draft_picks, %{draft_starts_at: nil}) do in_season_draft_picks end diff --git a/lib/ex338/in_season_draft_picks/in_season_draft_pick.ex b/lib/ex338/in_season_draft_picks/in_season_draft_pick.ex index 5fa411cb..275e1899 100644 --- a/lib/ex338/in_season_draft_picks/in_season_draft_pick.ex +++ b/lib/ex338/in_season_draft_picks/in_season_draft_pick.ex @@ -1,6 +1,7 @@ defmodule Ex338.InSeasonDraftPicks.InSeasonDraftPick do @moduledoc false use Ecto.Schema + import Ecto.Changeset import Ecto.Query, warn: false diff --git a/lib/ex338/injured_reserves.ex b/lib/ex338/injured_reserves.ex index e92072ac..97e35f01 100644 --- a/lib/ex338/injured_reserves.ex +++ b/lib/ex338/injured_reserves.ex @@ -5,9 +5,12 @@ defmodule Ex338.InjuredReserves do import Ecto, only: [build_assoc: 2] - alias Ex338.{InjuredReserves.InjuredReserve, Repo, RosterPositions, InjuredReserves.Admin} + alias Ex338.InjuredReserves.Admin + alias Ex338.InjuredReserves.InjuredReserve + alias Ex338.Repo + alias Ex338.RosterPositions - def change_injured_reserve(injured_reserve = %InjuredReserve{}, attrs \\ %{}) do + def change_injured_reserve(%InjuredReserve{} = injured_reserve, attrs \\ %{}) do InjuredReserve.changeset(injured_reserve, attrs) end @@ -34,7 +37,8 @@ defmodule Ex338.InjuredReserves do def list_injured_reserves(criteria \\ []) when is_list(criteria) do query = InjuredReserve.preload_assocs(InjuredReserve) - Enum.reduce(criteria, query, fn + criteria + |> Enum.reduce(query, fn {:fantasy_league_id, fantasy_league_id}, query -> InjuredReserve.by_league(query, fantasy_league_id) diff --git a/lib/ex338/injured_reserves/admin.ex b/lib/ex338/injured_reserves/admin.ex index 369e6c58..14d9ae0d 100644 --- a/lib/ex338/injured_reserves/admin.ex +++ b/lib/ex338/injured_reserves/admin.ex @@ -4,7 +4,8 @@ defmodule Ex338.InjuredReserves.Admin do """ alias Ecto.Multi - alias Ex338.{InjuredReserves.InjuredReserve, RosterPositions.RosterPosition} + alias Ex338.InjuredReserves.InjuredReserve + alias Ex338.RosterPositions.RosterPosition def approve_injured_reserve(injured_reserve, position) do Multi.new() diff --git a/lib/ex338/injured_reserves/injured_reserve.ex b/lib/ex338/injured_reserves/injured_reserve.ex index 838559e1..5f4d8471 100644 --- a/lib/ex338/injured_reserves/injured_reserve.ex +++ b/lib/ex338/injured_reserves/injured_reserve.ex @@ -2,6 +2,7 @@ defmodule Ex338.InjuredReserves.InjuredReserve do @moduledoc false use Ecto.Schema + import Ecto.Changeset import Ecto.Query, warn: false diff --git a/lib/ex338/jobs.ex b/lib/ex338/jobs.ex index a7ef0945..4b1461cb 100644 --- a/lib/ex338/jobs.ex +++ b/lib/ex338/jobs.ex @@ -1,4 +1,5 @@ defmodule Ex338.Jobs do + @moduledoc false import Ecto.Query, warn: false alias Ex338.Repo diff --git a/lib/ex338/roster_positions.ex b/lib/ex338/roster_positions.ex index 25fae067..db09db1a 100644 --- a/lib/ex338/roster_positions.ex +++ b/lib/ex338/roster_positions.ex @@ -1,24 +1,22 @@ defmodule Ex338.RosterPositions do @moduledoc false - alias Ex338.{ - FantasyLeagues.FantasyLeague, - RosterPositions.RosterPosition, - Repo, - FantasyPlayers - } + alias Ex338.FantasyLeagues.FantasyLeague + alias Ex338.FantasyPlayers + alias Ex338.Repo + alias Ex338.RosterPositions.RosterPosition def get_by(clauses) do Repo.get_by(RosterPosition, clauses) end - def list_all() do + def list_all do RosterPosition |> RosterPosition.order_by_id() |> Repo.all() end - def list_all_active() do + def list_all_active do RosterPosition |> RosterPosition.all_active() |> RosterPosition.order_by_id() diff --git a/lib/ex338/roster_positions/admin.ex b/lib/ex338/roster_positions/admin.ex index b448a2e3..4d7034cd 100644 --- a/lib/ex338/roster_positions/admin.ex +++ b/lib/ex338/roster_positions/admin.ex @@ -31,13 +31,13 @@ defmodule Ex338.RosterPositions.Admin do def order_by_position(%{roster_positions: positions} = fantasy_teams) do positions - |> sort_by_position - |> sort_primary_positions_first + |> sort_by_position() + |> sort_primary_positions_first() |> update_fantasy_team(fantasy_teams) end defp sort_by_position(positions) do - positions |> Enum.sort(&(&1.position <= &2.position)) + Enum.sort(positions, &(&1.position <= &2.position)) end defp sort_primary_positions_first(positions) do diff --git a/lib/ex338/roster_positions/open_position.ex b/lib/ex338/roster_positions/open_position.ex index e4b4ec67..8a42afae 100644 --- a/lib/ex338/roster_positions/open_position.ex +++ b/lib/ex338/roster_positions/open_position.ex @@ -1,16 +1,13 @@ defmodule Ex338.RosterPositions.OpenPosition do @moduledoc false - alias Ex338.{RosterPositions.Admin} + alias Ex338.RosterPositions.Admin def add_open_positions_to_teams(fantasy_teams, league_positions) do Enum.map(fantasy_teams, &add_open_positions_to_team(&1, league_positions)) end - def add_open_positions_to_team( - %{roster_positions: positions} = fantasy_team, - league_positions - ) do + def add_open_positions_to_team(%{roster_positions: positions} = fantasy_team, league_positions) do {unassigned, positions} = separate_unassigned(positions) positions @@ -25,9 +22,9 @@ defmodule Ex338.RosterPositions.OpenPosition do defp add_open_positions(roster_positions, league_positions) do roster_positions - |> format_positions_for_merge + |> format_positions_for_merge() |> merge_open_positions(league_positions) - |> return_position_key_into_map + |> return_position_key_into_map() end defp format_positions_for_merge(roster_positions) do diff --git a/lib/ex338/roster_positions/roster_position.ex b/lib/ex338/roster_positions/roster_position.ex index 643878cf..b70cb76b 100644 --- a/lib/ex338/roster_positions/roster_position.ex +++ b/lib/ex338/roster_positions/roster_position.ex @@ -2,6 +2,7 @@ defmodule Ex338.RosterPositions.RosterPosition do @moduledoc false use Ecto.Schema + import Ecto.Changeset import Ecto.Query, warn: false diff --git a/lib/ex338/trades.ex b/lib/ex338/trades.ex index d9466fac..aa27235a 100644 --- a/lib/ex338/trades.ex +++ b/lib/ex338/trades.ex @@ -1,14 +1,12 @@ defmodule Ex338.Trades do @moduledoc false - alias Ex338.{ - Repo, - RosterPositions, - Trades.Admin, - Trades.Trade, - Trades.TradeLineItem, - Trades.TradeVote - } + alias Ex338.Repo + alias Ex338.RosterPositions + alias Ex338.Trades.Admin + alias Ex338.Trades.Trade + alias Ex338.Trades.TradeLineItem + alias Ex338.Trades.TradeVote def all_for_league(league_id) do Trade @@ -19,7 +17,7 @@ defmodule Ex338.Trades do |> Trade.count_votes() end - def build_new_changeset() do + def build_new_changeset do Trade.new_changeset(trade_with_line_items()) end @@ -52,7 +50,8 @@ defmodule Ex338.Trades do |> Trade.preload_assocs() |> Trade.newest_first() - Enum.reduce(criteria, query, fn + criteria + |> Enum.reduce(query, fn {:fantasy_league_id, fantasy_league_id}, query -> Trade.by_league(query, fantasy_league_id) @@ -121,7 +120,7 @@ defmodule Ex338.Trades do # build_new_changeset - defp trade_with_line_items() do + defp trade_with_line_items do %Trade{ trade_line_items: [ %TradeLineItem{}, @@ -154,18 +153,13 @@ defmodule Ex338.Trades do line_items = line_items |> Enum.filter(&filter_line_items/1) - |> Enum.into(%{}) + |> Map.new() Map.put(trade, "trade_line_items", line_items) end def filter_line_items( - {_, - %{ - "fantasy_player_id" => nil, - "gaining_team_id" => nil, - "losing_team_id" => nil - }} + {_, %{"fantasy_player_id" => nil, "gaining_team_id" => nil, "losing_team_id" => nil}} ) do false end @@ -181,14 +175,12 @@ defmodule Ex338.Trades do end defp update_if_rejected(trade, votes) do - case any_reject_votes?(votes) do - true -> - trade - |> Ecto.Changeset.change(status: "Rejected") - |> Repo.update!() - - false -> - trade + if any_reject_votes?(votes) do + trade + |> Ecto.Changeset.change(status: "Rejected") + |> Repo.update!() + else + trade end end @@ -200,14 +192,12 @@ defmodule Ex338.Trades do num_votes = Enum.count(votes) num_teams = Enum.count(teams) - case(num_votes == num_teams) do - true -> - trade - |> Ecto.Changeset.change(status: "Pending") - |> Repo.update!() - - false -> - trade + if num_votes == num_teams do + trade + |> Ecto.Changeset.change(status: "Pending") + |> Repo.update!() + else + trade end end @@ -216,9 +206,10 @@ defmodule Ex338.Trades do defp get_pos_from_trade(%{trade_line_items: line_items}) do positions = Enum.reduce(line_items, [], &query_pos_id/2) - case Enum.any?(positions, &(&1 == nil)) do - true -> :error - false -> positions + if Enum.any?(positions, &(&1 == nil)) do + :error + else + positions end end diff --git a/lib/ex338/trades/admin.ex b/lib/ex338/trades/admin.ex index 193b94b4..67be801b 100644 --- a/lib/ex338/trades/admin.ex +++ b/lib/ex338/trades/admin.ex @@ -4,7 +4,9 @@ defmodule Ex338.Trades.Admin do """ alias Ecto.Multi - alias Ex338.{DraftPicks, Trades.Trade, RosterPositions.RosterPosition} + alias Ex338.DraftPicks + alias Ex338.RosterPositions.RosterPosition + alias Ex338.Trades.Trade def process_approved_trade(trade, params, losing_positions) do Multi.new() diff --git a/lib/ex338/trades/trade.ex b/lib/ex338/trades/trade.ex index af0a8bf2..6f6ca2c3 100644 --- a/lib/ex338/trades/trade.ex +++ b/lib/ex338/trades/trade.ex @@ -2,10 +2,13 @@ defmodule Ex338.Trades.Trade do @moduledoc false use Ecto.Schema + import Ecto.Changeset import Ecto.Query, warn: false - alias Ex338.{Trades.Trade, Trades.TradeLineItem, Trades.TradeVote} + alias Ex338.Trades.Trade + alias Ex338.Trades.TradeLineItem + alias Ex338.Trades.TradeVote @status_options ~w(Proposed Pending Approved Disapproved Rejected Canceled) @@ -78,7 +81,8 @@ defmodule Ex338.Trades.Trade do end def get_teams_from_trade(trade) do - Enum.reduce(trade.trade_line_items, [], fn item, acc -> + trade.trade_line_items + |> Enum.reduce([], fn item, acc -> teams = [item.gaining_team, item.losing_team] teams ++ acc diff --git a/lib/ex338/trades/trade_line_item.ex b/lib/ex338/trades/trade_line_item.ex index f81cee87..f27ac42e 100644 --- a/lib/ex338/trades/trade_line_item.ex +++ b/lib/ex338/trades/trade_line_item.ex @@ -2,10 +2,14 @@ defmodule Ex338.Trades.TradeLineItem do @moduledoc false use Ecto.Schema + import Ecto.Changeset import Ecto.Query, warn: false - alias Ex338.{RosterPositions, FantasyTeams, DraftPicks, FantasyPlayers} + alias Ex338.DraftPicks + alias Ex338.FantasyPlayers + alias Ex338.FantasyTeams + alias Ex338.RosterPositions schema "trade_line_items" do belongs_to(:trade, Ex338.Trades.Trade) @@ -66,12 +70,7 @@ defmodule Ex338.Trades.TradeLineItem do ## assoc_changeset defp validate_player_on_roster( - %{ - changes: %{ - losing_team_id: team_id, - fantasy_player_id: player_id - } - } = changeset + %{changes: %{losing_team_id: team_id, fantasy_player_id: player_id}} = changeset ) when not is_nil(player_id) do result = @@ -149,12 +148,7 @@ defmodule Ex338.Trades.TradeLineItem do end defp validate_future_pick_owner( - %{ - changes: %{ - losing_team_id: team_id, - future_pick_id: pick_id - } - } = changeset + %{changes: %{losing_team_id: team_id, future_pick_id: pick_id}} = changeset ) when not is_nil(pick_id) do result = diff --git a/lib/ex338/trades/trade_vote.ex b/lib/ex338/trades/trade_vote.ex index 2549f8c5..15aff877 100644 --- a/lib/ex338/trades/trade_vote.ex +++ b/lib/ex338/trades/trade_vote.ex @@ -1,7 +1,9 @@ defmodule Ex338.Trades.TradeVote do @moduledoc false use Ecto.Schema + import Ecto.Changeset + alias Ex338.Trades.TradeVote schema "trade_votes" do diff --git a/lib/ex338/uploader.ex b/lib/ex338/uploader.ex index 973a5a23..c9a92e62 100644 --- a/lib/ex338/uploader.ex +++ b/lib/ex338/uploader.ex @@ -1,8 +1,8 @@ defmodule Ex338.Uploader do @moduledoc false - alias Ecto.{Multi} - alias Ex338.{Repo} + alias Ecto.Multi + alias Ex338.Repo @table_options [ "Championships.Championship", diff --git a/lib/ex338/validate_helpers.ex b/lib/ex338/validate_helpers.ex index 8bbf916b..b8dba572 100644 --- a/lib/ex338/validate_helpers.ex +++ b/lib/ex338/validate_helpers.ex @@ -5,7 +5,7 @@ defmodule Ex338.ValidateHelpers do total_slot_count = count_total_slots(roster_positions) roster_positions - |> count_regular_slots + |> count_regular_slots() |> calculate_flex_slots_used(total_slot_count) |> compare_flex_slots(max_flex_spots) end diff --git a/lib/ex338/waivers.ex b/lib/ex338/waivers.ex index 7ac950e8..4f7acbe7 100644 --- a/lib/ex338/waivers.ex +++ b/lib/ex338/waivers.ex @@ -4,7 +4,10 @@ defmodule Ex338.Waivers do import Ecto import Ecto.Query, warn: false - alias Ex338.{Waivers.Waiver, Waivers, Waiver.Batch, Repo} + alias Ex338.Repo + alias Ex338.Waiver.Batch + alias Ex338.Waivers + alias Ex338.Waivers.Waiver def create_waiver(fantasy_team, waiver_params) do result = @@ -38,7 +41,7 @@ defmodule Ex338.Waivers do |> Repo.all() end - def get_all_pending_waivers() do + def get_all_pending_waivers do Waiver |> Waiver.preload_assocs() |> Waiver.pending() @@ -46,7 +49,7 @@ defmodule Ex338.Waivers do |> Repo.all() end - def batch_process_all() do + def batch_process_all do case get_all_pending_waivers() do [] -> :ok @@ -55,7 +58,7 @@ defmodule Ex338.Waivers do waivers |> Batch.group_and_sort() |> List.first() - |> process_batch + |> process_batch() batch_process_all() end @@ -93,19 +96,19 @@ defmodule Ex338.Waivers do defp process_successful(waiver) do waiver |> process_waiver(%{"status" => "successful"}) - |> handle_multi_update + |> handle_multi_update() end defp process_unsuccessful(waiver) do waiver |> process_waiver(%{"status" => "unsuccessful"}) - |> handle_multi_update + |> handle_multi_update() end defp process_invalid(waiver) do waiver |> process_waiver(%{"status" => "invalid"}) - |> handle_multi_update + |> handle_multi_update() end defp handle_multi_update({:ok, %{waiver: waiver}}) do diff --git a/lib/ex338/waivers/admin.ex b/lib/ex338/waivers/admin.ex index a8c4dc1b..20053dfc 100644 --- a/lib/ex338/waivers/admin.ex +++ b/lib/ex338/waivers/admin.ex @@ -2,14 +2,11 @@ defmodule Ex338.Waivers.Admin do @moduledoc false alias Ecto.Multi - - alias Ex338.{ - Waivers.Waiver, - RosterPositions.RosterPosition, - FantasyTeams.FantasyTeam, - Repo, - FantasyLeagues.FantasyLeague - } + alias Ex338.FantasyLeagues.FantasyLeague + alias Ex338.FantasyTeams.FantasyTeam + alias Ex338.Repo + alias Ex338.RosterPositions.RosterPosition + alias Ex338.Waivers.Waiver def process_waiver(waiver, %{"status" => "successful"} = params) do Multi.new() @@ -21,13 +18,11 @@ defmodule Ex338.Waivers.Admin do end def process_waiver(waiver, params) do - Multi.new() - |> update_waiver_status(waiver, params) + update_waiver_status(Multi.new(), waiver, params) end def update_waiver_status(multi, waiver, params) do - multi - |> Multi.update(:waiver, Waiver.changeset(waiver, params)) + Multi.update(multi, :waiver, Waiver.changeset(waiver, params)) end def insert_new_position(multi, %Waiver{add_fantasy_player_id: nil}) do @@ -87,8 +82,7 @@ defmodule Ex338.Waivers.Admin do team_count = league_teams_count(fantasy_team) changeset = Ecto.Changeset.change(fantasy_team, waiver_position: team_count) - multi - |> Multi.update(:team_waiver_update, changeset) + Multi.update(multi, :team_waiver_update, changeset) end defp league_teams_count(%FantasyTeam{fantasy_league_id: league_id}) do diff --git a/lib/ex338/waivers/batch_process.ex b/lib/ex338/waivers/batch_process.ex index 70b8ca33..abb61503 100644 --- a/lib/ex338/waivers/batch_process.ex +++ b/lib/ex338/waivers/batch_process.ex @@ -1,27 +1,25 @@ defmodule Ex338.Waiver.Batch do @moduledoc false - alias Ex338.{} - def group_and_sort(waivers) do waivers - |> group_by_league + |> group_by_league() |> Enum.map(&group_by_add_player/1) - |> flatten_league_waivers - |> sort_by_process_at + |> flatten_league_waivers() + |> sort_by_process_at() |> Enum.map(&sort_by_waiver_position/1) end def group_by_league(waivers) do waivers |> Enum.group_by(& &1.fantasy_team.fantasy_league_id) - |> convert_group_to_list + |> convert_group_to_list() end def group_by_add_player(waivers) do waivers |> Enum.group_by(& &1.add_fantasy_player_id) - |> convert_group_to_list + |> convert_group_to_list() end def sort_by_waiver_position(waivers) do diff --git a/lib/ex338/waivers/validate.ex b/lib/ex338/waivers/validate.ex index 7eef2e91..f0f7c84d 100644 --- a/lib/ex338/waivers/validate.ex +++ b/lib/ex338/waivers/validate.ex @@ -2,16 +2,15 @@ defmodule Ex338.Waivers.Validate do @moduledoc false use Ecto.Schema + import Ecto.Changeset import Ecto.Query, warn: false - alias Ex338.{ - FantasyPlayers, - FantasyTeams, - Repo, - RosterPositions.RosterPosition, - ValidateHelpers - } + alias Ex338.FantasyPlayers + alias Ex338.FantasyTeams + alias Ex338.Repo + alias Ex338.RosterPositions.RosterPosition + alias Ex338.ValidateHelpers def add_or_drop(waiver_changeset) do add_player = fetch_change(waiver_changeset, :add_fantasy_player_id) @@ -123,9 +122,8 @@ defmodule Ex338.Waivers.Validate do ## before_waiver_deadline - defp do_before_waiver_deadline(waiver_changeset, player_id, _key) - when is_nil(player_id), - do: waiver_changeset + defp do_before_waiver_deadline(waiver_changeset, player_id, _key) when is_nil(player_id), + do: waiver_changeset defp do_before_waiver_deadline(waiver_changeset, player_id, key) do team_id = get_field(waiver_changeset, :fantasy_team_id) @@ -201,16 +199,14 @@ defmodule Ex338.Waivers.Validate do end defp do_max_flex_slots(waiver_changeset, future_positions, max_flex_spots) do - case ValidateHelpers.slot_available?(future_positions, max_flex_spots) do - true -> - waiver_changeset - - false -> - add_error( - waiver_changeset, - :add_fantasy_player_id, - "No flex position available for this player" - ) + if ValidateHelpers.slot_available?(future_positions, max_flex_spots) do + waiver_changeset + else + add_error( + waiver_changeset, + :add_fantasy_player_id, + "No flex position available for this player" + ) end end diff --git a/lib/ex338/waivers/waiver.ex b/lib/ex338/waivers/waiver.ex index 89a36788..32a74175 100644 --- a/lib/ex338/waivers/waiver.ex +++ b/lib/ex338/waivers/waiver.ex @@ -2,18 +2,17 @@ defmodule Ex338.Waivers.Waiver do @moduledoc false use Ecto.Schema + import Ecto import Ecto.Changeset import Ecto.Query, warn: false - alias Ex338.{ - CalendarAssistant, - FantasyPlayers, - FantasyTeams, - Repo, - Waivers.Waiver, - Waivers.Validate - } + alias Ex338.CalendarAssistant + alias Ex338.FantasyPlayers + alias Ex338.FantasyTeams + alias Ex338.Repo + alias Ex338.Waivers.Validate + alias Ex338.Waivers.Waiver @status_options ["pending", "successful", "unsuccessful", "invalid", "cancelled"] @@ -32,7 +31,7 @@ defmodule Ex338.Waivers.Waiver do def build_new_changeset(fantasy_team) do fantasy_team |> build_assoc(:waivers) - |> new_changeset + |> new_changeset() end def by_league(query, league_id) do @@ -76,7 +75,7 @@ defmodule Ex338.Waivers.Waiver do |> validate_required([:fantasy_team_id]) |> Validate.add_or_drop() |> Validate.before_waiver_deadline() - |> set_datetime_to_process + |> set_datetime_to_process() |> Validate.wait_period_open() |> Validate.open_position() |> foreign_key_constraint(:fantasy_team_id) @@ -91,7 +90,7 @@ defmodule Ex338.Waivers.Waiver do def pending_waivers_for_player(query, add_player_id, league_id) do query |> by_league(league_id) - |> pending + |> pending() |> where([w], w.add_fantasy_player_id == ^add_player_id) |> limit(1) end diff --git a/lib/ex338/workers/in_season_autodraft_worker.ex b/lib/ex338/workers/in_season_autodraft_worker.ex index 5fc37fbd..c778ebb4 100644 --- a/lib/ex338/workers/in_season_autodraft_worker.ex +++ b/lib/ex338/workers/in_season_autodraft_worker.ex @@ -1,8 +1,10 @@ defmodule Ex338.Workers.InSeasonAutodraftWorker do + @moduledoc false use Oban.Worker, max_attempts: 1 - alias Ex338.{AutoDraft, Championships} + alias Ex338.AutoDraft + alias Ex338.Championships @thirty_seconds 30 diff --git a/lib/ex338_web.ex b/lib/ex338_web.ex index d8b07bc8..7f29f41f 100644 --- a/lib/ex338_web.ex +++ b/lib/ex338_web.ex @@ -20,15 +20,14 @@ defmodule Ex338Web do quote do use Phoenix.Controller, namespace: Ex338Web - alias Ex338.Repo import Ecto import Ecto.Query - - import Plug.Conn import Ex338Web.Gettext - alias Ex338Web.Router.Helpers, as: Routes - import Phoenix.LiveView.Controller + import Plug.Conn + + alias Ex338.Repo + alias Ex338Web.Router.Helpers, as: Routes end end @@ -67,11 +66,10 @@ defmodule Ex338Web do quote do use Phoenix.Router - import Plug.Conn + import Ex338Web.Authorization, only: [authorize_admin: 2] import Phoenix.Controller import Phoenix.LiveView.Router - - import Ex338Web.Authorization, only: [authorize_admin: 2] + import Plug.Conn end end @@ -79,10 +77,11 @@ defmodule Ex338Web do quote do use Phoenix.Channel - alias Ex338.Repo import Ecto import Ecto.Query import Ex338Web.Gettext + + alias Ex338.Repo end end @@ -92,18 +91,17 @@ defmodule Ex338Web do use Phoenix.HTML # Import LiveView helpers (live_render, live_component, live_patch, etc) - import Phoenix.Component - import Ex338Web.LiveHelpers - - import Ex338Web.ViewHelpers - import Ex338Web.SharedComponents # Import basic rendering functionality (render, render_layout, etc) - import Phoenix.View - import Ex338Web.ErrorHelpers - import Ex338Web.InputHelpers import Ex338Web.Gettext + import Ex338Web.InputHelpers + import Ex338Web.LiveHelpers + import Ex338Web.SharedComponents + import Ex338Web.ViewHelpers + import Phoenix.Component + import Phoenix.View + alias Ex338Web.Router.Helpers, as: Routes end end diff --git a/lib/ex338_web/controllers/archived_league_controller.ex b/lib/ex338_web/controllers/archived_league_controller.ex index 5e4ff8f2..49020893 100644 --- a/lib/ex338_web/controllers/archived_league_controller.ex +++ b/lib/ex338_web/controllers/archived_league_controller.ex @@ -1,7 +1,7 @@ defmodule Ex338Web.ArchivedLeagueController do use Ex338Web, :controller - alias Ex338.{FantasyLeagues} + alias Ex338.FantasyLeagues def index(conn, _params) do leagues = FantasyLeagues.get_leagues_by_status("archived") diff --git a/lib/ex338_web/controllers/authorization.ex b/lib/ex338_web/controllers/authorization.ex index 30a9e74f..cf214769 100644 --- a/lib/ex338_web/controllers/authorization.ex +++ b/lib/ex338_web/controllers/authorization.ex @@ -1,13 +1,14 @@ defmodule Ex338Web.Authorization do @moduledoc false - import Plug.Conn import Phoenix.Controller + import Plug.Conn + alias Ex338.Accounts.User def authorize_admin(conn, _opts) do user = conn.assigns.current_user - conn |> check_authorized(user) + check_authorized(conn, user) end defp check_authorized(conn, %User{admin: true}) do @@ -18,13 +19,13 @@ defmodule Ex338Web.Authorization do conn |> put_flash(:error, "You are not authorized") |> redirect(to: "/") - |> halt + |> halt() end def handle_unauthorized(conn) do conn |> put_flash(:error, "You can't access that page!") |> redirect(to: "/") - |> halt + |> halt() end end diff --git a/lib/ex338_web/controllers/championship_controller.ex b/lib/ex338_web/controllers/championship_controller.ex index 38e9c76d..cfe2c424 100644 --- a/lib/ex338_web/controllers/championship_controller.ex +++ b/lib/ex338_web/controllers/championship_controller.ex @@ -1,6 +1,8 @@ defmodule Ex338Web.ChampionshipController do use Ex338Web, :controller - alias Ex338.{Championships, FantasyLeagues} + + alias Ex338.Championships + alias Ex338.FantasyLeagues def index(conn, %{"fantasy_league_id" => league_id}) do render( diff --git a/lib/ex338_web/controllers/championship_slot_admin_controller.ex b/lib/ex338_web/controllers/championship_slot_admin_controller.ex index 9ddf705f..37e9aaaf 100644 --- a/lib/ex338_web/controllers/championship_slot_admin_controller.ex +++ b/lib/ex338_web/controllers/championship_slot_admin_controller.ex @@ -1,7 +1,7 @@ defmodule Ex338Web.ChampionshipSlotAdminController do use Ex338Web, :controller - alias Ex338.{Championships} + alias Ex338.Championships def create(conn, %{"fantasy_league_id" => league_id, "championship_id" => id}) do case Championships.create_slots_for_league(id, league_id) do diff --git a/lib/ex338_web/controllers/commish_email_controller.ex b/lib/ex338_web/controllers/commish_email_controller.ex index daa055a8..636730a9 100644 --- a/lib/ex338_web/controllers/commish_email_controller.ex +++ b/lib/ex338_web/controllers/commish_email_controller.ex @@ -1,7 +1,9 @@ defmodule Ex338Web.CommishEmailController do use Ex338Web, :controller - alias Ex338.{Repo, FantasyLeagues.FantasyLeague} - alias Ex338Web.{CommishEmail} + + alias Ex338.FantasyLeagues.FantasyLeague + alias Ex338.Repo + alias Ex338Web.CommishEmail def new(conn, _params) do render(conn, "new.html", @@ -11,11 +13,7 @@ defmodule Ex338Web.CommishEmailController do end def create(conn, %{ - "commish_email" => %{ - "leagues" => leagues, - "subject" => subject, - "message" => message - } + "commish_email" => %{"leagues" => leagues, "subject" => subject, "message" => message} }) do result = CommishEmail.send_email_to_leagues(leagues, subject, message) diff --git a/lib/ex338_web/controllers/draft_pick_controller.ex b/lib/ex338_web/controllers/draft_pick_controller.ex index 46efeb77..2c09a2ac 100644 --- a/lib/ex338_web/controllers/draft_pick_controller.ex +++ b/lib/ex338_web/controllers/draft_pick_controller.ex @@ -3,15 +3,13 @@ defmodule Ex338Web.DraftPickController do import Canary.Plugs - alias Ex338.{ - AutoDraft, - DraftPicks, - DraftQueues, - FantasyLeagues, - FantasyPlayers - } - - alias Ex338Web.{Authorization, DraftEmail} + alias Ex338.AutoDraft + alias Ex338.DraftPicks + alias Ex338.DraftQueues + alias Ex338.FantasyLeagues + alias Ex338.FantasyPlayers + alias Ex338Web.Authorization + alias Ex338Web.DraftEmail @autodraft_delay 1000 * 10 diff --git a/lib/ex338_web/controllers/draft_queue_controller.ex b/lib/ex338_web/controllers/draft_queue_controller.ex index 498e9a91..eb2027b6 100644 --- a/lib/ex338_web/controllers/draft_queue_controller.ex +++ b/lib/ex338_web/controllers/draft_queue_controller.ex @@ -1,11 +1,14 @@ defmodule Ex338Web.DraftQueueController do use Ex338Web, :controller - alias Ex338.{FantasyTeams.FantasyTeam, FantasyPlayers, DraftQueues, DraftQueues.DraftQueue} - alias Ex338Web.{Authorization} - import Canary.Plugs + alias Ex338.DraftQueues + alias Ex338.DraftQueues.DraftQueue + alias Ex338.FantasyPlayers + alias Ex338.FantasyTeams.FantasyTeam + alias Ex338Web.Authorization + plug( :load_and_authorize_resource, model: FantasyTeam, diff --git a/lib/ex338_web/controllers/fantasy_league_controller.ex b/lib/ex338_web/controllers/fantasy_league_controller.ex index f2b34470..95b2021d 100644 --- a/lib/ex338_web/controllers/fantasy_league_controller.ex +++ b/lib/ex338_web/controllers/fantasy_league_controller.ex @@ -1,7 +1,8 @@ defmodule Ex338Web.FantasyLeagueController do use Ex338Web, :controller - alias Ex338.{FantasyTeams, FantasyLeagues} + alias Ex338.FantasyLeagues + alias Ex338.FantasyTeams def show(conn, %{"id" => id}) do league = FantasyLeagues.get(id) diff --git a/lib/ex338_web/controllers/fantasy_player_controller.ex b/lib/ex338_web/controllers/fantasy_player_controller.ex index 65826d6c..272d9592 100644 --- a/lib/ex338_web/controllers/fantasy_player_controller.ex +++ b/lib/ex338_web/controllers/fantasy_player_controller.ex @@ -1,7 +1,8 @@ defmodule Ex338Web.FantasyPlayerController do use Ex338Web, :controller - alias Ex338.{FantasyLeagues, FantasyPlayers} + alias Ex338.FantasyLeagues + alias Ex338.FantasyPlayers def index(conn, %{"fantasy_league_id" => league_id}) do fantasy_league = FantasyLeagues.get(league_id) diff --git a/lib/ex338_web/controllers/fantasy_team_controller.ex b/lib/ex338_web/controllers/fantasy_team_controller.ex index a51b22c3..6edb56f4 100644 --- a/lib/ex338_web/controllers/fantasy_team_controller.ex +++ b/lib/ex338_web/controllers/fantasy_team_controller.ex @@ -1,11 +1,13 @@ defmodule Ex338Web.FantasyTeamController do use Ex338Web, :controller - alias Ex338.{FantasyTeams, FantasyTeams.FantasyTeam, FantasyLeagues} - alias Ex338Web.{Authorization} - import Canary.Plugs + alias Ex338.FantasyLeagues + alias Ex338.FantasyTeams + alias Ex338.FantasyTeams.FantasyTeam + alias Ex338Web.Authorization + plug( :load_and_authorize_resource, model: FantasyTeam, diff --git a/lib/ex338_web/controllers/in_season_draft_order_controller.ex b/lib/ex338_web/controllers/in_season_draft_order_controller.ex index b7091d9e..3224922b 100644 --- a/lib/ex338_web/controllers/in_season_draft_order_controller.ex +++ b/lib/ex338_web/controllers/in_season_draft_order_controller.ex @@ -1,7 +1,7 @@ defmodule Ex338Web.InSeasonDraftOrderController do use Ex338Web, :controller - alias Ex338.{InSeasonDraftPicks} + alias Ex338.InSeasonDraftPicks def create(conn, %{"fantasy_league_id" => league_id, "championship_id" => champ_id}) do case InSeasonDraftPicks.create_picks_for_league(league_id, champ_id) do diff --git a/lib/ex338_web/controllers/in_season_draft_pick_controller.ex b/lib/ex338_web/controllers/in_season_draft_pick_controller.ex index b45fa2ee..bfb36530 100644 --- a/lib/ex338_web/controllers/in_season_draft_pick_controller.ex +++ b/lib/ex338_web/controllers/in_season_draft_pick_controller.ex @@ -1,11 +1,13 @@ defmodule Ex338Web.InSeasonDraftPickController do use Ex338Web, :controller - alias Ex338.{DraftQueues, InSeasonDraftPicks} - alias Ex338Web.{Authorization, InSeasonDraftEmail} - import Canary.Plugs + alias Ex338.DraftQueues + alias Ex338.InSeasonDraftPicks + alias Ex338Web.Authorization + alias Ex338Web.InSeasonDraftEmail + plug( :load_and_authorize_resource, model: InSeasonDraftPicks.InSeasonDraftPick, diff --git a/lib/ex338_web/controllers/injured_reserve_controller.ex b/lib/ex338_web/controllers/injured_reserve_controller.ex index 946612ca..7ac4a1be 100644 --- a/lib/ex338_web/controllers/injured_reserve_controller.ex +++ b/lib/ex338_web/controllers/injured_reserve_controller.ex @@ -1,10 +1,15 @@ defmodule Ex338Web.InjuredReserveController do use Ex338Web, :controller - require Logger + import Canary.Plugs - alias Ex338.{FantasyLeagues, FantasyTeams, FantasyPlayers, InjuredReserves} - alias Ex338Web.{Authorization} + alias Ex338.FantasyLeagues + alias Ex338.FantasyPlayers + alias Ex338.FantasyTeams + alias Ex338.InjuredReserves + alias Ex338Web.Authorization + + require Logger plug( :load_and_authorize_resource, @@ -61,11 +66,7 @@ defmodule Ex338Web.InjuredReserveController do end end - def update(conn, %{ - "fantasy_league_id" => league_id, - "id" => id, - "injured_reserve" => params - }) do + def update(conn, %{"fantasy_league_id" => league_id, "id" => id, "injured_reserve" => params}) do injured_reserve = InjuredReserves.get_ir!(id) case InjuredReserves.update_injured_reserve(injured_reserve, params) do diff --git a/lib/ex338_web/controllers/owner_controller.ex b/lib/ex338_web/controllers/owner_controller.ex index 483c2711..1d775126 100644 --- a/lib/ex338_web/controllers/owner_controller.ex +++ b/lib/ex338_web/controllers/owner_controller.ex @@ -1,10 +1,11 @@ defmodule Ex338Web.OwnerController do use Ex338Web, :controller - alias Ex338.{FantasyLeagues.FantasyLeague, FantasyTeams.Owner} + alias Ex338.FantasyLeagues.FantasyLeague + alias Ex338.FantasyTeams.Owner def index(conn, %{"fantasy_league_id" => league_id}) do - fantasy_league = FantasyLeague |> Repo.get(league_id) + fantasy_league = Repo.get(FantasyLeague, league_id) owners = Owner diff --git a/lib/ex338_web/controllers/page_controller.ex b/lib/ex338_web/controllers/page_controller.ex index 9a0ffef0..4b9c6751 100644 --- a/lib/ex338_web/controllers/page_controller.ex +++ b/lib/ex338_web/controllers/page_controller.ex @@ -1,7 +1,7 @@ defmodule Ex338Web.PageController do use Ex338Web, :controller - alias Ex338.{FantasyLeagues} + alias Ex338.FantasyLeagues def index(conn, _params) do leagues = FantasyLeagues.get_leagues_by_status("primary") diff --git a/lib/ex338_web/controllers/table_upload_controller.ex b/lib/ex338_web/controllers/table_upload_controller.ex index 5ecc9300..a2426fe5 100644 --- a/lib/ex338_web/controllers/table_upload_controller.ex +++ b/lib/ex338_web/controllers/table_upload_controller.ex @@ -1,6 +1,7 @@ defmodule Ex338Web.TableUploadController do use Ex338Web, :controller - alias Ex338.{Uploader} + + alias Ex338.Uploader def new(conn, _params) do render(conn, "new.html", diff --git a/lib/ex338_web/controllers/trade_controller.ex b/lib/ex338_web/controllers/trade_controller.ex index 1cc50a59..277e0e09 100644 --- a/lib/ex338_web/controllers/trade_controller.ex +++ b/lib/ex338_web/controllers/trade_controller.ex @@ -1,11 +1,17 @@ defmodule Ex338Web.TradeController do use Ex338Web, :controller - alias Ex338.{DraftPicks, FantasyLeagues, Trades, FantasyTeams, Accounts} - alias Ex338Web.{Authorization, TradeEmail, Mailer} - import Canary.Plugs + alias Ex338.Accounts + alias Ex338.DraftPicks + alias Ex338.FantasyLeagues + alias Ex338.FantasyTeams + alias Ex338.Trades + alias Ex338Web.Authorization + alias Ex338Web.Mailer + alias Ex338Web.TradeEmail + plug( :load_and_authorize_resource, model: FantasyTeams.FantasyTeam, @@ -62,7 +68,7 @@ defmodule Ex338Web.TradeController do {:ok, trade} -> trade = Trades.find!(trade.id) admin_emails = Accounts.get_admin_emails() - recipients = (Trades.Trade.get_teams_emails(trade) ++ admin_emails) |> Enum.uniq() + recipients = Enum.uniq(Trades.Trade.get_teams_emails(trade) ++ admin_emails) conn |> TradeEmail.propose(league, trade, recipients) @@ -90,11 +96,7 @@ defmodule Ex338Web.TradeController do end end - def update(conn, %{ - "fantasy_team_id" => _team_id, - "id" => trade_id, - "trade" => trade_params - }) do + def update(conn, %{"fantasy_team_id" => _team_id, "id" => trade_id, "trade" => trade_params}) do %{fantasy_league: league} = team = conn.assigns.fantasy_team case Trades.update_trade(trade_id, trade_params) do @@ -102,7 +104,7 @@ defmodule Ex338Web.TradeController do if(trade.status == "Canceled") do trade = Trades.find!(trade.id) admin_emails = Accounts.get_admin_emails() - recipients = (Trades.Trade.get_teams_emails(trade) ++ admin_emails) |> Enum.uniq() + recipients = Enum.uniq(Trades.Trade.get_teams_emails(trade) ++ admin_emails) conn |> TradeEmail.cancel(league, trade, recipients, team) @@ -129,15 +131,13 @@ defmodule Ex338Web.TradeController do ) do trade = Trades.find!(trade_id) - case trade.status == "Proposed" do - true -> - conn - - false -> - conn - |> put_flash(:error, "Can only update a proposed trade") - |> redirect(to: "/") - |> halt + if trade.status == "Proposed" do + conn + else + conn + |> put_flash(:error, "Can only update a proposed trade") + |> redirect(to: "/") + |> halt() end end diff --git a/lib/ex338_web/controllers/trade_vote_controller.ex b/lib/ex338_web/controllers/trade_vote_controller.ex index 8ba57214..0c67dc74 100644 --- a/lib/ex338_web/controllers/trade_vote_controller.ex +++ b/lib/ex338_web/controllers/trade_vote_controller.ex @@ -1,8 +1,14 @@ defmodule Ex338Web.TradeVoteController do use Ex338Web, :controller - alias Ex338.{FantasyTeams.FantasyTeam, Trades, Accounts} - alias Ex338Web.{Authorization, Mailer, TradeEmail} + import Canary.Plugs + + alias Ex338.Accounts + alias Ex338.FantasyTeams.FantasyTeam + alias Ex338.Trades + alias Ex338Web.Authorization + alias Ex338Web.Mailer + alias Ex338Web.TradeEmail plug( :load_and_authorize_resource, @@ -14,8 +20,6 @@ defmodule Ex338Web.TradeVoteController do unauthorized_handler: {Authorization, :handle_unauthorized} ) - import Canary.Plugs - def create(conn, %{"fantasy_team_id" => _id, "trade_vote" => vote_params}) do team = conn.assigns.fantasy_team @@ -66,7 +70,7 @@ defmodule Ex338Web.TradeVoteController do defp maybe_send_trade_email(%{status: "Rejected"} = trade, conn, team) do league = trade.submitted_by_team.fantasy_league admin_emails = Accounts.get_admin_emails() - recipients = (Trades.Trade.get_teams_emails(trade) ++ admin_emails) |> Enum.uniq() + recipients = Enum.uniq(Trades.Trade.get_teams_emails(trade) ++ admin_emails) conn |> TradeEmail.reject(league, trade, recipients, team) diff --git a/lib/ex338_web/controllers/user_controller.ex b/lib/ex338_web/controllers/user_controller.ex index f9ca4471..0dbef499 100644 --- a/lib/ex338_web/controllers/user_controller.ex +++ b/lib/ex338_web/controllers/user_controller.ex @@ -1,11 +1,12 @@ defmodule Ex338Web.UserController do use Ex338Web, :controller - alias Ex338.{Accounts, Accounts.User} - alias Ex338Web.{Authorization} - import Canary.Plugs + alias Ex338.Accounts + alias Ex338.Accounts.User + alias Ex338Web.Authorization + plug( :load_and_authorize_resource, model: User, diff --git a/lib/ex338_web/controllers/waiver_admin_controller.ex b/lib/ex338_web/controllers/waiver_admin_controller.ex index 82a10f4c..5a533b00 100644 --- a/lib/ex338_web/controllers/waiver_admin_controller.ex +++ b/lib/ex338_web/controllers/waiver_admin_controller.ex @@ -1,10 +1,13 @@ defmodule Ex338Web.WaiverAdminController do use Ex338Web, :controller - alias Ex338.{FantasyLeagues, Waivers.Waiver, Waivers, Authorization} - import Canary.Plugs + alias Ex338.Authorization + alias Ex338.FantasyLeagues + alias Ex338.Waivers + alias Ex338.Waivers.Waiver + plug( :load_and_authorize_resource, model: Waiver, diff --git a/lib/ex338_web/controllers/waiver_controller.ex b/lib/ex338_web/controllers/waiver_controller.ex index 54aca85e..553d115f 100644 --- a/lib/ex338_web/controllers/waiver_controller.ex +++ b/lib/ex338_web/controllers/waiver_controller.ex @@ -1,11 +1,16 @@ defmodule Ex338Web.WaiverController do use Ex338Web, :controller - alias Ex338.{FantasyLeagues, FantasyTeams, FantasyPlayers, Waivers.Waiver, Waivers} - alias Ex338Web.{Authorization, NotificationEmail} - import Canary.Plugs + alias Ex338.FantasyLeagues + alias Ex338.FantasyPlayers + alias Ex338.FantasyTeams + alias Ex338.Waivers + alias Ex338.Waivers.Waiver + alias Ex338Web.Authorization + alias Ex338Web.NotificationEmail + plug( :load_and_authorize_resource, model: FantasyTeams.FantasyTeam, diff --git a/lib/ex338_web/emails/commish_email.ex b/lib/ex338_web/emails/commish_email.ex index 7a60fff4..c3ab128d 100644 --- a/lib/ex338_web/emails/commish_email.ex +++ b/lib/ex338_web/emails/commish_email.ex @@ -1,7 +1,10 @@ defmodule Ex338Web.CommishEmail do @moduledoc false - alias Ex338.{FantasyTeams, Accounts.User, Repo} - alias Ex338Web.{EmailTemplate, Mailer} + alias Ex338.Accounts.User + alias Ex338.FantasyTeams + alias Ex338.Repo + alias Ex338Web.EmailTemplate + alias Ex338Web.Mailer def send_email_to_leagues(leagues, subject, message) do owners = FantasyTeams.get_leagues_email_addresses(leagues) diff --git a/lib/ex338_web/emails/draft_email.ex b/lib/ex338_web/emails/draft_email.ex index d8ee934b..358c65b0 100644 --- a/lib/ex338_web/emails/draft_email.ex +++ b/lib/ex338_web/emails/draft_email.ex @@ -1,10 +1,15 @@ defmodule Ex338Web.DraftEmail do @moduledoc false - require Logger + alias Ex338.Accounts + alias Ex338.DraftPicks + alias Ex338.DraftPicks.DraftPick + alias Ex338.FantasyPlayers + alias Ex338Web.DraftPickView + alias Ex338Web.Mailer + alias Ex338Web.NotificationEmail - alias Ex338.{DraftPicks, DraftPicks.DraftPick, Accounts, FantasyPlayers} - alias Ex338Web.{DraftPickView, Mailer, NotificationEmail} + require Logger def send_error(changeset) do changeset @@ -37,7 +42,8 @@ defmodule Ex338Web.DraftEmail do end def changeset_error_to_string(changeset) do - Ecto.Changeset.traverse_errors(changeset, fn {msg, opts} -> + changeset + |> Ecto.Changeset.traverse_errors(fn {msg, opts} -> Enum.reduce(opts, msg, fn {key, value}, acc -> String.replace(acc, "%{#{key}}", to_string(value)) end) diff --git a/lib/ex338_web/emails/in_season_draft_email.ex b/lib/ex338_web/emails/in_season_draft_email.ex index c5f8a7bf..5e8a3268 100644 --- a/lib/ex338_web/emails/in_season_draft_email.ex +++ b/lib/ex338_web/emails/in_season_draft_email.ex @@ -1,10 +1,13 @@ defmodule Ex338Web.InSeasonDraftEmail do @moduledoc false - require Logger + alias Ex338.Accounts + alias Ex338.FantasyLeagues + alias Ex338.InSeasonDraftPicks + alias Ex338Web.Mailer + alias Ex338Web.NotificationEmail - alias Ex338.{FantasyLeagues, InSeasonDraftPicks, Accounts} - alias Ex338Web.{Mailer, NotificationEmail} + require Logger def send_update(pick) do num_picks = 5 diff --git a/lib/ex338_web/emails/notification_email.ex b/lib/ex338_web/emails/notification_email.ex index 75da77cb..bd1ff809 100644 --- a/lib/ex338_web/emails/notification_email.ex +++ b/lib/ex338_web/emails/notification_email.ex @@ -2,10 +2,15 @@ defmodule Ex338Web.NotificationEmail do @moduledoc false use Phoenix.Swoosh, view: Ex338Web.EmailView, layout: {Ex338Web.LayoutView, :email} + import Ex338Web.WaiverView, only: [display_name: 1] + + alias Ex338.Accounts + alias Ex338.Waivers + alias Ex338.Waivers.Waiver + alias Ex338Web.Mailer + require Logger - alias Ex338.{Accounts, Waivers, Waivers.Waiver} - alias Ex338Web.{Mailer} def draft_update(%{ recipients: recipients, diff --git a/lib/ex338_web/live/championship_live.ex b/lib/ex338_web/live/championship_live.ex index 25c1c43e..6f41b9e0 100644 --- a/lib/ex338_web/live/championship_live.ex +++ b/lib/ex338_web/live/championship_live.ex @@ -2,7 +2,10 @@ defmodule Ex338Web.ChampionshipLive do @moduledoc false use Ex338Web, :live_view - alias Ex338.{Championships, FantasyLeagues, InSeasonDraftPicks, Accounts} + alias Ex338.Accounts + alias Ex338.Championships + alias Ex338.FantasyLeagues + alias Ex338.InSeasonDraftPicks alias Ex338Web.ChampionshipView def mount(_params, session, socket) do @@ -42,8 +45,7 @@ defmodule Ex338Web.ChampionshipLive do championship = Championships.update_next_in_season_pick(socket.assigns.championship) socket = - socket - |> assign(:championship, championship) + assign(socket, :championship, championship) schedule_refresh() @@ -72,7 +74,7 @@ defmodule Ex338Web.ChampionshipLive do # Implementations - defp schedule_refresh() do + defp schedule_refresh do one_second = 1000 Process.send_after(self(), :refresh, one_second) end diff --git a/lib/ex338_web/live/commish/fantasy_league_live/approval.ex b/lib/ex338_web/live/commish/fantasy_league_live/approval.ex index 90d47cbe..6449cb1b 100644 --- a/lib/ex338_web/live/commish/fantasy_league_live/approval.ex +++ b/lib/ex338_web/live/commish/fantasy_league_live/approval.ex @@ -1,7 +1,12 @@ defmodule Ex338Web.Commish.FantasyLeagueLive.Approval do + @moduledoc false use Ex338Web, :live_view - alias Ex338.{Accounts, DraftPicks, FantasyLeagues, InjuredReserves, Trades} + alias Ex338.Accounts + alias Ex338.DraftPicks + alias Ex338.FantasyLeagues + alias Ex338.InjuredReserves + alias Ex338.Trades @impl true def mount(_params, %{"current_user_id" => user_id}, socket) do diff --git a/lib/ex338_web/live/commish/fantasy_league_live/edit.ex b/lib/ex338_web/live/commish/fantasy_league_live/edit.ex index d52a41d0..500a3160 100644 --- a/lib/ex338_web/live/commish/fantasy_league_live/edit.ex +++ b/lib/ex338_web/live/commish/fantasy_league_live/edit.ex @@ -1,4 +1,5 @@ defmodule Ex338Web.Commish.FantasyLeagueLive.Edit do + @moduledoc false use Ex338Web, :live_view alias Ex338.FantasyLeagues diff --git a/lib/ex338_web/live/commish/fantasy_league_live/form_component.ex b/lib/ex338_web/live/commish/fantasy_league_live/form_component.ex index 1b208af5..5a843f3b 100644 --- a/lib/ex338_web/live/commish/fantasy_league_live/form_component.ex +++ b/lib/ex338_web/live/commish/fantasy_league_live/form_component.ex @@ -1,4 +1,5 @@ defmodule Ex338Web.Commish.FantasyLeagueLive.FormComponent do + @moduledoc false use Ex338Web, :live_component alias Ex338.FantasyLeagues diff --git a/lib/ex338_web/live/draft_pick_live.ex b/lib/ex338_web/live/draft_pick_live.ex index fd5c058c..700bb9e2 100644 --- a/lib/ex338_web/live/draft_pick_live.ex +++ b/lib/ex338_web/live/draft_pick_live.ex @@ -2,7 +2,9 @@ defmodule Ex338Web.DraftPickLive do @moduledoc false use Ex338Web, :live_view - alias Ex338.{DraftPicks, FantasyLeagues, Accounts} + alias Ex338.Accounts + alias Ex338.DraftPicks + alias Ex338.FantasyLeagues alias Ex338Web.DraftPickView def mount(_params, session, socket) do @@ -137,7 +139,7 @@ defmodule Ex338Web.DraftPickLive do end) end - defp schedule_refresh(), do: Process.send_after(self(), :refresh, 1000 * 60) + defp schedule_refresh, do: Process.send_after(self(), :refresh, 1000 * 60) ## mount diff --git a/lib/ex338_web/live/live_helpers.ex b/lib/ex338_web/live/live_helpers.ex index ac6f111f..54a0f2df 100644 --- a/lib/ex338_web/live/live_helpers.ex +++ b/lib/ex338_web/live/live_helpers.ex @@ -1,4 +1,5 @@ defmodule Ex338Web.LiveHelpers do + @moduledoc false import Phoenix.LiveView.Helpers @doc """ diff --git a/lib/ex338_web/live/modal_component.ex b/lib/ex338_web/live/modal_component.ex index 8456f8bb..92a44c60 100644 --- a/lib/ex338_web/live/modal_component.ex +++ b/lib/ex338_web/live/modal_component.ex @@ -1,4 +1,5 @@ defmodule Ex338Web.ModalComponent do + @moduledoc false use Ex338Web, :live_component @impl true diff --git a/lib/ex338_web/live/rules_live.ex b/lib/ex338_web/live/rules_live.ex index 11c7bb48..388068c9 100644 --- a/lib/ex338_web/live/rules_live.ex +++ b/lib/ex338_web/live/rules_live.ex @@ -2,7 +2,9 @@ defmodule Ex338Web.RulesLive do @moduledoc false use Ex338Web, :live_view - alias Ex338.{Accounts, FantasyLeagues, FantasyTeams} + alias Ex338.Accounts + alias Ex338.FantasyLeagues + alias Ex338.FantasyTeams def mount(_params, session, socket) do %{ diff --git a/lib/ex338_web/mailer.ex b/lib/ex338_web/mailer.ex index b6684db6..407d5cc2 100644 --- a/lib/ex338_web/mailer.ex +++ b/lib/ex338_web/mailer.ex @@ -14,7 +14,7 @@ defmodule Ex338Web.Mailer do {:error, reason} end - def default_from_name_and_email() do + def default_from_name_and_email do email_address = Application.fetch_env!(:ex338, :mailer_default_from_email) name = Application.fetch_env!(:ex338, :mailer_default_from_name) diff --git a/lib/ex338_web/plugs/canonical_domain.ex b/lib/ex338_web/plugs/canonical_domain.ex index b55c0045..f0d98f00 100644 --- a/lib/ex338_web/plugs/canonical_domain.ex +++ b/lib/ex338_web/plugs/canonical_domain.ex @@ -34,7 +34,7 @@ defmodule Ex338Web.CanonicalDomain do defp redirect?(_), do: false - defp canonical_host() do + defp canonical_host do Ex338Web.Endpoint.config(:url)[:host] end end diff --git a/lib/ex338_web/plugs/event.ex b/lib/ex338_web/plugs/event.ex index be63f7db..fa8379b7 100644 --- a/lib/ex338_web/plugs/event.ex +++ b/lib/ex338_web/plugs/event.ex @@ -13,7 +13,7 @@ defmodule Ex338Web.RequestEvent do ## Helpers defp send_data(conn) do - headers = Enum.into(conn.req_headers, %{}) + headers = Map.new(conn.req_headers) ip = conn.remote_ip |> Tuple.to_list() |> Enum.join(".") user_id = extract_user_id(conn.assigns) diff --git a/lib/ex338_web/plugs/load_leagues.ex b/lib/ex338_web/plugs/load_leagues.ex index 70335504..7c9714dc 100644 --- a/lib/ex338_web/plugs/load_leagues.ex +++ b/lib/ex338_web/plugs/load_leagues.ex @@ -5,7 +5,7 @@ defmodule Ex338Web.LoadLeagues do import Plug.Conn - alias Ex338.{FantasyLeagues} + alias Ex338.FantasyLeagues def init(options) do # initialize options diff --git a/lib/ex338_web/plugs/load_user_teams.ex b/lib/ex338_web/plugs/load_user_teams.ex index a11cbb84..70029f60 100644 --- a/lib/ex338_web/plugs/load_user_teams.ex +++ b/lib/ex338_web/plugs/load_user_teams.ex @@ -5,7 +5,7 @@ defmodule Ex338Web.LoadUserTeams do import Plug.Conn - alias Ex338.{Accounts} + alias Ex338.Accounts def init(options) do # initialize options diff --git a/lib/ex338_web/pow/redis_cache.ex b/lib/ex338_web/pow/redis_cache.ex index 8634545b..8ff74cb2 100644 --- a/lib/ex338_web/pow/redis_cache.ex +++ b/lib/ex338_web/pow/redis_cache.ex @@ -6,7 +6,7 @@ defmodule Ex338Web.Pow.RedisCache do @redix_instance_name :redix - def name(), do: @redix_instance_name + def name, do: @redix_instance_name @impl true def put(config, record_or_records) do @@ -57,8 +57,8 @@ defmodule Ex338Web.Pow.RedisCache do def all(config, match_spec) do compiled_match_spec = :ets.match_spec_compile([{{match_spec, :_}, [], [:"$_"]}]) - Stream.resource( - fn -> do_scan(config, compiled_match_spec, "0") end, + fn -> do_scan(config, compiled_match_spec, "0") end + |> Stream.resource( &stream_scan(config, compiled_match_spec, &1), fn _ -> :ok end ) @@ -138,13 +138,9 @@ defmodule Ex338Web.Pow.RedisCache do defp namespace(config), do: Config.get(config, :namespace, "cache") defp to_binary_redis_key(key) do - key - |> Enum.map(fn part -> - part - |> :erlang.term_to_binary() - |> Base.url_encode64(padding: false) + Enum.map_join(key, ":", fn part -> + part |> :erlang.term_to_binary() |> Base.url_encode64(padding: false) end) - |> Enum.join(":") end defp from_binary_redis_key(key) do diff --git a/lib/ex338_web/router.ex b/lib/ex338_web/router.ex index 3ae1cf45..7fb89bc7 100644 --- a/lib/ex338_web/router.ex +++ b/lib/ex338_web/router.ex @@ -3,10 +3,10 @@ defmodule Ex338Web.Router do use Honeybadger.Plug use Pow.Phoenix.Router use Pow.Extension.Phoenix.Router, otp_app: :ex338 - import Phoenix.LiveDashboard.Router - use Kaffy.Routes, scope: "/admin", pipe_through: [:protected, :admin, :remove_root_layout] + import Phoenix.LiveDashboard.Router + pipeline :browser do plug(:accepts, ["html"]) plug(:fetch_session) diff --git a/lib/ex338_web/telemetry.ex b/lib/ex338_web/telemetry.ex index f090cfce..34c32ef6 100644 --- a/lib/ex338_web/telemetry.ex +++ b/lib/ex338_web/telemetry.ex @@ -1,5 +1,7 @@ defmodule Ex338Web.Telemetry do + @moduledoc false use Supervisor + import Telemetry.Metrics def start_link(arg) do diff --git a/lib/ex338_web/views/email_view.ex b/lib/ex338_web/views/email_view.ex index d4bdef6a..1a67e4f5 100644 --- a/lib/ex338_web/views/email_view.ex +++ b/lib/ex338_web/views/email_view.ex @@ -3,11 +3,6 @@ defmodule Ex338Web.EmailView do import Ex338Web.WaiverView, only: [display_name: 1] - def display_player(%{ - player_name: name, - sports_league: %{ - abbrev: abbrev - } - }), - do: "#{String.trim(name)}, #{abbrev}" + def display_player(%{player_name: name, sports_league: %{abbrev: abbrev}}), + do: "#{String.trim(name)}, #{abbrev}" end diff --git a/lib/ex338_web/views/fantasy_team_view.ex b/lib/ex338_web/views/fantasy_team_view.ex index 946d77fa..1315d86b 100644 --- a/lib/ex338_web/views/fantasy_team_view.ex +++ b/lib/ex338_web/views/fantasy_team_view.ex @@ -1,17 +1,15 @@ defmodule Ex338Web.FantasyTeamView do use Ex338Web, :view - alias Ex338.{ - DraftQueues.DraftQueue, - FantasyLeagues.FantasyLeague, - FantasyTeams.FantasyTeam, - RosterPositions.RosterPosition - } - import Ex338.RosterPositions.Admin, only: [primary_positions: 1, flex_and_unassigned_positions: 1] - def autodraft_setting_options() do + alias Ex338.DraftQueues.DraftQueue + alias Ex338.FantasyLeagues.FantasyLeague + alias Ex338.FantasyTeams.FantasyTeam + alias Ex338.RosterPositions.RosterPosition + + def autodraft_setting_options do FantasyTeam.autodraft_setting_options() end @@ -65,7 +63,7 @@ defmodule Ex338Web.FantasyTeamView do RosterPosition.flex_positions(num_spots) end - def queue_status_options() do + def queue_status_options do DraftQueue.owner_status_options() end diff --git a/lib/ex338_web/views/input_helpers.ex b/lib/ex338_web/views/input_helpers.ex index 820413c8..f10df7d7 100644 --- a/lib/ex338_web/views/input_helpers.ex +++ b/lib/ex338_web/views/input_helpers.ex @@ -1,4 +1,5 @@ defmodule Ex338Web.InputHelpers do + @moduledoc false use Phoenix.HTML def input(form, field, opts \\ []) do diff --git a/lib/ex338_web/views/layout_view.ex b/lib/ex338_web/views/layout_view.ex index fddf1ade..d93c056f 100644 --- a/lib/ex338_web/views/layout_view.ex +++ b/lib/ex338_web/views/layout_view.ex @@ -5,8 +5,8 @@ defmodule Ex338Web.LayoutView do fantasy_leagues |> filter_by_navbar(navbar) |> filter_by_draft_method(draft_method) - |> sort_by_div - |> sort_by_year + |> sort_by_div() + |> sort_by_year() end def commish_tab_link(current_route, link, content) do @@ -112,7 +112,7 @@ defmodule Ex338Web.LayoutView do ## Helpers defp trim_query_params(link) do - [link] = String.split(link, "?") |> Enum.take(1) + [link] = link |> String.split("?") |> Enum.take(1) link end diff --git a/lib/ex338_web/views/user_view.ex b/lib/ex338_web/views/user_view.ex index bd1028bf..3d547bf1 100644 --- a/lib/ex338_web/views/user_view.ex +++ b/lib/ex338_web/views/user_view.ex @@ -1,7 +1,7 @@ defmodule Ex338Web.UserView do use Ex338Web, :view - alias Ex338.{Accounts.User} + alias Ex338.Accounts.User def user_profile_image(%User{} = user, img_opts) do user.email diff --git a/lib/ex338_web/views/view_helpers.ex b/lib/ex338_web/views/view_helpers.ex index f347bd6d..6a45cb29 100644 --- a/lib/ex338_web/views/view_helpers.ex +++ b/lib/ex338_web/views/view_helpers.ex @@ -1,18 +1,16 @@ defmodule Ex338Web.ViewHelpers do @moduledoc false - alias Ex338.{ - FantasyTeams.FantasyTeam, - Accounts.User, - InSeasonDraftPicks.InSeasonDraftPick, - FantasyPlayers.FantasyPlayer, - FantasyPlayers.SportsLeague - } - - alias Ex338Web.Router.Helpers, as: Routes import Calendar.Strftime import Phoenix.Component import Phoenix.HTML.Link, only: [link: 2] + alias Ex338.Accounts.User + alias Ex338.FantasyPlayers.FantasyPlayer + alias Ex338.FantasyPlayers.SportsLeague + alias Ex338.FantasyTeams.FantasyTeam + alias Ex338.InSeasonDraftPicks.InSeasonDraftPick + alias Ex338Web.Router.Helpers, as: Routes + def admin?(%User{admin: true}), do: true def admin?(_current_user), do: false @@ -69,25 +67,25 @@ defmodule Ex338Web.ViewHelpers do def short_date_pst(date) do date - |> convert_to_pst + |> convert_to_pst() |> strftime!("%b %e, %Y") end def short_datetime_pst(date) do date - |> convert_to_pst + |> convert_to_pst() |> strftime!("%b %e, %l:%M %p") end def short_time_pst(date) do date - |> convert_to_pst + |> convert_to_pst() |> strftime!("%l:%M %p") end def short_time_secs_pst(date) do date - |> convert_to_pst + |> convert_to_pst() |> strftime!("%l:%M:%S %p") end diff --git a/mix.exs b/mix.exs index c0d30da5..fae64cde 100644 --- a/mix.exs +++ b/mix.exs @@ -69,6 +69,7 @@ defmodule Ex338.Mixfile do {:postgrex, "~> 0.16.0"}, {:pow, "== 1.0.28"}, {:redix, "~> 1.2.3"}, + {:styler, "~> 0.11", only: [:dev, :test], runtime: false}, {:swoosh, "~> 1.11.1"}, {:telemetry_poller, "~> 0.4"}, {:telemetry_metrics, "~> 0.4"} diff --git a/mix.lock b/mix.lock index ceb439df..1aa584fc 100644 --- a/mix.lock +++ b/mix.lock @@ -63,6 +63,7 @@ "ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"}, "redix": {:hex, :redix, "1.2.3", "3036e7c6080c42e1bbaa9168d1e28e367b01e8960a640a899b8ef8067273cb5e", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:nimble_options, "~> 0.5.0 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "14e2bca8a03fad297a78a3d201032df260ee5f0e0ef9c173c0f9ca5b3e0331b7"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"}, + "styler": {:hex, :styler, "0.11.9", "2595393b94e660cd6e8b582876337cc50ff047d184ccbed42fdad2bfd5d78af5", [:mix], [], "hexpm", "8b7806ba1fdc94d0a75127c56875f91db89b75117fcc67572661010c13e1f259"}, "swoosh": {:hex, :swoosh, "1.11.4", "9b353f998cba3c5e101a0669559c2fb2757b5d9eb7db058bf08687d82e93e416", [:mix], [{:cowboy, "~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:ex_aws, "~> 2.1", [hex: :ex_aws, repo: "hexpm", optional: true]}, {:finch, "~> 0.6", [hex: :finch, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.13 or ~> 1.0", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mail, "~> 0.2", [hex: :mail, repo: "hexpm", optional: true]}, {:mime, "~> 1.1 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d3390914022a456ae1604bfcb3431bd12509b2afe8c70296bae6c9dca4903d0f"}, "telemetry": {:hex, :telemetry, "0.4.3", "a06428a514bdbc63293cd9a6263aad00ddeb66f608163bdec7c8995784080818", [:rebar3], [], "hexpm", "eb72b8365ffda5bed68a620d1da88525e326cb82a75ee61354fc24b844768041"}, "telemetry_metrics": {:hex, :telemetry_metrics, "0.6.1", "315d9163a1d4660aedc3fee73f33f1d355dcc76c5c3ab3d59e76e3edf80eef1f", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7be9e0871c41732c233be71e4be11b96e56177bf15dde64a8ac9ce72ac9834c6"}, diff --git a/priv/repo/seeds.exs b/priv/repo/seeds.exs index f4ee13e5..da31d5e7 100644 --- a/priv/repo/seeds.exs +++ b/priv/repo/seeds.exs @@ -15,13 +15,11 @@ defmodule Ex338.Seeds do @moduledoc false - alias Ex338.{ - FantasyPlayers.FantasyPlayer, - FantasyPlayers.SportsLeague, - Repo, - Championships.Championship, - CalendarAssistant - } + alias Ex338.CalendarAssistant + alias Ex338.Championships.Championship + alias Ex338.FantasyPlayers.FantasyPlayer + alias Ex338.FantasyPlayers.SportsLeague + alias Ex338.Repo def store_sports_leagues(row) do changeset = SportsLeague.changeset(%SportsLeague{}, row) @@ -64,12 +62,14 @@ defmodule Ex338.Seeds do end end -File.stream!("priv/repo/csv_seed_data/sports_leagues.csv") +"priv/repo/csv_seed_data/sports_leagues.csv" +|> File.stream!() |> Stream.drop(1) |> CSV.decode!(headers: [:league_name, :abbrev]) |> Enum.each(&Ex338.Seeds.store_sports_leagues/1) -File.stream!("priv/repo/csv_seed_data/championships.csv") +"priv/repo/csv_seed_data/championships.csv" +|> File.stream!() |> Stream.drop(1) |> CSV.decode!( headers: [ @@ -89,7 +89,8 @@ File.stream!("priv/repo/csv_seed_data/championships.csv") ) |> Enum.each(&Ex338.Seeds.store_championships/1) -File.stream!("priv/repo/csv_seed_data/fantasy_players.csv") +"priv/repo/csv_seed_data/fantasy_players.csv" +|> File.stream!() |> Stream.drop(1) |> CSV.decode!(headers: [:player_name, :sports_league_id, :draft_pick]) |> Enum.each(&Ex338.Seeds.store_fantasy_players/1) diff --git a/test/ex338/accounts/user_test.exs b/test/ex338/accounts/user_test.exs index dc10d8e3..3c2586f9 100644 --- a/test/ex338/accounts/user_test.exs +++ b/test/ex338/accounts/user_test.exs @@ -1,6 +1,7 @@ defmodule Ex338.UserTest do use Ex338.DataCase, async: true - alias Ex338.{Accounts.User} + + alias Ex338.Accounts.User describe "admin_emails/0" do test "returns all admin emails" do diff --git a/test/ex338/accounts_test.exs b/test/ex338/accounts_test.exs index fc67abc8..2632b6f0 100644 --- a/test/ex338/accounts_test.exs +++ b/test/ex338/accounts_test.exs @@ -1,5 +1,6 @@ defmodule Ex338.AccountsTest do use Ex338.DataCase, async: true + alias Ex338.Accounts describe "get_admin_emails/0" do diff --git a/test/ex338/autodraft_test.exs b/test/ex338/autodraft_test.exs index 7c776d77..422c75a6 100644 --- a/test/ex338/autodraft_test.exs +++ b/test/ex338/autodraft_test.exs @@ -3,13 +3,11 @@ defmodule Ex338.AutoDraftTest do import Swoosh.TestAssertions - alias Ex338.{ - AutoDraft, - CalendarAssistant, - InSeasonDraftPicks.InSeasonDraftPick, - DraftQueues.DraftQueue, - FantasyTeams.FantasyTeam - } + alias Ex338.AutoDraft + alias Ex338.CalendarAssistant + alias Ex338.DraftQueues.DraftQueue + alias Ex338.FantasyTeams.FantasyTeam + alias Ex338.InSeasonDraftPicks.InSeasonDraftPick describe "make_picks_from_queues/1" do test "makes next draft pick from draft queue" do diff --git a/test/ex338/calendar_assistant_test.exs b/test/ex338/calendar_assistant_test.exs index d5bdf7b2..d3112605 100644 --- a/test/ex338/calendar_assistant_test.exs +++ b/test/ex338/calendar_assistant_test.exs @@ -1,6 +1,7 @@ defmodule Ex338.CalendarAssistantTest do use Ex338.DataCase, async: true - alias Ex338.{CalendarAssistant} + + alias Ex338.CalendarAssistant describe "days_from_now/1" do test "returns a date a specified number of days from now" do @@ -8,8 +9,8 @@ defmodule Ex338.CalendarAssistantTest do yesterday = CalendarAssistant.days_from_now(-1) tomorrow = CalendarAssistant.days_from_now(1) - assert DateTime.compare(now, yesterday) == :gt - assert DateTime.compare(now, tomorrow) == :lt + assert DateTime.after?(now, yesterday) + assert DateTime.before?(now, tomorrow) end end @@ -19,8 +20,8 @@ defmodule Ex338.CalendarAssistantTest do before = CalendarAssistant.mins_from_now(-1) later = CalendarAssistant.mins_from_now(1) - assert DateTime.compare(now, before) == :gt - assert DateTime.compare(now, later) == :lt + assert DateTime.after?(now, before) + assert DateTime.before?(now, later) end end end diff --git a/test/ex338/championships/championship_result_test.exs b/test/ex338/championships/championship_result_test.exs index 83b2f503..3548e0ab 100644 --- a/test/ex338/championships/championship_result_test.exs +++ b/test/ex338/championships/championship_result_test.exs @@ -1,7 +1,8 @@ defmodule Ex338.Championships.ChampionshipResultTest do use Ex338.DataCase, async: true - alias Ex338.{Championships.ChampionshipResult, CalendarAssistant} + alias Ex338.CalendarAssistant + alias Ex338.Championships.ChampionshipResult @valid_attrs %{points: 8, rank: 1, fantasy_player_id: 2, championship_id: 3} @invalid_attrs %{} diff --git a/test/ex338/championships/championship_slot_test.exs b/test/ex338/championships/championship_slot_test.exs index 0a6ef9cf..ff757157 100644 --- a/test/ex338/championships/championship_slot_test.exs +++ b/test/ex338/championships/championship_slot_test.exs @@ -1,7 +1,8 @@ defmodule Ex338.Championships.ChampionshipSlotTest do use Ex338.DataCase, async: true - alias Ex338.{Championships.ChampionshipSlot, CalendarAssistant} + alias Ex338.CalendarAssistant + alias Ex338.Championships.ChampionshipSlot @valid_attrs %{slot: 42} @invalid_attrs %{} diff --git a/test/ex338/championships/championship_test.exs b/test/ex338/championships/championship_test.exs index baad7dbd..2823384c 100644 --- a/test/ex338/championships/championship_test.exs +++ b/test/ex338/championships/championship_test.exs @@ -1,7 +1,8 @@ defmodule Ex338.Championships.ChampionshipTest do use Ex338.DataCase, async: true - alias Ex338.{Championships.Championship, CalendarAssistant} + alias Ex338.CalendarAssistant + alias Ex338.Championships.Championship describe "add_deadline_statuses/1" do test "add boolean with status of deadlines" do diff --git a/test/ex338/championships/create_slot_test.exs b/test/ex338/championships/create_slot_test.exs index 793af2ca..de45589c 100644 --- a/test/ex338/championships/create_slot_test.exs +++ b/test/ex338/championships/create_slot_test.exs @@ -1,12 +1,10 @@ defmodule Ex338.Championships.CreateSlotTest do use Ex338.DataCase, async: true - alias Ex338.{ - Championships.CreateSlot, - Championships.ChampionshipSlot, - FantasyTeams.FantasyTeam, - Repo - } + alias Ex338.Championships.ChampionshipSlot + alias Ex338.Championships.CreateSlot + alias Ex338.FantasyTeams.FantasyTeam + alias Ex338.Repo describe "create_slots_from_positions/1" do test "creates roster slots from positions" do diff --git a/test/ex338/championships_test.exs b/test/ex338/championships_test.exs index cf49104e..05605902 100644 --- a/test/ex338/championships_test.exs +++ b/test/ex338/championships_test.exs @@ -2,13 +2,11 @@ defmodule Ex338.ChampionshipsTest do use Ex338.DataCase, async: true use Oban.Testing, repo: Ex338.Repo - alias Ex338.{ - CalendarAssistant, - Championships, - Championships.ChampionshipSlot, - Championships.Championship, - InSeasonDraftPicks.InSeasonDraftPick - } + alias Ex338.CalendarAssistant + alias Ex338.Championships + alias Ex338.Championships.Championship + alias Ex338.Championships.ChampionshipSlot + alias Ex338.InSeasonDraftPicks.InSeasonDraftPick describe "all_for_league/1" do test "returns all championships by league and year" do @@ -90,7 +88,7 @@ defmodule Ex338.ChampionshipsTest do fantasy_league.id ) - assert result |> DateTime.truncate(:second) == five_mins + assert DateTime.truncate(result, :second) == five_mins end) end end diff --git a/test/ex338/commish_email_test.exs b/test/ex338/commish_email_test.exs index cd698229..b0584b26 100644 --- a/test/ex338/commish_email_test.exs +++ b/test/ex338/commish_email_test.exs @@ -1,7 +1,10 @@ defmodule Ex338.CommishEmailTest do use Ex338.DataCase, async: true + import Swoosh.TestAssertions - alias Ex338Web.{EmailTemplate, CommishEmail} + + alias Ex338Web.CommishEmail + alias Ex338Web.EmailTemplate describe "send_email_to_leagues/3" do test "sends an email to owners of a list of leagues" do diff --git a/test/ex338/draft_picks/clock_test.exs b/test/ex338/draft_picks/clock_test.exs index bdba8641..0bd76694 100644 --- a/test/ex338/draft_picks/clock_test.exs +++ b/test/ex338/draft_picks/clock_test.exs @@ -1,12 +1,10 @@ defmodule Ex338.DraftPicks.ClockTest do use Ex338.DataCase, async: true - alias Ex338.{ - FantasyLeagues.FantasyLeague, - FantasyTeams.FantasyTeam, - DraftPicks.DraftPick, - DraftPicks.Clock - } + alias Ex338.DraftPicks.Clock + alias Ex338.DraftPicks.DraftPick + alias Ex338.FantasyLeagues.FantasyLeague + alias Ex338.FantasyTeams.FantasyTeam describe "calculate_team_data/1" do test "returns summary of draft data" do diff --git a/test/ex338/draft_picks/draft_pick_test.exs b/test/ex338/draft_picks/draft_pick_test.exs index 01fc66cb..caf87d02 100644 --- a/test/ex338/draft_picks/draft_pick_test.exs +++ b/test/ex338/draft_picks/draft_pick_test.exs @@ -1,7 +1,9 @@ defmodule Ex338.DraftPicks.DraftPickTest do use Ex338.DataCase, async: true - alias Ex338.{CalendarAssistant, DraftPicks, DraftPicks.DraftPick} + alias Ex338.CalendarAssistant + alias Ex338.DraftPicks + alias Ex338.DraftPicks.DraftPick describe "add_pick_numbers/1" do test "Adds pick numbers for a list of draft picks" do @@ -410,7 +412,7 @@ defmodule Ex338.DraftPicks.DraftPickTest do test "only allows update to fantasy player" do changeset = DraftPick.owner_changeset(%DraftPick{}, @valid_user_attrs) - assert Map.keys(changeset.changes) == [:fantasy_player_id, :drafted_at] + assert Map.keys(changeset.changes) == [:drafted_at, :fantasy_player_id] end test "with invalid attributes" do diff --git a/test/ex338/draft_picks_test.exs b/test/ex338/draft_picks_test.exs index d43256b8..ff06b3d0 100644 --- a/test/ex338/draft_picks_test.exs +++ b/test/ex338/draft_picks_test.exs @@ -1,7 +1,9 @@ defmodule Ex338.DraftPicksTest do use Ex338.DataCase, async: true - alias Ex338.{DraftPicks, DraftPicks.FuturePick, DraftQueues.DraftQueue} + alias Ex338.DraftPicks + alias Ex338.DraftPicks.FuturePick + alias Ex338.DraftQueues.DraftQueue describe "future_picks" do @invalid_attrs %{round: nil} diff --git a/test/ex338/draft_queues/admin_test.exs b/test/ex338/draft_queues/admin_test.exs index c0b827f1..d626d1dd 100644 --- a/test/ex338/draft_queues/admin_test.exs +++ b/test/ex338/draft_queues/admin_test.exs @@ -1,7 +1,8 @@ defmodule Ex338.DraftQueues.AdminTest do use Ex338.DataCase, async: true - alias Ex338.{DraftQueues.Admin, DraftQueues.DraftQueue} + alias Ex338.DraftQueues.Admin + alias Ex338.DraftQueues.DraftQueue describe "update_drafted_from_pick/1" do test "updates pending draft queues to drafted from a draft pick" do diff --git a/test/ex338/draft_queues_test.exs b/test/ex338/draft_queues_test.exs index 5c43c1e3..2f861bb5 100644 --- a/test/ex338/draft_queues_test.exs +++ b/test/ex338/draft_queues_test.exs @@ -1,7 +1,8 @@ defmodule Ex338.DraftQueuesTest do use Ex338.DataCase, async: true - alias Ex338.{DraftQueues, DraftQueues.DraftQueue} + alias Ex338.DraftQueues + alias Ex338.DraftQueues.DraftQueue describe "create_draft_queue" do test "creates a draft queue with valid attributes" do diff --git a/test/ex338/fantasy_leagues/fantasy_league_test.exs b/test/ex338/fantasy_leagues/fantasy_league_test.exs index ebc92f66..a366563d 100644 --- a/test/ex338/fantasy_leagues/fantasy_league_test.exs +++ b/test/ex338/fantasy_leagues/fantasy_league_test.exs @@ -3,7 +3,9 @@ defmodule Ex338.FantasyLeagueTest do use Ex338.DataCase, async: true - alias Ex338.{FantasyLeagues.FantasyLeague, FantasyTeams.FantasyTeam, DraftPicks.DraftPick} + alias Ex338.DraftPicks.DraftPick + alias Ex338.FantasyLeagues.FantasyLeague + alias Ex338.FantasyTeams.FantasyTeam @valid_attrs %{fantasy_league_name: "2016 Div A", division: "A", year: 2016} @invalid_attrs %{} @@ -47,7 +49,7 @@ defmodule Ex338.FantasyLeagueTest do fantasy_league: other_league ) - query = FantasyTeam |> FantasyLeague.by_league(league.id) + query = FantasyLeague.by_league(FantasyTeam, league.id) query = from(f in query, select: f.team_name) assert Repo.all(query) == ~w(Brown) @@ -65,7 +67,7 @@ defmodule Ex338.FantasyLeagueTest do fantasy_league: other_league ) - query = DraftPick |> FantasyLeague.by_league(league.id) + query = FantasyLeague.by_league(DraftPick, league.id) query = from(d in query, select: d.draft_position) assert Repo.all(query) == [1.01] diff --git a/test/ex338/fantasy_leagues_test.exs b/test/ex338/fantasy_leagues_test.exs index 10f13353..b552f78d 100644 --- a/test/ex338/fantasy_leagues_test.exs +++ b/test/ex338/fantasy_leagues_test.exs @@ -1,6 +1,8 @@ defmodule Ex338.FantasyLeaguesTest do use Ex338.DataCase, async: true - alias Ex338.{FantasyLeagues, FantasyLeagues.FantasyLeague} + + alias Ex338.FantasyLeagues + alias Ex338.FantasyLeagues.FantasyLeague test "change_fantasy_league/1 returns a fantasy_league changeset" do fantasy_league = insert(:fantasy_league) diff --git a/test/ex338/fantasy_players/fantasy_player_test.exs b/test/ex338/fantasy_players/fantasy_player_test.exs index fafcfda6..9c0394af 100644 --- a/test/ex338/fantasy_players/fantasy_player_test.exs +++ b/test/ex338/fantasy_players/fantasy_player_test.exs @@ -3,7 +3,8 @@ defmodule Ex338.FantasyPlayerTest do use Ex338.DataCase, async: true - alias Ex338.{FantasyPlayers.FantasyPlayer, CalendarAssistant} + alias Ex338.CalendarAssistant + alias Ex338.FantasyPlayers.FantasyPlayer @valid_attrs %{player_name: "some content", sports_league_id: 12} @invalid_attrs %{} diff --git a/test/ex338/fantasy_players/sports_league_test.exs b/test/ex338/fantasy_players/sports_league_test.exs index 84ba6d60..7d76117f 100644 --- a/test/ex338/fantasy_players/sports_league_test.exs +++ b/test/ex338/fantasy_players/sports_league_test.exs @@ -1,7 +1,8 @@ defmodule Ex338.FantasyPlayers.SportsLeagueTest do use Ex338.DataCase, async: true - alias Ex338.{CalendarAssistant, FantasyPlayers.SportsLeague} + alias Ex338.CalendarAssistant + alias Ex338.FantasyPlayers.SportsLeague describe "abbrev_a_to_z/1" do test "sorts abbrev a to z" do diff --git a/test/ex338/fantasy_players_test.exs b/test/ex338/fantasy_players_test.exs index 019b420e..d2456462 100644 --- a/test/ex338/fantasy_players_test.exs +++ b/test/ex338/fantasy_players_test.exs @@ -1,7 +1,9 @@ defmodule Ex338.FantasyPlayersTest do use Ex338.DataCase, async: true - alias Ex338.{CalendarAssistant, FantasyPlayers, FantasyPlayers.FantasyPlayer} + alias Ex338.CalendarAssistant + alias Ex338.FantasyPlayers + alias Ex338.FantasyPlayers.FantasyPlayer describe "all_players_for_league/1" do test "returns players grouped by sports league" do diff --git a/test/ex338/fantasy_teams/deadlines_test.exs b/test/ex338/fantasy_teams/deadlines_test.exs index 79c2b51d..3e4a4089 100644 --- a/test/ex338/fantasy_teams/deadlines_test.exs +++ b/test/ex338/fantasy_teams/deadlines_test.exs @@ -1,7 +1,9 @@ defmodule Ex338.FantasyTeams.DeadlinesTest do use Ex338.DataCase, async: true - alias Ex338.{CalendarAssistant, Championships.Championship, FantasyTeams.Deadlines} + alias Ex338.CalendarAssistant + alias Ex338.Championships.Championship + alias Ex338.FantasyTeams.Deadlines describe "add_for_league/1" do test "add boolean whether season has ended" do diff --git a/test/ex338/fantasy_teams/fantasy_team_test.exs b/test/ex338/fantasy_teams/fantasy_team_test.exs index 0df8119d..77d63c05 100644 --- a/test/ex338/fantasy_teams/fantasy_team_test.exs +++ b/test/ex338/fantasy_teams/fantasy_team_test.exs @@ -3,7 +3,8 @@ defmodule Ex338.FantasyTeamTest do use Ex338.DataCase, async: true - alias Ex338.{FantasyTeams.FantasyTeam, CalendarAssistant} + alias Ex338.CalendarAssistant + alias Ex338.FantasyTeams.FantasyTeam describe "add_current_slot_results" do test "adds current slot results to FantasyTeam struct" do diff --git a/test/ex338/fantasy_teams/standings_history_test.exs b/test/ex338/fantasy_teams/standings_history_test.exs index e7ae9f2c..15fa324c 100644 --- a/test/ex338/fantasy_teams/standings_history_test.exs +++ b/test/ex338/fantasy_teams/standings_history_test.exs @@ -1,6 +1,7 @@ defmodule Ex338.FantasyTeams.StandingsHistoryTest do use Ex338.DataCase, async: true - alias Ex338.{FantasyTeams.StandingsHistory} + + alias Ex338.FantasyTeams.StandingsHistory describe "get_dates_for_league/1" do test "returns list of dates with 1st of the month for a league" do diff --git a/test/ex338/fantasy_teams/standings_test.exs b/test/ex338/fantasy_teams/standings_test.exs index 63717edf..a8a2a6fe 100644 --- a/test/ex338/fantasy_teams/standings_test.exs +++ b/test/ex338/fantasy_teams/standings_test.exs @@ -1,6 +1,7 @@ defmodule Ex338.FantasyTeams.StandingsTest do use Ex338.DataCase, async: true - alias Ex338.{FantasyTeams.Standings} + + alias Ex338.FantasyTeams.Standings describe "rank_points_winnings_for_teams/1" do test "calculates points/winnings for teams & adds to FantasyTeam struct" do diff --git a/test/ex338/fantasy_teams_test.exs b/test/ex338/fantasy_teams_test.exs index 75b8ea96..3c222fbf 100644 --- a/test/ex338/fantasy_teams_test.exs +++ b/test/ex338/fantasy_teams_test.exs @@ -1,6 +1,8 @@ defmodule Ex338.FantasyTeamsTest do use Ex338.DataCase, async: true - alias Ex338.{FantasyTeams, FantasyTeams.Owner} + + alias Ex338.FantasyTeams + alias Ex338.FantasyTeams.Owner describe "count_pending_draft_queues/1" do test "returns number of pending draft queues for a team" do diff --git a/test/ex338/in_season_draft_picks/admin_test.exs b/test/ex338/in_season_draft_picks/admin_test.exs index 0fe33049..a784fd57 100644 --- a/test/ex338/in_season_draft_picks/admin_test.exs +++ b/test/ex338/in_season_draft_picks/admin_test.exs @@ -1,13 +1,10 @@ defmodule Ex338.InSeasonDraftPicks.AdminTest do use Ex338.DataCase, async: true - alias Ex338.{ - InSeasonDraftPicks.Admin, - RosterPositions.RosterPosition, - FantasyPlayers.FantasyPlayer - } - alias Ecto.Multi + alias Ex338.FantasyPlayers.FantasyPlayer + alias Ex338.InSeasonDraftPicks.Admin + alias Ex338.RosterPositions.RosterPosition describe "update/2" do test "with valid player, returns a multi with valid changeset" do diff --git a/test/ex338/in_season_draft_picks/clock_test.exs b/test/ex338/in_season_draft_picks/clock_test.exs index 91627f01..f29c6ec6 100644 --- a/test/ex338/in_season_draft_picks/clock_test.exs +++ b/test/ex338/in_season_draft_picks/clock_test.exs @@ -1,12 +1,10 @@ defmodule Ex338.InSeasonInSeasonDraftPicks.ClockTest do use Ex338.DataCase, async: true - alias Ex338.{ - CalendarAssistant, - Championships.Championship, - InSeasonDraftPicks.Clock, - InSeasonDraftPicks.InSeasonDraftPick - } + alias Ex338.CalendarAssistant + alias Ex338.Championships.Championship + alias Ex338.InSeasonDraftPicks.Clock + alias Ex338.InSeasonDraftPicks.InSeasonDraftPick describe "update_in_season_draft_picks/2" do test "1st pick not available before draft" do diff --git a/test/ex338/in_season_draft_picks/in_season_draft_pick_test.exs b/test/ex338/in_season_draft_picks/in_season_draft_pick_test.exs index 1af1957a..56362cbd 100644 --- a/test/ex338/in_season_draft_picks/in_season_draft_pick_test.exs +++ b/test/ex338/in_season_draft_picks/in_season_draft_pick_test.exs @@ -1,7 +1,9 @@ defmodule Ex338.InSeasonDraftPicks.InSeasonDraftPickTest do use Ex338.DataCase, async: true - alias Ex338.{InSeasonDraftPicks, InSeasonDraftPicks.InSeasonDraftPick, CalendarAssistant} + alias Ex338.CalendarAssistant + alias Ex338.InSeasonDraftPicks + alias Ex338.InSeasonDraftPicks.InSeasonDraftPick @valid_attrs %{position: 42, fantasy_league_id: 1, draft_pick_asset_id: 1, championship_id: 2} @invalid_attrs %{} diff --git a/test/ex338/in_season_draft_picks_test.exs b/test/ex338/in_season_draft_picks_test.exs index eb0e01c7..65442581 100644 --- a/test/ex338/in_season_draft_picks_test.exs +++ b/test/ex338/in_season_draft_picks_test.exs @@ -2,12 +2,10 @@ defmodule Ex338.InSeasonDraftPicksTest do use Ex338.DataCase, async: true use Oban.Testing, repo: Ex338.Repo - alias Ex338.{ - CalendarAssistant, - DraftQueues.DraftQueue, - InSeasonDraftPicks, - InSeasonDraftPicks.InSeasonDraftPick - } + alias Ex338.CalendarAssistant + alias Ex338.DraftQueues.DraftQueue + alias Ex338.InSeasonDraftPicks + alias Ex338.InSeasonDraftPicks.InSeasonDraftPick describe "pick_with_assocs/1" do test "returns in season draft picks with associations" do diff --git a/test/ex338/injured_reserves/injured_reserve_test.exs b/test/ex338/injured_reserves/injured_reserve_test.exs index 04e83014..ac8eab39 100644 --- a/test/ex338/injured_reserves/injured_reserve_test.exs +++ b/test/ex338/injured_reserves/injured_reserve_test.exs @@ -1,7 +1,7 @@ defmodule Ex338.InjuredReserves.InjuredReserveTest do use Ex338.DataCase, async: true - alias Ex338.{InjuredReserves.InjuredReserve} + alias Ex338.InjuredReserves.InjuredReserve describe "by_league/2" do test "returns injured reserve actions in a fantasy league" do diff --git a/test/ex338/injured_reserves_test.exs b/test/ex338/injured_reserves_test.exs index 7b0fe484..1c201081 100644 --- a/test/ex338/injured_reserves_test.exs +++ b/test/ex338/injured_reserves_test.exs @@ -1,12 +1,10 @@ defmodule Ex338.InjuredReservesTest do use Ex338.DataCase, async: true - alias Ex338.{ - CalendarAssistant, - InjuredReserves, - InjuredReserves.InjuredReserve, - RosterPositions.RosterPosition - } + alias Ex338.CalendarAssistant + alias Ex338.InjuredReserves + alias Ex338.InjuredReserves.InjuredReserve + alias Ex338.RosterPositions.RosterPosition describe "get_ir!" do test "returns the user with assocs for a given id" do diff --git a/test/ex338/jobs_test.exs b/test/ex338/jobs_test.exs index 0f45aabc..666bfd30 100644 --- a/test/ex338/jobs_test.exs +++ b/test/ex338/jobs_test.exs @@ -1,9 +1,9 @@ defmodule Ex338.JobsTest do use Ex338.DataCase, async: true - use Oban.Testing, repo: Ex338.Repo - alias Ex338.Jobs + alias Ex338.CalendarAssistant + alias Ex338.Jobs describe "get_autodraft_job_by/1" do test "starts autodraft for a championship and a fantasy_league" do @@ -25,7 +25,7 @@ defmodule Ex338.JobsTest do }) assert result.id == job.id - assert result.scheduled_at |> DateTime.truncate(:second) == five_mins + assert DateTime.truncate(result.scheduled_at, :second) == five_mins end) end end diff --git a/test/ex338/roster_positions/admin_test.exs b/test/ex338/roster_positions/admin_test.exs index e12b98b3..1fc5c1ba 100644 --- a/test/ex338/roster_positions/admin_test.exs +++ b/test/ex338/roster_positions/admin_test.exs @@ -1,6 +1,8 @@ defmodule Ex338.RosterPositions.AdminTest do use Ex338.DataCase, async: true - alias Ex338.{RosterPositions.Admin, FantasyTeams.FantasyTeam} + + alias Ex338.FantasyTeams.FantasyTeam + alias Ex338.RosterPositions.Admin describe "primary_positions/1" do test "it returns only sports positions" do diff --git a/test/ex338/roster_positions/ir_position_test.exs b/test/ex338/roster_positions/ir_position_test.exs index da6cf94c..6e60e72d 100644 --- a/test/ex338/roster_positions/ir_position_test.exs +++ b/test/ex338/roster_positions/ir_position_test.exs @@ -1,5 +1,6 @@ defmodule Ex338.RosterPositions.IRPositionTest do use Ex338.DataCase, async: true + alias Ex338.RosterPositions.IRPosition describe "separate_from_active_for_teams/1" do diff --git a/test/ex338/roster_positions/open_position_test.exs b/test/ex338/roster_positions/open_position_test.exs index 299da895..fbe1d1de 100644 --- a/test/ex338/roster_positions/open_position_test.exs +++ b/test/ex338/roster_positions/open_position_test.exs @@ -1,6 +1,7 @@ defmodule Ex338.RosterPositions.OpenPositionTest do use Ex338.DataCase, async: true - alias Ex338.{RosterPositions.OpenPosition} + + alias Ex338.RosterPositions.OpenPosition @league_positions [ "CL", diff --git a/test/ex338/roster_positions/roster_position_test.exs b/test/ex338/roster_positions/roster_position_test.exs index 34cd1852..281a4af0 100644 --- a/test/ex338/roster_positions/roster_position_test.exs +++ b/test/ex338/roster_positions/roster_position_test.exs @@ -1,7 +1,7 @@ defmodule Ex338.RosterPositionTest do use Ex338.DataCase, async: true - alias Ex338.{RosterPositions.RosterPosition} + alias Ex338.RosterPositions.RosterPosition describe "active_by_sports_league/2" do test "only returns active roster positions from a sport" do diff --git a/test/ex338/roster_positions_test.exs b/test/ex338/roster_positions_test.exs index 8a7dcbd2..38787816 100644 --- a/test/ex338/roster_positions_test.exs +++ b/test/ex338/roster_positions_test.exs @@ -1,6 +1,7 @@ defmodule Ex338.RosterPositionsTest do use Ex338.DataCase, async: true - alias Ex338.{RosterPositions} + + alias Ex338.RosterPositions describe "get_by/1" do test "fetches a single RosterPosition from the query" do diff --git a/test/ex338/trades/admin_test.exs b/test/ex338/trades/admin_test.exs index 310456c1..e6178ebe 100644 --- a/test/ex338/trades/admin_test.exs +++ b/test/ex338/trades/admin_test.exs @@ -1,15 +1,12 @@ defmodule Ex338.Trades.AdminTest do use Ex338.DataCase, async: true - alias Ex338.{ - DraftPicks, - Trades.Trade, - Trades.TradeLineItem, - RosterPositions.RosterPosition, - Trades.Admin - } - alias Ecto.Multi + alias Ex338.DraftPicks + alias Ex338.RosterPositions.RosterPosition + alias Ex338.Trades.Admin + alias Ex338.Trades.Trade + alias Ex338.Trades.TradeLineItem @trade %Trade{ status: "Pending", diff --git a/test/ex338/trades/trade_test.exs b/test/ex338/trades/trade_test.exs index 1f7d0c55..774eab08 100644 --- a/test/ex338/trades/trade_test.exs +++ b/test/ex338/trades/trade_test.exs @@ -1,7 +1,9 @@ defmodule Ex338.TradeTest do use Ex338.DataCase, async: true - alias Ex338.{FantasyTeams.FantasyTeam, Trades.Trade, Trades.TradeVote} + alias Ex338.FantasyTeams.FantasyTeam + alias Ex338.Trades.Trade + alias Ex338.Trades.TradeVote describe "by_league/2" do test "returns trades from a league" do diff --git a/test/ex338/trades_test.exs b/test/ex338/trades_test.exs index 5cfaac76..13424c2e 100644 --- a/test/ex338/trades_test.exs +++ b/test/ex338/trades_test.exs @@ -1,6 +1,9 @@ defmodule Ex338.TradesTest do use Ex338.DataCase, async: true - alias Ex338.{DraftPicks.FuturePick, Trades, Trades.TradeVote} + + alias Ex338.DraftPicks.FuturePick + alias Ex338.Trades + alias Ex338.Trades.TradeVote describe "all_for_league/2" do test "returns only trades from a league with most recent first" do diff --git a/test/ex338/uploader_test.exs b/test/ex338/uploader_test.exs index 20303fd5..2b5e273b 100644 --- a/test/ex338/uploader_test.exs +++ b/test/ex338/uploader_test.exs @@ -1,7 +1,10 @@ defmodule Ex338.UploaderTest do use Ex338.DataCase, async: true - alias Ex338.{FantasyPlayers.FantasyPlayer, FantasyTeams.FantasyTeam, Repo, Uploader} + alias Ex338.FantasyPlayers.FantasyPlayer + alias Ex338.FantasyTeams.FantasyTeam + alias Ex338.Repo + alias Ex338.Uploader describe "insert_from_csv/2" do test "inserts data from a csv into a fantasy team table" do diff --git a/test/ex338/validate_helpers_test.exs b/test/ex338/validate_helpers_test.exs index d46543d2..cd7b8c04 100644 --- a/test/ex338/validate_helpers_test.exs +++ b/test/ex338/validate_helpers_test.exs @@ -1,7 +1,7 @@ defmodule Ex338.ValidateHelpersTest do use Ex338.DataCase, async: true - alias Ex338.{ValidateHelpers} + alias Ex338.ValidateHelpers describe "slot_available/2" do test "returns false if too many flex spots in use" do diff --git a/test/ex338/waivers/admin_test.exs b/test/ex338/waivers/admin_test.exs index 88bfa20a..c18ecf11 100644 --- a/test/ex338/waivers/admin_test.exs +++ b/test/ex338/waivers/admin_test.exs @@ -1,7 +1,9 @@ defmodule Ex338.Waivers.AdminTest do use Ex338.DataCase, async: true - alias Ex338.{Waivers, Waivers.Waiver} + alias Ecto.Multi + alias Ex338.Waivers + alias Ex338.Waivers.Waiver @waiver %Waiver{ fantasy_team_id: 1, diff --git a/test/ex338/waivers/batch_process_test.exs b/test/ex338/waivers/batch_process_test.exs index b6dda6c5..d5b15696 100644 --- a/test/ex338/waivers/batch_process_test.exs +++ b/test/ex338/waivers/batch_process_test.exs @@ -1,7 +1,10 @@ defmodule Ex338.Waiver.BatchTest do use Ex338.DataCase, async: true - alias Ex338.{Waivers.Waiver, Waiver.Batch, FantasyTeams.FantasyTeam, CalendarAssistant} + alias Ex338.CalendarAssistant + alias Ex338.FantasyTeams.FantasyTeam + alias Ex338.Waiver.Batch + alias Ex338.Waivers.Waiver describe "group_and_sort/1" do test "groups waivers by fantasy league and add player" do diff --git a/test/ex338/waivers/waiver_test.exs b/test/ex338/waivers/waiver_test.exs index e438027f..6cd0b52c 100644 --- a/test/ex338/waivers/waiver_test.exs +++ b/test/ex338/waivers/waiver_test.exs @@ -1,9 +1,12 @@ defmodule Ex338.Waivers.WaiverTest do use Ex338.DataCase, async: true - alias Ex338.{Waivers.Waiver, FantasyTeams.FantasyTeam, CalendarAssistant} import Ecto.Changeset + alias Ex338.CalendarAssistant + alias Ex338.FantasyTeams.FantasyTeam + alias Ex338.Waivers.Waiver + describe "build_new_changeset" do test "builds a new_changeset from a fantasy team struct" do team = %FantasyTeam{id: 1} diff --git a/test/ex338/waivers_test.exs b/test/ex338/waivers_test.exs index 3f73afc1..dda2b89a 100644 --- a/test/ex338/waivers_test.exs +++ b/test/ex338/waivers_test.exs @@ -1,7 +1,10 @@ defmodule Ex338.WaiversTest do use Ex338.DataCase, async: true - alias Ex338.{Waivers.Waiver, Waivers, CalendarAssistant, RosterPositions.RosterPosition} + alias Ex338.CalendarAssistant + alias Ex338.RosterPositions.RosterPosition + alias Ex338.Waivers + alias Ex338.Waivers.Waiver describe "create_waiver" do test "creates a waiver" do diff --git a/test/ex338/workers/in_season_autodraft_worker_test.exs b/test/ex338/workers/in_season_autodraft_worker_test.exs index 8b57cadf..4402806b 100644 --- a/test/ex338/workers/in_season_autodraft_worker_test.exs +++ b/test/ex338/workers/in_season_autodraft_worker_test.exs @@ -1,9 +1,8 @@ defmodule Ex338.Workers.InSeasonAutodraftWorkerTest do use Ex338.DataCase, async: true - use Oban.Testing, repo: Ex338.Repo - alias Ex338.{CalendarAssistant} + alias Ex338.CalendarAssistant describe "perform/1" do test "starts autodraft for a championship and a fantasy_league" do diff --git a/test/ex338_web/controllers/championship_controller_test.exs b/test/ex338_web/controllers/championship_controller_test.exs index a5cc75e4..721bd288 100644 --- a/test/ex338_web/controllers/championship_controller_test.exs +++ b/test/ex338_web/controllers/championship_controller_test.exs @@ -1,8 +1,10 @@ defmodule Ex338Web.ChampionshipControllerTest do use Ex338Web.ConnCase + import Phoenix.LiveViewTest - alias Ex338.{CalendarAssistant, InSeasonDraftPicks} + alias Ex338.CalendarAssistant + alias Ex338.InSeasonDraftPicks describe "index/2" do test "lists all championships", %{conn: conn} do diff --git a/test/ex338_web/controllers/championship_slot_admin_test.exs b/test/ex338_web/controllers/championship_slot_admin_test.exs index bd0ddbac..8f6358b3 100644 --- a/test/ex338_web/controllers/championship_slot_admin_test.exs +++ b/test/ex338_web/controllers/championship_slot_admin_test.exs @@ -1,6 +1,8 @@ defmodule Ex338Web.ChampionshipSlotAdminControllerTest do use Ex338Web.ConnCase - alias Ex338.{Championships.ChampionshipSlot, Accounts.User} + + alias Ex338.Accounts.User + alias Ex338.Championships.ChampionshipSlot setup %{conn: conn} do user = %User{name: "test", email: "test@example.com", id: 1} diff --git a/test/ex338_web/controllers/commish_email_controller_test.exs b/test/ex338_web/controllers/commish_email_controller_test.exs index 1af8eae1..d2686fce 100644 --- a/test/ex338_web/controllers/commish_email_controller_test.exs +++ b/test/ex338_web/controllers/commish_email_controller_test.exs @@ -1,8 +1,10 @@ defmodule Ex338Web.CommishEmailControllerTest do use Ex338Web.ConnCase + import Swoosh.TestAssertions - alias Ex338.{Accounts.User} - alias Ex338Web.{EmailTemplate} + + alias Ex338.Accounts.User + alias Ex338Web.EmailTemplate setup %{conn: conn} do user = %User{name: "test", email: "test@example.com", id: 1} diff --git a/test/ex338_web/controllers/draft_pick_controller_index_test.exs b/test/ex338_web/controllers/draft_pick_controller_index_test.exs index 1ba98d10..deca94f9 100644 --- a/test/ex338_web/controllers/draft_pick_controller_index_test.exs +++ b/test/ex338_web/controllers/draft_pick_controller_index_test.exs @@ -1,8 +1,9 @@ defmodule Ex338Web.DraftPickControllerIndexTest do use Ex338Web.ConnCase + import Phoenix.LiveViewTest - alias Ex338.{DraftPicks} + alias Ex338.DraftPicks describe "index/2" do test "lists all draft picks in a league and updates new pick", %{conn: conn} do diff --git a/test/ex338_web/controllers/draft_pick_controller_test.exs b/test/ex338_web/controllers/draft_pick_controller_test.exs index 1cca4acd..eed9effe 100644 --- a/test/ex338_web/controllers/draft_pick_controller_test.exs +++ b/test/ex338_web/controllers/draft_pick_controller_test.exs @@ -1,11 +1,9 @@ defmodule Ex338Web.DraftPickControllerTest do use Ex338Web.ConnCase - alias Ex338.{ - Accounts.User, - DraftPicks.DraftPick, - DraftQueues.DraftQueue - } + alias Ex338.Accounts.User + alias Ex338.DraftPicks.DraftPick + alias Ex338.DraftQueues.DraftQueue setup %{conn: conn} do user = %User{name: "test", email: "test@example.com", id: 1} diff --git a/test/ex338_web/controllers/draft_queue_controller_test.exs b/test/ex338_web/controllers/draft_queue_controller_test.exs index e86e68b3..4a44f933 100644 --- a/test/ex338_web/controllers/draft_queue_controller_test.exs +++ b/test/ex338_web/controllers/draft_queue_controller_test.exs @@ -1,7 +1,8 @@ defmodule Ex338Web.DraftQueueControllerTest do use Ex338Web.ConnCase - alias Ex338.{Accounts.User, DraftQueues.DraftQueue} + alias Ex338.Accounts.User + alias Ex338.DraftQueues.DraftQueue setup %{conn: conn} do user = %User{name: "test", email: "test@example.com", id: 1} diff --git a/test/ex338_web/controllers/fantasy_team_update_controller_test.exs b/test/ex338_web/controllers/fantasy_team_update_controller_test.exs index 9b0080fa..2d7170c9 100644 --- a/test/ex338_web/controllers/fantasy_team_update_controller_test.exs +++ b/test/ex338_web/controllers/fantasy_team_update_controller_test.exs @@ -1,12 +1,10 @@ defmodule Ex338Web.FantasyTeamUpdateControllerTest do use Ex338Web.ConnCase - alias Ex338.{ - Accounts.User, - FantasyTeams.FantasyTeam, - DraftQueues.DraftQueue, - RosterPositions.RosterPosition - } + alias Ex338.Accounts.User + alias Ex338.DraftQueues.DraftQueue + alias Ex338.FantasyTeams.FantasyTeam + alias Ex338.RosterPositions.RosterPosition setup %{conn: conn} do user = %User{name: "test", email: "test@example.com", id: 1} diff --git a/test/ex338_web/controllers/in_season_draft_order_controller_test.exs b/test/ex338_web/controllers/in_season_draft_order_controller_test.exs index 90cd4578..8f539f2a 100644 --- a/test/ex338_web/controllers/in_season_draft_order_controller_test.exs +++ b/test/ex338_web/controllers/in_season_draft_order_controller_test.exs @@ -1,6 +1,8 @@ defmodule Ex338Web.InSeasonDraftOrderControllerTest do use Ex338Web.ConnCase - alias Ex338.{InSeasonDraftPicks.InSeasonDraftPick, Accounts.User} + + alias Ex338.Accounts.User + alias Ex338.InSeasonDraftPicks.InSeasonDraftPick setup %{conn: conn} do user = %User{name: "test", email: "test@example.com", id: 1} diff --git a/test/ex338_web/controllers/in_season_draft_pick_controller_test.exs b/test/ex338_web/controllers/in_season_draft_pick_controller_test.exs index b90cc658..5feff0e0 100644 --- a/test/ex338_web/controllers/in_season_draft_pick_controller_test.exs +++ b/test/ex338_web/controllers/in_season_draft_pick_controller_test.exs @@ -1,12 +1,10 @@ defmodule Ex338Web.InSeasonDraftPickControllerTest do use Ex338Web.ConnCase - alias Ex338.{ - Accounts.User, - Repo, - InSeasonDraftPicks.InSeasonDraftPick, - DraftQueues.DraftQueue - } + alias Ex338.Accounts.User + alias Ex338.DraftQueues.DraftQueue + alias Ex338.InSeasonDraftPicks.InSeasonDraftPick + alias Ex338.Repo setup %{conn: conn} do user = %User{name: "test", email: "test@example.com", id: 1} diff --git a/test/ex338_web/controllers/injured_reserve_controller_test.exs b/test/ex338_web/controllers/injured_reserve_controller_test.exs index 6f3451ea..2cae984e 100644 --- a/test/ex338_web/controllers/injured_reserve_controller_test.exs +++ b/test/ex338_web/controllers/injured_reserve_controller_test.exs @@ -1,6 +1,9 @@ defmodule Ex338Web.InjuredReserveControllerTest do use Ex338Web.ConnCase - alias Ex338.{Accounts.User, CalendarAssistant, InjuredReserves.InjuredReserve} + + alias Ex338.Accounts.User + alias Ex338.CalendarAssistant + alias Ex338.InjuredReserves.InjuredReserve setup %{conn: conn} do user = %User{name: "test", email: "test@example.com", id: 1} diff --git a/test/ex338_web/controllers/page_controller_test.exs b/test/ex338_web/controllers/page_controller_test.exs index 0bf9848b..ce843d1c 100644 --- a/test/ex338_web/controllers/page_controller_test.exs +++ b/test/ex338_web/controllers/page_controller_test.exs @@ -1,5 +1,6 @@ defmodule Ex338Web.PageControllerTest do use Ex338Web.ConnCase + import Phoenix.LiveViewTest describe "GET /" do diff --git a/test/ex338_web/controllers/table_upload_controller_test.exs b/test/ex338_web/controllers/table_upload_controller_test.exs index 1fde71b4..8ad30fb0 100644 --- a/test/ex338_web/controllers/table_upload_controller_test.exs +++ b/test/ex338_web/controllers/table_upload_controller_test.exs @@ -1,7 +1,8 @@ defmodule Ex338Web.TableUploadControllerTest do use Ex338Web.ConnCase - alias Ex338.{FantasyTeams.FantasyTeam, Accounts.User} + alias Ex338.Accounts.User + alias Ex338.FantasyTeams.FantasyTeam setup %{conn: conn} do user = %User{name: "test", email: "test@example.com", id: 1} diff --git a/test/ex338_web/controllers/trade_controller_test.exs b/test/ex338_web/controllers/trade_controller_test.exs index 1040560f..c665c05c 100644 --- a/test/ex338_web/controllers/trade_controller_test.exs +++ b/test/ex338_web/controllers/trade_controller_test.exs @@ -3,7 +3,9 @@ defmodule Ex338Web.TradeControllerTest do import Swoosh.TestAssertions - alias Ex338.{DraftPicks, Trades.Trade, Trades.TradeVote} + alias Ex338.DraftPicks + alias Ex338.Trades.Trade + alias Ex338.Trades.TradeVote setup %{conn: conn} do user = %Ex338.Accounts.User{name: "test", email: "test@example.com", id: 1} diff --git a/test/ex338_web/controllers/trade_vote_controller_test.exs b/test/ex338_web/controllers/trade_vote_controller_test.exs index 0c4ea485..004bad9b 100644 --- a/test/ex338_web/controllers/trade_vote_controller_test.exs +++ b/test/ex338_web/controllers/trade_vote_controller_test.exs @@ -1,7 +1,12 @@ defmodule Ex338Web.TradeVoteControllerTest do use Ex338Web.ConnCase + import Swoosh.TestAssertions - alias Ex338.{Trades.Trade, Trades.TradeVote, Repo, Accounts.User} + + alias Ex338.Accounts.User + alias Ex338.Repo + alias Ex338.Trades.Trade + alias Ex338.Trades.TradeVote setup %{conn: conn} do user = %User{name: "test", email: "test@example.com", id: 1} diff --git a/test/ex338_web/controllers/user_controller_test.exs b/test/ex338_web/controllers/user_controller_test.exs index 16e4c21b..8ae11c30 100644 --- a/test/ex338_web/controllers/user_controller_test.exs +++ b/test/ex338_web/controllers/user_controller_test.exs @@ -1,7 +1,8 @@ defmodule Ex338Web.UserControllerTest do use Ex338Web.ConnCase - alias Ex338.{Repo, Accounts.User} + alias Ex338.Accounts.User + alias Ex338.Repo setup %{conn: conn} do user = insert(:user, name: "Brown", email: "test@example.com") diff --git a/test/ex338_web/controllers/waiver_admin_controller_test.exs b/test/ex338_web/controllers/waiver_admin_controller_test.exs index 2e0dad6c..859dc9f5 100644 --- a/test/ex338_web/controllers/waiver_admin_controller_test.exs +++ b/test/ex338_web/controllers/waiver_admin_controller_test.exs @@ -1,12 +1,10 @@ defmodule Ex338Web.WaiverAdminControllerTest do use Ex338Web.ConnCase - alias Ex338.{ - Waivers.Waiver, - Accounts.User, - RosterPositions.RosterPosition, - FantasyTeams.FantasyTeam - } + alias Ex338.Accounts.User + alias Ex338.FantasyTeams.FantasyTeam + alias Ex338.RosterPositions.RosterPosition + alias Ex338.Waivers.Waiver setup %{conn: conn} do user = %User{name: "test", email: "test@example.com", id: 1} diff --git a/test/ex338_web/controllers/waiver_controller_test.exs b/test/ex338_web/controllers/waiver_controller_test.exs index 0480e361..2dfe0d3a 100644 --- a/test/ex338_web/controllers/waiver_controller_test.exs +++ b/test/ex338_web/controllers/waiver_controller_test.exs @@ -1,6 +1,10 @@ defmodule Ex338Web.WaiverControllerTest do use Ex338Web.ConnCase - alias Ex338.{Waivers.Waiver, Accounts.User, RosterPositions.RosterPosition, CalendarAssistant} + + alias Ex338.Accounts.User + alias Ex338.CalendarAssistant + alias Ex338.RosterPositions.RosterPosition + alias Ex338.Waivers.Waiver setup %{conn: conn} do user = %User{name: "test", email: "test@example.com", id: 1} diff --git a/test/ex338_web/live/commish/fantasy_league_live_test.exs b/test/ex338_web/live/commish/fantasy_league_live_test.exs index 3ac1bd6b..5f27bfbd 100644 --- a/test/ex338_web/live/commish/fantasy_league_live_test.exs +++ b/test/ex338_web/live/commish/fantasy_league_live_test.exs @@ -3,7 +3,7 @@ defmodule Ex338Web.Commish.FantasyLeagueLiveTest do import Phoenix.LiveViewTest - alias Ex338.{Accounts.User} + alias Ex338.Accounts.User setup %{conn: conn} do user = %User{name: "test", email: "test@example.com", id: 1} diff --git a/test/ex338_web/mailer_test.exs b/test/ex338_web/mailer_test.exs index b2e7ae7b..91406344 100644 --- a/test/ex338_web/mailer_test.exs +++ b/test/ex338_web/mailer_test.exs @@ -2,10 +2,11 @@ defmodule Ex338Web.MailerTest do use Ex338.DataCase, async: true import ExUnit.CaptureLog - require Logger alias Ex338Web.Mailer + require Logger + describe "handle_delivery/1" do test "logs an error email" do delivery = {:error, {:error, "reason"}} diff --git a/test/ex338_web/plugs/canonical_domain_test.exs b/test/ex338_web/plugs/canonical_domain_test.exs index 97a45f7a..60a75717 100644 --- a/test/ex338_web/plugs/canonical_domain_test.exs +++ b/test/ex338_web/plugs/canonical_domain_test.exs @@ -2,7 +2,7 @@ defmodule Ex338Web.CanonicalDomainTest do use Ex338Web.ConnCase use Plug.Test - alias Ex338Web.{CanonicalDomain} + alias Ex338Web.CanonicalDomain @opts CanonicalDomain.init([]) diff --git a/test/ex338_web/plugs/load_leagues_test.exs b/test/ex338_web/plugs/load_leagues_test.exs index 952b0a31..81a4aabb 100644 --- a/test/ex338_web/plugs/load_leagues_test.exs +++ b/test/ex338_web/plugs/load_leagues_test.exs @@ -2,7 +2,7 @@ defmodule Ex338Web.LoadLeaguesTest do use Ex338Web.ConnCase use Plug.Test - alias Ex338Web.{LoadLeagues} + alias Ex338Web.LoadLeagues @opts LoadLeagues.init([]) diff --git a/test/ex338_web/plugs/load_user_teams_test.exs b/test/ex338_web/plugs/load_user_teams_test.exs index c1e20861..07671621 100644 --- a/test/ex338_web/plugs/load_user_teams_test.exs +++ b/test/ex338_web/plugs/load_user_teams_test.exs @@ -2,7 +2,7 @@ defmodule Ex338Web.LoadUserTeamsTest do use Ex338Web.ConnCase use Plug.Test - alias Ex338Web.{LoadUserTeams} + alias Ex338Web.LoadUserTeams @opts LoadUserTeams.init([]) @@ -13,8 +13,7 @@ defmodule Ex338Web.LoadUserTeamsTest do insert(:owner, fantasy_team: team, user: user) conn = - build_conn() - |> assign(:current_user, user) + assign(build_conn(), :current_user, user) conn = LoadUserTeams.call(conn, @opts) diff --git a/test/ex338_web/pow/pow_redis_cache_test.exs b/test/ex338_web/pow/pow_redis_cache_test.exs index e60e9000..87b8305a 100644 --- a/test/ex338_web/pow/pow_redis_cache_test.exs +++ b/test/ex338_web/pow/pow_redis_cache_test.exs @@ -1,9 +1,10 @@ defmodule Ex338Web.Pow.RedisCacheTest do use ExUnit.Case - doctest Ex338Web.Pow.RedisCache alias Ex338Web.Pow.RedisCache + doctest Ex338Web.Pow.RedisCache + @default_config [namespace: "test", ttl: :timer.hours(1)] setup do diff --git a/test/ex338_web/views/championship_view_test.exs b/test/ex338_web/views/championship_view_test.exs index 1a1cfc3b..eb9941a1 100644 --- a/test/ex338_web/views/championship_view_test.exs +++ b/test/ex338_web/views/championship_view_test.exs @@ -3,14 +3,11 @@ defmodule Ex338Web.ChampionshipViewTest do import Phoenix.LiveViewTest - alias Ex338.{ - Accounts.User, - Championships.Championship, - Championships.ChampionshipSlot, - InSeasonDraftPicks.InSeasonDraftPick - } - - alias Ex338Web.{ChampionshipView} + alias Ex338.Accounts.User + alias Ex338.Championships.Championship + alias Ex338.Championships.ChampionshipSlot + alias Ex338.InSeasonDraftPicks.InSeasonDraftPick + alias Ex338Web.ChampionshipView describe "get_team_name/1" do test "returns name from a fantasy team struct" do @@ -79,7 +76,7 @@ defmodule Ex338Web.ChampionshipViewTest do result = ChampionshipView.display_drafted_at_or_pick_due_at(pick) - assert result |> rendered_to_string() =~ " 3:30:40 PM" + assert rendered_to_string(result) =~ " 3:30:40 PM" end test "returns dashes if already picked but no drafted_at data" do diff --git a/test/ex338_web/views/commish_email_view_test.exs b/test/ex338_web/views/commish_email_view_test.exs index 2f2210de..ac80fd97 100644 --- a/test/ex338_web/views/commish_email_view_test.exs +++ b/test/ex338_web/views/commish_email_view_test.exs @@ -1,6 +1,7 @@ defmodule Ex338Web.CommishEmailViewTest do use Ex338Web.ConnCase, async: true - alias Ex338Web.{CommishEmailView} + + alias Ex338Web.CommishEmailView describe "format_leagues_for_select/1" do test "formats leagues for multiple select in form" do diff --git a/test/ex338_web/views/draft_pick_view_test.exs b/test/ex338_web/views/draft_pick_view_test.exs index 175c98a3..28be9b95 100644 --- a/test/ex338_web/views/draft_pick_view_test.exs +++ b/test/ex338_web/views/draft_pick_view_test.exs @@ -1,6 +1,7 @@ defmodule Ex338Web.DraftPickViewTest do use Ex338Web.ConnCase, async: true - alias Ex338Web.{DraftPickView} + + alias Ex338Web.DraftPickView describe "current_picks/2" do test "returns last picks if no picks remaining" do diff --git a/test/ex338_web/views/email_view_test.exs b/test/ex338_web/views/email_view_test.exs index 18eea829..162e514f 100644 --- a/test/ex338_web/views/email_view_test.exs +++ b/test/ex338_web/views/email_view_test.exs @@ -1,7 +1,7 @@ defmodule Ex338Web.EmailViewTest do use Ex338Web.ConnCase, async: true - alias Ex338Web.{EmailView} + alias Ex338Web.EmailView describe "display_player/1" do test "returns trimmed player name and abbrev" do diff --git a/test/ex338_web/views/fantasy_team_view_test.exs b/test/ex338_web/views/fantasy_team_view_test.exs index 9b8bcd9e..9604597f 100644 --- a/test/ex338_web/views/fantasy_team_view_test.exs +++ b/test/ex338_web/views/fantasy_team_view_test.exs @@ -1,7 +1,8 @@ defmodule Ex338Web.FantasyTeamViewTest do use Ex338Web.ConnCase, async: true - alias Ex338.{FantasyLeagues.FantasyLeague} - alias Ex338Web.{FantasyTeamView} + + alias Ex338.FantasyLeagues.FantasyLeague + alias Ex338Web.FantasyTeamView describe "display_autodraft_setting" do test "capitalizes on & off" do diff --git a/test/ex338_web/views/in_season_draft_pick_view_test.exs b/test/ex338_web/views/in_season_draft_pick_view_test.exs index 9b280414..94dbddd4 100644 --- a/test/ex338_web/views/in_season_draft_pick_view_test.exs +++ b/test/ex338_web/views/in_season_draft_pick_view_test.exs @@ -1,7 +1,8 @@ defmodule Ex338Web.InSeasonDraftPickViewTest do use Ex338Web.ConnCase, async: true - alias Ex338.{FantasyPlayers.FantasyPlayer} - alias Ex338Web.{InSeasonDraftPickView} + + alias Ex338.FantasyPlayers.FantasyPlayer + alias Ex338Web.InSeasonDraftPickView describe "format_players_as_options/1" do test "returns a list of tuples with player names and ids" do diff --git a/test/ex338_web/views/layout_view_test.exs b/test/ex338_web/views/layout_view_test.exs index 2dd81ab4..38134e73 100644 --- a/test/ex338_web/views/layout_view_test.exs +++ b/test/ex338_web/views/layout_view_test.exs @@ -1,8 +1,8 @@ defmodule Ex338Web.LayoutViewTest do use Ex338Web.ConnCase, async: true + alias Ex338.FantasyLeagues.FantasyLeague alias Ex338Web.LayoutView - alias Ex338.{FantasyLeagues.FantasyLeague} @leagues [ %FantasyLeague{ diff --git a/test/ex338_web/views/trade_view_test.exs b/test/ex338_web/views/trade_view_test.exs index 6dc8871c..5cae6c2e 100644 --- a/test/ex338_web/views/trade_view_test.exs +++ b/test/ex338_web/views/trade_view_test.exs @@ -1,8 +1,11 @@ defmodule Ex338Web.TradeViewTest do use Ex338Web.ConnCase, async: true + alias Ex338.Accounts.User + alias Ex338.FantasyTeams.FantasyTeam + alias Ex338.Trades.Trade + alias Ex338.Trades.TradeLineItem alias Ex338Web.TradeView - alias Ex338.{FantasyTeams.FantasyTeam, Trades.Trade, Trades.TradeLineItem, Accounts.User} describe "allow_vote?/2" do test "returns true if team can still vote" do diff --git a/test/ex338_web/views/user_view_test.exs b/test/ex338_web/views/user_view_test.exs index 673c657a..63d7991e 100644 --- a/test/ex338_web/views/user_view_test.exs +++ b/test/ex338_web/views/user_view_test.exs @@ -1,9 +1,8 @@ defmodule Ex338Web.UserViewTest do use Ex338Web.ConnCase, async: true - alias Ex338Web.UserView - alias Ex338.Accounts.User + alias Ex338Web.UserView describe "user_profile_image/1" do test "returns an image tag with the gravatar link" do diff --git a/test/ex338_web/views/view_helpers_test.exs b/test/ex338_web/views/view_helpers_test.exs index 6d0c5676..0554cc82 100644 --- a/test/ex338_web/views/view_helpers_test.exs +++ b/test/ex338_web/views/view_helpers_test.exs @@ -1,19 +1,16 @@ defmodule Ex338Web.ViewHelpersViewTest do use Ex338Web.ConnCase, async: true - alias Ex338.{ - Accounts.User, - DraftPicks.DraftPick, - FantasyPlayers.SportsLeague, - FantasyPlayers.FantasyPlayer, - FantasyTeams.FantasyTeam, - InSeasonDraftPicks.InSeasonDraftPick, - FantasyTeams.Owner, - RosterPositions.RosterPosition, - Waivers.Waiver - } - - alias Ex338Web.{ViewHelpers} + alias Ex338.Accounts.User + alias Ex338.DraftPicks.DraftPick + alias Ex338.FantasyPlayers.FantasyPlayer + alias Ex338.FantasyPlayers.SportsLeague + alias Ex338.FantasyTeams.FantasyTeam + alias Ex338.FantasyTeams.Owner + alias Ex338.InSeasonDraftPicks.InSeasonDraftPick + alias Ex338.RosterPositions.RosterPosition + alias Ex338.Waivers.Waiver + alias Ex338Web.ViewHelpers describe "admin?/1" do test "returns false if no user" do diff --git a/test/ex338_web/views/waiver_view_test.exs b/test/ex338_web/views/waiver_view_test.exs index 3652326c..7bd995b9 100644 --- a/test/ex338_web/views/waiver_view_test.exs +++ b/test/ex338_web/views/waiver_view_test.exs @@ -1,7 +1,9 @@ defmodule Ex338Web.WaiverViewTest do use Ex338Web.ConnCase, async: true - alias Ex338.{CalendarAssistant, Waivers.Waiver} - alias Ex338Web.{WaiverView} + + alias Ex338.CalendarAssistant + alias Ex338.Waivers.Waiver + alias Ex338Web.WaiverView describe "sort_most_recent/1" do test "returns struct sorted by most recent first" do diff --git a/test/support/channel_case.ex b/test/support/channel_case.ex index 5a5d504e..c256f2cc 100644 --- a/test/support/channel_case.ex +++ b/test/support/channel_case.ex @@ -20,11 +20,12 @@ defmodule Ex338Web.ChannelCase do # Import conveniences for testing with channels use Phoenix.ChannelTest - alias Ex338.Repo import Ecto import Ecto.Changeset import Ecto.Query + alias Ex338.Repo + # The default endpoint for testing @endpoint Ex338Web.Endpoint end diff --git a/test/support/conn_case.ex b/test/support/conn_case.ex index 606e6cc1..8c4bcc63 100644 --- a/test/support/conn_case.ex +++ b/test/support/conn_case.ex @@ -18,18 +18,15 @@ defmodule Ex338Web.ConnCase do using do quote do # Import conveniences for testing with connections - import Plug.Conn - import Phoenix.ConnTest - - alias Ex338.Repo import Ecto import Ecto.Changeset import Ecto.Query - - import Ex338Web.Router.Helpers - import Ex338.Factory + import Ex338Web.Router.Helpers + import Phoenix.ConnTest + import Plug.Conn + alias Ex338.Repo alias Phoenix.Flash # The default endpoint for testing diff --git a/test/support/data_case.ex b/test/support/data_case.ex index b748e391..18186061 100644 --- a/test/support/data_case.ex +++ b/test/support/data_case.ex @@ -18,13 +18,13 @@ defmodule Ex338.DataCase do using do quote do - alias Ex338.Repo - import Ecto import Ecto.Changeset import Ecto.Query import Ex338.DataCase import Ex338.Factory + + alias Ex338.Repo end end @@ -61,7 +61,8 @@ defmodule Ex338.DataCase do true """ def errors_on(struct, data) do - struct.__struct__.changeset(struct, data) + struct + |> struct.__struct__.changeset(data) |> Ecto.Changeset.traverse_errors(&Ex338Web.ErrorHelpers.translate_error/1) |> Enum.flat_map(fn {key, errors} -> for msg <- errors, do: {key, msg} end) end diff --git a/test/support/factory.ex b/test/support/factory.ex index a27535ae..5c16a904 100644 --- a/test/support/factory.ex +++ b/test/support/factory.ex @@ -5,7 +5,9 @@ defmodule Ex338.Factory do use ExMachina.Ecto, repo: Ex338.Repo - alias Ex338.{Accounts.User, Repo, CalendarAssistant} + alias Ex338.Accounts.User + alias Ex338.CalendarAssistant + alias Ex338.Repo def championship_factory do %Ex338.Championships.Championship{ From f8c5e2792f0e2f38a5ede4eff7167afb96e2b1cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jul 2023 03:53:04 +0000 Subject: [PATCH 06/18] Bump phoenix_live_view from 0.19.4 to 0.19.5 Bumps [phoenix_live_view](https://github.com/phoenixframework/phoenix_live_view) from 0.19.4 to 0.19.5. - [Changelog](https://github.com/phoenixframework/phoenix_live_view/blob/main/CHANGELOG.md) - [Commits](https://github.com/phoenixframework/phoenix_live_view/compare/v0.19.4...v0.19.5) --- updated-dependencies: - dependency-name: phoenix_live_view dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- mix.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix.lock b/mix.lock index 1aa584fc..b4227656 100644 --- a/mix.lock +++ b/mix.lock @@ -46,7 +46,7 @@ "phoenix_html": {:hex, :phoenix_html, "3.3.3", "380b8fb45912b5638d2f1d925a3771b4516b9a78587249cabe394e0a5d579dc9", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "923ebe6fec6e2e3b3e569dfbdc6560de932cd54b000ada0208b5f45024bdd76c"}, "phoenix_live_dashboard": {:hex, :phoenix_live_dashboard, "0.8.0", "0b3158b5b198aa444473c91d23d79f52fb077e807ffad80dacf88ce078fa8df2", [:mix], [{:ecto, "~> 3.6.2 or ~> 3.7", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_mysql_extras, "~> 0.5", [hex: :ecto_mysql_extras, repo: "hexpm", optional: true]}, {:ecto_psql_extras, "~> 0.7", [hex: :ecto_psql_extras, repo: "hexpm", optional: true]}, {:ecto_sqlite3_extras, "~> 1.1.7", [hex: :ecto_sqlite3_extras, repo: "hexpm", optional: true]}, {:mime, "~> 1.6 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.19.0", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.6 or ~> 1.0", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "87785a54474fed91a67a1227a741097eb1a42c2e49d3c0d098b588af65cd410d"}, "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.3.3", "3a53772a6118d5679bf50fc1670505a290e32a1d195df9e069d8c53ab040c054", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "766796676e5f558dbae5d1bdb066849673e956005e3730dfd5affd7a6da4abac"}, - "phoenix_live_view": {:hex, :phoenix_live_view, "0.19.4", "dd9ffe3ca0683bdef4f340bcdd2c35a6ee0d581a2696033fc25f52e742618bdc", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "fd2c666d227476d63af7b8c20e6e61d16f07eb49f924cf4198fca7668156f15b"}, + "phoenix_live_view": {:hex, :phoenix_live_view, "0.19.5", "6e730595e8e9b8c5da230a814e557768828fd8dfeeb90377d2d8dbb52d4ec00a", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "b2eaa0dd3cfb9bd7fb949b88217df9f25aed915e986a28ad5c8a0d054e7ca9d3"}, "phoenix_markdown": {:hex, :phoenix_markdown, "1.0.3", "8095c40dd5037f4b56079ad66de3fe9136406c7c44e1222ce3c74d22e4c7870a", [:mix], [{:earmark, "~> 1.2", [hex: :earmark, repo: "hexpm", optional: false]}, {:html_entities, "~> 0.4", [hex: :html_entities, repo: "hexpm", optional: false]}, {:phoenix, ">= 1.1.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, ">= 2.3.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}], "hexpm", "d3591c4cb3357b068cc8284952dbacedb874b287add27787eea2d1d314b18c16"}, "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.3", "3168d78ba41835aecad272d5e8cd51aa87a7ac9eb836eabc42f6e57538e3731d", [:mix], [], "hexpm", "bba06bc1dcfd8cb086759f0edc94a8ba2bc8896d5331a1e2c2902bf8e36ee502"}, "phoenix_pubsub_redis": {:hex, :phoenix_pubsub_redis, "3.0.1", "d4d856b1e57a21358e448543e1d091e07e83403dde4383b8be04ed9d2c201cbc", [:mix], [{:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5.1 or ~> 1.6", [hex: :poolboy, repo: "hexpm", optional: false]}, {:redix, "~> 0.10.0 or ~> 1.0", [hex: :redix, repo: "hexpm", optional: false]}], "hexpm", "0b36a17ff6e9a56159f8df8933d62b5c1f0695eae995a02e0c86c035ace6a309"}, From c870b355196d9e407c739a9398c4395b2fdc53dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Aug 2023 03:10:34 +0000 Subject: [PATCH 07/18] Bump gettext from 0.22.2 to 0.23.1 Bumps [gettext](https://github.com/elixir-gettext/gettext) from 0.22.2 to 0.23.1. - [Changelog](https://github.com/elixir-gettext/gettext/blob/main/CHANGELOG.md) - [Commits](https://github.com/elixir-gettext/gettext/compare/v0.22.2...v0.23.1) --- updated-dependencies: - dependency-name: gettext dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- mix.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix.lock b/mix.lock index b4227656..c1e5ed33 100644 --- a/mix.lock +++ b/mix.lock @@ -24,7 +24,7 @@ "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, "floki": {:hex, :floki, "0.34.3", "5e2dcaec5d7c228ce5b1d3501502e308b2d79eb655e4191751a1fe491c37feac", [:mix], [], "hexpm", "9577440eea5b97924b4bf3c7ea55f7b8b6dce589f9b28b096cc294a8dc342341"}, "gen_smtp": {:hex, :gen_smtp, "1.2.0", "9cfc75c72a8821588b9b9fe947ae5ab2aed95a052b81237e0928633a13276fd3", [:rebar3], [{:ranch, ">= 1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "5ee0375680bca8f20c4d85f58c2894441443a743355430ff33a783fe03296779"}, - "gettext": {:hex, :gettext, "0.22.2", "6bfca374de34ecc913a28ba391ca184d88d77810a3e427afa8454a71a51341ac", [:mix], [{:expo, "~> 0.4.0", [hex: :expo, repo: "hexpm", optional: false]}], "hexpm", "8a2d389673aea82d7eae387e6a2ccc12660610080ae7beb19452cfdc1ec30f60"}, + "gettext": {:hex, :gettext, "0.23.1", "821e619a240e6000db2fc16a574ef68b3bd7fe0167ccc264a81563cc93e67a31", [:mix], [{:expo, "~> 0.4.0", [hex: :expo, repo: "hexpm", optional: false]}], "hexpm", "19d744a36b809d810d610b57c27b934425859d158ebd56561bc41f7eeb8795db"}, "hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~>2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"}, "honeybadger": {:hex, :honeybadger, "0.20.0", "fb687c9a472e8e19727367a23d718a713a6bbb2b894aa598f402309bb0fcb10a", [:mix], [{:ecto, ">= 2.0.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:hackney, "~> 1.1", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:phoenix, ">= 1.0.0 and < 2.0.0", [hex: :phoenix, repo: "hexpm", optional: true]}, {:plug, ">= 1.0.0 and < 2.0.0", [hex: :plug, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f8ae08cff6b6c6b64a9f8fc9cb1a1efe8f3d2fe4508bdffce9ff042a6221ec81"}, "html_entities": {:hex, :html_entities, "0.5.2", "9e47e70598da7de2a9ff6af8758399251db6dbb7eebe2b013f2bbd2515895c3c", [:mix], [], "hexpm", "c53ba390403485615623b9531e97696f076ed415e8d8058b1dbaa28181f4fdcc"}, From 8db083f37da7266baf6c6f79c8b45443607507a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Oct 2023 03:10:50 +0000 Subject: [PATCH 08/18] Bump oban from 2.15.1 to 2.16.2 Bumps [oban](https://github.com/sorentwo/oban) from 2.15.1 to 2.16.2. - [Release notes](https://github.com/sorentwo/oban/releases) - [Changelog](https://github.com/sorentwo/oban/blob/main/CHANGELOG.md) - [Commits](https://github.com/sorentwo/oban/compare/v2.15.1...v2.16.2) --- updated-dependencies: - dependency-name: oban dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- mix.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix.lock b/mix.lock index c1e5ed33..1b75e06f 100644 --- a/mix.lock +++ b/mix.lock @@ -38,7 +38,7 @@ "mixpanel_api_ex": {:hex, :mixpanel_api_ex, "1.0.1", "affd7d886529df7cef6a229a1a2003a47f1f40a4f07f703caed369df60c2d1cf", [:mix], [{:httpoison, "~> 1.2", [hex: :httpoison, repo: "hexpm", optional: false]}, {:poison, "~> 3.1", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm", "fbed8505e9f8ca298f8d65e00ca7c53f88ccc5af8ccbbd8af209297303a7b319"}, "nimble_options": {:hex, :nimble_options, "1.0.2", "92098a74df0072ff37d0c12ace58574d26880e522c22801437151a159392270e", [:mix], [], "hexpm", "fd12a8db2021036ce12a309f26f564ec367373265b53e25403f0ee697380f1b8"}, "number": {:hex, :number, "1.0.4", "3e6e6032a3c1d4c3760e77a42c580a57a15545dd993af380809da30fe51a032c", [:mix], [{:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}], "hexpm", "16f7516584ef2be812af4f33f2eaf3f9b9f6ed8892f45853eb93113f83721e42"}, - "oban": {:hex, :oban, "2.15.1", "d49803174a4b564b1c90d107363d55a59e9e48aeb472ea364ea45d22a5c56997", [:mix], [{:ecto_sql, "~> 3.6", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:ecto_sqlite3, "~> 0.9", [hex: :ecto_sqlite3, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "60be616498db864a8fdd5e013b92f95d2a1d28a3f387c82bf05b35cdcb2af3e1"}, + "oban": {:hex, :oban, "2.16.2", "ec8dfd2f6dfdcd885061b58aeaa2794a0a6f62bad20c15939e4bb80bfd74ed76", [:mix], [{:ecto_sql, "~> 3.6", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:ecto_sqlite3, "~> 0.9", [hex: :ecto_sqlite3, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3d343c80948676abf9652da1e793ab6140ba64e9de7c8d6630eb5bb4aa8fea79"}, "parallel_stream": {:hex, :parallel_stream, "1.0.6", "b967be2b23f0f6787fab7ed681b4c45a215a81481fb62b01a5b750fa8f30f76c", [:mix], [], "hexpm", "639b2e8749e11b87b9eb42f2ad325d161c170b39b288ac8d04c4f31f8f0823eb"}, "parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"}, "phoenix": {:hex, :phoenix, "1.7.10", "02189140a61b2ce85bb633a9b6fd02dff705a5f1596869547aeb2b2b95edd729", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "cf784932e010fd736d656d7fead6a584a4498efefe5b8227e9f383bf15bb79d0"}, From 8c3ceb5d9bdec3006fb1aba77a37346bb6539d23 Mon Sep 17 00:00:00 2001 From: Axel Clark Date: Sun, 4 Feb 2024 14:28:55 -0800 Subject: [PATCH 09/18] Update database ssl options after OTP 26 upgrade * Update database ssl options after OTP 26 upgrade * Closes #1214 --- config/prod.exs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/prod.exs b/config/prod.exs index 54be4da4..60d97517 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -26,7 +26,8 @@ config :ex338, Ex338.Repo, adapter: Ecto.Adapters.Postgres, url: System.get_env("DATABASE_URL"), pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"), - ssl: true + ssl: true, + ssl_options: [verify: :verify_none] config :ex338, :pow_redis, uri: System.get_env("REDIS_URL") From 743446098a4d3cd379cf355aa152ce7a00b3410e Mon Sep 17 00:00:00 2001 From: Axel Clark Date: Sun, 4 Feb 2024 14:43:59 -0800 Subject: [PATCH 10/18] Use correct key for ssl_opts * See #1214 --- config/prod.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/prod.exs b/config/prod.exs index 60d97517..0ea17c4f 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -27,7 +27,7 @@ config :ex338, Ex338.Repo, url: System.get_env("DATABASE_URL"), pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"), ssl: true, - ssl_options: [verify: :verify_none] + ssl_opts: [verify: :verify_none] config :ex338, :pow_redis, uri: System.get_env("REDIS_URL") From 5bfad1247519161d2f118c401a7b9518e7107cd7 Mon Sep 17 00:00:00 2001 From: Axel Clark Date: Sun, 4 Feb 2024 14:50:07 -0800 Subject: [PATCH 11/18] Fix flaky test --- test/ex338/draft_picks/draft_pick_test.exs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/ex338/draft_picks/draft_pick_test.exs b/test/ex338/draft_picks/draft_pick_test.exs index caf87d02..87e5a169 100644 --- a/test/ex338/draft_picks/draft_pick_test.exs +++ b/test/ex338/draft_picks/draft_pick_test.exs @@ -412,7 +412,10 @@ defmodule Ex338.DraftPicks.DraftPickTest do test "only allows update to fantasy player" do changeset = DraftPick.owner_changeset(%DraftPick{}, @valid_user_attrs) - assert Map.keys(changeset.changes) == [:drafted_at, :fantasy_player_id] + change_keys = changeset.changes |> Map.keys() |> MapSet.new() + + expected_change_keys = MapSet.new([:drafted_at, :fantasy_player_id]) + assert MapSet.equal?(change_keys, expected_change_keys) end test "with invalid attributes" do From 83790604e0153ec87fb2b1e25fcfc72ed2dd8151 Mon Sep 17 00:00:00 2001 From: Axel Clark Date: Sun, 4 Feb 2024 15:07:15 -0800 Subject: [PATCH 12/18] Bump Swoosh --- mix.exs | 2 +- mix.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mix.exs b/mix.exs index fae64cde..e9bab8c8 100644 --- a/mix.exs +++ b/mix.exs @@ -70,7 +70,7 @@ defmodule Ex338.Mixfile do {:pow, "== 1.0.28"}, {:redix, "~> 1.2.3"}, {:styler, "~> 0.11", only: [:dev, :test], runtime: false}, - {:swoosh, "~> 1.11.1"}, + {:swoosh, "~> 1.15"}, {:telemetry_poller, "~> 0.4"}, {:telemetry_metrics, "~> 0.4"} ] diff --git a/mix.lock b/mix.lock index 1b75e06f..876892b9 100644 --- a/mix.lock +++ b/mix.lock @@ -4,7 +4,7 @@ "canada": {:hex, :canada, "1.0.2", "040e4c47609b0a67d5773ac1fbe5e99f840cef173d69b739beda7c98453e0770", [:mix], [], "hexpm", "4269f74153fe89583fe50bd4d5de57bfe01f31258a6b676d296f3681f1483c68"}, "canary": {:hex, :canary, "1.1.1", "4138d5e05db8497c477e4af73902eb9ae06e49dceaa13c2dd9f0b55525ded48b", [:mix], [{:canada, "~> 1.0.1", [hex: :canada, repo: "hexpm", optional: false]}, {:ecto, ">= 1.1.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "f348d9848693c830a65b707bba9e4dfdd6434e8c356a8d4477e4535afb0d653b"}, "castore": {:hex, :castore, "1.0.5", "9eeebb394cc9a0f3ae56b813459f990abb0a3dedee1be6b27fdb50301930502f", [:mix], [], "hexpm", "8d7c597c3e4a64c395980882d4bca3cebb8d74197c590dc272cfd3b6a6310578"}, - "certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"}, + "certifi": {:hex, :certifi, "2.12.0", "2d1cca2ec95f59643862af91f001478c9863c2ac9cb6e2f89780bfd8de987329", [:rebar3], [], "hexpm", "ee68d85df22e554040cdb4be100f33873ac6051387baf6a8f6ce82272340ff1c"}, "comeonin": {:hex, :comeonin, "5.3.3", "2c564dac95a35650e9b6acfe6d2952083d8a08e4a89b93a481acb552b325892e", [:mix], [], "hexpm", "3e38c9c2cb080828116597ca8807bb482618a315bfafd98c90bc22a821cc84df"}, "connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"}, "cowboy": {:hex, :cowboy, "2.10.0", "ff9ffeff91dae4ae270dd975642997afe2a1179d94b1887863e43f681a203e26", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "3afdccb7183cc6f143cb14d3cf51fa00e53db9ec80cdcd525482f5e99bc41d6b"}, @@ -25,7 +25,7 @@ "floki": {:hex, :floki, "0.34.3", "5e2dcaec5d7c228ce5b1d3501502e308b2d79eb655e4191751a1fe491c37feac", [:mix], [], "hexpm", "9577440eea5b97924b4bf3c7ea55f7b8b6dce589f9b28b096cc294a8dc342341"}, "gen_smtp": {:hex, :gen_smtp, "1.2.0", "9cfc75c72a8821588b9b9fe947ae5ab2aed95a052b81237e0928633a13276fd3", [:rebar3], [{:ranch, ">= 1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "5ee0375680bca8f20c4d85f58c2894441443a743355430ff33a783fe03296779"}, "gettext": {:hex, :gettext, "0.23.1", "821e619a240e6000db2fc16a574ef68b3bd7fe0167ccc264a81563cc93e67a31", [:mix], [{:expo, "~> 0.4.0", [hex: :expo, repo: "hexpm", optional: false]}], "hexpm", "19d744a36b809d810d610b57c27b934425859d158ebd56561bc41f7eeb8795db"}, - "hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~>2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"}, + "hackney": {:hex, :hackney, "1.20.1", "8d97aec62ddddd757d128bfd1df6c5861093419f8f7a4223823537bad5d064e2", [:rebar3], [{:certifi, "~> 2.12.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.4.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "fe9094e5f1a2a2c0a7d10918fee36bfec0ec2a979994cff8cfe8058cd9af38e3"}, "honeybadger": {:hex, :honeybadger, "0.20.0", "fb687c9a472e8e19727367a23d718a713a6bbb2b894aa598f402309bb0fcb10a", [:mix], [{:ecto, ">= 2.0.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:hackney, "~> 1.1", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:phoenix, ">= 1.0.0 and < 2.0.0", [hex: :phoenix, repo: "hexpm", optional: true]}, {:plug, ">= 1.0.0 and < 2.0.0", [hex: :plug, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f8ae08cff6b6c6b64a9f8fc9cb1a1efe8f3d2fe4508bdffce9ff042a6221ec81"}, "html_entities": {:hex, :html_entities, "0.5.2", "9e47e70598da7de2a9ff6af8758399251db6dbb7eebe2b013f2bbd2515895c3c", [:mix], [], "hexpm", "c53ba390403485615623b9531e97696f076ed415e8d8058b1dbaa28181f4fdcc"}, "httpoison": {:hex, :httpoison, "1.5.1", "0f55b5b673b03c5c327dac7015a67cb571b99b631acc0bc1b0b98dcd6b9f2104", [:mix], [{:hackney, "~> 1.8", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "191a3b6329c917de4e7ca68431919a59bf19e60694b313a69bc1f56a4cb160bf"}, @@ -40,7 +40,7 @@ "number": {:hex, :number, "1.0.4", "3e6e6032a3c1d4c3760e77a42c580a57a15545dd993af380809da30fe51a032c", [:mix], [{:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}], "hexpm", "16f7516584ef2be812af4f33f2eaf3f9b9f6ed8892f45853eb93113f83721e42"}, "oban": {:hex, :oban, "2.16.2", "ec8dfd2f6dfdcd885061b58aeaa2794a0a6f62bad20c15939e4bb80bfd74ed76", [:mix], [{:ecto_sql, "~> 3.6", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:ecto_sqlite3, "~> 0.9", [hex: :ecto_sqlite3, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3d343c80948676abf9652da1e793ab6140ba64e9de7c8d6630eb5bb4aa8fea79"}, "parallel_stream": {:hex, :parallel_stream, "1.0.6", "b967be2b23f0f6787fab7ed681b4c45a215a81481fb62b01a5b750fa8f30f76c", [:mix], [], "hexpm", "639b2e8749e11b87b9eb42f2ad325d161c170b39b288ac8d04c4f31f8f0823eb"}, - "parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"}, + "parse_trans": {:hex, :parse_trans, "3.4.1", "6e6aa8167cb44cc8f39441d05193be6e6f4e7c2946cb2759f015f8c56b76e5ff", [:rebar3], [], "hexpm", "620a406ce75dada827b82e453c19cf06776be266f5a67cff34e1ef2cbb60e49a"}, "phoenix": {:hex, :phoenix, "1.7.10", "02189140a61b2ce85bb633a9b6fd02dff705a5f1596869547aeb2b2b95edd729", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "cf784932e010fd736d656d7fead6a584a4498efefe5b8227e9f383bf15bb79d0"}, "phoenix_ecto": {:hex, :phoenix_ecto, "4.4.2", "b21bd01fdeffcfe2fab49e4942aa938b6d3e89e93a480d4aee58085560a0bc0d", [:mix], [{:ecto, "~> 3.5", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "70242edd4601d50b69273b057ecf7b684644c19ee750989fd555625ae4ce8f5d"}, "phoenix_html": {:hex, :phoenix_html, "3.3.3", "380b8fb45912b5638d2f1d925a3771b4516b9a78587249cabe394e0a5d579dc9", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "923ebe6fec6e2e3b3e569dfbdc6560de932cd54b000ada0208b5f45024bdd76c"}, @@ -64,7 +64,7 @@ "redix": {:hex, :redix, "1.2.3", "3036e7c6080c42e1bbaa9168d1e28e367b01e8960a640a899b8ef8067273cb5e", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:nimble_options, "~> 0.5.0 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "14e2bca8a03fad297a78a3d201032df260ee5f0e0ef9c173c0f9ca5b3e0331b7"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"}, "styler": {:hex, :styler, "0.11.9", "2595393b94e660cd6e8b582876337cc50ff047d184ccbed42fdad2bfd5d78af5", [:mix], [], "hexpm", "8b7806ba1fdc94d0a75127c56875f91db89b75117fcc67572661010c13e1f259"}, - "swoosh": {:hex, :swoosh, "1.11.4", "9b353f998cba3c5e101a0669559c2fb2757b5d9eb7db058bf08687d82e93e416", [:mix], [{:cowboy, "~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:ex_aws, "~> 2.1", [hex: :ex_aws, repo: "hexpm", optional: true]}, {:finch, "~> 0.6", [hex: :finch, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.13 or ~> 1.0", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mail, "~> 0.2", [hex: :mail, repo: "hexpm", optional: true]}, {:mime, "~> 1.1 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d3390914022a456ae1604bfcb3431bd12509b2afe8c70296bae6c9dca4903d0f"}, + "swoosh": {:hex, :swoosh, "1.15.1", "9a8f45b24efc51ce3b04680324828c50fbd9733b9cd798abdcf9b51f5b4667a3", [:mix], [{:bandit, ">= 1.0.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:cowboy, "~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:ex_aws, "~> 2.1", [hex: :ex_aws, repo: "hexpm", optional: true]}, {:finch, "~> 0.6", [hex: :finch, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.13 or ~> 1.0", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mail, "~> 0.2", [hex: :mail, repo: "hexpm", optional: true]}, {:mime, "~> 1.1 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: true]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:req, "~> 0.4 or ~> 1.0", [hex: :req, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "aa4e794bd39529f3d7e9cfd406ff1bbc422b9120e2a7ad38dfdf9b469d0c91f6"}, "telemetry": {:hex, :telemetry, "0.4.3", "a06428a514bdbc63293cd9a6263aad00ddeb66f608163bdec7c8995784080818", [:rebar3], [], "hexpm", "eb72b8365ffda5bed68a620d1da88525e326cb82a75ee61354fc24b844768041"}, "telemetry_metrics": {:hex, :telemetry_metrics, "0.6.1", "315d9163a1d4660aedc3fee73f33f1d355dcc76c5c3ab3d59e76e3edf80eef1f", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7be9e0871c41732c233be71e4be11b96e56177bf15dde64a8ac9ce72ac9834c6"}, "telemetry_poller": {:hex, :telemetry_poller, "0.5.1", "21071cc2e536810bac5628b935521ff3e28f0303e770951158c73eaaa01e962a", [:rebar3], [{:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "4cab72069210bc6e7a080cec9afffad1b33370149ed5d379b81c7c5f0c663fd4"}, From 061b54cc90f9513e02293926b9ba2ffb2b5ab77f Mon Sep 17 00:00:00 2001 From: Axel Clark Date: Sun, 4 Feb 2024 20:47:55 -0800 Subject: [PATCH 13/18] Replace markdown parser * Replace phoenix_markdown with nimble_publisher * phoenix_markdown is no longer maintained * Closes #1219 --- lib/ex338/rulebooks.ex | 22 +++ lib/ex338/rulebooks/rulebook.ex | 9 ++ lib/ex338_web/controllers/page_controller.ex | 4 +- .../templates/page/2017_rules.html.md | 82 ----------- .../templates/page/2018_rules.html.md | 85 ----------- .../templates/page/2019_rules.html.md | 86 ----------- .../templates/page/2020_keeper_rules.html.md | 65 --------- .../templates/page/2020_rules.html.md | 107 -------------- .../templates/page/2021_keeper_rules.html.md | 124 ---------------- .../templates/page/2021_rules.html.md | 127 ---------------- .../templates/page/2022_keeper_rules.html.md | 88 ------------ .../templates/page/2022_rules.html.md | 107 -------------- lib/ex338_web/templates/page/rules.html.eex | 2 +- mix.exs | 2 +- mix.lock | 3 + priv/rules/2017_standard_rules.md | 96 +++++++++++++ priv/rules/2018_standard_rules.md | 97 +++++++++++++ priv/rules/2019_standard_rules.md | 103 +++++++++++++ priv/rules/2020_keeper_rules.md | 78 ++++++++++ priv/rules/2020_standard_rules.md | 126 ++++++++++++++++ priv/rules/2021_keeper_rules.md | 130 +++++++++++++++++ priv/rules/2021_standard_rules.md | 136 ++++++++++++++++++ priv/rules/2022_keeper_rules.md | 94 ++++++++++++ priv/rules/2022_standard_rules.md | 119 +++++++++++++++ .../rules/2023_keeper_rules.md | 77 ++++------ .../rules/2023_standard_rules.md | 103 +++++-------- .../rules/2024_keeper_rules.md | 77 ++++------ .../rules/2024_standard_rules.md | 7 + test/ex338/rulebooks_test.exs | 23 +++ 29 files changed, 1135 insertions(+), 1044 deletions(-) create mode 100644 lib/ex338/rulebooks.ex create mode 100644 lib/ex338/rulebooks/rulebook.ex delete mode 100644 lib/ex338_web/templates/page/2017_rules.html.md delete mode 100644 lib/ex338_web/templates/page/2018_rules.html.md delete mode 100644 lib/ex338_web/templates/page/2019_rules.html.md delete mode 100644 lib/ex338_web/templates/page/2020_keeper_rules.html.md delete mode 100644 lib/ex338_web/templates/page/2020_rules.html.md delete mode 100644 lib/ex338_web/templates/page/2021_keeper_rules.html.md delete mode 100644 lib/ex338_web/templates/page/2021_rules.html.md delete mode 100644 lib/ex338_web/templates/page/2022_keeper_rules.html.md delete mode 100644 lib/ex338_web/templates/page/2022_rules.html.md create mode 100644 priv/rules/2017_standard_rules.md create mode 100644 priv/rules/2018_standard_rules.md create mode 100644 priv/rules/2019_standard_rules.md create mode 100644 priv/rules/2020_keeper_rules.md create mode 100644 priv/rules/2020_standard_rules.md create mode 100644 priv/rules/2021_keeper_rules.md create mode 100644 priv/rules/2021_standard_rules.md create mode 100644 priv/rules/2022_keeper_rules.md create mode 100644 priv/rules/2022_standard_rules.md rename lib/ex338_web/templates/page/2023_keeper_rules.html.md => priv/rules/2023_keeper_rules.md (92%) rename lib/ex338_web/templates/page/2023_rules.html.md => priv/rules/2023_standard_rules.md (92%) rename lib/ex338_web/templates/page/2024_keeper_rules.html.md => priv/rules/2024_keeper_rules.md (92%) rename lib/ex338_web/templates/page/2024_rules.html.md => priv/rules/2024_standard_rules.md (99%) create mode 100644 test/ex338/rulebooks_test.exs diff --git a/lib/ex338/rulebooks.ex b/lib/ex338/rulebooks.ex new file mode 100644 index 00000000..e5bb9759 --- /dev/null +++ b/lib/ex338/rulebooks.ex @@ -0,0 +1,22 @@ +defmodule Ex338.Rulebooks do + @moduledoc false + use NimblePublisher, + build: Ex338.Rulebooks.Rulebook, + from: Application.app_dir(:ex338, "priv/rules/**/*.md"), + as: :rulebooks + + alias Ex338.FantasyLeagues.FantasyLeague + + # And finally export them + def all_rulebooks, do: @rulebooks + + defmodule NotFoundError, do: defexception([:message, plug_status: 404]) + + def get_rulebook_for_fantasy_league!(%FantasyLeague{year: year, draft_method: draft_method}) do + Enum.find( + all_rulebooks(), + &(&1.year == year and &1.draft_method == Atom.to_string(draft_method)) + ) || + raise NotFoundError, "rule with year=#{year} and draft_method=#{draft_method} not found" + end +end diff --git a/lib/ex338/rulebooks/rulebook.ex b/lib/ex338/rulebooks/rulebook.ex new file mode 100644 index 00000000..b0130802 --- /dev/null +++ b/lib/ex338/rulebooks/rulebook.ex @@ -0,0 +1,9 @@ +defmodule Ex338.Rulebooks.Rulebook do + @moduledoc false + @enforce_keys [:year, :draft_method, :body] + defstruct [:year, :draft_method, :body] + + def build(_filename, attrs, body) do + struct!(__MODULE__, [body: body] ++ Map.to_list(attrs)) + end +end diff --git a/lib/ex338_web/controllers/page_controller.ex b/lib/ex338_web/controllers/page_controller.ex index 4b9c6751..ac8e3eaf 100644 --- a/lib/ex338_web/controllers/page_controller.ex +++ b/lib/ex338_web/controllers/page_controller.ex @@ -2,6 +2,7 @@ defmodule Ex338Web.PageController do use Ex338Web, :controller alias Ex338.FantasyLeagues + alias Ex338.Rulebooks def index(conn, _params) do leagues = FantasyLeagues.get_leagues_by_status("primary") @@ -20,6 +21,7 @@ defmodule Ex338Web.PageController do def rules(conn, %{"fantasy_league_id" => id}) do fantasy_league = FantasyLeagues.get(id) - render(conn, "rules.html", fantasy_league: fantasy_league) + rulebook = Rulebooks.get_rulebook_for_fantasy_league!(fantasy_league) + render(conn, "rules.html", fantasy_league: fantasy_league, rulebook: rulebook) end end diff --git a/lib/ex338_web/templates/page/2017_rules.html.md b/lib/ex338_web/templates/page/2017_rules.html.md deleted file mode 100644 index 20e3dde1..00000000 --- a/lib/ex338_web/templates/page/2017_rules.html.md +++ /dev/null @@ -1,82 +0,0 @@ -# 338 Rules for 2017 Season - -1. **Season:** The 2017 338 Season includes only sports with Championship game/series occurring in calendar year 2017. - -2. **Rosters:** Each Owner has 20 roster slots with one slot dedicated to each sport (14 slots) and 6 slots open to any sport. Roster slots may be left open at any time. - - 1. **Tennis/Golf:** You do not have to use the same player throughout the year. 2 players used in the same tournament will require 2 roster slots, but waivering/trading players for each tournament is allowed and the scores will be combined. If using multiple roster slots, Owner must declare which slot a newly acquired player will be in. Owners cannot use the same player in multiple slots, unless 2 or more rostered players have been used in the same slot. In that case, order is determined by the highest ranked player at the time of acquisition going into the roster slot with the most points. EX: I have Tiger and Phil for The Masters, then trade them both for Rory and Scott prior to US Open. I must declare which players will be combined before the event. I choose Tiger/Scott & Phil/Rory. For the British Open, I trade Rory for Tiger and drop Scott for Stenson, making the combo Tiger/Scott/Tiger & Phil/Rory/Stenson. Then I claim Scott for PGA, keeping Tiger & Stenson. At time of claim, rankings are: #1-Scott, #3-Tiger, #7-Stenson. Combo becomes Tiger/Scott/Tiger/Scott, Phil/Rory/Stenson/Tiger, Stenson. - - 2. **Injured Reserve:** ** ** Each Owner will have one IR slot per individual sport (MT, WT, PGA). If a player withdraws from an event prior to the start for any reason, Owner may move the player to IR and claim a new player. This will not cost a waiver claim, but the replacement player will be automatically dropped at the end of the tournament. IR claims are processed after the waiver deadline, giving priority to waiver claims. IR claims must be submitted prior to the start of the tournament. If a player is suspended or does not qualify for an event, IR does not apply and the player must be replaced by a waiver claim. - -3. **Entry Fee:** League A: $200 League B: $225 Payment due by Dec 1st, 2016. **Late payment may result in single sport disqualification(s) at the discretion of Dooley. Dooley has absolutely no mercy so expect it to** **happen and don't bitch about it. You had 2.5 months to pay and didn't. You are a loser. No one cares when losers complain.** - -4. **Scoring:** Points are awarded to the top 8 of each sport. 8 points for winning the league, 5 points for runner-up, 3 points for reaching the semifinals, and 1 point for reaching the quarterfinals. See individual sport for details. If any team/player is later stripped of a standing, prior to relegation, due to violation of any kind, points will be adjusted. Any violation and resulting standings change post-relegation will have no impact on the 338. - - 1. **College Football:** Top 4 teams will be determined by playoffs. The 4 highest ranked teams in the final AP Poll who are not in the playoffs will each get 1 point. - - 2. **Tennis:** Tennis-only points are awarded for each of the 4 Grand Slam Events, immediately after the tournament. 1st=8, 2nd=5, SF=3, QF=1. Negative 2 points awarded to a Top 8 Seed losing in the 1st round and Negative 1 point for a Top 8 Seed losing in the 2nd round. Tennis points will be tallied individually, to a specific roster slot. If a player is traded or dropped, the Owner retains any points they have earned. EX: I have Djokovic who wins the Aussie Open, scoring me 8 pts. I trade him for Nadal prior to the French Open. Nadal wins, so I now have 16 pts. If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W). League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8. Owner must score at least 1 point to be eligible). - - 3. **Golf:** Golf-only points are awarded for each of the 4 majors, immediately after the tournament: 1st=50, 2nd=40, 3rd-35th=37,36,35...6,5, 36th-40th =3, made cut =1, missed cut= -5. Golf points will be tallied individually, to a specific roster slot. If a player is traded or dropped, the Owner retains any points they have earned. EX: I have Tiger and Phil. Tiger wins the Masters (50pts) and Phil finishes 11th (29pts). I keep Tiger but drop Phil and Tiger wins the US Open. I now have 100pts for Tiger and still have 29pts for Phil. Prior to the British Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut. I now have 95 pts for Tiger and 79 pts combined for Phil/Rory. Following the four majors League points will be awarded to top 8 total scores. Each Owner may have multiple places in the top 8. Owner must score at least 1 pt to be eligible. - - 4. **Tennis/Golf League Points:** Players may be dropped and traded throughout the year, resulting in multiple players earning points. Rosters will lock after the final major's deadline and in order for league points to be earned, a roster slot must be occupied by that sport for the number of players earning points. Ex: If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points. If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player. - - 5. **Tie Breakers:** _Individual Sport_: Points awarded evenly to tied Owners. Money split for 1st or 2nd place tie. _League_: Owners will split the winnings evenly. _Relegation: _ See Below. - -5. **Payout:** (assumes 14 in A, 14 in B) - - 1. **League A:** - - 1st: $995 - - 2nd:$750 - - 3rd: $450 - - 4th: $300 - - 5th: $200 - 2. **League B:** - - 1st: $800 - - 2nd:$600 - - 3rd: $400 - - 4th: $275 - - 5th: $200 - - **Single Sport Payouts:** 1st: $25 2nd: $10. If an un-owned team finishes 1st or 2nd, money goes into league pot. If Owners tie, money is split evenly. - -6. **Waiver Wire:** Originally set by reverse draft order. A successful claim drops you to the bottom. All non-rostered teams are on waivers. Waiver claims are submitted via the Fantasy Team page. Select the team/player (player) you want to add and/or drop and hit submit. Owners can submit three types of waivers: add a player and drop a player (drop is only made if the add is successful), only drop a player, or only add a player. The league will be notified via email when the claim is submitted and the waiver will be listed as pending on the site. - - There will be a 3-day waiting period when any other Owner may claim the added player by submitting a new waiver for that player. “Drop only” waivers have no waiting period and are processed immediately. If a roster positions is not available on the team at the time the claim is submitted (and a player to drop is not included), the claim is invalid and will be cancelled by the commish. An owner may change the player to drop during the 3-day waiting period by messaging the commish or updating the claim via the site (this feature to be added in the future.) - - At the end of the 3-day period, new claims for that player will no longer be accepted and the commish will process the claim. The Owner with the highest waiver priority (i.e. lowest waiver position) will have the player added to its roster by the commish. Once submitted, a claim may not be cancelled by the claiming Owner. - - Waiting Period is waived during certain times for College Basketball, College Hockey, Kentucky Derby and LLWS. Due to the conference tournaments ending just before CBB and CHK brackets are announced, there will be no wait period on claims in CBB and CHK. Instead, we will have a 1 week "quiet period" prior to the deadline. Claims will not be announced to the league and will process at the deadline based on waiver position. Extra draft picks at the end of KD & LLWS will be up for waiver claim until the individual draft begins. At that point, remaining draft picks may be claimed with no waiting period. _Golf/Tennis_: Owners do NOT receive credit for points earned in tournaments prior to waiver pickup. Teams may be dropped without a pick-up, leaving an open roster slot to be filled later. One roster slot must be dedicated to each sport. - - 1. **Waiver Deadline:** See each sport for waiver deadlines. After the deadline NO TEAMS may be claimed or dropped from roster, **except** for late drops. After the deadline, there will be a an email sent with teams that were dropped within 12 hours of deadline or dropped after a successful claim and Owners will have an opportunity to claim them. This eliminates holding a team until the last minute to keep others from claiming. This also allows an Owner that put in a claim, but was trumped by a higher waiver to claim another team. For sports with multiple championships, waivers will be closed for that sport between each championship waiver deadline and the championship. After the championship, waivers for the sport will reopen. - -7. **Trades:** Trades are submitted to Commish and if eligible, presented to the league. Trades are ineligible if they break any 338 rules stated herein or include any non-338 assets. There will be a 3-day voting period needing 8 Yes votes to pass. A no-response during the voting period will be considered an approval. Once a trade is submitted for Commish approval, the involved Owners are agreeing to the trade and may not make changes or vote against it unless all involved agree. Future Round Draft Picks may be traded, but only for the adjacent season's draft and must be 1:1 (Owner-A trades 1st round pick to Owner-B for team and 5th round pick.) - - 1. **Golf/Tennis:** Points already earned by players that are traded stay with the former Owner. - - 2. **Trade Deadline:** See each sport for trade deadlines. After the deadline NO TEAMS for that sport may be traded. - - 3. **Future Round Draft Picks:** Deadline for trading draft picks is the current season MLB trade deadline. - -8. **Draft:** Draft order determined using [http://www.random.org/lists](http://www.random.org/lists). Conducted via website in Snake style. For leagues that have a smaller number of teams (e.g. KD, LLWS), every member must be able to draft a team from a league. Once the limit has been reached, only members without a team from that league will be allowed to draft from that sport. Once a draft pick has been emailed to the league, it cannot be changed. - - 1. **Kentucky Derby:** The draft for the Kentucky Derby will be held in May once the field is announced. During the September draft, you will be selecting a draft position rather than an actual horse. (For example, you may use your 4th round selection for the first pick in the Kentucky Derby draft). Draft limited to 18 horses in case of a late scratch, Owner will be able to replace horse. If a horse is scratched after being drafting, a replacement may be picked at the completion of the draft and it will NOT count as a waiver claim. If multiple horses are scratched, replacements are chosen in original draft order. The first pick must be made by 8:30 AM PST on Friday before the race. If not made by 8:30, the OWNER with Pick #2 may draft and so on. Owner with #1 may pick at any time after that, but cannot take a horse already drafted. - - 2. **LLWS:** The draft for the LLWS will begin in August, after the regional winners are set. During the September draft, you will be selecting a draft position rather than an actual team (For example, you may use your 4th round selection for the first pick in the LLWS draft). There are only 16 teams in the LLWS. - -9. **Relegation:** Based on League Points, the bottom 4 Owners in A will be relegated to League B and the top 4 Owners in B will move up to A. Because relegation and the 2018 draft will take place prior to the end of the MLB season, we will use the MLB regular season standings at the end of the day on the day of the US Open Men's final. This is for relegation purposes only_. League points will still be based on the playoffs. - - 1. For relegation, points will be awarded based on the following: - - * 8 pts: Best Overall Record - * 5 pts: Best Overall Record in other league - * 3 pts: 2nd Best Record in each league: - * 1 pt: 3rd division leader + best overall record of non-division leader. If top 2 teams are in same division, then 1 point to other 2 division leaders. - - 2. **TIEBREAKERS (in order of application):** - - * MLB_: Run Differential, Record in September, Head-to-Head Record, Coin Flip - * LEAGUE_: # of championships, # of teams scoring league points, lowest drafted team to score a league point (excludes waiver claims and trades). - - 3. **DRAFT PICK TRADES:** If relegation results in Owners that traded draft picks in different leagues, the traded picks will take place at the end of the round. EX: I trade my 1st round pick away and get a 10th round pick in return and I get relegated to B. The Owner I traded with would get my 1st round pick at the end of the 1st round. I would get the 10th round pick I traded for at the end of the 10th round. If both teams involved in the trade stay in the same league, or both get relegated, they would swap actual picks. If multiple Owners have supplemental picks, the order will be in reverse of the picks in that round. - - 4. **END OF SEASON** If an Owners gets relegated from A to B, but finishes in the money in League A after actual MLB results are recorded, that Owner will automatically move up to A (after their relegation season) as the #1 team, regardless of actual position in B. If an Owner finishes in the top 10 in A, but does not play the following season, the 11th place Owner will remain in A and a new Owner will be added to B. diff --git a/lib/ex338_web/templates/page/2018_rules.html.md b/lib/ex338_web/templates/page/2018_rules.html.md deleted file mode 100644 index ed3e5106..00000000 --- a/lib/ex338_web/templates/page/2018_rules.html.md +++ /dev/null @@ -1,85 +0,0 @@ -# 338 Rules for 2018 Season - -1. **Season:** The 2018 338 Season includes only sports with Championship game/series occurring in calendar year 2018. World Cup will replace EPL this year. All other sports will remain the same. - -2. **Rosters:** Each Owner has 20 roster slots with one slot dedicated to each sport (14 slots) and 6 slots open to any sport. Roster slots may be left open at any time. - - 1. **Tennis/Golf:** You do not have to use the same player throughout the year. 2 players used in the same tournament will require 2 roster slots, but waivering/trading players for each tournament is allowed and the scores will be combined. If using multiple roster slots, Owner must declare which slot a newly acquired player will be in. Owners cannot use the same player in multiple slots, unless 2 or more rostered players have been used in the same slot. In that case, order is determined by the highest ranked player at the time of acquisition going into the roster slot with the most points. EX: I have Tiger and Phil for The Masters, then trade them both for Rory and Scott prior to US Open. I must declare which players will be combined before the event. I choose Tiger/Scott & Phil/Rory. For the British Open, I trade Rory for Tiger and drop Scott for Stenson, making the combo Tiger/Scott/Tiger & Phil/Rory/Stenson. Then I claim Scott for PGA, keeping Tiger & Stenson. At time of claim, rankings are: #1-Scott, #3-Tiger, #7-Stenson. Combo becomes Tiger/Scott/Tiger/Scott, Phil/Rory/Stenson/Tiger, Stenson. - - 2. **Injured Reserve:** ** ** Each Owner will have one IR slot per individual sport (MT, WT, PGA). If a player withdraws from an event prior to the start for any reason, Owner may move the player to IR and claim a new player. This will not cost a waiver claim, but the replacement player will be automatically dropped at the end of the tournament. IR claims are processed after the waiver deadline, giving priority to waiver claims. IR claims must be submitted prior to the start of the tournament. If a player is suspended or does not qualify for an event, IR does not apply and the player must be replaced by a waiver claim. - -3. **Entry Fee:** League A: $200, League B: $225, League C: $250 Payment due by Dec 1st, 2017. **Late payment may result in single sport disqualification(s) at the discretion of Dooley. Dooley has absolutely no mercy so expect it to happen.** - -4. **Scoring:** Points are awarded to the top 8 of each sport. 8 points for winning the league, 5 points for runner-up, 3 points for reaching the semifinals, and 1 point for reaching the quarterfinals. See individual sport for details. If any team/player is later stripped of a standing, prior to relegation, due to violation of any kind, points will be adjusted. Any violation and resulting standings change post-relegation will have no impact on the 338. - - 1. **College Football: ** Top 4 teams will be determined by playoffs. The 4 highest ranked teams in the final AP Poll who are not in the playoffs will each get 1 point. - - 2. **Tennis:** Tennis-only points are awarded for each of the 4 Grand Slam Events, immediately after the tournament. 1st=8, 2nd=5, SF=3, QF=1. Negative 2 points awarded to a Top 8 Seed losing in the 1st round and Negative 1 point for a Top 8 Seed losing in the 2nd round. Tennis points will be tallied individually, to a specific roster slot. If a player is traded or dropped, the Owner retains any points they have earned. EX: I have Djokovic who wins the Aussie Open, scoring me 8 pts. I trade him for Nadal prior to the French Open. Nadal wins, so I now have 16 pts. If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W). League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8. Owner must score at least 1 point to be eligible). - - 3. **Golf:** Golf-only points are awarded for each of the 4 majors, immediately after the tournament: 1st=50, 2nd=40, 3rd-35th=37,36,35...6,5, 36th-40th =3, made cut =1, missed cut= -5. Golf points will be tallied individually, to a specific roster slot. If a player is traded or dropped, the Owner retains any points they have earned. EX: I have Tiger and Phil. Tiger wins the Masters (50pts) and Phil finishes 11th (29pts). I keep Tiger but drop Phil and Tiger wins the US Open. I now have 100pts for Tiger and still have 29pts for Phil. Prior to the British Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut. I now have 95 pts for Tiger and 79 pts combined for Phil/Rory. Following the four majors League points will be awarded to top 8 total scores. Each Owner may have multiple places in the top 8. Owner must score at least 1 pt to be eligible. - - 4. **Tennis/Golf League Points:** Players may be dropped and traded throughout the year, resulting in multiple players earning points. Rosters will lock after the final major's deadline and in order for league points to be earned, a roster slot must be occupied by that sport for the number of players earning points. Ex: If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points. If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player. - - 5. **Tie Breakers:** _Individual Sport_: Points awarded evenly to tied Owners. Money split for 1st or 2nd place tie. _League_: Owners will split the winnings evenly. _Relegation: _ See Below. - -5. **Payout:** (assumes 14 in A, 14 in B) - - 1. **League A:** - - 1st: $1,150 - - 2nd: $875 - - 3rd: $630 - - 4th: $450 - - 5th: $325 - 2. **League B:** - - 1st: $800 - - 2nd:$600 - - 3rd: $400 - - 4th: $275 - - 5th: $200 - 3. **League C:** - - 1st: $520 - - 2nd: $370 - - 3rd: $270 - - 4th: $175 - - **Single Sport Payouts:** A&B: 1st: $25 2nd: $10. C: 1st: $20 2nd: $10. If an un-owned team finishes 1st or 2nd, money goes into league pot. If Owners tie, money is split evenly. - -6. **Waiver Wire:** Originally set by reverse draft order. A successful claim drops you to the bottom. All non-rostered teams are on waivers. Waiver claims are submitted via the site's Waivers page. Select the team/player (player) you want to add and/or drop and hit submit. The league will be notified and there will be a 3-day waiting period where any other Owner may also claim the player. - - At the end of the 3-day period, the Owner with the highest waiver priority takes the player and must roster the player. If no roster slots are available, a different player must be dropped. If the deadline has already passed, a player in that sport may NOT be dropped, even if in the same sport as the player being claimed. Once submitted, a claim may not be cancelled by the claiming Owner, but the player dropped may be adjusted. - - Waiting Period is waived during certain times for College Basketball, College Hockey, Kentucky Derby and LLWS. Due to the conference tournaments ending just before CBB and CHK brackets are announced, there will be no wait period on claims in CBB and CHK. Instead, we will have a 1 week "quiet period" prior to the deadline. Claims will not be announced to the league and will process at the deadline based on waiver position. Extra draft picks at the end of KD & LLWS will be up for waiver claim until the individual draft begins. At that point, remaining draft picks may be claimed with no waiting period. _Golf/Tennis_: Owners do NOT receive credit for points earned in tournaments prior to waiver pickup. Teams may be dropped without a pick-up, leaving an open roster slot to be filled later. One roster slot must be dedicated to each sport. - - 1. **Waiver Deadline:** See each sport for waiver deadlines. After the deadline NO TEAMS may be claimed or dropped from roster, **except** for late drops. After the deadline, there will be a an email sent with teams that were dropped within 12 hours of deadline or dropped after a successful claim and Owners will have an opportunity to claim them. This eliminates holding a team until the last minute to keep others from claiming. This also allows an Owner that put in a claim, but was trumped by a higher waiver to claim another team. For sports with multiple championships, waivers will be closed for that sport between each championship waiver deadline and the championship. After the championship, waivers for the sport will reopen. - -7. **Trades:** Trades are submitted to Commish and if eligible, presented to the league. Trades are ineligible if they break any 338 rules stated herein or include any non-338 assets. There will be a 3-day voting period needing 8 Yes votes to pass. A no-response during the voting period will be considered an approval. Once a trade is submitted for Commish approval, the involved Owners are agreeing to the trade and may not make changes or vote against it unless all involved agree. Future Round Draft Picks may be traded, but only for the next draft to take place and must be 1:1 (Owner-A trades 1st round pick to Owner-B for team and 5th round pick.) - - 1. **Golf/Tennis:** Points already earned by players that are traded stay with the former Owner. - - 2. **Trade Deadline:** See each sport for trade deadlines. After the deadline NO TEAMS for that sport may be traded. - - 3. **Future Round Draft Picks:** Deadline for trading draft picks is the current season MLB trade deadline. - -8. **Draft:** Draft order determined using [http://www.random.org/lists](http://www.random.org/lists). Conducted via website in Snake style. For leagues that have a smaller number of teams (e.g. KD, LLWS), every member must be able to draft a team from a league. Once the limit has been reached, only members without a team from that league will be allowed to draft from that sport. Once a draft pick has been emailed to the league, it cannot be changed. - - 1. **Kentucky Derby:** The draft for the Kentucky Derby will be held in May once the field is announced. During the September draft, you will be selecting a draft position rather than an actual horse. (For example, you may use your 4th round selection for the first pick in the Kentucky Derby draft). Draft limited to 18 horses in case of a late scratch, Owner will be able to replace horse. If a horse is scratched after being drafting, a replacement may be picked at the completion of the draft and it will NOT count as a waiver claim. If multiple horses are scratched, replacements are chosen in original draft order. The first pick must be made by 8:30 AM PST on Friday before the race. If not made by 8:30, the OWNER with Pick #2 may draft and so on. Owner with #1 may pick at any time after that, but cannot take a horse already drafted. - - 2. **LLWS:** The draft for the LLWS will begin in August, after the regional winners are set. During the September draft, you will be selecting a draft position rather than an actual team (For example, you may use your 4th round selection for the first pick in the LLWS draft). There are only 16 teams in the LLWS. - -9. **Relegation:** Based on League Points, the bottom 4 Owners in A and B will be relegated to League B and C respectively. The top 4 Owners in B and C will move up to A and B. Because relegation and the next season's draft will take place prior to the end of the MLB season, we will use the MLB regular season standings at the end of the day on the day of the US Open Men's final. This is f_r relegation purposes only_. League points will still be based on the playoffs. - - 1. For relegation, points will be awarded based on the following: - - * 8 pts: Best Overall Record - * 5 pts: Best Overall Record in other league - * 3 pts: 2nd Best Record in each league: - * 1 pt: 3rd division leader + best overall record of non-division leader. If top 2 teams are in same division, then 1 point to other 2 division leaders. - - 2. **TIEBREAKERS (in order of application):** - - * _MLB_: Run Differential, Record in September, Head-to-Head Record, Coin Flip - * _LEAGUE_: # of championships, # of teams scoring league points, lowest drafted team to score a league point (excludes waiver claims and trades). - - 3. **DRAFT PICK TRADES:** If relegation results in Owners that traded draft picks in different leagues, the traded picks will take place at the end of the round. EX: I trade my 1st round pick away and get a 10th round pick in return and I get relegated to B. The Owner I traded with would get my 1st round pick at the end of the 1st round. I would get the 10th round pick I traded for at the end of the 10th round. If both teams involved in the trade stay in the same league, or both get relegated, they would swap actual picks. If multiple Owners have supplemental picks, the order will be in reverse of the picks in that round. - - 4. **END OF SEASON** If an Owners gets relegated from A to B or B to C, but finishes in the money after actual MLB results are recorded, that Owner will automatically move up to the next league (after their relegation season) as the #1 team, regardless of actual position in B or C. If an Owner finishes in the top 10 in A or B, but does not play the following season, the 11th place Owner will remain in A or B and a new Owner will be added to B or C. diff --git a/lib/ex338_web/templates/page/2019_rules.html.md b/lib/ex338_web/templates/page/2019_rules.html.md deleted file mode 100644 index 6f697574..00000000 --- a/lib/ex338_web/templates/page/2019_rules.html.md +++ /dev/null @@ -1,86 +0,0 @@ -# 338 Rules for 2019 Season - -1. **Season:** The 2019 338 Season includes only sports with Championship game/series occurring in calendar year 2019. There are 14 permanent sports and a 15th sport that changes each year. Permanent sports are: NCAA Football, NFL, NCAA Basketball, NBA, NCAA Hockey, NHL, NCAA Baseball, MLB, Champions League, Kentucky Derby, PGA, LLWS, Men’s and Women’s Tennis. In 2019, the rotating sport will be Women’s World Cup. Subsequent years will be an Olympic Event, EPL (subject to change) and World Cup. - -2. **Rosters:** Each Owner has 20 roster slots with one slot dedicated to each sport (15 slots) and 5 slots open to any sport. Roster slots may be left open at any time. - - 1. **Tennis/Golf:** You do not have to use the same player throughout the year. 2 players used in the same tournament will require 2 roster slots, but waivering/trading players for each tournament is allowed and the scores will be combined. If using multiple roster slots, Owner must declare which slot a newly acquired player will be in. Owners cannot use the same player in multiple slots, unless 2 or more rostered players have been used in the same slot. In that case, order is determined by the highest ranked player at the time of acquisition going into the roster slot with the most points. EX: I have Tiger and Phil for The Masters, then trade them both for Rory and Scott prior to US Open. I must declare which players will be combined before the event. I choose Tiger/Scott & Phil/Rory. For the British Open, I trade Rory for Tiger and drop Scott for Stenson, making the combo Tiger/Scott/Tiger & Phil/Rory/Stenson. Then I claim Scott for PGA, keeping Tiger & Stenson. At time of claim, rankings are: #1-Scott, #3-Tiger, #7-Stenson. Combo becomes Tiger/Scott/Tiger/Scott, Phil/Rory/Stenson/Tiger, Stenson. - - 2. **Injured Reserve:** ** ** Each Owner will have one IR slot per individual sport (MT, WT, PGA). If a player withdraws from an event prior to the start for any reason, Owner may move the player to IR and claim a new player. This will not cost a waiver claim, but the replacement player will be automatically dropped at the end of the tournament. IR claims are processed after the waiver deadline, giving priority to waiver claims. IR claims must be submitted prior to the start of the tournament. If a player is suspended or does not qualify for an event, IR does not apply and the player must be replaced by a waiver claim. - -3. **Entry Fee:** League A: $225, League B: $250, League C: $275 Payment due by Dec 1st, 2018. **Late payment may result in single sport disqualification(s) at the discretion of Dooley. Dooley has absolutely no mercy so expect it to happen.** - -4. **Scoring:** Points are awarded to the top 8 of each sport. 8 points for winning the league, 5 points for runner-up, 3 points for reaching the semifinals, and 1 point for reaching the quarterfinals. See individual sport for details. If any team/player is later stripped of a standing, prior to relegation, due to violation of any kind, points will be adjusted. Any violation and resulting standings change post-relegation will have no impact on the 338. - - 1. **College Football: ** Top 4 teams will be determined by playoffs. The 4 highest ranked teams in the final AP Poll who are not in the playoffs will each get 1 point. - - 2. **Tennis:** Tennis-only points are awarded for each of the 4 Grand Slam Events, immediately after the tournament. 1st=8, 2nd=5, SF=3, QF=1. Negative 2 points awarded to a Top 8 Seed losing in the 1st round and Negative 1 point for a Top 8 Seed losing in the 2nd round. Tennis points will be tallied individually, to a specific roster slot. If a player is traded or dropped, the Owner retains any points they have earned. EX: I have Djokovic who wins the Aussie Open, scoring me 8 pts. I trade him for Nadal prior to the French Open. Nadal wins, so I now have 16 pts. If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W). League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8. Owner must score at least 1 point to be eligible). - - 3. **Golf:** Golf-only points are awarded for each of the 4 majors, immediately after the tournament: 1st=50, 2nd=40, 3rd-35th=37,36,35...6,5, 36th-40th =3, made cut =1, missed cut= -5. Golf points will be tallied individually, to a specific roster slot. If a player is traded or dropped, the Owner retains any points they have earned. EX: I have Tiger and Phil. Tiger wins the Masters (50pts) and Phil finishes 11th (29pts). I keep Tiger but drop Phil and Tiger wins the US Open. I now have 100pts for Tiger and still have 29pts for Phil. Prior to the British Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut. I now have 95 pts for Tiger and 79 pts combined for Phil/Rory. Following the four majors League points will be awarded to top 8 total scores. Each Owner may have multiple places in the top 8. Owner must score at least 1 pt to be eligible. - - 4. **Tennis/Golf League Points:** Players may be dropped and traded throughout the year, resulting in multiple players earning points. Rosters will lock after the final major's deadline and in order for league points to be earned, a roster slot must be occupied by that sport for the number of players earning points. Ex: If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points. If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player. - - 5. **Tie Breakers:** _Individual Sport_: Points awarded evenly to tied Owners. Money split for 1st or 2nd place tie. _League_: Owners will split the winnings evenly. _Relegation: _ See Below. - -5. **5. Payout:** assumes 14 in each league - - 1. **League A:** - - 1st: $1,200 - - 2nd: $875 - - 3rd: $625 - - 4th: $450 - - 5th: $325 - 2. **League B:** - - 1st: $1,000 - - 2nd: $700 - - 3rd: $500 - - 4th: $375 - - 5th: $300 - 3. **League C:** - - 1st: $920 - - 2nd: $625 - - 3rd: $430 - - 4th: $325 - - 5th: $275 - - **Single Sport Payouts:** 1st: $25 2nd: $10. If an un-owned team finishes 1st or 2nd, money goes into league pot and divided equally among top 5. Leftover amount after equally dividing goes to League Winner. If Owners tie, money is split evenly. - -6. **Waiver Wire:** Originally set by reverse draft order. A successful claim drops you to the bottom. All non-rostered teams are on waivers. Waiver claims are submitted via the site's Waivers page. Select the team/player (player) you want to add and/or drop and hit submit. The league will be notified and there will be a 3-day waiting period where any other Owner may also claim the player. - - At the end of the 3-day period, the Owner with the highest waiver priority takes the player and must roster the player. If no roster slots are available, a different player must be dropped. If the deadline has already passed, a player in that sport may NOT be dropped, even if in the same sport as the player being claimed. Once submitted, a claim may not be cancelled by the claiming Owner, but the player dropped may be adjusted. - - Waiting Period is waived during certain times for College Basketball, College Hockey, Kentucky Derby and LLWS. Due to the conference tournaments ending just before CBB and CHK brackets are announced, there will be no wait period on claims in CBB and CHK. Instead, we will have a 1 week "quiet period" prior to the deadline. Claims will not be announced to the league and will process at the deadline based on waiver position. Extra draft picks at the end of KD & LLWS will be up for waiver claim until the individual draft begins. At that point, remaining draft picks may be claimed with no waiting period. _Golf/Tennis_: Owners do NOT receive credit for points earned in tournaments prior to waiver pickup. Teams may be dropped without a pick-up, leaving an open roster slot to be filled later. One roster slot must be dedicated to each sport. - - 1. **Waiver Deadline:** See each sport for waiver deadlines. After the deadline NO TEAMS may be claimed or dropped from roster, **except** for late drops. After the deadline, there will be a an email sent with teams that were dropped within 12 hours of deadline or dropped after a successful claim and Owners will have an opportunity to claim them. This eliminates holding a team until the last minute to keep others from claiming. This also allows an Owner that put in a claim, but was trumped by a higher waiver to claim another team. For sports with multiple championships, waivers will be closed for that sport between each championship waiver deadline and the championship. After the championship, waivers for the sport will reopen. - -7. **Trades:** Trades are submitted to Commish and if eligible, presented to the league. Trades are ineligible if they break any 338 rules stated herein or include any non-338 assets. There will be a 3-day voting period needing 8 Yes votes to pass. A no-response during the voting period will be considered an approval. Once a trade is submitted for Commish approval, the involved Owners are agreeing to the trade and may not make changes or vote against it unless all involved agree. Future Round Draft Picks may be traded, but only for the next draft to take place and must be 1:1 (Owner-A trades 1st round pick to Owner-B for team and 5th round pick.) - - 1. **Golf/Tennis:** Points already earned by players that are traded stay with the former Owner. - - 2. **Trade Deadline:** See Championships page for deadlines. After the deadline NO TEAMS for that sport may be traded. - - 3. **Future Round Draft Picks:** Deadline for trading draft picks is the current season MLB trade deadline. - -8. **Draft:** Draft order determined by random draw, conducted via website in Snake style. For leagues that have a smaller number of teams (e.g. KD, LLWS), every member must be able to draft a team from a league. Once the limit has been reached, only members without a team from that league will be allowed to draft from that sport. Once a draft pick has been emailed to the league, it cannot be changed. - - 1. **Kentucky Derby:** The draft for the Kentucky Derby will be held in May once the field is announced. During the September draft, you will be selecting a draft position rather than an actual horse. (For example, you may use your 4th round selection for the first pick in the Kentucky Derby draft). Draft limited to 18 horses in case of a late scratch, Owner will be able to replace horse. If a horse is scratched after being drafting, a replacement may be picked at the completion of the draft and it will NOT count as a waiver claim. If multiple horses are scratched, replacements are chosen in original draft order. The first pick must be made by 8:30 AM PST on Friday before the race. If not made by 8:30, the OWNER with Pick #2 may draft and so on. Owner with #1 may pick at any time after that, but cannot take a horse already drafted. - - 2. **LLWS:** The draft for the LLWS will begin in August, after the regional winners are set. During the September draft, you will be selecting a draft position rather than an actual team (For example, you may use your 4th round selection for the first pick in the LLWS draft). There are only 16 teams in the LLWS. - -9. **Relegation:** Based on League Points, the bottom 4 Owners in A and B will be relegated to League B and C respectively. The top 4 Owners in B and C will move up to A and B. Because relegation and the next season's draft will take place prior to the end of the MLB season, we will use the MLB regular season standings at the end of the day on the day of the US Open Men's final. This is f_r relegation purposes only_. League points will still be based on the playoffs. - - 1. For relegation, points will be awarded based on the following: - - * 8 pts: Best Overall Record - * 5 pts: Best Overall Record in other league - * 3 pts: 2nd Best Record in each league: - * 1 pt: 3rd division leader + best overall record of non-division leader. If top 2 teams are in same division, then 1 point to other 2 division leaders. - - 2. **TIEBREAKERS (in order of application):** - - * _MLB_: Run Differential, Record in September, Head-to-Head Record, Coin Flip - * _LEAGUE_: # of championships, # of teams scoring league points, lowest drafted team to score a league point (excludes waiver claims and trades). - - 3. **DRAFT PICK TRADES:** If relegation results in Owners that traded draft picks in different leagues, the traded picks will take place at the end of the round. EX: I trade my 1st round pick away and get a 10th round pick in return and I get relegated to B. The Owner I traded with would get my 1st round pick at the end of the 1st round. I would get the 10th round pick I traded for at the end of the 10th round. If both teams involved in the trade stay in the same league, or both get relegated, they would swap actual picks. If multiple Owners have supplemental picks, the order will be in reverse of the picks in that round. - - 4. **END OF SEASON** If an Owners gets relegated from A to B or B to C, but finishes in the money after actual MLB results are recorded, that Owner will automatically move up to the next league (after their relegation season) as the #1 team, regardless of actual position in B or C. If an Owner finishes in the top 10 in A or B, but does not play the following season, the 11th place Owner will remain in A or B and a new Owner will be added to B or C. diff --git a/lib/ex338_web/templates/page/2020_keeper_rules.html.md b/lib/ex338_web/templates/page/2020_keeper_rules.html.md deleted file mode 100644 index 9beb52b5..00000000 --- a/lib/ex338_web/templates/page/2020_keeper_rules.html.md +++ /dev/null @@ -1,65 +0,0 @@ -# 338 Keeper Rules for 2019-2020 Season - -1. **Season:** The 2019-2020 338 Keeper Season begins with the 2019 LLWS tournament and ends with the 2020 Olympic Steeplechase. There are 14 permanent sports and a 15th sport that changes each year. Permanent sports are: NCAA Football, NFL, NCAA Basketball, NBA, NCAA Hockey, NHL, NCAA Baseball, MLB, Champions League, Kentucky Derby, PGA, LLWS, Men's and Women's Tennis. For the 2019-20 season, the rotating sport will be Men's Steeplechase in the Olympics. Subsequent years will be MLS, World Cup and Women's World Cup (rotating sports subject to change). - -2. **Ownership:** Teams are allowed to have multiple owners and split the entry fee and winnings any way they choose. - 1. For league voting purposes, each team will only receive one vote, regardless of number of owners. - 2. Owners are not allowed to own or have partial ownership in multiple 338 teams in the same league, but may own or have partial ownership in teams in different leagues. If relegation puts 2 teams with the same owner or partial owner in the same league, that owner must drop ownership or partial ownership of one team and remain uninvolved until the teams are no longer in the same league. - -3. **Rosters:** Each Owner has 20 roster slots with one slot dedicated to each sport (15 slots) and 5 slots open to any sport. Roster slots may be left open at any time. - 1. **Tennis/Golf:** You do not have to use the same player throughout the year. 2 players used in the same tournament will require 2 roster slots, but waivering/trading players for each tournament is allowed and the scores will be combined. If using multiple roster slots, Owner must declare which slot a newly acquired player will be in. Owners cannot use the same player in multiple slots, unless 2 or more rostered players have been used in the same slot. In that case, order is determined by the highest ranked player at the time of acquisition going into the roster slot with the most points. EX: I have Tiger and Phil for The Masters, then trade them both for Rory and Scott prior to the PGA. I must declare which players will be combined before the event. I choose Tiger/Scott & Phil/Rory. For the US Open, I trade Rory for Tiger and drop Scott for Stenson, making the combo Tiger/Scott/Tiger & Phil/Rory/Stenson. Then I claim Scott for British Open, keeping Tiger & Stenson. At time of claim, rankings are: #1-Scott, #3-Tiger, #7-Stenson. Combo becomes Tiger/Scott/Tiger/Scott, Phil/Rory/Stenson/Tiger, Stenson. - 2. **Injured Reserve:** Each Owner will have one IR slot per individual sport (MT, WT, PGA). If a player withdraws from an event prior to the start for any reason, Owner may move the player to IR and claim a new player. This will not cost a waiver claim, but the replacement player will be automatically dropped at the end of the tournament. IR claims are processed after the waiver deadline, giving priority to waiver claims. IR claims must be submitted prior to the start of the tournament. If a player is suspended or does not qualify for an event, IR does not apply and the player must be replaced by a waiver claim. - -4. **Entry Fee** : $250 Payment due by Oct 1st, 2019. **Late payment may result in single sport disqualification(s) at the discretion of the Board of Directors.** - -5. **Scoring:** Points are awarded to the top 8 of each sport. 8 points for winning the league, 5 points for runner-up, 3 points for reaching the semifinals, and 1 point for reaching the quarterfinals. See individual sport for details. If any team/player is later stripped of a standing, prior to relegation or the final championship of the year (whichever comes first), due to violation of any kind, points will be adjusted. Any violation and resulting standings change post-deadline will have no impact on the 338. - 1. **College Football:** Top 4 teams will be determined by the CFP. The 4 highest ranked teams in the final AP Poll who are not in the playoffs will each get 1 point. - 2. **Tennis:** Tennis-only points are awarded for each of the 4 Grand Slam Events (2019 US Open, 2020 Aussie Open, French Open and Wimbledon) immediately after the tournament. 1st=8, 2nd=5, SF=3, QF=1. Negative 2 points awarded to a Top 8 Seed losing in the 1st round and Negative 1 point for a Top 8 Seed losing in the 2nd round. Tennis points will be tallied individually, to a specific roster slot. If a player is traded or dropped, the Owner retains any points they have earned. EX: I have Djokovic who wins the Aussie Open, scoring me 8 pts. I trade him for Nadal prior to the French Open. Nadal wins, so I now have 16 pts. If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W). League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8. Owner must score at least 1 point to be eligible). - 3. **Golf:** Golf-only points are awarded for each of the 4 2020 majors, immediately after the tournament: 1st=50, 2nd=40, 3rd-35th=37,36,35...6,5, 36th-40th =3, made cut =1, missed cut= -5. Golf points will be tallied individually, to a specific roster slot. If a player is traded or dropped, the Owner retains any points they have earned. EX: I have Tiger and Phil. Tiger wins the Masters (50pts) and Phil finishes 11th (29 pts). I keep Tiger but drop Phil and Tiger wins the PGA. I now have 100pts for Tiger and still have 29pts for Phil. Prior to the US Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut. I now have 95 pts for Tiger and 79 pts combined for Phil/Rory. Following the four majors League points will be awarded to top 8 total scores. Each Owner may have multiple places in the top 8. Owner must score at least 1 pt to be eligible. - 4. **Tennis/Golf League Points:** Players may be dropped and traded throughout the year, resulting in multiple players earning points. Rosters will lock after the final major's deadline and in order for league points to be earned, a roster slot must be occupied by that sport for the number of players earning points. Ex: If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points. If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player. - 5. **Tie Breakers** : _Individual Sport_: League Points will be split evenly among all tied Owners. Golf points awarded in full to each tied owner. Money split for 1st and/or 2nd place tie. _League_: Owners will split the winnings evenly. _Relegation: _ See Below. - -6. **Payout** : - - 1. **League A** : - - 1st: $1,000 - - 2nd: $750 - - 3rd: $550 - - 4th: $400 - - 5th: $275 - - 2. **League B** : - - 1st: N/A - - 2nd: - - 3rd: - - 4th: - - 5th: - - 3. **League C:** - - 1st: N/A - - 2nd: - - 3rd: - - 4th: - - 5th: - - 1. **Single Sport Payouts:** 1st: $25 2nd: $10. If an un-owned team finishes 1st or 2nd, money goes into league pot and divided equally among top 5. Leftover amount after equally dividing goes to League Winner. If Owners tie, money is split evenly. - -7. **Waiver Wire** : Originally set by reverse draft order. A successful claim drops you to the bottom. All non-rostered players are on waivers. Waiver claims are made by submission via the site's Waivers Page. Select the player you want and hit submit. The league will be notified and there will be a 3-day waiting period where any other Owner may also claim the player. Claims process exactly 72 hours after the original claim, regardless of how many other owners put a claim in. At the 72-hour mark, the Owner with the highest waiver priority will be awarded the player and must roster the player. If no valid roster slots are available, the claim will process as invalid and go to the next Owner. If the Waiver deadline has already passed, a player in that sport may NOT be dropped, even if in the same sport as the player being claimed, unless claim/drop was entered prior to the deadline but processes after. Once submitted, a claim may be cancelled within 2 hours of entry. After 2 hours, claims may not be cancelled but the player being dropped may be adjusted up to the process time. At Certain times, the Waiting Period is waived for College Basketball, College Hockey, Kentucky Derby and LLWS. Due to the conference tournaments ending just before CBB and CHK brackets are announced, there will be no waiver period on claims in CBB and CHK. Instead, we will have a 1 week "quiet period" prior to the deadline. Claims will not be announced to the league and will process at the deadline based on waiver position. Extra draft picks at the end of KD & LLWS will be up for waiver claim until the individual draft begins. At that point, remaining draft picks may be claimed with no waiting period. _Golf/Tennis_: Owners do NOT receive credit for points earned in tournaments prior to waiver pickup. Teams may be dropped without a pick-up, leaving an open roster slot to be filled later. One roster slot must be dedicated to each sport and cannot be filled with a player from a different sport. Flex spots can be filled with players from any sport. - - 1. **Waiver Deadline:** See each sport for waiver deadlines. After the deadline NO PLAYERS may be claimed or dropped from roster, **except** for late drops and pending claims in the 3-day waiting period. After the deadline, there will be an email sent with players that were dropped within 12 hours of deadline or dropped after a successful claim and Owners will have an opportunity to claim them. This eliminates holding a player until the last minute to keep others from claiming. This also allows an Owner that put in a claim, but was trumped by a higher waiver to claim another player. - -8. **Trades** : Trades are submitted to Commish and if eligible, presented to the league. Trades are ineligible if they break any 338 rules stated herein or include any non-338 assets. There will be a 3-day voting period needing 8 Yes votes to pass. A no-response during the voting period will be considered an approval. Once a trade is submitted for Commish approval, the involved Owners are agreeing to the trade and may not make changes or vote against it unless all involved agree. Future Round Draft Picks may be traded, but only for the next draft to take place (if mid-draft, trades apply to that draft) and must be 1:1 (Owner-A trades 1st round pick to Owner-B for player and 5th round pick.) - 1. **Golf/Tennis**: Points already earned by players that are traded stay with the former Owner. - 2. **Trade Deadline** : See each sport for trade deadlines. After the deadline NO TEAMS for that sport may be traded relating to the current season. Teams may be traded after the deadline for future seasons. - - Future Round Draft Picks: Deadline for trading draft picks and players for future seasons is July 15. - 3. **Keepers**: Players acquired via trade are eligible to be named a Keeper. Player’s draft round will be determined by draft position in previous draft. - -9. **Draft:** Draft order determined by draw, with Owners place in one bucket and draft position placed in a different bucket. Conducted via website in Snake style. For leagues that have a smaller number of teams (e.g. KD, LLWS), every member must be able to draft a team from a league. Once the limit has been reached, only members without a team from that league will be allowed to draft from that sport. Once a draft pick has been submitted and emailed to the league, it cannot be changed. - 1. **Kentucky Derby** : The draft for the Kentucky Derby will be held in May once the field is announced. During the League draft, you will be selecting a draft position rather than an actual horse. (For example, you may use your 4th round selection for the first pick in the Kentucky Derby draft). Draft limited to 18 horses in case of a late scratch, Owner will be able to replace horse. If a horse is scratched after being drafted, a replacement may be picked at the completion of the draft and it will NOT count as a waiver claim. If multiple horses are scratched, replacements are chosen in original draft order. The first pick must be made by 8:30 AM PST on race day. If not made by 8:30, the OWNER with Pick #2 may draft and so on. Owner with #1 may pick at any time after that, but cannot take a horse already drafted. - 2. **LLWS:** The draft for the LLWS will begin in August, after the regional winners are set. During the League draft, you will be selecting a draft position rather than an actual team (For example, you may use your 4th round selection for the first pick in the LLWS draft). There are only 16 teams in the LLWS. - 3. **Steeplechase:** The draft for the STP will begin in July, exact date TBD. During the League draft, you will be selecting a draft position rather than an actual team (For example, you may use your 4th round selection for the first pick in the STP draft). - -10. **Keepers:** Each owner may designate up to 3 Players as Keepers. To be eligible, the Player must have been drafted in the previous draft and rostered the entire season. KD and LLWS draft picks and traded players are eligible for Keeper status, but free agent claims are not. A player designated as a Keeper will be drafted by the Owner one round earlier than taken in the previous draft. First Round picks are not eligible to be a Keeper. Keepers must be declared prior to the start of the draft and may not be changed once submitted. - 1. If 2 or 3 players designated as Keepers were previously drafted in the same round, one Keeper will move up an additional round. - - An Owner cannot designate 2 2nd round picks as Keepers unless Owner has multiple first round picks. - 2. If Owner has multiple picks in a round where a Keeper is taken, Owner may choose which pick Keeper is taken with. diff --git a/lib/ex338_web/templates/page/2020_rules.html.md b/lib/ex338_web/templates/page/2020_rules.html.md deleted file mode 100644 index 8af7bcaa..00000000 --- a/lib/ex338_web/templates/page/2020_rules.html.md +++ /dev/null @@ -1,107 +0,0 @@ -# 338 Rules for 2020 Season - -1. **Season:** The 2020 338 Season includes only sports with Championship game/series occurring in calendar year 2020. There are 14 permanent sports and a 15th sport that changes each year. Permanent sports are: NCAA Football, NFL, NCAA Basketball, NBA, NCAA Hockey, NHL, NCAA Baseball, MLB, Champions League, Kentucky Derby, PGA, LLWS, Men’s and Women’s Tennis. In 2020, the rotating sport will be Men’s Olympic Steeplechase. Subsequent years will be EPL (subject to change), World Cup and Women’s World Cup. - -2. **Ownership:** Teams are allowed to have multiple owners and split the entry fee and winnings any way they choose. - 1. For league voting purposes, each team will only receive one vote, regardless of number of owners. - 2. Owners are not allowed to own or have partial ownership in multiple 338 teams in the same league, but may own or have partial ownership in teams in different leagues. If relegation/promotion puts 2 teams with the same owner or partial owner in the same league, owner(s) may drop ownership stake to a single team or else the lower ranked team(s) will be pushed down a league until all owners have a stake in only one team/league. - - -2. **Rosters:** Each Owner has 20 roster slots with one slot dedicated to each sport (15 slots) and 5 slots open to any sport. Roster slots may be left open at any time. - - 1. **Tennis/Golf:** You do not have to use the same player throughout the year. 2 players used in the same tournament will require 2 roster slots, but waivering/trading players for each tournament is allowed and the scores will be combined. If using multiple roster slots, Owner must declare which slot a newly acquired player will be in. Owners cannot use the same player in multiple slots, unless 2 or more rostered players have been used in the same slot. In that case, order is determined by the highest ranked player at the time of acquisition going into the roster slot with the most points. EX: I have Tiger and Phil for The Masters, then trade them both for Rory and Scott prior to PGA. I must declare which players will be combined before the event. I choose Tiger/Scott & Phil/Rory. For the US Open, I trade Rory for Tiger and drop Scott for Stenson, making the combo Tiger/Scott/Tiger & Phil/Rory/Stenson. Then I claim Scott for British Open, keeping Tiger & Stenson. At time of claim, rankings are: #1-Scott, #3-Tiger, #7-Stenson. Combo becomes Tiger/Scott/Tiger/Scott, Phil/Rory/Stenson/Tiger, Stenson. - - 2. **Injured Reserve:** ** ** Each Owner will have one IR slot per individual sport (MT, WT, PGA). If a player withdraws from an event prior to the start for any reason, Owner may move the player to IR and claim a new player. This will not cost a waiver claim, but the replacement player will be automatically dropped at the end of the tournament. IR claims are processed after the waiver deadline, giving priority to waiver claims. IR claims must be submitted prior to the start of the tournament. If a player is suspended or does not qualify for an event, IR does not apply and the player must be replaced by a waiver claim. - -3. **Entry Fee:** League A: $225, B: $250, C: $275, D: $300 Payment due by Dec 1st, 2019. Late payment may result in single sport disqualification(s) at the discretion of the Board of Directors. - -4. **Scoring:** Points are awarded to the top 8 of each sport. 8 points for winning the league, 5 points for runner-up, 3 points for reaching the semifinals, and 1 point for reaching the quarterfinals. See individual sport for details. If any team/player is later stripped of a standing, prior to relegation, due to violation of any kind, points will be adjusted. Any violation and resulting standings change post-relegation will have no impact on the 338. - - 1. **College Football: ** Top 4 teams will be determined by playoffs. The 4 highest ranked teams in the final AP Poll who are not in the playoffs will each get 1 point. - - 2. **Tennis:** Tennis-only points are awarded for each of the 4 Grand Slam Events, immediately after the tournament. 1st=8, 2nd=5, SF=3, QF=1. Negative 2 points awarded to a Top 8 Seed losing in the 1st round and Negative 1 point for a Top 8 Seed losing in the 2nd round. Tennis points will be tallied individually, to a specific roster slot. If a player is traded or dropped, the Owner retains any points they have earned. EX: I have Djokovic who wins the Aussie Open, scoring me 8 pts. I trade him for Nadal prior to the French Open. Nadal wins, so I now have 16 pts. If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W). League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8. Owner must score at least 1 point to be eligible). - - 3. **Golf:** Golf-only points are awarded for each of the 4 majors, immediately after the tournament: 1st=50, 2nd=40, 3rd-35th=37,36,35...6,5, 36th-40th =3, made cut =1, missed cut= -5. Golf points will be tallied individually, to a specific roster slot. If a player is traded or dropped, the Owner retains any points they have earned. EX: I have Tiger and Phil. Tiger wins the Masters (50pts) and Phil finishes 11th (29pts). I keep Tiger but drop Phil and Tiger wins the US Open. I now have 100pts for Tiger and still have 29pts for Phil. Prior to the British Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut. I now have 95 pts for Tiger and 79 pts combined for Phil/Rory. Following the four majors League points will be awarded to top 8 total scores. Each Owner may have multiple places in the top 8. Owner must score at least 1 pt to be eligible. - - 4. **Tennis/Golf League Points:** Players may be dropped and traded throughout the year, resulting in multiple players earning points. Rosters will lock after the final major's deadline and in order for league points to be earned, a roster slot must be occupied by that sport for the number of players earning points. Ex: If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points. If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player. - - 5. **Tie Breaker:s** _Individual Sport_: Points awarded evenly to tied Owners. Golf points awarded in full to each tied owner. Money split for 1st or 2nd place tie. _League_: Owners will split the winnings evenly. _Relegation: _ See Below. - -5. **Payout:** assumes 14 in A, B, C, and 8 in D. Payouts listed from 2019 seasonand will be finalized once Div D teams are finalized. - - 1. **League A:** - - 1st: $1,225 - - 2nd: $875 - - 3rd: $625 - - 4th: $450 - - 5th: $325 - 2. **League B:** - - 1st: $1,000 - - 2nd: $700 - - 3rd: $500 - - 4th: $375 - - 5th: $300 - 3. **League C:** - - 1st: $920 - - 2nd: $625 - - 3rd: $430 - - 4th: $325 - - 5th: $275 - 4. **League D:** - - 1st: $650 - - 2nd: $475 - - 3rd: $375 - - 4th: $300 - - 5th: $0 - - **Single Sport Payouts:** 1st: $25 2nd: $10. If an un-owned team finishes 1st or 2nd, money goes into league pot and divided equally among top 5. Leftover amount after equally dividing goes to League Winner. If Owners tie, money is split evenly. - -6. **Waiver Wire:** Originally set by reverse draft order. A successful claim drops you to the bottom. All non-rostered players are on waivers. Waiver claims are made by submission via the site’s Waivers Page. Select the player you want and hit submit. The league will be notified and there will be a 3-day waiting period where any other Owner may also claim the player. Claims process exactly 72 hours after the original claim, regardless of how many other owners put a claim in. - -At the 72-hour mark, the Owner with the highest waiver priority will be awarded the player and must roster the player. If no valid roster slots are available, the claim will process as invalid and go to the next Owner. If the Waiver deadline has already passed, a player in that sport may NOT be dropped, even if in the same sport as the player being claimed, unless claim/drop was entered prior to the deadline and processes after. Once submitted, a claim may be cancelled within 2 hours of entry. After 2 hours, claims may not be cancelled but the player being dropped may be adjusted up to the process time. - -Waiting Period is waived for College Basketball, College Hockey, Kentucky Derby, and LLWS. Due to the conference tournaments ending just before CBB and CHK brackets are announced, there will be no waiver period on claims in CBB and CHK. Instead, we will have a 1-week “quiet period” prior to the deadline. Claims will not be announced to the league and will process at the deadline based on waiver position. Extra draft picks at the end of KD & LLWS will be up for waiver claim until the individual draft begins. At that point, remaining draft picks may be claimed with no waiting period. - -Golf/Tennis: Owners do NOT receive credit for points earned in tournaments prior to waiver pickup. Teams may be dropped without a pick-up, leaving an open roster slot to be filled later. One roster slot must be dedicated to each sport and cannot be filled with a player from a different sport. Flex spots can be filled with players from any sport. - - 1. **Waiver Deadline:** See each sport for waiver deadlines. After the deadline NO TEAMS may be claimed or dropped from roster, **except** for late drops and pending claims in the 3-day waiting period. . After the deadline, there will be a an email sent with teams that were dropped within 12 hours of deadline or dropped after a successful claim and Owners will have an opportunity to claim them. This eliminates holding a team until the last minute to keep others from claiming. This also allows an Owner that put in a claim, but was trumped by a higher waiver to claim another team. For sports with multiple championships, waivers will be closed for that sport between each championship waiver deadline and the championship. After the championship, waivers for the sport will reopen. - -7. **Trades:** Trades are submitted to Commish and if eligible, presented to the league. Trades are ineligible if they break any 338 rules stated herein or include any non-338 assets. There will be a 3-day voting period needing 8 Yes votes to pass. A no-response during the voting period will be considered an approval. Once a trade is submitted for Commish approval, the involved Owners are agreeing to the trade and may not make changes or vote against it unless all involved agree. Future Round Draft Picks may be traded, but only for the next draft to take place (if mid-draft, trades apply to that draft) and must be 1:1 (Owner-A trades 1st round pick to Owner-B for team and 5th round pick.) - - 1. **Golf/Tennis:** Points already earned by players that are traded stay with the former Owner. - - 2. **Trade Deadline:** See Championships page for deadlines. After the deadline NO TEAMS for that sport may be traded. - - 3. **Future Round Draft Picks:** Deadline for trading draft picks is the current season MLB trade deadline. - -8. **Draft:** Draft order determined by random draw, with Owners placed in one bucket and draft position placed in a different bucket. The draft is conducted via website in Snake style. For leagues that have a smaller number of teams (e.g. KD, LLWS), every member must be able to draft a team from a league. Once the limit has been reached, only members without a team from that league will be allowed to draft from that sport. Once a draft pick has been emailed to the league, it cannot be changed. - - 1. **Time Limit:** Each Owner will have a cumulative total of 30 hours to make all 20 picks. There is no time limit for each pick. If an Owner exceeds 30 hours in total, the draft queue must be utilized to make picks. If the draft queue is empty, the Owner is able to manually enter a pick, but teh site will proceed withe the draft and allow the next Owner to enter their pick. - -9. **In-Season Drafts:** Some sports will include a secondary draft in-season. During the main League Draft, you will select a draft position rather than a specific player (i.e. With my first round pick in the League draft, I select the First Pick of the Kentucky Derby). The following sports will have a secondary in-season daft: - **Kentucky Derby:** Draft will take place morning of race day. The first pick must be made by 7:30 AM PST and subsequent picks will each have a set deadline. If not in by the deadline, site will allow next owner to pick and the draft can proceed. A skipped owner may pick at any time after that, but cannot take a horse already drafted. Draft limited to 18 horses so in the event of a late scratch Owner will be able to replace horse. If a horse is scratched after being drafted, a replacement may be picked at the completion of the draft and it will NOT count as a waiver claim. If multiple horses are scratched, replacements are chosen in original draft order. - **LLWS:** The draft for the LLWS will begin in August, on the Wednesday before the tournament starts Thursday. Each pick will have a set deadline. If not in by the deadline, site will allow next owner to pick and the draft can proceed. A skipped owner may pick at any time after that, but cannot take a team already drafted. There are only 16 teams in the LLWS. - **Steeplechase:** The draft for the STP will begin in July, exact date TBD. - -9. **Relegation:** Based on League Points, the bottom 4 Owners in A,B and C will be relegated down a league. The top 4 Owners in B,C and D will move up one League. Because relegation and the next season's draft will take place prior to the end of the MLB season, we will use the MLB regular season standings at the end of the day on the day of the US Open Men's final. This is for relegation purposes only. League points will still be based on the playoffs. - - 1. For relegation, points will be awarded based on the following: - - * 8 pts: Best Overall Record - * 5 pts: Best Overall Record in other league - * 3 pts: 2nd Best Record in each league: - * 1 pt: 3rd division leader + best overall record of non-division leader. If top 2 teams are in same division, then 1 point to other 2 division leaders. - - 2. **TIEBREAKERS (in order of application):** - - * _MLB_: Run Differential, Head-to-Head Record, Record in September, Coin Flip - * _LEAGUE_: # of championships, # of teams scoring league points, lowest drafted team to score a league point (excludes waiver claims and trades). - - 3. If an Owner gets relegated but finishes in the money after actual MLB results are recorded, that Owner will automatically move up to the next league the following season as the #1 team, regardless of actual position. - 4. If relegation/promotion puts 2 teams with the same owner or partial owner in the same league, owner(s) may drop ownership stake to a single team or else the lower ranked team(s) will be pushed down a league until all owners have a stake in only one team/league. In this case, the last team relegated (i.e. 11th place) will move back up. - - 5. **DRAFT PICK TRADES:** If relegation results in Owners that traded draft picks in different leagues, the traded picks will take place at the end of the round. EX: I trade my 1st round pick away and get a 10th round pick in return and I get relegated to B. The Owner I traded with would get my 1st round pick at the end of the 1st round. I would get the 10th round pick I traded for at the end of the 10th round. If both teams involved in the trade stay in the same league, or both get relegated, they would swap actual picks. If multiple Owners have supplemental picks, the order will be in reverse of the picks in that round. - -11. **Upper League Openings:** New Owners will be placed in the lowest league of the new season, unless joining as a partial owner to an existing team. Exceptions may be granted at the discretion of the Board of Directors - -12. **Owner Departures** If an Owner finishes in the top 10 or is promoted but does not play the following season or an Owner is forced to drop a team or move down a league due to ownership of multiple teams, the last Owner relegated (i.e. 11th place) will move back up. This rule will apply until any openings are in the lowest league at which point a new owner will be added. Exceptions may be made at the discretion of the 338 Board of Directors. diff --git a/lib/ex338_web/templates/page/2021_keeper_rules.html.md b/lib/ex338_web/templates/page/2021_keeper_rules.html.md deleted file mode 100644 index dbc36b6c..00000000 --- a/lib/ex338_web/templates/page/2021_keeper_rules.html.md +++ /dev/null @@ -1,124 +0,0 @@ -# 2020-2021 338 Keeper League Special One-Time Rule Changes. - -## Standard rules have not been completely updated (I’m lazy). In the event of conflicting rules, special rules will supersede standard rules. - -### Special Rules - -1. All roster slots will become flex slots and there will be no requirements to draft players from all 15 sports. Owners may construct their roster with any combination of players. - -1. Total roster slots will be reduced to 15. - -1. There will be no single sport payouts. - -1. Due to the cancellation of the 2020 LLWS, the 2020 Kentucky Derby (Fall KD), rescheduled for September 5 will replace LLWS. The 2021 Kentucky Derby in May (Spring KD) will be a separate sport. - -1. There will be no restrictions on drafting KD picks, so some owners may not get a pick. - -1. Rescheduled 2020 events will be included in the 20-21 season. PGA will include the 2020 Masters and 2020 US Open, making a potential 6 PGA events. MT & WT will include the 20 French Open, making a potential 5 Tennis events. - -1. In order for the season to be official and payouts made, 8 sports must be completed or have the league name official results by August 4th, 2021. If 8 or more sports are cancelled or delayed beyond August 4th, 2021 the 338 season will be cancelled and all entry fees refunded with no winnings paid out. Trades of future draft picks will also be cancelled. - -1. If a sport is cancelled or delayed beyond Aug 4th, 2021 no points will be awarded, unless the league officially names a champion. All trades will be valid, unless the entire 338 season is cancelled. - -1. In the event that a sport does not complete a season **and** the league names an official champion but not a clear 2nd – 8th, the 338 will use the following rankings to award league points: - - * MLB – Relegation point system and tiebreaker (see Rule 11) - * CFB – AP Poll - * NFL – Standings following MLB relegation point system - * CBK – AP Poll - * NBA – Standings following MLB relegation point system - * CHK – Pairwise - * NHL – Standings following MLB relegation point system - * NCAA Baseball – _Poll TBD_ - * Champions League – points split among tied teams - * EXCEPTIONS: Actual results will be used if a league has partially completed the postseason at the time of cancellation/suspension. - -1. In order for PGA, MT and WT results to count in league play, at least 3 events must be completed by Aug 4th, 2021. - -### 338 Keeper Standard Rules for 2021 - -1. **Season:** The 2020-2021 338 Keeper Season includes sports with championships between August 1 2020 and ends with the Men’s Olympic Steeplechase Final. There are 14 permanent sports and a 15th sport that changes each year. Permanent sports are: NCAA Football, NFL, NCAA Basketball, NBA, NCAA Hockey, NHL, NCAA Baseball, MLB, Champions League, Kentucky Derby, PGA, LLWS, Men’s and Women’s Tennis. In 2020-21, the rotating sport will be Men’s Olympic Steeplechase. Subsequent years will be World Cup, Women’s World Cup. - -1. **Ownership:** Teams are allowed to have multiple owners and split the entry fee and winnings any way they choose. - 1. For league voting purposes, each team will only receive one vote, regardless of number of owners. - 2. Owners are not allowed to own or have partial ownership in multiple 338 teams in the same league, but may own or have partial ownership in teams in different leagues. If relegation puts 2 teams with the same owner or partial owner in the same league, that owner must drop ownership or partial ownership of one team and remain uninvolved until the teams are no longer in the same league. - -1. **Rosters:** Each Owner has 20 roster slots with one slot dedicated to each sport (15 slots) and 5 slots open to any sport.  Roster slots may be left open at any time.   - 1. Tennis/Golf: You do not have to use the same player throughout the year.  2 players used in the same tournament will require 2 roster slots, but waivering/trading players for each tournament is allowed and the scores will be combined.  If using multiple roster slots, Owner must declare which slot a newly acquired player will be in.  Owners cannot use the same player in multiple slots, unless 2 or more rostered players have been used in the same slot.  In that case, order is determined by the highest ranked player at the time of acquisition going into the roster slot with the most points.  EX: I have Tiger and Phil for The Masters, then trade them both for Rory and Scott prior to PGA.  I must declare which players will be combined before the event.  I choose Tiger/Scott & Phil/Rory.  For the US Open, I trade Rory for Tiger and drop Scott for Stenson, making the combo Tiger/Scott/Tiger & Phil/Rory/Stenson.  Then I claim Scott for British Open, keeping Tiger & Stenson.  At time of claim, rankings are: #1-Scott, #3-Tiger, #7-Stenson.  Combo becomes Tiger/Scott/Tiger/Scott, Phil/Rory/Stenson/Tiger, Stenson. - - 1. Injured Reserve: Each Owner will have one IR slot per individual sport (MT, WT, PGA). If a player withdraws from an event prior to the start for any reason, Owner may move the player to IR and claim a new player. This will not cost a waiver claim, but the replacement player will be automatically dropped at the end of the tournament. IR claims are processed after the waiver deadline, giving priority to waiver claims. IR claims must be submitted prior to the start of the tournament. If a player is suspended or does not qualify for an event, IR does not apply and the player must be replaced by a waiver claim. - 1. In terms of roster slot occupation, the injured player maintains the occupied roster slot. If the replacement player is added via waivers for a future event, they are not considered to have occupied a roster slot.            - -1. **Entry Fee:** $200 Payment due by Dec 1st, 2020. **Late payment may result in single sport disqualification(s) at the discretion of the Board of Directors.** - -1. **Scoring:** Points are awarded to the top 8 of each sport. 8 points for winning the league, 5 points for runner-up, 3 points for reaching the semifinals, and 1 point for reaching the quarterfinals. See individual sport for details.  If any team/player is later stripped of a standing, **prior to relegation** or the final championship of the year (whichever comes first), due to violation of any kind, points will be adjusted. Any violation and resulting standings change post-deadline will have no impact on the 338. - - 1. College Football:  Top 4 teams will be determined by the CFP.  The 4 highest ranked teams in the final AP Poll who are not in the playoffs will each get 1 point. - - 1.  Tennis: Tennis-only points are awarded for each of the 4 Grand Slam Events (2020 US Open, 2021 Aussie Open, French Open and Wimbledon) immediately after the tournament. 1st=8, 2nd=5, SF=3, QF=1. Negative 2 points awarded to a Top 8 Seed losing in the 1st round and Negative 1 point for a Top 8 Seed losing in the 2nd round.  Tennis points will be tallied individually, to a specific roster slot.  If a player is traded or dropped, the Owner retains any points they have earned.  EX: I have Djokovic who wins the Aussie Open, scoring me 8 pts.  I trade him for Nadal prior to the French Open.  Nadal wins, so I now have 16 pts.  If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W).  League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8.  Owner must score at least 1 point to be eligible).    - - 1. Golf: Golf-only points are awarded for each of the 4 2020 majors, immediately after the tournament: 1st=50, 2nd=40, 3rd-35th=37,36,35...6,5, 36th-40th =3, made cut =1, missed cut= -5.  Golf points will be tallied individually, to a specific roster slot.  If a player is traded or dropped, the Owner retains any points they have earned.  EX: I have Tiger and Phil.  Tiger wins the Masters (50pts) and Phil finishes 11th (29pts).  I keep Tiger but drop Phil and Tiger wins the PGA. I now have 100pts for Tiger and still have 29pts for Phil.  Prior to the US Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut.  I now have 95 pts for Tiger and 79 pts combined for Phil/Rory.  Following the four majors League points will be awarded to top 8 total scores.  Each Owner may have multiple places in the top 8.  Owner must score at least 1 pt to be eligible.                                   - 1. Tennis/Golf League Points: Players may be dropped and traded throughout the year, resulting in multiple players earning points.  Rosters will lock after the final major's deadline and in order for league points to be earned, a roster slot must be occupied by that sport for the number of players earning points.  Ex: If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points.  If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player.       - - 1. Tie Breakers: - * Individual Sport: League Points will be split evenly among all tied Owners. Golf points awarded in full to each tied owner.  Money split for 1st and/or 2nd place tie. - * League:  Owners will split the winnings evenly.  - * Relegation:  See Below. - -1. **Payout:** - - All Leagues: - - * 1st: $875 - * 2nd: $650 - * 3rd: $475 - * 4th: $350 - * 5th: $250 - - 1. ~~Single Sport Payouts:  1st: $25 2nd: $10. If an un-owned team finishes 1st or 2nd, money goes into league pot and divided equally among top 5. Leftover amount after equally dividing goes to League Winner. If Owners tie, money is split evenly~~.    - -1. **Waiver Wire:** Originally set by reverse draft order. A successful claim drops you to the bottom. All non-rostered players are on waivers. Waiver claims are made by submission via the site’s Waivers Page. Select the player you want and hit submit. The league will be notified and there will be a 3-day waiting period where any other Owner may also claim the player. Claims process exactly 72 hours after the original claim, regardless of how many other owners put a claim in. At the 72-hour mark, the Owner with the highest waiver priority will be awarded the player and must roster the player. If no valid roster slots are available, the claim will process as invalid and go to the next Owner. If the Waiver deadline has already passed, a player in that sport may NOT be dropped, even if in the same sport as the player being claimed, unless claim/drop was entered prior to the deadline but processes after. Once submitted, a claim may be cancelled within 2 hours of entry. After 2 hours, claims may not be cancelled but the player being dropped may be adjusted up to the process time.  Waiting Period is waived for College Basketball, College Hockey, Kentucky Derby and LLWS.  Due to the conference tournaments ending just before CBB and CHK brackets are announced, there will be no waiver period on claims in CBB and CHK.  Instead, we will have a 1 week “quiet period” prior to the deadline.  Claims will not be announced to the league and will process at the deadline based on waiver position. Extra draft picks at the end of KD & LLWS will be up for waiver claim until the individual draft begins. At that point, remaining draft picks may be claimed with no waiting period. Golf/Tennis: Owners do NOT receive credit for points earned in tournaments prior to waiver pickup.  Teams may be dropped without a pick-up, leaving an open roster slot to be filled later.  One roster slot must be dedicated to each sport and cannot be filled with a player from a different sport. Flex spots can be filled with players from any sport.   - - 1. Waiver Deadline: See each sport for waiver deadlines. After the deadline NO PLAYERS may be claimed or dropped from roster, **except** for late drops and pending claims in the 3-day waiting period.  After the deadline, there will be an email sent with players that were dropped within 12 hours of deadline or dropped after a successful claim and Owners will have an opportunity to claim them.  This eliminates holding a player until the last minute to keep others from claiming.  This also allows an Owner that put in a claim, but was trumped by a higher waiver to claim another player. - -1. **Trades:** Trades are submitted to Commish and if eligible, presented to the league. Trades are ineligible if they break any 338 rules stated herein or include any non-338 assets. There will be a 3-day voting period needing 8 Yes votes to pass. A no-response during the voting period will be considered an approval.  Once a trade is submitted for Commish approval, the involved Owners are agreeing to the trade and may not make changes or vote against it unless all involved agree. Future Round Draft Picks may be traded, but only for the next draft to take place (if mid-draft, trades apply to that draft) and must be 1:1 (Owner-A trades 1st round pick to Owner-B for player and 5th round pick.)  - - 1. Golf/Tennis: Points already earned by players that are traded stay with the former Owner.  - 1. Trade Deadline: See each sport for trade deadlines. After the deadline NO TEAMS for that sport may be traded relating to the current season. Teams may be traded after the deadline for future seasons.  - 1. Future Round Draft Picks: Deadline for trading draft picks and players for future seasons is July 1.  - 1. Keepers: Players acquired via trade are eligible to be named a Keeper. Player’s draft round will be determined by draft position in previous draft. - 1. Cancellation/Suspension: If a sport is cancelled or suspended, trades will remain executed unless the entire 338 season is cancelled at which points all trades are nullified.    - -1. **Draft:** Draft order determined by draw, with Owners place in one bucket and draft position placed in a different bucket. Conducted via website in Snake style. ~~For leagues that have a smaller number of teams (e.g. KD, LLWS), every member must be able to draft a team from a league. Once the limit has been reached, only members without a team from that league will be allowed to draft from that sport.~~  Once a draft pick has been submitted and emailed to the league, it cannot be changed. - - 1. Time Limit: Each Owner will have a cumulative total of 30 hours to make all 20 picks. There is no time limit on each pick. If an Owner exceeds 30 hours in total, the draft queue must be utilized to make picks. If the queue is empty, the Owner is able to manually enter a pick, but the site will proceed with the draft and allow the next Owner to enter their pick. - - 1. In-Season Drafts: Some sports will include a secondary draft in-season. During the main League Draft, you will select a draft position rather than a specific player (i.e. With my first round pick in the League draft, I select the First Pick of the Kentucky Derby). The following sports will have a secondary in-season draft: - - 1. Kentucky Derby: Draft will take place morning of race day. The first pick must be made by 7:30 AM PST and subsequent picks will each have a set deadline. If not in by the deadline, site will allow next owner to pick and the draft can proceed. A skipped owner may pick at any time after that, but cannot take a horse already drafted.   ~~Draft limited to 18 horses so in the event of a late scratch Owner will be able to replace horse.~~  If a horse is scratched after being drafted, a replacement may be picked at the completion of the draft and it will NOT count as a waiver claim.  If multiple horses are scratched, replacements are chosen in original draft order. - - 1. LLWS: The draft for the LLWS will begin in August, on the Wednesday before the tournament starts Thursday. Each pick will have a set deadline. If not in by the deadline, site will allow next owner to pick and the draft can proceed. A skipped owner may pick at any time after that, but cannot take a team already drafted. There are only 16 teams in the LLWS. - - 1. Steeplechase: The draft for the STP will begin in July, exact date TBD. - -1. **Keepers:** Each owner may designate up to 3 Players as Keepers. To be eligible, the Player must have been drafted in the previous draft and rostered the entire season. KD and LLWS draft picks and traded players are eligible for Keeper status, but free agent claims are not. A player designated as a Keeper will be drafted by the Owner one round earlier than taken in the previous draft. First Round picks are not eligible to be a Keeper. Keepers must be declared prior to the start of the draft and may not be changed once submitted. - 1. If 2 or 3 players designated as Keepers were previously drafted in the same round and Owner does not have multiple picks in that round, one Keeper will move up an additional round. Owner may select which player moves up another round. - 1. An Owner cannot designate 2 2nd round picks as Keepers unless Owner has multiple first round picks. - 1. If Owner has multiple picks in a round where a Keeper is taken, Keeper is selected with Owner’s original pick, not pick acquired via trade. - -1. **Relegation:** ~~Based on League Points, the bottom 4 Owners in A and B will be relegated to League B and C respectively. The top 4 Owners in B and C will move up to A and B.  Because relegation and the next season’s draft will take place prior to the end of the MLB season, we will use the MLB regular season standings at the end of the day on the day of the US Open Men’s final.  This is for relegation purposes only.  League points will still be based on the playoffs.~~  For relegation, points will be awarded based on the following:  - - * 8 pts: Best Overall Record  - * 5 pts: Best Overall Record in other league  - * 3 pts: 2nd Best Record in each league:     - * 1 pt: 3rd division leader + best overall record of non-division leader.  If the top 2 teams are in the same division, then 1 point to other 2 division leaders. - - 1. TIEBREAKERS (in order of application): - 1. MLB: Run Differential, Record in September, Head-to-Head Record, Coin Flip  - 1. LEAGUE: # of championships, # of teams scoring league points, lowest drafted team to score a league point (excludes waiver claims and trades).   - 1. DRAFT PICK TRADES: If relegation results in Owners that traded draft picks in different leagues, the traded picks will take place at the end of the round.  EX: I trade my 1st round pick away and get a 10th round pick in return and I get relegated to B.  The Owner I traded with would get my 1st round pick at the end of the 1st round.  I would get the 10th round pick I traded for at the end of the 10th round.  If both teams involved in the trade stay in the same league, or both get relegated, they would swap actual picks.  If multiple Owners have supplemental picks, the order will be in reverse of the picks in that round.   - 1. If an Owner gets relegated from A to B or B to C, but finishes in the money after actual MLB results are recorded, that Owner will automatically move up to the next league (after their relegation season) as the #1 team, regardless of actual position in B or C.   - -1. **New Owners:** New Owners will be placed in the lowest league of the new season, unless joining as a partial owner to an existing team. Exceptions may be granted at the discretion of the Board of Directors. - -1. **Upper League Openings:** If an Owner finishes in the top 10 in A or B but does not play the following season or an Owner is forced to drop a team due to ownership of multiple teams, the 11th place Owner will remain in A and/or B and a new Owner will be added to C. Exceptions may be made at the discretion of the 338 Board of Directors. diff --git a/lib/ex338_web/templates/page/2021_rules.html.md b/lib/ex338_web/templates/page/2021_rules.html.md deleted file mode 100644 index 8cd84f4a..00000000 --- a/lib/ex338_web/templates/page/2021_rules.html.md +++ /dev/null @@ -1,127 +0,0 @@ -# 2020-2021 338 Special One-Time Rule Changes. - -## Standard rules have not been completely updated (I’m lazy). In the event of conflicting rules, special rules will supersede standard rules. - -### Special Rules - -1. All roster slots will become flex slots and there will be no requirements to draft players from all 15 sports. Owners may construct their roster with any combination of players. - -1. Total roster slots will be reduced to 15. - -1. All 3 leagues, A, B and C will have a $200 entry fee and equal payouts. There will be no single sport payouts. - -1. There will be no relegation at the end of the 2020-21 season. - -1. Due to the cancellation of the 2020 LLWS, the 2020 Kentucky Derby (Fall KD), rescheduled for September 5 will replace LLWS. The 2021 Kentucky Derby in May (Spring KD) will be a separate sport. - -1. There will be no restrictions on drafting KD picks, so some owners may not get a pick. - -1. Rescheduled 2020 events will be included in the 20-21 season. PGA will include the 2020 Masters and 2020 US Open, making a potential 6 PGA events. MT & WT will include the 20 French Open, making a potential 5 Tennis events. - -1. In order for the season to be official and payouts made, 8 sports must be completed or have the league name official results by August 4th, 2021. If 8 or more sports are cancelled or delayed beyond Aug 4th, 2021 the 338 season will be cancelled and all entry fees refunded with no winnings paid out. Trades of future draft picks will also be cancelled. - -1. If a sport is cancelled or delayed beyond Aug 4th, 2021 no points will be awarded, unless the league officially names a champion. All trades will be valid, unless the entire 338 season is cancelled. - -1. In the event that a sport does not complete a season **and** the league names an official champion but not a clear 2nd – 8th, the 338 will use the following rankings to award league points: - - * MLB – Relegation point system and tiebreaker (see Rule 11) - * CFB – AP Poll - * NFL – Standings following MLB relegation point system - * CBK – AP Poll - * NBA – Standings following MLB relegation point system - * CHK – Pairwise - * NHL – Standings following MLB relegation point system - * NCAA Baseball – _Poll TBD_ - * Champions League – points split among tied teams - * EXCEPTIONS: Actual results will be used if a league has partially completed the postseason at the time of cancellation/suspension. - -1. In order for PGA, MT and WT results to count in league play, at least 3 events must be completed by Aug 4th, 2021. - -### 338 Standard Rules for 2021 - -1. **Season:** The 2020-2021 338 Season includes sports with championships between August 1 2020 and ends with the Men’s Olympic Steeplechase Final. There are 14 permanent sports and a 15th sport that changes each year. Permanent sports are: NCAA Football, NFL, NCAA Basketball, NBA, NCAA Hockey, NHL, NCAA Baseball, MLB, Champions League, Kentucky Derby, PGA, LLWS, Men’s and Women’s Tennis. In 2020-21, the rotating sport will be Men’s Olympic Steeplechase. Subsequent years will be World Cup, Women’s World Cup. - -1. **Ownership:** Teams are allowed to have multiple owners and split the entry fee and winnings any way they choose. - 1. For league voting purposes, each team will only receive one vote, regardless of number of owners. - 2. Owners are not allowed to own or have partial ownership in multiple 338 teams in the same league, but may own or have partial ownership in teams in different leagues. If relegation/promotion puts 2 teams with the same owner or partial owner in the same league, owner(s) may drop ownership stake to a single team or else the lower ranked team(s) will be pushed down a league until all owners have a stake in only one team/league. - -1. **Rosters:** Each Owner has 20 roster slots with one slot dedicated to each sport (15 slots) and 5 slots open to any sport.  Roster slots may be left open at any time.   - 1. Tennis/Golf: You do not have to use the same player throughout the year.  2 players used in the same tournament will require 2 roster slots, but waivering/trading players for each tournament is allowed and the scores will be combined.  If using multiple roster slots, Owner must declare which slot a newly acquired player will be in.  Owners cannot use the same player in multiple slots, unless 2 or more rostered players have been used in the same slot.  In that case, order is determined by the highest ranked player at the time of acquisition going into the roster slot with the most points.  EX: I have Tiger and Phil for The Masters, then trade them both for Rory and Scott prior to PGA.  I must declare which players will be combined before the event.  I choose Tiger/Scott & Phil/Rory.  For the US Open, I trade Rory for Tiger and drop Scott for Stenson, making the combo Tiger/Scott/Tiger & Phil/Rory/Stenson.  Then I claim Scott for British Open, keeping Tiger & Stenson.  At time of claim, rankings are: #1-Scott, #3-Tiger, #7-Stenson.  Combo becomes Tiger/Scott/Tiger/Scott, Phil/Rory/Stenson/Tiger, Stenson. - - 1. Injured Reserve: Each Owner will have one IR slot per individual sport (MT, WT, PGA). If a player withdraws from an event prior to the start for any reason, Owner may move the player to IR and claim a new player. This will not cost a waiver claim, but the replacement player will be automatically dropped at the end of the tournament. IR claims are processed after the waiver deadline, giving priority to waiver claims. IR claims must be submitted prior to the start of the tournament. If a player is suspended or does not qualify for an event, IR does not apply and the player must be replaced by a waiver claim. - 1. In terms of roster slot occupation, the injured player maintains the occupied roster slot. If the replacement player is added via waivers for a future event, they are not considered to have occupied a roster slot.            - -1. **Entry Fee:** League A: $200, B: $200, C: $200. Payment due by Dec 1st, 2020. **Late payment may result in single sport disqualification(s) at the discretion of the Board of Directors.** - -1. **Scoring:** Points are awarded to the top 8 of each sport. 8 points for winning the league, 5 points for runner-up, 3 points for reaching the semifinals, and 1 point for reaching the quarterfinals. See individual sport for details.  If any team/player is later stripped of a standing, **prior to relegation** or the final championship of the year (whichever comes first), due to violation of any kind, points will be adjusted. Any violation and resulting standings change post-deadline will have no impact on the 338. - - 1. College Football:  Top 4 teams will be determined by the CFP.  The 4 highest ranked teams in the final AP Poll who are not in the playoffs will each get 1 point. - - 1.  Tennis: Tennis-only points are awarded for each of the 4 Grand Slam Events (2020 US Open, 2021 Aussie Open, French Open and Wimbledon) immediately after the tournament. 1st=8, 2nd=5, SF=3, QF=1. Negative 2 points awarded to a Top 8 Seed losing in the 1st round and Negative 1 point for a Top 8 Seed losing in the 2nd round.  Tennis points will be tallied individually, to a specific roster slot.  If a player is traded or dropped, the Owner retains any points they have earned.  EX: I have Djokovic who wins the Aussie Open, scoring me 8 pts.  I trade him for Nadal prior to the French Open.  Nadal wins, so I now have 16 pts.  If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W).  League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8.  Owner must score at least 1 point to be eligible).    - - 1. Golf: Golf-only points are awarded for each of the 4 2020 majors, immediately after the tournament: 1st=50, 2nd=40, 3rd-35th=37,36,35...6,5, 36th-40th =3, made cut =1, missed cut= -5.  Golf points will be tallied individually, to a specific roster slot.  If a player is traded or dropped, the Owner retains any points they have earned.  EX: I have Tiger and Phil.  Tiger wins the Masters (50pts) and Phil finishes 11th (29pts).  I keep Tiger but drop Phil and Tiger wins the PGA. I now have 100pts for Tiger and still have 29pts for Phil.  Prior to the US Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut.  I now have 95 pts for Tiger and 79 pts combined for Phil/Rory.  Following the four majors League points will be awarded to top 8 total scores.  Each Owner may have multiple places in the top 8.  Owner must score at least 1 pt to be eligible.                                   - 1. Tennis/Golf League Points: Players may be dropped and traded throughout the year, resulting in multiple players earning points.  Rosters will lock after the final major's deadline and in order for league points to be earned, a roster slot must be occupied by that sport for the number of players earning points.  Ex: If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points.  If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player.       - - 1. Tie Breakers: - * Individual Sport: League Points will be split evenly among all tied Owners. Golf points awarded in full to each tied owner.  Money split for 1st and/or 2nd place tie. - * League:  Owners will split the winnings evenly.  - * Relegation:  See Below. - -1. **Payout:** - - All Leagues: - - * 1st: $825 - * 2nd: $625 - * 3rd: $450 - * 4th: $300 - * 5th: $200 - - 1. ~~Single Sport Payouts:  1st: $25 2nd: $10. If an un-owned team finishes 1st or 2nd, money goes into league pot and divided equally among top 5. Leftover amount after equally dividing goes to League Winner. If Owners tie, money is split evenly~~.    - -1. **Waiver Wire:** Originally set by reverse draft order. A successful claim drops you to the bottom. All non-rostered players are on waivers. Waiver claims are made by submission via the site’s Waivers Page. Select the player you want and hit submit. The league will be notified and there will be a 3-day waiting period where any other Owner may also claim the player. Claims process exactly 72 hours after the original claim, regardless of how many other owners put a claim in. At the 72-hour mark, the Owner with the highest waiver priority will be awarded the player and must roster the player. If no valid roster slots are available, the claim will process as invalid and go to the next Owner. If the Waiver deadline has already passed, a player in that sport may NOT be dropped, even if in the same sport as the player being claimed, unless claim/drop was entered prior to the deadline but processes after. Once submitted, a claim may be cancelled within 2 hours of entry. After 2 hours, claims may not be cancelled but the player being dropped may be adjusted up to the process time.  Waiting Period is waived for College Basketball, College Hockey, Kentucky Derby and LLWS.  Due to the conference tournaments ending just before CBB and CHK brackets are announced, there will be no waiver period on claims in CBB and CHK.  Instead, we will have a 1 week “quiet period” prior to the deadline.  Claims will not be announced to the league and will process at the deadline based on waiver position. Extra draft picks at the end of KD & LLWS will be up for waiver claim until the individual draft begins. At that point, remaining draft picks may be claimed with no waiting period. Golf/Tennis: Owners do NOT receive credit for points earned in tournaments prior to waiver pickup.  Teams may be dropped without a pick-up, leaving an open roster slot to be filled later.  One roster slot must be dedicated to each sport and cannot be filled with a player from a different sport. Flex spots can be filled with players from any sport.   - - 1. Waiver Deadline: See each sport for waiver deadlines. After the deadline NO PLAYERS may be claimed or dropped from roster, **except** for late drops and pending claims in the 3-day waiting period.  After the deadline, there will be an email sent with players that were dropped within 12 hours of deadline or dropped after a successful claim and Owners will have an opportunity to claim them.  This eliminates holding a player until the last minute to keep others from claiming.  This also allows an Owner that put in a claim, but was trumped by a higher waiver to claim another player. - -1. **Trades:** Trades are submitted to Commish and if eligible, presented to the league. Trades are ineligible if they break any 338 rules stated herein or include any non-338 assets. There will be a 3-day voting period needing 8 Yes votes to pass. A no-response during the voting period will be considered an approval.  Once a trade is submitted for Commish approval, the involved Owners are agreeing to the trade and may not make changes or vote against it unless all involved agree. Future Round Draft Picks may be traded, but only for the next draft to take place (if mid-draft, trades apply to that draft) and must be 1:1 (Owner-A trades 1st round pick to Owner-B for player and 5th round pick.)  - - 1. Golf/Tennis: Points already earned by players that are traded stay with the former Owner.  - 1. Trade Deadline: See each sport for trade deadlines. After the deadline NO TEAMS for that sport may be traded relating to the current season. Teams may be traded after the deadline for future seasons.  - 1. Future Round Draft Picks: Deadline for trading draft picks and players for future seasons is July 1.  - 1. Keepers: Players acquired via trade are eligible to be named a Keeper. Player’s draft round will be determined by draft position in previous draft. - 1. Cancellation/Suspension: If a sport is cancelled or suspended, trades will remain executed unless the entire 338 season is cancelled at which points all trades are nullified.    - -1. **Draft:** Draft order determined by draw, with Owners place in one bucket and draft position placed in a different bucket. Conducted via website in Snake style. ~~For leagues that have a smaller number of teams (e.g. KD, LLWS), every member must be able to draft a team from a league. Once the limit has been reached, only members without a team from that league will be allowed to draft from that sport.~~  Once a draft pick has been submitted and emailed to the league, it cannot be changed. - - 1. Time Limit: Each Owner will have a cumulative total of 30 hours to make all 20 picks. There is no time limit on each pick. If an Owner exceeds 30 hours in total, the draft queue must be utilized to make picks. If the queue is empty, the Owner is able to manually enter a pick, but the site will proceed with the draft and allow the next Owner to enter their pick. - - 1. In-Season Drafts: Some sports will include a secondary draft in-season. During the main League Draft, you will select a draft position rather than a specific player (i.e. With my first round pick in the League draft, I select the First Pick of the Kentucky Derby). The following sports will have a secondary in-season draft: - - 1. Kentucky Derby: Draft will take place morning of race day. The first pick must be made by 7:30 AM PST and subsequent picks will each have a set deadline. If not in by the deadline, site will allow next owner to pick and the draft can proceed. A skipped owner may pick at any time after that, but cannot take a horse already drafted.   ~~Draft limited to 18 horses so in the event of a late scratch Owner will be able to replace horse.~~  If a horse is scratched after being drafted, a replacement may be picked at the completion of the draft and it will NOT count as a waiver claim.  If multiple horses are scratched, replacements are chosen in original draft order. - - 1. LLWS: The draft for the LLWS will begin in August, on the Wednesday before the tournament starts Thursday. Each pick will have a set deadline. If not in by the deadline, site will allow next owner to pick and the draft can proceed. A skipped owner may pick at any time after that, but cannot take a team already drafted. There are only 16 teams in the LLWS. - - 1. Steeplechase: The draft for the STP will begin in July, exact date TBD. - - 1. Keepers: Each owner may designate up to 3 Players as Keepers. To be eligible, the Player must have been drafted in the previous draft and rostered the entire season. KD and LLWS draft picks and traded players are eligible for Keeper status, but free agent claims are not. A player designated as a Keeper will be drafted by the Owner one round earlier than taken in the previous draft. First Round picks are not eligible to be a Keeper. Keepers must be declared prior to the start of the draft and may not be changed once submitted. - 1. If 2 or 3 players designated as Keepers were previously drafted in the same round and Owner does not have multiple picks in that round, one Keeper will move up an additional round. Owner may select which player moves up another round. - 1. An Owner cannot designate 2 2nd round picks as Keepers unless Owner has multiple first round picks. - 1. If Owner has multiple picks in a round where a Keeper is taken, Keeper is selected with Owner’s original pick, not pick acquired via trade. - -1. **Relegation:** ~~Based on League Points, the bottom 4 Owners in A and B will be relegated to League B and C respectively. The top 4 Owners in B and C will move up to A and B.  Because relegation and the next season’s draft will take place prior to the end of the MLB season, we will use the MLB regular season standings at the end of the day on the day of the US Open Men’s final.  This is for relegation purposes only.  League points will still be based on the playoffs.~~  For relegation, points will be awarded based on the following:  - - * 8 pts: Best Overall Record  - * 5 pts: Best Overall Record in other league  - * 3 pts: 2nd Best Record in each league:     - * 1 pt: 3rd division leader + best overall record of non-division leader.  If the top 2 teams are in the same division, then 1 point to other 2 division leaders. - - 1. TIEBREAKERS (in order of application): - 1. MLB: Run Differential, Record in September, Head-to-Head Record, Coin Flip  - 1. LEAGUE: # of championships, # of teams scoring league points, lowest drafted team to score a league point (excludes waiver claims and trades).   - 1. If relegation/promotion puts 2 teams with the same owner or partial owner in the same league, owner(s) may drop ownership stake to a single team or else the lower ranked team(s) will be pushed down a league until all owners have a stake in only one team/league. In this case, the last team relegated (i.e. 11th place) will move back up. - 1. DRAFT PICK TRADES: If relegation results in Owners that traded draft picks in different leagues, the traded picks will take place at the end of the round.  EX: I trade my 1st round pick away and get a 10th round pick in return and I get relegated to B.  The Owner I traded with would get my 1st round pick at the end of the 1st round.  I would get the 10th round pick I traded for at the end of the 10th round.  If both teams involved in the trade stay in the same league, or both get relegated, they would swap actual picks.  If multiple Owners have supplemental picks, the order will be in reverse of the picks in that round.   - 1. If an Owner gets relegated from A to B or B to C, but finishes in the money after actual MLB results are recorded, that Owner will automatically move up to the next league (after their relegation season) as the #1 team, regardless of actual position in B or C.   - -1. **New Owners:** New Owners will be placed in the lowest league of the new season, unless joining as a partial owner to an existing team. Exceptions may be granted at the discretion of the Board of Directors. - -1. **Upper League Openings:** If an Owner finishes in the top 10 in A or B but does not play the following season or an Owner is forced to drop a team due to ownership of multiple teams, the 11th place Owner will remain in A and/or B and a new Owner will be added to C. Exceptions may be made at the discretion of the 338 Board of Directors. diff --git a/lib/ex338_web/templates/page/2022_keeper_rules.html.md b/lib/ex338_web/templates/page/2022_keeper_rules.html.md deleted file mode 100644 index 68aa20d2..00000000 --- a/lib/ex338_web/templates/page/2022_keeper_rules.html.md +++ /dev/null @@ -1,88 +0,0 @@ -### 338 Keeper Rules for 2021 - -1. **Season:** The 2021-2022 338 Keeper Season includes sports with championships between August 15, 2021 and July 31, 2022. There are 14 permanent sports and a 15th sport that changes each year. Permanent sports are: NCAA Football, NFL, NCAA Basketball, NBA, NCAA Hockey, NHL, NCAA Baseball, MLB, Champions League, Kentucky Derby, PGA, LLWS, Men’s and Women’s Tennis. In 2021-22, the rotating sport will be Rugby League World Cup. Subsequent years will be World Cup, Women’s World Cup and Men’s 3000m Steeplechase in the Summer Olympics. - -1. **Ownership:** Teams are allowed to have multiple owners and split the entry fee and winnings any way they choose. - 1. For league voting purposes, each team will only receive one vote, regardless of number of owners. - 2. Owners are not allowed to own or have partial ownership in multiple 338 teams in the same league, but may own or have partial ownership in teams in different leagues. If relegation puts 2 teams with the same owner or partial owner in the same league, that owner must drop ownership or partial ownership of one team and remain uninvolved until the teams are no longer in the same league. - -1. **Rosters:** Each Owner has 20 roster slots with one slot dedicated to each sport (15 slots) and 5 slots open to any sport.  Roster slots may be left open at any time.   - 1. Tennis/Golf: You do not have to use the same player throughout the year.  2 players used in the same tournament will require 2 roster slots, but waivering/trading players for each tournament is allowed and the scores will be combined.  If using multiple roster slots, Owner must declare which slot a newly acquired player will be in.  Owners cannot use the same player in multiple slots, unless 2 or more rostered players have been used in the same slot.  In that case, order is determined by the highest ranked player at the time of acquisition going into the roster slot with the most points.  EX: I have Tiger and Phil for The Masters, then trade them both for Rory and Scott prior to PGA.  I must declare which players will be combined before the event.  I choose Tiger/Scott & Phil/Rory.  For the US Open, I trade Rory for Tiger and drop Scott for Stenson, making the combo Tiger/Scott/Tiger & Phil/Rory/Stenson.  Then I claim Scott for British Open, keeping Tiger & Stenson.  At time of claim, rankings are: #1-Scott, #3-Tiger, #7-Stenson.  Combo becomes Tiger/Scott/Tiger/Scott, Phil/Rory/Stenson/Tiger, Stenson. - - 1. Injured Reserve: Each Owner will have one IR slot per individual sport (MT, WT, PGA). If a player withdraws from an event prior to the start for any reason, Owner may move the player to IR and claim a new player. This will not cost a waiver claim, but the replacement player will be automatically dropped at the end of the tournament. IR claims are processed after the waiver deadline, giving priority to waiver claims. IR claims must be submitted prior to the start of the tournament. If a player is suspended or does not qualify for an event, IR does not apply and the player must be replaced by a waiver claim. - 1. In terms of roster slot occupation, the injured player maintains the occupied roster slot. If the replacement player is added via waivers for a future event, they are not considered to have occupied a roster slot.            - -1. **Entry Fee:** $250 Payment due by Dec 1st, 2021. **Late payment may result in single sport disqualification(s) at the discretion of the Board of Directors.** - -1. **Scoring:** Points are awarded to the top 8 of each sport. 8 points for winning the league, 5 points for runner-up, 3 points for reaching the semifinals, and 1 point for reaching the quarterfinals. See individual sport for details.  If any team/player is later stripped of a standing, **prior to relegation** or the final championship of the year (whichever comes first), due to violation of any kind, points will be adjusted. Any violation and resulting standings change post-deadline will have no impact on the 338. - - 1. College Football:  Top 4 teams will be determined by the CFP.  The 4 highest ranked teams in the final AP Poll who are not in the playoffs will each get 1 point. - - 1.  Tennis: Tennis-only points are awarded for each of the 4 Grand Slam Events (2021 US Open, 2022 Aussie Open, French Open and Wimbledon) immediately after the tournament. 1st=8, 2nd=5, SF=3, QF=1. Negative 2 points awarded to a Top 8 Seed losing in the 1st round and Negative 1 point for a Top 8 Seed losing in the 2nd round.  Tennis points will be tallied individually, to a specific roster slot.  If a player is traded or dropped, the Owner retains any points they have earned.  EX: I have Djokovic who wins the Aussie Open, scoring me 8 pts.  I trade him for Nadal prior to the French Open.  Nadal wins, so I now have 16 pts.  If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W).  League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8.  Owner must score at least 1 point to be eligible).    - - 1. Golf: Golf-only points are awarded for each of the 4 2020 majors, immediately after the tournament: 1st=50, 2nd=40, 3rd-35th=37,36,35...6,5, 36th-40th =3, made cut =1, missed cut= -5.  Golf points will be tallied individually, to a specific roster slot.  If a player is traded or dropped, the Owner retains any points they have earned.  EX: I have Tiger and Phil.  Tiger wins the Masters (50pts) and Phil finishes 11th (29pts).  I keep Tiger but drop Phil and Tiger wins the PGA. I now have 100pts for Tiger and still have 29pts for Phil.  Prior to the US Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut.  I now have 95 pts for Tiger and 79 pts combined for Phil/Rory.  Following the four majors League points will be awarded to top 8 total scores.  Each Owner may have multiple places in the top 8.  Owner must score at least 1 pt to be eligible.                                   - 1. Tennis/Golf League Points: Players may be dropped and traded throughout the year, resulting in multiple players earning points.  Rosters will lock after the final major's deadline and in order for league points to be earned, a roster slot must be occupied by that sport for the number of players earning points.  Ex: If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points.  If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player.       - - 1. Tie Breakers: - * Individual Sport: League Points will be split evenly among all tied Owners. Golf points awarded in full to each tied owner.  Money split for 1st and/or 2nd place tie. - * League:  Owners will split the winnings evenly.  - * Relegation:  See Below. - -1. **Payout:** - - * 1st: $1,000 - * 2nd: $750 - * 3rd: $550 - * 4th: $400 - * 5th: $275 - - 1. Single Sport Payouts:  1st: $25 2nd: $10. If an un-owned team finishes 1st or 2nd, money goes into league pot and divided equally among top 5. Leftover amount after equally dividing goes to League Winner. If Owners tie, money is split evenly.    - -1. **Waiver Wire:** Originally set by reverse draft order. A successful claim drops you to the bottom. All non-rostered players are on waivers. Waiver claims are made by submission via the site’s Waivers Page. Select the player you want and hit submit. The league will be notified and there will be a 3-day waiting period where any other Owner may also claim the player. Claims process exactly 72 hours after the original claim, regardless of how many other owners put a claim in. - - At the 72-hour mark, the Owner with the highest waiver priority will be awarded the player and must roster the player. If no valid roster slots are available, the claim will process as invalid and go to the next Owner. If the Waiver deadline has already passed, a player in that sport may NOT be dropped, even if in the same sport as the player being claimed, unless claim/drop was entered prior to the deadline but processes after. - - Waiting Period is waived for College Basketball, College Hockey, Kentucky Derby and LLWS.  Due to the conference tournaments ending just before CBB and CHK brackets are announced, there will be no waiver period on claims in CBB and CHK.  Instead, we will have a 1 week “quiet period” prior to the deadline.  Claims will not be announced to the league and will process at the deadline based on waiver position. Extra draft picks at the end of KD & LLWS will be up for waiver claim until the individual draft begins. At that point, remaining draft picks may be claimed with no waiting period. Golf/Tennis: Owners do NOT receive credit for points earned in tournaments prior to waiver pickup.  Teams may be dropped without a pick-up, leaving an open roster slot to be filled later.  One roster slot must be dedicated to each sport and cannot be filled with a player from a different sport. Flex spots can be filled with players from any sport.   - -1. **Waiver Deadline:** See each sport for waiver deadlines. After the deadline NO players may be claimed or dropped from roster, **except** for late drops and pending claims in the 3-day waiting period.  After the deadline, there will be an email sent with players that were dropped within 12 hours of deadline or dropped after a successful claim and Owners will have an opportunity to claim them.  This eliminates holding a player until the last minute to keep others from claiming.  This also allows an Owner that put in a claim, but was trumped by a higher waiver to claim another player. - -1. **Trades:** Trades are submitted to Commish and if eligible, presented to the league. Trades are ineligible if they break any 338 rules stated herein or include any non-338 assets. There will be a 3-day voting period needing a majority Yes votes to pass. A no-response during the voting period will be considered an approval.  Once a trade is submitted for Commish approval, the involved Owners are agreeing to the trade and may not make changes or vote against it unless all involved agree. Future Round Draft Picks may be traded, but only for the next draft to take place (if mid-draft, trades apply to that draft) and must be 1:1 (Owner-A trades 1st round pick to Owner-B for player and 5th round pick.)  - - 1. Golf/Tennis: Points already earned by players that are traded stay with the former Owner.  - 1. Trade Deadline: See each sport for trade deadlines. After the deadline NO players for that sport may be traded relating to the current season. Keeper rights to a player may be traded but it will not affect the current season’s rosters or points.  - 1. Future Round Draft Picks: Deadline for trading draft picks and players for future seasons is the trade deadline of the final sport.  - 1. Keepers: Players acquired via trade are eligible to be named a Keeper. Player’s draft round will be determined by draft position in previous draft. - 1. Cancellation/Suspension: If a sport is cancelled or suspended, trades will remain executed unless the entire 338 season is cancelled at which points all trades are nullified.    - -1. **Draft:** Draft order determined by draw, with Owners place in one bucket and draft position placed in a different bucket. Conducted via website in Snake style. For leagues that have a smaller number of teams (e.g. KD, LLWS), every member must be able to draft a team from a league. Once the limit has been reached, only members without a team from that league will be allowed to draft from that sport.  Once a draft pick has been submitted and emailed to the league, it cannot be changed. - - 1. Time Limit: Each Owner will have a cumulative total of 25 hours to make all 20 picks. There is no time limit on each pick. If an Owner exceeds 25 hours in total, the draft queue must be utilized to make picks. If the queue is empty, the Owner is able to manually enter a pick, but the site will proceed with the draft and allow the next Owner to enter their pick. - - 1. In-Season Drafts: Some sports will include a secondary draft in-season. During the main League Draft, you will select a draft position rather than a specific player (i.e. With my first round pick in the League draft, I select the First Pick of the Kentucky Derby). The following sports will have a secondary in-season draft: - - 1. Kentucky Derby: Draft will take place on race day.IN 2022, the draft queue must be utilized. Owners will load their picks and the draft will take place via autodraft at1:30 pm PDT. If an owner does not have their queue loaded at 1:30, they will be skipped. A skipped owner may pick at any time after that, but cannot take a horse already drafted. ~~Draft limited to 18 horses so in the event of a late scratch Owner will be able to replace horse.~~  If a horse is scratched after being drafted, a replacement may be picked at the completion of the draft and it will NOT count as a waiver claim.  If multiple horses are scratched, replacements are chosen in original draft order. - - 1. LLWS: The draft for the LLWS will begin in August, on the Wednesday before the tournament starts Thursday. Each pick will have a set deadline. If not in by the deadline, site will allow next owner to pick and the draft can proceed. A skipped owner may pick at any time after that, but cannot take a team already drafted. There are only 16 teams in the LLWS. - -1. **Keepers:** Each owner may designate up to 3 Players as Keepers. To be eligible, the Player must have been drafted in the previous draft and rostered the entire season. KD and LLWS draft picks and traded players are eligible for Keeper status, but free agent claims are not. A player designated as a Keeper will be drafted by the Owner one round earlier than taken in the previous draft. First Round picks are not eligible to be a Keeper. Keepers must be declared prior to the start of the draft and may not be changed once submitted. - 1. If 2 or 3 players designated as Keepers were previously drafted in the same round and Owner does not have multiple picks in that round, one Keeper will move up an additional round. Owner may select which player moves up another round. - 1. An Owner cannot designate 2 2nd round picks as Keepers unless Owner has multiple first round picks. - 1. If Owner has multiple picks in a round where a Keeper is taken, Keeper is selected with Owner’s original pick, not pick acquired via trade. - -1. **New Owners:** New Owners will be placed in the lowest league of the new season, unless joining as a partial owner to an existing team. Exceptions may be granted at the discretion of the Board of Directors. - -1. **Upper League Openings:** If an Owner finishes in the top 10 in A or B but does not play the following season or an Owner is forced to drop a team due to ownership of multiple teams, the 11th place Owner will remain in A and/or B and a new Owner will be added to C. Exceptions may be made at the discretion of the 338 Board of Directors. - -1. **Cancellations:** In order for the season to be official and payouts made, 8 sports must be completed or have the league name official results by August 1st, 2022. If 8 or more sports are cancelled or delayed beyond August 1st, the 338 season will be cancelled and all entry fees refunded with no winnings paid out. Trades of future draft picks will also be cancelled. - - If a sport is cancelled or delayed beyond Aug 1st, 2022 no points will be awarded, unless the league officially names a champion. All trades will be valid, unless the entire 338 season is cancelled.In the event that a sport does not complete a season and the league names an official champion but not a clear 2nd – 8th, the 338 will use the following rankings to award league points: - -* MLB – 5 pts to best record in other league, 3 points to 2nd best record in eachleague and 1 pt to 3rd division leader and best record for a non-division leader. If the top 2 teams are in the same division, then 1 point to other 2 division leaders. -* CFB – AP Poll -* NFL – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. -* CBK – AP Poll -* NBA – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. -* CHK – PairwiseNHL – – 5 pts to best record in other conference, 3 points to 2nd best record ineach conference and 1 pt to 3rd & 4th best records in each conference. -* NCAA Baseball – D1Baseball.com RankingsChampions League – points split among tied teams - - EXCEPTIONS: Actual results will be used if a league has partially completed the postseason at the time of cancellation/suspension.In order for PGA, MT and WT results to count in league play, at least 3 eventsmust be completed by Aug 1st, 2022. diff --git a/lib/ex338_web/templates/page/2022_rules.html.md b/lib/ex338_web/templates/page/2022_rules.html.md deleted file mode 100644 index a50d214f..00000000 --- a/lib/ex338_web/templates/page/2022_rules.html.md +++ /dev/null @@ -1,107 +0,0 @@ -### 338 Rules for 2022 - -1. **Season:** The 2021-2022 338 Season includes sports with championships between August 15, 2021 and July 31, 2022. There are 14 permanent sports and a 15th sport that changes each year. Permanent sports are: NCAA Football, NFL, NCAA Basketball, NBA, NCAA Hockey, NHL, NCAA Baseball, MLB, Champions League, Kentucky Derby, PGA, LLWS, Men’s and Women’s Tennis. In 2021-22, the rotating sport will be Rugby League World Cup. Subsequent years will be World Cup, Women’s World Cup and Men’s 3000m Steeplechase in the Summer Olympics. - -1. **Ownership:** Teams are allowed to have multiple owners and split the entry fee and winnings any way they choose. - 1. For league voting purposes, each team will only receive one vote, regardless of number of owners. - 2. Owners are not allowed to own or have partial ownership in multiple 338 teams in the same league, but may own or have partial ownership in teams in different leagues. If relegation/promotion puts 2 teams with the same owner or partial owner in the same league, owner(s) may drop ownership stake to a single team or else the lower ranked team(s) will be pushed down a league until all owners have a stake in only one team/league. - -1. **Rosters:** Each Owner has 20 roster slots with one slot dedicated to each sport (15 slots) and 5 slots open to any sport.  Roster slots may be left open at any time.   - 1. Tennis/Golf: You do not have to use the same player throughout the year.  2 players used in the same tournament will require 2 roster slots, but waivering/trading players for each tournament is allowed and the scores will be combined.  If using multiple roster slots, Owner must declare which slot a newly acquired player will be in.  Owners cannot use the same player in multiple slots, unless 2 or more rostered players have been used in the same slot.  In that case, order is determined by the highest ranked player at the time of acquisition going into the roster slot with the most points.  EX: I have Tiger and Phil for The Masters, then trade them both for Rory and Scott prior to PGA.  I must declare which players will be combined before the event.  I choose Tiger/Scott & Phil/Rory.  For the US Open, I trade Rory for Tiger and drop Scott for Stenson, making the combo Tiger/Scott/Tiger & Phil/Rory/Stenson.  Then I claim Scott for British Open, keeping Tiger & Stenson.  At time of claim, rankings are: #1-Scott, #3-Tiger, #7-Stenson.  Combo becomes Tiger/Scott/Tiger/Scott, Phil/Rory/Stenson/Tiger, Stenson. - - 1. Injured Reserve: Each Owner will have one IR slot per individual sport (MT, WT, PGA). If a player withdraws from an event prior to the start for any reason, Owner may move the player to IR and claim a new player. This will not cost a waiver claim, but the replacement player will be automatically dropped at the end of the tournament. IR claims are processed after the waiver deadline, giving priority to waiver claims. IR claims must be submitted prior to the start of the tournament. If a player is suspended or does not qualify for an event, IR does not apply and the player must be replaced by a waiver claim. - -1. **Entry Fee:** League A: $225, B: $250, C: $275. Payment due by Dec 1st, 2021. **Late payment may result in single sport disqualification(s) at the discretion of the Board of Directors.** - -1. **Scoring:** Points are awarded to the top 8 of each sport. 8 points for winning the league, 5 points for runner-up, 3 points for reaching the semifinals, and 1 point for reaching the quarterfinals. See individual sport for details.  If any team/player is later stripped of a standing, **prior to relegation** or the final championship of the year (whichever comes first), due to violation of any kind, points will be adjusted. Any violation and resulting standings change post-deadline will have no impact on the 338. - - 1. College Football:  Top 4 teams will be determined by the CFP.  The 4 highest ranked teams in the final AP Poll who are not in the playoffs will each get 1 point. - - 1.  Tennis: Tennis-only points are awarded for each of the 4 Grand Slam Events (2021 US Open, 2022 Aussie Open, French Open and Wimbledon) immediately after the tournament. 1st=8, 2nd=5, SF=3, QF=1. Negative 2 points awarded to a Top 8 Seed losing in the 1st round and Negative 1 point for a Top 8 Seed losing in the 2nd round.  Tennis points will be tallied individually, to a specific roster slot.  If a player is traded or dropped, the Owner retains any points they have earned.  EX: I have Djokovic who wins the Aussie Open, scoring me 8 pts.  I trade him for Nadal prior to the French Open.  Nadal wins, so I now have 16 pts.  If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W).  League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8.  Owner must score at least 1 point to be eligible).    - - 1. Golf: Golf-only points are awarded for each of the 4 2020 majors, immediately after the tournament: 1st=50, 2nd=40, 3rd-35th=37,36,35...6,5, 36th-40th =3, made cut =1, missed cut= -5.  Golf points will be tallied individually, to a specific roster slot.  If a player is traded or dropped, the Owner retains any points they have earned.  EX: I have Tiger and Phil.  Tiger wins the Masters (50pts) and Phil finishes 11th (29pts).  I keep Tiger but drop Phil and Tiger wins the PGA. I now have 100pts for Tiger and still have 29pts for Phil.  Prior to the US Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut.  I now have 95 pts for Tiger and 79 pts combined for Phil/Rory.  Following the four majors League points will be awarded to top 8 total scores.  Each Owner may have multiple places in the top 8.  Owner must score at least 1 pt to be eligible.                                   - 1. Tennis/Golf League Points: Players may be dropped and traded throughout the year, resulting in multiple players earning points.  Rosters will lock after the final major's deadline and in order for league points to be earned, a roster slot must be occupied by that sport for the number of players earning points.  Ex: If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points.  If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player.       - - 1. Tie Breakers: - * Individual Sport: League Points will be split evenly among all tied Owners. Golf points awarded in full to each tied owner.  Money split for 1st and/or 2nd place tie. - * League:  Owners will split the winnings evenly.  - * Relegation:  See Below. - -1. **Payout:** - - 1.League A: - * 1st: $975 - * 2nd: $750 - * 3rd: $550 - * 4th: $350 - * 5th: $275 - - 2. League B: - * 1st: $900 - * 2nd: $650 - * 3rd: $475 - * 4th: $350 - * 5th: $275 - - 3. League C: - * 1st: $750 - * 2nd: $575 - * 3rd: $425 - * 4th: $325 - * 5th: $275 - - 1. Single Sport Payouts:  1st: $25 2nd: $10. If an un-owned team finishes 1st or 2nd, money goes into league pot and divided equally among top 5. Leftover amount after equally dividing goes to League Winner. If Owners tie, money is split evenly.    - -1. **Waiver Wire:** Originally set by reverse draft order. A successful claim drops you to the bottom. All non-rostered players are on waivers. Waiver claims are made by submission via the site’s Waivers Page. Select the player you want and hit submit. The league will be notified and there will be a 3-day waiting period where any other Owner may also claim the player. Claims process exactly 72 hours after the original claim, regardless of how many other owners put a claim in. - - At the 72-hour mark, the Owner with the highest waiver priority will be awarded the player and must roster the player. If no valid roster slots are available, the claim will process as invalid and go to the next Owner. If the Waiver deadline has already passed, a player in that sport may NOT be dropped, even if in the same sport as the player being claimed, unless claim/drop was entered prior to the deadline but processes after.   - - Waiting Period is waived for College Basketball, College Hockey, Kentucky Derby and LLWS.  Due to the conference tournaments ending just before CBB and CHK brackets are announced, there will be no waiver period on claims in CBB and CHK.  Instead, we will have a 1 week “quiet period” prior to the deadline.  Claims will not be announced to the league and will process at the deadline based on waiver position. Extra draft picks at the end of KD & LLWS will be up for waiver claim until the individual draft begins. At that point, remaining draft picks may be claimed with no waiting period. Golf/Tennis: Owners do NOT receive credit for points earned in tournaments prior to waiver pickup.  Teams may be dropped without a pick-up, leaving an open roster slot to be filled later.  One roster slot must be dedicated to each sport and cannot be filled with a player from a different sport. Flex spots can be filled with players from any sport.   - -1. **Waiver Deadline:** See each sport for waiver deadlines. After the deadline NO players may be claimed or dropped from roster, **except** for late drops and pending claims in the 3-day waiting period.  After the deadline, there will be an email sent with players that were dropped within 12 hours of deadline or dropped after a successful claim and Owners will have an opportunity to claim them.  This eliminates holding a player until the last minute to keep others from claiming.  This also allows an Owner that put in a claim, but was trumped by a higher waiver to claim another player. - -1. **Trades:** Trades are submitted to Commish and if eligible, presented to the league. Trades are ineligible if they break any 338 rules stated herein or include any non-338 assets. There will be a 3-day voting period needing a majority Yes votes to pass. A no-response during the voting period will be considered an approval.  Once a trade is submitted for Commish approval, the involved Owners are agreeing to the trade and may not make changes or vote against it unless all involved agree. Future Round Draft Picks may be traded, but only for the next draft to take place (if mid-draft, trades apply to that draft) and must be 1:1 (Owner-A trades 1st round pick to Owner-B for player and 5th round pick.)  - - 1. Golf/Tennis: Points already earned by players that are traded stay with the former Owner.  - 1. Trade Deadline: See each sport for trade deadlines. After the deadline NO players for that sport may be traded relating to the current season. Teams may be traded after the deadline for future seasons.  - 1. Future Round Draft Picks: Deadline for trading draft picks and players for future seasons is the trade deadline of the final sport.  - 1. Keepers: Players acquired via trade are eligible to be named a Keeper. Player’s draft round will be determined by draft position in previous draft. - 1. Cancellation/Suspension: If a sport is cancelled or suspended, trades will remain executed unless the entire 338 season is cancelled at which points all trades are nullified.    - -1. **Draft:** Draft order determined by draw, with Owners place in one bucket and draft position placed in a different bucket. Conducted via website in Snake style. For leagues that have a smaller number of teams (e.g. KD, LLWS), every member must be able to draft a team from a league. Once the limit has been reached, only members without a team from that league will be allowed to draft from that sport.  Once a draft pick has been submitted and emailed to the league, it cannot be changed. - - 1. Time Limit: Each Owner will have a cumulative total of 25 hours to make all 20 picks. There is no time limit on each pick. If an Owner exceeds 25 hours in total, the draft queue must be utilized to make picks. If the queue is empty, the Owner is able to manually enter a pick, but the site will proceed with the draft and allow the next Owner to enter their pick. - - 1. In-Season Drafts: Some sports will include a secondary draft in-season. During the main League Draft, you will select a draft position rather than a specific player (i.e. With my first round pick in the League draft, I select the First Pick of the Kentucky Derby). The following sports will have a secondary in-season draft: - - 1. Kentucky Derby: Draft will take place on race day. Starting in 2022, the draft queue must be utilized. Owners will load their picks and the draft will take place via autodraft at 1:30 pm PDT. If an owner does not have their queue loaded at 1:30, they will be skipped. A skipped owner may pick at any time after that, but cannot take a horse already drafted. Draft limited to 18 horses so in the event of a late scratch Owner willbe able to replace horse. If a horse is scratched after being drafted, a replacement may be picked at the completion of the draft and it will NOT count as a waiver claim. If multiple horses are scratched, replacements are chosen in original draft order. - - 1. LLWS: The draft for the LLWS will begin in August, on the Wednesday before the tournament starts Thursday. Each pick will have a set deadline. If not in by the deadline, site will allow next owner to pick and the draft can proceed. A skipped owner may pick at any time after that, but cannot take a team already drafted. There are only 16 teams in the LLWS. - -1. **Relegation:** Based on League Points, the bottom 4 Owners in A and B will be relegated down a league. The top 4 Owners in B and C will move up a league. - - 1. TIEBREAKERS (in order of application): - 1. LEAGUE: # of championships, # of teams scoring league points, lowest drafted team to score a league point (excludes waiver claims and trades).   - 1. If relegation/promotion puts 2 teams with the same owner or partial owner in the same league, owner(s) may drop ownership stake to a single team or else the lower ranked team(s) will be pushed down a league until all owners have a stake in only one team/league. In this case, the last team relegated (i.e. 11th place) will move back up. - 1. DRAFT PICK TRADES: If relegation results in Owners that traded draft picks in different leagues, the traded picks will take place at the end of the round.  EX: I trade my 1st round pick away and get a 10th round pick in return and I get relegated to B.  The Owner I traded with would get my 1st round pick at the end of the 1st round.  I would get the 10th round pick I traded for at the end of the 10th round.  If both teams involved in the trade stay in the same league, or both get relegated, they would swap actual picks.  If multiple Owners have supplemental picks, the order will be in reverse of the picks in that round.   - 1. If an Owner gets relegated from A to B or B to C, but finishes in the money after actual MLB results are recorded, that Owner will automatically move up to the next league (after their relegation season) as the #1 team, regardless of actual position in B or C.   - -1. **New Owners:** New Owners will be placed in the lowest league of the new season, unless joining as a partial owner to an existing team. Exceptions may be granted at the discretion of the Board of Directors. - -1. **Upper League Openings:** If an Owner finishes in the top 10 in A or B but does not play the following season or an Owner is forced to drop a team due to ownership of multiple teams, the 11th place Owner will remain in A and/or B and a new Owner will be added to C. Exceptions may be made at the discretion of the 338 Board of Directors. - -1. **Owner Departures:** If an Owner finishes in the top 10 or is promoted but does not play the following season or an Owner is forced to drop a team or move down a league due to ownership of multiple teams, the last Owner relegated (i.e. 11th place) will move back up. This rule will apply until any openings are in the lowest league at which point a new owner will be added. Exceptions may be made at the discretion of the 338 Board of Directors. - -1. **Cancellations:** In order for the season to be official and payouts made, 8 sports must be completed or have the league name official results by August 1st, 2022. If 8 or more sports are cancelled or delayed beyond August 1st, the 338 season will be cancelled and all entry fees refunded with no winnings paid out. Trades of future draft picks will also be cancelled. - - If a sport is cancelled or delayed beyond Aug 1st, 2022 no points will be awarded, unless the league officially names a champion. All trades will be valid, unless the entire 338 season is cancelled.In the event that a sport does not complete a season and the league names an official champion but not a clear 2nd – 8th, the 338 will use the following rankings to award league points: - -* MLB – 5 pts to best record in other league, 3 points to 2nd best record in eachleague and 1 pt to 3rd division leader and best record for a non-division leader. If the top 2 teams are in the same division, then 1 point to other 2 division leaders. -* CFB – AP Poll -* NFL – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. -* CBK – AP Poll -* NBA – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. -* CHK – PairwiseNHL – – 5 pts to best record in other conference, 3 points to 2nd best record ineach conference and 1 pt to 3rd & 4th best records in each conference. -* NCAA Baseball – D1Baseball.com RankingsChampions League – points split among tied teams - - EXCEPTIONS: Actual results will be used if a league has partially completed the postseason at the time of cancellation/suspension.In order for PGA, MT and WT results to count in league play, at least 3 eventsmust be completed by Aug 1st, 2022. diff --git a/lib/ex338_web/templates/page/rules.html.eex b/lib/ex338_web/templates/page/rules.html.eex index 542e77a1..aa581799 100644 --- a/lib/ex338_web/templates/page/rules.html.eex +++ b/lib/ex338_web/templates/page/rules.html.eex @@ -2,7 +2,7 @@
- <%= render Ex338Web.PageView.rules_path(@fantasy_league) %> + <%= Phoenix.HTML.raw @rulebook.body %>
<%= if @current_user do %> <%= diff --git a/mix.exs b/mix.exs index e9bab8c8..a0c17e3d 100644 --- a/mix.exs +++ b/mix.exs @@ -52,6 +52,7 @@ defmodule Ex338.Mixfile do {:jason, "~> 1.0"}, {:kaffy, "~> 0.9.1"}, {:mixpanel_api_ex, "~> 1.0.1"}, + {:nimble_publisher, "~> 1.0"}, {:number, "~> 1.0.0"}, {:oban, "~> 2.13"}, {:phoenix, "~> 1.7.0"}, @@ -59,7 +60,6 @@ defmodule Ex338.Mixfile do {:phoenix_ecto, "~> 4.4.0"}, {:phoenix_html, "~> 3.2"}, {:phoenix_live_reload, "~> 1.3.0", only: :dev}, - {:phoenix_markdown, "~> 1.0"}, {:phoenix_pubsub, "~> 2.0"}, {:phoenix_pubsub_redis, "~> 3.0.0"}, {:phoenix_live_view, "~> 0.19.0"}, diff --git a/mix.lock b/mix.lock index 876892b9..65cc35d2 100644 --- a/mix.lock +++ b/mix.lock @@ -32,11 +32,14 @@ "idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"}, "jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"}, "kaffy": {:hex, :kaffy, "0.9.4", "6a5446cd2c782b8e122061eab409254eb1fa412adb5824169f0528d16775dc45", [:mix], [{:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.5", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}], "hexpm", "91736c9ddc34a94ed76cb56058fdb6b206c9d777b71856c90ef4554f485f13b9"}, + "makeup": {:hex, :makeup, "1.1.1", "fa0bc768698053b2b3869fa8a62616501ff9d11a562f3ce39580d60860c3a55e", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "5dc62fbdd0de44de194898b6710692490be74baa02d9d108bc29f007783b0b48"}, "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"}, "mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"}, "mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"}, "mixpanel_api_ex": {:hex, :mixpanel_api_ex, "1.0.1", "affd7d886529df7cef6a229a1a2003a47f1f40a4f07f703caed369df60c2d1cf", [:mix], [{:httpoison, "~> 1.2", [hex: :httpoison, repo: "hexpm", optional: false]}, {:poison, "~> 3.1", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm", "fbed8505e9f8ca298f8d65e00ca7c53f88ccc5af8ccbbd8af209297303a7b319"}, "nimble_options": {:hex, :nimble_options, "1.0.2", "92098a74df0072ff37d0c12ace58574d26880e522c22801437151a159392270e", [:mix], [], "hexpm", "fd12a8db2021036ce12a309f26f564ec367373265b53e25403f0ee697380f1b8"}, + "nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"}, + "nimble_publisher": {:hex, :nimble_publisher, "1.1.0", "49dee0f30536140268996660a5927d0282946949c35c88ccc6da11a19231b4b6", [:mix], [{:earmark, "~> 1.4", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "80fb42d8d1e34f41ff29fc2a1ae6ab86ea7b764b3c2d38e5268a43cf33825782"}, "number": {:hex, :number, "1.0.4", "3e6e6032a3c1d4c3760e77a42c580a57a15545dd993af380809da30fe51a032c", [:mix], [{:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}], "hexpm", "16f7516584ef2be812af4f33f2eaf3f9b9f6ed8892f45853eb93113f83721e42"}, "oban": {:hex, :oban, "2.16.2", "ec8dfd2f6dfdcd885061b58aeaa2794a0a6f62bad20c15939e4bb80bfd74ed76", [:mix], [{:ecto_sql, "~> 3.6", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:ecto_sqlite3, "~> 0.9", [hex: :ecto_sqlite3, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3d343c80948676abf9652da1e793ab6140ba64e9de7c8d6630eb5bb4aa8fea79"}, "parallel_stream": {:hex, :parallel_stream, "1.0.6", "b967be2b23f0f6787fab7ed681b4c45a215a81481fb62b01a5b750fa8f30f76c", [:mix], [], "hexpm", "639b2e8749e11b87b9eb42f2ad325d161c170b39b288ac8d04c4f31f8f0823eb"}, diff --git a/priv/rules/2017_standard_rules.md b/priv/rules/2017_standard_rules.md new file mode 100644 index 00000000..aedc083b --- /dev/null +++ b/priv/rules/2017_standard_rules.md @@ -0,0 +1,96 @@ +%{ +year: 2017, +draft_method: "redraft", +} + +--- + +# 338 Rules for 2017 Season + +1. **Season:** The 2017 338 Season includes only sports with Championship game/series occurring in calendar year 2017. + +2. **Rosters:** Each Owner has 20 roster slots with one slot dedicated to each sport (14 slots) and 6 slots open to any sport. Roster slots may be left open at any time. + +3. **Tennis/Golf:** You do not have to use the same player throughout the year. 2 players used in the same tournament will require 2 roster slots, but waivering/trading players for each tournament is allowed and the scores will be combined. If using multiple roster slots, Owner must declare which slot a newly acquired player will be in. Owners cannot use the same player in multiple slots, unless 2 or more rostered players have been used in the same slot. In that case, order is determined by the highest ranked player at the time of acquisition going into the roster slot with the most points. EX: I have Tiger and Phil for The Masters, then trade them both for Rory and Scott prior to US Open. I must declare which players will be combined before the event. I choose Tiger/Scott & Phil/Rory. For the British Open, I trade Rory for Tiger and drop Scott for Stenson, making the combo Tiger/Scott/Tiger & Phil/Rory/Stenson. Then I claim Scott for PGA, keeping Tiger & Stenson. At time of claim, rankings are: #1-Scott, #3-Tiger, #7-Stenson. Combo becomes Tiger/Scott/Tiger/Scott, Phil/Rory/Stenson/Tiger, Stenson. + +4. **Injured Reserve:** \*\* \*\* Each Owner will have one IR slot per individual sport (MT, WT, PGA). If a player withdraws from an event prior to the start for any reason, Owner may move the player to IR and claim a new player. This will not cost a waiver claim, but the replacement player will be automatically dropped at the end of the tournament. IR claims are processed after the waiver deadline, giving priority to waiver claims. IR claims must be submitted prior to the start of the tournament. If a player is suspended or does not qualify for an event, IR does not apply and the player must be replaced by a waiver claim. + +5. **Entry Fee:** League A: $200 League B: $225 Payment due by Dec 1st, 2016. **Late payment may result in single sport disqualification(s) at the discretion of Dooley. Dooley has absolutely no mercy so expect it to** **happen and don't bitch about it. You had 2.5 months to pay and didn't. You are a loser. No one cares when losers complain.** + +6. **Scoring:** Points are awarded to the top 8 of each sport. 8 points for winning the league, 5 points for runner-up, 3 points for reaching the semifinals, and 1 point for reaching the quarterfinals. See individual sport for details. If any team/player is later stripped of a standing, prior to relegation, due to violation of any kind, points will be adjusted. Any violation and resulting standings change post-relegation will have no impact on the 338. + +7. **College Football:** Top 4 teams will be determined by playoffs. The 4 highest ranked teams in the final AP Poll who are not in the playoffs will each get 1 point. + +8. **Tennis:** Tennis-only points are awarded for each of the 4 Grand Slam Events, immediately after the tournament. 1st=8, 2nd=5, SF=3, QF=1. Negative 2 points awarded to a Top 8 Seed losing in the 1st round and Negative 1 point for a Top 8 Seed losing in the 2nd round. Tennis points will be tallied individually, to a specific roster slot. If a player is traded or dropped, the Owner retains any points they have earned. EX: I have Djokovic who wins the Aussie Open, scoring me 8 pts. I trade him for Nadal prior to the French Open. Nadal wins, so I now have 16 pts. If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W). League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8. Owner must score at least 1 point to be eligible). + +9. **Golf:** Golf-only points are awarded for each of the 4 majors, immediately after the tournament: 1st=50, 2nd=40, 3rd-35th=37,36,35...6,5, 36th-40th =3, made cut =1, missed cut= -5. Golf points will be tallied individually, to a specific roster slot. If a player is traded or dropped, the Owner retains any points they have earned. EX: I have Tiger and Phil. Tiger wins the Masters (50pts) and Phil finishes 11th (29pts). I keep Tiger but drop Phil and Tiger wins the US Open. I now have 100pts for Tiger and still have 29pts for Phil. Prior to the British Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut. I now have 95 pts for Tiger and 79 pts combined for Phil/Rory. Following the four majors League points will be awarded to top 8 total scores. Each Owner may have multiple places in the top 8. Owner must score at least 1 pt to be eligible. + +10. **Tennis/Golf League Points:** Players may be dropped and traded throughout the year, resulting in multiple players earning points. Rosters will lock after the final major's deadline and in order for league points to be earned, a roster slot must be occupied by that sport for the number of players earning points. Ex: If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points. If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player. + +11. **Tie Breakers:** _Individual Sport_: Points awarded evenly to tied Owners. Money split for 1st or 2nd place tie. _League_: Owners will split the winnings evenly. _Relegation: _ See Below. + +12. **Payout:** (assumes 14 in A, 14 in B) + +13. **League A:** + + + - 1st: $995 + - 2nd:$750 + - 3rd: $450 + - 4th: $300 + - 5th: $200 + +2. **League B:** + + + - 1st: $800 + - 2nd:$600 + - 3rd: $400 + - 4th: $275 + - 5th: $200 + +**Single Sport Payouts:** 1st: $25 2nd: $10. If an un-owned team finishes 1st or 2nd, money goes into league pot. If Owners tie, money is split evenly. + +6. **Waiver Wire:** Originally set by reverse draft order. A successful claim drops you to the bottom. All non-rostered teams are on waivers. Waiver claims are submitted via the Fantasy Team page. Select the team/player (player) you want to add and/or drop and hit submit. Owners can submit three types of waivers: add a player and drop a player (drop is only made if the add is successful), only drop a player, or only add a player. The league will be notified via email when the claim is submitted and the waiver will be listed as pending on the site. + +There will be a 3-day waiting period when any other Owner may claim the added player by submitting a new waiver for that player. “Drop only” waivers have no waiting period and are processed immediately. If a roster positions is not available on the team at the time the claim is submitted (and a player to drop is not included), the claim is invalid and will be cancelled by the commish. An owner may change the player to drop during the 3-day waiting period by messaging the commish or updating the claim via the site (this feature to be added in the future.) + +At the end of the 3-day period, new claims for that player will no longer be accepted and the commish will process the claim. The Owner with the highest waiver priority (i.e. lowest waiver position) will have the player added to its roster by the commish. Once submitted, a claim may not be cancelled by the claiming Owner. + +Waiting Period is waived during certain times for College Basketball, College Hockey, Kentucky Derby and LLWS. Due to the conference tournaments ending just before CBB and CHK brackets are announced, there will be no wait period on claims in CBB and CHK. Instead, we will have a 1 week "quiet period" prior to the deadline. Claims will not be announced to the league and will process at the deadline based on waiver position. Extra draft picks at the end of KD & LLWS will be up for waiver claim until the individual draft begins. At that point, remaining draft picks may be claimed with no waiting period. _Golf/Tennis_: Owners do NOT receive credit for points earned in tournaments prior to waiver pickup. Teams may be dropped without a pick-up, leaving an open roster slot to be filled later. One roster slot must be dedicated to each sport. + +1. **Waiver Deadline:** See each sport for waiver deadlines. After the deadline NO TEAMS may be claimed or dropped from roster, **except** for late drops. After the deadline, there will be a an email sent with teams that were dropped within 12 hours of deadline or dropped after a successful claim and Owners will have an opportunity to claim them. This eliminates holding a team until the last minute to keep others from claiming. This also allows an Owner that put in a claim, but was trumped by a higher waiver to claim another team. For sports with multiple championships, waivers will be closed for that sport between each championship waiver deadline and the championship. After the championship, waivers for the sport will reopen. + +2. **Trades:** Trades are submitted to Commish and if eligible, presented to the league. Trades are ineligible if they break any 338 rules stated herein or include any non-338 assets. There will be a 3-day voting period needing 8 Yes votes to pass. A no-response during the voting period will be considered an approval. Once a trade is submitted for Commish approval, the involved Owners are agreeing to the trade and may not make changes or vote against it unless all involved agree. Future Round Draft Picks may be traded, but only for the adjacent season's draft and must be 1:1 (Owner-A trades 1st round pick to Owner-B for team and 5th round pick.) + +3. **Golf/Tennis:** Points already earned by players that are traded stay with the former Owner. + +4. **Trade Deadline:** See each sport for trade deadlines. After the deadline NO TEAMS for that sport may be traded. + +5. **Future Round Draft Picks:** Deadline for trading draft picks is the current season MLB trade deadline. + +6. **Draft:** Draft order determined using [http://www.random.org/lists](http://www.random.org/lists). Conducted via website in Snake style. For leagues that have a smaller number of teams (e.g. KD, LLWS), every member must be able to draft a team from a league. Once the limit has been reached, only members without a team from that league will be allowed to draft from that sport. Once a draft pick has been emailed to the league, it cannot be changed. + +7. **Kentucky Derby:** The draft for the Kentucky Derby will be held in May once the field is announced. During the September draft, you will be selecting a draft position rather than an actual horse. (For example, you may use your 4th round selection for the first pick in the Kentucky Derby draft). Draft limited to 18 horses in case of a late scratch, Owner will be able to replace horse. If a horse is scratched after being drafting, a replacement may be picked at the completion of the draft and it will NOT count as a waiver claim. If multiple horses are scratched, replacements are chosen in original draft order. The first pick must be made by 8:30 AM PST on Friday before the race. If not made by 8:30, the OWNER with Pick #2 may draft and so on. Owner with #1 may pick at any time after that, but cannot take a horse already drafted. + +8. **LLWS:** The draft for the LLWS will begin in August, after the regional winners are set. During the September draft, you will be selecting a draft position rather than an actual team (For example, you may use your 4th round selection for the first pick in the LLWS draft). There are only 16 teams in the LLWS. + +9. **Relegation:** Based on League Points, the bottom 4 Owners in A will be relegated to League B and the top 4 Owners in B will move up to A. Because relegation and the 2018 draft will take place prior to the end of the MLB season, we will use the MLB regular season standings at the end of the day on the day of the US Open Men's final. This is for relegation purposes only\_. League points will still be based on the playoffs. + +10. For relegation, points will be awarded based on the following: + + + * 8 pts: Best Overall Record + * 5 pts: Best Overall Record in other league + * 3 pts: 2nd Best Record in each league: + * 1 pt: 3rd division leader + best overall record of non-division leader. If top 2 teams are in same division, then 1 point to other 2 division leaders. + +2. **TIEBREAKERS (in order of application):** + + + * MLB_: Run Differential, Record in September, Head-to-Head Record, Coin Flip + * LEAGUE_: # of championships, # of teams scoring league points, lowest drafted team to score a league point (excludes waiver claims and trades). + +3. **DRAFT PICK TRADES:** If relegation results in Owners that traded draft picks in different leagues, the traded picks will take place at the end of the round. EX: I trade my 1st round pick away and get a 10th round pick in return and I get relegated to B. The Owner I traded with would get my 1st round pick at the end of the 1st round. I would get the 10th round pick I traded for at the end of the 10th round. If both teams involved in the trade stay in the same league, or both get relegated, they would swap actual picks. If multiple Owners have supplemental picks, the order will be in reverse of the picks in that round. + +4. **END OF SEASON** If an Owners gets relegated from A to B, but finishes in the money in League A after actual MLB results are recorded, that Owner will automatically move up to A (after their relegation season) as the #1 team, regardless of actual position in B. If an Owner finishes in the top 10 in A, but does not play the following season, the 11th place Owner will remain in A and a new Owner will be added to B. diff --git a/priv/rules/2018_standard_rules.md b/priv/rules/2018_standard_rules.md new file mode 100644 index 00000000..4f84851b --- /dev/null +++ b/priv/rules/2018_standard_rules.md @@ -0,0 +1,97 @@ +%{ +year: 2018, +draft_method: "redraft", +} + +--- + +# 338 Rules for 2018 Season + +1. **Season:** The 2018 338 Season includes only sports with Championship game/series occurring in calendar year 2018. World Cup will replace EPL this year. All other sports will remain the same. + +2. **Rosters:** Each Owner has 20 roster slots with one slot dedicated to each sport (14 slots) and 6 slots open to any sport. Roster slots may be left open at any time. + +3. **Tennis/Golf:** You do not have to use the same player throughout the year. 2 players used in the same tournament will require 2 roster slots, but waivering/trading players for each tournament is allowed and the scores will be combined. If using multiple roster slots, Owner must declare which slot a newly acquired player will be in. Owners cannot use the same player in multiple slots, unless 2 or more rostered players have been used in the same slot. In that case, order is determined by the highest ranked player at the time of acquisition going into the roster slot with the most points. EX: I have Tiger and Phil for The Masters, then trade them both for Rory and Scott prior to US Open. I must declare which players will be combined before the event. I choose Tiger/Scott & Phil/Rory. For the British Open, I trade Rory for Tiger and drop Scott for Stenson, making the combo Tiger/Scott/Tiger & Phil/Rory/Stenson. Then I claim Scott for PGA, keeping Tiger & Stenson. At time of claim, rankings are: #1-Scott, #3-Tiger, #7-Stenson. Combo becomes Tiger/Scott/Tiger/Scott, Phil/Rory/Stenson/Tiger, Stenson. + +4. **Injured Reserve:** \*\* \*\* Each Owner will have one IR slot per individual sport (MT, WT, PGA). If a player withdraws from an event prior to the start for any reason, Owner may move the player to IR and claim a new player. This will not cost a waiver claim, but the replacement player will be automatically dropped at the end of the tournament. IR claims are processed after the waiver deadline, giving priority to waiver claims. IR claims must be submitted prior to the start of the tournament. If a player is suspended or does not qualify for an event, IR does not apply and the player must be replaced by a waiver claim. + +5. **Entry Fee:** League A: $200, League B: $225, League C: $250 Payment due by Dec 1st, 2017. **Late payment may result in single sport disqualification(s) at the discretion of Dooley. Dooley has absolutely no mercy so expect it to happen.** + +6. **Scoring:** Points are awarded to the top 8 of each sport. 8 points for winning the league, 5 points for runner-up, 3 points for reaching the semifinals, and 1 point for reaching the quarterfinals. See individual sport for details. If any team/player is later stripped of a standing, prior to relegation, due to violation of any kind, points will be adjusted. Any violation and resulting standings change post-relegation will have no impact on the 338. + +7. **College Football: ** Top 4 teams will be determined by playoffs. The 4 highest ranked teams in the final AP Poll who are not in the playoffs will each get 1 point. + +8. **Tennis:** Tennis-only points are awarded for each of the 4 Grand Slam Events, immediately after the tournament. 1st=8, 2nd=5, SF=3, QF=1. Negative 2 points awarded to a Top 8 Seed losing in the 1st round and Negative 1 point for a Top 8 Seed losing in the 2nd round. Tennis points will be tallied individually, to a specific roster slot. If a player is traded or dropped, the Owner retains any points they have earned. EX: I have Djokovic who wins the Aussie Open, scoring me 8 pts. I trade him for Nadal prior to the French Open. Nadal wins, so I now have 16 pts. If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W). League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8. Owner must score at least 1 point to be eligible). + +9. **Golf:** Golf-only points are awarded for each of the 4 majors, immediately after the tournament: 1st=50, 2nd=40, 3rd-35th=37,36,35...6,5, 36th-40th =3, made cut =1, missed cut= -5. Golf points will be tallied individually, to a specific roster slot. If a player is traded or dropped, the Owner retains any points they have earned. EX: I have Tiger and Phil. Tiger wins the Masters (50pts) and Phil finishes 11th (29pts). I keep Tiger but drop Phil and Tiger wins the US Open. I now have 100pts for Tiger and still have 29pts for Phil. Prior to the British Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut. I now have 95 pts for Tiger and 79 pts combined for Phil/Rory. Following the four majors League points will be awarded to top 8 total scores. Each Owner may have multiple places in the top 8. Owner must score at least 1 pt to be eligible. + +10. **Tennis/Golf League Points:** Players may be dropped and traded throughout the year, resulting in multiple players earning points. Rosters will lock after the final major's deadline and in order for league points to be earned, a roster slot must be occupied by that sport for the number of players earning points. Ex: If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points. If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player. + +11. **Tie Breakers:** _Individual Sport_: Points awarded evenly to tied Owners. Money split for 1st or 2nd place tie. _League_: Owners will split the winnings evenly. _Relegation: _ See Below. + +12. **Payout:** (assumes 14 in A, 14 in B) + +13. **League A:** + + - 1st: $1,150 + - 2nd: $875 + - 3rd: $630 + - 4th: $450 + - 5th: $325 + +14. **League B:** + + - 1st: $800 + - 2nd:$600 + - 3rd: $400 + - 4th: $275 + - 5th: $200 + +15. **League C:** + + - 1st: $520 + - 2nd: $370 + - 3rd: $270 + - 4th: $175 + +**Single Sport Payouts:** A&B: 1st: $25 2nd: $10. C: 1st: $20 2nd: $10. If an un-owned team finishes 1st or 2nd, money goes into league pot. If Owners tie, money is split evenly. + +6. **Waiver Wire:** Originally set by reverse draft order. A successful claim drops you to the bottom. All non-rostered teams are on waivers. Waiver claims are submitted via the site's Waivers page. Select the team/player (player) you want to add and/or drop and hit submit. The league will be notified and there will be a 3-day waiting period where any other Owner may also claim the player. + +At the end of the 3-day period, the Owner with the highest waiver priority takes the player and must roster the player. If no roster slots are available, a different player must be dropped. If the deadline has already passed, a player in that sport may NOT be dropped, even if in the same sport as the player being claimed. Once submitted, a claim may not be cancelled by the claiming Owner, but the player dropped may be adjusted. + +Waiting Period is waived during certain times for College Basketball, College Hockey, Kentucky Derby and LLWS. Due to the conference tournaments ending just before CBB and CHK brackets are announced, there will be no wait period on claims in CBB and CHK. Instead, we will have a 1 week "quiet period" prior to the deadline. Claims will not be announced to the league and will process at the deadline based on waiver position. Extra draft picks at the end of KD & LLWS will be up for waiver claim until the individual draft begins. At that point, remaining draft picks may be claimed with no waiting period. _Golf/Tennis_: Owners do NOT receive credit for points earned in tournaments prior to waiver pickup. Teams may be dropped without a pick-up, leaving an open roster slot to be filled later. One roster slot must be dedicated to each sport. + +1. **Waiver Deadline:** See each sport for waiver deadlines. After the deadline NO TEAMS may be claimed or dropped from roster, **except** for late drops. After the deadline, there will be a an email sent with teams that were dropped within 12 hours of deadline or dropped after a successful claim and Owners will have an opportunity to claim them. This eliminates holding a team until the last minute to keep others from claiming. This also allows an Owner that put in a claim, but was trumped by a higher waiver to claim another team. For sports with multiple championships, waivers will be closed for that sport between each championship waiver deadline and the championship. After the championship, waivers for the sport will reopen. + +2. **Trades:** Trades are submitted to Commish and if eligible, presented to the league. Trades are ineligible if they break any 338 rules stated herein or include any non-338 assets. There will be a 3-day voting period needing 8 Yes votes to pass. A no-response during the voting period will be considered an approval. Once a trade is submitted for Commish approval, the involved Owners are agreeing to the trade and may not make changes or vote against it unless all involved agree. Future Round Draft Picks may be traded, but only for the next draft to take place and must be 1:1 (Owner-A trades 1st round pick to Owner-B for team and 5th round pick.) + +3. **Golf/Tennis:** Points already earned by players that are traded stay with the former Owner. + +4. **Trade Deadline:** See each sport for trade deadlines. After the deadline NO TEAMS for that sport may be traded. + +5. **Future Round Draft Picks:** Deadline for trading draft picks is the current season MLB trade deadline. + +6. **Draft:** Draft order determined using [http://www.random.org/lists](http://www.random.org/lists). Conducted via website in Snake style. For leagues that have a smaller number of teams (e.g. KD, LLWS), every member must be able to draft a team from a league. Once the limit has been reached, only members without a team from that league will be allowed to draft from that sport. Once a draft pick has been emailed to the league, it cannot be changed. + +7. **Kentucky Derby:** The draft for the Kentucky Derby will be held in May once the field is announced. During the September draft, you will be selecting a draft position rather than an actual horse. (For example, you may use your 4th round selection for the first pick in the Kentucky Derby draft). Draft limited to 18 horses in case of a late scratch, Owner will be able to replace horse. If a horse is scratched after being drafting, a replacement may be picked at the completion of the draft and it will NOT count as a waiver claim. If multiple horses are scratched, replacements are chosen in original draft order. The first pick must be made by 8:30 AM PST on Friday before the race. If not made by 8:30, the OWNER with Pick #2 may draft and so on. Owner with #1 may pick at any time after that, but cannot take a horse already drafted. + +8. **LLWS:** The draft for the LLWS will begin in August, after the regional winners are set. During the September draft, you will be selecting a draft position rather than an actual team (For example, you may use your 4th round selection for the first pick in the LLWS draft). There are only 16 teams in the LLWS. + +9. **Relegation:** Based on League Points, the bottom 4 Owners in A and B will be relegated to League B and C respectively. The top 4 Owners in B and C will move up to A and B. Because relegation and the next season's draft will take place prior to the end of the MLB season, we will use the MLB regular season standings at the end of the day on the day of the US Open Men's final. This is f*r relegation purposes only*. League points will still be based on the playoffs. + +10. For relegation, points will be awarded based on the following: + + - 8 pts: Best Overall Record + - 5 pts: Best Overall Record in other league + - 3 pts: 2nd Best Record in each league: + - 1 pt: 3rd division leader + best overall record of non-division leader. If top 2 teams are in same division, then 1 point to other 2 division leaders. + +11. **TIEBREAKERS (in order of application):** + + - _MLB_: Run Differential, Record in September, Head-to-Head Record, Coin Flip + - _LEAGUE_: # of championships, # of teams scoring league points, lowest drafted team to score a league point (excludes waiver claims and trades). + +12. **DRAFT PICK TRADES:** If relegation results in Owners that traded draft picks in different leagues, the traded picks will take place at the end of the round. EX: I trade my 1st round pick away and get a 10th round pick in return and I get relegated to B. The Owner I traded with would get my 1st round pick at the end of the 1st round. I would get the 10th round pick I traded for at the end of the 10th round. If both teams involved in the trade stay in the same league, or both get relegated, they would swap actual picks. If multiple Owners have supplemental picks, the order will be in reverse of the picks in that round. + +13. **END OF SEASON** If an Owners gets relegated from A to B or B to C, but finishes in the money after actual MLB results are recorded, that Owner will automatically move up to the next league (after their relegation season) as the #1 team, regardless of actual position in B or C. If an Owner finishes in the top 10 in A or B, but does not play the following season, the 11th place Owner will remain in A or B and a new Owner will be added to B or C. diff --git a/priv/rules/2019_standard_rules.md b/priv/rules/2019_standard_rules.md new file mode 100644 index 00000000..079209a2 --- /dev/null +++ b/priv/rules/2019_standard_rules.md @@ -0,0 +1,103 @@ +%{ +year: 2019, +draft_method: "redraft", +} + +--- + +# 338 Rules for 2019 Season + +1. **Season:** The 2019 338 Season includes only sports with Championship game/series occurring in calendar year 2019. There are 14 permanent sports and a 15th sport that changes each year. Permanent sports are: NCAA Football, NFL, NCAA Basketball, NBA, NCAA Hockey, NHL, NCAA Baseball, MLB, Champions League, Kentucky Derby, PGA, LLWS, Men’s and Women’s Tennis. In 2019, the rotating sport will be Women’s World Cup. Subsequent years will be an Olympic Event, EPL (subject to change) and World Cup. + +2. **Rosters:** Each Owner has 20 roster slots with one slot dedicated to each sport (15 slots) and 5 slots open to any sport. Roster slots may be left open at any time. + +3. **Tennis/Golf:** You do not have to use the same player throughout the year. 2 players used in the same tournament will require 2 roster slots, but waivering/trading players for each tournament is allowed and the scores will be combined. If using multiple roster slots, Owner must declare which slot a newly acquired player will be in. Owners cannot use the same player in multiple slots, unless 2 or more rostered players have been used in the same slot. In that case, order is determined by the highest ranked player at the time of acquisition going into the roster slot with the most points. EX: I have Tiger and Phil for The Masters, then trade them both for Rory and Scott prior to US Open. I must declare which players will be combined before the event. I choose Tiger/Scott & Phil/Rory. For the British Open, I trade Rory for Tiger and drop Scott for Stenson, making the combo Tiger/Scott/Tiger & Phil/Rory/Stenson. Then I claim Scott for PGA, keeping Tiger & Stenson. At time of claim, rankings are: #1-Scott, #3-Tiger, #7-Stenson. Combo becomes Tiger/Scott/Tiger/Scott, Phil/Rory/Stenson/Tiger, Stenson. + +4. **Injured Reserve:** \*\* \*\* Each Owner will have one IR slot per individual sport (MT, WT, PGA). If a player withdraws from an event prior to the start for any reason, Owner may move the player to IR and claim a new player. This will not cost a waiver claim, but the replacement player will be automatically dropped at the end of the tournament. IR claims are processed after the waiver deadline, giving priority to waiver claims. IR claims must be submitted prior to the start of the tournament. If a player is suspended or does not qualify for an event, IR does not apply and the player must be replaced by a waiver claim. + +5. **Entry Fee:** League A: $225, League B: $250, League C: $275 Payment due by Dec 1st, 2018. **Late payment may result in single sport disqualification(s) at the discretion of Dooley. Dooley has absolutely no mercy so expect it to happen.** + +6. **Scoring:** Points are awarded to the top 8 of each sport. 8 points for winning the league, 5 points for runner-up, 3 points for reaching the semifinals, and 1 point for reaching the quarterfinals. See individual sport for details. If any team/player is later stripped of a standing, prior to relegation, due to violation of any kind, points will be adjusted. Any violation and resulting standings change post-relegation will have no impact on the 338. + +7. **College Football: ** Top 4 teams will be determined by playoffs. The 4 highest ranked teams in the final AP Poll who are not in the playoffs will each get 1 point. + +8. **Tennis:** Tennis-only points are awarded for each of the 4 Grand Slam Events, immediately after the tournament. 1st=8, 2nd=5, SF=3, QF=1. Negative 2 points awarded to a Top 8 Seed losing in the 1st round and Negative 1 point for a Top 8 Seed losing in the 2nd round. Tennis points will be tallied individually, to a specific roster slot. If a player is traded or dropped, the Owner retains any points they have earned. EX: I have Djokovic who wins the Aussie Open, scoring me 8 pts. I trade him for Nadal prior to the French Open. Nadal wins, so I now have 16 pts. If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W). League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8. Owner must score at least 1 point to be eligible). + +9. **Golf:** Golf-only points are awarded for each of the 4 majors, immediately after the tournament: 1st=50, 2nd=40, 3rd-35th=37,36,35...6,5, 36th-40th =3, made cut =1, missed cut= -5. Golf points will be tallied individually, to a specific roster slot. If a player is traded or dropped, the Owner retains any points they have earned. EX: I have Tiger and Phil. Tiger wins the Masters (50pts) and Phil finishes 11th (29pts). I keep Tiger but drop Phil and Tiger wins the US Open. I now have 100pts for Tiger and still have 29pts for Phil. Prior to the British Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut. I now have 95 pts for Tiger and 79 pts combined for Phil/Rory. Following the four majors League points will be awarded to top 8 total scores. Each Owner may have multiple places in the top 8. Owner must score at least 1 pt to be eligible. + +10. **Tennis/Golf League Points:** Players may be dropped and traded throughout the year, resulting in multiple players earning points. Rosters will lock after the final major's deadline and in order for league points to be earned, a roster slot must be occupied by that sport for the number of players earning points. Ex: If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points. If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player. + +11. **Tie Breakers:** _Individual Sport_: Points awarded evenly to tied Owners. Money split for 1st or 2nd place tie. _League_: Owners will split the winnings evenly. _Relegation: _ See Below. + +12. **5. Payout:** assumes 14 in each league + +13. **League A:** + + + - 1st: $1,200 + - 2nd: $875 + - 3rd: $625 + - 4th: $450 + - 5th: $325 + +2. **League B:** + + + - 1st: $1,000 + - 2nd: $700 + - 3rd: $500 + - 4th: $375 + - 5th: $300 + +3. **League C:** + + + - 1st: $920 + - 2nd: $625 + - 3rd: $430 + - 4th: $325 + - 5th: $275 + +**Single Sport Payouts:** 1st: $25 2nd: $10. If an un-owned team finishes 1st or 2nd, money goes into league pot and divided equally among top 5. Leftover amount after equally dividing goes to League Winner. If Owners tie, money is split evenly. + +6. **Waiver Wire:** Originally set by reverse draft order. A successful claim drops you to the bottom. All non-rostered teams are on waivers. Waiver claims are submitted via the site's Waivers page. Select the team/player (player) you want to add and/or drop and hit submit. The league will be notified and there will be a 3-day waiting period where any other Owner may also claim the player. + +At the end of the 3-day period, the Owner with the highest waiver priority takes the player and must roster the player. If no roster slots are available, a different player must be dropped. If the deadline has already passed, a player in that sport may NOT be dropped, even if in the same sport as the player being claimed. Once submitted, a claim may not be cancelled by the claiming Owner, but the player dropped may be adjusted. + +Waiting Period is waived during certain times for College Basketball, College Hockey, Kentucky Derby and LLWS. Due to the conference tournaments ending just before CBB and CHK brackets are announced, there will be no wait period on claims in CBB and CHK. Instead, we will have a 1 week "quiet period" prior to the deadline. Claims will not be announced to the league and will process at the deadline based on waiver position. Extra draft picks at the end of KD & LLWS will be up for waiver claim until the individual draft begins. At that point, remaining draft picks may be claimed with no waiting period. _Golf/Tennis_: Owners do NOT receive credit for points earned in tournaments prior to waiver pickup. Teams may be dropped without a pick-up, leaving an open roster slot to be filled later. One roster slot must be dedicated to each sport. + +1. **Waiver Deadline:** See each sport for waiver deadlines. After the deadline NO TEAMS may be claimed or dropped from roster, **except** for late drops. After the deadline, there will be a an email sent with teams that were dropped within 12 hours of deadline or dropped after a successful claim and Owners will have an opportunity to claim them. This eliminates holding a team until the last minute to keep others from claiming. This also allows an Owner that put in a claim, but was trumped by a higher waiver to claim another team. For sports with multiple championships, waivers will be closed for that sport between each championship waiver deadline and the championship. After the championship, waivers for the sport will reopen. + +2. **Trades:** Trades are submitted to Commish and if eligible, presented to the league. Trades are ineligible if they break any 338 rules stated herein or include any non-338 assets. There will be a 3-day voting period needing 8 Yes votes to pass. A no-response during the voting period will be considered an approval. Once a trade is submitted for Commish approval, the involved Owners are agreeing to the trade and may not make changes or vote against it unless all involved agree. Future Round Draft Picks may be traded, but only for the next draft to take place and must be 1:1 (Owner-A trades 1st round pick to Owner-B for team and 5th round pick.) + +3. **Golf/Tennis:** Points already earned by players that are traded stay with the former Owner. + +4. **Trade Deadline:** See Championships page for deadlines. After the deadline NO TEAMS for that sport may be traded. + +5. **Future Round Draft Picks:** Deadline for trading draft picks is the current season MLB trade deadline. + +6. **Draft:** Draft order determined by random draw, conducted via website in Snake style. For leagues that have a smaller number of teams (e.g. KD, LLWS), every member must be able to draft a team from a league. Once the limit has been reached, only members without a team from that league will be allowed to draft from that sport. Once a draft pick has been emailed to the league, it cannot be changed. + +7. **Kentucky Derby:** The draft for the Kentucky Derby will be held in May once the field is announced. During the September draft, you will be selecting a draft position rather than an actual horse. (For example, you may use your 4th round selection for the first pick in the Kentucky Derby draft). Draft limited to 18 horses in case of a late scratch, Owner will be able to replace horse. If a horse is scratched after being drafting, a replacement may be picked at the completion of the draft and it will NOT count as a waiver claim. If multiple horses are scratched, replacements are chosen in original draft order. The first pick must be made by 8:30 AM PST on Friday before the race. If not made by 8:30, the OWNER with Pick #2 may draft and so on. Owner with #1 may pick at any time after that, but cannot take a horse already drafted. + +8. **LLWS:** The draft for the LLWS will begin in August, after the regional winners are set. During the September draft, you will be selecting a draft position rather than an actual team (For example, you may use your 4th round selection for the first pick in the LLWS draft). There are only 16 teams in the LLWS. + +9. **Relegation:** Based on League Points, the bottom 4 Owners in A and B will be relegated to League B and C respectively. The top 4 Owners in B and C will move up to A and B. Because relegation and the next season's draft will take place prior to the end of the MLB season, we will use the MLB regular season standings at the end of the day on the day of the US Open Men's final. This is f*r relegation purposes only*. League points will still be based on the playoffs. + +10. For relegation, points will be awarded based on the following: + + + * 8 pts: Best Overall Record + * 5 pts: Best Overall Record in other league + * 3 pts: 2nd Best Record in each league: + * 1 pt: 3rd division leader + best overall record of non-division leader. If top 2 teams are in same division, then 1 point to other 2 division leaders. + +2. **TIEBREAKERS (in order of application):** + + + * _MLB_: Run Differential, Record in September, Head-to-Head Record, Coin Flip + * _LEAGUE_: # of championships, # of teams scoring league points, lowest drafted team to score a league point (excludes waiver claims and trades). + +3. **DRAFT PICK TRADES:** If relegation results in Owners that traded draft picks in different leagues, the traded picks will take place at the end of the round. EX: I trade my 1st round pick away and get a 10th round pick in return and I get relegated to B. The Owner I traded with would get my 1st round pick at the end of the 1st round. I would get the 10th round pick I traded for at the end of the 10th round. If both teams involved in the trade stay in the same league, or both get relegated, they would swap actual picks. If multiple Owners have supplemental picks, the order will be in reverse of the picks in that round. + +4. **END OF SEASON** If an Owners gets relegated from A to B or B to C, but finishes in the money after actual MLB results are recorded, that Owner will automatically move up to the next league (after their relegation season) as the #1 team, regardless of actual position in B or C. If an Owner finishes in the top 10 in A or B, but does not play the following season, the 11th place Owner will remain in A or B and a new Owner will be added to B or C. diff --git a/priv/rules/2020_keeper_rules.md b/priv/rules/2020_keeper_rules.md new file mode 100644 index 00000000..70151513 --- /dev/null +++ b/priv/rules/2020_keeper_rules.md @@ -0,0 +1,78 @@ +%{ +year: 2020, +draft_method: "keeper", +} + +--- + +# 338 Keeper Rules for 2019-2020 Season + +1. **Season:** The 2019-2020 338 Keeper Season begins with the 2019 LLWS tournament and ends with the 2020 Olympic Steeplechase. There are 14 permanent sports and a 15th sport that changes each year. Permanent sports are: NCAA Football, NFL, NCAA Basketball, NBA, NCAA Hockey, NHL, NCAA Baseball, MLB, Champions League, Kentucky Derby, PGA, LLWS, Men's and Women's Tennis. For the 2019-20 season, the rotating sport will be Men's Steeplechase in the Olympics. Subsequent years will be MLS, World Cup and Women's World Cup (rotating sports subject to change). + +2. **Ownership:** Teams are allowed to have multiple owners and split the entry fee and winnings any way they choose. + + 1. For league voting purposes, each team will only receive one vote, regardless of number of owners. + 2. Owners are not allowed to own or have partial ownership in multiple 338 teams in the same league, but may own or have partial ownership in teams in different leagues. If relegation puts 2 teams with the same owner or partial owner in the same league, that owner must drop ownership or partial ownership of one team and remain uninvolved until the teams are no longer in the same league. + +3. **Rosters:** Each Owner has 20 roster slots with one slot dedicated to each sport (15 slots) and 5 slots open to any sport. Roster slots may be left open at any time. +4. **Tennis/Golf:** You do not have to use the same player throughout the year. 2 players used in the same tournament will require 2 roster slots, but waivering/trading players for each tournament is allowed and the scores will be combined. If using multiple roster slots, Owner must declare which slot a newly acquired player will be in. Owners cannot use the same player in multiple slots, unless 2 or more rostered players have been used in the same slot. In that case, order is determined by the highest ranked player at the time of acquisition going into the roster slot with the most points. EX: I have Tiger and Phil for The Masters, then trade them both for Rory and Scott prior to the PGA. I must declare which players will be combined before the event. I choose Tiger/Scott & Phil/Rory. For the US Open, I trade Rory for Tiger and drop Scott for Stenson, making the combo Tiger/Scott/Tiger & Phil/Rory/Stenson. Then I claim Scott for British Open, keeping Tiger & Stenson. At time of claim, rankings are: #1-Scott, #3-Tiger, #7-Stenson. Combo becomes Tiger/Scott/Tiger/Scott, Phil/Rory/Stenson/Tiger, Stenson. +5. **Injured Reserve:** Each Owner will have one IR slot per individual sport (MT, WT, PGA). If a player withdraws from an event prior to the start for any reason, Owner may move the player to IR and claim a new player. This will not cost a waiver claim, but the replacement player will be automatically dropped at the end of the tournament. IR claims are processed after the waiver deadline, giving priority to waiver claims. IR claims must be submitted prior to the start of the tournament. If a player is suspended or does not qualify for an event, IR does not apply and the player must be replaced by a waiver claim. + +6. **Entry Fee** : $250 Payment due by Oct 1st, 2019. **Late payment may result in single sport disqualification(s) at the discretion of the Board of Directors.** + +7. **Scoring:** Points are awarded to the top 8 of each sport. 8 points for winning the league, 5 points for runner-up, 3 points for reaching the semifinals, and 1 point for reaching the quarterfinals. See individual sport for details. If any team/player is later stripped of a standing, prior to relegation or the final championship of the year (whichever comes first), due to violation of any kind, points will be adjusted. Any violation and resulting standings change post-deadline will have no impact on the 338. +8. **College Football:** Top 4 teams will be determined by the CFP. The 4 highest ranked teams in the final AP Poll who are not in the playoffs will each get 1 point. +9. **Tennis:** Tennis-only points are awarded for each of the 4 Grand Slam Events (2019 US Open, 2020 Aussie Open, French Open and Wimbledon) immediately after the tournament. 1st=8, 2nd=5, SF=3, QF=1. Negative 2 points awarded to a Top 8 Seed losing in the 1st round and Negative 1 point for a Top 8 Seed losing in the 2nd round. Tennis points will be tallied individually, to a specific roster slot. If a player is traded or dropped, the Owner retains any points they have earned. EX: I have Djokovic who wins the Aussie Open, scoring me 8 pts. I trade him for Nadal prior to the French Open. Nadal wins, so I now have 16 pts. If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W). League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8. Owner must score at least 1 point to be eligible). +10. **Golf:** Golf-only points are awarded for each of the 4 2020 majors, immediately after the tournament: 1st=50, 2nd=40, 3rd-35th=37,36,35...6,5, 36th-40th =3, made cut =1, missed cut= -5. Golf points will be tallied individually, to a specific roster slot. If a player is traded or dropped, the Owner retains any points they have earned. EX: I have Tiger and Phil. Tiger wins the Masters (50pts) and Phil finishes 11th (29 pts). I keep Tiger but drop Phil and Tiger wins the PGA. I now have 100pts for Tiger and still have 29pts for Phil. Prior to the US Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut. I now have 95 pts for Tiger and 79 pts combined for Phil/Rory. Following the four majors League points will be awarded to top 8 total scores. Each Owner may have multiple places in the top 8. Owner must score at least 1 pt to be eligible. +11. **Tennis/Golf League Points:** Players may be dropped and traded throughout the year, resulting in multiple players earning points. Rosters will lock after the final major's deadline and in order for league points to be earned, a roster slot must be occupied by that sport for the number of players earning points. Ex: If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points. If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player. +12. **Tie Breakers** : _Individual Sport_: League Points will be split evenly among all tied Owners. Golf points awarded in full to each tied owner. Money split for 1st and/or 2nd place tie. _League_: Owners will split the winnings evenly. _Relegation: _ See Below. + +13. **Payout** : + + 1. **League A** : + + - 1st: $1,000 + - 2nd: $750 + - 3rd: $550 + - 4th: $400 + - 5th: $275 + + 2. **League B** : + + - 1st: N/A + - 2nd: + - 3rd: + - 4th: + - 5th: + + 3. **League C:** + + - 1st: N/A + - 2nd: + - 3rd: + - 4th: + - 5th: + + 4. **Single Sport Payouts:** 1st: $25 2nd: $10. If an un-owned team finishes 1st or 2nd, money goes into league pot and divided equally among top 5. Leftover amount after equally dividing goes to League Winner. If Owners tie, money is split evenly. + +14. **Waiver Wire** : Originally set by reverse draft order. A successful claim drops you to the bottom. All non-rostered players are on waivers. Waiver claims are made by submission via the site's Waivers Page. Select the player you want and hit submit. The league will be notified and there will be a 3-day waiting period where any other Owner may also claim the player. Claims process exactly 72 hours after the original claim, regardless of how many other owners put a claim in. At the 72-hour mark, the Owner with the highest waiver priority will be awarded the player and must roster the player. If no valid roster slots are available, the claim will process as invalid and go to the next Owner. If the Waiver deadline has already passed, a player in that sport may NOT be dropped, even if in the same sport as the player being claimed, unless claim/drop was entered prior to the deadline but processes after. Once submitted, a claim may be cancelled within 2 hours of entry. After 2 hours, claims may not be cancelled but the player being dropped may be adjusted up to the process time. At Certain times, the Waiting Period is waived for College Basketball, College Hockey, Kentucky Derby and LLWS. Due to the conference tournaments ending just before CBB and CHK brackets are announced, there will be no waiver period on claims in CBB and CHK. Instead, we will have a 1 week "quiet period" prior to the deadline. Claims will not be announced to the league and will process at the deadline based on waiver position. Extra draft picks at the end of KD & LLWS will be up for waiver claim until the individual draft begins. At that point, remaining draft picks may be claimed with no waiting period. _Golf/Tennis_: Owners do NOT receive credit for points earned in tournaments prior to waiver pickup. Teams may be dropped without a pick-up, leaving an open roster slot to be filled later. One roster slot must be dedicated to each sport and cannot be filled with a player from a different sport. Flex spots can be filled with players from any sport. + +15. **Waiver Deadline:** See each sport for waiver deadlines. After the deadline NO PLAYERS may be claimed or dropped from roster, **except** for late drops and pending claims in the 3-day waiting period. After the deadline, there will be an email sent with players that were dropped within 12 hours of deadline or dropped after a successful claim and Owners will have an opportunity to claim them. This eliminates holding a player until the last minute to keep others from claiming. This also allows an Owner that put in a claim, but was trumped by a higher waiver to claim another player. + +16. **Trades** : Trades are submitted to Commish and if eligible, presented to the league. Trades are ineligible if they break any 338 rules stated herein or include any non-338 assets. There will be a 3-day voting period needing 8 Yes votes to pass. A no-response during the voting period will be considered an approval. Once a trade is submitted for Commish approval, the involved Owners are agreeing to the trade and may not make changes or vote against it unless all involved agree. Future Round Draft Picks may be traded, but only for the next draft to take place (if mid-draft, trades apply to that draft) and must be 1:1 (Owner-A trades 1st round pick to Owner-B for player and 5th round pick.) + + 1. **Golf/Tennis**: Points already earned by players that are traded stay with the former Owner. + 2. **Trade Deadline** : See each sport for trade deadlines. After the deadline NO TEAMS for that sport may be traded relating to the current season. Teams may be traded after the deadline for future seasons. + - Future Round Draft Picks: Deadline for trading draft picks and players for future seasons is July 15. + 3. **Keepers**: Players acquired via trade are eligible to be named a Keeper. Player’s draft round will be determined by draft position in previous draft. + +17. **Draft:** Draft order determined by draw, with Owners place in one bucket and draft position placed in a different bucket. Conducted via website in Snake style. For leagues that have a smaller number of teams (e.g. KD, LLWS), every member must be able to draft a team from a league. Once the limit has been reached, only members without a team from that league will be allowed to draft from that sport. Once a draft pick has been submitted and emailed to the league, it cannot be changed. + + 1. **Kentucky Derby** : The draft for the Kentucky Derby will be held in May once the field is announced. During the League draft, you will be selecting a draft position rather than an actual horse. (For example, you may use your 4th round selection for the first pick in the Kentucky Derby draft). Draft limited to 18 horses in case of a late scratch, Owner will be able to replace horse. If a horse is scratched after being drafted, a replacement may be picked at the completion of the draft and it will NOT count as a waiver claim. If multiple horses are scratched, replacements are chosen in original draft order. The first pick must be made by 8:30 AM PST on race day. If not made by 8:30, the OWNER with Pick #2 may draft and so on. Owner with #1 may pick at any time after that, but cannot take a horse already drafted. + 2. **LLWS:** The draft for the LLWS will begin in August, after the regional winners are set. During the League draft, you will be selecting a draft position rather than an actual team (For example, you may use your 4th round selection for the first pick in the LLWS draft). There are only 16 teams in the LLWS. + 3. **Steeplechase:** The draft for the STP will begin in July, exact date TBD. During the League draft, you will be selecting a draft position rather than an actual team (For example, you may use your 4th round selection for the first pick in the STP draft). + +18. **Keepers:** Each owner may designate up to 3 Players as Keepers. To be eligible, the Player must have been drafted in the previous draft and rostered the entire season. KD and LLWS draft picks and traded players are eligible for Keeper status, but free agent claims are not. A player designated as a Keeper will be drafted by the Owner one round earlier than taken in the previous draft. First Round picks are not eligible to be a Keeper. Keepers must be declared prior to the start of the draft and may not be changed once submitted. + 1. If 2 or 3 players designated as Keepers were previously drafted in the same round, one Keeper will move up an additional round. + - An Owner cannot designate 2 2nd round picks as Keepers unless Owner has multiple first round picks. + 2. If Owner has multiple picks in a round where a Keeper is taken, Owner may choose which pick Keeper is taken with. diff --git a/priv/rules/2020_standard_rules.md b/priv/rules/2020_standard_rules.md new file mode 100644 index 00000000..37364209 --- /dev/null +++ b/priv/rules/2020_standard_rules.md @@ -0,0 +1,126 @@ +%{ +year: 2020, +draft_method: "redraft", +} + +--- + +# 338 Rules for 2020 Season + +1. **Season:** The 2020 338 Season includes only sports with Championship game/series occurring in calendar year 2020. There are 14 permanent sports and a 15th sport that changes each year. Permanent sports are: NCAA Football, NFL, NCAA Basketball, NBA, NCAA Hockey, NHL, NCAA Baseball, MLB, Champions League, Kentucky Derby, PGA, LLWS, Men’s and Women’s Tennis. In 2020, the rotating sport will be Men’s Olympic Steeplechase. Subsequent years will be EPL (subject to change), World Cup and Women’s World Cup. + +2. **Ownership:** Teams are allowed to have multiple owners and split the entry fee and winnings any way they choose. +3. For league voting purposes, each team will only receive one vote, regardless of number of owners. +4. Owners are not allowed to own or have partial ownership in multiple 338 teams in the same league, but may own or have partial ownership in teams in different leagues. If relegation/promotion puts 2 teams with the same owner or partial owner in the same league, owner(s) may drop ownership stake to a single team or else the lower ranked team(s) will be pushed down a league until all owners have a stake in only one team/league. + +5. **Rosters:** Each Owner has 20 roster slots with one slot dedicated to each sport (15 slots) and 5 slots open to any sport. Roster slots may be left open at any time. + +6. **Tennis/Golf:** You do not have to use the same player throughout the year. 2 players used in the same tournament will require 2 roster slots, but waivering/trading players for each tournament is allowed and the scores will be combined. If using multiple roster slots, Owner must declare which slot a newly acquired player will be in. Owners cannot use the same player in multiple slots, unless 2 or more rostered players have been used in the same slot. In that case, order is determined by the highest ranked player at the time of acquisition going into the roster slot with the most points. EX: I have Tiger and Phil for The Masters, then trade them both for Rory and Scott prior to PGA. I must declare which players will be combined before the event. I choose Tiger/Scott & Phil/Rory. For the US Open, I trade Rory for Tiger and drop Scott for Stenson, making the combo Tiger/Scott/Tiger & Phil/Rory/Stenson. Then I claim Scott for British Open, keeping Tiger & Stenson. At time of claim, rankings are: #1-Scott, #3-Tiger, #7-Stenson. Combo becomes Tiger/Scott/Tiger/Scott, Phil/Rory/Stenson/Tiger, Stenson. + +7. **Injured Reserve:** \*\* \*\* Each Owner will have one IR slot per individual sport (MT, WT, PGA). If a player withdraws from an event prior to the start for any reason, Owner may move the player to IR and claim a new player. This will not cost a waiver claim, but the replacement player will be automatically dropped at the end of the tournament. IR claims are processed after the waiver deadline, giving priority to waiver claims. IR claims must be submitted prior to the start of the tournament. If a player is suspended or does not qualify for an event, IR does not apply and the player must be replaced by a waiver claim. + +8. **Entry Fee:** League A: $225, B: $250, C: $275, D: $300 Payment due by Dec 1st, 2019. Late payment may result in single sport disqualification(s) at the discretion of the Board of Directors. + +9. **Scoring:** Points are awarded to the top 8 of each sport. 8 points for winning the league, 5 points for runner-up, 3 points for reaching the semifinals, and 1 point for reaching the quarterfinals. See individual sport for details. If any team/player is later stripped of a standing, prior to relegation, due to violation of any kind, points will be adjusted. Any violation and resulting standings change post-relegation will have no impact on the 338. + +10. **College Football: ** Top 4 teams will be determined by playoffs. The 4 highest ranked teams in the final AP Poll who are not in the playoffs will each get 1 point. + +11. **Tennis:** Tennis-only points are awarded for each of the 4 Grand Slam Events, immediately after the tournament. 1st=8, 2nd=5, SF=3, QF=1. Negative 2 points awarded to a Top 8 Seed losing in the 1st round and Negative 1 point for a Top 8 Seed losing in the 2nd round. Tennis points will be tallied individually, to a specific roster slot. If a player is traded or dropped, the Owner retains any points they have earned. EX: I have Djokovic who wins the Aussie Open, scoring me 8 pts. I trade him for Nadal prior to the French Open. Nadal wins, so I now have 16 pts. If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W). League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8. Owner must score at least 1 point to be eligible). + +12. **Golf:** Golf-only points are awarded for each of the 4 majors, immediately after the tournament: 1st=50, 2nd=40, 3rd-35th=37,36,35...6,5, 36th-40th =3, made cut =1, missed cut= -5. Golf points will be tallied individually, to a specific roster slot. If a player is traded or dropped, the Owner retains any points they have earned. EX: I have Tiger and Phil. Tiger wins the Masters (50pts) and Phil finishes 11th (29pts). I keep Tiger but drop Phil and Tiger wins the US Open. I now have 100pts for Tiger and still have 29pts for Phil. Prior to the British Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut. I now have 95 pts for Tiger and 79 pts combined for Phil/Rory. Following the four majors League points will be awarded to top 8 total scores. Each Owner may have multiple places in the top 8. Owner must score at least 1 pt to be eligible. + +13. **Tennis/Golf League Points:** Players may be dropped and traded throughout the year, resulting in multiple players earning points. Rosters will lock after the final major's deadline and in order for league points to be earned, a roster slot must be occupied by that sport for the number of players earning points. Ex: If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points. If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player. + +14. **Tie Breaker:s** _Individual Sport_: Points awarded evenly to tied Owners. Golf points awarded in full to each tied owner. Money split for 1st or 2nd place tie. _League_: Owners will split the winnings evenly. _Relegation: _ See Below. + +15. **Payout:** assumes 14 in A, B, C, and 8 in D. Payouts listed from 2019 seasonand will be finalized once Div D teams are finalized. + +16. **League A:** + + + - 1st: $1,225 + - 2nd: $875 + - 3rd: $625 + - 4th: $450 + - 5th: $325 + +2. **League B:** + + + - 1st: $1,000 + - 2nd: $700 + - 3rd: $500 + - 4th: $375 + - 5th: $300 + +3. **League C:** + + + - 1st: $920 + - 2nd: $625 + - 3rd: $430 + - 4th: $325 + - 5th: $275 + +4. **League D:** + + + - 1st: $650 + - 2nd: $475 + - 3rd: $375 + - 4th: $300 + - 5th: $0 + +**Single Sport Payouts:** 1st: $25 2nd: $10. If an un-owned team finishes 1st or 2nd, money goes into league pot and divided equally among top 5. Leftover amount after equally dividing goes to League Winner. If Owners tie, money is split evenly. + +6. **Waiver Wire:** Originally set by reverse draft order. A successful claim drops you to the bottom. All non-rostered players are on waivers. Waiver claims are made by submission via the site’s Waivers Page. Select the player you want and hit submit. The league will be notified and there will be a 3-day waiting period where any other Owner may also claim the player. Claims process exactly 72 hours after the original claim, regardless of how many other owners put a claim in. + +At the 72-hour mark, the Owner with the highest waiver priority will be awarded the player and must roster the player. If no valid roster slots are available, the claim will process as invalid and go to the next Owner. If the Waiver deadline has already passed, a player in that sport may NOT be dropped, even if in the same sport as the player being claimed, unless claim/drop was entered prior to the deadline and processes after. Once submitted, a claim may be cancelled within 2 hours of entry. After 2 hours, claims may not be cancelled but the player being dropped may be adjusted up to the process time. + +Waiting Period is waived for College Basketball, College Hockey, Kentucky Derby, and LLWS. Due to the conference tournaments ending just before CBB and CHK brackets are announced, there will be no waiver period on claims in CBB and CHK. Instead, we will have a 1-week “quiet period” prior to the deadline. Claims will not be announced to the league and will process at the deadline based on waiver position. Extra draft picks at the end of KD & LLWS will be up for waiver claim until the individual draft begins. At that point, remaining draft picks may be claimed with no waiting period. + +Golf/Tennis: Owners do NOT receive credit for points earned in tournaments prior to waiver pickup. Teams may be dropped without a pick-up, leaving an open roster slot to be filled later. One roster slot must be dedicated to each sport and cannot be filled with a player from a different sport. Flex spots can be filled with players from any sport. + +1. **Waiver Deadline:** See each sport for waiver deadlines. After the deadline NO TEAMS may be claimed or dropped from roster, **except** for late drops and pending claims in the 3-day waiting period. . After the deadline, there will be a an email sent with teams that were dropped within 12 hours of deadline or dropped after a successful claim and Owners will have an opportunity to claim them. This eliminates holding a team until the last minute to keep others from claiming. This also allows an Owner that put in a claim, but was trumped by a higher waiver to claim another team. For sports with multiple championships, waivers will be closed for that sport between each championship waiver deadline and the championship. After the championship, waivers for the sport will reopen. + +2. **Trades:** Trades are submitted to Commish and if eligible, presented to the league. Trades are ineligible if they break any 338 rules stated herein or include any non-338 assets. There will be a 3-day voting period needing 8 Yes votes to pass. A no-response during the voting period will be considered an approval. Once a trade is submitted for Commish approval, the involved Owners are agreeing to the trade and may not make changes or vote against it unless all involved agree. Future Round Draft Picks may be traded, but only for the next draft to take place (if mid-draft, trades apply to that draft) and must be 1:1 (Owner-A trades 1st round pick to Owner-B for team and 5th round pick.) + +3. **Golf/Tennis:** Points already earned by players that are traded stay with the former Owner. + +4. **Trade Deadline:** See Championships page for deadlines. After the deadline NO TEAMS for that sport may be traded. + +5. **Future Round Draft Picks:** Deadline for trading draft picks is the current season MLB trade deadline. + +6. **Draft:** Draft order determined by random draw, with Owners placed in one bucket and draft position placed in a different bucket. The draft is conducted via website in Snake style. For leagues that have a smaller number of teams (e.g. KD, LLWS), every member must be able to draft a team from a league. Once the limit has been reached, only members without a team from that league will be allowed to draft from that sport. Once a draft pick has been emailed to the league, it cannot be changed. + +7. **Time Limit:** Each Owner will have a cumulative total of 30 hours to make all 20 picks. There is no time limit for each pick. If an Owner exceeds 30 hours in total, the draft queue must be utilized to make picks. If the draft queue is empty, the Owner is able to manually enter a pick, but teh site will proceed withe the draft and allow the next Owner to enter their pick. + +8. **In-Season Drafts:** Some sports will include a secondary draft in-season. During the main League Draft, you will select a draft position rather than a specific player (i.e. With my first round pick in the League draft, I select the First Pick of the Kentucky Derby). The following sports will have a secondary in-season daft: + **Kentucky Derby:** Draft will take place morning of race day. The first pick must be made by 7:30 AM PST and subsequent picks will each have a set deadline. If not in by the deadline, site will allow next owner to pick and the draft can proceed. A skipped owner may pick at any time after that, but cannot take a horse already drafted. Draft limited to 18 horses so in the event of a late scratch Owner will be able to replace horse. If a horse is scratched after being drafted, a replacement may be picked at the completion of the draft and it will NOT count as a waiver claim. If multiple horses are scratched, replacements are chosen in original draft order. + **LLWS:** The draft for the LLWS will begin in August, on the Wednesday before the tournament starts Thursday. Each pick will have a set deadline. If not in by the deadline, site will allow next owner to pick and the draft can proceed. A skipped owner may pick at any time after that, but cannot take a team already drafted. There are only 16 teams in the LLWS. + **Steeplechase:** The draft for the STP will begin in July, exact date TBD. + +9. **Relegation:** Based on League Points, the bottom 4 Owners in A,B and C will be relegated down a league. The top 4 Owners in B,C and D will move up one League. Because relegation and the next season's draft will take place prior to the end of the MLB season, we will use the MLB regular season standings at the end of the day on the day of the US Open Men's final. This is for relegation purposes only. League points will still be based on the playoffs. + +10. For relegation, points will be awarded based on the following: + + + * 8 pts: Best Overall Record + * 5 pts: Best Overall Record in other league + * 3 pts: 2nd Best Record in each league: + * 1 pt: 3rd division leader + best overall record of non-division leader. If top 2 teams are in same division, then 1 point to other 2 division leaders. + +2. **TIEBREAKERS (in order of application):** + + + * _MLB_: Run Differential, Head-to-Head Record, Record in September, Coin Flip + * _LEAGUE_: # of championships, # of teams scoring league points, lowest drafted team to score a league point (excludes waiver claims and trades). + +3. If an Owner gets relegated but finishes in the money after actual MLB results are recorded, that Owner will automatically move up to the next league the following season as the #1 team, regardless of actual position. +4. If relegation/promotion puts 2 teams with the same owner or partial owner in the same league, owner(s) may drop ownership stake to a single team or else the lower ranked team(s) will be pushed down a league until all owners have a stake in only one team/league. In this case, the last team relegated (i.e. 11th place) will move back up. + +5. **DRAFT PICK TRADES:** If relegation results in Owners that traded draft picks in different leagues, the traded picks will take place at the end of the round. EX: I trade my 1st round pick away and get a 10th round pick in return and I get relegated to B. The Owner I traded with would get my 1st round pick at the end of the 1st round. I would get the 10th round pick I traded for at the end of the 10th round. If both teams involved in the trade stay in the same league, or both get relegated, they would swap actual picks. If multiple Owners have supplemental picks, the order will be in reverse of the picks in that round. + +6. **Upper League Openings:** New Owners will be placed in the lowest league of the new season, unless joining as a partial owner to an existing team. Exceptions may be granted at the discretion of the Board of Directors + +7. **Owner Departures** If an Owner finishes in the top 10 or is promoted but does not play the following season or an Owner is forced to drop a team or move down a league due to ownership of multiple teams, the last Owner relegated (i.e. 11th place) will move back up. This rule will apply until any openings are in the lowest league at which point a new owner will be added. Exceptions may be made at the discretion of the 338 Board of Directors. diff --git a/priv/rules/2021_keeper_rules.md b/priv/rules/2021_keeper_rules.md new file mode 100644 index 00000000..fe741f14 --- /dev/null +++ b/priv/rules/2021_keeper_rules.md @@ -0,0 +1,130 @@ +%{ +year: 2021, +draft_method: "keeper", +} + +--- + +# 2020-2021 338 Keeper League Special One-Time Rule Changes. + +## Standard rules have not been completely updated (I’m lazy). In the event of conflicting rules, special rules will supersede standard rules. + +### Special Rules + +1. All roster slots will become flex slots and there will be no requirements to draft players from all 15 sports. Owners may construct their roster with any combination of players. + +1. Total roster slots will be reduced to 15. + +1. There will be no single sport payouts. + +1. Due to the cancellation of the 2020 LLWS, the 2020 Kentucky Derby (Fall KD), rescheduled for September 5 will replace LLWS. The 2021 Kentucky Derby in May (Spring KD) will be a separate sport. + +1. There will be no restrictions on drafting KD picks, so some owners may not get a pick. + +1. Rescheduled 2020 events will be included in the 20-21 season. PGA will include the 2020 Masters and 2020 US Open, making a potential 6 PGA events. MT & WT will include the 20 French Open, making a potential 5 Tennis events. + +1. In order for the season to be official and payouts made, 8 sports must be completed or have the league name official results by August 4th, 2021. If 8 or more sports are cancelled or delayed beyond August 4th, 2021 the 338 season will be cancelled and all entry fees refunded with no winnings paid out. Trades of future draft picks will also be cancelled. + +1. If a sport is cancelled or delayed beyond Aug 4th, 2021 no points will be awarded, unless the league officially names a champion. All trades will be valid, unless the entire 338 season is cancelled. + +1. In the event that a sport does not complete a season **and** the league names an official champion but not a clear 2nd – 8th, the 338 will use the following rankings to award league points: + + - MLB – Relegation point system and tiebreaker (see Rule 11) + - CFB – AP Poll + - NFL – Standings following MLB relegation point system + - CBK – AP Poll + - NBA – Standings following MLB relegation point system + - CHK – Pairwise + - NHL – Standings following MLB relegation point system + - NCAA Baseball – _Poll TBD_ + - Champions League – points split among tied teams + - EXCEPTIONS: Actual results will be used if a league has partially completed the postseason at the time of cancellation/suspension. + +1. In order for PGA, MT and WT results to count in league play, at least 3 events must be completed by Aug 4th, 2021. + +### 338 Keeper Standard Rules for 2021 + +1. **Season:** The 2020-2021 338 Keeper Season includes sports with championships between August 1 2020 and ends with the Men’s Olympic Steeplechase Final. There are 14 permanent sports and a 15th sport that changes each year. Permanent sports are: NCAA Football, NFL, NCAA Basketball, NBA, NCAA Hockey, NHL, NCAA Baseball, MLB, Champions League, Kentucky Derby, PGA, LLWS, Men’s and Women’s Tennis. In 2020-21, the rotating sport will be Men’s Olympic Steeplechase. Subsequent years will be World Cup, Women’s World Cup. + +1. **Ownership:** Teams are allowed to have multiple owners and split the entry fee and winnings any way they choose. + + 1. For league voting purposes, each team will only receive one vote, regardless of number of owners. + 2. Owners are not allowed to own or have partial ownership in multiple 338 teams in the same league, but may own or have partial ownership in teams in different leagues. If relegation puts 2 teams with the same owner or partial owner in the same league, that owner must drop ownership or partial ownership of one team and remain uninvolved until the teams are no longer in the same league. + +1. **Rosters:** Each Owner has 20 roster slots with one slot dedicated to each sport (15 slots) and 5 slots open to any sport.  Roster slots may be left open at any time. + + 1. Tennis/Golf: You do not have to use the same player throughout the year.  2 players used in the same tournament will require 2 roster slots, but waivering/trading players for each tournament is allowed and the scores will be combined.  If using multiple roster slots, Owner must declare which slot a newly acquired player will be in.  Owners cannot use the same player in multiple slots, unless 2 or more rostered players have been used in the same slot.  In that case, order is determined by the highest ranked player at the time of acquisition going into the roster slot with the most points.  EX: I have Tiger and Phil for The Masters, then trade them both for Rory and Scott prior to PGA.  I must declare which players will be combined before the event.  I choose Tiger/Scott & Phil/Rory.  For the US Open, I trade Rory for Tiger and drop Scott for Stenson, making the combo Tiger/Scott/Tiger & Phil/Rory/Stenson.  Then I claim Scott for British Open, keeping Tiger & Stenson.  At time of claim, rankings are: #1-Scott, #3-Tiger, #7-Stenson.  Combo becomes Tiger/Scott/Tiger/Scott, Phil/Rory/Stenson/Tiger, Stenson. + + 1. Injured Reserve: Each Owner will have one IR slot per individual sport (MT, WT, PGA). If a player withdraws from an event prior to the start for any reason, Owner may move the player to IR and claim a new player. This will not cost a waiver claim, but the replacement player will be automatically dropped at the end of the tournament. IR claims are processed after the waiver deadline, giving priority to waiver claims. IR claims must be submitted prior to the start of the tournament. If a player is suspended or does not qualify for an event, IR does not apply and the player must be replaced by a waiver claim. + 1. In terms of roster slot occupation, the injured player maintains the occupied roster slot. If the replacement player is added via waivers for a future event, they are not considered to have occupied a roster slot. + +1. **Entry Fee:** $200 Payment due by Dec 1st, 2020. **Late payment may result in single sport disqualification(s) at the discretion of the Board of Directors.** + +1. **Scoring:** Points are awarded to the top 8 of each sport. 8 points for winning the league, 5 points for runner-up, 3 points for reaching the semifinals, and 1 point for reaching the quarterfinals. See individual sport for details.  If any team/player is later stripped of a standing, **prior to relegation** or the final championship of the year (whichever comes first), due to violation of any kind, points will be adjusted. Any violation and resulting standings change post-deadline will have no impact on the 338. + + 1. College Football:  Top 4 teams will be determined by the CFP.  The 4 highest ranked teams in the final AP Poll who are not in the playoffs will each get 1 point. + + 1. Tennis: Tennis-only points are awarded for each of the 4 Grand Slam Events (2020 US Open, 2021 Aussie Open, French Open and Wimbledon) immediately after the tournament. 1st=8, 2nd=5, SF=3, QF=1. Negative 2 points awarded to a Top 8 Seed losing in the 1st round and Negative 1 point for a Top 8 Seed losing in the 2nd round.  Tennis points will be tallied individually, to a specific roster slot.  If a player is traded or dropped, the Owner retains any points they have earned.  EX: I have Djokovic who wins the Aussie Open, scoring me 8 pts.  I trade him for Nadal prior to the French Open.  Nadal wins, so I now have 16 pts.  If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W).  League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8.  Owner must score at least 1 point to be eligible). + + 1. Golf: Golf-only points are awarded for each of the 4 2020 majors, immediately after the tournament: 1st=50, 2nd=40, 3rd-35th=37,36,35...6,5, 36th-40th =3, made cut =1, missed cut= -5.  Golf points will be tallied individually, to a specific roster slot.  If a player is traded or dropped, the Owner retains any points they have earned.  EX: I have Tiger and Phil.  Tiger wins the Masters (50pts) and Phil finishes 11th (29pts).  I keep Tiger but drop Phil and Tiger wins the PGA. I now have 100pts for Tiger and still have 29pts for Phil.  Prior to the US Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut.  I now have 95 pts for Tiger and 79 pts combined for Phil/Rory.  Following the four majors League points will be awarded to top 8 total scores.  Each Owner may have multiple places in the top 8.  Owner must score at least 1 pt to be eligible. + 1. Tennis/Golf League Points: Players may be dropped and traded throughout the year, resulting in multiple players earning points.  Rosters will lock after the final major's deadline and in order for league points to be earned, a roster slot must be occupied by that sport for the number of players earning points.  Ex: If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points.  If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player. + + 1. Tie Breakers: + - Individual Sport: League Points will be split evenly among all tied Owners. Golf points awarded in full to each tied owner.  Money split for 1st and/or 2nd place tie. + - League:  Owners will split the winnings evenly. + - Relegation:  See Below. + +1. **Payout:** + + All Leagues: + + - 1st: $875 + - 2nd: $650 + - 3rd: $475 + - 4th: $350 + - 5th: $250 + + 1. ~~Single Sport Payouts:  1st: $25 2nd: $10. If an un-owned team finishes 1st or 2nd, money goes into league pot and divided equally among top 5. Leftover amount after equally dividing goes to League Winner. If Owners tie, money is split evenly~~. + +1. **Waiver Wire:** Originally set by reverse draft order. A successful claim drops you to the bottom. All non-rostered players are on waivers. Waiver claims are made by submission via the site’s Waivers Page. Select the player you want and hit submit. The league will be notified and there will be a 3-day waiting period where any other Owner may also claim the player. Claims process exactly 72 hours after the original claim, regardless of how many other owners put a claim in. At the 72-hour mark, the Owner with the highest waiver priority will be awarded the player and must roster the player. If no valid roster slots are available, the claim will process as invalid and go to the next Owner. If the Waiver deadline has already passed, a player in that sport may NOT be dropped, even if in the same sport as the player being claimed, unless claim/drop was entered prior to the deadline but processes after. Once submitted, a claim may be cancelled within 2 hours of entry. After 2 hours, claims may not be cancelled but the player being dropped may be adjusted up to the process time.  Waiting Period is waived for College Basketball, College Hockey, Kentucky Derby and LLWS.  Due to the conference tournaments ending just before CBB and CHK brackets are announced, there will be no waiver period on claims in CBB and CHK.  Instead, we will have a 1 week “quiet period” prior to the deadline.  Claims will not be announced to the league and will process at the deadline based on waiver position. Extra draft picks at the end of KD & LLWS will be up for waiver claim until the individual draft begins. At that point, remaining draft picks may be claimed with no waiting period. Golf/Tennis: Owners do NOT receive credit for points earned in tournaments prior to waiver pickup.  Teams may be dropped without a pick-up, leaving an open roster slot to be filled later.  One roster slot must be dedicated to each sport and cannot be filled with a player from a different sport. Flex spots can be filled with players from any sport. + + 1. Waiver Deadline: See each sport for waiver deadlines. After the deadline NO PLAYERS may be claimed or dropped from roster, **except** for late drops and pending claims in the 3-day waiting period.  After the deadline, there will be an email sent with players that were dropped within 12 hours of deadline or dropped after a successful claim and Owners will have an opportunity to claim them.  This eliminates holding a player until the last minute to keep others from claiming.  This also allows an Owner that put in a claim, but was trumped by a higher waiver to claim another player. + +1. **Trades:** Trades are submitted to Commish and if eligible, presented to the league. Trades are ineligible if they break any 338 rules stated herein or include any non-338 assets. There will be a 3-day voting period needing 8 Yes votes to pass. A no-response during the voting period will be considered an approval.  Once a trade is submitted for Commish approval, the involved Owners are agreeing to the trade and may not make changes or vote against it unless all involved agree. Future Round Draft Picks may be traded, but only for the next draft to take place (if mid-draft, trades apply to that draft) and must be 1:1 (Owner-A trades 1st round pick to Owner-B for player and 5th round pick.) + + 1. Golf/Tennis: Points already earned by players that are traded stay with the former Owner. + 1. Trade Deadline: See each sport for trade deadlines. After the deadline NO TEAMS for that sport may be traded relating to the current season. Teams may be traded after the deadline for future seasons. + 1. Future Round Draft Picks: Deadline for trading draft picks and players for future seasons is July 1. + 1. Keepers: Players acquired via trade are eligible to be named a Keeper. Player’s draft round will be determined by draft position in previous draft. + 1. Cancellation/Suspension: If a sport is cancelled or suspended, trades will remain executed unless the entire 338 season is cancelled at which points all trades are nullified. + +1. **Draft:** Draft order determined by draw, with Owners place in one bucket and draft position placed in a different bucket. Conducted via website in Snake style. ~~For leagues that have a smaller number of teams (e.g. KD, LLWS), every member must be able to draft a team from a league. Once the limit has been reached, only members without a team from that league will be allowed to draft from that sport.~~  Once a draft pick has been submitted and emailed to the league, it cannot be changed. + + 1. Time Limit: Each Owner will have a cumulative total of 30 hours to make all 20 picks. There is no time limit on each pick. If an Owner exceeds 30 hours in total, the draft queue must be utilized to make picks. If the queue is empty, the Owner is able to manually enter a pick, but the site will proceed with the draft and allow the next Owner to enter their pick. + + 1. In-Season Drafts: Some sports will include a secondary draft in-season. During the main League Draft, you will select a draft position rather than a specific player (i.e. With my first round pick in the League draft, I select the First Pick of the Kentucky Derby). The following sports will have a secondary in-season draft: + + 1. Kentucky Derby: Draft will take place morning of race day. The first pick must be made by 7:30 AM PST and subsequent picks will each have a set deadline. If not in by the deadline, site will allow next owner to pick and the draft can proceed. A skipped owner may pick at any time after that, but cannot take a horse already drafted.   ~~Draft limited to 18 horses so in the event of a late scratch Owner will be able to replace horse.~~  If a horse is scratched after being drafted, a replacement may be picked at the completion of the draft and it will NOT count as a waiver claim.  If multiple horses are scratched, replacements are chosen in original draft order. + + 1. LLWS: The draft for the LLWS will begin in August, on the Wednesday before the tournament starts Thursday. Each pick will have a set deadline. If not in by the deadline, site will allow next owner to pick and the draft can proceed. A skipped owner may pick at any time after that, but cannot take a team already drafted. There are only 16 teams in the LLWS. + + 1. Steeplechase: The draft for the STP will begin in July, exact date TBD. + +1. **Keepers:** Each owner may designate up to 3 Players as Keepers. To be eligible, the Player must have been drafted in the previous draft and rostered the entire season. KD and LLWS draft picks and traded players are eligible for Keeper status, but free agent claims are not. A player designated as a Keeper will be drafted by the Owner one round earlier than taken in the previous draft. First Round picks are not eligible to be a Keeper. Keepers must be declared prior to the start of the draft and may not be changed once submitted. 1. If 2 or 3 players designated as Keepers were previously drafted in the same round and Owner does not have multiple picks in that round, one Keeper will move up an additional round. Owner may select which player moves up another round. 1. An Owner cannot designate 2 2nd round picks as Keepers unless Owner has multiple first round picks. 1. If Owner has multiple picks in a round where a Keeper is taken, Keeper is selected with Owner’s original pick, not pick acquired via trade. + +1. **Relegation:** ~~Based on League Points, the bottom 4 Owners in A and B will be relegated to League B and C respectively. The top 4 Owners in B and C will move up to A and B.  Because relegation and the next season’s draft will take place prior to the end of the MLB season, we will use the MLB regular season standings at the end of the day on the day of the US Open Men’s final.  This is for relegation purposes only.  League points will still be based on the playoffs.~~  For relegation, points will be awarded based on the following: + + - 8 pts: Best Overall Record + - 5 pts: Best Overall Record in other league + - 3 pts: 2nd Best Record in each league: + - 1 pt: 3rd division leader + best overall record of non-division leader.  If the top 2 teams are in the same division, then 1 point to other 2 division leaders. + + 1. TIEBREAKERS (in order of application): + 1. MLB: Run Differential, Record in September, Head-to-Head Record, Coin Flip + 1. LEAGUE: # of championships, # of teams scoring league points, lowest drafted team to score a league point (excludes waiver claims and trades). + 1. DRAFT PICK TRADES: If relegation results in Owners that traded draft picks in different leagues, the traded picks will take place at the end of the round.  EX: I trade my 1st round pick away and get a 10th round pick in return and I get relegated to B.  The Owner I traded with would get my 1st round pick at the end of the 1st round.  I would get the 10th round pick I traded for at the end of the 10th round.  If both teams involved in the trade stay in the same league, or both get relegated, they would swap actual picks.  If multiple Owners have supplemental picks, the order will be in reverse of the picks in that round. + 1. If an Owner gets relegated from A to B or B to C, but finishes in the money after actual MLB results are recorded, that Owner will automatically move up to the next league (after their relegation season) as the #1 team, regardless of actual position in B or C. + +1. **New Owners:** New Owners will be placed in the lowest league of the new season, unless joining as a partial owner to an existing team. Exceptions may be granted at the discretion of the Board of Directors. + +1. **Upper League Openings:** If an Owner finishes in the top 10 in A or B but does not play the following season or an Owner is forced to drop a team due to ownership of multiple teams, the 11th place Owner will remain in A and/or B and a new Owner will be added to C. Exceptions may be made at the discretion of the 338 Board of Directors. diff --git a/priv/rules/2021_standard_rules.md b/priv/rules/2021_standard_rules.md new file mode 100644 index 00000000..a533e0b7 --- /dev/null +++ b/priv/rules/2021_standard_rules.md @@ -0,0 +1,136 @@ +%{ +year: 2021, +draft_method: "redraft", +} + +--- + +# 2020-2021 338 Special One-Time Rule Changes. + +## Standard rules have not been completely updated (I’m lazy). In the event of conflicting rules, special rules will supersede standard rules. + +### Special Rules + +1. All roster slots will become flex slots and there will be no requirements to draft players from all 15 sports. Owners may construct their roster with any combination of players. + +1. Total roster slots will be reduced to 15. + +1. All 3 leagues, A, B and C will have a $200 entry fee and equal payouts. There will be no single sport payouts. + +1. There will be no relegation at the end of the 2020-21 season. + +1. Due to the cancellation of the 2020 LLWS, the 2020 Kentucky Derby (Fall KD), rescheduled for September 5 will replace LLWS. The 2021 Kentucky Derby in May (Spring KD) will be a separate sport. + +1. There will be no restrictions on drafting KD picks, so some owners may not get a pick. + +1. Rescheduled 2020 events will be included in the 20-21 season. PGA will include the 2020 Masters and 2020 US Open, making a potential 6 PGA events. MT & WT will include the 20 French Open, making a potential 5 Tennis events. + +1. In order for the season to be official and payouts made, 8 sports must be completed or have the league name official results by August 4th, 2021. If 8 or more sports are cancelled or delayed beyond Aug 4th, 2021 the 338 season will be cancelled and all entry fees refunded with no winnings paid out. Trades of future draft picks will also be cancelled. + +1. If a sport is cancelled or delayed beyond Aug 4th, 2021 no points will be awarded, unless the league officially names a champion. All trades will be valid, unless the entire 338 season is cancelled. + +1. In the event that a sport does not complete a season **and** the league names an official champion but not a clear 2nd – 8th, the 338 will use the following rankings to award league points: + + - MLB – Relegation point system and tiebreaker (see Rule 11) + - CFB – AP Poll + - NFL – Standings following MLB relegation point system + - CBK – AP Poll + - NBA – Standings following MLB relegation point system + - CHK – Pairwise + - NHL – Standings following MLB relegation point system + - NCAA Baseball – _Poll TBD_ + - Champions League – points split among tied teams + - EXCEPTIONS: Actual results will be used if a league has partially completed the postseason at the time of cancellation/suspension. + +1. In order for PGA, MT and WT results to count in league play, at least 3 events must be completed by Aug 4th, 2021. + +### 338 Standard Rules for 2021 + +1. **Season:** The 2020-2021 338 Season includes sports with championships between August 1 2020 and ends with the Men’s Olympic Steeplechase Final. There are 14 permanent sports and a 15th sport that changes each year. Permanent sports are: NCAA Football, NFL, NCAA Basketball, NBA, NCAA Hockey, NHL, NCAA Baseball, MLB, Champions League, Kentucky Derby, PGA, LLWS, Men’s and Women’s Tennis. In 2020-21, the rotating sport will be Men’s Olympic Steeplechase. Subsequent years will be World Cup, Women’s World Cup. + +1. **Ownership:** Teams are allowed to have multiple owners and split the entry fee and winnings any way they choose. + + 1. For league voting purposes, each team will only receive one vote, regardless of number of owners. + 2. Owners are not allowed to own or have partial ownership in multiple 338 teams in the same league, but may own or have partial ownership in teams in different leagues. If relegation/promotion puts 2 teams with the same owner or partial owner in the same league, owner(s) may drop ownership stake to a single team or else the lower ranked team(s) will be pushed down a league until all owners have a stake in only one team/league. + +1. **Rosters:** Each Owner has 20 roster slots with one slot dedicated to each sport (15 slots) and 5 slots open to any sport.  Roster slots may be left open at any time. + + 1. Tennis/Golf: You do not have to use the same player throughout the year.  2 players used in the same tournament will require 2 roster slots, but waivering/trading players for each tournament is allowed and the scores will be combined.  If using multiple roster slots, Owner must declare which slot a newly acquired player will be in.  Owners cannot use the same player in multiple slots, unless 2 or more rostered players have been used in the same slot.  In that case, order is determined by the highest ranked player at the time of acquisition going into the roster slot with the most points.  EX: I have Tiger and Phil for The Masters, then trade them both for Rory and Scott prior to PGA.  I must declare which players will be combined before the event.  I choose Tiger/Scott & Phil/Rory.  For the US Open, I trade Rory for Tiger and drop Scott for Stenson, making the combo Tiger/Scott/Tiger & Phil/Rory/Stenson.  Then I claim Scott for British Open, keeping Tiger & Stenson.  At time of claim, rankings are: #1-Scott, #3-Tiger, #7-Stenson.  Combo becomes Tiger/Scott/Tiger/Scott, Phil/Rory/Stenson/Tiger, Stenson. + + 1. Injured Reserve: Each Owner will have one IR slot per individual sport (MT, WT, PGA). If a player withdraws from an event prior to the start for any reason, Owner may move the player to IR and claim a new player. This will not cost a waiver claim, but the replacement player will be automatically dropped at the end of the tournament. IR claims are processed after the waiver deadline, giving priority to waiver claims. IR claims must be submitted prior to the start of the tournament. If a player is suspended or does not qualify for an event, IR does not apply and the player must be replaced by a waiver claim. + 1. In terms of roster slot occupation, the injured player maintains the occupied roster slot. If the replacement player is added via waivers for a future event, they are not considered to have occupied a roster slot. + +1. **Entry Fee:** League A: $200, B: $200, C: $200. Payment due by Dec 1st, 2020. **Late payment may result in single sport disqualification(s) at the discretion of the Board of Directors.** + +1. **Scoring:** Points are awarded to the top 8 of each sport. 8 points for winning the league, 5 points for runner-up, 3 points for reaching the semifinals, and 1 point for reaching the quarterfinals. See individual sport for details.  If any team/player is later stripped of a standing, **prior to relegation** or the final championship of the year (whichever comes first), due to violation of any kind, points will be adjusted. Any violation and resulting standings change post-deadline will have no impact on the 338. + + 1. College Football:  Top 4 teams will be determined by the CFP.  The 4 highest ranked teams in the final AP Poll who are not in the playoffs will each get 1 point. + + 1. Tennis: Tennis-only points are awarded for each of the 4 Grand Slam Events (2020 US Open, 2021 Aussie Open, French Open and Wimbledon) immediately after the tournament. 1st=8, 2nd=5, SF=3, QF=1. Negative 2 points awarded to a Top 8 Seed losing in the 1st round and Negative 1 point for a Top 8 Seed losing in the 2nd round.  Tennis points will be tallied individually, to a specific roster slot.  If a player is traded or dropped, the Owner retains any points they have earned.  EX: I have Djokovic who wins the Aussie Open, scoring me 8 pts.  I trade him for Nadal prior to the French Open.  Nadal wins, so I now have 16 pts.  If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W).  League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8.  Owner must score at least 1 point to be eligible). + + 1. Golf: Golf-only points are awarded for each of the 4 2020 majors, immediately after the tournament: 1st=50, 2nd=40, 3rd-35th=37,36,35...6,5, 36th-40th =3, made cut =1, missed cut= -5.  Golf points will be tallied individually, to a specific roster slot.  If a player is traded or dropped, the Owner retains any points they have earned.  EX: I have Tiger and Phil.  Tiger wins the Masters (50pts) and Phil finishes 11th (29pts).  I keep Tiger but drop Phil and Tiger wins the PGA. I now have 100pts for Tiger and still have 29pts for Phil.  Prior to the US Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut.  I now have 95 pts for Tiger and 79 pts combined for Phil/Rory.  Following the four majors League points will be awarded to top 8 total scores.  Each Owner may have multiple places in the top 8.  Owner must score at least 1 pt to be eligible. + 1. Tennis/Golf League Points: Players may be dropped and traded throughout the year, resulting in multiple players earning points.  Rosters will lock after the final major's deadline and in order for league points to be earned, a roster slot must be occupied by that sport for the number of players earning points.  Ex: If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points.  If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player. + + 1. Tie Breakers: + - Individual Sport: League Points will be split evenly among all tied Owners. Golf points awarded in full to each tied owner.  Money split for 1st and/or 2nd place tie. + - League:  Owners will split the winnings evenly. + - Relegation:  See Below. + +1. **Payout:** + + All Leagues: + + - 1st: $825 + - 2nd: $625 + - 3rd: $450 + - 4th: $300 + - 5th: $200 + + 1. ~~Single Sport Payouts:  1st: $25 2nd: $10. If an un-owned team finishes 1st or 2nd, money goes into league pot and divided equally among top 5. Leftover amount after equally dividing goes to League Winner. If Owners tie, money is split evenly~~. + +1. **Waiver Wire:** Originally set by reverse draft order. A successful claim drops you to the bottom. All non-rostered players are on waivers. Waiver claims are made by submission via the site’s Waivers Page. Select the player you want and hit submit. The league will be notified and there will be a 3-day waiting period where any other Owner may also claim the player. Claims process exactly 72 hours after the original claim, regardless of how many other owners put a claim in. At the 72-hour mark, the Owner with the highest waiver priority will be awarded the player and must roster the player. If no valid roster slots are available, the claim will process as invalid and go to the next Owner. If the Waiver deadline has already passed, a player in that sport may NOT be dropped, even if in the same sport as the player being claimed, unless claim/drop was entered prior to the deadline but processes after. Once submitted, a claim may be cancelled within 2 hours of entry. After 2 hours, claims may not be cancelled but the player being dropped may be adjusted up to the process time.  Waiting Period is waived for College Basketball, College Hockey, Kentucky Derby and LLWS.  Due to the conference tournaments ending just before CBB and CHK brackets are announced, there will be no waiver period on claims in CBB and CHK.  Instead, we will have a 1 week “quiet period” prior to the deadline.  Claims will not be announced to the league and will process at the deadline based on waiver position. Extra draft picks at the end of KD & LLWS will be up for waiver claim until the individual draft begins. At that point, remaining draft picks may be claimed with no waiting period. Golf/Tennis: Owners do NOT receive credit for points earned in tournaments prior to waiver pickup.  Teams may be dropped without a pick-up, leaving an open roster slot to be filled later.  One roster slot must be dedicated to each sport and cannot be filled with a player from a different sport. Flex spots can be filled with players from any sport. + + 1. Waiver Deadline: See each sport for waiver deadlines. After the deadline NO PLAYERS may be claimed or dropped from roster, **except** for late drops and pending claims in the 3-day waiting period.  After the deadline, there will be an email sent with players that were dropped within 12 hours of deadline or dropped after a successful claim and Owners will have an opportunity to claim them.  This eliminates holding a player until the last minute to keep others from claiming.  This also allows an Owner that put in a claim, but was trumped by a higher waiver to claim another player. + +1. **Trades:** Trades are submitted to Commish and if eligible, presented to the league. Trades are ineligible if they break any 338 rules stated herein or include any non-338 assets. There will be a 3-day voting period needing 8 Yes votes to pass. A no-response during the voting period will be considered an approval.  Once a trade is submitted for Commish approval, the involved Owners are agreeing to the trade and may not make changes or vote against it unless all involved agree. Future Round Draft Picks may be traded, but only for the next draft to take place (if mid-draft, trades apply to that draft) and must be 1:1 (Owner-A trades 1st round pick to Owner-B for player and 5th round pick.) + + 1. Golf/Tennis: Points already earned by players that are traded stay with the former Owner. + 1. Trade Deadline: See each sport for trade deadlines. After the deadline NO TEAMS for that sport may be traded relating to the current season. Teams may be traded after the deadline for future seasons. + 1. Future Round Draft Picks: Deadline for trading draft picks and players for future seasons is July 1. + 1. Keepers: Players acquired via trade are eligible to be named a Keeper. Player’s draft round will be determined by draft position in previous draft. + 1. Cancellation/Suspension: If a sport is cancelled or suspended, trades will remain executed unless the entire 338 season is cancelled at which points all trades are nullified. + +1. **Draft:** Draft order determined by draw, with Owners place in one bucket and draft position placed in a different bucket. Conducted via website in Snake style. ~~For leagues that have a smaller number of teams (e.g. KD, LLWS), every member must be able to draft a team from a league. Once the limit has been reached, only members without a team from that league will be allowed to draft from that sport.~~  Once a draft pick has been submitted and emailed to the league, it cannot be changed. + + 1. Time Limit: Each Owner will have a cumulative total of 30 hours to make all 20 picks. There is no time limit on each pick. If an Owner exceeds 30 hours in total, the draft queue must be utilized to make picks. If the queue is empty, the Owner is able to manually enter a pick, but the site will proceed with the draft and allow the next Owner to enter their pick. + + 1. In-Season Drafts: Some sports will include a secondary draft in-season. During the main League Draft, you will select a draft position rather than a specific player (i.e. With my first round pick in the League draft, I select the First Pick of the Kentucky Derby). The following sports will have a secondary in-season draft: + + 1. Kentucky Derby: Draft will take place morning of race day. The first pick must be made by 7:30 AM PST and subsequent picks will each have a set deadline. If not in by the deadline, site will allow next owner to pick and the draft can proceed. A skipped owner may pick at any time after that, but cannot take a horse already drafted.   ~~Draft limited to 18 horses so in the event of a late scratch Owner will be able to replace horse.~~  If a horse is scratched after being drafted, a replacement may be picked at the completion of the draft and it will NOT count as a waiver claim.  If multiple horses are scratched, replacements are chosen in original draft order. + + 1. LLWS: The draft for the LLWS will begin in August, on the Wednesday before the tournament starts Thursday. Each pick will have a set deadline. If not in by the deadline, site will allow next owner to pick and the draft can proceed. A skipped owner may pick at any time after that, but cannot take a team already drafted. There are only 16 teams in the LLWS. + + 1. Steeplechase: The draft for the STP will begin in July, exact date TBD. + + 1. Keepers: Each owner may designate up to 3 Players as Keepers. To be eligible, the Player must have been drafted in the previous draft and rostered the entire season. KD and LLWS draft picks and traded players are eligible for Keeper status, but free agent claims are not. A player designated as a Keeper will be drafted by the Owner one round earlier than taken in the previous draft. First Round picks are not eligible to be a Keeper. Keepers must be declared prior to the start of the draft and may not be changed once submitted. + 1. If 2 or 3 players designated as Keepers were previously drafted in the same round and Owner does not have multiple picks in that round, one Keeper will move up an additional round. Owner may select which player moves up another round. + 1. An Owner cannot designate 2 2nd round picks as Keepers unless Owner has multiple first round picks. + 1. If Owner has multiple picks in a round where a Keeper is taken, Keeper is selected with Owner’s original pick, not pick acquired via trade. + +1. **Relegation:** ~~Based on League Points, the bottom 4 Owners in A and B will be relegated to League B and C respectively. The top 4 Owners in B and C will move up to A and B.  Because relegation and the next season’s draft will take place prior to the end of the MLB season, we will use the MLB regular season standings at the end of the day on the day of the US Open Men’s final.  This is for relegation purposes only.  League points will still be based on the playoffs.~~  For relegation, points will be awarded based on the following: + + - 8 pts: Best Overall Record + - 5 pts: Best Overall Record in other league + - 3 pts: 2nd Best Record in each league: + - 1 pt: 3rd division leader + best overall record of non-division leader.  If the top 2 teams are in the same division, then 1 point to other 2 division leaders. + + 1. TIEBREAKERS (in order of application): + 1. MLB: Run Differential, Record in September, Head-to-Head Record, Coin Flip + 1. LEAGUE: # of championships, # of teams scoring league points, lowest drafted team to score a league point (excludes waiver claims and trades). + 1. If relegation/promotion puts 2 teams with the same owner or partial owner in the same league, owner(s) may drop ownership stake to a single team or else the lower ranked team(s) will be pushed down a league until all owners have a stake in only one team/league. In this case, the last team relegated (i.e. 11th place) will move back up. + 1. DRAFT PICK TRADES: If relegation results in Owners that traded draft picks in different leagues, the traded picks will take place at the end of the round.  EX: I trade my 1st round pick away and get a 10th round pick in return and I get relegated to B.  The Owner I traded with would get my 1st round pick at the end of the 1st round.  I would get the 10th round pick I traded for at the end of the 10th round.  If both teams involved in the trade stay in the same league, or both get relegated, they would swap actual picks.  If multiple Owners have supplemental picks, the order will be in reverse of the picks in that round. + 1. If an Owner gets relegated from A to B or B to C, but finishes in the money after actual MLB results are recorded, that Owner will automatically move up to the next league (after their relegation season) as the #1 team, regardless of actual position in B or C. + +1. **New Owners:** New Owners will be placed in the lowest league of the new season, unless joining as a partial owner to an existing team. Exceptions may be granted at the discretion of the Board of Directors. + +1. **Upper League Openings:** If an Owner finishes in the top 10 in A or B but does not play the following season or an Owner is forced to drop a team due to ownership of multiple teams, the 11th place Owner will remain in A and/or B and a new Owner will be added to C. Exceptions may be made at the discretion of the 338 Board of Directors. diff --git a/priv/rules/2022_keeper_rules.md b/priv/rules/2022_keeper_rules.md new file mode 100644 index 00000000..b5f6a83a --- /dev/null +++ b/priv/rules/2022_keeper_rules.md @@ -0,0 +1,94 @@ +%{ +year: 2022, +draft_method: "keeper", +} + +--- + +### 338 Keeper Rules for 2021 + +1. **Season:** The 2021-2022 338 Keeper Season includes sports with championships between August 15, 2021 and July 31, 2022. There are 14 permanent sports and a 15th sport that changes each year. Permanent sports are: NCAA Football, NFL, NCAA Basketball, NBA, NCAA Hockey, NHL, NCAA Baseball, MLB, Champions League, Kentucky Derby, PGA, LLWS, Men’s and Women’s Tennis. In 2021-22, the rotating sport will be Rugby League World Cup. Subsequent years will be World Cup, Women’s World Cup and Men’s 3000m Steeplechase in the Summer Olympics. + +1. **Ownership:** Teams are allowed to have multiple owners and split the entry fee and winnings any way they choose. + + 1. For league voting purposes, each team will only receive one vote, regardless of number of owners. + 2. Owners are not allowed to own or have partial ownership in multiple 338 teams in the same league, but may own or have partial ownership in teams in different leagues. If relegation puts 2 teams with the same owner or partial owner in the same league, that owner must drop ownership or partial ownership of one team and remain uninvolved until the teams are no longer in the same league. + +1. **Rosters:** Each Owner has 20 roster slots with one slot dedicated to each sport (15 slots) and 5 slots open to any sport.  Roster slots may be left open at any time. + + 1. Tennis/Golf: You do not have to use the same player throughout the year.  2 players used in the same tournament will require 2 roster slots, but waivering/trading players for each tournament is allowed and the scores will be combined.  If using multiple roster slots, Owner must declare which slot a newly acquired player will be in.  Owners cannot use the same player in multiple slots, unless 2 or more rostered players have been used in the same slot.  In that case, order is determined by the highest ranked player at the time of acquisition going into the roster slot with the most points.  EX: I have Tiger and Phil for The Masters, then trade them both for Rory and Scott prior to PGA.  I must declare which players will be combined before the event.  I choose Tiger/Scott & Phil/Rory.  For the US Open, I trade Rory for Tiger and drop Scott for Stenson, making the combo Tiger/Scott/Tiger & Phil/Rory/Stenson.  Then I claim Scott for British Open, keeping Tiger & Stenson.  At time of claim, rankings are: #1-Scott, #3-Tiger, #7-Stenson.  Combo becomes Tiger/Scott/Tiger/Scott, Phil/Rory/Stenson/Tiger, Stenson. + + 1. Injured Reserve: Each Owner will have one IR slot per individual sport (MT, WT, PGA). If a player withdraws from an event prior to the start for any reason, Owner may move the player to IR and claim a new player. This will not cost a waiver claim, but the replacement player will be automatically dropped at the end of the tournament. IR claims are processed after the waiver deadline, giving priority to waiver claims. IR claims must be submitted prior to the start of the tournament. If a player is suspended or does not qualify for an event, IR does not apply and the player must be replaced by a waiver claim. + 1. In terms of roster slot occupation, the injured player maintains the occupied roster slot. If the replacement player is added via waivers for a future event, they are not considered to have occupied a roster slot. + +1. **Entry Fee:** $250 Payment due by Dec 1st, 2021. **Late payment may result in single sport disqualification(s) at the discretion of the Board of Directors.** + +1. **Scoring:** Points are awarded to the top 8 of each sport. 8 points for winning the league, 5 points for runner-up, 3 points for reaching the semifinals, and 1 point for reaching the quarterfinals. See individual sport for details.  If any team/player is later stripped of a standing, **prior to relegation** or the final championship of the year (whichever comes first), due to violation of any kind, points will be adjusted. Any violation and resulting standings change post-deadline will have no impact on the 338. + + 1. College Football:  Top 4 teams will be determined by the CFP.  The 4 highest ranked teams in the final AP Poll who are not in the playoffs will each get 1 point. + + 1. Tennis: Tennis-only points are awarded for each of the 4 Grand Slam Events (2021 US Open, 2022 Aussie Open, French Open and Wimbledon) immediately after the tournament. 1st=8, 2nd=5, SF=3, QF=1. Negative 2 points awarded to a Top 8 Seed losing in the 1st round and Negative 1 point for a Top 8 Seed losing in the 2nd round.  Tennis points will be tallied individually, to a specific roster slot.  If a player is traded or dropped, the Owner retains any points they have earned.  EX: I have Djokovic who wins the Aussie Open, scoring me 8 pts.  I trade him for Nadal prior to the French Open.  Nadal wins, so I now have 16 pts.  If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W).  League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8.  Owner must score at least 1 point to be eligible). + + 1. Golf: Golf-only points are awarded for each of the 4 2020 majors, immediately after the tournament: 1st=50, 2nd=40, 3rd-35th=37,36,35...6,5, 36th-40th =3, made cut =1, missed cut= -5.  Golf points will be tallied individually, to a specific roster slot.  If a player is traded or dropped, the Owner retains any points they have earned.  EX: I have Tiger and Phil.  Tiger wins the Masters (50pts) and Phil finishes 11th (29pts).  I keep Tiger but drop Phil and Tiger wins the PGA. I now have 100pts for Tiger and still have 29pts for Phil.  Prior to the US Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut.  I now have 95 pts for Tiger and 79 pts combined for Phil/Rory.  Following the four majors League points will be awarded to top 8 total scores.  Each Owner may have multiple places in the top 8.  Owner must score at least 1 pt to be eligible. + 1. Tennis/Golf League Points: Players may be dropped and traded throughout the year, resulting in multiple players earning points.  Rosters will lock after the final major's deadline and in order for league points to be earned, a roster slot must be occupied by that sport for the number of players earning points.  Ex: If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points.  If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player. + + 1. Tie Breakers: + - Individual Sport: League Points will be split evenly among all tied Owners. Golf points awarded in full to each tied owner.  Money split for 1st and/or 2nd place tie. + - League:  Owners will split the winnings evenly. + - Relegation:  See Below. + +1. **Payout:** + + - 1st: $1,000 + - 2nd: $750 + - 3rd: $550 + - 4th: $400 + - 5th: $275 + + 1. Single Sport Payouts:  1st: $25 2nd: $10. If an un-owned team finishes 1st or 2nd, money goes into league pot and divided equally among top 5. Leftover amount after equally dividing goes to League Winner. If Owners tie, money is split evenly. + +1. **Waiver Wire:** Originally set by reverse draft order. A successful claim drops you to the bottom. All non-rostered players are on waivers. Waiver claims are made by submission via the site’s Waivers Page. Select the player you want and hit submit. The league will be notified and there will be a 3-day waiting period where any other Owner may also claim the player. Claims process exactly 72 hours after the original claim, regardless of how many other owners put a claim in. + + At the 72-hour mark, the Owner with the highest waiver priority will be awarded the player and must roster the player. If no valid roster slots are available, the claim will process as invalid and go to the next Owner. If the Waiver deadline has already passed, a player in that sport may NOT be dropped, even if in the same sport as the player being claimed, unless claim/drop was entered prior to the deadline but processes after. + + Waiting Period is waived for College Basketball, College Hockey, Kentucky Derby and LLWS.  Due to the conference tournaments ending just before CBB and CHK brackets are announced, there will be no waiver period on claims in CBB and CHK.  Instead, we will have a 1 week “quiet period” prior to the deadline.  Claims will not be announced to the league and will process at the deadline based on waiver position. Extra draft picks at the end of KD & LLWS will be up for waiver claim until the individual draft begins. At that point, remaining draft picks may be claimed with no waiting period. Golf/Tennis: Owners do NOT receive credit for points earned in tournaments prior to waiver pickup.  Teams may be dropped without a pick-up, leaving an open roster slot to be filled later.  One roster slot must be dedicated to each sport and cannot be filled with a player from a different sport. Flex spots can be filled with players from any sport. + +1. **Waiver Deadline:** See each sport for waiver deadlines. After the deadline NO players may be claimed or dropped from roster, **except** for late drops and pending claims in the 3-day waiting period.  After the deadline, there will be an email sent with players that were dropped within 12 hours of deadline or dropped after a successful claim and Owners will have an opportunity to claim them.  This eliminates holding a player until the last minute to keep others from claiming.  This also allows an Owner that put in a claim, but was trumped by a higher waiver to claim another player. + +1. **Trades:** Trades are submitted to Commish and if eligible, presented to the league. Trades are ineligible if they break any 338 rules stated herein or include any non-338 assets. There will be a 3-day voting period needing a majority Yes votes to pass. A no-response during the voting period will be considered an approval.  Once a trade is submitted for Commish approval, the involved Owners are agreeing to the trade and may not make changes or vote against it unless all involved agree. Future Round Draft Picks may be traded, but only for the next draft to take place (if mid-draft, trades apply to that draft) and must be 1:1 (Owner-A trades 1st round pick to Owner-B for player and 5th round pick.) + + 1. Golf/Tennis: Points already earned by players that are traded stay with the former Owner. + 1. Trade Deadline: See each sport for trade deadlines. After the deadline NO players for that sport may be traded relating to the current season. Keeper rights to a player may be traded but it will not affect the current season’s rosters or points. + 1. Future Round Draft Picks: Deadline for trading draft picks and players for future seasons is the trade deadline of the final sport. + 1. Keepers: Players acquired via trade are eligible to be named a Keeper. Player’s draft round will be determined by draft position in previous draft. + 1. Cancellation/Suspension: If a sport is cancelled or suspended, trades will remain executed unless the entire 338 season is cancelled at which points all trades are nullified. + +1. **Draft:** Draft order determined by draw, with Owners place in one bucket and draft position placed in a different bucket. Conducted via website in Snake style. For leagues that have a smaller number of teams (e.g. KD, LLWS), every member must be able to draft a team from a league. Once the limit has been reached, only members without a team from that league will be allowed to draft from that sport.  Once a draft pick has been submitted and emailed to the league, it cannot be changed. + + 1. Time Limit: Each Owner will have a cumulative total of 25 hours to make all 20 picks. There is no time limit on each pick. If an Owner exceeds 25 hours in total, the draft queue must be utilized to make picks. If the queue is empty, the Owner is able to manually enter a pick, but the site will proceed with the draft and allow the next Owner to enter their pick. + + 1. In-Season Drafts: Some sports will include a secondary draft in-season. During the main League Draft, you will select a draft position rather than a specific player (i.e. With my first round pick in the League draft, I select the First Pick of the Kentucky Derby). The following sports will have a secondary in-season draft: + + 1. Kentucky Derby: Draft will take place on race day.IN 2022, the draft queue must be utilized. Owners will load their picks and the draft will take place via autodraft at1:30 pm PDT. If an owner does not have their queue loaded at 1:30, they will be skipped. A skipped owner may pick at any time after that, but cannot take a horse already drafted. ~~Draft limited to 18 horses so in the event of a late scratch Owner will be able to replace horse.~~  If a horse is scratched after being drafted, a replacement may be picked at the completion of the draft and it will NOT count as a waiver claim.  If multiple horses are scratched, replacements are chosen in original draft order. + + 1. LLWS: The draft for the LLWS will begin in August, on the Wednesday before the tournament starts Thursday. Each pick will have a set deadline. If not in by the deadline, site will allow next owner to pick and the draft can proceed. A skipped owner may pick at any time after that, but cannot take a team already drafted. There are only 16 teams in the LLWS. + +1. **Keepers:** Each owner may designate up to 3 Players as Keepers. To be eligible, the Player must have been drafted in the previous draft and rostered the entire season. KD and LLWS draft picks and traded players are eligible for Keeper status, but free agent claims are not. A player designated as a Keeper will be drafted by the Owner one round earlier than taken in the previous draft. First Round picks are not eligible to be a Keeper. Keepers must be declared prior to the start of the draft and may not be changed once submitted. 1. If 2 or 3 players designated as Keepers were previously drafted in the same round and Owner does not have multiple picks in that round, one Keeper will move up an additional round. Owner may select which player moves up another round. 1. An Owner cannot designate 2 2nd round picks as Keepers unless Owner has multiple first round picks. 1. If Owner has multiple picks in a round where a Keeper is taken, Keeper is selected with Owner’s original pick, not pick acquired via trade. + +1. **New Owners:** New Owners will be placed in the lowest league of the new season, unless joining as a partial owner to an existing team. Exceptions may be granted at the discretion of the Board of Directors. + +1. **Upper League Openings:** If an Owner finishes in the top 10 in A or B but does not play the following season or an Owner is forced to drop a team due to ownership of multiple teams, the 11th place Owner will remain in A and/or B and a new Owner will be added to C. Exceptions may be made at the discretion of the 338 Board of Directors. + +1. **Cancellations:** In order for the season to be official and payouts made, 8 sports must be completed or have the league name official results by August 1st, 2022. If 8 or more sports are cancelled or delayed beyond August 1st, the 338 season will be cancelled and all entry fees refunded with no winnings paid out. Trades of future draft picks will also be cancelled. + + If a sport is cancelled or delayed beyond Aug 1st, 2022 no points will be awarded, unless the league officially names a champion. All trades will be valid, unless the entire 338 season is cancelled.In the event that a sport does not complete a season and the league names an official champion but not a clear 2nd – 8th, the 338 will use the following rankings to award league points: + +- MLB – 5 pts to best record in other league, 3 points to 2nd best record in eachleague and 1 pt to 3rd division leader and best record for a non-division leader. If the top 2 teams are in the same division, then 1 point to other 2 division leaders. +- CFB – AP Poll +- NFL – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. +- CBK – AP Poll +- NBA – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. +- CHK – PairwiseNHL – – 5 pts to best record in other conference, 3 points to 2nd best record ineach conference and 1 pt to 3rd & 4th best records in each conference. +- NCAA Baseball – D1Baseball.com RankingsChampions League – points split among tied teams + + EXCEPTIONS: Actual results will be used if a league has partially completed the postseason at the time of cancellation/suspension.In order for PGA, MT and WT results to count in league play, at least 3 eventsmust be completed by Aug 1st, 2022. diff --git a/priv/rules/2022_standard_rules.md b/priv/rules/2022_standard_rules.md new file mode 100644 index 00000000..4e942a13 --- /dev/null +++ b/priv/rules/2022_standard_rules.md @@ -0,0 +1,119 @@ +%{ +year: 2022, +draft_method: "redraft", +} + +--- + +### 338 Rules for 2022 + +1. **Season:** The 2021-2022 338 Season includes sports with championships between August 15, 2021 and July 31, 2022. There are 14 permanent sports and a 15th sport that changes each year. Permanent sports are: NCAA Football, NFL, NCAA Basketball, NBA, NCAA Hockey, NHL, NCAA Baseball, MLB, Champions League, Kentucky Derby, PGA, LLWS, Men’s and Women’s Tennis. In 2021-22, the rotating sport will be Rugby League World Cup. Subsequent years will be World Cup, Women’s World Cup and Men’s 3000m Steeplechase in the Summer Olympics. + +1. **Ownership:** Teams are allowed to have multiple owners and split the entry fee and winnings any way they choose. + + 1. For league voting purposes, each team will only receive one vote, regardless of number of owners. + 2. Owners are not allowed to own or have partial ownership in multiple 338 teams in the same league, but may own or have partial ownership in teams in different leagues. If relegation/promotion puts 2 teams with the same owner or partial owner in the same league, owner(s) may drop ownership stake to a single team or else the lower ranked team(s) will be pushed down a league until all owners have a stake in only one team/league. + +1. **Rosters:** Each Owner has 20 roster slots with one slot dedicated to each sport (15 slots) and 5 slots open to any sport.  Roster slots may be left open at any time. + + 1. Tennis/Golf: You do not have to use the same player throughout the year.  2 players used in the same tournament will require 2 roster slots, but waivering/trading players for each tournament is allowed and the scores will be combined.  If using multiple roster slots, Owner must declare which slot a newly acquired player will be in.  Owners cannot use the same player in multiple slots, unless 2 or more rostered players have been used in the same slot.  In that case, order is determined by the highest ranked player at the time of acquisition going into the roster slot with the most points.  EX: I have Tiger and Phil for The Masters, then trade them both for Rory and Scott prior to PGA.  I must declare which players will be combined before the event.  I choose Tiger/Scott & Phil/Rory.  For the US Open, I trade Rory for Tiger and drop Scott for Stenson, making the combo Tiger/Scott/Tiger & Phil/Rory/Stenson.  Then I claim Scott for British Open, keeping Tiger & Stenson.  At time of claim, rankings are: #1-Scott, #3-Tiger, #7-Stenson.  Combo becomes Tiger/Scott/Tiger/Scott, Phil/Rory/Stenson/Tiger, Stenson. + + 1. Injured Reserve: Each Owner will have one IR slot per individual sport (MT, WT, PGA). If a player withdraws from an event prior to the start for any reason, Owner may move the player to IR and claim a new player. This will not cost a waiver claim, but the replacement player will be automatically dropped at the end of the tournament. IR claims are processed after the waiver deadline, giving priority to waiver claims. IR claims must be submitted prior to the start of the tournament. If a player is suspended or does not qualify for an event, IR does not apply and the player must be replaced by a waiver claim. + +1. **Entry Fee:** League A: $225, B: $250, C: $275. Payment due by Dec 1st, 2021. **Late payment may result in single sport disqualification(s) at the discretion of the Board of Directors.** + +1. **Scoring:** Points are awarded to the top 8 of each sport. 8 points for winning the league, 5 points for runner-up, 3 points for reaching the semifinals, and 1 point for reaching the quarterfinals. See individual sport for details.  If any team/player is later stripped of a standing, **prior to relegation** or the final championship of the year (whichever comes first), due to violation of any kind, points will be adjusted. Any violation and resulting standings change post-deadline will have no impact on the 338. + + 1. College Football:  Top 4 teams will be determined by the CFP.  The 4 highest ranked teams in the final AP Poll who are not in the playoffs will each get 1 point. + + 1. Tennis: Tennis-only points are awarded for each of the 4 Grand Slam Events (2021 US Open, 2022 Aussie Open, French Open and Wimbledon) immediately after the tournament. 1st=8, 2nd=5, SF=3, QF=1. Negative 2 points awarded to a Top 8 Seed losing in the 1st round and Negative 1 point for a Top 8 Seed losing in the 2nd round.  Tennis points will be tallied individually, to a specific roster slot.  If a player is traded or dropped, the Owner retains any points they have earned.  EX: I have Djokovic who wins the Aussie Open, scoring me 8 pts.  I trade him for Nadal prior to the French Open.  Nadal wins, so I now have 16 pts.  If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W).  League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8.  Owner must score at least 1 point to be eligible). + + 1. Golf: Golf-only points are awarded for each of the 4 2020 majors, immediately after the tournament: 1st=50, 2nd=40, 3rd-35th=37,36,35...6,5, 36th-40th =3, made cut =1, missed cut= -5.  Golf points will be tallied individually, to a specific roster slot.  If a player is traded or dropped, the Owner retains any points they have earned.  EX: I have Tiger and Phil.  Tiger wins the Masters (50pts) and Phil finishes 11th (29pts).  I keep Tiger but drop Phil and Tiger wins the PGA. I now have 100pts for Tiger and still have 29pts for Phil.  Prior to the US Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut.  I now have 95 pts for Tiger and 79 pts combined for Phil/Rory.  Following the four majors League points will be awarded to top 8 total scores.  Each Owner may have multiple places in the top 8.  Owner must score at least 1 pt to be eligible. + 1. Tennis/Golf League Points: Players may be dropped and traded throughout the year, resulting in multiple players earning points.  Rosters will lock after the final major's deadline and in order for league points to be earned, a roster slot must be occupied by that sport for the number of players earning points.  Ex: If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points.  If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player. + + 1. Tie Breakers: + - Individual Sport: League Points will be split evenly among all tied Owners. Golf points awarded in full to each tied owner.  Money split for 1st and/or 2nd place tie. + - League:  Owners will split the winnings evenly. + - Relegation:  See Below. + +1. **Payout:** + + 1.League A: + + - 1st: $975 + - 2nd: $750 + - 3rd: $550 + - 4th: $350 + - 5th: $275 + + 2. League B: + + - 1st: $900 + - 2nd: $650 + - 3rd: $475 + - 4th: $350 + - 5th: $275 + + 3. League C: + + - 1st: $750 + - 2nd: $575 + - 3rd: $425 + - 4th: $325 + - 5th: $275 + + 4. Single Sport Payouts:  1st: $25 2nd: $10. If an un-owned team finishes 1st or 2nd, money goes into league pot and divided equally among top 5. Leftover amount after equally dividing goes to League Winner. If Owners tie, money is split evenly. + +1. **Waiver Wire:** Originally set by reverse draft order. A successful claim drops you to the bottom. All non-rostered players are on waivers. Waiver claims are made by submission via the site’s Waivers Page. Select the player you want and hit submit. The league will be notified and there will be a 3-day waiting period where any other Owner may also claim the player. Claims process exactly 72 hours after the original claim, regardless of how many other owners put a claim in. + + At the 72-hour mark, the Owner with the highest waiver priority will be awarded the player and must roster the player. If no valid roster slots are available, the claim will process as invalid and go to the next Owner. If the Waiver deadline has already passed, a player in that sport may NOT be dropped, even if in the same sport as the player being claimed, unless claim/drop was entered prior to the deadline but processes after. + + Waiting Period is waived for College Basketball, College Hockey, Kentucky Derby and LLWS.  Due to the conference tournaments ending just before CBB and CHK brackets are announced, there will be no waiver period on claims in CBB and CHK.  Instead, we will have a 1 week “quiet period” prior to the deadline.  Claims will not be announced to the league and will process at the deadline based on waiver position. Extra draft picks at the end of KD & LLWS will be up for waiver claim until the individual draft begins. At that point, remaining draft picks may be claimed with no waiting period. Golf/Tennis: Owners do NOT receive credit for points earned in tournaments prior to waiver pickup.  Teams may be dropped without a pick-up, leaving an open roster slot to be filled later.  One roster slot must be dedicated to each sport and cannot be filled with a player from a different sport. Flex spots can be filled with players from any sport. + +1. **Waiver Deadline:** See each sport for waiver deadlines. After the deadline NO players may be claimed or dropped from roster, **except** for late drops and pending claims in the 3-day waiting period.  After the deadline, there will be an email sent with players that were dropped within 12 hours of deadline or dropped after a successful claim and Owners will have an opportunity to claim them.  This eliminates holding a player until the last minute to keep others from claiming.  This also allows an Owner that put in a claim, but was trumped by a higher waiver to claim another player. + +1. **Trades:** Trades are submitted to Commish and if eligible, presented to the league. Trades are ineligible if they break any 338 rules stated herein or include any non-338 assets. There will be a 3-day voting period needing a majority Yes votes to pass. A no-response during the voting period will be considered an approval.  Once a trade is submitted for Commish approval, the involved Owners are agreeing to the trade and may not make changes or vote against it unless all involved agree. Future Round Draft Picks may be traded, but only for the next draft to take place (if mid-draft, trades apply to that draft) and must be 1:1 (Owner-A trades 1st round pick to Owner-B for player and 5th round pick.) + + 1. Golf/Tennis: Points already earned by players that are traded stay with the former Owner. + 1. Trade Deadline: See each sport for trade deadlines. After the deadline NO players for that sport may be traded relating to the current season. Teams may be traded after the deadline for future seasons. + 1. Future Round Draft Picks: Deadline for trading draft picks and players for future seasons is the trade deadline of the final sport. + 1. Keepers: Players acquired via trade are eligible to be named a Keeper. Player’s draft round will be determined by draft position in previous draft. + 1. Cancellation/Suspension: If a sport is cancelled or suspended, trades will remain executed unless the entire 338 season is cancelled at which points all trades are nullified. + +1. **Draft:** Draft order determined by draw, with Owners place in one bucket and draft position placed in a different bucket. Conducted via website in Snake style. For leagues that have a smaller number of teams (e.g. KD, LLWS), every member must be able to draft a team from a league. Once the limit has been reached, only members without a team from that league will be allowed to draft from that sport.  Once a draft pick has been submitted and emailed to the league, it cannot be changed. + + 1. Time Limit: Each Owner will have a cumulative total of 25 hours to make all 20 picks. There is no time limit on each pick. If an Owner exceeds 25 hours in total, the draft queue must be utilized to make picks. If the queue is empty, the Owner is able to manually enter a pick, but the site will proceed with the draft and allow the next Owner to enter their pick. + + 1. In-Season Drafts: Some sports will include a secondary draft in-season. During the main League Draft, you will select a draft position rather than a specific player (i.e. With my first round pick in the League draft, I select the First Pick of the Kentucky Derby). The following sports will have a secondary in-season draft: + + 1. Kentucky Derby: Draft will take place on race day. Starting in 2022, the draft queue must be utilized. Owners will load their picks and the draft will take place via autodraft at 1:30 pm PDT. If an owner does not have their queue loaded at 1:30, they will be skipped. A skipped owner may pick at any time after that, but cannot take a horse already drafted. Draft limited to 18 horses so in the event of a late scratch Owner willbe able to replace horse. If a horse is scratched after being drafted, a replacement may be picked at the completion of the draft and it will NOT count as a waiver claim. If multiple horses are scratched, replacements are chosen in original draft order. + + 1. LLWS: The draft for the LLWS will begin in August, on the Wednesday before the tournament starts Thursday. Each pick will have a set deadline. If not in by the deadline, site will allow next owner to pick and the draft can proceed. A skipped owner may pick at any time after that, but cannot take a team already drafted. There are only 16 teams in the LLWS. + +1. **Relegation:** Based on League Points, the bottom 4 Owners in A and B will be relegated down a league. The top 4 Owners in B and C will move up a league. + + 1. TIEBREAKERS (in order of application): + 1. LEAGUE: # of championships, # of teams scoring league points, lowest drafted team to score a league point (excludes waiver claims and trades). + 1. If relegation/promotion puts 2 teams with the same owner or partial owner in the same league, owner(s) may drop ownership stake to a single team or else the lower ranked team(s) will be pushed down a league until all owners have a stake in only one team/league. In this case, the last team relegated (i.e. 11th place) will move back up. + 1. DRAFT PICK TRADES: If relegation results in Owners that traded draft picks in different leagues, the traded picks will take place at the end of the round.  EX: I trade my 1st round pick away and get a 10th round pick in return and I get relegated to B.  The Owner I traded with would get my 1st round pick at the end of the 1st round.  I would get the 10th round pick I traded for at the end of the 10th round.  If both teams involved in the trade stay in the same league, or both get relegated, they would swap actual picks.  If multiple Owners have supplemental picks, the order will be in reverse of the picks in that round. + 1. If an Owner gets relegated from A to B or B to C, but finishes in the money after actual MLB results are recorded, that Owner will automatically move up to the next league (after their relegation season) as the #1 team, regardless of actual position in B or C. + +1. **New Owners:** New Owners will be placed in the lowest league of the new season, unless joining as a partial owner to an existing team. Exceptions may be granted at the discretion of the Board of Directors. + +1. **Upper League Openings:** If an Owner finishes in the top 10 in A or B but does not play the following season or an Owner is forced to drop a team due to ownership of multiple teams, the 11th place Owner will remain in A and/or B and a new Owner will be added to C. Exceptions may be made at the discretion of the 338 Board of Directors. + +1. **Owner Departures:** If an Owner finishes in the top 10 or is promoted but does not play the following season or an Owner is forced to drop a team or move down a league due to ownership of multiple teams, the last Owner relegated (i.e. 11th place) will move back up. This rule will apply until any openings are in the lowest league at which point a new owner will be added. Exceptions may be made at the discretion of the 338 Board of Directors. + +1. **Cancellations:** In order for the season to be official and payouts made, 8 sports must be completed or have the league name official results by August 1st, 2022. If 8 or more sports are cancelled or delayed beyond August 1st, the 338 season will be cancelled and all entry fees refunded with no winnings paid out. Trades of future draft picks will also be cancelled. + + If a sport is cancelled or delayed beyond Aug 1st, 2022 no points will be awarded, unless the league officially names a champion. All trades will be valid, unless the entire 338 season is cancelled.In the event that a sport does not complete a season and the league names an official champion but not a clear 2nd – 8th, the 338 will use the following rankings to award league points: + +- MLB – 5 pts to best record in other league, 3 points to 2nd best record in eachleague and 1 pt to 3rd division leader and best record for a non-division leader. If the top 2 teams are in the same division, then 1 point to other 2 division leaders. +- CFB – AP Poll +- NFL – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. +- CBK – AP Poll +- NBA – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. +- CHK – PairwiseNHL – – 5 pts to best record in other conference, 3 points to 2nd best record ineach conference and 1 pt to 3rd & 4th best records in each conference. +- NCAA Baseball – D1Baseball.com RankingsChampions League – points split among tied teams + + EXCEPTIONS: Actual results will be used if a league has partially completed the postseason at the time of cancellation/suspension.In order for PGA, MT and WT results to count in league play, at least 3 eventsmust be completed by Aug 1st, 2022. diff --git a/lib/ex338_web/templates/page/2023_keeper_rules.html.md b/priv/rules/2023_keeper_rules.md similarity index 92% rename from lib/ex338_web/templates/page/2023_keeper_rules.html.md rename to priv/rules/2023_keeper_rules.md index 79198a60..7d2ca0f7 100644 --- a/lib/ex338_web/templates/page/2023_keeper_rules.html.md +++ b/priv/rules/2023_keeper_rules.md @@ -1,3 +1,10 @@ +%{ +year: 2023, +draft_method: "keeper", +} + +--- + # 338 Rules for 2022-23 Keeper Season ## 1. Season @@ -8,7 +15,6 @@ Permanent sports are: NCAA Football, NFL, NCAA Basketball, NBA, NCAA Hockey, NHL In 2022-23, the rotating sport will be the World Cup. Subsequent years are to be determined but may include: Women’s World Cup, Men’s 3000m Steeplechase in the Summer Olympics and Women’s College Basketball. - ## 2. Ownership Teams are allowed to have multiple owners and split the entry fee and winnings any way they choose. @@ -19,12 +25,10 @@ Owners are not allowed to own or have partial ownership in multiple 338 teams in If relegation/promotion puts 2 teams with the same owner or partial owner in the same league, owner(s) may drop ownership stake to a single team or else the lower ranked team(s) will be pushed down a league until all owners have a stake in only one team/league. - ## 3. Rosters Each Owner has 20 roster slots with one slot dedicated to each sport (15 slots) and 5 slots open to any sport. Roster slots may be left open at any time - ### Tennis/Golf You do not have to use the same player throughout the year. 2 players used in the same tournament will require 2 roster slots, but waivering/trading players for each tournament is allowed and the scores will be combined. If using multiple roster slots, Owner must declare which slot a newly acquired player will be in (separate from roster slots). Owners cannot use the same player in multiple slots, unless 2 or more rostered players have been used in the same slot. In that case, order is determined by the highest ranked player at the time of acquisition going into the roster slot with the most points. @@ -33,7 +37,6 @@ You do not have to use the same player throughout the year. 2 players used in th I have Tiger and Phil for The Masters, then trade them both for Rory and Scott prior to PGA. I must declare which players will be combined before the event. I choose Tiger/Scott & Phil/Rory. For the US Open, I trade Rory for Tiger and drop Scott for Stenson, making the combo Tiger/Scott/Tiger & Phil/Rory/Stenson. Then I claim Scott for British Open, keeping Tiger & Stenson. At time of claim, rankings are: #1-Scott, #3-Tiger, #7-Stenson. Combo becomes Tiger/Scott/Tiger/Scott, Phil/Rory/Stenson/Tiger, Stenson. - ### Injured Reserve Each Owner will have one IR slot per individual sport (MT, WT, PGA). If a player withdraws from an event prior to the start, Owner may move the player to IR and claim a new player. This will not cost a waiver claim, but the replacement player will be automatically dropped at the end of the tournament. @@ -42,33 +45,28 @@ IR claims may be submitted at any time but are processed in the order submitted If a player is suspended for rules violation or does not qualify for an event, IR does not apply and the player must be replaced by a waiver claim. - ## 4. Keepers -Up to 3 players may be designated as keepers at the start of the draft. In order to be eligible to designated as a keeper, a player must: +Up to 3 players may be designated as keepers at the start of the draft. In order to be eligible to designated as a keeper, a player must: 1. Have been drafted in rounds 2-20 in the previous draft 2. Can not have been claimed on waivers at any point during the season 3. Be in one of the 14 permanent sports -A keeper will be redrafted one round earlier than the player was selected in the previous draft. If an owner does not have a pick in that round, the player will move to the owner’s next available pick in a lower round. If an owner has multiple keepers in the same round but only 1 pick, they can select which player will be taken in an earlier round. If an owner has multiple picks in a round with a keeper, the keeper will be selected with the later pick . - +A keeper will be redrafted one round earlier than the player was selected in the previous draft. If an owner does not have a pick in that round, the player will move to the owner’s next available pick in a lower round. If an owner has multiple keepers in the same round but only 1 pick, they can select which player will be taken in an earlier round. If an owner has multiple picks in a round with a keeper, the keeper will be selected with the later pick . ## 4. Entry Fee -Entry fee of $250 due by Dec 1st, 2022. Late payment may result in single sport disqualification(s) at the discretion of the Board of Directors. Entry fees and payouts only accepted from one user, regardless of number of co-owners per team. - +Entry fee of $250 due by Dec 1st, 2022. Late payment may result in single sport disqualification(s) at the discretion of the Board of Directors. Entry fees and payouts only accepted from one user, regardless of number of co-owners per team. ## 5. Scoring Points are awarded to the top 8 of each sport. 8 points for winning the league, 5 points for runner-up, 3 points for reaching the semifinals, and 1 point for reaching the quarterfinals. See individual sport for details. If any team/player is later stripped of a standing, prior to relegation, due to violation of any kind, points will be adjusted. Any violation and resulting standings change post-relegation will have no impact on the 338. - ### College Football Top 4 teams will be determined by playoffs. The 4 highest ranked teams in the final AP Poll who are not in the playoffs will each get 1 point. - ### Tennis Tennis-only points are awarded for each of the 4 Grand Slam Events, immediately after the tournament. 1st=8, 2nd=5, SF=3, QF=1. Negative 2 points awarded to a Top 8 Seed losing in the 1st round and Negative 1 point for a Top 8 Seed losing in the 2nd round. Tennis points will be tallied individually, to an assigned tennis slot (e.g. Tennis-1, Tennis-2, etc). If a player is traded or dropped, the Owner retains any points they have earned. @@ -77,14 +75,13 @@ Tennis-only points are awarded for each of the 4 Grand Slam Events, immediately I have Djokovic who wins the Aussie Open, scoring me 8 pts. I trade him for Nadal prior to the French Open. Nadal wins, so I now have 16 pts. If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W). League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8. Owner must score at least 1 point to be eligible). - ### Golf Golf-only points are awarded for each of the 4 majors, immediately after the tournament: 1st=50, 2nd=40, 3rd-35th=37,36,35…6,5, 36th-40th =3, made cut =1, missed cut= -5. Golf points will be tallied individually, to an assigned golf slot (e.g. PGA-1, PGA-2, etc). If a player is traded or dropped, the Owner retains any points they have earned. #### Example Scenario -I have Tiger and Phil. Tiger wins the Masters (50pts) and Phil finishes 11th (29pts). I keep Tiger but drop Phil and Tiger wins the US Open. I now have 100pts for Tiger and still have 29pts for Phil. Prior to the British Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut. I now have 95 pts for Tiger and 79 pts combined for Phil/Rory. Following the four majors League points will be awarded to top 8 total scores. Each Owner may have multiple places in the top 8. Owner must score at least 1 pt to be eligible. +I have Tiger and Phil. Tiger wins the Masters (50pts) and Phil finishes 11th (29pts). I keep Tiger but drop Phil and Tiger wins the US Open. I now have 100pts for Tiger and still have 29pts for Phil. Prior to the British Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut. I now have 95 pts for Tiger and 79 pts combined for Phil/Rory. Following the four majors League points will be awarded to top 8 total scores. Each Owner may have multiple places in the top 8. Owner must score at least 1 pt to be eligible. ### Tennis/Golf League Points @@ -94,34 +91,28 @@ Players may be dropped and traded throughout the year, resulting in multiple pla If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points. If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player. - ### Tie Breaker:s Individual Sport Points awarded evenly to tied Owners. Golf points awarded in full to each tied owner. Money split for 1st or 2nd place tie. League: Owners will split the winnings evenly. Relegation: See Below. - ## 6. Payout - ### League A: -* 1st: $1000 -* 2nd: $750 -* 3rd: $550 -* 4th: $400 -* 5th: $275 - +- 1st: $1000 +- 2nd: $750 +- 3rd: $550 +- 4th: $400 +- 5th: $275 ### Single Sport Payouts 1st: $25 2nd: $10. If an un-owned team finishes 1st or 2nd, money goes into league pot and divided equally among top 5. Leftover amount after equally dividing goes to League Winner. If Owners tie, money is split evenly. - ### Payments Payments will only be sent to one user, regardless of the number of owners per team. - ## 7. Waiver Wire Originally set by reverse draft order. A successful claim drops you to the bottom. All non-rostered players are on waivers. Waiver claims are made by submission via the site’s Waivers Page. Select the player you want and hit submit. The league will be notified and there will be a 3-day waiting period where any other Owner may also claim the player. @@ -130,26 +121,22 @@ Claims process exactly 72 hours after the original claim, regardless of how many If no valid roster slots are available, the claim will process as invalid and go to the next Owner. If the Waiver deadline has already passed, a player in that sport may NOT be dropped, even if in the same sport as the player being claimed, unless claim/drop was entered prior to the deadline and processes after. Claims may be canceled at any time during the wait period. - ### Waiting Periods Waiting Period is waived for College Basketball, College Hockey, Kentucky Derby, and LLWS. Due to the conference tournaments ending just before CBB and CHK brackets are announced, there will be no waiver period on claims in CBB and CHK. Instead, we will have a 1-week “quiet period” prior to the deadline. Claims will not be announced to the league and will process at the deadline based on waiver position. Extra draft picks at the end of KD & LLWS will be up for waiver claim until the individual draft begins. At that point, remaining draft picks may be claimed with no waiting period. - ### Golf/Tennis Owners do NOT receive credit for points earned in tournaments prior to waiver pickup. Teams may be dropped without a pick-up, leaving an open roster slot to be filled later. One roster slot must be dedicated to each sport and cannot be filled with a player from a different sport. Flex spots can be filled with players from any sport. - ### Waiver Deadline See each sport for waiver deadlines. After the deadline NO players may be claimed or dropped from roster, except for late drops and pending claims in the 3-day waiting period. . After the deadline, there will be a an email sent with teams that were dropped within 12 hours of deadline or dropped after a successful claim and Owners will have an opportunity to claim them. This eliminates holding a team until the last minute to keep others from claiming. This also allows an Owner that put in a claim, but was trumped by a higher waiver to claim another team. - ## 8. Trades Trades of players and future round draft picks are allowed. Trades are submitted to another owner from the roster page. If the trade is accepted, the league will be notified. Trades are ineligible if they break any 338 rules stated herein or include any non-338 assets. @@ -160,64 +147,52 @@ Once a trade is submitted and the other owner accepts, the involved Owners are a Future Round Draft Picks may be traded, but only for the next draft to take place (if mid-draft, trades apply to that draft) and must be 1:1 (Owner-A trades 1st round pick to Owner-B for a player and 5th round pick.) - ### Golf/Tennis Points already earned by players that are traded stay with the former Owner. - ### Trade Deadline See Championships page for deadlines. After the deadline NO players for that sport may be traded. - ### Future Round Draft Picks Deadline for trading draft picks and players for future seasons is the trade deadline of the final sport - ### Keeper Rights Keeper rights to eligible players may be traded after the deadline but the player will continue to be rostered by the current owner until the end of the season. - ## 9. Draft Draft order determined by random draw, with Owners placed in one bucket and draft position placed in a different bucket. The draft is conducted via website in Snake style. For leagues that have a smaller number of teams (e.g. KD, LLWS), every member must be able to draft a team from a league. Once the limit has been reached, only members without a team from that league will be allowed to draft from that sport. Once a draft pick has been emailed to the league, it cannot be changed. - ### Time Limit Each Owner will have a cumulative total of 25 hours to make all 20 picks. There is no time limit for each pick. If an Owner exceeds 25 hours in total, the draft queue must be utilized to make picks. If the draft queue is empty, the Owner is able to manually enter a pick, but the site will proceed with the draft and allow the next Owner to enter their pick. -Hours from 11pm - 6am local time will not count against draft time. If an owner is on the clock overnight, those hours will be deducted the following day by the commish. Default local time for each team is PST unless the team provides another time zone to the commish. Each team can identify one local time zone. - +Hours from 11pm - 6am local time will not count against draft time. If an owner is on the clock overnight, those hours will be deducted the following day by the commish. Default local time for each team is PST unless the team provides another time zone to the commish. Each team can identify one local time zone. ## 10. In-Season Drafts Some sports will include a secondary draft in-season. During the main League Draft, you will select a draft position rather than a specific player (i.e. With my first round pick in the League draft, I select the First Pick of the Kentucky Derby). The following sports will have a secondary in-season draft: - ### Kentucky Derby Draft will take place on race day, time TBD. In 2023, there will be a 5 minute time limit per pick. After 5 minutes, if a pick is not in the draft queue and owner has not entered a pick they will be skipped. A skipped owner may pick at any time after that, but cannot take a horse already drafted. Draft limited to 18 horses so in the event of a late scratch Owner will be able to replace horse. If a horse is scratched after being drafted, a replacement may be picked at the completion of the draft and it will NOT count as a waiver claim. If multiple horses are scratched, replacements are chosen in original draft order. - ### LLWS The draft for the LLWS will be Sunday August 14th. In 2023, there will be a 5 minute time limit per pick. After 5 minutes, if a pick is not in the draft queue and owner has not entered a pick they will be skipped A skipped owner may pick at any time after that, but cannot take a team already drafted. There are only 20 teams in the LLWS. - ## 12. Upper League Openings New Owners will be placed in the lowest league of the new season, unless joining as a partial owner to an existing team. Exceptions may be granted at the discretion of the Board of Directors - ## 13. Owner Departures If an Owner finishes in the top 10 or is promoted but does not play the following season or an Owner is forced to drop a team or move down a league due to ownership of multiple teams, the last Owner relegated (i.e. 11th place) will move back up. This rule will apply until any openings are in the lowest league at which point a new owner will be added. Exceptions may be made at the discretion of the 338 Board of Directors. - ## 14. Official Season In order for the season to be official and payouts made, 8 sports must be completed or have the league name official results by August 1st, 2023. If 8 or more sports are canceled or delayed beyond August 1st, the 338 season will be canceled and all entry fees refunded with no winnings paid out. Trades of future draft picks will also be canceled. @@ -226,15 +201,15 @@ If a sport is canceled or delayed beyond Aug 1st 2023, no points will be awarded In the event that a sport does not complete the season and the league declares an official champion but not a clear 2nd – 8th, the 338 will use the following rankings to award league points: -* MLB – 5 pts to best record in other league, 3 points to 2nd best record in each league and 1 pt to 3rd division leader and best record for a non-division leader. If the top 2 teams are in the same division, then 1 point to other 2 division leaders. -* CFB – AP Poll -* NFL – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. -* CBK – AP Poll -* NBA – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. -* CHK – Pairwise -* NHL – – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. -* NCAA Baseball – [D1Baseball.com](http://d1baseball.com/) Rankings -* Champions League – points split among tied teams +- MLB – 5 pts to best record in other league, 3 points to 2nd best record in each league and 1 pt to 3rd division leader and best record for a non-division leader. If the top 2 teams are in the same division, then 1 point to other 2 division leaders. +- CFB – AP Poll +- NFL – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. +- CBK – AP Poll +- NBA – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. +- CHK – Pairwise +- NHL – – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. +- NCAA Baseball – [D1Baseball.com](http://d1baseball.com/) Rankings +- Champions League – points split among tied teams Exceptions: If a league has partially completed the postseason at the time of cancellation/suspension, actual results will be used. diff --git a/lib/ex338_web/templates/page/2023_rules.html.md b/priv/rules/2023_standard_rules.md similarity index 92% rename from lib/ex338_web/templates/page/2023_rules.html.md rename to priv/rules/2023_standard_rules.md index 571f76e5..1e94be28 100644 --- a/lib/ex338_web/templates/page/2023_rules.html.md +++ b/priv/rules/2023_standard_rules.md @@ -1,5 +1,11 @@ -# 338 Rules for 2022-23 Season +%{ +year: 2023, +draft_method: "redraft", +} + +--- +# 338 Rules for 2022-23 Season ## 1. Season @@ -9,7 +15,6 @@ Permanent sports are: NCAA Football, NFL, NCAA Basketball, NBA, NCAA Hockey, NHL In 2022-23, the rotating sport will be the World Cup. Subsequent years are to be determined but may include: Women’s World Cup, Men’s 3000m Steeplechase in the Summer Olympics and Women’s College Basketball. - ## 2. Ownership Teams are allowed to have multiple owners and split the entry fee and winnings any way they choose. @@ -20,12 +25,10 @@ Owners are not allowed to own or have partial ownership in multiple 338 teams in If relegation/promotion puts 2 teams with the same owner or partial owner in the same league, owner(s) may drop ownership stake to a single team or else the lower ranked team(s) will be pushed down a league until all owners have a stake in only one team/league. - ## 3. Rosters Each Owner has 20 roster slots with one slot dedicated to each sport (15 slots) and 5 slots open to any sport. Roster slots may be left open at any time - ### Tennis/Golf You do not have to use the same player throughout the year. 2 players used in the same tournament will require 2 roster slots, but waivering/trading players for each tournament is allowed and the scores will be combined. If using multiple roster slots, Owner must declare which slot a newly acquired player will be in (separate from roster slots). Owners cannot use the same player in multiple slots, unless 2 or more rostered players have been used in the same slot. In that case, order is determined by the highest ranked player at the time of acquisition going into the roster slot with the most points. @@ -34,7 +37,6 @@ You do not have to use the same player throughout the year. 2 players used in th I have Tiger and Phil for The Masters, then trade them both for Rory and Scott prior to PGA. I must declare which players will be combined before the event. I choose Tiger/Scott & Phil/Rory. For the US Open, I trade Rory for Tiger and drop Scott for Stenson, making the combo Tiger/Scott/Tiger & Phil/Rory/Stenson. Then I claim Scott for British Open, keeping Tiger & Stenson. At time of claim, rankings are: #1-Scott, #3-Tiger, #7-Stenson. Combo becomes Tiger/Scott/Tiger/Scott, Phil/Rory/Stenson/Tiger, Stenson. - ### Injured Reserve Each Owner will have one IR slot per individual sport (MT, WT, PGA). If a player withdraws from an event prior to the start, Owner may move the player to IR and claim a new player. This will not cost a waiver claim, but the replacement player will be automatically dropped at the end of the tournament. @@ -43,29 +45,25 @@ IR claims may be submitted at any time but are processed in the order submitted If a player is suspended for rules violation or does not qualify for an event, IR does not apply and the player must be replaced by a waiver claim. - ## 4. Entry Fee -League A: $225, B: $250, C: $275. Payment due by Dec 1st, 2022. Late payment may result in single sport disqualification(s) at the discretion of the Board of Directors. Entry fees and payouts only accepted from one user, regardless of the number of co-owners per team. - +League A: $225, B: $250, C: $275. Payment due by Dec 1st, 2022. Late payment may result in single sport disqualification(s) at the discretion of the Board of Directors. Entry fees and payouts only accepted from one user, regardless of the number of co-owners per team. ## 5. Scoring Points are awarded to the top 8 of each sport. 8 points for winning the league, 5 points for runner-up, 3 points for reaching the semifinals, and 1 point for reaching the quarterfinals. See individual sport for details. If any team/player is later stripped of a standing, prior to relegation, due to violation of any kind, points will be adjusted. Any violation and resulting standings change post-relegation will have no impact on the 338. - ### College Football Top 4 teams will be determined by playoffs. The 4 highest ranked teams in the final AP Poll who are not in the playoffs will each get 1 point. - ### Tennis Tennis-only points are awarded for each of the 4 Grand Slam Events, immediately after the tournament. 1st=8, 2nd=5, SF=3, QF=1. Negative 2 points awarded to a Top 8 Seed losing in the 1st round and Negative 1 point for a Top 8 Seed losing in the 2nd round. Tennis points will be tallied individually, to an assigned tennis slot (e.g. Tennis-1, Tennis-2, etc). If a player is traded or dropped, the Owner retains any points they have earned. #### Example Scenario -I have Djokovic who wins the Aussie Open, scoring me 8 pts. I trade him for Nadal prior to the French Open. Nadal wins, so I now have 16 pts. If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W). League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8. Owner must score at least 1 point to be eligible). +I have Djokovic who wins the Aussie Open, scoring me 8 pts. I trade him for Nadal prior to the French Open. Nadal wins, so I now have 16 pts. If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W). League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8. Owner must score at least 1 point to be eligible). ### Golf @@ -75,66 +73,52 @@ Golf-only points are awarded for each of the 4 majors, immediately after the tou I have Tiger and Phil. Tiger wins the Masters (50pts) and Phil finishes 11th (29pts). I keep Tiger but drop Phil and Tiger wins the US Open. I now have 100pts for Tiger and still have 29pts for Phil. Prior to the British Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut. I now have 95 pts for Tiger and 79 pts combined for Phil/Rory. Following the four majors League points will be awarded to top 8 total scores. Each Owner may have multiple places in the top 8. Owner must score at least 1 pt to be eligible. - ### Tennis/Golf League Points Players may be dropped and traded throughout the year, resulting in multiple players earning points. Rosters will lock after the final major's deadline and in order for league points to be earned, a roster slot must be occupied by that sport for the number of players earning points. #### Example Scenario -If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points. If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player. +If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points. If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player. ### Tie Breaker:s Individual Sport Points awarded evenly to tied Owners. Golf points awarded in full to each tied owner. Money split for 1st or 2nd place tie. League: Owners will split the winnings evenly. Relegation: See Below. - ## 6. Payout - ### League A: - - -* 1st: $1050 -* 2nd: $800 -* 3rd: $600 -* 4th: $425 -* 5th: $300 - +- 1st: $1050 +- 2nd: $800 +- 3rd: $600 +- 4th: $425 +- 5th: $300 ### League B: - - -* 1st: $900 -* 2nd: $675 -* 3rd: $500 -* 4th: $375 -* 5th: $275 - +- 1st: $900 +- 2nd: $675 +- 3rd: $500 +- 4th: $375 +- 5th: $275 ### League C: - - -* 1st: $825 -* 2nd: $600 -* 3rd: $450 -* 4th: $350 -* 5th: $275 - +- 1st: $825 +- 2nd: $600 +- 3rd: $450 +- 4th: $350 +- 5th: $275 ### Single Sport Payouts 1st: $25 2nd: $10. If an un-owned team finishes 1st or 2nd, money goes into league pot and divided equally among top 5. Leftover amount after equally dividing goes to League Winner. If Owners tie, money is split evenly. - ### Payments Payments will only be sent to one user, regardless of the number of owners per team. - ## 7. Waiver Wire Originally set by reverse draft order. A successful claim drops you to the bottom. All non-rostered players are on waivers. Waiver claims are made by submission via the site’s Waivers Page. Select the player you want and hit submit. The league will be notified and there will be a 3-day waiting period where any other Owner may also claim the player. @@ -145,26 +129,22 @@ If no valid roster slots are available, the claim will process as invalid and go Claims may be canceled at any time during the wait period. - ### Waiting Periods Waiting Period is waived for College Basketball, College Hockey, Kentucky Derby, and LLWS. Due to the conference tournaments ending just before CBB and CHK brackets are announced, there will be no waiver period on claims in CBB and CHK. Instead, we will have a 1-week “quiet period” prior to the deadline. Claims will not be announced to the league and will process at the deadline based on waiver position. Extra draft picks at the end of KD & LLWS will be up for waiver claim until the individual draft begins. At that point, remaining draft picks may be claimed with no waiting period. - ### Golf/Tennis Owners do NOT receive credit for points earned in tournaments prior to waiver pickup. Teams may be dropped without a pick-up, leaving an open roster slot to be filled later. One roster slot must be dedicated to each sport and cannot be filled with a player from a different sport. Flex spots can be filled with players from any sport. - ### Waiver Deadline See each sport for waiver deadlines. After the deadline NO players may be claimed or dropped from roster, except for late drops and pending claims in the 3-day waiting period. After the deadline, there will be a an email sent with teams that were dropped within 12 hours of deadline or dropped after a successful claim and Owners will have an opportunity to claim them. This eliminates holding a team until the last minute to keep others from claiming. This also allows an Owner that put in a claim, but was trumped by a higher waiver to claim another team. - ## 8. Trades Trades of players and future round draft picks are allowed. Trades are submitted to another owner from the roster page. If the trade is accepted, the league will be notified. Trades are ineligible if they break any 338 rules stated herein or include any non-338 assets. @@ -175,59 +155,48 @@ Once a trade is submitted and the other owner accepts, the involved Owners are a Future Round Draft Picks may be traded, but only for the next draft to take place (if mid-draft, trades apply to that draft) and must be 1:1 (Owner-A trades 1st round pick to Owner-B for a player and 5th round pick.) - ### Golf/Tennis Points already earned by players that are traded stay with the former Owner. - ### Trade Deadline See Championships page for deadlines. After the deadline NO players for that sport may be traded. - ### Future Round Draft Picks Deadline for trading draft picks and players for future seasons is the trade deadline of the final sport - ## 9. Draft Draft order determined by random draw, with Owners placed in one bucket and draft position placed in a different bucket. The draft is conducted via website in Snake style. For leagues that have a smaller number of teams (e.g. KD, LLWS), every member must be able to draft a team from a league. Once the limit has been reached, only members without a team from that league will be allowed to draft from that sport. Once a draft pick has been emailed to the league, it cannot be changed. - ### Time Limit Each Owner will have a cumulative total of 25 hours to make all 20 picks. There is no time limit for each pick. If an Owner exceeds 25 hours in total, the draft queue must be utilized to make picks. If the draft queue is empty, the Owner is able to manually enter a pick, but the site will proceed with the draft and allow the next Owner to enter their pick. -Hours from 11pm - 6am local time will not count against draft time. If an owner is on the clock overnight, those hours will be deducted the following day by the commish. Default local time for each team is PST unless the team provides another time zone to the commish. Each team can identify one local time zone. - +Hours from 11pm - 6am local time will not count against draft time. If an owner is on the clock overnight, those hours will be deducted the following day by the commish. Default local time for each team is PST unless the team provides another time zone to the commish. Each team can identify one local time zone. ## 10. In-Season Drafts Some sports will include a secondary draft in-season. During the main League Draft, you will select a draft position rather than a specific player (i.e. With my first round pick in the League draft, I select the First Pick of the Kentucky Derby). The following sports will have a secondary in-season draft: - ### Kentucky Derby Draft will take place on race day, time TBD. In 2023, there will be a 5 minute time limit per pick. After 5 minutes, if a pick is not in the draft queue and owner has not entered a pick they will be skipped. A skipped owner may pick at any time after that, but cannot take a horse already drafted. Draft limited to 18 horses so in the event of a late scratch Owner will be able to replace horse. If a horse is scratched after being drafted, a replacement may be picked at the completion of the draft and it will NOT count as a waiver claim. If multiple horses are scratched, replacements are chosen in original draft order. - ### LLWS The draft for the LLWS will be Sunday August 14th. In 2023, there will be a 5 minute time limit per pick. After 5 minutes, if a pick is not in the draft queue and owner has not entered a pick they will be skipped. A skipped owner may pick at any time after that, but cannot take a team already drafted. There are only 20 teams in the LLWS. - ## 12. Upper League Openings New Owners will be placed in the lowest league of the new season, unless joining as a partial owner to an existing team. Exceptions may be granted at the discretion of the Board of Directors - ## 13. Owner Departures If an Owner finishes in the top 10 or is promoted but does not play the following season or an Owner is forced to drop a team or move down a league due to ownership of multiple teams, the last Owner relegated (i.e. 11th place) will move back up. This rule will apply until any openings are in the lowest league at which point a new owner will be added. Exceptions may be made at the discretion of the 338 Board of Directors. - ## 14. Official Season In order for the season to be official and payouts made, 8 sports must be completed or have the league name official results by August 1st, 2023. If 8 or more sports are canceled or delayed beyond August 1st, the 338 season will be canceled and all entry fees refunded with no winnings paid out. Trades of future draft picks will also be canceled. @@ -236,17 +205,15 @@ If a sport is canceled or delayed beyond Aug 1st 2023, no points will be awarded In the event that a sport does not complete the season and the league declares an official champion but not a clear 2nd – 8th, the 338 will use the following rankings to award league points: - - -* MLB – 5 pts to best record in other league, 3 points to 2nd best record in each league and 1 pt to 3rd division leader and best record for a non-division leader. If the top 2 teams are in the same division, then 1 point to other 2 division leaders. -* CFB – AP Poll -* NFL – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. -* CBK – AP Poll -* NBA – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. -* CHK – Pairwise -* NHL – – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. -* NCAA Baseball – [D1Baseball.com](http://d1baseball.com/) Rankings -* Champions League – points split among tied teams +- MLB – 5 pts to best record in other league, 3 points to 2nd best record in each league and 1 pt to 3rd division leader and best record for a non-division leader. If the top 2 teams are in the same division, then 1 point to other 2 division leaders. +- CFB – AP Poll +- NFL – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. +- CBK – AP Poll +- NBA – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. +- CHK – Pairwise +- NHL – – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. +- NCAA Baseball – [D1Baseball.com](http://d1baseball.com/) Rankings +- Champions League – points split among tied teams Exceptions: If a league has partially completed the postseason at the time of cancellation/suspension, actual results will be used. diff --git a/lib/ex338_web/templates/page/2024_keeper_rules.html.md b/priv/rules/2024_keeper_rules.md similarity index 92% rename from lib/ex338_web/templates/page/2024_keeper_rules.html.md rename to priv/rules/2024_keeper_rules.md index da582b3b..315e2456 100644 --- a/lib/ex338_web/templates/page/2024_keeper_rules.html.md +++ b/priv/rules/2024_keeper_rules.md @@ -1,3 +1,10 @@ +%{ +year: 2024, +draft_method: "keeper", +} + +--- + # 338 Rules for 2023-24 Keeper Season ## 1. Season @@ -8,7 +15,6 @@ Permanent sports are: NCAA Football, NFL, NCAA Basketball, NBA, NCAA Hockey, NHL In 2023-24, the rotating sport will be the Euro Championship. Subsequent years are to be determined but may include: World Cup, Men’s 3000m Steeplechase in the Summer Olympics and Women’s College Basketball. - ## 2. Ownership Teams are allowed to have multiple owners and split the entry fee and winnings any way they choose. @@ -19,12 +25,10 @@ Owners are not allowed to own or have partial ownership in multiple 338 teams in If relegation/promotion puts 2 teams with the same owner or partial owner in the same league, owner(s) may drop ownership stake to a single team or else the lower ranked team(s) will be pushed down a league until all owners have a stake in only one team/league. - ## 3. Rosters Each Owner has 20 roster slots with one slot dedicated to each sport (15 slots) and 5 slots open to any sport. Roster slots may be left open at any time - ### Tennis/Golf You do not have to use the same player throughout the year. 2 players used in the same tournament will require 2 roster slots, but waivering/trading players for each tournament is allowed and the scores will be combined. If using multiple roster slots, Owner must declare which slot a newly acquired player will be in (separate from roster slots). Owners cannot use the same player in multiple slots, unless 2 or more rostered players have been used in the same slot. In that case, order is determined by the highest ranked player at the time of acquisition going into the roster slot with the most points. @@ -33,7 +37,6 @@ You do not have to use the same player throughout the year. 2 players used in th I have Tiger and Phil for The Masters, then trade them both for Rory and Scott prior to PGA. I must declare which players will be combined before the event. I choose Tiger/Scott & Phil/Rory. For the US Open, I trade Rory for Tiger and drop Scott for Stenson, making the combo Tiger/Scott/Tiger & Phil/Rory/Stenson. Then I claim Scott for British Open, keeping Tiger & Stenson. At time of claim, rankings are: #1-Scott, #3-Tiger, #7-Stenson. Combo becomes Tiger/Scott/Tiger/Scott, Phil/Rory/Stenson/Tiger, Stenson. - ### Injured Reserve Each Owner will have one IR slot per individual sport (MT, WT, PGA). If a player withdraws from an event prior to the start, Owner may move the player to IR and claim a new player. This will not cost a waiver claim, but the replacement player will be automatically dropped at the end of the tournament. @@ -42,33 +45,28 @@ IR claims may be submitted at any time before the start of each tournament but a If a player is suspended for rules violation or does not qualify for an event, the player is not eligible for IR and must be replaced by a waiver claim. - ## 4. Keepers -Up to 3 players may be designated as keepers at the start of the draft. In order to be eligible to designated as a keeper, a player must: +Up to 3 players may be designated as keepers at the start of the draft. In order to be eligible to designated as a keeper, a player must: 1. Have been drafted in rounds 2-20 in the previous draft 2. Can not have been claimed on waivers at any point during the season 3. Be in one of the 14 permanent sports -A keeper will be redrafted one round earlier than the player was selected in the previous draft. If an owner does not have a pick in that round, the player will move to the owner’s next available pick in a lower round. If an owner has multiple keepers in the same round but only 1 pick, they can select which player will be taken in an earlier round. If an owner has multiple picks in a round with a keeper, the keeper will be selected with the later pick . - +A keeper will be redrafted one round earlier than the player was selected in the previous draft. If an owner does not have a pick in that round, the player will move to the owner’s next available pick in a lower round. If an owner has multiple keepers in the same round but only 1 pick, they can select which player will be taken in an earlier round. If an owner has multiple picks in a round with a keeper, the keeper will be selected with the later pick . ## 4. Entry Fee -Entry fee of $250 due by Dec 1st, 2023. Late payment may result in single sport disqualification(s) at the discretion of the Board of Directors. Entry fees and payouts only accepted from one user, regardless of number of co-owners per team. - +Entry fee of $250 due by Dec 1st, 2023. Late payment may result in single sport disqualification(s) at the discretion of the Board of Directors. Entry fees and payouts only accepted from one user, regardless of number of co-owners per team. ## 5. Scoring Points are awarded to the top 8 of each sport. 8 points for winning the league, 5 points for runner-up, 3 points for reaching the semifinals, and 1 point for reaching the quarterfinals. See individual sport for details. If any team/player is later stripped of a standing, prior to relegation, due to violation of any kind, points will be adjusted. Any violation and resulting standings change post-relegation will have no impact on the 338. - ### College Football Top 4 teams will be determined by playoffs. The 4 highest ranked teams in the final AP Poll who are not in the playoffs will each get 1 point. - ### Tennis Tennis-only points are awarded for each of the 4 Grand Slam Events, immediately after the tournament. 1st=8, 2nd=5, SF=3, QF=1. Negative 2 points awarded to a Top 8 Seed losing in the 1st round and Negative 1 point for a Top 8 Seed losing in the 2nd round. If match is a walkover or player retires before the completion of the first set, negative points will not apply. Tennis points will be tallied individually, to an assigned tennis slot (e.g. Tennis-1, Tennis-2, etc). If a player is traded or dropped, the Owner retains any points they have earned. @@ -77,14 +75,13 @@ Tennis-only points are awarded for each of the 4 Grand Slam Events, immediately I have Djokovic who wins the Aussie Open, scoring me 8 pts. I trade him for Nadal prior to the French Open. Nadal wins, so I now have 16 pts. If I had kept Djokovic and traded for Nadal prior to the French Open, then Nadal beats Djokovic, I would have 13 pts for my first Tennis slot (Djokovic Aussie W + FO 2nd place) and 8 pts for my second slot (Nadal FO W). League pts awarded to top 8 total scores (OWNER may have multiple places in the top 8. Owner must score at least 1 point to be eligible). - ### Golf Golf-only points are awarded for each of the 4 majors, immediately after the tournament: 1st=50, 2nd=40, 3rd-35th=37,36,35…6,5, 36th-40th =3, made cut =1, missed cut= -5. If a player is disqualified or withdraws in the 1st or 2nd round, it will be considered a missed cut. Golf points will be tallied individually, to an assigned golf slot (e.g. PGA-1, PGA-2, etc). If a player is traded or dropped, the Owner retains any points they have earned. #### Example Scenario -I have Tiger and Phil. Tiger wins the Masters (50pts) and Phil finishes 11th (29pts). I keep Tiger but drop Phil and Tiger wins the US Open. I now have 100pts for Tiger and still have 29pts for Phil. Prior to the British Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut. I now have 95 pts for Tiger and 79 pts combined for Phil/Rory. Following the four majors League points will be awarded to top 8 total scores. Each Owner may have multiple places in the top 8. Owner must score at least 1 pt to be eligible. +I have Tiger and Phil. Tiger wins the Masters (50pts) and Phil finishes 11th (29pts). I keep Tiger but drop Phil and Tiger wins the US Open. I now have 100pts for Tiger and still have 29pts for Phil. Prior to the British Open, I pick up Rory and still have Tiger. Rory wins and Tiger misses the cut. I now have 95 pts for Tiger and 79 pts combined for Phil/Rory. Following the four majors League points will be awarded to top 8 total scores. Each Owner may have multiple places in the top 8. Owner must score at least 1 pt to be eligible. ### Tennis/Golf League Points @@ -94,34 +91,28 @@ Players may be dropped and traded throughout the year, resulting in multiple pla If I have Djokovic and Nadal and they finish first and second in tennis, I must have 2 roster slots occupied by men's tennis players in order to earn league points. If I traded or dropped one of them and filled the roster slot with a different sport, I would only earn league points for one player. - ### Tie Breaker:s Individual Sport Tennis and golf points will be split evenly among tied Owners at the end of the final major. Single event golf points awarded in full to each tied owner. Money split for 1st or 2nd place tie. League: Owners will split the winnings evenly. Relegation: See Below. - ## 6. Payout - ### League A: -* 1st: $1000 -* 2nd: $750 -* 3rd: $550 -* 4th: $400 -* 5th: $275 - +- 1st: $1000 +- 2nd: $750 +- 3rd: $550 +- 4th: $400 +- 5th: $275 ### Single Sport Payouts 1st: $25 2nd: $10. If an un-owned team finishes 1st or 2nd, money goes into league pot and divided equally among top 5. If Owners tie, money is split evenly. - ### Payments Payments will only be sent to one user, regardless of the number of owners per team. - ## 7. Waiver Wire Originally set by reverse draft order. A successful claim drops you to the bottom. All non-rostered players are on waivers. Waiver claims are made by submission via the site’s Waivers Page. Select the player you want and hit submit. The league will be notified and there will be a 3-day waiting period where any other Owner may also claim the player. @@ -130,7 +121,6 @@ Claims process exactly 72 hours after the original claim (except at deadlines, s If no valid roster slots are available, the claim will process as invalid and go to the next Owner. If the Waiver deadline has already passed, a player in that sport may NOT be dropped, even if in the same sport as the player being claimed, unless claim/drop was entered prior to the deadline and processes after. Claims may be canceled at any time during the wait period. - ### Waiting Periods Waiting Period is waived for College Basketball, College Hockey, Kentucky Derby, and LLWS. Due to the conference tournaments ending just before CBB and CHK brackets are announced, there will be no waiver period on claims in CBB and CHK. Instead, we will have a 1-week “quiet period” prior to the deadline. Claims will not be announced to the league and will process at the deadline based on waiver position. @@ -139,19 +129,16 @@ Extra draft picks at the end of KD & LLWS will be up for waiver claim until the New in 2023-24, all waiver claims submitted within 48 hours of the deadline will process at 11:59 pm Pacific the day after the deadline. - ### Golf/Tennis Owners do NOT receive credit for points earned in tournaments prior to waiver pickup. Teams may be dropped without a pick-up, leaving an open roster slot to be filled later. One roster slot must be dedicated to each sport and cannot be filled with a player from a different sport. Flex spots can be filled with players from any sport. - ### Waiver Deadline See each sport for waiver deadlines. After the deadline NO players may be claimed or dropped from roster, except for late drops and pending claims in the period. After the deadline, there will be an email sent with teams that were dropped within 12 hours of deadline or dropped after a successful claim and Owners will have an opportunity to claim them. This eliminates holding a team until the last minute to keep others from claiming. This also allows an Owner that put in a claim, but was trumped by a higher waiver to claim another team. - ## 8. Trades Trades of players and future round draft picks are allowed. Trades are submitted to another owner from the roster page. If the trade is accepted, the league will be notified. Trades are ineligible if they break any 338 rules stated herein or include any non-338 assets. @@ -162,49 +149,40 @@ Once a trade is submitted and the other owner accepts, the involved Owners are a Future Round Draft Picks may be traded, but only for the next draft to take place (if mid-draft, trades apply to that draft) and must be 1:1 (Owner-A trades 1st round pick to Owner-B for a player and 5th round pick.) - ### Golf/Tennis Points already earned by players that are traded stay with the former Owner. - ### Trade Deadline See Championships page for deadlines. After the deadline NO players for that sport may be traded. - ### Future Round Draft Picks Deadline for trading draft picks and players for future seasons is the trade deadline of the final sport - ### Keeper Rights Keeper rights to eligible players may be traded after the deadline but the player will continue to be rostered by the current owner until the end of the season. - ## 9. Draft Draft order determined by random draw, with Owners placed in one bucket and draft position placed in a different bucket. The draft is conducted via website in Snake style. For leagues that have a smaller number of teams (e.g. KD, LLWS), every member must be able to draft a team from a league. Once the limit has been reached, only members without a team from that league will be allowed to draft from that sport. Once a draft pick has been emailed to the league, it cannot be changed. - ### Time Limit Each Owner will have a cumulative total of 25 hours to make all 20 picks. There is no time limit for each pick. If an Owner exceeds 25 hours in total, the draft queue must be utilized to make picks. If the draft queue is empty, the Owner is able to manually enter a pick, but the site will proceed with the draft and allow the next Owner to enter their pick. -Hours from 11pm - 6am local time will not count against draft time. If an owner is on the clock overnight, those hours will be deducted the following day by the commish. Default local time for each team is PST unless the team provides another time zone to the commish. Each team can identify one local time zone. - +Hours from 11pm - 6am local time will not count against draft time. If an owner is on the clock overnight, those hours will be deducted the following day by the commish. Default local time for each team is PST unless the team provides another time zone to the commish. Each team can identify one local time zone. ## 10. In-Season Drafts Some sports will include a secondary draft in-season. During the main League Draft, you will select a draft position rather than a specific player (i.e. With my first round pick in the League draft, I select the First Pick of the Kentucky Derby). The following sports will have a secondary in-season draft: - ### Kentucky Derby Draft will take place on race day, time TBD. There will be a 5 minute time limit per pick. After 5 minutes, if a pick is not in the draft queue and owner has not entered a pick they will be skipped. A skipped owner may pick at any time after that, but cannot take a horse already drafted. Draft limited to 18 horses so in the event of a late scratch Owner will be able to replace horse. If a horse is scratched after being drafted, a replacement may be picked at the completion of the draft and it will NOT count as a waiver claim. If multiple horses are scratched, replacements are chosen in original draft order. - ### LLWS The draft for the LLWS will be Tuesday August 15th. There will be a 5 minute time limit per pick. After 5 minutes, if a pick is not in the draft queue and owner has not entered a pick they will be skipped A skipped owner may pick at any time after that, but cannot take a team already drafted. There are only 20 teams in the LLWS. @@ -227,17 +205,14 @@ If relegation results in Owners that traded draft picks in different leagues, th Example: I trade my 1st round pick away and get a 10th round pick in return and I get relegated to B. The Owner I traded with would get my 1st round pick at the end of the 1st round. I would get the 10th round pick I traded for at the end of the 10th round. If both teams involved in the trade stay in the same league, or both get relegated, they would swap actual picks. If multiple Owners have supplemental picks, the order will be in reverse of the picks in that round. - ## 12. Upper League Openings New Owners will be placed in the lowest league of the new season, unless joining as a partial owner to an existing team. Exceptions may be granted at the discretion of the Board of Directors - ## 13. Owner Departures If an Owner finishes in the top 10 or is promoted but does not play the following season or an Owner is forced to drop a team or move down a league due to ownership of multiple teams, the last Owner relegated (i.e. 11th place) will move back up. This rule will apply until any openings are in the lowest league at which point a new owner will be added. Exceptions may be made at the discretion of the 338 Board of Directors. - ## 14. Official Season In order for the season to be official and payouts made, 8 sports must be completed or have the league name official results by July 15th, 2024. If 8 or more sports are canceled or delayed beyond July 15th, the 338 season will be canceled and all entry fees refunded with no winnings paid out. Trades of future draft picks will also be canceled. @@ -246,15 +221,15 @@ If a sport is canceled or delayed beyond Aug 1st 2023, no points will be awarded In the event that a sport does not complete the season and the league declares an official champion but not a clear 2nd – 8th, the 338 will use the following rankings to award league points: -* MLB – 5 pts to best record in other league, 3 points to 2nd best record in each league and 1 pt to 3rd division leader and best record for a non-division leader. If the top 2 teams are in the same division, then 1 point to other 2 division leaders. -* CFB – AP Poll -* NFL – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. -* CBK – AP Poll -* NBA – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. -* CHK – Pairwise -* NHL – – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. -* NCAA Baseball – [D1Baseball.com](http://d1baseball.com/) Rankings -* Champions League – points split among tied teams +- MLB – 5 pts to best record in other league, 3 points to 2nd best record in each league and 1 pt to 3rd division leader and best record for a non-division leader. If the top 2 teams are in the same division, then 1 point to other 2 division leaders. +- CFB – AP Poll +- NFL – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. +- CBK – AP Poll +- NBA – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. +- CHK – Pairwise +- NHL – – 5 pts to best record in other conference, 3 points to 2nd best record in each conference and 1 pt to 3rd & 4th best records in each conference. +- NCAA Baseball – [D1Baseball.com](http://d1baseball.com/) Rankings +- Champions League – points split among tied teams Exceptions: If a league has partially completed the postseason at the time of cancellation/suspension, actual results will be used. diff --git a/lib/ex338_web/templates/page/2024_rules.html.md b/priv/rules/2024_standard_rules.md similarity index 99% rename from lib/ex338_web/templates/page/2024_rules.html.md rename to priv/rules/2024_standard_rules.md index c2fa6da8..b87ecb17 100644 --- a/lib/ex338_web/templates/page/2024_rules.html.md +++ b/priv/rules/2024_standard_rules.md @@ -1,3 +1,10 @@ +%{ +year: 2024, +draft_method: "redraft", +} + +--- + # 338 Rules for 2023-24 Season ## 1. Season diff --git a/test/ex338/rulebooks_test.exs b/test/ex338/rulebooks_test.exs new file mode 100644 index 00000000..eb54867f --- /dev/null +++ b/test/ex338/rulebooks_test.exs @@ -0,0 +1,23 @@ +defmodule Ex338.RulebooksTest do + use Ex338.DataCase, async: true + + alias Ex338.Rulebooks + + describe "get_rulebook_for_fantasy_league!/2" do + test "gets rulebook by year and draft method" do + fantasy_league = insert(:fantasy_league, year: 2021, draft_method: "keeper") + result = Rulebooks.get_rulebook_for_fantasy_league!(fantasy_league) + + assert result.year == 2021 + assert result.draft_method == "keeper" + end + + test "crashes if it doesn't exist" do + fantasy_league = insert(:fantasy_league, year: 0000, draft_method: "keeper") + + assert_raise Ex338.Rulebooks.NotFoundError, fn -> + Rulebooks.get_rulebook_for_fantasy_league!(fantasy_league) + end + end + end +end From 7ae8f7cfb9e05fc3f18bc4dc18d705508a6880bb Mon Sep 17 00:00:00 2001 From: Axel Clark Date: Sun, 4 Feb 2024 20:57:53 -0800 Subject: [PATCH 14/18] Bump phoenix_live_reload --- mix.exs | 2 +- mix.lock | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/mix.exs b/mix.exs index a0c17e3d..245f751e 100644 --- a/mix.exs +++ b/mix.exs @@ -59,7 +59,7 @@ defmodule Ex338.Mixfile do {:phoenix_live_dashboard, "~> 0.8.0"}, {:phoenix_ecto, "~> 4.4.0"}, {:phoenix_html, "~> 3.2"}, - {:phoenix_live_reload, "~> 1.3.0", only: :dev}, + {:phoenix_live_reload, "~> 1.4", only: :dev}, {:phoenix_pubsub, "~> 2.0"}, {:phoenix_pubsub_redis, "~> 3.0.0"}, {:phoenix_live_view, "~> 0.19.0"}, diff --git a/mix.lock b/mix.lock index 65cc35d2..eb36e1d1 100644 --- a/mix.lock +++ b/mix.lock @@ -27,7 +27,6 @@ "gettext": {:hex, :gettext, "0.23.1", "821e619a240e6000db2fc16a574ef68b3bd7fe0167ccc264a81563cc93e67a31", [:mix], [{:expo, "~> 0.4.0", [hex: :expo, repo: "hexpm", optional: false]}], "hexpm", "19d744a36b809d810d610b57c27b934425859d158ebd56561bc41f7eeb8795db"}, "hackney": {:hex, :hackney, "1.20.1", "8d97aec62ddddd757d128bfd1df6c5861093419f8f7a4223823537bad5d064e2", [:rebar3], [{:certifi, "~> 2.12.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.4.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "fe9094e5f1a2a2c0a7d10918fee36bfec0ec2a979994cff8cfe8058cd9af38e3"}, "honeybadger": {:hex, :honeybadger, "0.20.0", "fb687c9a472e8e19727367a23d718a713a6bbb2b894aa598f402309bb0fcb10a", [:mix], [{:ecto, ">= 2.0.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:hackney, "~> 1.1", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:phoenix, ">= 1.0.0 and < 2.0.0", [hex: :phoenix, repo: "hexpm", optional: true]}, {:plug, ">= 1.0.0 and < 2.0.0", [hex: :plug, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f8ae08cff6b6c6b64a9f8fc9cb1a1efe8f3d2fe4508bdffce9ff042a6221ec81"}, - "html_entities": {:hex, :html_entities, "0.5.2", "9e47e70598da7de2a9ff6af8758399251db6dbb7eebe2b013f2bbd2515895c3c", [:mix], [], "hexpm", "c53ba390403485615623b9531e97696f076ed415e8d8058b1dbaa28181f4fdcc"}, "httpoison": {:hex, :httpoison, "1.5.1", "0f55b5b673b03c5c327dac7015a67cb571b99b631acc0bc1b0b98dcd6b9f2104", [:mix], [{:hackney, "~> 1.8", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "191a3b6329c917de4e7ca68431919a59bf19e60694b313a69bc1f56a4cb160bf"}, "idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"}, "jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"}, @@ -42,15 +41,13 @@ "nimble_publisher": {:hex, :nimble_publisher, "1.1.0", "49dee0f30536140268996660a5927d0282946949c35c88ccc6da11a19231b4b6", [:mix], [{:earmark, "~> 1.4", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "80fb42d8d1e34f41ff29fc2a1ae6ab86ea7b764b3c2d38e5268a43cf33825782"}, "number": {:hex, :number, "1.0.4", "3e6e6032a3c1d4c3760e77a42c580a57a15545dd993af380809da30fe51a032c", [:mix], [{:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}], "hexpm", "16f7516584ef2be812af4f33f2eaf3f9b9f6ed8892f45853eb93113f83721e42"}, "oban": {:hex, :oban, "2.16.2", "ec8dfd2f6dfdcd885061b58aeaa2794a0a6f62bad20c15939e4bb80bfd74ed76", [:mix], [{:ecto_sql, "~> 3.6", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:ecto_sqlite3, "~> 0.9", [hex: :ecto_sqlite3, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3d343c80948676abf9652da1e793ab6140ba64e9de7c8d6630eb5bb4aa8fea79"}, - "parallel_stream": {:hex, :parallel_stream, "1.0.6", "b967be2b23f0f6787fab7ed681b4c45a215a81481fb62b01a5b750fa8f30f76c", [:mix], [], "hexpm", "639b2e8749e11b87b9eb42f2ad325d161c170b39b288ac8d04c4f31f8f0823eb"}, "parse_trans": {:hex, :parse_trans, "3.4.1", "6e6aa8167cb44cc8f39441d05193be6e6f4e7c2946cb2759f015f8c56b76e5ff", [:rebar3], [], "hexpm", "620a406ce75dada827b82e453c19cf06776be266f5a67cff34e1ef2cbb60e49a"}, - "phoenix": {:hex, :phoenix, "1.7.10", "02189140a61b2ce85bb633a9b6fd02dff705a5f1596869547aeb2b2b95edd729", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "cf784932e010fd736d656d7fead6a584a4498efefe5b8227e9f383bf15bb79d0"}, + "phoenix": {:hex, :phoenix, "1.7.11", "1d88fc6b05ab0c735b250932c4e6e33bfa1c186f76dcf623d8dd52f07d6379c7", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.7", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "b1ec57f2e40316b306708fe59b92a16b9f6f4bf50ccfa41aa8c7feb79e0ec02a"}, "phoenix_ecto": {:hex, :phoenix_ecto, "4.4.2", "b21bd01fdeffcfe2fab49e4942aa938b6d3e89e93a480d4aee58085560a0bc0d", [:mix], [{:ecto, "~> 3.5", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "70242edd4601d50b69273b057ecf7b684644c19ee750989fd555625ae4ce8f5d"}, "phoenix_html": {:hex, :phoenix_html, "3.3.3", "380b8fb45912b5638d2f1d925a3771b4516b9a78587249cabe394e0a5d579dc9", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "923ebe6fec6e2e3b3e569dfbdc6560de932cd54b000ada0208b5f45024bdd76c"}, "phoenix_live_dashboard": {:hex, :phoenix_live_dashboard, "0.8.0", "0b3158b5b198aa444473c91d23d79f52fb077e807ffad80dacf88ce078fa8df2", [:mix], [{:ecto, "~> 3.6.2 or ~> 3.7", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_mysql_extras, "~> 0.5", [hex: :ecto_mysql_extras, repo: "hexpm", optional: true]}, {:ecto_psql_extras, "~> 0.7", [hex: :ecto_psql_extras, repo: "hexpm", optional: true]}, {:ecto_sqlite3_extras, "~> 1.1.7", [hex: :ecto_sqlite3_extras, repo: "hexpm", optional: true]}, {:mime, "~> 1.6 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.19.0", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.6 or ~> 1.0", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "87785a54474fed91a67a1227a741097eb1a42c2e49d3c0d098b588af65cd410d"}, - "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.3.3", "3a53772a6118d5679bf50fc1670505a290e32a1d195df9e069d8c53ab040c054", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "766796676e5f558dbae5d1bdb066849673e956005e3730dfd5affd7a6da4abac"}, + "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.4.1", "2aff698f5e47369decde4357ba91fc9c37c6487a512b41732818f2204a8ef1d3", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "9bffb834e7ddf08467fe54ae58b5785507aaba6255568ae22b4d46e2bb3615ab"}, "phoenix_live_view": {:hex, :phoenix_live_view, "0.19.5", "6e730595e8e9b8c5da230a814e557768828fd8dfeeb90377d2d8dbb52d4ec00a", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "b2eaa0dd3cfb9bd7fb949b88217df9f25aed915e986a28ad5c8a0d054e7ca9d3"}, - "phoenix_markdown": {:hex, :phoenix_markdown, "1.0.3", "8095c40dd5037f4b56079ad66de3fe9136406c7c44e1222ce3c74d22e4c7870a", [:mix], [{:earmark, "~> 1.2", [hex: :earmark, repo: "hexpm", optional: false]}, {:html_entities, "~> 0.4", [hex: :html_entities, repo: "hexpm", optional: false]}, {:phoenix, ">= 1.1.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, ">= 2.3.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}], "hexpm", "d3591c4cb3357b068cc8284952dbacedb874b287add27787eea2d1d314b18c16"}, "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.3", "3168d78ba41835aecad272d5e8cd51aa87a7ac9eb836eabc42f6e57538e3731d", [:mix], [], "hexpm", "bba06bc1dcfd8cb086759f0edc94a8ba2bc8896d5331a1e2c2902bf8e36ee502"}, "phoenix_pubsub_redis": {:hex, :phoenix_pubsub_redis, "3.0.1", "d4d856b1e57a21358e448543e1d091e07e83403dde4383b8be04ed9d2c201cbc", [:mix], [{:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5.1 or ~> 1.6", [hex: :poolboy, repo: "hexpm", optional: false]}, {:redix, "~> 0.10.0 or ~> 1.0", [hex: :redix, repo: "hexpm", optional: false]}], "hexpm", "0b36a17ff6e9a56159f8df8933d62b5c1f0695eae995a02e0c86c035ace6a309"}, "phoenix_swoosh": {:hex, :phoenix_swoosh, "1.2.0", "a544d83fde4a767efb78f45404a74c9e37b2a9c5ea3339692e65a6966731f935", [:mix], [{:finch, "~> 0.8", [hex: :finch, repo: "hexpm", optional: true]}, {:hackney, "~> 1.10", [hex: :hackney, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6", [hex: :phoenix, repo: "hexpm", optional: true]}, {:phoenix_html, "~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_view, "~> 1.0 or ~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:swoosh, "~> 1.5", [hex: :swoosh, repo: "hexpm", optional: false]}], "hexpm", "e88d117251e89a16b92222415a6d87b99a96747ddf674fc5c7631de734811dba"}, From ab1c800d37ce77b2a6464737c5811fed35e454e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 05:01:00 +0000 Subject: [PATCH 15/18] Bump telemetry_metrics from 0.6.1 to 0.6.2 Bumps [telemetry_metrics](https://github.com/beam-telemetry/telemetry_metrics) from 0.6.1 to 0.6.2. - [Changelog](https://github.com/beam-telemetry/telemetry_metrics/blob/main/CHANGELOG.md) - [Commits](https://github.com/beam-telemetry/telemetry_metrics/compare/v0.6.1...v0.6.2) --- updated-dependencies: - dependency-name: telemetry_metrics dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- mix.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix.lock b/mix.lock index eb36e1d1..7154fcd7 100644 --- a/mix.lock +++ b/mix.lock @@ -66,7 +66,7 @@ "styler": {:hex, :styler, "0.11.9", "2595393b94e660cd6e8b582876337cc50ff047d184ccbed42fdad2bfd5d78af5", [:mix], [], "hexpm", "8b7806ba1fdc94d0a75127c56875f91db89b75117fcc67572661010c13e1f259"}, "swoosh": {:hex, :swoosh, "1.15.1", "9a8f45b24efc51ce3b04680324828c50fbd9733b9cd798abdcf9b51f5b4667a3", [:mix], [{:bandit, ">= 1.0.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:cowboy, "~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:ex_aws, "~> 2.1", [hex: :ex_aws, repo: "hexpm", optional: true]}, {:finch, "~> 0.6", [hex: :finch, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.13 or ~> 1.0", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mail, "~> 0.2", [hex: :mail, repo: "hexpm", optional: true]}, {:mime, "~> 1.1 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: true]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:req, "~> 0.4 or ~> 1.0", [hex: :req, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "aa4e794bd39529f3d7e9cfd406ff1bbc422b9120e2a7ad38dfdf9b469d0c91f6"}, "telemetry": {:hex, :telemetry, "0.4.3", "a06428a514bdbc63293cd9a6263aad00ddeb66f608163bdec7c8995784080818", [:rebar3], [], "hexpm", "eb72b8365ffda5bed68a620d1da88525e326cb82a75ee61354fc24b844768041"}, - "telemetry_metrics": {:hex, :telemetry_metrics, "0.6.1", "315d9163a1d4660aedc3fee73f33f1d355dcc76c5c3ab3d59e76e3edf80eef1f", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7be9e0871c41732c233be71e4be11b96e56177bf15dde64a8ac9ce72ac9834c6"}, + "telemetry_metrics": {:hex, :telemetry_metrics, "0.6.2", "2caabe9344ec17eafe5403304771c3539f3b6e2f7fb6a6f602558c825d0d0bfb", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "9b43db0dc33863930b9ef9d27137e78974756f5f198cae18409970ed6fa5b561"}, "telemetry_poller": {:hex, :telemetry_poller, "0.5.1", "21071cc2e536810bac5628b935521ff3e28f0303e770951158c73eaaa01e962a", [:rebar3], [{:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "4cab72069210bc6e7a080cec9afffad1b33370149ed5d379b81c7c5f0c663fd4"}, "tzdata": {:hex, :tzdata, "1.0.1", "f6027a331af7d837471248e62733c6ebee86a72e57c613aa071ebb1f750fc71a", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "cf1345dfbce6acdfd4e23cbb36e96e53d1981bc89181cd0b936f4f398f4c0b78"}, "unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"}, From 1ca8b95c88b49087d399e0c2571c50673fd4b158 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 05:01:07 +0000 Subject: [PATCH 16/18] Bump oban from 2.16.2 to 2.17.3 Bumps [oban](https://github.com/sorentwo/oban) from 2.16.2 to 2.17.3. - [Release notes](https://github.com/sorentwo/oban/releases) - [Changelog](https://github.com/sorentwo/oban/blob/main/CHANGELOG.md) - [Commits](https://github.com/sorentwo/oban/compare/v2.16.2...v2.17.3) --- updated-dependencies: - dependency-name: oban dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- mix.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix.lock b/mix.lock index 7154fcd7..22fab96d 100644 --- a/mix.lock +++ b/mix.lock @@ -40,7 +40,7 @@ "nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"}, "nimble_publisher": {:hex, :nimble_publisher, "1.1.0", "49dee0f30536140268996660a5927d0282946949c35c88ccc6da11a19231b4b6", [:mix], [{:earmark, "~> 1.4", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "80fb42d8d1e34f41ff29fc2a1ae6ab86ea7b764b3c2d38e5268a43cf33825782"}, "number": {:hex, :number, "1.0.4", "3e6e6032a3c1d4c3760e77a42c580a57a15545dd993af380809da30fe51a032c", [:mix], [{:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}], "hexpm", "16f7516584ef2be812af4f33f2eaf3f9b9f6ed8892f45853eb93113f83721e42"}, - "oban": {:hex, :oban, "2.16.2", "ec8dfd2f6dfdcd885061b58aeaa2794a0a6f62bad20c15939e4bb80bfd74ed76", [:mix], [{:ecto_sql, "~> 3.6", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:ecto_sqlite3, "~> 0.9", [hex: :ecto_sqlite3, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3d343c80948676abf9652da1e793ab6140ba64e9de7c8d6630eb5bb4aa8fea79"}, + "oban": {:hex, :oban, "2.17.3", "ddfd5710aadcd550d2e174c8d73ce5f1865601418cf54a91775f20443fb832b7", [:mix], [{:ecto_sql, "~> 3.6", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:ecto_sqlite3, "~> 0.9", [hex: :ecto_sqlite3, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "452eada8bfe0d0fefd0740ab5fa8cf3ef6c375df0b4a3c3805d179022a04738a"}, "parse_trans": {:hex, :parse_trans, "3.4.1", "6e6aa8167cb44cc8f39441d05193be6e6f4e7c2946cb2759f015f8c56b76e5ff", [:rebar3], [], "hexpm", "620a406ce75dada827b82e453c19cf06776be266f5a67cff34e1ef2cbb60e49a"}, "phoenix": {:hex, :phoenix, "1.7.11", "1d88fc6b05ab0c735b250932c4e6e33bfa1c186f76dcf623d8dd52f07d6379c7", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.7", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "b1ec57f2e40316b306708fe59b92a16b9f6f4bf50ccfa41aa8c7feb79e0ec02a"}, "phoenix_ecto": {:hex, :phoenix_ecto, "4.4.2", "b21bd01fdeffcfe2fab49e4942aa938b6d3e89e93a480d4aee58085560a0bc0d", [:mix], [{:ecto, "~> 3.5", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "70242edd4601d50b69273b057ecf7b684644c19ee750989fd555625ae4ce8f5d"}, From 7ed50f35e6b218cbe99227cf5d45b8eacf7d05c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 05:01:00 +0000 Subject: [PATCH 17/18] Bump phoenix_swoosh from 1.2.0 to 1.2.1 Bumps [phoenix_swoosh](https://github.com/swoosh/phoenix_swoosh) from 1.2.0 to 1.2.1. - [Release notes](https://github.com/swoosh/phoenix_swoosh/releases) - [Changelog](https://github.com/swoosh/phoenix_swoosh/blob/main/CHANGELOG.md) - [Commits](https://github.com/swoosh/phoenix_swoosh/compare/v1.2.0...v1.2.1) --- updated-dependencies: - dependency-name: phoenix_swoosh dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- mix.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix.lock b/mix.lock index 22fab96d..2d8498fa 100644 --- a/mix.lock +++ b/mix.lock @@ -50,7 +50,7 @@ "phoenix_live_view": {:hex, :phoenix_live_view, "0.19.5", "6e730595e8e9b8c5da230a814e557768828fd8dfeeb90377d2d8dbb52d4ec00a", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "b2eaa0dd3cfb9bd7fb949b88217df9f25aed915e986a28ad5c8a0d054e7ca9d3"}, "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.3", "3168d78ba41835aecad272d5e8cd51aa87a7ac9eb836eabc42f6e57538e3731d", [:mix], [], "hexpm", "bba06bc1dcfd8cb086759f0edc94a8ba2bc8896d5331a1e2c2902bf8e36ee502"}, "phoenix_pubsub_redis": {:hex, :phoenix_pubsub_redis, "3.0.1", "d4d856b1e57a21358e448543e1d091e07e83403dde4383b8be04ed9d2c201cbc", [:mix], [{:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5.1 or ~> 1.6", [hex: :poolboy, repo: "hexpm", optional: false]}, {:redix, "~> 0.10.0 or ~> 1.0", [hex: :redix, repo: "hexpm", optional: false]}], "hexpm", "0b36a17ff6e9a56159f8df8933d62b5c1f0695eae995a02e0c86c035ace6a309"}, - "phoenix_swoosh": {:hex, :phoenix_swoosh, "1.2.0", "a544d83fde4a767efb78f45404a74c9e37b2a9c5ea3339692e65a6966731f935", [:mix], [{:finch, "~> 0.8", [hex: :finch, repo: "hexpm", optional: true]}, {:hackney, "~> 1.10", [hex: :hackney, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6", [hex: :phoenix, repo: "hexpm", optional: true]}, {:phoenix_html, "~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_view, "~> 1.0 or ~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:swoosh, "~> 1.5", [hex: :swoosh, repo: "hexpm", optional: false]}], "hexpm", "e88d117251e89a16b92222415a6d87b99a96747ddf674fc5c7631de734811dba"}, + "phoenix_swoosh": {:hex, :phoenix_swoosh, "1.2.1", "b74ccaa8046fbc388a62134360ee7d9742d5a8ae74063f34eb050279de7a99e1", [:mix], [{:finch, "~> 0.8", [hex: :finch, repo: "hexpm", optional: true]}, {:hackney, "~> 1.10", [hex: :hackney, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6", [hex: :phoenix, repo: "hexpm", optional: true]}, {:phoenix_html, "~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_view, "~> 1.0 or ~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:swoosh, "~> 1.5", [hex: :swoosh, repo: "hexpm", optional: false]}], "hexpm", "4000eeba3f9d7d1a6bf56d2bd56733d5cadf41a7f0d8ffe5bb67e7d667e204a2"}, "phoenix_template": {:hex, :phoenix_template, "1.0.4", "e2092c132f3b5e5b2d49c96695342eb36d0ed514c5b252a77048d5969330d639", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "2c0c81f0e5c6753faf5cca2f229c9709919aba34fab866d3bc05060c9c444206"}, "phoenix_view": {:hex, :phoenix_view, "2.0.3", "4d32c4817fce933693741deeb99ef1392619f942633dde834a5163124813aad3", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}], "hexpm", "cd34049af41be2c627df99cd4eaa71fc52a328c0c3d8e7d4aa28f880c30e7f64"}, "plug": {:hex, :plug, "1.15.3", "712976f504418f6dff0a3e554c40d705a9bcf89a7ccef92fc6a5ef8f16a30a97", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "cc4365a3c010a56af402e0809208873d113e9c38c401cabd88027ef4f5c01fd2"}, From 0f7b6be7dcde532c0c7b82e8ba4af3eb3b36d960 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 03:56:06 +0000 Subject: [PATCH 18/18] Bump pow from 1.0.28 to 1.0.35 Bumps [pow](https://github.com/pow-auth/pow) from 1.0.28 to 1.0.35. - [Release notes](https://github.com/pow-auth/pow/releases) - [Changelog](https://github.com/pow-auth/pow/blob/main/CHANGELOG.md) - [Commits](https://github.com/pow-auth/pow/compare/v1.0.28...v1.0.35) --- updated-dependencies: - dependency-name: pow dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- mix.exs | 2 +- mix.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mix.exs b/mix.exs index 245f751e..1944d982 100644 --- a/mix.exs +++ b/mix.exs @@ -67,7 +67,7 @@ defmodule Ex338.Mixfile do {:phoenix_swoosh, "~> 1.2.0"}, {:plug_cowboy, "~> 2.7"}, {:postgrex, "~> 0.16.0"}, - {:pow, "== 1.0.28"}, + {:pow, "== 1.0.35"}, {:redix, "~> 1.2.3"}, {:styler, "~> 0.11", only: [:dev, :test], runtime: false}, {:swoosh, "~> 1.15"}, diff --git a/mix.lock b/mix.lock index 2d8498fa..eef2e5d0 100644 --- a/mix.lock +++ b/mix.lock @@ -59,7 +59,7 @@ "poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm", "fec8660eb7733ee4117b85f55799fd3833eb769a6df71ccf8903e8dc5447cfce"}, "poolboy": {:hex, :poolboy, "1.5.2", "392b007a1693a64540cead79830443abf5762f5d30cf50bc95cb2c1aaafa006b", [:rebar3], [], "hexpm", "dad79704ce5440f3d5a3681c8590b9dc25d1a561e8f5a9c995281012860901e3"}, "postgrex": {:hex, :postgrex, "0.16.5", "fcc4035cc90e23933c5d69a9cd686e329469446ef7abba2cf70f08e2c4b69810", [:mix], [{:connection, "~> 1.1", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "edead639dc6e882618c01d8fc891214c481ab9a3788dfe38dd5e37fd1d5fb2e8"}, - "pow": {:hex, :pow, "1.0.28", "b2cc32673e3fd138db6bd7e0656d826b287800d60f4139ed3c3fa6df926f1250", [:mix], [{:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix, ">= 1.3.0 and < 1.8.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, ">= 2.0.0 and < 4.0.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:plug, ">= 1.5.0 and < 2.0.0", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "e03f6ae9a536153f8491e3ef7bb0908f5494756905997611abb204ce23b4d64d"}, + "pow": {:hex, :pow, "1.0.35", "68722d10158c755582f52d5565441672799eceb651197c6b4c60dc14bed575c8", [:mix], [{:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix, ">= 1.3.0 and < 1.8.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, ">= 2.0.0 and < 5.0.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_live_view, ">= 0.18.0", [hex: :phoenix_live_view, repo: "hexpm", optional: true]}, {:plug, ">= 1.5.0 and < 2.0.0", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "6436d7715b7a822b463cc9c95f0bbcda4d31109dc2f44c63f3d7fcbe1f34d1fb"}, "ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"}, "redix": {:hex, :redix, "1.2.3", "3036e7c6080c42e1bbaa9168d1e28e367b01e8960a640a899b8ef8067273cb5e", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:nimble_options, "~> 0.5.0 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "14e2bca8a03fad297a78a3d201032df260ee5f0e0ef9c173c0f9ca5b3e0331b7"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"},