adityanandanx / adityanandanx/raftaar

10. Trip Receipts & Email Notifications

Open
#11 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Parent PRD

#1

## What to build

Receipt generation and delivery after trip completion. After payment is charged, an itemized receipt is generated and sent to customer via email. Receipt includes trip details (start/end station, duration, cost breakdown), and acts as proof of payment.

Implements receipt template, email composition (mocked provider), async background job, and frontend receipt display.

## Acceptance criteria

- [ ] `POST /trips/send-receipt` generates and emails receipt (internal, async job after charge)
- [ ] Email template includes: trip_id, start_station, end_station, start_time, end_time, duration_minutes, cost breakdown (base fare + per-minute charges)
- [ ] Cost breakdown shows: Base fare ₹2, Per-minute (if applicable), Total cost
- [ ] Mock email provider (no real SMTP): log to console/file
- [ ] Receipt sent within 1 minute of trip completion
- [ ] `GET /trips/:id/receipt` returns receipt data as JSON
- [ ] Database updates: trip.receipt_sent_at = now()
- [ ] Frontend: Receipt screen shown after trip end with all details
- [ ] Frontend: Download receipt button (PDF export optional for MVP)
- [ ] Frontend: "Receipt sent to [email]" confirmation message
- [ ] Edge cases: email send failure (retry logic), customer has no email (optional)
- [ ] All emails logged for audit (admin can see email sent records)

## Blocked by

- Blocked by #9 (Trip Charging - receipt sent after charge succeeds)

## User stories addressed

- User story 15: Itemized receipt after each trip
- User story 24: Email notification with proof of transaction

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the parent PRD (#1) and the blocked Trip Charging issue (#9), then map the POST /trips/send-receipt and GET /trips/:id/receipt entry points across the backend and frontend. Done means the acceptance criteria are covered: itemized receipt generation, mocked email delivery and logging, receipt persistence, retry handling, and the receipt screen with confirmation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend, database, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.