Linked Accounts¶
Overview¶
The Linked Accounts feature in FanToPark enables secure connections between students, parents/guardians, and coaches. This dual-approval system ensures proper consent from both guardians and students while allowing coaches to immediately use basic communication services.
Key Benefits¶
- For Coaches: Immediate WhatsApp/SMS communication, with app features enabled after approval
- For Parents/Guardians: Control over their child's app participation and data sharing
- For Students: Authority to approve/reject their own profile and app access
- For Academies: Compliance with child protection regulations
How It Works¶
The linked accounts system operates on a dual-consent model with differentiated service access:
- Coach adds student - Can immediately use WhatsApp/SMS services
- Guardian receives in-app notification to approve/reject the connection
- Student receives in-app notification to approve/reject their profile
- App services are enabled only after respective approvals
- Backend tracks separate statuses for parent and child approvals
Approval Workflow¶
graph TB
subgraph "Coach App - Player Addition"
A[Coach Login] --> B[Add Players/Batch]
B --> C[Enter Student Info]
C --> D[Enter Guardian Contact]
D --> E[Submit]
E --> F[Player Added - Basic Services Active]
F --> G[✅ WhatsApp/SMS Services Available Immediately]
F --> H[⏸️ App Services Pending Approval]
end
subgraph "Dual Approval System"
H --> I[Send In-App Notification to Guardian]
H --> J[Send In-App Notification to Student]
I --> K{Guardian Decision}
K -->|Approve| L[Guardian Status: Approved]
K -->|Reject| M[Guardian Status: Rejected]
K -->|No Response| N[Guardian Status: Pending]
J --> O{Student Decision}
O -->|Approve| P[Student Status: Approved]
O -->|Reject| Q[Student Status: Rejected]
O -->|No Response| R[Student Status: Pending]
end
subgraph "Service Availability Matrix"
S[Coach Services]
S --> T{Service Type}
T -->|WhatsApp/SMS| U[✅ Always Available]
T -->|App Services| V{Check Approval Status}
V --> W[Guardian App Services]
W -->|Guardian Approved| X[✅ Enabled for Guardian]
W -->|Guardian Pending/Rejected| Y[❌ Disabled for Guardian]
V --> Z[Student App Services]
Z -->|Student Approved| AA[✅ Enabled for Student]
Z -->|Student Pending/Rejected| AB[❌ Disabled for Student]
end
subgraph "Rejection Handling"
M --> AC[Guardian App Services Halted]
Q --> AD[Student App Services Halted]
AC --> AE[Coach Notified to Fix Details]
AD --> AE
AE --> AF[Resend Approval Request]
end
subgraph "Database Status Tracking"
DB[(Player Database)]
PST[(Parent Status Table)]
CST[(Child Status Table)]
L --> PST
M --> PST
P --> CST
Q --> CST
end
Service Access Model¶
Immediate Services (No Approval Required)¶
When a coach adds a student, the following services are immediately available: - ✅ WhatsApp messaging - ✅ SMS notifications - ✅ Basic roster management - ✅ Attendance tracking - ✅ Manual fee tracking
App-Based Services (Approval Required)¶
The following services require approval from guardian/student: - ❌ In-app notifications - ❌ Performance reports in app - ❌ Fee reminders in app - ❌ Team communications in app - ❌ Digital payment processing - ❌ Progress tracking in app
Dual Status Tracking¶
The system maintains separate approval statuses for guardians and students:
Guardian Status Types¶
1. Guardian Pending¶
- When: Initial status after coach adds student
- App Access: No guardian app features enabled
- Coach Can: Use WhatsApp/SMS with guardian
- Coach Cannot: Send app notifications, share reports in app
2. Guardian Approved¶
- When: Guardian approves connection in app
- App Access: Full guardian app features enabled
- Available Services:
- ✅ In-app notifications for guardian
- ✅ View performance reports in app
- ✅ Receive fee reminders in app
- ✅ Make payments through app
- ✅ Access all guardian features
3. Guardian Rejected¶
- When: Guardian rejects connection in app
- App Access: All guardian app services halted
- Coach Action Required: Fix details and resend approval
- WhatsApp/SMS: Still available
Student Status Types¶
1. Student Pending¶
- When: Initial status when student logs in
- App Access: Limited to approval screen
- Cannot: Access training content, view reports
2. Student Approved¶
- When: Student approves their profile
- App Access: Full student app features enabled
- Available Services:
- ✅ View own performance data
- ✅ Access training materials
- ✅ Receive in-app notifications
- ✅ Participate in team features
- ✅ Tournament registrations
3. Student Rejected¶
- When: Student rejects their profile
- App Access: All student app services halted
- Coach Action Required: Verify details with student
- WhatsApp/SMS: Still available to coach
User Guides¶
For Coaches¶
Adding Students with Guardian Approval¶
-
Navigate to Player Management
- Open Coach App
- Go to "Players" section
- Click "Add New Player"
-
Enter Student Information
- Full name
- Date of birth
- Contact number (optional)
- Medical information (if applicable)
-
Add Guardian Details
- Guardian name
- Relationship to student
- Mobile number (required for approval)
- Email address (optional)
-
Submit for Approval
- Review entered information
- Click "Send Approval Request"
- System sends SMS/email to guardian
-
Track Approval Status
- View pending approvals in dashboard
- Receive notifications when guardians respond
- Resend requests after 48 hours if needed
Managing Different Status Types¶
Pending Players: - View list of pending approvals - Send reminder notifications (max 2 per week) - Edit player details before approval - Cancel approval requests
Approved Players: - Full access to all coaching features - Send performance reports - Include in team communications - Process fee payments
Rejected Players: - Review rejection reason (if provided) - Update incorrect information - Initiate new approval request - Archive or remove from system
For Parents/Guardians¶
Approving Coach Connections¶
-
Receive In-App Approval Request
- Push notification in FanToPark app
- Approval request appears in notifications tab
- Can review anytime within validity period
-
Review Coach Profile
- Coach name and credentials
- Academy affiliation (if applicable)
- Contact information
- Number of students managed
- Coach ratings and reviews
-
Verify Student Information
- Confirm student details are correct
- Review services coach will provide
- Check communication preferences
-
Make Decision in App
- Approve: Enable all app-based services for guardian
- Reject: Block app services, notify coach to fix details
- Request Changes: Send message to coach for corrections
Managing Linked Accounts¶
View Connected Coaches: - Access list of approved coaches - Review services each coach provides - Check communication history
Update Permissions: - Modify notification preferences - Change contact information - Adjust data sharing settings
Revoke Access: - Remove coach connection - Stop all communications - Archive historical data
For Students¶
Approving Your Profile¶
-
First Login
- Download FanToPark Student App
- Login with phone number provided to coach
- Verify account with OTP
- Immediately see approval request
-
Review Your Profile
- Check your personal information
- Verify coach details are correct
- Review what data will be shared
-
Make Your Decision
- Approve: Unlock all app features for yourself
- Reject: Block your app access, notify coach
- Edit Request: Ask coach to update details
After Approval¶
-
Access Full Features
- View training schedules
- Access performance reports
- Receive in-app notifications
- Participate in team activities
-
Manage Your Profile
- Update personal information
- Set notification preferences
- Control data sharing settings
-
Family Account Linking
- Link parent/guardian accounts
- Share progress with family
- Enable family fee payments
Notifications System¶
Coach Notifications¶
| Event | Notification Type | Message Template |
|---|---|---|
| Guardian Approval | In-app Push | "✅ [Guardian Name] has approved app access for [Student Name]" |
| Guardian Rejection | In-app Push | "❌ [Guardian Name] rejected app access. Please update details" |
| Student Approval | In-app Push | "✅ [Student Name] has approved their profile" |
| Student Rejection | In-app Push | "❌ [Student Name] rejected their profile. Please verify details" |
| Pending Reminder | In-app | "⏰ [X] approval requests pending for more than 3 days" |
Guardian Notifications¶
| Event | Notification Type | Message Template |
|---|---|---|
| New Request | In-app Push | "Coach [Name] has added [Student] to their batch. Approve to enable app features" |
| Approval Confirmation | In-app | "✅ You've approved app access for [Student] with Coach [Name]" |
| Rejection Confirmation | In-app | "❌ You've rejected app access. Coach has been notified" |
Student Notifications¶
| Event | Notification Type | Message Template |
|---|---|---|
| Profile Ready | In-app Push | "Your coach [Name] has added you. Approve to access all features" |
| Approval Confirmation | In-app | "✅ Profile approved! You can now access all features" |
| Rejection Confirmation | In-app | "❌ Profile rejected. Coach will update your details" |
Privacy and Security¶
Data Protection¶
- Consent-Based Access: No student data shared without guardian approval
- Encrypted Communications: All messages between coach and guardian encrypted
- Audit Trail: Complete log of all approval requests and decisions
- Data Minimization: Only essential information collected and stored
Compliance Features¶
- Age Verification: System checks student age for appropriate permissions
- COPPA Compliance: For students under 13 (where applicable)
- Right to Deletion: Guardians can request complete data removal
- Regular Audits: Quarterly reviews of data access and permissions
Best Practices¶
For Coaches¶
- Complete Profile Setup: Ensure your coach profile is complete and professional
- Accurate Information: Double-check student and guardian details before submission
- Timely Follow-up: Address pending requests within 48 hours
- Clear Communication: Explain the benefits of the platform to guardians
- Respect Decisions: Accept guardian rejections professionally
For Academies¶
- Standardize Process: Create academy-wide approval workflows
- Train Coaches: Ensure all coaches understand the approval system
- Monitor Compliance: Regular audits of approval rates and pending requests
- Parent Education: Provide information sessions about the platform
- Support Documentation: Maintain help resources for parents and coaches
Troubleshooting¶
Common Issues and Solutions¶
| Issue | Solution |
|---|---|
| Guardian didn't receive SMS | Verify phone number, resend request, try email alternative |
| Approval link expired | Generate new approval request with updated details |
| Wrong guardian contacted | Cancel request, update guardian information, resubmit |
| Student can't access app | Ensure approval is complete, verify phone number matches |
| Duplicate approval requests | Check for existing pending requests before creating new ones |
FAQ¶
Q: Can coaches use any services before approval? A: Yes, coaches can immediately use WhatsApp and SMS services. Only app-based features require approval.
Q: Are guardian and student approvals independent? A: Yes, they are tracked separately. Guardian approval enables guardian app features, student approval enables student app features.
Q: What happens if only guardian approves but student doesn't? A: Guardian can access all parent app features (view reports, make payments), but student cannot access student app features.
Q: What happens if student approves but guardian doesn't? A: Student can access their app features, but guardian won't receive app notifications or access parent features.
Q: Can a rejected approval be reversed? A: Yes, coaches can fix the issues and resend approval requests to both guardians and students.
Q: How long does an approval request remain valid? A: Approval requests remain active until acted upon. Coaches receive reminders for pending requests after 3 days.
Q: Can a student have multiple coaches? A: Yes, students can be connected to multiple coaches, each requiring separate approvals.
Q: Is approval required for adult students? A: Students 18+ can self-approve their profile, but guardian approval is optional.
Technical Implementation¶
API Endpoints¶
POST /api/players/add
- Adds new player with dual pending status
- Enables WhatsApp/SMS services immediately
- Triggers in-app approval notifications
GET /api/players/approval-status/{playerId}
- Returns both guardian and student status
- Includes approval history for both
POST /api/approval/send-guardian-request
- Sends in-app notification to guardian
- Returns request ID
POST /api/approval/send-student-request
- Sends in-app notification to student
- Returns request ID
PUT /api/approval/guardian-response
- Records guardian decision
- Updates guardian_status field
- Enables/disables guardian app services
PUT /api/approval/student-response
- Records student decision
- Updates student_status field
- Enables/disables student app services
GET /api/coach/pending-approvals
- Lists all pending approvals (guardian and student)
- Shows separate status for each
- Includes days pending
GET /api/services/availability/{playerId}
- Returns service availability matrix
- Shows WhatsApp/SMS (always true)
- Shows app services based on approval status
Status Flow Diagram¶
stateDiagram-v2
[*] --> PlayerAdded: Coach adds player
PlayerAdded --> GuardianPending: Guardian notified
PlayerAdded --> StudentPending: Student notified
PlayerAdded --> BasicServicesActive: WhatsApp/SMS enabled
GuardianPending --> GuardianApproved: Guardian approves
GuardianPending --> GuardianRejected: Guardian rejects
GuardianRejected --> GuardianPending: Coach resubmits
StudentPending --> StudentApproved: Student approves
StudentPending --> StudentRejected: Student rejects
StudentRejected --> StudentPending: Coach resubmits
GuardianApproved --> GuardianAppActive: Guardian app services enabled
StudentApproved --> StudentAppActive: Student app services enabled
GuardianApproved --> GuardianRevoked: Guardian revokes
GuardianRevoked --> GuardianPending: Coach requests re-approval
StudentApproved --> StudentRevoked: Student revokes
StudentRevoked --> StudentPending: Coach requests re-approval
Database Schema¶
-- Player Status Table
CREATE TABLE player_status (
player_id UUID PRIMARY KEY,
guardian_status ENUM('pending', 'approved', 'rejected') DEFAULT 'pending',
student_status ENUM('pending', 'approved', 'rejected') DEFAULT 'pending',
guardian_status_updated_at TIMESTAMP,
student_status_updated_at TIMESTAMP,
coach_id UUID NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Approval History Table
CREATE TABLE approval_history (
id UUID PRIMARY KEY,
player_id UUID NOT NULL,
approver_type ENUM('guardian', 'student') NOT NULL,
action ENUM('approved', 'rejected', 'revoked') NOT NULL,
reason TEXT,
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Service Availability View
CREATE VIEW service_availability AS
SELECT
player_id,
TRUE as whatsapp_enabled,
TRUE as sms_enabled,
(guardian_status = 'approved') as guardian_app_enabled,
(student_status = 'approved') as student_app_enabled
FROM player_status;