code: def add(
      self, name, project_name, query_str, start_at, end_at, repeat_str
  ):
      if project_name is None:
          project_name = "mindsdb"
      project_controller = ProjectController()
      project = project_controller.get(name=project_name)
  
      # check if exists
      record = (
          db.session.query(db.Jobs)
          .filter_by(
              company_id=ctx.company_id,
              name=name,
              project_id=project.id,
              deleted_at=sa.null(),
          )
          .first()
      )
      if record is not None:
          raise EntityExistsError(f"Job already exists: {name}")
  
      if start_at is not None:
          start_at = self._parse_date(start_at)
          if start_at < dt.datetime.now():
              start_at = dt.datetime.now()
      else:
          start_at = dt.datetime.now()
  
      if end_at is not None:
          end_at = self._parse_date(end_at)
  
          if end_at < start_at:
              raise Exception(f"Wrong end date {start_at} > {end_at}")
  
      # check sql = try to parse it
      for sql in split_sql(query_str):
          try:
              # replace template variables with null
              sql = re.sub(r"\{\{[\w\d]+}}", "", sql)
  
              parse_sql(sql, dialect="mindsdb")
          except ParsingException as e:
              raise ParsingException(f"Unable to parse: {sql}: {e}")
  
      # plan next run
      next_run_at = start_at
  
      schedule_str = None
      if repeat_str is not None:
          schedule_str = "every " + repeat_str
  
          # try to calculate schedule string
          calc_next_date(schedule_str, start_at)
      else:
          # no schedule for job end_at is meaningless
          end_at = None
  
      # create job record
      record = db.Jobs(
          company_id=ctx.company_id,
          user_class=ctx.user_class,
          name=name,
          project_id=project.id,
          query_str=query_str,
          start_at=start_at,
          end_at=end_at,
          next_run_at=next_run_at,
          schedule_str=schedule_str,
      )
      db.session.add(record)
      db.session.commit()
  
imports: import re
  import datetime
  from dateutil.relativedelta import relativedelta
  import sqlalchemy
  from mindsdb_sql import parse_sql, ParsingException
  from mindsdb.utilities.context import context
  from mindsdb.utilities.exception import EntityNotExistsError, EntityExistsError
  from mindsdb.interfaces.storage import db
  from mindsdb.interfaces.database.projects import ProjectController
  from mindsdb.interfaces.query_context.context_controller import query_context_controller
  from mindsdb.utilities import log
label_desc: Use image node_id 1 for calling the JobsController obj's underlying member method code with example usage: obj.add(name, project_name, query_str, start_at, end_at, repeat_str) without return types