protected override async Task Handle(UpdatePermissionCommand request, CancellationToken cancellationToken)
        {
            var permission = await _permissionsRepository.GetByIdAsync(request.Id);

            permission.EmployeeFirstName = request.EmployeeFirstName;
            permission.EmployeeLastName  = request.EmployeeLastName;
            permission.PermissionTypeId  = request.PermissionTypeId;
            permission.PermissionDate    = request.PermissionDate;

            await _permissionsRepository.UpdateAsync(permission);
        }
        public async Task <PermissionDto> Handle(GetPermissionByIdQuery request, CancellationToken cancellationToken)
        {
            var permission = await _permissionsRepository.GetByIdAsync(request.Id);

            if (permission == null)
            {
                throw new NotFoundException($"El permiso con el identificador {request.Id} no existe o fue eliminado");
            }

            var permissionDto = _mapper.Map <PermissionDto>(permission);

            return(permissionDto);
        }
        protected override async Task Handle(DeletePermissionCommand request, CancellationToken cancellationToken)
        {
            var permission = await _permissionsRepository.GetByIdAsync(request.Id);

            await _permissionsRepository.DeleteAsync(permission);
        }