You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The membership-plans module (backend/src/membership-plans/) was removed from the working tree. Membership tiers are a core revenue driver — without plan management, every booking is one-off and the hub loses recurring subscription revenue.
Context
The original module entities (MembershipPlan, UserMembership) and enums exist in git history but are deleted — rebuild
PaymentsModule for Paystack subscription payments
User entity: add activeMembershipId FK (nullable)
EmailModule for subscription confirmation and cancellation emails
GET /membership-plans — list active plans sorted by displayOrder (public, no auth)
GET /membership-plans/:id — plan detail (public)
POST /membership-plans — create plan (admin only)
PATCH /membership-plans/:id — update plan (admin only); cannot change priceKobo if plan has active subscribers
POST /membership-plans/:id/subscribe — member subscribes to a plan; initialises Paystack recurring charge; creates UserMembership with ACTIVE status; sends welcome email
DELETE /membership-plans/my-subscription — cancel subscription; sets cancelledAt; membership remains ACTIVE until currentPeriodEnd; sends cancellation email
GET /membership-plans/my-subscription — get current user's active subscription with plan details
Overview
The membership-plans module (
backend/src/membership-plans/) was removed from the working tree. Membership tiers are a core revenue driver — without plan management, every booking is one-off and the hub loses recurring subscription revenue.Context
MembershipPlan,UserMembership) and enums exist in git history but are deleted — rebuildPaymentsModulefor Paystack subscription paymentsUserentity: addactiveMembershipIdFK (nullable)EmailModulefor subscription confirmation and cancellation emailsTasks
MembershipPlanentity:id,name,description(text),priceKobo(int),billingCycle(MONTHLY/QUARTERLY/YEARLY),features(JSONB string array, e.g.["Unlimited hot-desk access", "5 meeting room hours/month"]),bookingHoursIncluded(int, 0 = unlimited),guestPassesPerMonth(int, default 0),isActive(bool),displayOrder(int),createdAt,updatedAtUserMembershipentity:id,userId(FK),planId(FK),status(ACTIVE/CANCELLED/EXPIRED/PAST_DUE),startDate,currentPeriodEnd,cancelledAt(nullable),paystackSubscriptionCode(nullable),createdAtGET /membership-plans— list active plans sorted bydisplayOrder(public, no auth)GET /membership-plans/:id— plan detail (public)POST /membership-plans— create plan (admin only)PATCH /membership-plans/:id— update plan (admin only); cannot changepriceKoboif plan has active subscribersPOST /membership-plans/:id/subscribe— member subscribes to a plan; initialises Paystack recurring charge; createsUserMembershipwithACTIVEstatus; sends welcome emailDELETE /membership-plans/my-subscription— cancel subscription; setscancelledAt; membership remainsACTIVEuntilcurrentPeriodEnd; sends cancellation emailGET /membership-plans/my-subscription— get current user's active subscription with plan detailsMembershipPlansModuleinAppModuleFiles to Modify / Create
backend/src/membership-plans/(module, entities, controller, providers)backend/src/app.module.ts