Package com.example.lottery.util
Class InvitationFlowUtil
java.lang.Object
com.example.lottery.util.InvitationFlowUtil
Utility class that centralizes invitation status transitions and notification response handling.
This class ensures consistent status names and Firestore update payloads across the entrant's event details and notification processing flows.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionBuilds a Firestore update payload for cancelling an entrant's participation.buildEntrantStatusUpdateFromResponse(String response) Builds a Firestore update payload for an entrant status based on a notification response.Builds a Firestore update payload for marking an entrant as invited.Builds a Firestore update payload for marking an entrant as not selected.Builds a Firestore update payload for marking a notification as read.Builds a Firestore update payload for an entrant joining the waitlist after an invitation.static StringnormalizeEntrantStatus(String rawStatus) Normalizes a raw entrant status string into its canonical form.static StringnormalizeNotificationResponse(String rawResponse) Normalizes a raw notification response string into its canonical form.
-
Field Details
-
STATUS_WAITLISTED
- See Also:
-
STATUS_INVITED
- See Also:
-
STATUS_ACCEPTED
- See Also:
-
STATUS_CANCELLED
- See Also:
-
STATUS_NOT_SELECTED
- See Also:
-
RESPONSE_NONE
- See Also:
-
RESPONSE_ACCEPTED
- See Also:
-
RESPONSE_DECLINED
- See Also:
-
RESPONSE_DISMISSED
- See Also:
-
RESPONSE_CANCELLED
- See Also:
-
-
Method Details
-
normalizeEntrantStatus
Normalizes a raw entrant status string into its canonical form.- Parameters:
rawStatus- The status string from Firestore or UI.- Returns:
- The canonical status string (e.g., "waitlisted", "invited").
-
normalizeNotificationResponse
Normalizes a raw notification response string into its canonical form.- Parameters:
rawResponse- The response string from a notification dialog.- Returns:
- The canonical response string (e.g., "accepted", "declined").
-
buildInvitedEntrantUpdate
Builds a Firestore update payload for marking an entrant as invited.- Returns:
- A map containing status and timestamp updates.
-
buildNotSelectedEntrantUpdate
Builds a Firestore update payload for marking an entrant as not selected.- Returns:
- A map containing status and timestamp updates.
-
buildEntrantStatusUpdateFromResponse
Builds a Firestore update payload for an entrant status based on a notification response.- Parameters:
response- The user's response string.- Returns:
- A map containing status and timestamp updates.
-
buildWaitlistJoinUpdate
Builds a Firestore update payload for an entrant joining the waitlist after an invitation.- Returns:
- A map containing status and timestamp updates.
-
buildCancelledEntrantUpdate
Builds a Firestore update payload for cancelling an entrant's participation.- Returns:
- A map containing status and timestamp updates.
-
buildReadNotificationUpdate
Builds a Firestore update payload for marking a notification as read.- Returns:
- A map with read status updated.
-