Skip to main content

Tournament Entities

Entities for fishing tournaments, registrations, results, and prizes.

Tournament

Purpose: Represents a fishing tournament/competition with registration, payment, and results management.

Key Fields:

  • Id (int): Unique identifier
  • OrganizerId: User who created the tournament
  • Name: Tournament name
  • Description: Detailed description
  • Location: Tournament location
  • Latitude, Longitude: Location coordinates
  • TournamentType: SingleDay, MultiDay, Series
  • Format: Individual, Team
  • RegistrationStartDate, RegistrationEndDate: Registration period
  • StartDate, EndDate: Tournament dates
  • EntryFee: Entry fee per angler/team
  • RequiresPayment: Whether payment is required
  • StripeProductId, StripePriceId: Stripe payment integration
  • TotalPrizePool: Total prize pool amount
  • MaxParticipants: Maximum participants
  • Status: Draft, Open, InProgress, Completed, Cancelled

Relationships:

  • Many-to-one: User (organizer)
  • One-to-many: TournamentCategory, TournamentRegistration, TournamentResult, TournamentRule, TournamentSponsor, TournamentTeam

Usage Patterns:

// Create tournament
var tournament = new Tournament
{{
OrganizerId = organizerId,
Name = "Lake Michigan Salmon Classic 2024",
StartDate = startDate,
EndDate = endDate,
EntryFee = 100.00m,
RequiresPayment = true,
Status = TournamentStatus.Open
}};

// Get active tournaments
var tournaments = context.Tournaments
.Where(t => t.Status == TournamentStatus.Open)
.Include(t => t.Organizer)
.Include(t => t.Categories)
.ToList();

TournamentRegistration

Purpose: User/team registration for a tournament.

Key Fields:

  • Id (int): Unique identifier
  • TournamentId: Associated tournament
  • UserId: Registered user
  • CategoryId: Tournament category/division
  • TeamId: Team (if team format)
  • PaymentStatus: Pending, Paid, Failed, Refunded
  • StripePaymentIntentId: Stripe payment intent
  • RegisteredAt: Registration timestamp

Relationships:

  • Many-to-one: Tournament, User, TournamentCategory, TournamentTeam

Usage Patterns:

// Register for tournament
var registration = new TournamentRegistration
{{
TournamentId = tournamentId,
UserId = userId,
CategoryId = categoryId,
PaymentStatus = PaymentStatus.Pending,
RegisteredAt = DateTime.UtcNow
}};

// Get user's registrations
var registrations = context.TournamentRegistrations
.Where(tr => tr.UserId == userId)
.Include(tr => tr.Tournament)
.Include(tr => tr.Category)
.ToList();

TournamentResult

Purpose: Tournament catch results and leaderboard entries.

Key Fields:

  • Id (int): Unique identifier
  • TournamentId: Associated tournament
  • RegistrationId: Associated registration
  • FishingLogEntryId: Catch log entry
  • Rank: Final rank/position
  • Points: Points earned
  • WeightLb: Fish weight
  • LengthInches: Fish length
  • SubmittedAt: When result was submitted

Relationships:

  • Many-to-one: Tournament, TournamentRegistration, FishingLogEntry

TournamentCategory

Purpose: Categories/divisions within a tournament (e.g., by species, age group, skill level).

Key Fields:

  • Id (int): Unique identifier
  • TournamentId: Associated tournament
  • Name: Category name
  • SpeciesId: Species-specific category
  • MinAge, MaxAge: Age requirements
  • SkillLevel: Skill level requirement
  • EntryFee: Category-specific entry fee
  • PrizePool: Prize pool for this category

Relationships:

  • Many-to-one: Tournament, FishSpecies
  • One-to-many: TournamentRegistration, TournamentResult, TournamentPrize

TournamentTeam

Purpose: Teams for team-format tournaments.

Key Fields:

  • Id (int): Unique identifier
  • TournamentId: Associated tournament
  • TeamName: Team name
  • CaptainUserId: Team captain
  • MaxMembers: Maximum team size

Relationships:

  • Many-to-one: Tournament, User (captain)
  • One-to-many: TournamentRegistration

TournamentPrize

Purpose: Prizes for tournament winners.

Key Fields:

  • Id (int): Unique identifier
  • TournamentId: Associated tournament
  • CategoryId: Category (if category-specific)
  • Place: Prize place (1st, 2nd, 3rd, etc.)
  • PrizeType: Cash, Trophy, Gear, etc.
  • Amount: Prize amount/value
  • Description: Prize description

Relationships:

  • Many-to-one: Tournament, TournamentCategory

TournamentRule

Purpose: Tournament rules and regulations.

Key Fields:

  • Id (int): Unique identifier
  • TournamentId: Associated tournament
  • RuleText: Rule text
  • RuleType: General, Species, Size, etc.
  • Order: Display order

Relationships:

  • Many-to-one: Tournament

TournamentSponsor

Purpose: Tournament sponsors.

Key Fields:

  • Id (int): Unique identifier
  • TournamentId: Associated tournament
  • SponsorName: Sponsor name
  • SponsorLogoUrl: Logo URL
  • SponsorWebsite: Website URL
  • SponsorLevel: Gold, Silver, Bronze, etc.

Relationships:

  • Many-to-one: Tournament

TournamentEligibilityRule

Purpose: Eligibility rules for tournament participation.

Key Fields:

  • Id (int): Unique identifier
  • TournamentId: Associated tournament
  • RuleType: Age, License, Experience, etc.
  • RuleValue: Rule value/criteria

Relationships:

  • Many-to-one: Tournament