Search in sources :

Example 1 with IdmRequest

use of eu.bcvsolutions.idm.core.model.entity.IdmRequest in project CzechIdMng by bcvsolutions.

the class DefaultIdmRequestService method toEntity.

@Override
protected IdmRequest toEntity(IdmRequestDto dto, IdmRequest entity) {
    if (this.isNew(dto)) {
        dto.setResult(new OperationResultDto(OperationState.CREATED));
        dto.setState(RequestState.CONCEPT);
    } else if (dto.getResult() == null) {
        IdmRequestDto persistedDto = this.get(dto.getId());
        dto.setResult(persistedDto.getResult());
    }
    IdmRequest requestEntity = super.toEntity(dto, entity);
    return requestEntity;
}
Also used : OperationResultDto(eu.bcvsolutions.idm.core.api.dto.OperationResultDto) IdmRequest(eu.bcvsolutions.idm.core.model.entity.IdmRequest) IdmRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmRequestDto)

Aggregations

IdmRequestDto (eu.bcvsolutions.idm.core.api.dto.IdmRequestDto)1 OperationResultDto (eu.bcvsolutions.idm.core.api.dto.OperationResultDto)1 IdmRequest (eu.bcvsolutions.idm.core.model.entity.IdmRequest)1