Conversation
Tag metadata
Test branch
Add user mantra count router to API
- Updated error message for duplicate series to clarify scope to time blocks. - Removed redundant functions for checking existing series in routines. - Adjusted series session resolution to include current plan details. - Added tests to ensure duplicate series can exist across different time blocks.
bookmark update
…lated services and views - Enhanced get_groups_paginated to accept exclude_group_ids for filtering out specific groups. - Updated list_public_groups to handle token validation and exclude joined groups based on the user's token. - Modified get_public_groups view to accept and pass the token for group filtering. - Added tests to ensure correct behavior for excluding joined groups based on user authentication.
Refactor series handling in routines service and repository
Add exclude_group_ids parameter to get_groups_paginated and update re…
- Added 'audience' field to PropsResponse model. - Updated retrieve_client_info function to include 'AUTH0_AUDIENCE' in the response. - Modified unit test to validate the new 'audience' field in the response.
…vices - Introduced mala_image_id and mala_image_url to the MantraCountSummaryDTO for enhanced mantra details. - Implemented _resolve_mala_image_fields function to extract mala image information. - Updated get_user_mantra_counts_service to include mala image data in the response. - Enhanced tests to cover new mala image fields and their resolution logic.
…ication - Added a new function to extract email from Auth0 payload, handling cases where the email is not directly present. - Updated the verify_auth0_token function to include a check for the 'kid' in the token header and improved error handling. - Ensured that the extracted email is added to the payload if it was not originally included.
Add mala image fields to MantraCountSummaryDTO and update related ser…
Enhance PropsResponse model and update client info retrieval
- Added a new `user_group_accumulators` table to track user participation in group accumulators, including foreign key relationships to `group_accumulators` and `users`. - Updated the `group_accumulator_history` model to include a reference to `user_group_accumulator_id`, allowing for better tracking of user contributions. - Enhanced service methods to manage user group accumulator sessions, including creation, retrieval, and soft deletion of user participation records. - Modified response models to include `is_joined` and `member_count` fields, providing clearer insights into user participation status and group dynamics. - Updated API endpoints to support new user session functionalities and ensure accurate data retrieval for group accumulators. - Added tests to verify the correct implementation of user participation tracking and associated metrics.
- Replaced the `get_enrolled_count_map_by_series_ids` function with `get_enrolled_count_map_by_group_and_series_ids` to accurately track enrollments based on both group and series IDs. - Updated relevant service methods and response models to incorporate the new enrollment count logic, ensuring accurate data representation in user series enrollment DTOs. - Enhanced tests to validate the changes in enrollment count retrieval and ensure correct functionality across affected components.
- Updated the `is_user_joined_group_accumulator` function to directly query the `group_accumulator_joins` table for user membership status, improving efficiency and clarity. - Modified the `get_joined_group_accumulator_ids_by_user` function to utilize the `group_accumulator_joins` table for retrieving joined group accumulator IDs, ensuring consistency in data retrieval methods.
- Introduced a new Bearer authentication scheme in the OpenAPI configuration to standardize security documentation. - Implemented a normalization function to consolidate HTTP bearer schemes into a single documented entry, improving clarity in API security. - Updated the API documentation generation to include the new security scheme, ensuring accurate representation of authentication requirements. - Refactored the scalar API documentation endpoint to utilize the new OpenAPI URL generation method.
- Updated the `delete_group_accumulator_user_service` to not only soft-delete the user's current session but also initiate a new active session, allowing users to continue participating and counting contributions. - Revised the docstring for clarity on the functionality of resetting user participation. - Adjusted the corresponding test to reflect the new behavior of starting a fresh participation session after deletion.
- Introduced `GroupAccumulatorDetailUserDTO` to encapsulate user-specific metrics such as total and today's counts, username, and avatar URL. - Updated `GroupAccumulatorDetailDTO` to include a user object instead of separate count fields, enhancing the response structure. - Refactored service methods to build and return the new user DTO, ensuring accurate user participation data is included in responses. - Enhanced tests to validate the inclusion of user details in the group accumulator service response when authenticated.
- Introduced `remove_group_accumulator_joins_for_group` function to delete join rows for all group accumulators associated with a user in a specified group, preserving user session history. - Integrated the new function into the `leave_group` service method to ensure proper cleanup of group accumulator joins when a user leaves a group. - Added unit tests to validate the functionality of the new removal method, ensuring it correctly deletes join rows without affecting user session data.
Group accumulation
…Model - Updated `AccumulatorGroupDTO` to replace `image_key` with `image` of type `ImageUrlModel`, enhancing the structure of group accumulator responses. - Modified the `get_accumulator_groups_service` to fetch the image URL using `get_image_url`, ensuring that the image is returned as a presigned URL instead of a raw key. - Adjusted tests to validate the new image handling in accumulator group responses, confirming that the image URL is correctly retrieved and included in the service output.
- Updated the `_series_to_dtos` function to retrieve and incorporate schedule details from plans, including start date, end date, and total days for each series. - Refactored the logic to build `GroupSeriesListItemDTO` instances with the new schedule data, ensuring accurate representation of series timelines. - Added a new test case to validate that the schedule information is correctly included in the series DTOs, confirming the integration of plan schedules into the response structure.
distinct day number only as already within series
Refactor accumulator response models and services to utilize ImageUrl…
…ation - Introduced `SeriesProgressDTO` and `SeriesPartnerDTO` to encapsulate progress tracking and partner details for series. - Updated various response models, including `SeriesDTO`, `UserSeriesEnrollmentDTO`, and `DashboardItemDTO`, to include progress and partner attributes. - Refactored service methods to compute and return series progress based on plan schedules. - Added tests to validate the integration of progress and partner information in series-related responses.
Add validation for plan schedules within series
- Added `get_language_filtered_series_plan_ids` to filter series plans based on language preferences. - Introduced `compute_user_series_progress` to calculate user progress in series, considering completed days. - Updated user service methods to utilize the new progress computation and filtering functions. - Enhanced tests to validate the new functionalities for series progress and language filtering.
…logic - Introduced a new endpoint `/plan-notification-content` to retrieve notification content based on user and plan IDs. - Implemented `resolve_plan_notification_content` function to handle the logic for fetching plan notification details. - Enhanced image URL resolution logic to ensure fallback mechanisms are in place for plan images. - Added tests to validate the new functionality and ensure proper handling of image URLs in notifications.
Enhance series response models to include progress and partner inform…
- Introduced `_enum_value` to convert enum and string representations to their corresponding string values. - Added `_normalize_platform` to standardize platform values to lowercase. - Updated `get_users_with_matching_timeblocks` to utilize these new functions for improved data consistency. - Created unit tests for both utility functions to ensure correct behavior across various input types.
- Renamed `upsert_push_device_token` to `delete_push_device_token_by_token` and updated its logic to remove conflicting tokens based on the provided token, with an option to exclude a specific ID. - Introduced `_upsert_push_device_token` in the service layer to handle the creation and updating of push device tokens, ensuring proper management of existing tokens and their states. - Updated tests to reflect changes in the repository and service methods, ensuring comprehensive coverage for the new functionality.
- Renamed `upsert_push_device_token` to `delete_push_device_token_by_token` and updated its logic to remove conflicting tokens while preserving the option to exclude a specific ID. - Introduced `_upsert_push_device_token` to handle the creation and updating of push device tokens, ensuring proper management of existing tokens and their states. - Updated service methods to utilize the new repository functions, enhancing the overall structure and clarity of push device token operations. - Added tests to validate the new functionality and ensure correct behavior in various scenarios, including token creation and updates.
Add utility functions for enum value handling and platform normalization
Refactor push device token management
- Changed the assignment of `source_id` in the `_resolve_recitation_sessions` function from `first_segment_id` to `text_id` to ensure correct data mapping. - Updated corresponding test assertions in `test_resolve_recitation_sessions_success` and `test_resolve_sessions_mixed_types` to reflect the new `source_id` assignment, ensuring tests accurately validate the expected behavior.
Update source_id references in recitation session handling
- Integrated APScheduler to manage daily cleanup of expired verses of the day. - Added configuration for verse retention period in `config.py`. - Implemented `cleanup_expired_verses_of_day` function to delete verses older than the specified expiry days. - Updated database interaction to support deletion of expired verses. - Created tests to validate the cleanup functionality and ensure correct behavior.
|
Too many files changed for review. ( Bypass the limit by tagging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
should fix : issue #855