- Entity: Event
- Who is paying: Coordinator
- Calculation/Rule: Number of students participated × Rs 200 per student
- Unit of measure: Rs 200 per student
- Trigger: Click on the digital certificate
- Output: X × 200 (where X = number of students)
- Controlled by Admin: Shows "Event X - Per student fee is Y, Event A - per student fee is Z..."
-
Payment Calculation:
- Uses
perStudentBaseChargefromGlobalSettingstable - Formula:
perStudentBaseCharge × participantCount - Location:
backend/src/routes/payment.js(lines 197-219) - Admin can set this globally in Admin Dashboard
- Uses
-
Payment Flow:
- Endpoint:
/api/payment/create-order-events - Supports both GLOBAL and EVENT fee modes
- Creates Razorpay order
- Payment verification implemented
- Endpoint:
-
Admin Management:
- ✅ Global settings page:
/admin/settings/global-payments - ✅ Quick edit in Events Management page
- ✅ Per-event fee override in Events Fee Management table
- ✅ Shows per-event fee breakdown
- ✅ Global settings page:
-
Checkout Modal:
- ✅ Integrated in
CoachDashboard.jsx - Shows payment breakdown before Razorpay
- ✅ Integrated in
-
Default Amount:
perStudentBaseChargedefaults to 0 in schema- Action Required: Admin should set to 200 (or desired amount) via UI
- Location: Admin can set via Global Payment Settings
-
Trigger Point:
- Currently triggered from "Pay Event Fee" button in dashboard
- Spec Requirement: Should be triggered on "Click on digital certificate"
- Action Required: Add payment trigger when user clicks to view/download certificate
- Location:
IssueCertificates.jsxor certificate download/view component
- Who is paying: Coordinator
- Calculation: Person (one-time registration fee)
- Trigger: Post successful account creation
- Controlled by: Admin
-
Global Setting Added:
- ✅
coordinatorSubscriptionFeefield added toGlobalSettingstable - ✅ Admin can set this globally in Global Payment Settings
- ✅ Available in both AdminGlobalPayments and AdminEventsManagement pages
- ✅
-
Database Schema:
- ✅ Column added:
coordinatorSubscriptionFee(Float, default 0) - ✅ Migration script created:
ADD_COORDINATOR_SUBSCRIPTION_FEE.sql
- ✅ Column added:
-
Backend API:
- ✅ Updated
/api/admin/settings/global-paymentsPUT endpoint - ✅ Accepts
coordinatorSubscriptionFeein request body - ✅ Returns updated settings including coordinator fee
- ✅ Updated
-
Frontend UI:
- ✅ AdminGlobalPayments.jsx - Full settings page with coordinator subscription fee field
- ✅ AdminEventsManagement.jsx - Quick edit section includes coordinator subscription fee
- ✅ Both pages allow real-time updates
-
Payment Integration:
- Action Required: Integrate coordinator subscription fee into registration flow
- Location:
backend/src/routes/auth.js- Coach/Coordinator registration endpoint - Trigger: After successful account creation, before returning success response
- Flow:
- Check if coordinator subscription fee > 0
- Create Razorpay order for subscription fee
- Redirect to payment or return payment order details
- Verify payment before completing registration
-
Payment Verification:
- Action Required: Add payment verification endpoint for coordinator subscription
- Location:
backend/src/routes/payment.js - Flow: Verify payment and mark coordinator account as subscribed
- Who is paying: Student
- Calculation: Person (one-time registration fee)
- Trigger: Connect to an event in student dashboard
- Condition: If event is created by admin then only
- Controlled by: Admin
- Event Registration:
- Students can register for events
- Payment flow exists for event registrations
-
Condition Check:
- Action Required: Check if event is created by admin
- Location: Event registration endpoint
- Logic: Only charge registration fee if
event.createdBy === 'ADMIN'or similar flag
-
Registration Fee:
- Action Required: Add student registration fee to global settings
- Action Required: Charge student when connecting to admin-created events
- Location: Student event registration flow
- Who is paying: Institute
- Calculation: Person (one-time registration fee)
- Trigger: Post successful account creation
- Controlled by: Admin
- Action Required: Add institute subscription fee to global settings
- Action Required: Integrate into institute registration flow
- Action Required: Create payment order after account creation
- Who is paying: Company
- Calculation: Person (one-time registration fee)
- Trigger: Post successful account creation
- Controlled by: Admin
- Action Required: Add company subscription fee to global settings
- Action Required: Integrate into company registration flow
- Action Required: Create payment order after account creation
- Who is paying: Any stakeholder
- Calculation: Person (one-time registration fee)
- Trigger: Post successful account creation
- Controlled by: Admin
- Action Required: Add stakeholder-specific subscription fees
- Action Required: Generic registration payment flow
- Action Required: Role-based fee assignment
- Schema Update: Added
coordinatorSubscriptionFeetoGlobalSettingsmodel - Backend API: Updated global payment settings endpoint to handle coordinator fee
- Frontend - AdminGlobalPayments: Added coordinator subscription fee input field
- Frontend - AdminEventsManagement: Added coordinator subscription fee to quick edit section
- Migration Script: Created
ADD_COORDINATOR_SUBSCRIPTION_FEE.sqlfor database migration
- Coordinator Registration Payment Flow: Integrate subscription fee into registration process
- Payment Verification: Add verification endpoint for coordinator subscription payments
- Student Registration Fee: Add to global settings and integrate into event registration
- Other Entity Fees: Institute, Company, and other stakeholder fees
- Certificate Trigger: Move event fee payment trigger to certificate click
-
Run Migration:
psql $DATABASE_URL -f backend/ADD_COORDINATOR_SUBSCRIPTION_FEE.sql -
Test Global Settings:
- Navigate to Admin Dashboard → Global Payment Settings
- Set Coordinator Subscription Fee
- Verify it saves and persists
-
Implement Registration Payment Flow:
- Update registration endpoints to check for subscription fees
- Create Razorpay orders for subscription payments
- Add payment verification
-
Add Certificate Payment Trigger:
- Update certificate view/download component
- Trigger payment flow when certificate is accessed
- Show payment modal before certificate display
backend/prisma/schema.prisma- AddedcoordinatorSubscriptionFeefieldbackend/src/routes/admin.js- Updated global payment settings endpointbackend/ADD_COORDINATOR_SUBSCRIPTION_FEE.sql- Migration script
frontend/src/pages/dashboard/AdminGlobalPayments.jsx- Added coordinator fee fieldfrontend/src/pages/dashboard/AdminEventsManagement.jsx- Added coordinator fee to quick edit
- Run database migration
- Verify coordinator subscription fee field appears in Admin Global Payment Settings
- Set coordinator subscription fee value
- Verify value persists after page refresh
- Test coordinator registration flow (pending implementation)
- Test payment order creation for coordinator subscription
- Test payment verification for coordinator subscription
- Verify event fee calculation uses perStudentBaseCharge
- Test certificate payment trigger (pending implementation)