module OA
  class UploadManualAdjustmentPage < OA::BasePage
    page_url "/accounting/upload_manual_adjustments.php"

    link(:download_template_link, id: "downloadManualAdjustmentTemplate")
    file_field(:choose_file, name: "prmUserFile")
    button(:upload_button, name: "exUpload")
    element(:validation_errors, :tr, id: "upload-manual-adustments-errors")

    def template_url
      download_template_link_element.href
    end

    def upload_file(file_path)
      self.choose_file = file_path
      upload_button
    end
  end
end
