Currently, Order has no columns that store any data about refunds, that data has to be computed based on order's transactions, which makes the following problematic/slow/near impossible:
- filtering for orders with refunds;
- aggregating orders refunds (which is necessary for running reports, such as tax reports);
- having consistent refund amounts in the future (relying on consistent rounding arithmetic in Python is destined to backfire).
Order should get extra columns to store refunded amounts (the actual sum of Transaction.amount_refunded and the refunded tax, if applicable).