DEMO PROJECT. Self-initiated sample. Not a client file.
CSV payment report
The script reads synthetic sample.csv rows. It checks the amount and an ISO date, keeps the first valid paid row for each order id, and writes a total. Refunded rows, invalid amounts, bad dates, and a repeated order id stay out of the total.
Accepted output
| order_id | amount |
|---|---|
| A-100 | 12.50 |
| A-101 | 7.00 |
| A-104 | 3.25 |
| TOTAL | 22.75 |
Left out
| order_id | reason |
|---|---|
| A-102 | refunded |
| A-103 | not a number |
| A-100 | duplicate order id |
| A-105 | empty amount |
| A-106 | currency symbol |
| A-107 | invalid date |
| A-108 | empty date |
Run python process.py in the repository to regenerate the CSV output. The tests expect the total 22.75.