Untitled

Anonymous
java
08/27/2023 12:54 PM
664 B
16
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...