tcrasset / your-budget

Personal budgeting cross platform mobile application, using zero based budgeting. Built using Flutter.
10 stars 1 forks source link

Sort transactions by insert order #14

Closed tcrasset closed 3 years ago

tcrasset commented 3 years ago

Ideally, the transactions in the showTransactionsPage should be sorted by the order they were inserted by the user. Right now, we just sort by date, but the date value is not finegrained enough (only by day).

There are two ways, in preferred order:

  1. Sort by date, but increase the grain to be seconds. The change should be made in the date picker when inserting transactions.
  2. Sort by id, as we use AUTOINCREMENT in the database, higher IDs mean later insertion time.
tcrasset commented 3 years ago

Sort by date, but increase the grain to be seconds. The change should be made in the date picker when inserting transactions.

This choice was preferred, as was actually the only possible.

Indeed, sorting by ID meant that transactions entered later, but having a sooner date would have been ranked as last entered, which is not correct;