chore: migrate to gitea
Some checks failed
golangci-lint / lint (push) Failing after 1m30s
Test / test (push) Failing after 2m17s

This commit is contained in:
2026-01-27 00:40:46 +01:00
parent 1e05874160
commit f8df24c29d
3169 changed files with 1216434 additions and 1587 deletions

View File

@@ -1,13 +1,14 @@
package expense
import (
"budget/internal/account"
"budget/internal/storage/dao"
"budget/internal/storage/model"
"budget/internal/utils"
"strconv"
"strings"
"time"
"gitea.frenchtouch.duckdns.org/kratisto/budget-backend/internal/account"
"gitea.frenchtouch.duckdns.org/kratisto/budget-backend/internal/storage/dao"
"gitea.frenchtouch.duckdns.org/kratisto/budget-backend/internal/storage/model"
"gitea.frenchtouch.duckdns.org/kratisto/budget-backend/internal/utils"
)
type Service struct {
@@ -18,8 +19,8 @@ func (s Service) GetExpensesOfAnAccountBetween(accountId, from, to string) ([]*E
expenses, err := s.db.GetExpensesOfAnAccountBetween(accountId, from, to)
utils.GetLogger().Info(err)
if e, ok := err.(*dao.Error); ok {
switch {
case e.Type == dao.ErrTypeNotFound:
switch e.Type {
case dao.ErrTypeNotFound:
return nil, &model.ErrNotFound
default:
return nil, &model.ErrInternalServer
@@ -38,8 +39,8 @@ func (s Service) GetAllExpensesOfAnAccount(accountId string) ([]*Expense, error)
expenses, err := s.db.GetAllExpensesOfAnAccount(accountId)
utils.GetLogger().Info(err)
if e, ok := err.(*dao.Error); ok {
switch {
case e.Type == dao.ErrTypeNotFound:
switch e.Type {
case dao.ErrTypeNotFound:
return nil, &model.ErrNotFound
default:
return nil, &model.ErrInternalServer
@@ -100,7 +101,10 @@ func (s Service) processCaisseEpargne(filedata [][]string, account *account.Acco
},
AccountId: account.ID,
}
s.CreateExpense(expense)
err = s.CreateExpense(expense)
if err != nil {
return err
}
utils.GetLogger().Info(val)
}