Пример #1
0
        public OutputBase ApproveLeaveRequest(ApproveLeaveRequestInput input)
        {
            var request = _leaveRequestRepository.FirstOrDefault(r => r.Id == input.LeaveRequestId);

            if (request == null)
            {
                return new OutputBase {
                           Message = "Invalid Request Id", Success = false
                }
            }
            ;
            var employee = _employeeRepository.Get(request.EmployeeId);

            request.Status = LeaveRequestStatus.Approved;
            return(AssignLeave(new AssignLeaveInput
            {
                LeaveTypeId = request.LeaveTypeId,
                StartDate = request.StartDate,
                EndDate = request.EndDate,
                EmployeeNumber = employee.Number
            }));
        }