hotfix: commenting out providers for demo
This commit is contained in:
parent
6b09c3c8d2
commit
edc15952c8
|
|
@ -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) {
|
func (s *Service) GetGames(ctx context.Context, req domain.GameListRequest) ([]domain.GameEntity, error) {
|
||||||
// 1. Check if provider is enabled in DB
|
// 1. Check if provider is enabled in DB
|
||||||
provider, err := s.repo.GetVirtualGameProviderByID(ctx, req.ProviderID)
|
// provider, err := s.repo.GetVirtualGameProviderByID(ctx, req.ProviderID)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
return nil, fmt.Errorf("failed to check provider %s: %w", req.ProviderID, err)
|
// return nil, fmt.Errorf("failed to check provider %s: %w", req.ProviderID, err)
|
||||||
}
|
// }
|
||||||
|
|
||||||
if !provider.Enabled {
|
// if !provider.Enabled {
|
||||||
// Provider exists but is disabled → return empty list (or error if you prefer)
|
// // Provider exists but is disabled → return empty list (or error if you prefer)
|
||||||
return nil, fmt.Errorf("provider %s is disabled", req.ProviderID)
|
// return nil, fmt.Errorf("provider %s is disabled", req.ProviderID)
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 2. Prepare signature params
|
// 2. Prepare signature params
|
||||||
sigParams := map[string]any{
|
sigParams := map[string]any{
|
||||||
|
|
|
||||||
|
|
@ -126,21 +126,21 @@ func NewApp(
|
||||||
|
|
||||||
app.Use(cors.New(cors.Config{
|
app.Use(cors.New(cors.Config{
|
||||||
AllowOrigins: "*",
|
AllowOrigins: "*",
|
||||||
AllowMethods: "GET,POST,PUT,DELETE,OPTIONS",
|
AllowMethods: "GET,POST,PUT,PATCH,DELETE,OPTIONS",
|
||||||
AllowHeaders: "Content-Type,Authorization,platform",
|
AllowHeaders: "Content-Type,Authorization,platform",
|
||||||
// AllowCredentials: true,
|
// AllowCredentials: true,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
s := &App{
|
s := &App{
|
||||||
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,
|
||||||
|
|
|
||||||
|
|
@ -154,10 +154,10 @@ func SetupReportandVirtualGameCronJobs(
|
||||||
spec string
|
spec string
|
||||||
period string
|
period string
|
||||||
}{
|
}{
|
||||||
// {
|
{
|
||||||
// spec: "*/60 * * * * *", // Every 1 minute for testing
|
spec: "*/60 * * * * *", // Every 1 minute for testing
|
||||||
// period: "test",
|
period: "test",
|
||||||
// },
|
},
|
||||||
{
|
{
|
||||||
spec: "0 0 0 * * *", // Daily at midnight
|
spec: "0 0 0 * * *", // Daily at midnight
|
||||||
period: "daily",
|
period: "daily",
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ func (h *Handler) LoginCustomer(c *fiber.Ctx) error {
|
||||||
successRes.CompanyID,
|
successRes.CompanyID,
|
||||||
h.jwtConfig.JwtAccessKey,
|
h.jwtConfig.JwtAccessKey,
|
||||||
h.jwtConfig.JwtAccessExpiry,
|
h.jwtConfig.JwtAccessExpiry,
|
||||||
);
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
h.mongoLoggerSvc.Error("Failed to create access token",
|
h.mongoLoggerSvc.Error("Failed to create access token",
|
||||||
zap.Int("status_code", fiber.StatusInternalServerError),
|
zap.Int("status_code", fiber.StatusInternalServerError),
|
||||||
|
|
@ -195,22 +195,22 @@ func (h *Handler) LoginAdmin(c *fiber.Ctx) error {
|
||||||
switch {
|
switch {
|
||||||
case errors.Is(err, authentication.ErrInvalidPassword), errors.Is(err, authentication.ErrUserNotFound):
|
case errors.Is(err, authentication.ErrInvalidPassword), errors.Is(err, authentication.ErrUserNotFound):
|
||||||
h.mongoLoggerSvc.Info("Login attempt failed: Invalid credentials",
|
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("email", req.Email),
|
||||||
zap.String("phone", req.PhoneNumber),
|
zap.String("phone", req.PhoneNumber),
|
||||||
zap.Error(err),
|
zap.Error(err),
|
||||||
zap.Time("timestamp", time.Now()),
|
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):
|
case errors.Is(err, authentication.ErrUserSuspended):
|
||||||
h.mongoLoggerSvc.Info("Login attempt failed: User login has been locked",
|
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("email", req.Email),
|
||||||
zap.String("phone", req.PhoneNumber),
|
zap.String("phone", req.PhoneNumber),
|
||||||
zap.Error(err),
|
zap.Error(err),
|
||||||
zap.Time("timestamp", time.Now()),
|
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:
|
default:
|
||||||
h.mongoLoggerSvc.Error("Login failed",
|
h.mongoLoggerSvc.Error("Login failed",
|
||||||
zap.Int("status_code", fiber.StatusInternalServerError),
|
zap.Int("status_code", fiber.StatusInternalServerError),
|
||||||
|
|
@ -296,22 +296,22 @@ func (h *Handler) LoginSuper(c *fiber.Ctx) error {
|
||||||
switch {
|
switch {
|
||||||
case errors.Is(err, authentication.ErrInvalidPassword), errors.Is(err, authentication.ErrUserNotFound):
|
case errors.Is(err, authentication.ErrInvalidPassword), errors.Is(err, authentication.ErrUserNotFound):
|
||||||
h.mongoLoggerSvc.Info("Login attempt failed: Invalid credentials",
|
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("email", req.Email),
|
||||||
zap.String("phone", req.PhoneNumber),
|
zap.String("phone", req.PhoneNumber),
|
||||||
zap.Error(err),
|
zap.Error(err),
|
||||||
zap.Time("timestamp", time.Now()),
|
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):
|
case errors.Is(err, authentication.ErrUserSuspended):
|
||||||
h.mongoLoggerSvc.Info("Login attempt failed: User login has been locked",
|
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("email", req.Email),
|
||||||
zap.String("phone", req.PhoneNumber),
|
zap.String("phone", req.PhoneNumber),
|
||||||
zap.Error(err),
|
zap.Error(err),
|
||||||
zap.Time("timestamp", time.Now()),
|
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:
|
default:
|
||||||
h.mongoLoggerSvc.Error("Login failed",
|
h.mongoLoggerSvc.Error("Login failed",
|
||||||
zap.Int("status_code", fiber.StatusInternalServerError),
|
zap.Int("status_code", fiber.StatusInternalServerError),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user