Skip to main content

Charter Entities

Entities for charter boat listings, bookings, and captain management.

CharterCaptain

Purpose: Charter boat captain profile and information.

Key Fields:

  • Id (int): Unique identifier
  • UserId: Associated user account
  • BusinessName: Charter business name
  • LicenseNumber: Captain's license number
  • LicenseExpiration: License expiration date
  • YearsExperience: Years of experience
  • BoatId: Associated boat
  • StripeConnectAccountId: Stripe Connect account for payments
  • IsVerified: Whether captain is verified
  • IsActive: Whether accepting bookings

Relationships:

  • Many-to-one: User, Boat
  • One-to-many: CharterListing, Booking

Usage Patterns:

// Get verified captains
var captains = context.CharterCaptains
.Where(cc => cc.IsVerified && cc.IsActive)
.Include(cc => cc.User)
.Include(cc => cc.Boat)
.ToList();

CharterListing

Purpose: Specific charter trip listings offered by captains.

Key Fields:

  • Id (int): Unique identifier
  • CharterCaptainId: Captain offering the trip
  • Title: Listing title
  • Description: Trip description
  • TripType: HalfDay, FullDay, MultiDay, etc.
  • DurationHours: Trip duration
  • MaxAnglers, MinAnglers: Angler limits
  • Price: Trip price
  • PricingModel: PerTrip, PerAngler, PerHour
  • DepartureLocation: Departure location
  • DepartureLatitude, DepartureLongitude: Coordinates
  • TargetSpecies: Target fish species
  • StartDate, EndDate: Availability dates
  • RecurrencePattern: Daily, Weekly, Monthly
  • IsActive: Whether listing is active

Relationships:

  • Many-to-one: CharterCaptain
  • One-to-many: CharterListingImage, CharterPricing, Booking, CharterAvailability

Usage Patterns:

// Create listing
var listing = new CharterListing
{{
CharterCaptainId = captainId,
Title = "Lake Michigan Salmon Trip",
TripType = TripType.FullDay,
DurationHours = 8,
MaxAnglers = 6,
Price = 800.00m,
PricingModel = PricingModel.PerTrip,
IsActive = true
}};

// Get available listings
var listings = context.CharterListings
.Where(cl => cl.IsActive && cl.StartDate <= DateTime.UtcNow && cl.EndDate >= DateTime.UtcNow)
.Include(cl => cl.CharterCaptain)
.Include(cl => cl.Images)
.ToList();

Booking

Purpose: User bookings for charter trips.

Key Fields:

  • Id (int): Unique identifier
  • CharterListingId: Booked listing
  • UserId: Booking user
  • BookingDate: Trip date
  • NumberOfAnglers: Number of anglers
  • TotalPrice: Total booking price
  • PaymentStatus: Pending, Paid, Failed, Refunded
  • StripePaymentIntentId: Stripe payment intent
  • Status: Pending, Confirmed, Completed, Cancelled
  • BookedAt: Booking timestamp

Relationships:

  • Many-to-one: CharterListing, User
  • One-to-many: BookingParticipant

Usage Patterns:

// Create booking
var booking = new Booking
{{
CharterListingId = listingId,
UserId = userId,
BookingDate = tripDate,
NumberOfAnglers = 4,
TotalPrice = 800.00m,
PaymentStatus = PaymentStatus.Pending,
Status = BookingStatus.Pending,
BookedAt = DateTime.UtcNow
}};

// Get user's bookings
var bookings = context.Bookings
.Where(b => b.UserId == userId)
.Include(b => b.CharterListing)
.ThenInclude(cl => cl.CharterCaptain)
.ToList();

BookingParticipant

Purpose: Individual participants in a charter booking.

Key Fields:

  • Id (int): Unique identifier
  • BookingId: Associated booking
  • UserId: Participant user (optional)
  • Name: Participant name
  • Email: Participant email
  • Age: Participant age

Relationships:

  • Many-to-one: Booking, User (optional)

CharterAvailability

Purpose: Captain availability calendar.

Key Fields:

  • Id (int): Unique identifier
  • CharterListingId: Associated listing
  • Date: Available date
  • StartTime, EndTime: Available time window
  • IsAvailable: Whether available
  • Notes: Availability notes

Relationships:

  • Many-to-one: CharterListing

CharterPricing

Purpose: Pricing tiers and packages for charter listings.

Key Fields:

  • Id (int): Unique identifier
  • CharterListingId: Associated listing
  • PricingTier: Standard, Premium, etc.
  • Price: Tier price
  • Description: Tier description
  • Includes: What's included

Relationships:

  • Many-to-one: CharterListing

CharterListingImage

Purpose: Images for charter listings.

Key Fields:

  • Id (int): Unique identifier
  • CharterListingId: Associated listing
  • ImageUrl: Image URL
  • IsPrimary: Primary image flag
  • Order: Display order

Relationships:

  • Many-to-one: CharterListing