class SerializableAcquiredMediaRelease < JSONAPI::Serializable::Resource
  type 'acquired_media_release'
  
  attributes :project_id, :contract_template_id, :tagging_status, :name, :person_name,
              :person_address_street1, :person_address_street2, :person_address_city, :person_address_state,
              :person_address_zip, :person_address_country, :person_phone, :person_email, :person_fax,
              :person_title, :person_company, :created_at, :updated_at, :collection_uid, :territory_old, :term_old,
              :applicable_medium_id, :applicable_medium_text, :territory_id, :territory_text, :term_id, :term_text,
              :restriction_id, :restriction_text, :categories, :description, :tag_list
  
  has_many :file_infos do
    data do
      @object.file_infos
    end

    meta do
      { count: @object.file_infos.size }
    end
  end            
end
