feat: add membership renewal status filter #16299
Open
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.
Overview
This PR adds a renewal status filter to the membership UI, allowing lock managers to filter members by their membership renewal status. The filter supports:
Implementation Plan
The implementation includes changes to both backend (Locksmith API) and frontend (unlock-app):
Backend Changes
RenewalStatustype tolocksmith/src/operations/subscriptionOperations.tsapplyRenewalStatusFilter()function to filter keys based on subscription statusgetKeysByPage()inkeyOperations.tsto acceptrenewalStatusparameterkeyController.tsto extract and passrenewalStatusquery parameterrenewalStatusin API routesFrontend Changes
RenewalStatusenum toFilterBar.tsxMembers.tsxto managerenewalStatusstateconfig/locksmith.tsto includerenewalStatusparameter in API callsKey Features
✅ Filter only appears for recurring locks - The renewal status filter is conditionally rendered and only shows for locks with recurring/subscription payments enabled
✅ Works with existing filters - The renewal status filter works seamlessly alongside other filters (expiration, approval status)
✅ Pagination support - Pagination works correctly with the renewal status filter applied
✅ Comprehensive filtering - Supports multiple renewal status scenarios
Files Modified
locksmith/src/controllers/v2/keyController.tslocksmith/src/operations/subscriptionOperations.tslocksmith/src/operations/keyOperations.tslocksmith/src/routes/v2/keys.tsunlock-app/src/components/interface/locks/Manage/elements/FilterBar.tsxunlock-app/src/components/interface/locks/Manage/elements/Members.tsxunlock-app/src/config/locksmith.tsTesting
renewalStatusquery parameterRelated
This implements the membership renewal status filter feature as discussed in the issue.