public async Task Remove(UserEvent userEvent)
        {
            db.UserEventRecords.Remove(userEvent);
            await db.SaveChangesAsync();

            WorkingDay workingDay = await workingDayRepository.GetWorkingDayByID(userEvent.WorkingDayID);

            await workingDayRepository.UpdateTimes(workingDay);

            await workingDayRepository.CheckOffensesInRange(workingDay.UserID, workingDay.Date, workingDay.Date);
        }
        public async Task UpdateEditEventRequestList(List <EditEventRequest> requestsList)
        {
            foreach (EditEventRequest request in requestsList)
            {
                // Update the original event if the edit request is approved
                if (request.Approval == Approval.Approved)
                {
                    UserEvent updatedEvent = await userEventRepository.GetEventByID(request.UserEventID);

                    WorkingDay workingDay = await workingDayRepository.GetWorkingDayByID(updatedEvent.WorkingDayID);

                    updatedEvent.Time = request.NewTime;
                    await userEventRepository.Update(updatedEvent);

                    await workingDayRepository.UpdateTimes(workingDay);

                    await workingDayRepository.CheckOffensesInRange(workingDay.UserID, workingDay.Date, DateTime.Today.AddDays(-1));
                }
                db.EditEventRequests.Update(request);
            }
            await db.SaveChangesAsync();
        }