public GenericObjectResponse <List <WorkingHoursPayload> > ChangeWorkingHours(long roomId, [FromBody] List <WorkingHoursPayload> payload)
        {
            long?userId = AuthenticationService.IsAuthorized(Request, UserRole.RoomOwner);

            if (userId == null)
            {
                Response.StatusCode = 401;
                return(new GenericObjectResponse <List <WorkingHoursPayload> >(""));
            }

            RoomValidationService roomValidationService = new RoomValidationService();
            GenericStatusMessage  roomExistsValidation  = roomValidationService.ValidateRoomExistsAndOwnedByUser(roomId, userId.Value);

            if (!roomExistsValidation.Success)
            {
                Response.StatusCode = 404;
                return(new GenericObjectResponse <List <WorkingHoursPayload> >("Not found."));
            }

            WorkingHoursManipulationService service = new WorkingHoursManipulationService();
            GenericObjectResponse <List <WorkingHoursPayload> > response = service.ChangeWorkingHoursForRoom(roomId, payload);

            if (!response.Status.Success)
            {
                Response.StatusCode = 400;
            }

            return(response);
        }
        public async Task <GenericObjectResponse <RoomResponse> > ChangeRoomData([FromBody] CreateRoomPayload payload, long roomId)
        {
            long?userId = AuthenticationService.IsAuthorized(Request, UserRole.RoomOwner);

            if (userId == null)
            {
                Response.StatusCode = 401;
                return(new GenericObjectResponse <RoomResponse>(""));
            }

            RoomValidationService roomValidationService = new RoomValidationService();
            GenericStatusMessage  roomExistsValidation  = roomValidationService.ValidateRoomExistsAndOwnedByUser(roomId, userId.Value);

            if (!roomExistsValidation.Success)
            {
                Response.StatusCode = 404;
                return(new GenericObjectResponse <RoomResponse>("Not found."));
            }

            RoomManipulationService roomManipulationService = new RoomManipulationService();

            return(await roomManipulationService.ChangeRoomData(payload, roomId));
        }
        private GenericStatusMessage ChangeRoomActivation(long roomId, bool activate, bool force = false)
        {
            long?userId = AuthenticationService.IsAuthorized(Request, UserRole.RoomOwner);

            if (userId == null)
            {
                Response.StatusCode = 401;
                return(new GenericStatusMessage(false, ""));
            }

            RoomValidationService roomValidationService = new RoomValidationService();
            GenericStatusMessage  roomExistsValidation  = roomValidationService.ValidateRoomExistsAndOwnedByUser(roomId, userId.Value);

            if (!roomExistsValidation.Success)
            {
                Response.StatusCode = 404;
                return(new GenericStatusMessage(false, "Not found."));
            }

            RoomManipulationService roomManipulationService = new RoomManipulationService();

            return(roomManipulationService.ChangeRoomActivation(roomId, activate, force));
        }