billfixers-partner 1.2.1 → 1.2.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5d6ff6a126177cb75dee8df02d1c0a3c9f97d0e6f86bb716f6baf406b0fc811
4
- data.tar.gz: 4bfa0b1d80a879c8b7bdc72f63260254ab20148a7dc92d4bf78384b78cb8e06a
3
+ metadata.gz: cf94181e7afc6710dba6f8c421a346b83dc84d78dfb8b735512aaae7083a182c
4
+ data.tar.gz: 6c5797d87f189cd2a5335ca7681d21c894ced84adafdfb5a7a17d779fc0672b3
5
5
  SHA512:
6
- metadata.gz: e6435d70558a67fccf6512c7801aa95800a530488067f3f39082dae20d5d27f6b9527c8318fb03341b1a48cd509e2f8757bcdbe563ecd5dc4f1b3b5756750198
7
- data.tar.gz: 65fadf82b078607800af37cce8b7805e804e6d994b9c03ea977c8774633c0cbecc1b3f2795b36554f2ccc1c9b30cc6f6e5bb9aa59d3220de03bef87b0ad9b42b
6
+ metadata.gz: ae321f033b41723231aff3239e3eaeb900880a1b423acf48fa3e292e4cc9dc80f01a9d93268840ec088718eb2c7be2faa5a9303b97964796c3d72be471bb2651
7
+ data.tar.gz: 3300ae51e3db5a4c6e2473e258d39ad18aa950229d02de9f93eab407bf3b7944765c42562f1bbd99549ee707414515f20eefad14048ef2184636aedfd87c185d
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}
@@ -95,6 +95,13 @@ module Billfixers
95
95
  dataType
96
96
  value
97
97
  }
98
+ customer {
99
+ #{CUSTOMER_FRAGMENT}
100
+ }
101
+
102
+ bill {
103
+ #{BILL_FRAGMENT}
104
+ }
98
105
  )
99
106
 
100
107
  LIST_PROVIDERS_QUERY = %(
@@ -318,5 +325,20 @@ module Billfixers
318
325
  }
319
326
  }
320
327
  )
328
+
329
+ PROVIDE_DOCUMENTLESS_INFO_MUTATION = %(
330
+ mutation($bill_id: ID!, $documentless_info: JSON!) {
331
+ ProvideDocumentlessInfo(input: {
332
+ billId: $bill_id,
333
+ documentlessInfo: $documentless_info
334
+ }) {
335
+ success
336
+ errors
337
+ bill {
338
+ #{BILL_FRAGMENT}
339
+ }
340
+ }
341
+ }
342
+ )
321
343
  end
322
344
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Billfixers
4
4
  module Partner
5
- VERSION = '1.2.1'
5
+ VERSION = '1.2.5'
6
6
  end
7
7
  end