Added recategorization from UI

This commit is contained in:
Manuel Forcén Muñoz 2024-05-16 23:08:56 +02:00
parent 128cd85a9b
commit 1ad1e66470
4 changed files with 25 additions and 12 deletions

View file

@ -157,6 +157,20 @@ impl Transaction {
Ok(res)
}
pub async fn list_uncategorized(pool: &SqlitePool, account: i32) -> Result<Vec<Self>> {
let mut query = sqlx::QueryBuilder::new("SELECT * FROM TRANSACTIONS WHERE account=");
query.push_bind(account);
query.push(" AND category IS NULL");
let rows = query.build().fetch_all(pool).await?;
let mut ret = Vec::new();
for r in &rows {
ret.push(Transaction::from_row(r)?);
}
Ok(ret)
}
pub async fn group_by_date(
pool: &SqlitePool,
account: i32,