adityanandanx / adityanandanx/raftaar
11. Support Tickets & Auto-Refund Policy
- Langage dominant
- Python
- Étoiles
- 0
- Forks
- 0
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
## Parent PRD
#1
## What to build
Support ticket system with automatic refund policy. Customers can report issues with trips (damaged bike, accident, etc.) within 24 hours, and automatically receive 100% refund. For issues reported after 24 hours, support team manually reviews.
Implements ticket creation, 24-hour auto-refund window, refund state machine, and frontend ticket management UI.
## Acceptance criteria
- [ ] `POST /support-tickets/create` creates support ticket for a trip (JWT required)
- [ ] Accepts: trip_id, issue_type (damaged_bike, accident, lost, other), description
- [ ] Response includes: ticket_id, created_at, auto_refund_eligible (true/false)
- [ ] Auto-refund check: if (now - trip.end_time) < 24 hours, auto_refund_eligible = true
- [ ] If auto_refund_eligible = true, immediately create refund (refund.status = 'approved')
- [ ] `GET /support-tickets` lists user's tickets with status (JWT required)
- [ ] `GET /support-tickets/:id` returns ticket details including refund status (JWT required)
- [ ] Database schema: `support_tickets` (id, user_id, trip_id, issue_type, description, status, created_at)
- [ ] If auto-refund issued: trip.status = 'refunded', refund.status = 'approved'
- [ ] Refund amount = original trip cost
- [ ] Edge cases: ticket for already-refunded trip (reject), trip from future (invalid)
- [ ] Frontend: Report issue button on trip history/receipt
- [ ] Frontend: Support tickets list showing ticket ID, trip details, status, refund status
- [ ] Frontend: Auto-refund badge if eligible
## Blocked by
- Blocked by #9 (Trip Charging - needs completed transactions to refund)
- Blocked by #2 (Authentication - needs user context)
## User stories addressed
- User story 18: Report damaged bike or issue
- User story 19: Easy refund process
- User story 20: Automatic refund eligibility within 24 hours
- User story 21: Contact support through app
- User story 22: View support tickets and status
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Review blocked issues #9 and #2 first to understand completed-trip charging, refunds, and JWT user context. Map the listed support-ticket endpoints and schema to the existing backend and trip-history UI, then verify the acceptance criteria, including the 24-hour boundary, refund state changes, validation errors, and ticket status displays.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- api, full-stack, payments
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- Calme
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100