private AgreedClientAction MapDtoToAction(AgreedActionDTO dto)
        {
            var action = new AgreedClientAction();

            if (dto.Id.HasValue)
            {
                action.Id = dto.Id.Value;
            }

            action.ActionId         = dto.Action.Id.Value;
            action.PlannedStartTime = dto.PlannedStartTime.TimeOfDay;

            if (dto.EstimatedDurationMinutes.HasValue)
            {
                action.EstimatedDurationMinutes = dto.EstimatedDurationMinutes.Value;
            }
            else
            {
                var duration = (int)(dto.PlannedEndTime - dto.PlannedStartTime).TotalMinutes;
                action.EstimatedDurationMinutes = duration;
            }

            action.ClientActionSpecificDescription = dto.ClientActionSpecificDescription;
            action.Day              = dto.Day;
            action.EmployeeId       = dto.EmployeeId;
            action.IndividualPlanId = dto.IndividualPlanId;

            return(action);
        }
        // mappers
        private AgreedActionDTO MapActionToDto(AgreedClientAction action)
        {
            var dto = new AgreedActionDTO();

            dto.Id = action.Id;
            dto.ClientActionSpecificDescription = action.ClientActionSpecificDescription;
            dto.EstimatedDurationMinutes        = action.EstimatedDurationMinutes;
            dto.PlannedStartTime = DateTime.Today.Add(action.PlannedStartTime);
            dto.PlannedEndTime   = DateTime.Today.Add(action.PlannedStartTime).AddMinutes(action.EstimatedDurationMinutes);
            dto.Action           = MapActionToDto(action.Action);
            dto.IndividualPlanId = action.IndividualPlanId;
            dto.EmployeeId       = action.EmployeeId;
            dto.Day = action.Day;

            return(dto);
        }
        public void UpdateAgreedAction(AgreedActionDTO dto)
        {
            var action = MapDtoToAction(dto);

            _agreedActionsApiService.UpdateAgreedClientAction(action);
        }