Package com.example.lottery.model
Class Event
java.lang.Object
com.example.lottery.model.Event
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 Summary
ConstructorsConstructorDescriptionEvent()Default constructor required for Firestore.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 Summary
Modifier and TypeMethodDescriptioncom.google.firebase.Timestampcom.google.firebase.Timestampcom.google.firebase.TimestampgetPlace()com.google.firebase.Timestampcom.google.firebase.Timestampcom.google.firebase.TimestampgetTitle()com.google.firebase.TimestampbooleanbooleanvoidsetCapacity(Integer capacity) voidsetCategory(String category) voidsetCreatedAt(com.google.firebase.Timestamp createdAt) voidsetDetails(String details) voidsetDrawDate(com.google.firebase.Timestamp drawDate) voidsetEventEndDateTime(com.google.firebase.Timestamp eventEndDateTime) voidsetEventId(String eventId) voidsetOrganizerId(String organizerId) voidvoidsetPosterBase64(String posterBase64) voidsetPrivate(boolean aPrivate) voidsetQrCodeContent(String qrCodeContent) voidsetRegistrationDeadline(com.google.firebase.Timestamp registrationDeadline) voidsetRegistrationStart(com.google.firebase.Timestamp registrationStart) voidsetRequireLocation(boolean requireLocation) voidsetScheduledDateTime(com.google.firebase.Timestamp scheduledDateTime) voidvoidvoidsetUpdatedAt(com.google.firebase.Timestamp updatedAt) voidsetWaitingListLimit(Integer waitingListLimit) voidtouch()Updates the updatedAt timestamp.
-
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
-
setEventId
- Parameters:
eventId- The unique identifier to set for the event.
-
getTitle
- Returns:
- The title of the event.
-
setTitle
- Parameters:
title- The title to set for the event.
-
getDetails
-
setDetails
- Parameters:
details- The detailed description to set.
-
getOrganizerId
-
setOrganizerId
- Parameters:
organizerId- The identifier of the event organizer to set.
-
getCapacity
-
setCapacity
-
getWaitingListLimit
- Returns:
- The optional limit for the waiting list. null means unlimited.
-
setWaitingListLimit
- Parameters:
waitingListLimit- The optional limit to set for the waiting list.
-
getQrCodeContent
-
setQrCodeContent
-
getStatus
-
setStatus
-
getPosterBase64
-
setPosterBase64
-
getCategory
-
setCategory
-
getPlace
-
setPlace
-
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.
-