Module: Teamlab::CrmHistory

Included in:
Crm
Defined in:
lib/teamlab/modules/crm/crm_history.rb

Overview

Methods for working with crm history

Instance Method Summary collapse

Instance Method Details

#create_event(contact_id, content, category_id, options = {}) ⇒ Object



14
15
16
# File 'lib/teamlab/modules/crm/crm_history.rb', line 14

def create_event(contact_id, content, category_id, options = {})
  @request.post(%w[history], { contactId: contact_id, content: content, categoryId: category_id }.merge(options))
end

#create_history_category(title, image_name, options = {}) ⇒ Object



18
19
20
# File 'lib/teamlab/modules/crm/crm_history.rb', line 18

def create_history_category(title, image_name, options = {})
  @request.post(%w[history category], { title: title.to_s, imageName: image_name.to_s }.merge(options))
end


34
35
36
# File 'lib/teamlab/modules/crm/crm_history.rb', line 34

def delete_event_and_related_files(id)
  @request.delete(['history', id.to_s])
end

#delete_history_category(id) ⇒ Object



38
39
40
# File 'lib/teamlab/modules/crm/crm_history.rb', line 38

def delete_history_category(id)
  @request.delete(['history', 'category', id.to_s])
end

#get_all_history_categoriesObject



10
11
12
# File 'lib/teamlab/modules/crm/crm_history.rb', line 10

def get_all_history_categories
  @request.get(%w[history category])
end

#get_event_list_by_filter(options = {}) ⇒ Object



6
7
8
# File 'lib/teamlab/modules/crm/crm_history.rb', line 6

def get_event_list_by_filter(options = {})
  @request.get(%w[history filter], options)
end

#update_history_categories_order(*titles) ⇒ Object



26
27
28
# File 'lib/teamlab/modules/crm/crm_history.rb', line 26

def update_history_categories_order(*titles)
  @request.put(%w[history category reorder], titles: titles.flatten)
end

#update_history_category(id, title, options = {}) ⇒ Object



22
23
24
# File 'lib/teamlab/modules/crm/crm_history.rb', line 22

def update_history_category(id, title, options = {})
  @request.put(['history', 'category', id.to_s], { title: title }.merge(options))
end

#update_history_category_icon(id, icon_name) ⇒ Object



30
31
32
# File 'lib/teamlab/modules/crm/crm_history.rb', line 30

def update_history_category_icon(id, icon_name)
  @request.put(['history', 'category', id.to_s, 'icon'], imageName: icon_name.to_s)
end