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
domainProviders := make([]domain.VirtualGameProvider, len(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{
ProviderID: p.ProviderID,
ProviderName: p.ProviderName,
Enabled: p.Enabled,
LogoDark: logoDark,
LogoLight: logoLight,
CreatedAt: p.CreatedAt.Time,
UpdatedAt: &p.UpdatedAt.Time,
// Add other fields as needed

View File

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

View File

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

View File

@ -136,6 +136,8 @@ func (h *Handler) StartGame(c *fiber.Ctx) error {
})
}
// There needs to be a way to generate a sessionID
// Attach user ID to request
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.IP = c.IP()
res, err := h.veliVirtualGameSvc.StartGame(context.Background(), req)
if err != nil {
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.IP = c.IP()
res, err := h.veliVirtualGameSvc.StartDemoGame(context.Background(), req)
if err != nil {
h.InternalServerErrorLogger().Error("Failed to [VeliGameHandler]StartDemoGame",