From aa42c082645d275eabd276058bf9fc3d74562759 Mon Sep 17 00:00:00 2001 From: tapst0rm <104149744+tapst0rm@users.noreply.github.com> Date: Sat, 28 Nov 2026 21:59:12 -0600 Subject: [PATCH 1/3] Kdoc comments for all controllers Only controller kdocs. Note: there are some unused functions such as isMuted in NotificationPreferenceController and 3 in messagecontroller and 2 in message notification but im assume jason might use it later for the remaning stories. --- .../controller/AdminLogController.kt | 2 +- .../controller/AppControllers.kt | 10 +++--- .../controller/CampsitePhotoController.kt | 10 +++++- .../controller/LotteryController.kt | 8 +++-- .../controller/MessageController.kt | 18 +++++----- .../MessageNotificationController.kt | 22 ++++++------ .../controller/NotificationController.kt | 36 ++++++++++++++++--- .../controller/ReservationController.kt | 8 ++--- .../controller/ReviewController.kt | 5 +-- .../controller/ReviewReactionController.kt | 7 ++-- .../controller/ReviewReplyController.kt | 7 ++-- .../controller/UserController.kt | 16 +++++---- 12 files changed, 94 insertions(+), 55 deletions(-) diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/controller/AdminLogController.kt b/code/app/src/main/java/com/example/lambda_bbb_events/controller/AdminLogController.kt index 6fc22ef1..ff802c61 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/controller/AdminLogController.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/controller/AdminLogController.kt @@ -61,7 +61,7 @@ class AdminLogController( * The original identifiers are preserved for internal use. * * @param logs The logs containing user and campsite identifiers. - * @param profileNames A map of user IDs to user names. + * @param profileNames A map of user IDs to usernames. * @param campsiteNames A map of campsite IDs to campsite names. * @return A list of logs containing resolved display names. */ diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/controller/AppControllers.kt b/code/app/src/main/java/com/example/lambda_bbb_events/controller/AppControllers.kt index 960bf8fc..ddb72a65 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/controller/AppControllers.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/controller/AppControllers.kt @@ -19,11 +19,12 @@ import com.example.lambda_bbb_events.model.services.PlaceSearch * @property reviewReplies Controller for the replies under reviews. * @property reviewReactions Controller for the emoji reactions to reviews. * @property places Searches for places by name. + * @property notifications Controller for notification operations. * @property messages Controller for messaging operations. - * @property notificationPreferences Controller for notification preferences. - * @property messageNotifications Controller for incoming message alerts. + * @property notificationPreferences Controller for notification preferences from individual messaging contacts + * @property messageNotifications Controller for incoming android alerts for eligible incoming messages. * @property adminLogs Controller for administrative notification and message logs. - * @property adminLotteries Controller for admin-only lottery actions. + * @property adminLotteries Controller for administrating lottery actions. */ class AppControllers( val users: UserController, @@ -38,13 +39,10 @@ class AppControllers( val places: PlaceSearch = FallbackPlaceSearch(), val notifications: NotificationController, val messages: MessageController = MessageController(users), - /** Manages preferences for notifications from individual messaging contacts. */ val notificationPreferences: NotificationPreferenceController = NotificationPreferenceController(users), - /** Posts Android notifications for eligible incoming messages. */ val messageNotifications: MessageNotificationController = MessageNotificationController(users), val adminLogs: AdminLogController = AdminLogController(), - /** Coordinates administrator actions for running lotteries. */ val adminLotteries: AdminLotteryController = AdminLotteryController() ) \ No newline at end of file diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/controller/CampsitePhotoController.kt b/code/app/src/main/java/com/example/lambda_bbb_events/controller/CampsitePhotoController.kt index 147049b5..0b13f3aa 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/controller/CampsitePhotoController.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/controller/CampsitePhotoController.kt @@ -35,7 +35,7 @@ class CampsitePhotoController( * * @param campsiteId The ID of the campsite. * @param uploaderId The ID of the user adding the photo. - * @param photo The photo. + * @param photo The photo to be added. * @throws IllegalStateException if the campsite already has [MAX_PHOTOS] photos. * @throws Exception if the photo could not be uploaded or saved. */ @@ -64,6 +64,8 @@ class CampsitePhotoController( * Removes a photo from a campsite, then deletes it. If deleting it fails, it is still * removed from the campsite. * + * @param campsiteId The ID of the campsite. + * @param imageId The ID of the photo to be removed. * @throws Exception if the change could not be saved, in which case the photo is kept. */ suspend fun removePhoto(campsiteId: String, imageId: String) { @@ -74,6 +76,8 @@ class CampsitePhotoController( /** * Moves a photo to the front, making it the thumbnail. The others keep their order. * + * @param campsiteId The ID of the campsite. + * @param imageId The ID of the photo to be removed. * @throws Exception if the change could not be saved. */ suspend fun makeThumbnail(campsiteId: String, imageId: String) { @@ -83,6 +87,10 @@ class CampsitePhotoController( /** * Changes the part of a photo that stays in view when it is cropped. * + * @param campsiteId The ID of the campsite. + * @param imageId The ID of the photo. + * @param focusX The horizontal focus position. + * @param focusY The vertical focus position. * @throws Exception if the change could not be saved. */ suspend fun changeFocus(campsiteId: String, imageId: String, focusX: Float, focusY: Float) { diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/controller/LotteryController.kt b/code/app/src/main/java/com/example/lambda_bbb_events/controller/LotteryController.kt index a9cfe3a6..98ba2349 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/controller/LotteryController.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/controller/LotteryController.kt @@ -187,7 +187,7 @@ class LotteryController( * @param bookingEnd The end date of the booking period. * @param numberOfWinnersString The number of winners of the lottery (as a string). * @param waitlistCapacityString The maximum number of entries (as a string). - * @return `null` if the lottery was created successfully. An error message otherwise. + * @return `null` if the lottery was updated successfully. An error message otherwise. */ suspend fun updateLottery( lotteryId: String, @@ -297,6 +297,7 @@ class LotteryController( * Deletes a lottery. * * @param lottery The lottery to delete. + * @throws Exception if deleting lottery fails. */ suspend fun deleteLottery(lottery: Lottery) { lotteryRepository.deleteLottery(lottery) @@ -311,6 +312,7 @@ class LotteryController( * @param ownerId The device ID of the owner. * @param campsiteName Gets a campsite's name from its ID, for the message, or `null` if unknown. * @return The number of winners sent a message. + * @throws Exception if retrieving lotteries or cancelling a lottery or notifying winners fails. */ suspend fun cancelLotteriesOfDeletedOwner( ownerId: String, @@ -358,7 +360,7 @@ class LotteryController( } /** - * Gets the lotteries of a campsite that match a filter. + * Returns the lotteries of a campsite that match a filter. * * @param campsiteId The `campsiteId` to search for. * @param filter Which lotteries to return. The default is only the active ones. @@ -459,6 +461,7 @@ class LotteryController( * * @param lottery The lottery being accepted. * @param ownerId The device ID of the owner accepting. + * @throws Exception if updating the lottery fails. */ suspend fun acceptLotteryRequest(lottery: Lottery, ownerId: String) { lotteryRepository.updateLottery( @@ -470,6 +473,7 @@ class LotteryController( * Declines a lottery request. This cancels the whole lottery. * * @param lottery The lottery being declined. + * @throws Exception if updating the lottery fails. */ suspend fun declineLotteryRequest(lottery: Lottery) { lotteryRepository.updateLottery(lottery.copy(status = LotteryStatus.CANCELLED)) diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/controller/MessageController.kt b/code/app/src/main/java/com/example/lambda_bbb_events/controller/MessageController.kt index e5d66ce4..4c51fdcd 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/controller/MessageController.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/controller/MessageController.kt @@ -22,8 +22,7 @@ import kotlinx.coroutines.flow.Flow * current user and their role. * * @param userController Controller responsible for user operations. - * @param conversationRepository Repository responsible - * for managing conversations. + * @param conversationRepository Repository responsible for managing conversations. */ class MessageController( private val userController: UserController, @@ -61,6 +60,7 @@ class MessageController( * @param contactId Device ID of the campsite owner or administrator. * @param type Type of conversation. * @return Unique identifier of the conversation. + * @throws IllegalStateException If no user is signed in. * * Reference: * Anthropic. (2026). Claude Code (Claude Opus 5.5) [Large language model]. @@ -68,7 +68,7 @@ class MessageController( * Changed with the help of this AI tool. * Prompts: * - "Now on the notification page as well. Please also remove the profile duplication bug. - * Also please fix the way the admins work since it seems all admins share an account. One + * Also, please fix the way the admins work since it seems all admins share an account. One * more thing is to fix the notification page so that the spacing looks right." * - Answers chosen when the AI asked how to do this: "Merge repeated contacts" and "Separate * chats per admin". @@ -136,6 +136,7 @@ class MessageController( * Should only be called after conversation access is checked. * * @param conversationId Unique identifier of the conversation. + * @throws IllegalStateException If no user is signed in. */ fun openConversation(conversationId: String) { check(userController.currentUser != null) { @@ -171,7 +172,7 @@ class MessageController( * Changed with the help of this AI tool. * Prompts: * - "Now on the notification page as well. Please also remove the profile duplication bug. - * Also please fix the way the admins work since it seems all admins share an account. One + * Also, please fix the way the admins work since it seems all admins share an account. One * more thing is to fix the notification page so that the spacing looks right." * - Answers chosen when the AI asked how to do this: "Merge repeated contacts" and "Separate * chats per admin". @@ -193,7 +194,7 @@ class MessageController( * message in their conversations. * * @param messageId Unique identifier of the message. - * @throws IllegalStateException If no conversation is open + * @throws IllegalStateException If no conversation is open, no user signed in, * or the current user may not delete the message. * * Reference: @@ -220,6 +221,7 @@ class MessageController( * Whether the current user may delete [message]. * * @param message The message to check. + * @return `true` if the current user may delete the message, `false` if otherwise. * * Reference: * Anthropic. (2026). Claude Code (Claude Opus 5.5) [Large language model]. @@ -247,7 +249,7 @@ class MessageController( * Changed with the help of this AI tool. * Prompts: * - "Now on the notification page as well. Please also remove the profile duplication bug. - * Also please fix the way the admins work since it seems all admins share an account. One + * Also, please fix the way the admins work since it seems all admins share an account. One * more thing is to fix the notification page so that the spacing looks right." * - Answers chosen when the AI asked how to do this: "Merge repeated contacts" and "Separate * chats per admin". @@ -295,7 +297,7 @@ class MessageController( * Changed with the help of this AI tool. * Prompts: * - "Now on the notification page as well. Please also remove the profile duplication bug. - * Also please fix the way the admins work since it seems all admins share an account. One + * Also, please fix the way the admins work since it seems all admins share an account. One * more thing is to fix the notification page so that the spacing looks right." * - Answers chosen when the AI asked how to do this: "Merge repeated contacts" and "Separate * chats per admin". @@ -340,7 +342,7 @@ class MessageController( * Changed with the help of this AI tool. * Prompts: * - "Now on the notification page as well. Please also remove the profile duplication bug. - * Also please fix the way the admins work since it seems all admins share an account. One + * Also, please fix the way the admins work since it seems all admins share an account. One * more thing is to fix the notification page so that the spacing looks right." * - Answers chosen when the AI asked how to do this: "Merge repeated contacts" and "Separate * chats per admin". diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/controller/MessageNotificationController.kt b/code/app/src/main/java/com/example/lambda_bbb_events/controller/MessageNotificationController.kt index 4f065a1e..86854469 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/controller/MessageNotificationController.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/controller/MessageNotificationController.kt @@ -41,19 +41,19 @@ class MessageNotificationController( * @param conversation Conversation containing the message. * @param message Incoming message. * @return True if notifications are permitted. - * - * Reference: - * Anthropic. (2026). Claude Code (Claude Opus 5.5) [Large language model]. - * https://claude.com/claude-code - * Changed with the help of this AI tool. - * Prompts: - * - "Now on the notification page as well. Please also remove the profile duplication bug. - * Also please fix the way the admins work since it seems all admins share an account. One - * more thing is to fix the notification page so that the spacing looks right." - * - Answers chosen when the AI asked how to do this: "Merge repeated contacts" and "Separate - * chats per admin". */ suspend fun shouldNotify( +// Reference: +// Anthropic. (2026). Claude Code (Claude Opus 5.5) [Large language model]. +// https://claude.com/claude-code +// Changed with the help of this AI tool. +// Prompts: +// - "Now on the notification page as well. Please also remove the profile duplication bug. +// Also, please fix the way the admins work since it seems all admins share an account. One +// more thing is to fix the notification page so that the spacing looks right." +// - Answers chosen when the AI asked how to do this: "Merge repeated contacts" and "Separate +// chats per admin". + conversation: Conversation, message: Message ): Boolean { diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/controller/NotificationController.kt b/code/app/src/main/java/com/example/lambda_bbb_events/controller/NotificationController.kt index 9c6f2879..c19d7c48 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/controller/NotificationController.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/controller/NotificationController.kt @@ -1,5 +1,6 @@ package com.example.lambda_bbb_events.controller + /* * builds notifications and verifies if app and user preference both have notification enabled */ @@ -21,7 +22,9 @@ import com.example.lambda_bbb_events.model.notification.NotificationCategory import com.example.lambda_bbb_events.model.notification.NotificationMode /** - * Builds and displays notifications + * Builds notification and delivery as wel as preferences and history + * + * Checks user and Android notification settings before displaying notifications. * * @property context Context used for system services * @property users Used to verify user notification preference @@ -44,6 +47,7 @@ class NotificationController( /** * Shows a notification if the user and system both allow it. * @param notification The notification content. + * @param category Category used to determine the delivery. */ fun showNotification( notification: Notification, @@ -85,6 +89,14 @@ class NotificationController( } } + /** + * Helper function that checks notification permission and builds the notification. + * + * High priority notifications go to a separate channel ID. + * + * @param notification The notification content. + * @param mode The notification delivery mode. + */ private fun postNotification( notification: Notification, mode: NotificationMode @@ -177,7 +189,12 @@ class NotificationController( } } - /** Observes changes to the saved notification history for [userId]. */ + /** + * Observes changes to the notification history for a user. + * + * @param userId ID of the user whose notification history is observed. + * @return A flow of the user's notification history. + */ fun observeHistory(userId: String) = historyStore.observeHistory(userId) @@ -189,7 +206,13 @@ class NotificationController( historyStore.clear(userId) } - /** Returns the delivery mode for the given user and notification category. */ + /** + * Returns the delivery mode for a user's notification category. + * + * @param userId ID of the user whose preference is retrieved. + * @param category Notification category. + * @return The saved notification delivery mode. + */ fun getCategoryMode( userId: String, category: NotificationCategory @@ -197,7 +220,12 @@ class NotificationController( return categoryStore.getMode(userId, category) } - /** Saves a category delivery preference for the signed-in user. */ + /** + * Saves a notification delivery preference for the signed-in user. + * + * @param category Notification category. + * @param mode Delivery mode to save. + */ fun setCategoryMode( category: NotificationCategory, mode: NotificationMode diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/controller/ReservationController.kt b/code/app/src/main/java/com/example/lambda_bbb_events/controller/ReservationController.kt index 9f67f738..0daacd7e 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/controller/ReservationController.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/controller/ReservationController.kt @@ -12,8 +12,8 @@ import java.time.LocalDate enum class ReservationFilter { ALL, // all reservations UPCOMING, // status: pending or confirmed and the stay has not ended - PAST, // status: not cancelled or rejected and the stay has ended - CANCELLED // status: cancelled by the entrant or rejected by the owner + PAST, // status: not canceled or rejected and the stay has ended + CANCELLED // status: canceled by the entrant or rejected by the owner } /** @@ -36,7 +36,7 @@ class ReservationController( } /** - * Cancels a reservation by updating its status to CANCELLED. + * Cancels a reservation by updating its status to "CANCELED". * * @param reservation The reservation to cancel. */ @@ -114,7 +114,7 @@ class ReservationController( * @param filter The filter of reservations to return. * @return The list of matching reservations. */ - suspend fun getReservationsForCampsite( + fun getReservationsForCampsite( campsiteId: String, filter: ReservationFilter ): List { diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/controller/ReviewController.kt b/code/app/src/main/java/com/example/lambda_bbb_events/controller/ReviewController.kt index 7df91ed1..832d7917 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/controller/ReviewController.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/controller/ReviewController.kt @@ -117,10 +117,7 @@ class ReviewController( * deleting it failed. */ suspend fun deleteReview(review: Review, user: User?): Boolean { - if (!canDelete(review, user)) { - return false - } - return try { + return canDelete(review, user) && try { reviewRepository.delete(review.reviewId) true } catch (_: Exception) { diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/controller/ReviewReactionController.kt b/code/app/src/main/java/com/example/lambda_bbb_events/controller/ReviewReactionController.kt index 796446e4..2073518d 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/controller/ReviewReactionController.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/controller/ReviewReactionController.kt @@ -17,6 +17,7 @@ class ReviewReactionController( * Checks if a user can react to reviews. Anyone who is signed in can. * * @param user The user, or `null` if nobody is signed in. + * @return `true` if the user is signed in, `false` otherwise. */ fun canReact(user: User?): Boolean = user != null @@ -25,6 +26,7 @@ class ReviewReactionController( * [ReviewReaction.EMOJIS]. Emojis nobody picked are left out. * * @param review The review. + * @return A map of emojis to their reaction counts. */ fun reactionCounts(review: Review): Map { val reactions = reactionRepository.getReactionsFor(review.reviewId) @@ -77,10 +79,7 @@ class ReviewReactionController( * @return `true` if the reaction was removed, `false` otherwise. */ suspend fun removeReaction(review: Review, user: User?): Boolean { - if (user == null) { - return false - } - return try { + return user != null && try { reactionRepository.delete(ReviewReaction.idFor(review.reviewId, user.deviceId)) true } catch (_: Exception) { diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/controller/ReviewReplyController.kt b/code/app/src/main/java/com/example/lambda_bbb_events/controller/ReviewReplyController.kt index 07e2e1a3..f54a5773 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/controller/ReviewReplyController.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/controller/ReviewReplyController.kt @@ -18,6 +18,7 @@ class ReviewReplyController( * Gets the replies to a review, oldest first, so they read like a conversation. * * @param review The review. + * @return The replies of the review (sorted by oldest to newest) */ fun getReplies(review: Review): List { return replyRepository.getRepliesFor(review.reviewId).sortedBy { it.repliedAt } @@ -27,6 +28,7 @@ class ReviewReplyController( * Checks if a user can reply to reviews. Anyone who is signed in can. * * @param user The user, or `null` if nobody is signed in. + * @return `true` if the user is signed in, `false` otherwise (null). */ fun canReply(user: User?): Boolean = user != null @@ -78,10 +80,7 @@ class ReviewReplyController( * deleting it failed. */ suspend fun deleteReply(reply: ReviewReply, user: User?): Boolean { - if (!canDeleteReply(reply, user)) { - return false - } - return try { + return canDeleteReply(reply, user) && try { replyRepository.delete(reply.replyId) true } catch (_: Exception) { diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/controller/UserController.kt b/code/app/src/main/java/com/example/lambda_bbb_events/controller/UserController.kt index 0cb85a26..5869cc95 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/controller/UserController.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/controller/UserController.kt @@ -44,8 +44,8 @@ class UserController( val hasAccountOnDevice: Boolean get() = userRepository.getCachedUser(deviceId) != null - // use this var for signed in user. only use inside the main app when a user exists - // so we dont need to consider null exceptions + // use this var for signed-in user. only use inside the main app when a user exists + // so we don't need to consider null exceptions /** The signed-in user; throws if none exists. */ val user: User get() = currentUser ?: error("No signed-in user") @@ -112,6 +112,7 @@ class UserController( saveLoggedOut(true) } + /** Save logged out value */ private fun saveLoggedOut(value: Boolean) { loggedOut = value sessionStore.loggedOut = value @@ -187,13 +188,13 @@ class UserController( /** * Syncs the result of Android's notification permission prompt shown at app launch. - * Uses the account on this device even if the user is logged out, because the + * Uses preference of the account on this device even if the user is logged out, because the * prompt appears before login. * * Updates for cases where notification setting is desynced with app permission when user * changes permission from android settings before relaunch * - * @param allow`true` if the user allowed notifications in app settings, `false` if they denied. + * @param allow `true` if the user allowed notifications in app settings, `false` if they denied. */ suspend fun syncNotificationPermissionFromSystem(allow: Boolean) { val account = userRepository.getCachedUser(deviceId) ?: return @@ -225,6 +226,9 @@ class UserController( /** * Checks if the name, email, and phone fields are blank. * + * @param name The user's name. + * @param email The user's email address. + * @param phone The user's phone number. * @return `true` if they are not blank (valid), `false` otherwise. */ private fun isValidProfile(name: String, email: String, phone: String): Boolean { @@ -273,7 +277,7 @@ class UserController( * Removes another user's profile. Only admins can remove profiles, and they cannot * remove their own this way; see [deleteAccount] for that. * - * Only the profile is removed. The user's lotteries should be cancelled and their + * Only the profile is removed. The user's lotteries should be canceled and their * campsites archived first, with [LotteryController.cancelLotteriesOfDeletedOwner] and * [CampsiteController.archiveCampsitesByOwner], so they are not left without an owner. * @@ -337,7 +341,7 @@ class UserController( * Deletes the current user's own account. Admins remove other users' accounts with * [removeUser]. * - * Only the account is deleted. The user's lotteries should be cancelled and their + * Only the account is deleted. The user's lotteries should be canceled and their * campsites archived first, with [LotteryController.cancelLotteriesOfDeletedOwner] and * [CampsiteController.archiveCampsitesByOwner], so they are not left without an owner. * From ed3c30cbd0014c1f94e6655fa5550d9a1d6eec05 Mon Sep 17 00:00:00 2001 From: tapst0rm <104149744+tapst0rm@users.noreply.github.com> Date: Sat, 28 Nov 2026 22:01:29 -0600 Subject: [PATCH 2/3] fixed package name for admin and message models --- .../lambda_bbb_events/controller/AdminLogController.kt | 4 ++-- .../example/lambda_bbb_events/controller/LotteryController.kt | 2 +- .../example/lambda_bbb_events/controller/MessageController.kt | 4 ++-- .../controller/MessageNotificationController.kt | 4 ++-- .../com/example/lambda_bbb_events/model/admin/AdminLog.kt | 2 +- .../example/lambda_bbb_events/model/message/Conversation.kt | 4 ++-- .../com/example/lambda_bbb_events/model/message/Message.kt | 2 +- .../lambda_bbb_events/model/repository/AdminRepository.kt | 4 ++-- .../model/repository/ConversationRepository.kt | 2 +- .../lambda_bbb_events/model/repository/LotteryRepository.kt | 2 +- .../lambda_bbb_events/model/repository/MessageRepository.kt | 4 ++-- .../model/services/IncomingMessageListener.kt | 4 ++-- .../view/ui/admin_screens/AdminLogsScreen.kt | 4 ++-- .../lambda_bbb_events/view/ui/components/logs/AdminLogCard.kt | 4 ++-- .../view/ui/components/logs/AdminLogDialog.kt | 4 ++-- .../view/ui/components/logs/LogTabSelector.kt | 2 +- .../view/ui/components/messaging/ConversationCard.kt | 2 +- .../view/ui/components/messaging/MessageBubble.kt | 2 +- .../view/ui/user_screens/notification/ChatRoute.kt | 2 +- .../view/ui/user_screens/notification/ChatScreen.kt | 2 +- .../view/ui/user_screens/notification/MessageContacts.kt | 2 +- .../view/ui/user_screens/notification/NotificationsScreen.kt | 3 +-- .../lambda_bbb_events/controller/LotteryControllerUnitTest.kt | 2 +- .../lambda_bbb_events/model/message/MessageUnitTest.kt | 1 - .../model/repository/LotteryRepositoryUnitTest.kt | 2 +- .../model/repository/MessageRepositoryUnitTest.kt | 4 ++-- .../ui/user_screens/notification/MessageContactsUnitTest.kt | 2 +- 27 files changed, 37 insertions(+), 39 deletions(-) diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/controller/AdminLogController.kt b/code/app/src/main/java/com/example/lambda_bbb_events/controller/AdminLogController.kt index ff802c61..31fda6b6 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/controller/AdminLogController.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/controller/AdminLogController.kt @@ -1,7 +1,7 @@ package com.example.lambda_bbb_events.controller -import com.example.lambda_bbb_events.model.AdminLog -import com.example.lambda_bbb_events.model.LogType +import com.example.lambda_bbb_events.model.admin.AdminLog +import com.example.lambda_bbb_events.model.admin.LogType import com.example.lambda_bbb_events.model.repository.AdminLogRepository /** diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/controller/LotteryController.kt b/code/app/src/main/java/com/example/lambda_bbb_events/controller/LotteryController.kt index 98ba2349..3b61660e 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/controller/LotteryController.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/controller/LotteryController.kt @@ -2,7 +2,7 @@ package com.example.lambda_bbb_events.controller import com.example.lambda_bbb_events.model.lottery.Lottery import com.example.lambda_bbb_events.model.lottery.LotteryStatus -import com.example.lambda_bbb_events.model.Message +import com.example.lambda_bbb_events.model.message.Message import com.example.lambda_bbb_events.model.repository.LotteryRepository import java.time.LocalDate import java.time.ZoneId diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/controller/MessageController.kt b/code/app/src/main/java/com/example/lambda_bbb_events/controller/MessageController.kt index 4c51fdcd..16ee323a 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/controller/MessageController.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/controller/MessageController.kt @@ -3,8 +3,8 @@ package com.example.lambda_bbb_events.controller import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.setValue -import com.example.lambda_bbb_events.model.Message -import com.example.lambda_bbb_events.model.Conversation +import com.example.lambda_bbb_events.model.message.Message +import com.example.lambda_bbb_events.model.message.Conversation import com.example.lambda_bbb_events.model.message.ConversationType import com.example.lambda_bbb_events.model.repository.MessageRepository import com.example.lambda_bbb_events.model.repository.ConversationRepository diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/controller/MessageNotificationController.kt b/code/app/src/main/java/com/example/lambda_bbb_events/controller/MessageNotificationController.kt index 86854469..808b0f17 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/controller/MessageNotificationController.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/controller/MessageNotificationController.kt @@ -13,8 +13,8 @@ import androidx.core.app.NotificationManagerCompat import androidx.core.content.ContextCompat import com.example.lambda_bbb_events.MainActivity import com.example.lambda_bbb_events.R -import com.example.lambda_bbb_events.model.Conversation -import com.example.lambda_bbb_events.model.Message +import com.example.lambda_bbb_events.model.message.Conversation +import com.example.lambda_bbb_events.model.message.Message import com.example.lambda_bbb_events.model.repository.NotificationPreferenceRepository /** diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/model/admin/AdminLog.kt b/code/app/src/main/java/com/example/lambda_bbb_events/model/admin/AdminLog.kt index a431d0f9..491e132c 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/model/admin/AdminLog.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/model/admin/AdminLog.kt @@ -1,4 +1,4 @@ -package com.example.lambda_bbb_events.model +package com.example.lambda_bbb_events.model.admin /** * Represents the types of logs available to an administrator. diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/model/message/Conversation.kt b/code/app/src/main/java/com/example/lambda_bbb_events/model/message/Conversation.kt index d9a7d131..ff5ce92d 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/model/message/Conversation.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/model/message/Conversation.kt @@ -1,6 +1,5 @@ -package com.example.lambda_bbb_events.model +package com.example.lambda_bbb_events.model.message -import com.example.lambda_bbb_events.model.message.ConversationType import com.google.firebase.Timestamp /* @@ -9,6 +8,7 @@ import com.google.firebase.Timestamp * https://claude.com/claude-code * This whole file was written with the help of this AI tool. * Prompts: + * Prompts: * - "Now on the notification page as well. Please also remove the profile duplication bug. Also * please fix the way the admins work since it seems all admins share an account. One more thing * is to fix the notification page so that the spacing looks right." diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/model/message/Message.kt b/code/app/src/main/java/com/example/lambda_bbb_events/model/message/Message.kt index e714ba8f..749a9c98 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/model/message/Message.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/model/message/Message.kt @@ -1,4 +1,4 @@ -package com.example.lambda_bbb_events.model +package com.example.lambda_bbb_events.model.message import com.google.firebase.Timestamp diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/model/repository/AdminRepository.kt b/code/app/src/main/java/com/example/lambda_bbb_events/model/repository/AdminRepository.kt index ab5d839b..615d0e5e 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/model/repository/AdminRepository.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/model/repository/AdminRepository.kt @@ -1,7 +1,7 @@ package com.example.lambda_bbb_events.model.repository -import com.example.lambda_bbb_events.model.AdminLog -import com.example.lambda_bbb_events.model.LogType +import com.example.lambda_bbb_events.model.admin.AdminLog +import com.example.lambda_bbb_events.model.admin.LogType import com.google.firebase.Timestamp import com.google.firebase.firestore.DocumentSnapshot import com.google.firebase.firestore.FirebaseFirestore diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/model/repository/ConversationRepository.kt b/code/app/src/main/java/com/example/lambda_bbb_events/model/repository/ConversationRepository.kt index 9276d84c..ba4ec98b 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/model/repository/ConversationRepository.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/model/repository/ConversationRepository.kt @@ -1,6 +1,6 @@ package com.example.lambda_bbb_events.model.repository -import com.example.lambda_bbb_events.model.Conversation +import com.example.lambda_bbb_events.model.message.Conversation import com.example.lambda_bbb_events.model.message.ConversationType import com.example.lambda_bbb_events.model.user.UserRole import com.google.firebase.Firebase diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/model/repository/LotteryRepository.kt b/code/app/src/main/java/com/example/lambda_bbb_events/model/repository/LotteryRepository.kt index 93fca79a..72fb81b5 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/model/repository/LotteryRepository.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/model/repository/LotteryRepository.kt @@ -5,7 +5,7 @@ import com.example.lambda_bbb_events.model.lottery.Lottery import com.example.lambda_bbb_events.model.lottery.LotteryStatus import com.example.lambda_bbb_events.model.lottery.WaitlistEntry import com.example.lambda_bbb_events.model.lottery.WaitlistStatus -import com.example.lambda_bbb_events.model.Message +import com.example.lambda_bbb_events.model.message.Message import com.example.lambda_bbb_events.model.reservation.Reservation import com.google.firebase.Firebase import com.google.firebase.firestore.DocumentSnapshot diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/model/repository/MessageRepository.kt b/code/app/src/main/java/com/example/lambda_bbb_events/model/repository/MessageRepository.kt index 74f1188f..2049db53 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/model/repository/MessageRepository.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/model/repository/MessageRepository.kt @@ -1,7 +1,7 @@ package com.example.lambda_bbb_events.model.repository -import com.example.lambda_bbb_events.model.Conversation -import com.example.lambda_bbb_events.model.Message +import com.example.lambda_bbb_events.model.message.Conversation +import com.example.lambda_bbb_events.model.message.Message import com.example.lambda_bbb_events.model.lottery.Lottery import com.example.lambda_bbb_events.model.lottery.LotteryStatus import com.example.lambda_bbb_events.model.lottery.WaitlistEntry diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/model/services/IncomingMessageListener.kt b/code/app/src/main/java/com/example/lambda_bbb_events/model/services/IncomingMessageListener.kt index 20dd78e1..b154af18 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/model/services/IncomingMessageListener.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/model/services/IncomingMessageListener.kt @@ -4,8 +4,8 @@ import android.content.Context import android.util.Log import com.example.lambda_bbb_events.controller.MessageController import com.example.lambda_bbb_events.controller.MessageNotificationController -import com.example.lambda_bbb_events.model.Conversation -import com.example.lambda_bbb_events.model.Message +import com.example.lambda_bbb_events.model.message.Conversation +import com.example.lambda_bbb_events.model.message.Message import com.google.firebase.Firebase import com.google.firebase.Timestamp import com.google.firebase.firestore.FirebaseFirestore diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/admin_screens/AdminLogsScreen.kt b/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/admin_screens/AdminLogsScreen.kt index 54dce391..8f15637f 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/admin_screens/AdminLogsScreen.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/admin_screens/AdminLogsScreen.kt @@ -13,8 +13,8 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import androidx.navigation.NavController import com.example.lambda_bbb_events.controller.AppControllers -import com.example.lambda_bbb_events.model.AdminLog -import com.example.lambda_bbb_events.model.LogType +import com.example.lambda_bbb_events.model.admin.AdminLog +import com.example.lambda_bbb_events.model.admin.LogType import com.example.lambda_bbb_events.model.user.UserRole import com.example.lambda_bbb_events.view.ui.components.admin.NoAccessMessage import com.example.lambda_bbb_events.view.ui.components.logs.AdminLogCard diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/components/logs/AdminLogCard.kt b/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/components/logs/AdminLogCard.kt index d6290356..f148bde8 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/components/logs/AdminLogCard.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/components/logs/AdminLogCard.kt @@ -15,8 +15,8 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp -import com.example.lambda_bbb_events.model.AdminLog -import com.example.lambda_bbb_events.model.LogType +import com.example.lambda_bbb_events.model.admin.AdminLog +import com.example.lambda_bbb_events.model.admin.LogType import java.text.SimpleDateFormat import java.util.Date import java.util.Locale diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/components/logs/AdminLogDialog.kt b/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/components/logs/AdminLogDialog.kt index 0ce060a1..c072c6c4 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/components/logs/AdminLogDialog.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/components/logs/AdminLogDialog.kt @@ -7,8 +7,8 @@ import androidx.compose.material3.* import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp -import com.example.lambda_bbb_events.model.AdminLog -import com.example.lambda_bbb_events.model.LogType +import com.example.lambda_bbb_events.model.admin.AdminLog +import com.example.lambda_bbb_events.model.admin.LogType /** * Displays the complete details of an administrative log. diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/components/logs/LogTabSelector.kt b/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/components/logs/LogTabSelector.kt index 8ae78fb4..2e798fab 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/components/logs/LogTabSelector.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/components/logs/LogTabSelector.kt @@ -13,7 +13,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.semantics.Role import androidx.compose.ui.unit.dp -import com.example.lambda_bbb_events.model.LogType +import com.example.lambda_bbb_events.model.admin.LogType /** * Displays a segmented tab selector for the admin logs screen. diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/components/messaging/ConversationCard.kt b/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/components/messaging/ConversationCard.kt index 5ceed82c..f5b30a77 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/components/messaging/ConversationCard.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/components/messaging/ConversationCard.kt @@ -18,7 +18,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp -import com.example.lambda_bbb_events.model.Conversation +import com.example.lambda_bbb_events.model.message.Conversation import com.example.lambda_bbb_events.view.ui.components.common.ProfilePicture import java.text.SimpleDateFormat diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/components/messaging/MessageBubble.kt b/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/components/messaging/MessageBubble.kt index 8d92450d..67997e20 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/components/messaging/MessageBubble.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/components/messaging/MessageBubble.kt @@ -25,7 +25,7 @@ import androidx.compose.ui.platform.testTag import androidx.compose.ui.text.font.FontStyle import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.unit.dp -import com.example.lambda_bbb_events.model.Message +import com.example.lambda_bbb_events.model.message.Message import java.text.SimpleDateFormat /** diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/user_screens/notification/ChatRoute.kt b/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/user_screens/notification/ChatRoute.kt index ebdb6eec..819150e0 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/user_screens/notification/ChatRoute.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/user_screens/notification/ChatRoute.kt @@ -10,7 +10,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.navigation.NavController import com.example.lambda_bbb_events.controller.AppControllers -import com.example.lambda_bbb_events.model.Conversation +import com.example.lambda_bbb_events.model.message.Conversation import com.example.lambda_bbb_events.model.message.ConversationType import com.example.lambda_bbb_events.model.repository.MessageRepository import kotlinx.coroutines.CancellationException diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/user_screens/notification/ChatScreen.kt b/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/user_screens/notification/ChatScreen.kt index 37776fab..da7d9e99 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/user_screens/notification/ChatScreen.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/user_screens/notification/ChatScreen.kt @@ -12,7 +12,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import com.example.lambda_bbb_events.controller.MessageController -import com.example.lambda_bbb_events.model.Message +import com.example.lambda_bbb_events.model.message.Message import com.example.lambda_bbb_events.view.ui.components.profile.ShowAlertDialog import androidx.navigation.NavController import com.example.lambda_bbb_events.view.ui.components.common.ScreenTitle diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/user_screens/notification/MessageContacts.kt b/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/user_screens/notification/MessageContacts.kt index f5c7172b..68db097f 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/user_screens/notification/MessageContacts.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/user_screens/notification/MessageContacts.kt @@ -1,6 +1,6 @@ package com.example.lambda_bbb_events.view.ui.user_screens.notification -import com.example.lambda_bbb_events.model.Conversation +import com.example.lambda_bbb_events.model.message.Conversation import com.example.lambda_bbb_events.model.message.ConversationType import com.example.lambda_bbb_events.model.message.MessagingAccess import com.example.lambda_bbb_events.model.user.User diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/user_screens/notification/NotificationsScreen.kt b/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/user_screens/notification/NotificationsScreen.kt index f9597144..5e8b813c 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/user_screens/notification/NotificationsScreen.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/view/ui/user_screens/notification/NotificationsScreen.kt @@ -10,13 +10,12 @@ import androidx.compose.ui.Modifier import androidx.navigation.NavController import com.example.lambda_bbb_events.controller.MessageController import com.example.lambda_bbb_events.controller.NotificationPreferenceController -import com.example.lambda_bbb_events.model.Conversation +import com.example.lambda_bbb_events.model.message.Conversation import com.example.lambda_bbb_events.model.repository.MessagingAccessRepository import com.example.lambda_bbb_events.model.user.User import com.example.lambda_bbb_events.view.ui.components.common.ScreenTitle import com.example.lambda_bbb_events.view.ui.components.navigation.BottomNavigationBar import kotlinx.coroutines.CancellationException -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.flowOf import com.example.lambda_bbb_events.controller.NotificationController diff --git a/code/app/src/test/java/com/example/lambda_bbb_events/controller/LotteryControllerUnitTest.kt b/code/app/src/test/java/com/example/lambda_bbb_events/controller/LotteryControllerUnitTest.kt index 0d0528ac..1027f732 100644 --- a/code/app/src/test/java/com/example/lambda_bbb_events/controller/LotteryControllerUnitTest.kt +++ b/code/app/src/test/java/com/example/lambda_bbb_events/controller/LotteryControllerUnitTest.kt @@ -3,7 +3,7 @@ package com.example.lambda_bbb_events.controller import com.example.lambda_bbb_events.model.lottery.Lottery import com.example.lambda_bbb_events.model.lottery.LotteryStatus import com.example.lambda_bbb_events.model.lottery.WaitlistEntry -import com.example.lambda_bbb_events.model.Message +import com.example.lambda_bbb_events.model.message.Message import com.example.lambda_bbb_events.model.repository.LotteryRepository import io.mockk.coEvery import io.mockk.coVerify diff --git a/code/app/src/test/java/com/example/lambda_bbb_events/model/message/MessageUnitTest.kt b/code/app/src/test/java/com/example/lambda_bbb_events/model/message/MessageUnitTest.kt index 56a52a4a..02b56335 100644 --- a/code/app/src/test/java/com/example/lambda_bbb_events/model/message/MessageUnitTest.kt +++ b/code/app/src/test/java/com/example/lambda_bbb_events/model/message/MessageUnitTest.kt @@ -1,6 +1,5 @@ package com.example.lambda_bbb_events.model.message -import com.example.lambda_bbb_events.model.Message import com.google.firebase.Timestamp import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue diff --git a/code/app/src/test/java/com/example/lambda_bbb_events/model/repository/LotteryRepositoryUnitTest.kt b/code/app/src/test/java/com/example/lambda_bbb_events/model/repository/LotteryRepositoryUnitTest.kt index af2fa3f1..c31ea7c5 100644 --- a/code/app/src/test/java/com/example/lambda_bbb_events/model/repository/LotteryRepositoryUnitTest.kt +++ b/code/app/src/test/java/com/example/lambda_bbb_events/model/repository/LotteryRepositoryUnitTest.kt @@ -3,7 +3,7 @@ package com.example.lambda_bbb_events.model.repository import com.example.lambda_bbb_events.model.lottery.Lottery import com.example.lambda_bbb_events.model.lottery.WaitlistEntry import com.example.lambda_bbb_events.model.lottery.WaitlistStatus -import com.example.lambda_bbb_events.model.Message +import com.example.lambda_bbb_events.model.message.Message import com.example.lambda_bbb_events.model.reservation.Reservation import com.example.lambda_bbb_events.model.reservation.ReservationStatus import com.google.firebase.firestore.CollectionReference diff --git a/code/app/src/test/java/com/example/lambda_bbb_events/model/repository/MessageRepositoryUnitTest.kt b/code/app/src/test/java/com/example/lambda_bbb_events/model/repository/MessageRepositoryUnitTest.kt index 048f35f4..809978c8 100644 --- a/code/app/src/test/java/com/example/lambda_bbb_events/model/repository/MessageRepositoryUnitTest.kt +++ b/code/app/src/test/java/com/example/lambda_bbb_events/model/repository/MessageRepositoryUnitTest.kt @@ -1,7 +1,7 @@ package com.example.lambda_bbb_events.model.repository -import com.example.lambda_bbb_events.model.Conversation -import com.example.lambda_bbb_events.model.Message +import com.example.lambda_bbb_events.model.message.Conversation +import com.example.lambda_bbb_events.model.message.Message import com.example.lambda_bbb_events.model.message.ConversationType import com.google.firebase.Timestamp import com.google.firebase.firestore.DocumentReference diff --git a/code/app/src/test/java/com/example/lambda_bbb_events/view/ui/user_screens/notification/MessageContactsUnitTest.kt b/code/app/src/test/java/com/example/lambda_bbb_events/view/ui/user_screens/notification/MessageContactsUnitTest.kt index 3fb31ceb..cb3af120 100644 --- a/code/app/src/test/java/com/example/lambda_bbb_events/view/ui/user_screens/notification/MessageContactsUnitTest.kt +++ b/code/app/src/test/java/com/example/lambda_bbb_events/view/ui/user_screens/notification/MessageContactsUnitTest.kt @@ -1,6 +1,6 @@ package com.example.lambda_bbb_events.view.ui.user_screens.notification -import com.example.lambda_bbb_events.model.Conversation +import com.example.lambda_bbb_events.model.message.Conversation import com.example.lambda_bbb_events.model.message.ConversationType import com.example.lambda_bbb_events.model.message.MessagingAccess import com.example.lambda_bbb_events.model.user.Admin From 6d416bc780f4280e17ef65534a74454f8872b44b Mon Sep 17 00:00:00 2001 From: tapst0rm <104149744+tapst0rm@users.noreply.github.com> Date: Sat, 28 Nov 2026 22:54:38 -0600 Subject: [PATCH 3/3] Kdoc comments for around a third of model controller kdocs are done, working through model, committing now to save progress. --- .../model/campsite/AvailabilitySchedule.kt | 39 ++++++++-- .../model/campsite/Campsite.kt | 15 ++++ .../model/campsite/CampsiteFilters.kt | 5 ++ .../model/formatting/DateParsing.kt | 10 ++- .../model/formatting/PhoneNumber.kt | 4 + .../lambda_bbb_events/model/image/Image.kt | 20 ++++- .../model/local/NotificationCategoryStore.kt | 20 +++++ .../model/local/NotificationHistoryStore.kt | 17 +++++ .../model/local/RecentlyViewedStore.kt | 75 +++++++++++++++---- .../model/local/SessionStore.kt | 5 +- .../model/local/ThemePreferenceStore.kt | 8 +- .../model/lottery/Lottery.kt | 4 +- 12 files changed, 194 insertions(+), 28 deletions(-) diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/model/campsite/AvailabilitySchedule.kt b/code/app/src/main/java/com/example/lambda_bbb_events/model/campsite/AvailabilitySchedule.kt index 66e9f2c8..f970dd56 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/model/campsite/AvailabilitySchedule.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/model/campsite/AvailabilitySchedule.kt @@ -2,8 +2,13 @@ package com.example.lambda_bbb_events.model.campsite import java.time.LocalDate +/* + * Tracks campsite availability and manages bookings across date ranges. + */ + /** Tracks campsite availability by date alongside the date ranges of current bookings. */ data class AvailabilitySchedule ( + /** Availability by date, where 0 is available and 1 means booked. */ var dates: MutableMap = mutableMapOf(), ) { /** Booked date ranges indexed by the identifier supplied when booking. */ @@ -16,7 +21,13 @@ data class AvailabilitySchedule ( val maxDate: LocalDate? get() = dates.keys.maxOrNull() - /** Adds availability for [startDate] through [endDate], inclusive. A missing end date selects one day. */ + /** + * Adds availability for [startDate] through [endDate], inclusive. + * A missing end date selects one day. + * + * @param startDate The first date to make available. + * @param endDate The last date to make available, or null for one day. + */ fun addAvailableDates(startDate: LocalDate, endDate: LocalDate? = null) { val newEndDate = endDate ?: startDate var newDate = startDate @@ -34,6 +45,12 @@ data class AvailabilitySchedule ( * Books the days from startDate to endDate for one person, leaving every other day open. * Fails if any of those days is not offered or is already booked, or if the person * already holds a booking here. + * + * @param startDate The first date to book. + * @param endDate The last date to book, or set to null for booking only the start date. + * @param ownerID The identifier of the person making the booking. + * @return `true` if the booking was created, `false` if the dates are unavailable + * or the person already has a booking. */ fun addNewBooking(startDate: LocalDate, endDate: LocalDate? = null, ownerID: String): Boolean { val actualEnd = endDate ?: startDate @@ -47,6 +64,9 @@ data class AvailabilitySchedule ( /** * Frees only the days held by this person's booking. + * + * @param ownerID The identifier of the person whose booking should be canceled. + * @return `true` if a booking was canceled, `false` if the person has no booking. */ fun cancelBooking(ownerID: String): Boolean { val booking = currentBookings.remove(ownerID) ?: return false @@ -57,7 +77,11 @@ data class AvailabilitySchedule ( } /** - * Removes availability for [startDate] through [endDate], inclusive. A missing end date selects one day. + * Removes availability for [startDate] through [endDate], inclusive. + * A missing end date selects one day. + * + * @param startDate The first date to remove from availability. + * @param endDate The last date to remove from availability, or null for one day. */ fun removeAvailableDate(startDate: LocalDate, endDate: LocalDate? = null) { val newEndDate = endDate ?: startDate @@ -73,17 +97,20 @@ data class AvailabilitySchedule ( } /** + * Checks whether every day in the specified range is available. + * * True when every day from start to end is offered and not booked. Days outside the range * are ignored, so any open stretch can be booked around existing bookings. + * + * @param start The first date to check. + * @param end The last date to check. + * @return `true` if every day in range, is available, `false` if otherwise. */ fun isAvailable( start: LocalDate, end: LocalDate ): Boolean { - if (end.isBefore(start)) { - return false - } - return daysBetween(start, end).all { dates[it] == 0 } + return !end.isBefore(start) && daysBetween(start, end).all { dates[it] == 0 } } private fun daysBetween(start: LocalDate, end: LocalDate): Sequence { diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/model/campsite/Campsite.kt b/code/app/src/main/java/com/example/lambda_bbb_events/model/campsite/Campsite.kt index 69977bf2..58423874 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/model/campsite/Campsite.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/model/campsite/Campsite.kt @@ -49,6 +49,8 @@ data class Campsite( ) { /** * Whether the campsite has a real location. Campsites saved without one have 0, 0. + * + * @return `true` if the campsite has a location, `false` if otherwise. */ fun hasLocation(): Boolean = latitude != 0.0 || longitude != 0.0 @@ -56,9 +58,17 @@ data class Campsite( * Gets the total points the campsite has received from reviews: every reviewer's stars * added together, which is the average rating times the number of reviews. For example, * 30 reviews averaging 4.5 stars give 135 points. + * + * @return The total review points. */ fun totalPoints(): Float = rating * ratingCount + /** + * Checks whether this campsite is equal to another object. + * + * @param other The object to compare with 'this' campsite. + * @return `true` if the objects are equal, `false` otherwise. + */ override fun equals(other: Any?): Boolean { if (this === other) return true if (other !is Campsite) return false @@ -68,6 +78,11 @@ data class Campsite( campsiteName == other.campsiteName } + /** + * Generates a hash code for this campsite. + * + * @return The hash code of this campsite. + */ override fun hashCode(): Int { var result = campsiteId.hashCode() result = 31 * result + ownerId.hashCode() diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/model/campsite/CampsiteFilters.kt b/code/app/src/main/java/com/example/lambda_bbb_events/model/campsite/CampsiteFilters.kt index 961f63e2..3969a0a0 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/model/campsite/CampsiteFilters.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/model/campsite/CampsiteFilters.kt @@ -6,6 +6,11 @@ import java.time.LocalDate import java.time.ZoneId import java.util.Date +/* + * Defines filters for browsing campsites and checks campsite availability + * through lotteries. + */ + /** * The filters applied when browsing campsites. By default, nothing is filtered. * diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/model/formatting/DateParsing.kt b/code/app/src/main/java/com/example/lambda_bbb_events/model/formatting/DateParsing.kt index 19874633..de575218 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/model/formatting/DateParsing.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/model/formatting/DateParsing.kt @@ -3,6 +3,10 @@ package com.example.lambda_bbb_events.model.formatting import java.time.LocalDate import java.time.format.DateTimeParseException +/* + * Provides date parsing text into LocalDate values. + */ + /** * Reads a date written as "yyyy-MM-dd", such as "2026-07-01". * @@ -10,9 +14,9 @@ import java.time.format.DateTimeParseException * @return The date, or `null` if the text is not a valid date. */ fun parseDateOrNull(text: String): LocalDate? { - try { - return LocalDate.parse(text) + return try { + LocalDate.parse(text) } catch (e: DateTimeParseException) { - return null + null } } diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/model/formatting/PhoneNumber.kt b/code/app/src/main/java/com/example/lambda_bbb_events/model/formatting/PhoneNumber.kt index 781cad5c..ebae6c50 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/model/formatting/PhoneNumber.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/model/formatting/PhoneNumber.kt @@ -217,6 +217,9 @@ fun formatLocalNumber(country: CountryCode, digits: String): String { /** * Gets the most digits a local number can have in [country]. Phone numbers have at most * 15 digits including the country code, and Canadian and US numbers always have 10. + * + * @param country The country the number belongs to. + * @return The maximum number of local digits. */ fun maxLocalNumberLength(country: CountryCode): Int { if (country.dialCode == "+1") { @@ -230,6 +233,7 @@ fun maxLocalNumberLength(country: CountryCode): Int { * Gets an example mobile number for [country], formatted for display, such as * "7400 123456" for the United Kingdom. * + * @param country The country to get an example number for. * @return The example, or an empty string if none is known for the country. */ fun exampleLocalNumber(country: CountryCode): String { diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/model/image/Image.kt b/code/app/src/main/java/com/example/lambda_bbb_events/model/image/Image.kt index 3870af60..ff6700ba 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/model/image/Image.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/model/image/Image.kt @@ -26,13 +26,26 @@ data class ImageMetaData( val focusY: Float = 0.5f ) -/** Stores one encoded image band and its position in the reconstructed image. */ +/** + * Stores one encoded image band and its position in the reconstructed image. + * + * @property imageId The ID of the image this chunk belongs to. + * @property priority The position of this chunk in the reconstructed image. + * @property bandHeight The height of this image band. + * @property imageBytes The encoded image data. + */ data class ImageChunk( val imageId: String = "", val priority: Int = 0, val bandHeight: Int = 0, val imageBytes: ByteArray = byteArrayOf() ) { + /** + * Checks whether this image chunk is equal to another object. + * + * @param other The object to compare with this image chunk. + * @return `true` if both chunks have the same image ID and priority, `false` otherwise. + */ override fun equals(other: Any?): Boolean { if (this === other) return true if (other !is ImageChunk) return false @@ -40,6 +53,11 @@ data class ImageChunk( return imageId == other.imageId && priority == other.priority } + /** + * Generates a hash code based on the image ID and priority. + * + * @return The hash code of this image chunk. + */ override fun hashCode(): Int { var result = imageId.hashCode() result = 31 * result + priority diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/model/local/NotificationCategoryStore.kt b/code/app/src/main/java/com/example/lambda_bbb_events/model/local/NotificationCategoryStore.kt index e7c78629..b43e8fcc 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/model/local/NotificationCategoryStore.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/model/local/NotificationCategoryStore.kt @@ -7,6 +7,8 @@ import java.util.concurrent.TimeUnit /** * Stores notification category preferences for each user. + * + * @param context The Android context for accessing preferences. */ class NotificationCategoryStore(context: Context) { @@ -24,6 +26,10 @@ class NotificationCategoryStore(context: Context) { /** * Retrieves the notification mode for a category. + * + * @param userId The ID of the user. + * @param category The notification category. + * @return The saved notification mode, or the default mode if none is saved. */ fun getMode( userId: String, @@ -49,6 +55,10 @@ class NotificationCategoryStore(context: Context) { /** * Updates a notification category preference. + * + * @param userId The ID of the user. + * @param category The notification category. + * @param mode The notification mode to save. */ fun setMode( userId: String, @@ -68,6 +78,9 @@ class NotificationCategoryStore(context: Context) { /** * Records a notification for a weekly summary. + * + * @param userId The ID of the user. + * @param category The notification category. */ fun addPending( userId: String, @@ -95,6 +108,10 @@ class NotificationCategoryStore(context: Context) { /** * Returns the pending count if a weekly summary is due. + * + * @param userId The ID of the user. + * @param category The notification category. + * @return The pending count if a weekly summary is due, or 0 if otherwise. */ fun getDueCount( userId: String, @@ -126,6 +143,9 @@ class NotificationCategoryStore(context: Context) { /** * Clears pending notifications after displaying a summary. + * + * @param userId The ID of the user. + * @param category The notification category. */ fun clearPending( userId: String, diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/model/local/NotificationHistoryStore.kt b/code/app/src/main/java/com/example/lambda_bbb_events/model/local/NotificationHistoryStore.kt index 3d460518..deb363a3 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/model/local/NotificationHistoryStore.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/model/local/NotificationHistoryStore.kt @@ -8,8 +8,14 @@ import android.content.SharedPreferences import org.json.JSONArray import org.json.JSONObject +/* + * Stores notification history locally for each user. + */ + /** * Stores notification history locally for each user. + * + * @param context The Android context used to access shared preferences. */ class NotificationHistoryStore(context: Context) { @@ -20,6 +26,9 @@ class NotificationHistoryStore(context: Context) { /** * Retrieves saved notifications for a user. + * + * @param userId The ID of the user. + * @return The user's saved notification history. */ fun getHistory(userId: String): List { @@ -43,6 +52,9 @@ class NotificationHistoryStore(context: Context) { /** * Saves a new notification. + * + * @param userId The ID of the user. + * @param notification The notification to save. */ fun add( userId: String, @@ -74,6 +86,9 @@ class NotificationHistoryStore(context: Context) { /** * Observes changes to notification history. + * + * @param userId The ID of the user. + * @return a flow that emits user's notification history whenever it changes. */ fun observeHistory(userId: String) = callbackFlow { @@ -101,6 +116,8 @@ class NotificationHistoryStore(context: Context) { /** * Clears the notification history for a user. + * + * @param userId The ID of the user. */ fun clear(userId: String) { diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/model/local/RecentlyViewedStore.kt b/code/app/src/main/java/com/example/lambda_bbb_events/model/local/RecentlyViewedStore.kt index 31335145..306ccc56 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/model/local/RecentlyViewedStore.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/model/local/RecentlyViewedStore.kt @@ -6,7 +6,7 @@ import android.database.sqlite.SQLiteDatabase import android.database.sqlite.SQLiteOpenHelper /* - * Stores the campsites the user has viewed on this device. + * Provides local storage for recently viewed campsites and device settings. */ /** @@ -38,16 +38,30 @@ class InMemoryRecentlyViewedStore : RecentlyViewedStore { /** When each campsite was last viewed, keyed by campsite ID. */ private val views = mutableMapOf() + + /** + * Loads the most recently viewed campsite IDs. + * + * @param limit The maximum number of IDs to load. + * @return The campsite IDs, sorted by most recently viewed. + */ override fun load(limit: Int): List { val newestFirst = views.entries.sortedByDescending { it.value } val ids = mutableListOf() - for (entry in newestFirst.take(limit)) { - ids.add(entry.key) + for ((key) in newestFirst.take(limit)) { + ids.add(key) } return ids } + /** + * Records a campsite view, keeping only the most recent views. + * + * @param campsiteId The ID of the viewed campsite. + * @param viewedAt The time the campsite was viewed, in milliseconds. + * @param limit The maximum number of views to keep. + */ override fun record(campsiteId: String, viewedAt: Long, limit: Int) { views[campsiteId] = viewedAt @@ -71,34 +85,52 @@ class InMemoryRecentlyViewedStore : RecentlyViewedStore { * * @param context The application context. * @param name The database file name, or `null` for a database held in memory. - * - * Reference: - * Anthropic. (2026). Claude Code (Claude Opus 5.5) [Large language model]. - * https://claude.com/claude-code - * Changed with the help of this AI tool (settings table, version 2 upgrade). - * Prompts: - * - "Okay so one thing I found was that dark mode doesn't stay if you select dark mode within - * the app. it disapears after app resets. Let's save it into the sqlite3 db we already have." - * - "Please make sure to also document and cite your changes." */ class LocalDatabase( + +// Reference: +// Anthropic. (2026). Claude Code (Claude Opus 5.5) [Large language model]. +// https://claude.com/claude-code +// Changed with the help of this AI tool (settings table, version 2 upgrade). +// Prompts: +// - "Okay so one thing I found was that dark mode doesn't stay if you select dark mode within +// the app. it disappears after app resets. Let's save it into the sqlite3 db we already have." +// - "Please make sure to also document and cite your changes." context: Context, name: String? = DATABASE_NAME ) : SQLiteOpenHelper(context, name, null, DATABASE_VERSION) { companion object { + /** The name of the local database file. */ const val DATABASE_NAME = "lambda_local.db" + + /** The current database version. */ const val DATABASE_VERSION = 2 + /** The recently viewed campsites table. */ const val RECENTLY_VIEWED_TABLE = "recently_viewed" + + /** The campsite ID column. */ const val COLUMN_CAMPSITE_ID = "campsite_id" + + /** The column with data when a campsite was viewed. */ const val COLUMN_VIEWED_AT = "viewed_at" + /** The device settings table. */ const val SETTINGS_TABLE = "settings" + + /** The setting's key column. */ const val COLUMN_KEY = "key" + + /** The setting's value column. */ const val COLUMN_VALUE = "value" } + /** + * Creates the recently viewed and settings tables. + * + * @param db The database in which to create the tables. + */ override fun onCreate(db: SQLiteDatabase) { db.execSQL( """ @@ -114,6 +146,10 @@ class LocalDatabase( /** * Adds the settings table to databases made before version 2, * keeping the recently viewed campsites already saved. + * + * @param db The database to upgrade. + * @param oldVersion The previous database version. + * @param newVersion The new database version. */ override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) { if (oldVersion < 2) { @@ -143,12 +179,18 @@ class LocalDatabase( * * Calls read and write the disk, so they should be made off the main thread. * - * @param database The local database to store views in. + * @property database The local database used to store campsite views. */ class SqliteRecentlyViewedStore( private val database: LocalDatabase ) : RecentlyViewedStore { + /** + * Loads the most recently viewed campsite IDs. + * + * @param limit The maximum number of IDs to load. + * @return The campsite IDs, sorted by most recently viewed. + */ override fun load(limit: Int): List { val ids = mutableListOf() val cursor = database.readableDatabase.query( @@ -168,6 +210,13 @@ class SqliteRecentlyViewedStore( return ids } + /** + * Records a campsite view, keeping only the most recent views. + * + * @param campsiteId The ID of the viewed campsite. + * @param viewedAt The time the campsite was viewed, in milliseconds. + * @param limit The maximum number of views to keep. + */ override fun record(campsiteId: String, viewedAt: Long, limit: Int) { val db = database.writableDatabase db.beginTransaction() diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/model/local/SessionStore.kt b/code/app/src/main/java/com/example/lambda_bbb_events/model/local/SessionStore.kt index 850889d8..e8328e44 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/model/local/SessionStore.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/model/local/SessionStore.kt @@ -20,7 +20,7 @@ interface SessionStore { /** * Keeps the logged out state in memory only. Used in tests, where nothing is saved. * - * @param loggedOut Whether the user starts logged out. + * @property loggedOut Whether the user is currently logged out. */ class InMemorySessionStore(override var loggedOut: Boolean = false) : SessionStore @@ -33,6 +33,9 @@ class SharedPreferencesSessionStore(context: Context) : SessionStore { private val preferences = context.getSharedPreferences("session", Context.MODE_PRIVATE) + /** + * Whether the user has logged out on this device. + */ override var loggedOut: Boolean get() = preferences.getBoolean(KEY_LOGGED_OUT, false) set(value) { diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/model/local/ThemePreferenceStore.kt b/code/app/src/main/java/com/example/lambda_bbb_events/model/local/ThemePreferenceStore.kt index 8f48fcd4..ff495dca 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/model/local/ThemePreferenceStore.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/model/local/ThemePreferenceStore.kt @@ -2,6 +2,9 @@ package com.example.lambda_bbb_events.model.local import android.content.ContentValues import android.database.sqlite.SQLiteDatabase +/* + * Stores and retrieves user's theme preference using the local SQLite database. + */ /** * Saves the theme the user picked in the app in the [LocalDatabase], @@ -15,7 +18,7 @@ import android.database.sqlite.SQLiteDatabase * startup so the first frame already uses the saved theme; [save] should be * made off the main thread. * - * @param database The local database to store the choice in. + * @property database The local database to store the user's theme choice in. * * Reference: * Anthropic. (2026). Claude Code (Claude Opus 5.5) [Large language model]. @@ -23,7 +26,7 @@ import android.database.sqlite.SQLiteDatabase * Written with the help of this AI tool. * Prompts: * - "Okay so one thing I found was that dark mode doesn't stay if you select dark mode within - * the app. it disapears after app resets. Let's save it into the sqlite3 db we already have." + * the app. it disappears after app resets. Let's save it into the sqlite3 db we already have." * - "Please make sure to also document and cite your changes." * - "And then add a third button to the settings as system settings." */ @@ -32,6 +35,7 @@ class SqliteThemePreferenceStore( ) { companion object { + /** The key used to store the user's theme preference in the settings. */ const val DARK_THEME_KEY = "dark_theme" private const val DARK = "dark" private const val LIGHT = "light" diff --git a/code/app/src/main/java/com/example/lambda_bbb_events/model/lottery/Lottery.kt b/code/app/src/main/java/com/example/lambda_bbb_events/model/lottery/Lottery.kt index 19df30fc..9fa9f4cd 100644 --- a/code/app/src/main/java/com/example/lambda_bbb_events/model/lottery/Lottery.kt +++ b/code/app/src/main/java/com/example/lambda_bbb_events/model/lottery/Lottery.kt @@ -14,7 +14,7 @@ enum class LotteryStatus { OPEN, // accepting entries CLOSED, // not accepting entries DRAWN, // lottery winners have been picked - CANCELLED // owner cancelled the lottery + CANCELLED // owner canceled the lottery } /** @@ -24,7 +24,7 @@ enum class LotteryStatus { * @property campsiteIds IDs of the campsites included in this lottery. Must not be empty. * @property ownerIds The IDs of the campsite owners listed in the lottery. * @property pendingOwnerIds Owners who were invited to the multiple campsite lottery but - * haven't accepted yet. The lottery registration is can open when this is empty. + * hasn't been accepted yet. The lottery registration is can open when this is empty. * @property registrationStart The date when entrants can start joining the waitlist. * @property registrationEnd The date when the waitlist stops accepting entrants. * @property bookingStart The date when winners can start booking.