Referral
djdj apps
New Page 1: Admin Panel – Referral Settings
📍 Route: /admin/referral-settings
🧩 Tab 1: Referral Settings Section
Setting Type Notes
Enable Referral System Toggle Globally enable/disable
Referrer Bonus Input (₹ / %) e.g., ₹100
Referred User Bonus Input (₹ / %) e.g., ₹50
Bonus Type Radio/Dropdown Fixed / Percentage
Referral Code Length Input (number) e.g., 6 characters
Prevent Reuse Checkbox Detect and block abuse
Minimum Booking Value Input (₹) e.g., ₹250
Booking Status = "Completed" Condition Must be met before referrer gets bonus
Max Earnings Per Referrer Input (₹) Optional cap on bonus total
🧩 Tab 2: Withdrawal Settings Section
Setting Type Notes
Enable Withdrawal Option Toggle Show/hide on frontend
Minimum Withdrawal Amount Input (₹) e.g., ₹200
Withdrawal Methods (Admin Toggles Each): Checkbox List Dynamically controls frontend visibility
→ Amazon Gift Card Email + Mobile Number Fields shown to user on withdrawal form
→ Bank Transfer Name, Bank Name, Account No, Confirm Account No, IFSC
→ UPI UPI ID e.g., yourname@upi
🧩 Tab 3: Referral Signups Table
Shows all referral-based user signups:
Referrer Code Referred User Phone Email Signup Date Booking Status Bonus Status
FIXBRO123 John Doe 987XXXXXXX john@x.com 2025-07-15 Booked Pending
FIXBRO456 Raj 789XXXXXXX raj@x.com 2025-07-14 Completed Credited
🔍 Filter Options:
Referral Used / Not Used
Booking Completed / Not Completed
Bonus Status: Pending / Credited / Failed
🧩 Tab 4: Withdrawal Request Received
Shows requests submitted by users:
User Amount Method Input Details Status Actions
Raj ₹250 UPI raj@bank Pending Approve / Reject
John ₹500 Bank A/C No, IFSC Approved -
Admin can view, approve, or reject each withdrawal.
✅ New Page 2: Frontend – Referral Page
📍 Route: /referral
🧑💼 Tab 1: User’s Referral Info
Feature Description
Your Code e.g., FIXBRO123 + 📋 Copy Button
Referral Link https://fixbro.in/signup?ref=FIXBRO123
Referral History Referred users and their status:
• Raj → Booked → Bonus Pending
• John → Completed → Bonus Credited ₹100
Benefits Shown • Invite friends & Earn ₹100
• Your friend gets ₹50 on signup
💰 Tab 2: Your Wallet
Wallet Info Display
Current Balance ₹XXX
Upcoming (Pending) Balance ₹YYY
Bonus History Show referral bonus credits, usage, and pending ones
💸 Tab 3: Withdrawal
Form fields shown dynamically based on admin-enabled methods:
Amazon Gift Card: Email, Mobile Number
Bank Transfer: Full bank details
UPI: UPI ID
Validation:
Must meet minimum withdrawal set by admin
Show error if not eligible
Submit button to send request → saved in Firestore
🔁 Backend Logic (Firebase / Node.js / Custom)
🟢 On Signup
Read ?ref=FIXBRO123
Save referredBy to new user profile
Assign unique referral code to the new user
Credit instant bonus (e.g., ₹50) to the referred user's wallet
✅ On Booking Completion
If this is user's first booking and meets min value
Credit referrer's wallet (e.g., ₹100)
Update referral entry to "completed"
🔐 Fraud Prevention & Retention
Rule Logic
Prevent reuse Track device/IP, mark abuse flag
Existing user with referral? Show message: "Code not applicable"
Deleted account? Preserve referral trail in referrals collection
Multiple account detection Optional: device fingerprinting, same phone/email blocking
🔔 Notifications
Event Trigger
Referral code used Notify referrer
Bonus credited Notify referrer and referred user
Withdrawal approved Notify user by email or push