Skip to content

Instantly share code, notes, and snippets.

@johnkil
Created November 27, 2024 13:31
Show Gist options
  • Save johnkil/e755d0b5ea796d1b731b4834c4924358 to your computer and use it in GitHub Desktop.
Save johnkil/e755d0b5ea796d1b731b4834c4924358 to your computer and use it in GitHub Desktop.
data class Event(
val id: Int,
val image: Image?,
val title: String,
val description: String?,
val areQuestionsAllowed: Boolean,
val startDate: Instant,
val endDate: Instant,
val organizer: User,
val address: EventLocation?,
val onlineMeeting: EventLocation?,
val broadcast: EventBroadcast,
val registration: EventRegistration,
val likes: EventLikes
)
sealed interface EventBroadcast {
data object None : EventBroadcast
data object Upcoming : EventBroadcast
data class Live(
val broadcastId: Int,
val pinCode: String?
) : EventBroadcast
}
data class EventLocation(
val name: String,
val description: String
)
sealed interface EventRegistration {
data object NotRequired : EventRegistration
data class Required(
val startDate: Instant,
val endDate: Instant,
val displayedRegisteredUsers: List<User>,
val totalRegisteredUsers: Int,
val isUserRegistered: Boolean,
val status: EventRegistrationStatus
) : EventRegistration
}
enum class EventRegistrationStatus {
PENDING,
OPEN,
CLOSED
}
sealed interface EventLikes {
data object NotAllowed : EventLikes
data class Allowed(
val totalCount: Int,
val isLikedByUser: Boolean
) : EventLikes
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment