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_idamount
A-10012.50
A-1017.00
A-1043.25
TOTAL22.75

Left out

order_idreason
A-102refunded
A-103not a number
A-100duplicate order id
A-105empty amount
A-106currency symbol
A-107invalid date
A-108empty date

Run python process.py in the repository to regenerate the CSV output. The tests expect the total 22.75.