code: def edit(id: int, parent: int, alloc: Decimal):
      
      saved = False
  
      # load
      app = AppAggregate()
      item = app.get(id)
      if not item:
          raise KeyError("Asset Class with id %s not found.", id)
  
      if parent:
          assert parent != id, "Parent can not be set to self."
  
          # TODO check if parent exists?
  
          item.parentid = parent
          saved = True
          # click.echo(f"parent set to {parent}")
  
      if alloc:
          assert alloc != Decimal(0)
  
          item.allocation = alloc
          saved = True
  
      app.save()
      if saved:
          click.echo("Data saved.")
      else:
          click.echo("No data modified. Use --help to see possible parameters.")
docs: Edit asset class