finapps 0.1.15.pre → 0.1.16.pre
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/finapps.rb +2 -0
- data/lib/finapps/rest/accounts.rb +20 -0
- data/lib/finapps/rest/client.rb +2 -1
- data/lib/finapps/rest/defaults.rb +9 -1
- data/lib/finapps/rest/transactions.rb +33 -0
- data/lib/finapps/rest/user_institutions.rb +31 -0
- data/lib/finapps/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a818aeff9a31ef6eb1f67d3b1880859d7c43c0b6
|
4
|
+
data.tar.gz: 23ccd3acc49ef3db74e2efd5062966bdb1e8a7df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e36fa88c4a4b77425fa524fdfccb7983c3180fc7d1e8b6a3b39afb428afabfcf5a3d0aebfb55e6d706f9b9bc5c67ddb9b1641d57e81baca75e82893d0726d7c2
|
7
|
+
data.tar.gz: 2c181db9b899a5150a498f91a50bc506e241b5056d44a69829b918184c676227c6a542b7c218994609c1b44022474a9b2bab8c001e96f7aba9406d6d28db2db6
|
data/lib/finapps.rb
CHANGED
@@ -18,6 +18,26 @@ module FinApps
|
|
18
18
|
return accounts, error_messages
|
19
19
|
end
|
20
20
|
|
21
|
+
def show(account_id)
|
22
|
+
logger.debug "##{__method__.to_s} => Started"
|
23
|
+
|
24
|
+
raise MissingArgumentsError.new 'Missing argument: account_id.' if account_id.blank?
|
25
|
+
logger.debug "##{__method__.to_s} => site_id: #{site_id}"
|
26
|
+
|
27
|
+
end_point = Defaults::END_POINTS[:accounts_show]
|
28
|
+
logger.debug "##{__method__.to_s} => end_point: #{end_point}"
|
29
|
+
|
30
|
+
path = end_point.sub ':account_id', ERB::Util.url_encode(account_id)
|
31
|
+
logger.debug "##{__method__.to_s} => path: #{path}"
|
32
|
+
|
33
|
+
account, error_messages = @client.send(path, :get ) do |r|
|
34
|
+
Account.new(r.body)
|
35
|
+
end
|
36
|
+
|
37
|
+
logger.debug "##{__method__.to_s} => Completed"
|
38
|
+
return account, error_messages
|
39
|
+
end
|
40
|
+
|
21
41
|
end
|
22
42
|
|
23
43
|
class Account < FinApps::REST::Resource
|
data/lib/finapps/rest/client.rb
CHANGED
@@ -5,7 +5,7 @@ module FinApps
|
|
5
5
|
include FinApps::Logging
|
6
6
|
include FinApps::REST::Connection
|
7
7
|
|
8
|
-
attr_reader :users, :institutions, :user_institutions, :accounts
|
8
|
+
attr_reader :users, :institutions, :user_institutions, :accounts, :transactions
|
9
9
|
|
10
10
|
# @param [String] company_identifier
|
11
11
|
# @param [String] company_token
|
@@ -169,6 +169,7 @@ module FinApps
|
|
169
169
|
@institutions ||= FinApps::REST::Institutions.new self
|
170
170
|
@user_institutions ||= FinApps::REST::UserInstitutions.new self
|
171
171
|
@accounts ||= FinApps::REST::Accounts.new self
|
172
|
+
@transactions ||= FinApps::REST::Transactions.new self
|
172
173
|
end
|
173
174
|
|
174
175
|
end
|
@@ -26,10 +26,18 @@ module FinApps
|
|
26
26
|
:users_create => 'users/new',
|
27
27
|
:users_login => 'users/login',
|
28
28
|
:users_delete => 'users/:public_id/delete',
|
29
|
+
|
29
30
|
:institutions_search => 'institutions/:search_term/search',
|
30
31
|
:institutions_form => 'institutions/:site_id/form',
|
32
|
+
|
31
33
|
:user_institutions_add => 'institutions/:site_id/add',
|
32
|
-
:
|
34
|
+
:user_institutions_status => 'institutions/user/:user_institution_id/status',
|
35
|
+
:user_institutions_refresh_all => 'institutions/user/refresh/all',
|
36
|
+
|
37
|
+
:accounts_list => 'accounts/list',
|
38
|
+
:accounts_show => 'accounts/:account_id/show',
|
39
|
+
|
40
|
+
:transactions_search => 'transactions/search'
|
33
41
|
}.freeze
|
34
42
|
|
35
43
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module FinApps
|
2
|
+
module REST
|
3
|
+
|
4
|
+
require 'erb'
|
5
|
+
|
6
|
+
class Transactions < FinApps::REST::Resources
|
7
|
+
include FinApps::REST::Defaults
|
8
|
+
|
9
|
+
# @param [Hash] params
|
10
|
+
# @return [Array<FinApps::REST::Transaction>, Array<String>]
|
11
|
+
def search(params={})
|
12
|
+
logger.debug "##{__method__.to_s} => Started"
|
13
|
+
|
14
|
+
path = Defaults::END_POINTS[:transactions_search]
|
15
|
+
logger.debug "##{__method__.to_s} => path: #{path}"
|
16
|
+
|
17
|
+
transactions, error_messages = @client.send(path, :post, params) do |r|
|
18
|
+
r.body.each { |i| Transaction.new(i) }
|
19
|
+
end
|
20
|
+
|
21
|
+
logger.debug "##{__method__.to_s} => Completed"
|
22
|
+
return transactions, error_messages
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
class Transaction < FinApps::REST::Resource
|
28
|
+
attr_accessor :_id, :account_id, :date, :transaction_date, :description, :amount,
|
29
|
+
:type, :status, :keyword, :merchant_name, :categories, :tags
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
@@ -29,6 +29,37 @@ module FinApps
|
|
29
29
|
return user_institution, error_messages
|
30
30
|
end
|
31
31
|
|
32
|
+
def status(user_institution_id)
|
33
|
+
logger.debug "##{__method__.to_s} => Started"
|
34
|
+
|
35
|
+
raise MissingArgumentsError.new 'Missing argument: user_institution_id.' if user_institution_id.blank?
|
36
|
+
logger.debug "##{__method__.to_s} => user_institution_id: #{user_institution_id}"
|
37
|
+
|
38
|
+
end_point = Defaults::END_POINTS[:user_institutions_status]
|
39
|
+
logger.debug "##{__method__.to_s} => end_point: #{end_point}"
|
40
|
+
|
41
|
+
path = end_point.sub ':user_institution_id', ERB::Util.url_encode(user_institution_id)
|
42
|
+
logger.debug "##{__method__.to_s} => path: #{path}"
|
43
|
+
|
44
|
+
user_institution, error_messages = @client.send(path, :get ) do |r|
|
45
|
+
UserInstitution.new(r.body)
|
46
|
+
end
|
47
|
+
|
48
|
+
logger.debug "##{__method__.to_s} => Completed"
|
49
|
+
return user_institution, error_messages
|
50
|
+
end
|
51
|
+
|
52
|
+
def refresh_all
|
53
|
+
logger.debug "##{__method__.to_s} => Started"
|
54
|
+
|
55
|
+
path = Defaults::END_POINTS[:user_institutions_refresh_all]
|
56
|
+
logger.debug "##{__method__.to_s} => path: #{path}"
|
57
|
+
|
58
|
+
_, error_messages = @client.send(path, :get )
|
59
|
+
|
60
|
+
logger.debug "##{__method__.to_s} => Completed"
|
61
|
+
error_messages
|
62
|
+
end
|
32
63
|
end
|
33
64
|
|
34
65
|
class UserInstitution < FinApps::REST::Resource
|
data/lib/finapps/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: finapps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.16.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erich Quintero
|
@@ -205,6 +205,7 @@ files:
|
|
205
205
|
- lib/finapps/rest/institutions.rb
|
206
206
|
- lib/finapps/rest/resource.rb
|
207
207
|
- lib/finapps/rest/resources.rb
|
208
|
+
- lib/finapps/rest/transactions.rb
|
208
209
|
- lib/finapps/rest/user_institutions.rb
|
209
210
|
- lib/finapps/rest/users.rb
|
210
211
|
- lib/finapps/utils/logging.rb
|