Class Event

java.lang.Object
com.example.lottery.model.Event

public class Event extends Object
Model class representing an event.

Key Responsibilities:

  • Encapsulates all metadata for an event, including titles, dates, descriptions, and place.
  • Stores promotional poster image as a Base64 string and QR code content.
  • Acts as a Data Transfer Object (DTO) for Firebase Firestore serialization.

Satisfies requirements for: US 02.01.01: Event creation with promotional QR code. US 02.01.04: Registration deadline management. US 02.04.01: Event poster support. US 02.02.03: Geolocation requirement toggle. US 02.03.01: Waiting List Limit.

  • Constructor Details

    • Event

      public Event()
      Default constructor required for Firestore.
    • Event

      public Event(String eventId, String title, String details, String organizerId, Integer capacity, Integer waitingListLimit, String qrCodeContent, String status, String posterBase64, String category, String place, com.google.firebase.Timestamp scheduledDateTime, com.google.firebase.Timestamp eventEndDateTime, com.google.firebase.Timestamp registrationStart, com.google.firebase.Timestamp registrationDeadline, com.google.firebase.Timestamp drawDate, boolean requireLocation, boolean isPrivate, com.google.firebase.Timestamp createdAt, com.google.firebase.Timestamp updatedAt)
      Full constructor for target Firestore event document.
  • Method Details

    • getEventId

      public String getEventId()
    • setEventId

      public void setEventId(String eventId)
      Parameters:
      eventId - The unique identifier to set for the event.
    • getTitle

      public String getTitle()
      Returns:
      The title of the event.
    • setTitle

      public void setTitle(String title)
      Parameters:
      title - The title to set for the event.
    • getDetails

      public String getDetails()
    • setDetails

      public void setDetails(String details)
      Parameters:
      details - The detailed description to set.
    • getOrganizerId

      public String getOrganizerId()
    • setOrganizerId

      public void setOrganizerId(String organizerId)
      Parameters:
      organizerId - The identifier of the event organizer to set.
    • getCapacity

      public Integer getCapacity()
    • setCapacity

      public void setCapacity(Integer capacity)
    • getWaitingListLimit

      public Integer getWaitingListLimit()
      Returns:
      The optional limit for the waiting list. null means unlimited.
    • setWaitingListLimit

      public void setWaitingListLimit(Integer waitingListLimit)
      Parameters:
      waitingListLimit - The optional limit to set for the waiting list.
    • getQrCodeContent

      public String getQrCodeContent()
    • setQrCodeContent

      public void setQrCodeContent(String qrCodeContent)
    • getStatus

      public String getStatus()
    • setStatus

      public void setStatus(String status)
    • getPosterBase64

      public String getPosterBase64()
    • setPosterBase64

      public void setPosterBase64(String posterBase64)
    • getCategory

      public String getCategory()
    • setCategory

      public void setCategory(String category)
    • getPlace

      public String getPlace()
    • setPlace

      public void setPlace(String place)
    • getScheduledDateTime

      public com.google.firebase.Timestamp getScheduledDateTime()
    • setScheduledDateTime

      public void setScheduledDateTime(com.google.firebase.Timestamp scheduledDateTime)
    • getEventEndDateTime

      public com.google.firebase.Timestamp getEventEndDateTime()
    • setEventEndDateTime

      public void setEventEndDateTime(com.google.firebase.Timestamp eventEndDateTime)
    • getRegistrationStart

      public com.google.firebase.Timestamp getRegistrationStart()
    • setRegistrationStart

      public void setRegistrationStart(com.google.firebase.Timestamp registrationStart)
    • getRegistrationDeadline

      public com.google.firebase.Timestamp getRegistrationDeadline()
    • setRegistrationDeadline

      public void setRegistrationDeadline(com.google.firebase.Timestamp registrationDeadline)
    • getDrawDate

      public com.google.firebase.Timestamp getDrawDate()
    • setDrawDate

      public void setDrawDate(com.google.firebase.Timestamp drawDate)
    • isRequireLocation

      public boolean isRequireLocation()
    • setRequireLocation

      public void setRequireLocation(boolean requireLocation)
    • isPrivate

      public boolean isPrivate()
    • setPrivate

      public void setPrivate(boolean aPrivate)
    • getCreatedAt

      public com.google.firebase.Timestamp getCreatedAt()
    • setCreatedAt

      public void setCreatedAt(com.google.firebase.Timestamp createdAt)
    • getUpdatedAt

      public com.google.firebase.Timestamp getUpdatedAt()
    • setUpdatedAt

      public void setUpdatedAt(com.google.firebase.Timestamp updatedAt)
    • touch

      public void touch()
      Updates the updatedAt timestamp. Should be called explicitly before Firestore writes.