Social Service Integration (Permission Check)
Description
Connect the Chat Service to the Social Service to verify friendship before allowing messages to be sent.
Features
1. Call Social Service Endpoint
- Use HTTP module to call the Social Service's friendship check endpoint
- Send request with sender ID and recipient ID
- Receive friendship status response
2. Check Friendship Status
- Before sending a message, verify if sender and recipient are friends
- Block message if they are not friends
- Allow message only if status is FRIENDS
3. Error Handling
- If Social Service is down, show error to user
- If users are not friends, show error message
- Display error as a toast notification to sender
What Needs to Happen
When user tries to send a message:
- Capture sender ID and recipient ID
- Call Social Service API endpoint
- Get friendship status response
- If FRIENDS → Allow message to be sent
- If NOT FRIENDS → Block message and show error toast
- If Social Service fails → Show error toast
Error Messages:
- "You are not friends with this user"
- "Failed to verify friendship status"
- "Social Service is currently unavailable"
Acceptance Criteria
Dependencies
- HTTP Module (Axios or similar)
- Social Service running and accessible
- Social Service endpoint: GET /internal/status/: user1/:user2
Simple Implementation Flow
User sends message
↓
Extract sender & recipient IDs
↓
Call Social Service
↓
Get response (FRIENDS or NOT FRIENDS)
↓
If FRIENDS → Send message ✓
If NOT FRIENDS → Show error toast ✗
If Error → Show error toast ✗
Social Service Integration (Permission Check)
Description
Connect the Chat Service to the Social Service to verify friendship before allowing messages to be sent.
Features
1. Call Social Service Endpoint
2. Check Friendship Status
3. Error Handling
What Needs to Happen
When user tries to send a message:
Error Messages:
Acceptance Criteria
Dependencies
Simple Implementation Flow