anz_bank_client 0.1.2 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c15b49548ec220f8db3dd750e6d4de206d501aa3c8b74848c541534174f1c435
4
- data.tar.gz: a68aad4abcf6e137b9a796e017a7ecc683da9f0bfd2451a068930a061ff3caf2
3
+ metadata.gz: 216c40177f3517dff2b1ff113b18c77c4df4526306f1d8e5143403500bc11498
4
+ data.tar.gz: a957dbd10b7af784b091a3fb460f194d4303d2f73c50bad8489a7268ead79a21
5
5
  SHA512:
6
- metadata.gz: c2a6b555a62d4832da6747f08d4ea5ca9c37f18bc6e2986953b10cf6e9a6f362d1b0d62b7b6f30c97f773c28dbc549dfbc72ca587a3713303a4751674d814711
7
- data.tar.gz: 59f0984b3b1878bc5bd19877df6f60988915dac48dece351c9a824fcd19c214bf4d457438563669f0efdb4ab07158f5592b920f32045a4ff306e7bc85bef3388
6
+ metadata.gz: 6b0da2d8e69590454849505c0b02eaac4b441fbe5e66cc2bb19e95935d9ad198f22f49d2d7f5a4bb62e33cca2d3fd71b9e84d222af25816026c9aeba56ab2c26
7
+ data.tar.gz: 01143ac8dccd5847caf485360cff1ab390a9d9e4cfe843d0624aa8e1fbcd39b48681de7f43a22ae3a67521860e8e34c7e23b6465f958a032e1f3b479c5c5cc27
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- anz_bank_client (0.1.2)
4
+ anz_bank_client (0.1.4)
5
5
  faraday (~> 2.7)
6
6
  faraday-cookie_jar (~> 0.0.7)
7
7
  faraday-follow_redirects (~> 0.3.0)
data/exe/anzcli CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ $LOAD_PATH.unshift(File.expand_path("../../lib", __FILE__))
2
3
  require "anz_bank_client"
3
4
  require "readline"
4
5
  require "optparse"
@@ -65,7 +66,7 @@ class AnzCli < Thor
65
66
  description1: t[:details][0],
66
67
  description2: t[:details][1],
67
68
  amount: "% 12.2f" % t[:amount],
68
- balance: "% 12.2f" % t[:balance],
69
+ balance: t[:balance] ? ("% 12.2f" % t[:balance]) : nil,
69
70
  }
70
71
  end
71
72
  tp txns
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AnzBankClient
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.4"
5
5
  end
@@ -135,6 +135,8 @@ module AnzBankClient
135
135
  accountBalance: normalised_balance,
136
136
  availableFunds: account.dig("availableFunds", "amount"),
137
137
  isLiabilityType: account["isLoan"] || account["isCreditCard"],
138
+ supportsTransactions: true,
139
+ dynamicBalance: account["isInvestment"],
138
140
  }
139
141
  end
140
142
  end
@@ -158,7 +160,10 @@ module AnzBankClient
158
160
  raise "Error getting transactions: #{response.status}\n\n#{response.body}" unless response.status == 200
159
161
 
160
162
  response_json = JSON.parse(response.body)
161
- response_json["transactions"].map do |transaction|
163
+ transactions = response_json["transactions"]
164
+ # Ignore transactions without an amount - these can be informational messages like "Finance Charge Rate Changed Today"
165
+ transactions = transactions.filter{ |transaction| transaction["amount"] }
166
+ transactions.map do |transaction|
162
167
  {
163
168
  date: transaction["date"],
164
169
  postedDate: transaction["postedDate"],
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anz_bank_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - George Dewar
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-12 00:00:00.000000000 Z
11
+ date: 2024-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday