Skip to main content

Captain License Entities

Entities for tracking captain's licenses, renewals, and renewal events.

CaptainLicense

Purpose: User's captain's license.

Key Fields:

  • Id (int): Unique identifier
  • UserId: License holder
  • LicenseNumber: License number
  • LicenseType: License type/level
  • IssuingAuthority: USCG, State, International
  • IssueDate: Issue date
  • ExpirationDate: Expiration date
  • Status: Active, Expired, Suspended, etc.
  • RequiresClassRenewal: Whether requires class renewal
  • RequiresTestRenewal: Whether requires test renewal
  • RequiresMedicalExam: Whether requires medical exam
  • RequiresDrugTest: Whether requires drug test
  • IsVerified: Whether license is verified

Relationships:

  • Many-to-one: User
  • One-to-many: LicenseRenewalHistory

Usage Patterns:

// Create license
var license = new CaptainLicense
{{
UserId = userId,
LicenseNumber = "USCG-12345",
LicenseType = "6-Pack",
IssuingAuthority = "USCG",
IssueDate = issueDate,
ExpirationDate = expirationDate,
Status = LicenseStatus.Active
}};

// Get expiring licenses
var expiring = context.CaptainLicenses
.Where(cl => cl.ExpirationDate <= DateTime.UtcNow.AddDays(90) && cl.Status == LicenseStatus.Active)
.Include(cl => cl.User)
.ToList();

LicenseRenewalEvent

Purpose: License renewal event (class, test, exam).

Key Fields:

  • Id (int): Unique identifier
  • EventName: Event name
  • EventDescription: Event description
  • EventType: Class, Test, Exam, Medical, DrugTest
  • OrganizerName: Organizer name
  • OrganizerEmail, OrganizerPhone: Contact information
  • LocationName: Event location
  • Address, City, State, ZipCode: Address
  • Latitude, Longitude: Coordinates
  • EventDate: Event date
  • StartTime, EndTime: Event times
  • RegistrationFee: Registration fee
  • MaxParticipants: Maximum participants
  • LicenseTypesCovered: License types covered
  • IsActive: Whether event is active

Relationships:

  • One-to-many: LicenseRenewalEventRegistration

LicenseRenewalEventRegistration

Purpose: User registration for a renewal event.

Key Fields:

  • Id (int): Unique identifier
  • LicenseRenewalEventId: Associated event
  • UserId: Registered user
  • CaptainLicenseId: Associated license
  • RegistrationDate: Registration date
  • Status: Pending, Confirmed, Completed, Cancelled
  • PaymentStatus: Payment status
  • Attended: Whether user attended
  • Passed: Whether user passed (for tests)
  • CertificateUrl: Certificate URL (if applicable)

Relationships:

  • Many-to-one: LicenseRenewalEvent, User, CaptainLicense

LicenseRenewalHistory

Purpose: History of license renewals.

Key Fields:

  • Id (int): Unique identifier
  • CaptainLicenseId: Associated license
  • RenewalDate: Renewal date
  • RenewalMethod: Class, Exam, Online, etc.
  • RenewalEventId: Associated renewal event (optional)
  • RequirementsMet: Requirements met (JSON)
  • DocumentationUrl: Documentation URL
  • Notes: Renewal notes

Relationships:

  • Many-to-one: CaptainLicense, LicenseRenewalEvent (optional)