feat: move treasure_chest to seperate module
All checks were successful
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 1m18s

This commit is contained in:
2025-12-27 10:18:20 +01:00
parent 0325fe101c
commit 28113d27d0
13 changed files with 123 additions and 112 deletions

View File

@@ -4,7 +4,8 @@ import (
"context"
"spend-sparrow/internal/auth_types"
"spend-sparrow/internal/core"
"spend-sparrow/internal/service"
"spend-sparrow/internal/treasure_chest"
"spend-sparrow/internal/treasure_chest_types"
"spend-sparrow/internal/types"
"time"
@@ -90,14 +91,14 @@ func (s Service) TreasureChests(
return nil, core.ErrUnauthorized
}
treasureChests := make([]*types.TreasureChest, 0)
treasureChests := make([]*treasure_chest_types.TreasureChest, 0)
err := s.db.SelectContext(ctx, &treasureChests, `SELECT * FROM treasure_chest WHERE user_id = ?`, user.Id)
err = core.TransformAndLogDbError(ctx, "dashboard TreasureChests", nil, err)
if err != nil {
return nil, err
}
treasureChests = service.SortTreasureChests(treasureChests)
treasureChests = treasure_chest.SortTreasureChests(treasureChests)
result := make([]*DashboardTreasureChest, 0)