quick debt settlement in the overview page

This commit is contained in:
2025-08-30 15:19:53 +01:00
parent 689e371b40
commit 587312cc95
8 changed files with 167 additions and 3 deletions
+16
View File
@@ -38,6 +38,22 @@ func (e *Expense) GetPayments(tx *sql.Tx) error {
return nil
}
func GetExpensePaymentByUserID(tx *sql.Tx, eId int64, uId int64,
) (ExpensePayment, error) {
ctx := context.Background()
queries := repo.New(tx)
payment, err := queries.GetExpensePaymentByUser(ctx, repo.GetExpensePaymentByUserParams{
ExpID: eId,
UserID: uId,
})
if err != nil {
return ExpensePayment{}, err
}
return mapRepoGetPaymentRow(payment), nil
}
func (p *ExpensePayment) Insert(tx *sql.Tx, expID int64) error {
ctx := context.Background()