self.create_task

in src/task.rb [76:100]


  def self.create_task(title:,description:,status:)
    now = Time.now
    item = new(
      task_id: "#{now.to_i}_#{SecureRandom.uuid}",
      table_name: "TASK",
      title: title,
      description: description,
      status: status,
      created_at: now,
      updated_at: now,
      est_completion_date: nil,
      raw_updates: []
    )
    if item.save
      [item, nil]
    else
      if item.valid? 
        puts "[ERROR] Unknown issue trying to write valid item #{item.to_h} to app table."
        [nil, ServerError.new]
      else 
        [nil, InvalidInputException.new(item.errors.full_messages.join(", "))]
      end
    end
  end