finapps 0.11.0.pre → 0.12.0.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 60f381e8530bb34bc0ba5f61a70ad445191f3da5
4
- data.tar.gz: a4a7b8e2e47bcd6e5dad044e7b3b7799b9553ce0
3
+ metadata.gz: d18acb35884ccd46dbb8444036f1cff552dcf717
4
+ data.tar.gz: 21139e437fbe3a15b4085e72d328c087b8919a5c
5
5
  SHA512:
6
- metadata.gz: 2ce9bd4ba149817f5aab8940745668edf3281b4b86404d8d66bf613a9e4f5725df450576c62a94336796300431ea28423849b4b44c42664d26c137aef0e20186
7
- data.tar.gz: c5d66249bdc782f7a23ac5f5d60917108f79a4877ace1c357db27af20c0b4137552d9c4f8d71bd2be5ead8872ac82a6791d8eccf01d5be87cc784d3dd39d0197
6
+ metadata.gz: 1970e891e49e2a93b512643bcf036904e6d022fc5c3489bea51416deea3ab0a0888fd3544e66739c065a88b48516b2e38deac033d4930a934c90301ece63f4f8
7
+ data.tar.gz: 9402175c551bbd957f79a976adf7b00f8fd0049952571e76d051ceec26cb83ec6c72c0bb95c3ee93758fef3c8cb350b66a807111bd42767ad5d92fd895b2e59f
data/lib/finapps.rb CHANGED
@@ -18,15 +18,12 @@ require 'finapps/rest/errors'
18
18
 
19
19
  require 'finapps/rest/resource'
20
20
  require 'finapps/rest/resources'
21
+
21
22
  require 'finapps/rest/users'
22
23
  require 'finapps/rest/institutions'
23
24
  require 'finapps/rest/user_institutions'
24
25
  require 'finapps/rest/transactions'
25
26
  require 'finapps/rest/categories'
26
- require 'finapps/rest/geo'
27
- require 'finapps/rest/inventory/feed_categories'
28
- require 'finapps/rest/inventory/feeds'
29
- require 'finapps/rest/relevance/rulesets'
30
27
  require 'finapps/rest/budget_models'
31
28
  require 'finapps/rest/budget'
32
29
  require 'finapps/rest/cashflow'
@@ -45,6 +45,22 @@ module FinApps
45
45
  return budget, error_messages
46
46
  end
47
47
 
48
+ # @param [Hash] params
49
+ # @return [Array<Hash>, Array<String>]
50
+ def update(params={})
51
+ logger.debug "##{__method__.to_s} => Started"
52
+
53
+ raise MissingArgumentsError.new 'Missing argument: params.' if params.blank?
54
+
55
+ end_point = Defaults::END_POINTS[:budget_update]
56
+ logger.debug "##{__method__.to_s} => end_point: #{end_point}"
57
+
58
+ budget, error_messages = @client.send(end_point, :put, params)
59
+ logger.debug "##{__method__.to_s} => Completed"
60
+
61
+ return budget, error_messages
62
+ end
63
+
48
64
  end
49
65
  end
50
66
  end
@@ -0,0 +1,69 @@
1
+ module FinApps
2
+ module REST
3
+
4
+ require 'erb'
5
+
6
+ class BudgetCalculation < FinApps::REST::Resources
7
+ include FinApps::REST::Defaults
8
+
9
+ # @param [Hash] params
10
+ # @return [Array<Hash>, Array<String>]
11
+ def create_old(params = {})
12
+ logger.debug "##{__method__.to_s} => Started"
13
+
14
+ raise MissingArgumentsError.new 'Missing argument: params.' if params.blank?
15
+
16
+ end_point = Defaults::END_POINTS[:budget_calculation_create]
17
+ logger.debug "##{__method__.to_s} => end_point: #{end_point}"
18
+
19
+ path = end_point
20
+ logger.debug "##{__method__.to_s} => path: #{path}"
21
+
22
+ budget_calculation, error_messages = @client.send(path, :get)
23
+ logger.debug "##{__method__.to_s} => Completed"
24
+
25
+ return budget_calculation, error_messages
26
+ end
27
+
28
+ # @param [String] budget_model
29
+ # @param [Number] income
30
+ # @return [Array<Hash>, Array<String>]
31
+ def create(budget_model, income)
32
+ logger.debug "##{__method__.to_s} => Started"
33
+
34
+ raise MissingArgumentsError.new 'Missing argument: budget_model.' if budget_model.blank?
35
+ logger.debug "##{__method__.to_s} => budget_model: #{budget_model}"
36
+ raise MissingArgumentsError.new 'Missing argument: income.' if income.blank?
37
+ logger.debug "##{__method__.to_s} => income: #{income}"
38
+
39
+ end_point = Defaults::END_POINTS[:budget_calculation_create]
40
+ logger.debug "##{__method__.to_s} => end_point: #{end_point}"
41
+
42
+ path = end_point.sub(':budget_model', ERB::Util.url_encode(budget_model)).sub(':income', ERB::Util.url_encode(income))
43
+ logger.debug "##{__method__.to_s} => path: #{path}"
44
+
45
+ budget_calculation, error_messages = @client.send(path, :get)
46
+ logger.debug "##{__method__.to_s} => Completed"
47
+
48
+ return budget_calculation, error_messages
49
+ end
50
+
51
+ # @return [Array<Hash>, Array<String>]
52
+ def show
53
+ logger.debug "##{__method__.to_s} => Started"
54
+
55
+ end_point = Defaults::END_POINTS[:budget_calculation_show]
56
+ logger.debug "##{__method__.to_s} => end_point: #{end_point}"
57
+
58
+ path = end_point
59
+ logger.debug "##{__method__.to_s} => path: #{path}"
60
+
61
+ budget_calculation, error_messages = @client.send(path, :get)
62
+ logger.debug "##{__method__.to_s} => Completed"
63
+
64
+ return budget_calculation, error_messages
65
+ end
66
+
67
+ end
68
+ end
69
+ end
@@ -5,7 +5,9 @@ module FinApps
5
5
  include FinApps::Logging
6
6
  include FinApps::REST::Connection
7
7
 
8
- attr_reader :connection, :users, :institutions, :user_institutions, :transactions, :categories, :rule_sets, :budget_models, :budget, :cashflow
8
+ attr_reader :connection, :users, :institutions, :user_institutions,
9
+ :transactions, :categories,
10
+ :budget_models, :budget_calculation, :budget, :cashflow
9
11
 
10
12
  # @param [String] company_identifier
11
13
  # @param [String] company_token
@@ -195,8 +197,8 @@ module FinApps
195
197
  @user_institutions ||= FinApps::REST::UserInstitutions.new self
196
198
  @transactions ||= FinApps::REST::Transactions.new self
197
199
  @categories ||= FinApps::REST::Categories.new self
198
- @rule_sets ||= FinApps::REST::Relevance::Rulesets.new self
199
200
  @budget_models ||= FinApps::REST::BudgetModels.new self
201
+ @budget_calculation ||= FinApps::REST::BudgetCalculation.new self
200
202
  @budget ||= FinApps::REST::Budget.new self
201
203
  @cashflow ||= FinApps::REST::Cashflow.new self
202
204
  end
@@ -42,14 +42,17 @@ module FinApps
42
42
 
43
43
  :categories_list => 'categories',
44
44
  :categories_new => 'categories',
45
- :categories_edit => 'categories',
45
+ :categories_update => 'categories',
46
46
  :categories_show => 'categories/:category_id',
47
47
  :categories_delete => 'categories/:category_id',
48
48
 
49
49
  :budget_models_list => 'budget/templates',
50
50
  :budget_models_show => 'budget/template/:budget_model_id',
51
51
 
52
- :budget_create => 'budget/template',
52
+ :budget_calculation_create => 'budget/template',
53
+ :budget_calculation_show => 'categories',
54
+
55
+ :budget_update => 'budget',
53
56
  :budget_show => 'budget/:start_date/:end_date',
54
57
 
55
58
  :cashflow_show => 'cashflow/:start_date/:end_date',
@@ -1,3 +1,3 @@
1
1
  module FinApps
2
- VERSION = '0.11.0.pre'
2
+ VERSION = '0.12.0.pre'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: finapps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0.pre
4
+ version: 0.12.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erich Quintero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-21 00:00:00.000000000 Z
11
+ date: 2015-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -198,6 +198,7 @@ files:
198
198
  - lib/finapps/middleware/raise_http_exceptions.rb
199
199
  - lib/finapps/middleware/response_logger.rb
200
200
  - lib/finapps/rest/budget.rb
201
+ - lib/finapps/rest/budget_calculation.rb
201
202
  - lib/finapps/rest/budget_models.rb
202
203
  - lib/finapps/rest/cashflow.rb
203
204
  - lib/finapps/rest/categories.rb
@@ -205,12 +206,7 @@ files:
205
206
  - lib/finapps/rest/connection.rb
206
207
  - lib/finapps/rest/defaults.rb
207
208
  - lib/finapps/rest/errors.rb
208
- - lib/finapps/rest/geo.rb
209
209
  - lib/finapps/rest/institutions.rb
210
- - lib/finapps/rest/inventory/feed_categories.rb
211
- - lib/finapps/rest/inventory/feeds.rb
212
- - lib/finapps/rest/relevance.rb
213
- - lib/finapps/rest/relevance/rulesets.rb
214
210
  - lib/finapps/rest/resource.rb
215
211
  - lib/finapps/rest/resources.rb
216
212
  - lib/finapps/rest/transactions.rb
@@ -1,110 +0,0 @@
1
- module FinApps
2
- module REST
3
-
4
- require 'erb'
5
-
6
- class Geo < FinApps::REST::Resources
7
-
8
- def record_by_ip_address(ip_address)
9
- logger.debug "##{__method__.to_s} => Started"
10
-
11
- raise MissingArgumentsError.new 'Missing argument: ip_address.' if ip_address.blank?
12
- logger.debug "##{__method__.to_s} => ip_address: #{ip_address}"
13
-
14
- end_point = Defaults::END_POINTS[:geo_record_by_ip_address]
15
- logger.debug "##{__method__.to_s} => end_point: #{end_point}"
16
-
17
- path = end_point.sub ':ip_address', ERB::Util.url_encode(ip_address)
18
- logger.debug "##{__method__.to_s} => path: #{path}"
19
-
20
- results, error_messages = @client.send(path, :get)
21
-
22
- logger.debug "##{__method__.to_s} => Completed"
23
- return results, error_messages
24
- end
25
-
26
- def record_by_region(region, city)
27
- logger.debug "##{__method__.to_s} => Started"
28
-
29
- raise MissingArgumentsError.new 'Missing argument: region.' if region.blank?
30
- logger.debug "##{__method__.to_s} => region: #{region}"
31
- raise MissingArgumentsError.new 'Missing argument: city.' if city.blank?
32
- logger.debug "##{__method__.to_s} => city: #{city}"
33
-
34
- end_point = Defaults::END_POINTS[:geo_record_by_region]
35
- logger.debug "##{__method__.to_s} => end_point: #{end_point}"
36
-
37
- path = end_point.sub ':region', ERB::Util.url_encode(region)
38
- path = path.sub ':city', ERB::Util.url_encode(city)
39
- logger.debug "##{__method__.to_s} => path: #{path}"
40
-
41
- results, error_messages = @client.send(path, :get)
42
-
43
- logger.debug "##{__method__.to_s} => Completed"
44
- return results, error_messages
45
- end
46
-
47
- def postal_record_by_region(region, city)
48
- logger.debug "##{__method__.to_s} => Started"
49
-
50
- raise MissingArgumentsError.new 'Missing argument: region.' if region.blank?
51
- logger.debug "##{__method__.to_s} => region: #{region}"
52
- raise MissingArgumentsError.new 'Missing argument: city.' if city.blank?
53
- logger.debug "##{__method__.to_s} => city: #{city}"
54
-
55
- end_point = Defaults::END_POINTS[:geo_postal_record_by_region]
56
- logger.debug "##{__method__.to_s} => end_point: #{end_point}"
57
-
58
- path = end_point.sub ':region', ERB::Util.url_encode(region)
59
- path = path.sub ':city', ERB::Util.url_encode(city)
60
- logger.debug "##{__method__.to_s} => path: #{path}"
61
-
62
- results, error_messages = @client.send(path, :get)
63
-
64
- logger.debug "##{__method__.to_s} => Completed"
65
- return results, error_messages
66
- end
67
-
68
- def postal_record_by_postal_code(postal)
69
- logger.debug "##{__method__.to_s} => Started"
70
-
71
- raise MissingArgumentsError.new 'Missing argument: postal.' if postal.blank?
72
- logger.debug "##{__method__.to_s} => postal: #{postal}"
73
-
74
- end_point = Defaults::END_POINTS[:geo_postal_record_by_postal_code]
75
- logger.debug "##{__method__.to_s} => end_point: #{end_point}"
76
-
77
- path = end_point.sub ':postal', ERB::Util.url_encode(postal)
78
- logger.debug "##{__method__.to_s} => path: #{path}"
79
-
80
- results, error_messages = @client.send(path, :get)
81
-
82
- logger.debug "##{__method__.to_s} => Completed"
83
- return results, error_messages
84
- end
85
-
86
- def us_record_by_region(region, city)
87
- logger.debug "##{__method__.to_s} => Started"
88
-
89
- raise MissingArgumentsError.new 'Missing argument: region.' if region.blank?
90
- logger.debug "##{__method__.to_s} => region: #{region}"
91
- raise MissingArgumentsError.new 'Missing argument: city.' if city.blank?
92
- logger.debug "##{__method__.to_s} => city: #{city}"
93
-
94
- end_point = Defaults::END_POINTS[:geo_us_record_by_region]
95
- logger.debug "##{__method__.to_s} => end_point: #{end_point}"
96
-
97
- path = end_point.sub ':region', ERB::Util.url_encode(region)
98
- path = path.sub ':city', ERB::Util.url_encode(city)
99
- logger.debug "##{__method__.to_s} => path: #{path}"
100
-
101
- results, error_messages = @client.send(path, :get)
102
-
103
- logger.debug "##{__method__.to_s} => Completed"
104
- return results, error_messages
105
- end
106
-
107
- end
108
-
109
- end
110
- end
@@ -1,43 +0,0 @@
1
- module FinApps
2
- module REST
3
- module Inventory
4
-
5
- require 'erb'
6
-
7
- class FeedCategories < FinApps::REST::Resources
8
-
9
- def list(feed_name, region = nil, city = nil)
10
- logger.debug "##{__method__.to_s} => Started"
11
-
12
- raise MissingArgumentsError.new 'Missing argument: feed_name.' if feed_name.blank?
13
- logger.debug "##{__method__.to_s} => feed_name: #{feed_name}"
14
-
15
- raise MissingArgumentsError.new 'Missing argument: region.' if region.blank? && city.present?
16
- logger.debug "##{__method__.to_s} => region: #{region}"
17
-
18
- raise MissingArgumentsError.new 'Missing argument: city.' if region.present? && city.blank?
19
- logger.debug "##{__method__.to_s} => city: #{city}"
20
-
21
- if region.present? && city.present?
22
- end_point = Defaults::END_POINTS[:inventory_feed_categories_list_by_region]
23
- path = end_point.sub ':feed_name', ERB::Util.url_encode(feed_name)
24
- path = path.sub ':region', ERB::Util.url_encode(region)
25
- path = path.sub ':city', ERB::Util.url_encode(city)
26
- else
27
- end_point = Defaults::END_POINTS[:inventory_feed_categories_list]
28
- path = end_point.sub ':feed_name', ERB::Util.url_encode(feed_name)
29
- end
30
- logger.debug "##{__method__.to_s} => end_point: #{end_point}"
31
- logger.debug "##{__method__.to_s} => path: #{path}"
32
-
33
- results, error_messages = @client.send(path, :get)
34
-
35
- logger.debug "##{__method__.to_s} => Completed"
36
- return results, error_messages
37
- end
38
-
39
- end
40
-
41
- end
42
- end
43
- end
@@ -1,46 +0,0 @@
1
- module FinApps
2
- module REST
3
- module Inventory
4
-
5
- require 'erb'
6
-
7
- class Feeds < FinApps::REST::Resources
8
-
9
- def list
10
- logger.debug "##{__method__.to_s} => Started"
11
-
12
- end_point = Defaults::END_POINTS[:inventory_feeds_list]
13
- logger.debug "##{__method__.to_s} => end_point: #{end_point}"
14
-
15
- path = end_point
16
- logger.debug "##{__method__.to_s} => path: #{path}"
17
-
18
- results, error_messages = @client.send(path, :get)
19
-
20
- logger.debug "##{__method__.to_s} => Completed"
21
- return results, error_messages
22
- end
23
-
24
- def show(feed_name)
25
- logger.debug "##{__method__.to_s} => Started"
26
-
27
- raise MissingArgumentsError.new 'Missing argument: feed_name.' if feed_name.blank?
28
- logger.debug "##{__method__.to_s} => feed_name: #{feed_name}"
29
-
30
- end_point = Defaults::END_POINTS[:inventory_feed_show]
31
- logger.debug "##{__method__.to_s} => end_point: #{end_point}"
32
-
33
- path = end_point.sub ':feed_name', ERB::Util.url_encode(feed_name)
34
- logger.debug "##{__method__.to_s} => path: #{path}"
35
-
36
- results, error_messages = @client.send(path, :get)
37
-
38
- logger.debug "##{__method__.to_s} => Completed"
39
- return results, error_messages
40
- end
41
-
42
- end
43
-
44
- end
45
- end
46
- end
@@ -1,98 +0,0 @@
1
- module FinApps
2
- module REST
3
-
4
- require 'erb'
5
-
6
- class Relevance < FinApps::REST::Resources
7
-
8
- def rulesets
9
- logger.debug "##{__method__.to_s} => Started"
10
-
11
- end_point = Defaults::END_POINTS[:relevance_rulesets]
12
- logger.debug "##{__method__.to_s} => end_point: #{end_point}"
13
-
14
- path = end_point
15
- logger.debug "##{__method__.to_s} => path: #{path}"
16
-
17
- results, error_messages = @client.send(path, :get)
18
-
19
- logger.debug "##{__method__.to_s} => Completed"
20
- return results, error_messages
21
- end
22
-
23
- def ruleset_by_name(ruleset_name)
24
- logger.debug "##{__method__.to_s} => Started"
25
-
26
- raise MissingArgumentsError.new 'Missing argument: ruleset_name.' if ruleset_name.blank?
27
- logger.debug "##{__method__.to_s} => ruleset_name: #{ruleset_name}"
28
-
29
- end_point = Defaults::END_POINTS[:relevance_ruleset_by_name]
30
- logger.debug "##{__method__.to_s} => end_point: #{end_point}"
31
-
32
- path = end_point.sub ':ruleset_name', ERB::Util.url_encode(ruleset_name)
33
- logger.debug "##{__method__.to_s} => path: #{path}"
34
-
35
- results, error_messages = @client.send(path, :get)
36
-
37
- logger.debug "##{__method__.to_s} => Completed"
38
- return results, error_messages
39
- end
40
-
41
- def update_ruleset(params = {})
42
- logger.debug "##{__method__.to_s} => Started"
43
-
44
- raise MissingArgumentsError.new 'Missing argument: params.' if params.blank?
45
- logger.debug "##{__method__.to_s} => params: #{params.inspect}"
46
-
47
- end_point = Defaults::END_POINTS[:relevance_update_ruleset]
48
- logger.debug "##{__method__.to_s} => end_point: #{end_point}"
49
-
50
- path = end_point
51
- logger.debug "##{__method__.to_s} => path: #{path}"
52
-
53
- results, error_messages = @client.send(path, :post, params)
54
-
55
- logger.debug "##{__method__.to_s} => Completed"
56
- return results, error_messages
57
- end
58
-
59
- def run_ruleset_by_name(params = {})
60
- logger.debug "##{__method__.to_s} => Started"
61
-
62
- raise MissingArgumentsError.new 'Missing argument: params.' if params.blank?
63
- logger.debug "##{__method__.to_s} => params: #{params.inspect}"
64
-
65
- end_point = Defaults::END_POINTS[:relevance_run_ruleset_by_name]
66
- logger.debug "##{__method__.to_s} => end_point: #{end_point}"
67
-
68
- path = end_point
69
- logger.debug "##{__method__.to_s} => path: #{path}"
70
-
71
- results, error_messages = @client.send(path, :post, params)
72
-
73
- logger.debug "##{__method__.to_s} => Completed"
74
- return results, error_messages
75
- end
76
-
77
- def run_ruleset_custom(params = {})
78
- logger.debug "##{__method__.to_s} => Started"
79
-
80
- raise MissingArgumentsError.new 'Missing argument: params.' if params.blank?
81
- logger.debug "##{__method__.to_s} => params: #{params.inspect}"
82
-
83
- end_point = Defaults::END_POINTS[:relevance_run_ruleset_custom]
84
- logger.debug "##{__method__.to_s} => end_point: #{end_point}"
85
-
86
- path = end_point
87
- logger.debug "##{__method__.to_s} => path: #{path}"
88
-
89
- results, error_messages = @client.send(path, :post, params)
90
-
91
- logger.debug "##{__method__.to_s} => Completed"
92
- return results, error_messages
93
- end
94
-
95
- end
96
-
97
- end
98
- end
@@ -1,64 +0,0 @@
1
- module FinApps
2
- module REST
3
- module Relevance
4
-
5
- require 'erb'
6
-
7
- class Rulesets < FinApps::REST::Resources
8
-
9
- def list
10
- logger.debug "##{__method__.to_s} => Started"
11
-
12
- end_point = Defaults::END_POINTS[:relevance_rulesets_list]
13
- logger.debug "##{__method__.to_s} => end_point: #{end_point}"
14
-
15
- path = end_point
16
- logger.debug "##{__method__.to_s} => path: #{path}"
17
-
18
- results, error_messages = @client.send(path, :get)
19
-
20
- logger.debug "##{__method__.to_s} => Completed"
21
- return results, error_messages
22
- end
23
-
24
- def show(ruleset_name)
25
- logger.debug "##{__method__.to_s} => Started"
26
-
27
- raise MissingArgumentsError.new 'Missing argument: ruleset_name.' if ruleset_name.blank?
28
- logger.debug "##{__method__.to_s} => ruleset_name: #{ruleset_name}"
29
-
30
- end_point = Defaults::END_POINTS[:relevance_rulesets_show]
31
- logger.debug "##{__method__.to_s} => end_point: #{end_point}"
32
-
33
- path = end_point.sub ':ruleset_name', ERB::Util.url_encode(ruleset_name)
34
- logger.debug "##{__method__.to_s} => path: #{path}"
35
-
36
- results, error_messages = @client.send(path, :get)
37
-
38
- logger.debug "##{__method__.to_s} => Completed"
39
- return results, error_messages
40
- end
41
-
42
- def run(params = {})
43
- logger.debug "##{__method__.to_s} => Started"
44
-
45
- raise MissingArgumentsError.new 'Missing argument: params.' if params.blank?
46
- logger.debug "##{__method__.to_s} => params: #{params.inspect}"
47
-
48
- end_point = Defaults::END_POINTS[:relevance_rulesets_run]
49
- logger.debug "##{__method__.to_s} => end_point: #{end_point}"
50
-
51
- path = end_point
52
- logger.debug "##{__method__.to_s} => path: #{path}"
53
-
54
- results, error_messages = @client.send(path, :post, params)
55
-
56
- logger.debug "##{__method__.to_s} => Completed"
57
- return results, error_messages
58
- end
59
-
60
- end
61
- end
62
-
63
- end
64
- end