billfixers-partner 1.2.0 → 1.2.4
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/.gitignore +2 -0
- data/lib/billfixers/partner/client.rb +15 -1
- data/lib/billfixers/partner/gql.rb +24 -9
- data/lib/billfixers/partner/version.rb +1 -1
- data/partner_schema.json +2034 -275
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a1711f994bad70448e70829eb0ef0dee4860adf52fb949a443ba1efacc26cd3
|
4
|
+
data.tar.gz: e6a370ef45152d5761333f1f3d38d2f7866e72dd0d37401b530dc069833ea710
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a7f6d21417c2724a66f6293dfb1d64b02f0c8b3620048861df2357e69d6ffda5d11ec6c085852f121b89753294991ca5904b2191636610d14437b26ebdb5041
|
7
|
+
data.tar.gz: 417e3e8878b8acc44c4eee32ba091a4a4a977f05b2a9d43a373f99337a44387f4feb10f80f6aebab2b564ac408c4b2ac5a300f4fd945bee507b2752b68e33ca0
|
data/.gitignore
CHANGED
@@ -6,7 +6,9 @@ require 'graphlient'
|
|
6
6
|
module Billfixers
|
7
7
|
module Partner
|
8
8
|
class Client
|
9
|
-
def initialize(api_key
|
9
|
+
def initialize(api_key:)
|
10
|
+
test_mode = api_key.start_with?('test_')
|
11
|
+
|
10
12
|
endpoint = test_mode ? 'https://billfixers-partner-sandbox.herokuapp.com/partner/graphql' : 'https://billfixers.herokuapp.com/partner/graphql'
|
11
13
|
|
12
14
|
@gql = Graphlient::Client.new(endpoint,
|
@@ -189,6 +191,18 @@ module Billfixers
|
|
189
191
|
response.data.calculate_savings_estimate
|
190
192
|
end
|
191
193
|
|
194
|
+
def provide_documentless_info(bill_id, documentless_info)
|
195
|
+
response = @gql.query(
|
196
|
+
PROVIDE_DOCUMENTLESS_INFO_MUTATION,
|
197
|
+
{
|
198
|
+
bill_id: bill_id,
|
199
|
+
documentless_info: documentless_info
|
200
|
+
}
|
201
|
+
)
|
202
|
+
|
203
|
+
response.data.provide_documentless_info
|
204
|
+
end
|
205
|
+
|
192
206
|
private
|
193
207
|
|
194
208
|
def camelize(hsh)
|
@@ -21,7 +21,6 @@ module Billfixers
|
|
21
21
|
firstName
|
22
22
|
lastName
|
23
23
|
phoneNumber
|
24
|
-
avatarUrl
|
25
24
|
b2b
|
26
25
|
createdAt
|
27
26
|
updatedAt
|
@@ -50,6 +49,7 @@ module Billfixers
|
|
50
49
|
updatedAt
|
51
50
|
autoRenegotiate
|
52
51
|
allowsContract
|
52
|
+
documentlessInfo
|
53
53
|
|
54
54
|
items {
|
55
55
|
#{BILL_ITEM_FRAGMENT}
|
@@ -299,24 +299,39 @@ module Billfixers
|
|
299
299
|
|
300
300
|
CALCULATE_SAVINGS_ESTIMATE = %(
|
301
301
|
query(
|
302
|
-
$
|
303
|
-
$
|
302
|
+
$provider_id: ID!
|
303
|
+
$current_monthly_amount: Float!
|
304
304
|
) {
|
305
305
|
CalculateSavingsEstimate {
|
306
306
|
estimatedAnnualSavings(
|
307
|
-
providerId: $
|
308
|
-
currentMonthlyAmount: $
|
307
|
+
providerId: $provider_id
|
308
|
+
currentMonthlyAmount: $current_monthly_amount
|
309
309
|
)
|
310
310
|
estimatedMonthlySavings(
|
311
|
-
providerId: $
|
312
|
-
currentMonthlyAmount: $
|
311
|
+
providerId: $provider_id
|
312
|
+
currentMonthlyAmount: $current_monthly_amount
|
313
313
|
)
|
314
314
|
percentageSavings(
|
315
|
-
providerId: $
|
316
|
-
currentMonthlyAmount: $
|
315
|
+
providerId: $provider_id
|
316
|
+
currentMonthlyAmount: $current_monthly_amount
|
317
317
|
)
|
318
318
|
}
|
319
319
|
}
|
320
320
|
)
|
321
|
+
|
322
|
+
PROVIDE_DOCUMENTLESS_INFO_MUTATION = %(
|
323
|
+
mutation($bill_id: ID!, $documentless_info: JSON!) {
|
324
|
+
ProvideDocumentlessInfo(input: {
|
325
|
+
billId: $bill_id,
|
326
|
+
documentlessInfo: $documentless_info
|
327
|
+
}) {
|
328
|
+
success
|
329
|
+
errors
|
330
|
+
bill {
|
331
|
+
#{BILL_FRAGMENT}
|
332
|
+
}
|
333
|
+
}
|
334
|
+
}
|
335
|
+
)
|
321
336
|
end
|
322
337
|
end
|