# typed: strict
class Job::PostFileJob < Scraper::JobBase
  extend T::Sig
  include Domain::StaticFileJobHelper

  queue_as :static_file

  sig { override.returns(Symbol) }
  def self.http_factory_method
    :get_generic_http_client
  end

  sig { override.params(args: T::Hash[Symbol, T.untyped]).returns(T.untyped) }
  def perform(args)
    post_file = T.cast(args[:post_file], Domain::PostFile)
    post = post_file.post
    logger.tagged(make_arg_tag(post_file), make_arg_tag(post)) do
      download_post_file(post_file)
    end
  end
end
