hotfix: commenting out providers for demo

This commit is contained in:
Samuel Tariku 2025-09-03 09:55:25 +03:00
parent 6b09c3c8d2
commit edc15952c8
4 changed files with 35 additions and 35 deletions

View File

@ -66,15 +66,15 @@ func (s *Service) GetProviders(ctx context.Context, req domain.ProviderRequest)
func (s *Service) GetGames(ctx context.Context, req domain.GameListRequest) ([]domain.GameEntity, error) {
// 1. Check if provider is enabled in DB
provider, err := s.repo.GetVirtualGameProviderByID(ctx, req.ProviderID)
if err != nil {
return nil, fmt.Errorf("failed to check provider %s: %w", req.ProviderID, err)
}
// provider, err := s.repo.GetVirtualGameProviderByID(ctx, req.ProviderID)
// if err != nil {
// return nil, fmt.Errorf("failed to check provider %s: %w", req.ProviderID, err)
// }
if !provider.Enabled {
// Provider exists but is disabled → return empty list (or error if you prefer)
return nil, fmt.Errorf("provider %s is disabled", req.ProviderID)
}
// if !provider.Enabled {
// // Provider exists but is disabled → return empty list (or error if you prefer)
// return nil, fmt.Errorf("provider %s is disabled", req.ProviderID)
// }
// 2. Prepare signature params
sigParams := map[string]any{

View File

@ -126,21 +126,21 @@ func NewApp(
app.Use(cors.New(cors.Config{
AllowOrigins: "*",
AllowMethods: "GET,POST,PUT,DELETE,OPTIONS",
AllowMethods: "GET,POST,PUT,PATCH,DELETE,OPTIONS",
AllowHeaders: "Content-Type,Authorization,platform",
// AllowCredentials: true,
}))
s := &App{
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

@ -154,10 +154,10 @@ func SetupReportandVirtualGameCronJobs(
spec string
period string
}{
// {
// spec: "*/60 * * * * *", // Every 1 minute for testing
// period: "test",
// },
{
spec: "*/60 * * * * *", // Every 1 minute for testing
period: "test",
},
{
spec: "0 0 0 * * *", // Daily at midnight
period: "daily",

View File

@ -108,12 +108,12 @@ func (h *Handler) LoginCustomer(c *fiber.Ctx) error {
}
accessToken, err := jwtutil.CreateJwt(
successRes.UserId,
successRes.Role,
successRes.CompanyID,
h.jwtConfig.JwtAccessKey,
successRes.UserId,
successRes.Role,
successRes.CompanyID,
h.jwtConfig.JwtAccessKey,
h.jwtConfig.JwtAccessExpiry,
);
)
if err != nil {
h.mongoLoggerSvc.Error("Failed to create access token",
zap.Int("status_code", fiber.StatusInternalServerError),
@ -195,22 +195,22 @@ func (h *Handler) LoginAdmin(c *fiber.Ctx) error {
switch {
case errors.Is(err, authentication.ErrInvalidPassword), errors.Is(err, authentication.ErrUserNotFound):
h.mongoLoggerSvc.Info("Login attempt failed: Invalid credentials",
zap.Int("status_code", fiber.StatusUnauthorized),
zap.Int("status_code", fiber.StatusBadRequest),
zap.String("email", req.Email),
zap.String("phone", req.PhoneNumber),
zap.Error(err),
zap.Time("timestamp", time.Now()),
)
return fiber.NewError(fiber.StatusUnauthorized, "Invalid credentials")
return fiber.NewError(fiber.StatusBadRequest, "Invalid credentials")
case errors.Is(err, authentication.ErrUserSuspended):
h.mongoLoggerSvc.Info("Login attempt failed: User login has been locked",
zap.Int("status_code", fiber.StatusUnauthorized),
zap.Int("status_code", fiber.StatusForbidden),
zap.String("email", req.Email),
zap.String("phone", req.PhoneNumber),
zap.Error(err),
zap.Time("timestamp", time.Now()),
)
return fiber.NewError(fiber.StatusUnauthorized, "User login has been locked")
return fiber.NewError(fiber.StatusForbidden, "User login has been locked")
default:
h.mongoLoggerSvc.Error("Login failed",
zap.Int("status_code", fiber.StatusInternalServerError),
@ -296,22 +296,22 @@ func (h *Handler) LoginSuper(c *fiber.Ctx) error {
switch {
case errors.Is(err, authentication.ErrInvalidPassword), errors.Is(err, authentication.ErrUserNotFound):
h.mongoLoggerSvc.Info("Login attempt failed: Invalid credentials",
zap.Int("status_code", fiber.StatusUnauthorized),
zap.Int("status_code", fiber.StatusBadRequest),
zap.String("email", req.Email),
zap.String("phone", req.PhoneNumber),
zap.Error(err),
zap.Time("timestamp", time.Now()),
)
return fiber.NewError(fiber.StatusUnauthorized, "Invalid credentials")
return fiber.NewError(fiber.StatusBadRequest, "Invalid credentials")
case errors.Is(err, authentication.ErrUserSuspended):
h.mongoLoggerSvc.Info("Login attempt failed: User login has been locked",
zap.Int("status_code", fiber.StatusUnauthorized),
zap.Int("status_code", fiber.StatusForbidden),
zap.String("email", req.Email),
zap.String("phone", req.PhoneNumber),
zap.Error(err),
zap.Time("timestamp", time.Now()),
)
return fiber.NewError(fiber.StatusUnauthorized, "User login has been locked")
return fiber.NewError(fiber.StatusForbidden, "User login has been locked")
default:
h.mongoLoggerSvc.Error("Login failed",
zap.Int("status_code", fiber.StatusInternalServerError),