chore: migrate to gitea
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user