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.
Pull Request
Title
Loyalty Program and Rewards APIs
fixes #985
Description
Points and Rewards System: Design a system to accumulate points per rental, redeemable for discounts or perks.
Referral Tracking and Rewarding: Enable referral tracking for rewarding users who bring new customers.
Loyalty and Tiered Discounts: Provide loyalty-based pricing tiers and discounts for repeat customers.
// 1. Accumulate Points on Rental
router.post("/rentals/:rentalId/complete", accumulatePoints);
// 2. Redeem Points for Rewards
router.post("/redeem", redeem);
// 3. Referral Tracking and Points Award
router.post("/referral", referral);
// 4. Get User Points and Rewards
router.get("/points-rewards", pointRewards );
//5.Loaylty Middleware for users creating the rentals.
Related Issues
Checklist