Skip to content

Conversation

@Flash-Shivam
Copy link

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:

  • will_renew: Members whose subscriptions are active and will automatically renew
  • wont_renew_expired_card: Members whose payment method is expired
  • wont_renew_cancelled: Members who have cancelled their subscription
  • wont_renew_insufficient_funds: Members with insufficient funds for renewal

Implementation Plan

The implementation includes changes to both backend (Locksmith API) and frontend (unlock-app):

Backend Changes

  1. Add RenewalStatus type to locksmith/src/operations/subscriptionOperations.ts
  2. Implement applyRenewalStatusFilter() function to filter keys based on subscription status
  3. Update getKeysByPage() in keyOperations.ts to accept renewalStatus parameter
  4. Update keyController.ts to extract and pass renewalStatus query parameter
  5. Add validation for renewalStatus in API routes

Frontend Changes

  1. Add RenewalStatus enum to FilterBar.tsx
  2. Add renewal status dropdown to FilterBar component (conditional rendering for recurring locks only)
  3. Update Members.tsx to manage renewalStatus state
  4. Update Locksmith client in config/locksmith.ts to include renewalStatus parameter in API calls

Key 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.ts
  • locksmith/src/operations/subscriptionOperations.ts
  • locksmith/src/operations/keyOperations.ts
  • locksmith/src/routes/v2/keys.ts
  • unlock-app/src/components/interface/locks/Manage/elements/FilterBar.tsx
  • unlock-app/src/components/interface/locks/Manage/elements/Members.tsx
  • unlock-app/src/config/locksmith.ts

Testing

  • API endpoint accepts renewalStatus query parameter
  • API returns correct keys for each renewal status value
  • Filter dropdown only shows for locks with recurring payments
  • Filter works in combination with other filters
  • Pagination works correctly with renewal status filter
  • Non-recurring locks don't show the renewal status filter
  • Error handling for invalid filter values

Related

This implements the membership renewal status filter feature as discussed in the issue.

@cla-bot
Copy link

cla-bot bot commented Dec 29, 2025

Thank you for your pull request and welcome to Unlock! We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @Flash-Shivam on file.
In order for us to review and merge your code, please open another pull request with a single modification: your github username added to the file .clabot.
Thank you!

@vercel
Copy link

vercel bot commented Dec 29, 2025

@Flash-Shivam is attempting to deploy a commit to the Unlock Protocol Team on Vercel.

A member of the Team first needs to authorize it.

@cla-bot
Copy link

cla-bot bot commented Dec 29, 2025

Thank you for your pull request and welcome to Unlock! We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @Flash-Shivam on file.
In order for us to review and merge your code, please open another pull request with a single modification: your github username added to the file .clabot.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant