fix telepon and init lupas

This commit is contained in:
dirgantarasiahaan
2023-05-29 19:19:25 +07:00
parent bab3a7a3d9
commit 431ad60bdb
32 changed files with 328 additions and 47 deletions

View File

@@ -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);
}
}
}