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
- #create_event(contact_id, content, category_id, options = {}) ⇒ Object
- #create_history_category(title, image_name, options = {}) ⇒ Object
- #delete_event_and_related_files(id) ⇒ Object
- #delete_history_category(id) ⇒ Object
- #get_all_history_categories ⇒ Object
- #get_event_list_by_filter(options = {}) ⇒ Object
- #update_history_categories_order(*titles) ⇒ Object
- #update_history_category(id, title, options = {}) ⇒ Object
- #update_history_category_icon(id, icon_name) ⇒ Object
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, = {}) @request.post(%w[history], { contactId: contact_id, content: content, categoryId: category_id }.merge()) 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, = {}) @request.post(%w[history category], { title: title.to_s, imageName: image_name.to_s }.merge()) end |
#delete_event_and_related_files(id) ⇒ Object
34 35 36 |
# File 'lib/teamlab/modules/crm/crm_history.rb', line 34 def (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_categories ⇒ Object
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( = {}) @request.get(%w[history filter], ) 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, = {}) @request.put(['history', 'category', id.to_s], { title: title }.merge()) 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 |