simplicity_client 0.2.1 → 0.2.2

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/simplicity_client.rb +37 -6
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3283578b786c0a520eeaee6b46290f1459e9075925f8fdf172534ac533270e33
4
- data.tar.gz: cee5f3f5ac077c4cea0bc246d7f1a4b2ea03a23db7ad21795485730685ba3959
3
+ metadata.gz: af805426700df49eb866015545dac1afa7c833490be0c0f2a6cb825bd9dc2e3e
4
+ data.tar.gz: 4dbeed2df67de9a27ff27c5521ad8b581f2e5f9b6642975612429eea7efa4f4f
5
5
  SHA512:
6
- metadata.gz: 2ddd8ee90c05b00ba4ed232846f5c2e546e087c93c7e2c3a58965c74480640fe04823bea6d94c9b3b0f58e64f41cd738b8b157420b71d5864846cb74e0600185
7
- data.tar.gz: fbf5d020b63bae7fd804154b34513d95e9991afa39023877905072e69df66879b4afd3e7028251204e314720c4ca472860dc9e81d86d4a90e521202791dd7bbe
6
+ metadata.gz: 73e5c8d7f37681956ac2dcddb647522b1cae78d78e9d85c8744c7f0a96ee18c5740e62618365ca6cb7defcdd73de4094eb5870325690f170a42af8643cf4c57e
7
+ data.tar.gz: d6f3d25bf87442259549191a82c2d590f7d2cdcabe8b2deba838142da0f800a8c330bacc9e4bce9e553fc887310cb4bf8597b37b472e348c7d33ddd6bd6aa26d
@@ -155,7 +155,35 @@ module SimplicityClient
155
155
  email = @auth_data["email"]
156
156
  body = {
157
157
  variables: {},
158
- query: "{\n Account(email: \"#{email}\") {\n InvestmentType\n InvestmentCode\n PortfolioCode\n InvestmentName\n Portfolio\n Status\n RegistryAccountId\n MarketValue\n PrimaryBeneficiarySurname\n EntityType\n PriceDate\n IsDefault\n ExternalReference\n BankAccounts {\n AccountName\n LastThreeDigitsOfAccountNumberPart\n SuffixPart\n IsPrimary\n Id\n __typename\n }\n __typename\n }\n}\n",
158
+ query: <<-GRAPHQL
159
+ {
160
+ AccountV2(email: \"george@dewar.co.nz\") {
161
+ Portfolios {
162
+ Portfolio
163
+ PortfolioCode
164
+ MarketValue
165
+ IsDefault
166
+ CanWithdraw
167
+ InvestorDetails {
168
+ InvestmentName
169
+ PrimaryBeneficiarySurname
170
+ EntityType
171
+ __typename
172
+ }
173
+ __typename
174
+ }
175
+ Investment {
176
+ InvestmentCode
177
+ InvestmentType
178
+ Status
179
+ PriceDate
180
+ ExternalReference
181
+ __typename
182
+ }
183
+ __typename
184
+ }
185
+ }
186
+ GRAPHQL
159
187
  }.to_json
160
188
 
161
189
  signer = Aws::Sigv4::Signer.new(
@@ -182,12 +210,15 @@ module SimplicityClient
182
210
  # Handle the response
183
211
  if response.success?
184
212
  obj = JSON.parse(response.body)
185
- obj["data"]["Account"].map do |account|
213
+ obj["data"]["AccountV2"].map do |account|
214
+ investment = account["Investment"]
215
+ portfolio = account["Portfolios"][0]
216
+ investor_details = portfolio["InvestorDetails"]
186
217
  {
187
- accountNo: account["InvestmentCode"],
188
- accountType: "#{account["InvestmentType"]} - #{account["Portfolio"]}",
189
- customerName: account["InvestmentName"],
190
- accountBalance: account["MarketValue"],
218
+ accountNo: investment["InvestmentCode"],
219
+ accountType: "#{investment["InvestmentType"]} - #{portfolio["Portfolio"]}",
220
+ customerName: investor_details["InvestmentName"],
221
+ accountBalance: portfolio["MarketValue"],
191
222
  isLiabilityType: false,
192
223
  supportsTransactions: false,
193
224
  dynamicBalance: true,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplicity_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - George Dewar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-03 00:00:00.000000000 Z
11
+ date: 2025-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-cognitoidentity