teamleader 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.md +7 -0
- data/lib/teamleader/api.rb +53 -7
- data/lib/teamleader/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTBmOGY3MWIyMWQ0NmU5YzY1MGEwNzY3NDY0ZjkxMjQ3YmZkN2Y5ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjYyZDQxY2QxOTA3NWEwMzQxMTlkNWMxYTE3OWM4MzA3MzkzOWZhZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODU3M2Q0YTQ0NGYyYjNiNDViMmJlMDM0NDIyYWUwMWNmOWE3YWI5MWIxM2Fm
|
10
|
+
ZDJiZjIyYjcyMmVkYWUzZmU2NTNhZGQ1OTc3ZDllNTQ1N2ExYmFmMWYwZDMz
|
11
|
+
NDdhZWVmMmRhMDk4NThhN2IwMjhlMTI5NGVhY2Q1MWVkZWFiNjc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Yjc2N2IyMDEwNDBkYWNmMzI2ZDlmZWY0NGY5OTNiNWZiNzI5NDM4N2FlNWU4
|
14
|
+
MzYzMjg1MTZlZjliOTYxMTA5Y2FkODFkYmI0MGY3M2MxYTc2MzI1MmRjMmYy
|
15
|
+
OGYxZmIwZDk5MzVhNWM4YjZkODFlOWNjODc2NWNiZDY5YmUzMzE=
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## [0.2.0] - 2017-05-12
|
5
|
+
### Added
|
6
|
+
- Method `link_contact_to_company`
|
7
|
+
- Methods for Products (add, update, delete, get one, get all)
|
8
|
+
- Methods for Invoice (add, update payment status, get PDF, get one, get all)
|
9
|
+
- Update `get_company` to accept an Hash instead of an id as parameter
|
10
|
+
|
4
11
|
## [0.1.1] - 2017-05-12
|
5
12
|
### Changed
|
6
13
|
- Mark `json` dependency version as `>= 1`
|
data/lib/teamleader/api.rb
CHANGED
@@ -41,8 +41,9 @@ module Teamleader
|
|
41
41
|
request "/addCompany.php", params
|
42
42
|
end
|
43
43
|
|
44
|
-
def get_company(
|
45
|
-
|
44
|
+
def get_company(params={})
|
45
|
+
raise "company_id is required" if params[:company_id].nil?
|
46
|
+
request "/getCompany.php", params
|
46
47
|
end
|
47
48
|
|
48
49
|
def get_companies(params={})
|
@@ -52,14 +53,27 @@ module Teamleader
|
|
52
53
|
end
|
53
54
|
|
54
55
|
def add_invoice(params={})
|
55
|
-
raise "contact_or_company" if params[:contact_or_company].nil?
|
56
|
-
raise "contact_or_company_id" if params[:contact_or_company_id].nil?
|
57
|
-
raise "sys_department_id" if params[:sys_department_id].nil?
|
56
|
+
raise "contact_or_company is required" if params[:contact_or_company].nil?
|
57
|
+
raise "contact_or_company_id is required" if params[:contact_or_company_id].nil?
|
58
|
+
raise "sys_department_id is required" if params[:sys_department_id].nil?
|
58
59
|
request "/addInvoice.php", params
|
59
60
|
end
|
60
61
|
|
61
|
-
def
|
62
|
-
|
62
|
+
def update_invoice_payment_status(params={})
|
63
|
+
raise "invoice_id is required" if params[:invoice_id].nil?
|
64
|
+
raise "status is required" if params[:status].nil?
|
65
|
+
raise "status must be 'paid' or 'not_paid'" unless ['paid', 'not_paid'].include?(params[:status])
|
66
|
+
request "/setInvoicePaymentStatus.php", params
|
67
|
+
end
|
68
|
+
|
69
|
+
def get_invoice(params={})
|
70
|
+
raise "invoice_id is required" if params[:invoice_id].nil?
|
71
|
+
request "/getInvoice.php", params
|
72
|
+
end
|
73
|
+
|
74
|
+
def download_invoice_pdf(params={})
|
75
|
+
raise "invoice_id is required" if params[:invoice_id].nil?
|
76
|
+
request "/downloadInvoicePDF.php", params
|
63
77
|
end
|
64
78
|
|
65
79
|
def get_invoices(params={})
|
@@ -68,6 +82,38 @@ module Teamleader
|
|
68
82
|
request "/getInvoices.php", params
|
69
83
|
end
|
70
84
|
|
85
|
+
def add_product(params={})
|
86
|
+
raise "name is required" if params[:name].nil?
|
87
|
+
raise "price is required" if params[:price].nil?
|
88
|
+
request "/addProduct.php", params
|
89
|
+
end
|
90
|
+
|
91
|
+
def update_product(params={})
|
92
|
+
raise "product_id is required" if params[:product_id].nil?
|
93
|
+
request "/updateProduct.php", params
|
94
|
+
end
|
95
|
+
|
96
|
+
def delete_product(params={})
|
97
|
+
raise "product_id is required" if params[:product_id].nil?
|
98
|
+
request "/deleteProduct.php", params
|
99
|
+
end
|
100
|
+
|
101
|
+
def get_product(params={})
|
102
|
+
raise "product_id is required" if params[:product_id].nil?
|
103
|
+
request "/getProduct.php", params
|
104
|
+
end
|
105
|
+
|
106
|
+
def get_product(params={})
|
107
|
+
raise "product_id is required" if params[:product_id].nil?
|
108
|
+
request "/getProduct.php", params
|
109
|
+
end
|
110
|
+
|
111
|
+
def get_products(params={})
|
112
|
+
raise "amount is required" if params[:amount].nil?
|
113
|
+
raise "pageno is required" if params[:pageno].nil?
|
114
|
+
request "/getProducts.php", params
|
115
|
+
end
|
116
|
+
|
71
117
|
private
|
72
118
|
def request(path, data={})
|
73
119
|
headers = {
|
data/lib/teamleader/version.rb
CHANGED