fix: minor changes

This commit is contained in:
Samuel Tariku 2025-09-17 12:57:37 +03:00
parent 7336dcfb5d
commit 999b8d6591
4 changed files with 33 additions and 13 deletions

View File

@ -33,10 +33,22 @@ func (s *service) ListProviders(ctx context.Context, limit, offset int32) ([]dom
// Convert []dbgen.VirtualGameProvider to []domain.VirtualGameProvider // Convert []dbgen.VirtualGameProvider to []domain.VirtualGameProvider
domainProviders := make([]domain.VirtualGameProvider, len(providers)) domainProviders := make([]domain.VirtualGameProvider, len(providers))
for i, p := range providers { for i, p := range providers {
var logoDark *string
if p.LogoDark.Valid {
logoDark = &p.LogoDark.String
}
var logoLight *string
if p.LogoLight.Valid {
logoLight = &p.LogoLight.String
}
domainProviders[i] = domain.VirtualGameProvider{ domainProviders[i] = domain.VirtualGameProvider{
ProviderID: p.ProviderID, ProviderID: p.ProviderID,
ProviderName: p.ProviderName, ProviderName: p.ProviderName,
Enabled: p.Enabled, Enabled: p.Enabled,
LogoDark: logoDark,
LogoLight: logoLight,
CreatedAt: p.CreatedAt.Time, CreatedAt: p.CreatedAt.Time,
UpdatedAt: &p.UpdatedAt.Time, UpdatedAt: &p.UpdatedAt.Time,
// Add other fields as needed // Add other fields as needed

View File

@ -65,8 +65,8 @@ func (s *Service) AddProviders(ctx context.Context, req domain.ProviderRequest)
popokParams := dbgen.CreateVirtualGameProviderParams{ popokParams := dbgen.CreateVirtualGameProviderParams{
ProviderID: "popok", ProviderID: "popok",
ProviderName: "Popok Gaming", ProviderName: "Popok Gaming",
LogoDark: pgtype.Text{String: "/static/logos/popok-dark.png", Valid: true}, // adjust as needed LogoDark: pgtype.Text{String: fmt.Sprintf("%v/static/logos/popok-dark.png", s.cfg.PopOK.CallbackURL), Valid: true}, // adjust as needed
LogoLight: pgtype.Text{String: "/static/logos/popok-light.png", Valid: true}, // adjust as needed LogoLight: pgtype.Text{String: fmt.Sprintf("%v/static/logos/popok-light.png", s.cfg.PopOK.CallbackURL), Valid: true}, // adjust as needed
Enabled: true, Enabled: true,
} }

View File

@ -60,7 +60,7 @@ type App struct {
logger *slog.Logger logger *slog.Logger
NotidicationStore *notificationservice.Service NotidicationStore *notificationservice.Service
referralSvc *referralservice.Service referralSvc *referralservice.Service
raffleSvc raffle.RaffleStore raffleSvc raffle.RaffleStore
bonusSvc *bonus.Service bonusSvc *bonus.Service
port int port int
settingSvc *settings.Service settingSvc *settings.Service
@ -137,17 +137,19 @@ func NewApp(
// AllowCredentials: true, // AllowCredentials: true,
})) }))
app.Static("/static", "./static")
s := &App{ s := &App{
atlasVirtualGameService: atlasVirtualGameService, atlasVirtualGameService: atlasVirtualGameService,
veliVirtualGameService: veliVirtualGameService, veliVirtualGameService: veliVirtualGameService,
telebirrSvc: telebirrSvc, telebirrSvc: telebirrSvc,
arifpaySvc: arifpaySvc, arifpaySvc: arifpaySvc,
santimpaySvc: santimpaySvc, santimpaySvc: santimpaySvc,
issueReportingSvc: issueReportingSvc, issueReportingSvc: issueReportingSvc,
instSvc: instSvc, instSvc: instSvc,
currSvc: currSvc, currSvc: currSvc,
fiber: app, fiber: app,
port: port, port: port,
settingSvc: settingSvc, settingSvc: settingSvc,
authSvc: authSvc, authSvc: authSvc,

View File

@ -135,7 +135,9 @@ func (h *Handler) StartGame(c *fiber.Ctx) error {
Error: err.Error(), Error: err.Error(),
}) })
} }
// There needs to be a way to generate a sessionID
// Attach user ID to request // Attach user ID to request
req.PlayerID = fmt.Sprintf("%d", userId) req.PlayerID = fmt.Sprintf("%d", userId)
@ -144,6 +146,8 @@ func (h *Handler) StartGame(c *fiber.Ctx) error {
req.BrandID = h.Cfg.VeliGames.BrandID req.BrandID = h.Cfg.VeliGames.BrandID
} }
req.IP = c.IP()
res, err := h.veliVirtualGameSvc.StartGame(context.Background(), req) res, err := h.veliVirtualGameSvc.StartGame(context.Background(), req)
if err != nil { if err != nil {
h.InternalServerErrorLogger().Error("Failed to [VeliGameHandler]StartGame", h.InternalServerErrorLogger().Error("Failed to [VeliGameHandler]StartGame",
@ -198,6 +202,8 @@ func (h *Handler) StartDemoGame(c *fiber.Ctx) error {
req.BrandID = h.Cfg.VeliGames.BrandID req.BrandID = h.Cfg.VeliGames.BrandID
} }
req.IP = c.IP()
res, err := h.veliVirtualGameSvc.StartDemoGame(context.Background(), req) res, err := h.veliVirtualGameSvc.StartDemoGame(context.Background(), req)
if err != nil { if err != nil {
h.InternalServerErrorLogger().Error("Failed to [VeliGameHandler]StartDemoGame", h.InternalServerErrorLogger().Error("Failed to [VeliGameHandler]StartDemoGame",