private BillOfMaterialsDTO convertToDTO(BillOfMaterials model) {
    BillOfMaterialsDTO dto = new BillOfMaterialsDTO();

    dto.setId(model.getId());
    dto.setDescription(model.getDescription());
    dto.setParts(model.getParts());

    return dto;
  }
  @Override
  public BillOfMaterialsDTO update(BillOfMaterialsDTO billOfMaterials) {
    LOGGER.info("Updating bill of materials entry with information: {}", billOfMaterials);

    BillOfMaterials updated = findbillOfMaterialsById(billOfMaterials.getId());
    updated.update(billOfMaterials.getDescription(), billOfMaterials.getParts());
    updated = repository.save(updated);

    LOGGER.info("Updated bill of materials entry with information: {}", updated);

    return convertToDTO(updated);
  }
  @Override
  public BillOfMaterialsDTO create(BillOfMaterialsDTO billOfMaterials) {
    LOGGER.info("Creating a new bill of materials entry with information: {}", billOfMaterials);

    BillOfMaterials persisted =
        BillOfMaterials.getBuilder()
            .description(billOfMaterials.getDescription())
            .parts(billOfMaterials.getParts())
            .build();

    persisted = repository.save(persisted);
    LOGGER.info("Created a new bill of materials entry with information: {}", persisted);

    return convertToDTO(persisted);
  }