Untitled
unknown
java
2 years ago
498 B
9
Indexable
private void isSupplyExistentAndActive(Long id) {
Supplies supplies = suppliesRepository
.findById(id)
.orElseThrow(() -> new BadRequestAlertException(Translator.toLocal("entity.not.found"), ENTITY_NAME, "idnotfound"));
if (Objects.equals(supplies.getStatus(), Constants.STATUS.DELETE)) throw new BadRequestAlertException(
Translator.toLocal("entity.not.active"),
ENTITY_NAME,
"entityNotActive"
);
}Editor is loading...