NEW TICKET#21 · Invoice list
Sort invoices with a tie-breaker, then page them
Tomás Reyes · Support Lead
Opened today
“Two complaints about the invoice list, and I think they're one bug. First, page 1 starts with what should be on page 2: the earliest invoices are missing. Second, a studio that sends 30 invoices on the 1st of every month sees the same invoice on two pages and never sees others. Invoices are listed by due date, earliest first; when two are due the same day, the lower invoice number should come first, every time. Pages start at 1. Can you fix invoicePage?”
YOUR PLAN
- 1Watch an example2 min
- 2Warm-up 11 min
- 3Warm-up 21 min
- 4Fix the ticket11 min
BY THE END YOU CAN
- Write a comparator with a tie-breaker using ||
- Work out where a page starts
- Sort a copy, not the list you were given