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.
- checksums.yaml +4 -4
- data/lib/simplicity_client.rb +37 -6
- 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: af805426700df49eb866015545dac1afa7c833490be0c0f2a6cb825bd9dc2e3e
|
4
|
+
data.tar.gz: 4dbeed2df67de9a27ff27c5521ad8b581f2e5f9b6642975612429eea7efa4f4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73e5c8d7f37681956ac2dcddb647522b1cae78d78e9d85c8744c7f0a96ee18c5740e62618365ca6cb7defcdd73de4094eb5870325690f170a42af8643cf4c57e
|
7
|
+
data.tar.gz: d6f3d25bf87442259549191a82c2d590f7d2cdcabe8b2deba838142da0f800a8c330bacc9e4bce9e553fc887310cb4bf8597b37b472e348c7d33ddd6bd6aa26d
|
data/lib/simplicity_client.rb
CHANGED
@@ -155,7 +155,35 @@ module SimplicityClient
|
|
155
155
|
email = @auth_data["email"]
|
156
156
|
body = {
|
157
157
|
variables: {},
|
158
|
-
query:
|
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"]["
|
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:
|
188
|
-
accountType: "#{
|
189
|
-
customerName:
|
190
|
-
accountBalance:
|
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.
|
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-
|
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
|