feat(backend): implement subscription management module with superadmin controls (#128)#142
Open
anshika1179 wants to merge 1 commit into
Open
Conversation
Author
|
@rdodiya i had sent the pull request kindly check it once and if any modification required let me know |
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.
Closes #128
Description
This PR introduces a highly cohesive and scalable backend Subscription Management Module for RestroHub. The architecture is designed to support the SuperAdmin role for managing standard restaurant plans (e.g., Free, Basic, Pro, Custom) and laying the groundwork for robust feature access controls (addressing future requirements like Issue #129).
Key Architectural Changes
com.restroly.qrmenu.subscriptionpackage. This ensures clean separation of concerns and guarantees zero merge conflicts with existing authentication or user management flows.SubscriptionPlan: Core model containing pricing, billing cycles, and active status.SubscriptionFeature&PlanFeatureMapping: Dynamic feature toggle mapping structure to prevent hardcoded feature restrictions.RestaurantSubscription: Links an activet_restaurant_masterrecord to a specificSubscriptionPlanwith defined start/end dates.ddl-auto=updategenerates thet_subscription_plan,t_subscription_feature,t_plan_feature_mapping, andt_restaurant_subscriptiontables seamlessly on launch.API Capabilities
Exposes comprehensive REST APIs fully secured via Spring Security's
@PreAuthorize:POST /api/v1/admin/subscriptions/plans(SuperAdmin only)PUT /api/v1/admin/subscriptions/plans/{id}(SuperAdmin only)GET /api/v1/admin/subscriptions/plans(SuperAdmin only)POST /api/v1/admin/subscriptions/restaurants/{restId}/assign(SuperAdmin only)GET /api/v1/restaurant/{restId}/subscription(Restaurant Owner & SuperAdmin)Verification Checklist
SUPER_ADMINvsRESTAURANT_OWNER).Restaurantcore code.Next Steps (Post-Merge)
isFeatureEnabled()has been added to theSubscriptionServicewhich can now be utilized globally to restrict feature endpoints depending on a restaurant's active plan.