billfixers-partner 1.2.0 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 664ff1de4959a3ffa7fab0eaaf7e664168abe420beab6cced0f456340fb8e7d1
4
- data.tar.gz: 25802d198f8b2003e0b489d29426aa9ed35bf74f5c13459845bb4cc582de069f
3
+ metadata.gz: 4a1711f994bad70448e70829eb0ef0dee4860adf52fb949a443ba1efacc26cd3
4
+ data.tar.gz: e6a370ef45152d5761333f1f3d38d2f7866e72dd0d37401b530dc069833ea710
5
5
  SHA512:
6
- metadata.gz: d69a5a4faa111dde675cc0755c48874be48529a965b3130cb2bf2bee50b7866899e9267fdd6359d9eda0b041b1d6a97a99699d66014311fae8fd03817dcaca2e
7
- data.tar.gz: ac2895eb75d835b0ec319ff89aaf363fa5feda664182c47d021cdb39cf4b7a3d42ed4378bcb9c3be4ba0fb07045b69848f4a0769267f1ecdb861b10a4724b0b4
6
+ metadata.gz: 2a7f6d21417c2724a66f6293dfb1d64b02f0c8b3620048861df2357e69d6ffda5d11ec6c085852f121b89753294991ca5904b2191636610d14437b26ebdb5041
7
+ data.tar.gz: 417e3e8878b8acc44c4eee32ba091a4a4a977f05b2a9d43a373f99337a44387f4feb10f80f6aebab2b564ac408c4b2ac5a300f4fd945bee507b2752b68e33ca0
data/.gitignore CHANGED
@@ -7,3 +7,5 @@
7
7
  /spec/reports/
8
8
  /tmp/
9
9
  .byebug_history
10
+ *.gem
11
+ .DS_Store
@@ -6,7 +6,9 @@ require 'graphlient'
6
6
  module Billfixers
7
7
  module Partner
8
8
  class Client
9
- def initialize(api_key:, test_mode: false)
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
- $providerId: ID!
303
- $currentMonthlyAmount: Float!
302
+ $provider_id: ID!
303
+ $current_monthly_amount: Float!
304
304
  ) {
305
305
  CalculateSavingsEstimate {
306
306
  estimatedAnnualSavings(
307
- providerId: $providerId
308
- currentMonthlyAmount: $currentMonthlyAmount
307
+ providerId: $provider_id
308
+ currentMonthlyAmount: $current_monthly_amount
309
309
  )
310
310
  estimatedMonthlySavings(
311
- providerId: $providerId
312
- currentMonthlyAmount: $currentMonthlyAmount
311
+ providerId: $provider_id
312
+ currentMonthlyAmount: $current_monthly_amount
313
313
  )
314
314
  percentageSavings(
315
- providerId: $providerId
316
- currentMonthlyAmount: $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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Billfixers
4
4
  module Partner
5
- VERSION = '1.2.0'
5
+ VERSION = '1.2.4'
6
6
  end
7
7
  end