public void CompleteWorkTask(Identity <WorkTask> id)
        {
            var target = _WorkTaskRepository.SelectById(id);

            if (target == null)
            {
                throw new NotFoundException("完了対象がみつかりませんでした");
            }

            var spec = new WorkTaskCompletionSpecification(_WorkingTimeRangeRepository);

            var result = spec.IsSatisfiedBy(target);

            if (result != ValidationResult.Success)
            {
                throw new SpecificationCheckException(result);
            }

            target.Complete();

            _WorkTaskRepository.Edit(target);
        }
示例#2
0
 public void Edit(WorkTask workTask)
 {
     _TaskRepository.Edit(workTask);
 }