teamlab 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Changelog.md +4 -0
- data/lib/teamlab/modules/crm.rb +20 -6
- data/lib/teamlab/version.rb +1 -1
- data/spec/lib/crm_spec.rb +28 -3
- data/spec/support/http_data.rb +3 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3f8ece2f290ad01dafb96410607fc621f58797c
|
4
|
+
data.tar.gz: e3f9cb9314231a312651c54b4a02d2d2ef822c1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 538543131c37c9935d9795e3d97af3e9d374c24e61e9d842c5ea1ce8e6df1176a06f883dff49a3bd949469e17b299153ea256047774322e95094be17d355349a
|
7
|
+
data.tar.gz: 579cdab75bd8f5c2c6f2bfa9a80b98234e45bbdaf43d53ecede20fcd080573429c140aad14e90a171de1185ec8cb36c957c4a747f79d99af5b1b18477eaf682f
|
data/Changelog.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## 0.5.0
|
4
|
+
* Add crm methods: save_smtp_settings, update_crm_currency, update_organisation_company_name, update_organisation_address
|
5
|
+
* Change method create_invoice
|
6
|
+
|
3
7
|
## 0.4.0
|
4
8
|
* Add portal submodule with `Portal#invite_user_url` and `Portal#invite_visitor_url` methods
|
5
9
|
* Add rubocop support in project. Fix a lot of minor problems, should have no impact on existing working code
|
data/lib/teamlab/modules/crm.rb
CHANGED
@@ -162,14 +162,12 @@ module Teamlab
|
|
162
162
|
@request.post(%w(task), { title: title, deadline: deadline, responsibleId: responsible_id, categoryId: category_id }.merge(options))
|
163
163
|
end
|
164
164
|
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
165
|
+
def create_invoice(number, issue_date, client_id, due_date, language, currency, exchange_rate, terms, invoice_line, options)
|
166
|
+
@request.post(%w(invoice), {number: number, issueDate: issue_date, contactId: client_id, dueDate: due_date,
|
167
|
+
language: language, currency: currency, exchangeRate: exchange_rate, terms: terms,
|
168
|
+
invoiceLines: invoice_line}.merge(options))
|
169
169
|
end
|
170
170
|
|
171
|
-
#=========================================== TODO: OPTIONAL VARIABLES =====================================================
|
172
|
-
|
173
171
|
def create_invoice_line(invoice_id, options = {})
|
174
172
|
@request.post(%w(invoiceline), { invoiceId: invoice_id }.merge(options))
|
175
173
|
end
|
@@ -218,6 +216,14 @@ module Teamlab
|
|
218
216
|
@request.put(%w(settings), options)
|
219
217
|
end
|
220
218
|
|
219
|
+
def save_smtp_settings(options = {})
|
220
|
+
@request.put(%w(settings smtp), options)
|
221
|
+
end
|
222
|
+
|
223
|
+
def update_crm_currency(currency)
|
224
|
+
@request.put(%w(settings currency), {currency: currency})
|
225
|
+
end
|
226
|
+
|
221
227
|
def update_task(task_id, title, deadline, category_id, options = {})
|
222
228
|
@request.put(['task', task_id.to_s], { title: title, deadline: deadline, categoryid: category_id }.merge(options))
|
223
229
|
end
|
@@ -256,6 +262,14 @@ module Teamlab
|
|
256
262
|
@request.put(%w(contact filter access), options)
|
257
263
|
end
|
258
264
|
|
265
|
+
def update_organisation_company_name(title)
|
266
|
+
@request.put(%w(settings organisation base), {companyName: title})
|
267
|
+
end
|
268
|
+
|
269
|
+
def update_organisation_address(text)
|
270
|
+
@request.put(%w(settings organisation address), {companyAddress: text})
|
271
|
+
end
|
272
|
+
|
259
273
|
def update_statuses_contact_order(options = {})
|
260
274
|
@request.put(%w(contact status reorder), options)
|
261
275
|
end
|
data/lib/teamlab/version.rb
CHANGED
data/spec/lib/crm_spec.rb
CHANGED
@@ -77,9 +77,8 @@ describe '[CRM]' do
|
|
77
77
|
|
78
78
|
describe '#create_invoice' do
|
79
79
|
it_should_behave_like 'an api request' do
|
80
|
-
pending 'http://bugzserver/show_bug.cgi?id=23886'
|
81
80
|
let(:command) { :create_invoice }
|
82
|
-
let(:args) { [] }
|
81
|
+
let(:args) { [random_word, DUE_DATE, random_id(:user), DUE_DATE, LANGUAGE.sample, CURRENCY.sample, rand(1000), random_word, random_id(:invoice_line)] }
|
83
82
|
let(:add_data_to_collector) { true }
|
84
83
|
let(:data_param) { :invoice_ids }
|
85
84
|
let(:param_names) { %w(id) }
|
@@ -109,7 +108,6 @@ describe '[CRM]' do
|
|
109
108
|
|
110
109
|
describe '#create_invoice_line' do
|
111
110
|
it_should_behave_like 'an api request' do
|
112
|
-
pending 'http://bugzserver/show_bug.cgi?id=23886, http://bugzserver/show_bug.cgi?id=23888'
|
113
111
|
let(:command) { :create_invoice_line }
|
114
112
|
let(:args) { [random_id(:invoice)] }
|
115
113
|
let(:add_data_to_collector) { true }
|
@@ -533,6 +531,20 @@ describe '[CRM]' do
|
|
533
531
|
end
|
534
532
|
end
|
535
533
|
|
534
|
+
describe '#update_organisation_company_name' do
|
535
|
+
it_should_behave_like 'an api request' do
|
536
|
+
let(:command) { :update_organisation_company_name }
|
537
|
+
let(:args) { [random_word] }
|
538
|
+
end
|
539
|
+
end
|
540
|
+
|
541
|
+
describe '#update_organisation_address' do
|
542
|
+
it_should_behave_like 'an api request' do
|
543
|
+
let(:command) { :update_organisation_address }
|
544
|
+
let(:args) { [random_word] }
|
545
|
+
end
|
546
|
+
end
|
547
|
+
|
536
548
|
describe '#update_contact_type' do
|
537
549
|
it_should_behave_like 'an api request' do
|
538
550
|
let(:command) { :update_contact_type }
|
@@ -564,6 +576,19 @@ describe '[CRM]' do
|
|
564
576
|
end
|
565
577
|
end
|
566
578
|
|
579
|
+
describe '#update_crm_currency' do
|
580
|
+
it_should_behave_like 'an api request' do
|
581
|
+
let(:command) { :update_crm_currency }
|
582
|
+
let(:args) { [CURRENCY.sample] }
|
583
|
+
end
|
584
|
+
end
|
585
|
+
|
586
|
+
describe '#save_smtp_settings' do
|
587
|
+
it_should_behave_like 'an api request' do
|
588
|
+
let(:command) { :save_smtp_settings }
|
589
|
+
end
|
590
|
+
end
|
591
|
+
|
567
592
|
describe '#save_number_settings' do
|
568
593
|
it_should_behave_like 'an api request' do
|
569
594
|
let(:command) { :save_number_settings }
|
data/spec/support/http_data.rb
CHANGED
@@ -89,6 +89,9 @@ CONTACT_INFO_TYPES = %w(Phone Email Website Skype Twitter LinkedIn Facebook Live
|
|
89
89
|
ENTITY_TYPES = %w(opportunity company contact)
|
90
90
|
USER_FIELDS = %w(TextField TextArea SelectBox CheckBox Heading Date)
|
91
91
|
IMAGE_URL = 'http://thebooksmugglers.com/wp-content/uploads/2009/02/image002-200x300.jpg' # 'http://www.soulscode.com/wp-content/uploads/2011/02/doll-200x300.jpg'
|
92
|
+
DUE_DATE = '2020-04-10T08:00:00.0000000+03:00'
|
93
|
+
LANGUAGE = %w(az-Latn-AZ cs-CZ de-DE el-GR en-GB en-US es-ES fi-FI fr-FR it-IT ja-JP ko-KR lv-LV pl-PL pt-BR pt-PT ru-RU sl-SI tr-TR uk-UA vi-VN zh-CN)
|
94
|
+
CURRENCY = %w(AUD CAD CHF EUR GBP JPY USD AMD ARS AZN BDT BGN BRL BYR CLP CNY COP CRC CUP CZK DKK DOP DZD GEL HKD HRK HUF IDR ILS INR KRW KWD KZT LTL LVL MAD MDL MGA MUR MXN MYR NGN NOK NZD PHP PKR PLN RUB SAR SEK SGD THB TRY TTD UAH UZS VEF VND XAF XOF ZAR)
|
92
95
|
# endregion
|
93
96
|
|
94
97
|
# region Community
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teamlab
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rzagudaev
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2016-01-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httparty
|
@@ -166,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
166
166
|
version: '0'
|
167
167
|
requirements: []
|
168
168
|
rubyforge_project:
|
169
|
-
rubygems_version: 2.
|
169
|
+
rubygems_version: 2.5.1
|
170
170
|
signing_key:
|
171
171
|
specification_version: 4
|
172
172
|
summary: Ruby gem for OnlyOffice\TeamLab
|