-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Milestone
Description
NOTIF_UPD-6: Implement Backend Logic for Update Management with Enhanced User Cache
Description
Develop next-updates-admin and next-updates-user libraries for managing user updates in the backend. Enhance next-updates-user with a local caching mechanism for efficient retrieval of updates, reducing frequent queries to the Redis cache.
next-updates-admin Library
Purpose
Manage the creation and deletion of updates for users from an administrative perspective.
Key Methods
-
createUpdate:
- Purpose: Create a new update for a user.
- Parameters:
accountId(UUID),updateType(enum),updateContent(JSONB). - Functionality: Validates the input and uses
next-updates-cacheto store the update in the cache. - Type Safety: Ensures that
updateTypeandupdateContentalign with predefined types.
-
deleteUpdate:
- Purpose: Delete a specific update for a user.
- Parameters:
accountId(UUID),updateType(enum). - Functionality: Uses
next-updates-cacheto remove the specified update from the cache.
-
deleteAllUpdatesForUser:
- Purpose: Delete all updates associated with a specific user.
- Parameters:
accountId(UUID). - Functionality: Clears all updates for the given
accountIdfrom the cache.
Enhanced next-updates-user Library
Purpose
Enable users to retrieve their updates efficiently, using a local caching mechanism for optimized performance.
Enhanced Key Methods
-
fetchAllUpdates:
- Purpose: Retrieve all updates for the authenticated user and store them in a local cache.
- Functionality: Uses the JWT from the user's cookie to determine
accountId, fetches all updates usingnext-updates-cache, and stores them in the local cache. - Returns: A local cache object containing all updates for the user.
-
getSpecificUpdate:
- Purpose: Retrieve a specific type of update from the local cache.
- Parameters:
updateType(enum). - Functionality: Checks the local cache for the specified
updateTypeand retrieves the relevant update if available. - Returns: The specific update object or null if not available.
-
clearUpdate:
- Purpose: Clear a specific update from the local cache and the Redis cache.
- Parameters:
updateType(enum). - Functionality: Clears the specified update from both the local cache and using
next-updates-cache.
-
clearAllUpdates:
- Purpose: Clear all updates for the user from the local cache and the Redis cache.
- Functionality: Clears all updates from both the local cache and using
next-updates-cache.
Acceptance Criteria
- Effective Update Management:
next-updates-adminefficiently handles creation and deletion of updates. - Optimized User Retrieval:
next-updates-userminimizes Redis cache queries by using a local caching mechanism. - Type Safety and Validation: Input data is validated and conforms to predefined types and structures.
- Performance and Scalability: Both libraries perform well with a large volume of updates and users.
- Testing and Documentation: Comprehensive testing for reliability, along with detailed documentation on library usage.
Notes
- Prioritize the security of user data in
next-updates-user, implementing robust JWT-based authentication and authorization. - Ensure seamless integration with
next-updates-cachefor cache interactions. - The local caching mechanism in
next-updates-usershould be designed to handle synchronization issues with the Redis cache.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status