(c *fiber.Ctx)
| 54 | } |
| 55 | |
| 56 | func (bundleController *bundleControllerImpl) CreateNewBundle(c *fiber.Ctx) error { |
| 57 | var createNewBundleRequest types.CreateNewBundleRequest |
| 58 | validationErrors := utils.BindAndValidate(c, &createNewBundleRequest) |
| 59 | if len(validationErrors) > 0 { |
| 60 | logger.L.Error("In CreateNewBundle: Validation errors", zap.Any("validationErrors", validationErrors)) |
| 61 | return utils.ValidationErrorResponse(c, validationErrors) |
| 62 | } |
| 63 | authKey := c.Locals("authKey").(*model.AuthKey) |
| 64 | createdBy := authKey.CreatedBy |
| 65 | logger.L.Info("In CreateNewBundle: Creating new bundle", zap.Any("keyUser", createdBy), zap.Any("createNewBundleRequest", createNewBundleRequest)) |
| 66 | bundle, err := bundleController.bundleService.CreateNewBundle(&createNewBundleRequest, createdBy) |
| 67 | if err != nil { |
| 68 | logger.L.Error("In CreateNewBundle: Failed to create new bundle", zap.Error(err)) |
| 69 | return utils.ErrorResponse(c, err.Error()) |
| 70 | } |
| 71 | logger.L.Info("In CreateNewBundle: New bundle created successfully", zap.Any("bundle", bundle)) |
| 72 | return utils.SuccessResponse(c, bundle) |
| 73 | } |
| 74 | |
| 75 | func (bundleController *bundleControllerImpl) Rollback(c *fiber.Ctx) error { |
| 76 | var rollbackRequest types.RollbackRequest |
nothing calls this directly
no test coverage detected