fix telepon and init lupas
This commit is contained in:
@@ -38,12 +38,7 @@ public class PostCreateDrpService implements BaseService<DrpRequest, DrpResponse
|
||||
@Override
|
||||
public DrpResponse execute(DrpRequest input) {
|
||||
|
||||
Optional<Drp> drpOptional = drpRepository.findByTahunAndIsDeleteFalse(input.getTahun());
|
||||
if (drpOptional.isPresent()) {
|
||||
throw new BusinessException(Constants.ERR_CODE_10010,
|
||||
Constants.ERR_TTL_10010,
|
||||
Constants.ERR_MSG_10010);
|
||||
}
|
||||
validateTahunDrp(input);
|
||||
|
||||
Drp drp = Drp.builder()
|
||||
.tahun(input.getTahun())
|
||||
@@ -90,4 +85,13 @@ public class PostCreateDrpService implements BaseService<DrpRequest, DrpResponse
|
||||
.id(drpSaved.getId())
|
||||
.build();
|
||||
}
|
||||
|
||||
public void validateTahunDrp(DrpRequest input) {
|
||||
Optional<Drp> drpOptional = drpRepository.findByTahunAndIsDeleteFalse(input.getTahun());
|
||||
if (drpOptional.isPresent()) {
|
||||
throw new BusinessException(Constants.ERR_CODE_10010,
|
||||
Constants.ERR_TTL_10010,
|
||||
Constants.ERR_MSG_10010);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user