quaderno 1.11.2 → 1.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +53 -1
- data/VERSION +1 -1
- data/changelog.md +3 -0
- data/lib/quaderno-ruby/base.rb +12 -2
- data/lib/quaderno-ruby/behavior/crud.rb +56 -11
- data/lib/quaderno-ruby/behavior/deliver.rb +10 -2
- data/lib/quaderno-ruby/behavior/payment.rb +23 -4
- data/lib/quaderno-ruby/behavior/retrieve.rb +11 -2
- data/lib/quaderno-ruby/collection.rb +22 -0
- data/lib/quaderno-ruby/helpers/authentication.rb +26 -0
- data/lib/quaderno-ruby.rb +4 -1
- data/quaderno.gemspec +16 -5
- data/test/fixtures/quaderno_cassettes/all_contacts.yml +11 -282
- data/test/fixtures/quaderno_cassettes/all_contacts_by_access_token.yml +56 -0
- data/test/fixtures/quaderno_cassettes/all_contacts_by_authentication_token.yml +57 -0
- data/test/fixtures/quaderno_cassettes/all_estimates.yml +10 -14
- data/test/fixtures/quaderno_cassettes/all_expenses.yml +14 -47
- data/test/fixtures/quaderno_cassettes/all_invoices.yml +13 -2873
- data/test/fixtures/quaderno_cassettes/all_items.yml +8 -8
- data/test/fixtures/quaderno_cassettes/all_receipts.yml +11 -14
- data/test/fixtures/quaderno_cassettes/all_webhooks.yml +40 -36
- data/test/fixtures/quaderno_cassettes/create_estimate_on_downgraded_API.yml +46 -318
- data/test/fixtures/quaderno_cassettes/create_expense_on_downgraded_API.yml +125 -357
- data/test/fixtures/quaderno_cassettes/create_invoice_on_downgraded_API.yml +45 -318
- data/test/fixtures/quaderno_cassettes/create_receipt_on_downgraded_API.yml +56 -53
- data/test/fixtures/quaderno_cassettes/deleted_contact.yml +40 -592
- data/test/fixtures/quaderno_cassettes/deleted_contact_by_access_token.yml +199 -0
- data/test/fixtures/quaderno_cassettes/deleted_contact_by_authentication_token.yml +199 -0
- data/test/fixtures/quaderno_cassettes/deleted_estimate.yml +40 -334
- data/test/fixtures/quaderno_cassettes/deleted_expense.yml +43 -364
- data/test/fixtures/quaderno_cassettes/deleted_invoice.yml +44 -3199
- data/test/fixtures/quaderno_cassettes/deleted_item.yml +22 -22
- data/test/fixtures/quaderno_cassettes/deleted_receipt.yml +43 -42
- data/test/fixtures/quaderno_cassettes/deleted_webhook.yml +48 -44
- data/test/fixtures/quaderno_cassettes/delivered_estimate.yml +25 -32
- data/test/fixtures/quaderno_cassettes/delivered_invoice.yml +29 -2888
- data/test/fixtures/quaderno_cassettes/delivered_receipt.yml +29 -29
- data/test/fixtures/quaderno_cassettes/evidence_invoice.yml +19 -354
- data/test/fixtures/quaderno_cassettes/found_contact.yml +19 -291
- data/test/fixtures/quaderno_cassettes/found_contact_by_access_token.yml +99 -0
- data/test/fixtures/quaderno_cassettes/found_contact_by_authentication_token.yml +100 -0
- data/test/fixtures/quaderno_cassettes/found_estimate.yml +20 -24
- data/test/fixtures/quaderno_cassettes/found_expense.yml +24 -94
- data/test/fixtures/quaderno_cassettes/found_invoice.yml +22 -2886
- data/test/fixtures/quaderno_cassettes/found_item.yml +18 -16
- data/test/fixtures/quaderno_cassettes/found_receipt.yml +21 -24
- data/test/fixtures/quaderno_cassettes/found_webhook.yml +24 -22
- data/test/fixtures/quaderno_cassettes/new_contact.yml +9 -7
- data/test/fixtures/quaderno_cassettes/new_contact_by_access_token.yml +48 -0
- data/test/fixtures/quaderno_cassettes/new_contact_by_authentication_token.yml +48 -0
- data/test/fixtures/quaderno_cassettes/new_estimate.yml +29 -320
- data/test/fixtures/quaderno_cassettes/new_evidence.yml +10 -8
- data/test/fixtures/quaderno_cassettes/new_expense.yml +42 -363
- data/test/fixtures/quaderno_cassettes/new_invoice.yml +29 -324
- data/test/fixtures/quaderno_cassettes/new_item.yml +10 -8
- data/test/fixtures/quaderno_cassettes/new_receipt.yml +28 -24
- data/test/fixtures/quaderno_cassettes/new_webhook.yml +16 -14
- data/test/fixtures/quaderno_cassettes/paid_expense.yml +22 -52
- data/test/fixtures/quaderno_cassettes/paid_invoice.yml +22 -2879
- data/test/fixtures/quaderno_cassettes/rate_limit.yml +5 -5
- data/test/fixtures/quaderno_cassettes/unpay_an_expense.yml +29 -61
- data/test/fixtures/quaderno_cassettes/unpay_an_invoice.yml +28 -2888
- data/test/fixtures/quaderno_cassettes/updated_contact.yml +22 -292
- data/test/fixtures/quaderno_cassettes/updated_contact_by_access_token.yml +101 -0
- data/test/fixtures/quaderno_cassettes/updated_contact_by_authentication_token.yml +102 -0
- data/test/fixtures/quaderno_cassettes/updated_estimate.yml +44 -353
- data/test/fixtures/quaderno_cassettes/updated_expense.yml +43 -346
- data/test/fixtures/quaderno_cassettes/updated_invoice.yml +43 -361
- data/test/fixtures/quaderno_cassettes/updated_item.yml +21 -17
- data/test/fixtures/quaderno_cassettes/updated_receipt.yml +47 -41
- data/test/fixtures/quaderno_cassettes/updated_webhook.yml +35 -31
- data/test/helper.rb +2 -1
- data/test/unit/test_quaderno_contacts.rb +1 -1
- data/test/unit/test_quaderno_contacts_thread_safe.rb +104 -0
- data/test/unit/test_quaderno_expenses.rb +5 -5
- metadata +15 -4
- data/test/fixtures/quaderno_cassettes/calculate_tax.yml +0 -85
- data/test/fixtures/quaderno_cassettes/wrong_token.yml +0 -36
@@ -5,10 +5,12 @@ http_interactions:
|
|
5
5
|
uri: http://sk_test_B7xXrTspfeGukQqGN1pK@development.lvh.me:3000/api/contacts.json
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: first_name
|
8
|
+
string: '{"first_name":"Test customer"}'
|
9
9
|
headers:
|
10
10
|
accept:
|
11
11
|
- application/json; api_version=20160602
|
12
|
+
content-type:
|
13
|
+
- application/json
|
12
14
|
authorization:
|
13
15
|
- Basic c2tfdGVzdF9CN3hYclRzcGZlR3VrUXFHTjFwSzo=
|
14
16
|
response:
|
@@ -21,38 +23,40 @@ http_interactions:
|
|
21
23
|
x-ratelimit-limit:
|
22
24
|
- '2000'
|
23
25
|
x-ratelimit-reset:
|
24
|
-
- '
|
26
|
+
- '1'
|
25
27
|
x-ratelimit-remaining:
|
26
|
-
- '
|
28
|
+
- '91'
|
27
29
|
content-type:
|
28
30
|
- application/json; charset=utf-8
|
29
31
|
etag:
|
30
|
-
- '"
|
32
|
+
- '"f710d0238ce57e50b83b3da2b7ecfe0d"'
|
31
33
|
cache-control:
|
32
34
|
- max-age=0, private, must-revalidate
|
33
35
|
x-request-id:
|
34
|
-
-
|
36
|
+
- 3170e289-db15-444c-a66a-c4f2a710b344
|
35
37
|
x-runtime:
|
36
|
-
- '
|
38
|
+
- '1.638696'
|
37
39
|
connection:
|
38
40
|
- close
|
39
41
|
server:
|
40
42
|
- thin
|
41
43
|
body:
|
42
44
|
encoding: UTF-8
|
43
|
-
string: '{"id":
|
44
|
-
customer","contact_name":null,"street_line_1":null,"street_line_2":null,"postal_code":null,"city":null,"region":null,"country":"ES","phone_1":null,"phone_2":null,"fax":null,"email":null,"web":null,"discount":null,"tax_id":null,"vat_number":null,"bank_account":null,"language":"ES","notes":null,"secure_id":"
|
45
|
+
string: '{"id":53,"kind":"company","created_at":1497268179,"full_name":"Test
|
46
|
+
customer","contact_name":null,"street_line_1":null,"street_line_2":null,"postal_code":null,"city":null,"region":null,"country":"ES","phone_1":null,"phone_2":null,"fax":null,"email":null,"web":null,"discount":null,"tax_id":null,"vat_number":null,"bank_account":null,"language":"ES","notes":null,"secure_id":"658db8fdb0ae926ce37a239aab1619bf5f8fc4f4","permalink":"http://development.lvh.me:3000/billing/658db8fdb0ae926ce37a239aab1619bf5f8fc4f4","url":"http://development.lvh.me:3000/api/contacts/53"}'
|
45
47
|
http_version: '1.1'
|
46
|
-
recorded_at:
|
48
|
+
recorded_at: Mon, 12 Jun 2017 11:49:40 GMT
|
47
49
|
- request:
|
48
50
|
method: post
|
49
51
|
uri: http://sk_test_B7xXrTspfeGukQqGN1pK@development.lvh.me:3000/api/receipts.json
|
50
52
|
body:
|
51
53
|
encoding: UTF-8
|
52
|
-
string: contact_id
|
54
|
+
string: '{"contact_id":53,"currency":"EUR","items_attributes":[{"description":"Aircraft","quantity":"1.0","unit_price":"0.0"}],"tags":"tnt","payment_method":"cash","notes":""}'
|
53
55
|
headers:
|
54
56
|
accept:
|
55
57
|
- application/json; api_version=20160602
|
58
|
+
content-type:
|
59
|
+
- application/json
|
56
60
|
authorization:
|
57
61
|
- Basic c2tfdGVzdF9CN3hYclRzcGZlR3VrUXFHTjFwSzo=
|
58
62
|
response:
|
@@ -65,19 +69,19 @@ http_interactions:
|
|
65
69
|
x-ratelimit-limit:
|
66
70
|
- '2000'
|
67
71
|
x-ratelimit-reset:
|
68
|
-
- '
|
72
|
+
- '0'
|
69
73
|
x-ratelimit-remaining:
|
70
|
-
- '
|
74
|
+
- '90'
|
71
75
|
content-type:
|
72
76
|
- application/json; charset=utf-8
|
73
77
|
etag:
|
74
|
-
- '"
|
78
|
+
- '"f7bfc685efa964fc8fad6e84b042358c"'
|
75
79
|
cache-control:
|
76
80
|
- max-age=0, private, must-revalidate
|
77
81
|
x-request-id:
|
78
|
-
-
|
82
|
+
- 923be158-1857-4184-8631-54001e3d8835
|
79
83
|
x-runtime:
|
80
|
-
- '
|
84
|
+
- '4.633702'
|
81
85
|
connection:
|
82
86
|
- close
|
83
87
|
server:
|
@@ -85,36 +89,35 @@ http_interactions:
|
|
85
89
|
body:
|
86
90
|
encoding: ASCII-8BIT
|
87
91
|
string: !binary |-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
fQ==
|
92
|
+
eyJpZCI6MjAzLCJudW1iZXIiOiIwMDAzIiwiaXNzdWVfZGF0ZSI6IjIwMTct
|
93
|
+
MDYtMTIiLCJjcmVhdGVkX2F0IjoxNDk3Mj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cm1h
|
109
|
+
bGluayI6Imh0dHA6Ly9kZXZlbG9wbWVudC5sdmgubWU6MzAwMC9yZWNlaXB0
|
110
|
+
LzdjZWI4OWJhN2VkYzFjYjkyNmJlODQ3MzIwNjdjZDY2MGNlOTEyZTUiLCJw
|
111
|
+
ZGYiOiJodHRwOi8vZGV2ZWxvcG1lbnQubHZoLm1lOjMwMDAvcmVjZWlwdC83
|
112
|
+
Y2ViODliYTdlZGMxY2I5MjZiZTg0NzMyMDY3Y2Q2NjBjZTkxMmU1LnBkZiIs
|
113
|
+
InVybCI6Imh0dHA6Ly9kZXZlbG9wbWVudC5sdmgubWU6MzAwMC9hcGkvcmVj
|
114
|
+
ZWlwdHMvMjAzLmpzb24iLCJwcm9jZXNzb3IiOm51bGwsInByb2Nlc3Nvcl9p
|
115
|
+
ZCI6bnVsbH0=
|
113
116
|
http_version: '1.1'
|
114
|
-
recorded_at:
|
117
|
+
recorded_at: Mon, 12 Jun 2017 11:49:45 GMT
|
115
118
|
- request:
|
116
119
|
method: delete
|
117
|
-
uri: http://sk_test_B7xXrTspfeGukQqGN1pK@development.lvh.me:3000/api/receipts/
|
120
|
+
uri: http://sk_test_B7xXrTspfeGukQqGN1pK@development.lvh.me:3000/api/receipts/203.json
|
118
121
|
body:
|
119
122
|
encoding: US-ASCII
|
120
123
|
string: ''
|
@@ -133,15 +136,15 @@ http_interactions:
|
|
133
136
|
x-ratelimit-limit:
|
134
137
|
- '2000'
|
135
138
|
x-ratelimit-reset:
|
136
|
-
- '
|
139
|
+
- '15'
|
137
140
|
x-ratelimit-remaining:
|
138
|
-
- '
|
141
|
+
- '100'
|
139
142
|
cache-control:
|
140
143
|
- no-cache
|
141
144
|
x-request-id:
|
142
|
-
-
|
145
|
+
- 804eb5ef-a74e-4e8c-85db-5955b07357d5
|
143
146
|
x-runtime:
|
144
|
-
- '
|
147
|
+
- '2.946196'
|
145
148
|
connection:
|
146
149
|
- close
|
147
150
|
server:
|
@@ -150,10 +153,10 @@ http_interactions:
|
|
150
153
|
encoding: US-ASCII
|
151
154
|
string: ''
|
152
155
|
http_version: '1.1'
|
153
|
-
recorded_at:
|
156
|
+
recorded_at: Mon, 12 Jun 2017 11:49:48 GMT
|
154
157
|
- request:
|
155
158
|
method: delete
|
156
|
-
uri: http://sk_test_B7xXrTspfeGukQqGN1pK@development.lvh.me:3000/api/contacts/
|
159
|
+
uri: http://sk_test_B7xXrTspfeGukQqGN1pK@development.lvh.me:3000/api/contacts/53.json
|
157
160
|
body:
|
158
161
|
encoding: US-ASCII
|
159
162
|
string: ''
|
@@ -172,15 +175,15 @@ http_interactions:
|
|
172
175
|
x-ratelimit-limit:
|
173
176
|
- '2000'
|
174
177
|
x-ratelimit-reset:
|
175
|
-
- '
|
178
|
+
- '15'
|
176
179
|
x-ratelimit-remaining:
|
177
|
-
- '
|
180
|
+
- '99'
|
178
181
|
cache-control:
|
179
182
|
- no-cache
|
180
183
|
x-request-id:
|
181
|
-
-
|
184
|
+
- f85ce166-ddd4-4254-bd61-a877fefd13b9
|
182
185
|
x-runtime:
|
183
|
-
- '
|
186
|
+
- '1.077894'
|
184
187
|
connection:
|
185
188
|
- close
|
186
189
|
server:
|
@@ -189,5 +192,5 @@ http_interactions:
|
|
189
192
|
encoding: US-ASCII
|
190
193
|
string: ''
|
191
194
|
http_version: '1.1'
|
192
|
-
recorded_at:
|
195
|
+
recorded_at: Mon, 12 Jun 2017 11:49:49 GMT
|
193
196
|
recorded_with: VCR 2.9.2
|