class AddHeadshotCollectionUidToProjectJob < ApplicationJob
  queue_as :default

  def perform(project)
    # TODO: move this into Project model?
    collection = HeadshotCollection.for_project(project)
    response = BrayniacAI::Collection.create!(collection)
    project.update_attribute(:headshot_collection_uid, response.collection_id)
  end
end
