loan_creator 0.5.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +39 -0
- data/CODE_OF_CONDUCT.md +73 -0
- data/README.md +10 -4
- data/lib/loan_creator/uncapitalized_bullet.rb +34 -0
- data/lib/loan_creator/version.rb +1 -1
- data/lib/loan_creator.rb +10 -9
- data/loan_creator.gemspec +3 -3
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8db3e56a2163350ca40694fd499d989155ddcf09
|
4
|
+
data.tar.gz: a37e9da2455b71ef215618ab0f35dd4e55b5cd16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a56a344d7ed6509fea8625b4897550073f8c5f13e39860501e7d02d8eb40b55cdf4c55b74dca815993d706dc1283c07ec9361cc815590807284d295910858f41
|
7
|
+
data.tar.gz: 3db6aebe3ee2a2916175ecfd5f43f231fdbd669d92e217c4601184e70b8c73ab87468b636c739832b3a9181a5165dca3a9313d29d5fe4512cae3dc0747c9af4a
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
v0.6.1
|
2
|
+
-------------------------
|
3
|
+
|
4
|
+
- fix homepage url
|
5
|
+
|
6
|
+
v0.6.0
|
7
|
+
-------------------------
|
8
|
+
|
9
|
+
- add `LoanCreator::UncapitalizedBullet`
|
10
|
+
|
11
|
+
v0.5.0
|
12
|
+
-------------------------
|
13
|
+
|
14
|
+
- add `interests_start_date` in `LoanCreator::Common` attributes, replacing `first_term_date`
|
15
|
+
|
16
|
+
v0.3.0
|
17
|
+
-------------------------
|
18
|
+
|
19
|
+
- add `first_term_date` in `LoanCreator::Common` attributes
|
20
|
+
|
21
|
+
v0.2.3
|
22
|
+
-------------------------
|
23
|
+
|
24
|
+
- rename `starts_at` -> `starts_on`
|
25
|
+
|
26
|
+
v0.2.2
|
27
|
+
-------------------------
|
28
|
+
|
29
|
+
- rename `date` -> `due_on`
|
30
|
+
|
31
|
+
v0.2.1
|
32
|
+
-------------------------
|
33
|
+
|
34
|
+
- convert some options to their expected type by default
|
35
|
+
|
36
|
+
v0.2.0
|
37
|
+
-------------------------
|
38
|
+
|
39
|
+
- Huge rework : add `period`, rename `amount_in_cents` to `amount` and other breaking changes.
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
9
|
+
level of experience, education, socio-economic status, nationality, personal
|
10
|
+
appearance, race, religion, or sexual identity and orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at development@capsens.eu. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
72
|
+
|
73
|
+
[homepage]: https://www.contributor-covenant.org
|
data/README.md
CHANGED
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
`loan_creator` gem intends to provide a set of methods to allow automatic generation of loan timetables, for simulation, from a lender point of view and from a borrower point of view, regarding financial rounding differences. As of today, the gem makes the borrower support any rounding issue. In a later work, an option should be provided to decide who supports such issues.
|
4
4
|
|
5
|
-
Link to Loan_Creator excel simulator [Click here] (Excel)
|
6
|
-
|
7
5
|
## Installation
|
8
6
|
|
9
7
|
Add this line to your application's Gemfile:
|
@@ -35,6 +33,7 @@ There are four types of loans. All inherit from a `LoanCreator::Common` class.
|
|
35
33
|
LoanCreator::Linear
|
36
34
|
LoanCreator::InFine
|
37
35
|
LoanCreator::Bullet
|
36
|
+
LoanCreator::UncapitalizedBullet
|
38
37
|
```
|
39
38
|
|
40
39
|
Each instance of one of the previous classes has the following attributes:
|
@@ -137,6 +136,9 @@ Capital share shall be repaid in full at loan's end.
|
|
137
136
|
Interests are capitalized, i.e. added to the borrowed capital on each term.\
|
138
137
|
Capital share shall be repaid in full and all interests paid at loan's end.
|
139
138
|
|
139
|
+
`UncapitalizedBullet` same as bullet, the only difference is the interests\
|
140
|
+
are NOT capitalized.
|
141
|
+
|
140
142
|
There is no deferred time for `InFine` and `Bullet` loans as it would be equivalent to increasing loan's duration.
|
141
143
|
|
142
144
|
### Attributes
|
@@ -155,10 +157,14 @@ There is no deferred time for `InFine` and `Bullet` loans as it would be equival
|
|
155
157
|
capital is refunded, only interest. Only relevant for `Standard` and `Linear` loans.
|
156
158
|
|
157
159
|
`interests_start_date`: Optional. To be used when the loan starts before the first full term date. This then compute an
|
158
|
-
additional term with only interests for the time difference.
|
160
|
+
additional term with only interests for the time difference.
|
159
161
|
For example, with a `start_at` in january 2020 and a `interests_start_date` in october 2019, the timetable will include a
|
160
162
|
first term corresponding to 3 months of interests.
|
161
163
|
|
164
|
+
## Calculation
|
165
|
+
|
166
|
+
An excel simulator for standard case can be found [here](CapSens_Loan.xlsx).
|
167
|
+
|
162
168
|
## Development
|
163
169
|
|
164
170
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -167,7 +173,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
167
173
|
|
168
174
|
## Contributing
|
169
175
|
|
170
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
176
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/CapSens/loan_creator.
|
171
177
|
|
172
178
|
|
173
179
|
## License
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module LoanCreator
|
2
|
+
class UncapitalizedBullet < LoanCreator::Common
|
3
|
+
def lender_timetable
|
4
|
+
raise ArgumentError.new(:deferred_in_periods) unless deferred_in_periods == 0
|
5
|
+
raise ArgumentError.new(:interests_start_date) unless interests_start_date.nil?
|
6
|
+
timetable = new_timetable
|
7
|
+
reset_current_term
|
8
|
+
@crd_beginning_of_period = amount
|
9
|
+
@crd_end_of_period = amount
|
10
|
+
(duration_in_periods - 1).times { timetable << current_term }
|
11
|
+
compute_last_term
|
12
|
+
timetable << current_term
|
13
|
+
timetable
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def compute_last_term
|
19
|
+
@crd_end_of_period = bigd('0')
|
20
|
+
@period_interests = total_interests
|
21
|
+
@period_capital = @crd_beginning_of_period
|
22
|
+
@total_paid_capital_end_of_period = @period_capital
|
23
|
+
@total_paid_interests_end_of_period = @period_interests
|
24
|
+
@period_amount_to_pay = @period_capital + @period_interests
|
25
|
+
end
|
26
|
+
|
27
|
+
def total_interests
|
28
|
+
amount.mult(
|
29
|
+
bigd(periodic_interests_rate) * bigd(duration_in_periods),
|
30
|
+
BIG_DECIMAL_DIGITS
|
31
|
+
)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/lib/loan_creator/version.rb
CHANGED
data/lib/loan_creator.rb
CHANGED
@@ -7,13 +7,14 @@ require 'loan_creator/version'
|
|
7
7
|
module LoanCreator
|
8
8
|
BIG_DECIMAL_DIGITS = 14
|
9
9
|
|
10
|
-
autoload :ExcelFormulas,
|
11
|
-
autoload :BorrowerTimetable,
|
12
|
-
autoload :Common,
|
13
|
-
autoload :Standard,
|
14
|
-
autoload :Linear,
|
15
|
-
autoload :InFine,
|
16
|
-
autoload :Bullet,
|
17
|
-
autoload :Timetable,
|
18
|
-
autoload :Term,
|
10
|
+
autoload :ExcelFormulas, 'loan_creator/excel_formulas'
|
11
|
+
autoload :BorrowerTimetable, 'loan_creator/borrower_timetable'
|
12
|
+
autoload :Common, 'loan_creator/common'
|
13
|
+
autoload :Standard, 'loan_creator/standard'
|
14
|
+
autoload :Linear, 'loan_creator/linear'
|
15
|
+
autoload :InFine, 'loan_creator/in_fine'
|
16
|
+
autoload :Bullet, 'loan_creator/bullet'
|
17
|
+
autoload :Timetable, 'loan_creator/timetable'
|
18
|
+
autoload :Term, 'loan_creator/term'
|
19
|
+
autoload :UncapitalizedBullet, 'loan_creator/uncapitalized_bullet'
|
19
20
|
end
|
data/loan_creator.gemspec
CHANGED
@@ -5,11 +5,11 @@ require 'loan_creator/version'
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'loan_creator'
|
7
7
|
spec.version = LoanCreator::VERSION
|
8
|
-
spec.authors =
|
9
|
-
spec.email = ['thibault@capsens.eu', 'nicolas.besnard@capsens.eu', 'younes.serraj@gmail.com']
|
8
|
+
spec.authors = ["thibaulth", "nicob", "younes.serraj", "Antoine Becquet", "Jerome Drevet"]
|
9
|
+
spec.email = ['thibault@capsens.eu', 'nicolas.besnard@capsens.eu', 'younes.serraj@gmail.com', "antoine@capsens.eu", "jerome@capsens.eu"]
|
10
10
|
|
11
11
|
spec.summary = 'Create and update timetables from input data'
|
12
|
-
spec.homepage = 'https://
|
12
|
+
spec.homepage = 'https://github.com/CapSens/loan-creator'
|
13
13
|
spec.license = 'MIT'
|
14
14
|
|
15
15
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
metadata
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: loan_creator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thibaulth
|
8
8
|
- nicob
|
9
9
|
- younes.serraj
|
10
|
+
- Antoine Becquet
|
11
|
+
- Jerome Drevet
|
10
12
|
autorequire:
|
11
13
|
bindir: exe
|
12
14
|
cert_chain: []
|
@@ -115,6 +117,8 @@ email:
|
|
115
117
|
- thibault@capsens.eu
|
116
118
|
- nicolas.besnard@capsens.eu
|
117
119
|
- younes.serraj@gmail.com
|
120
|
+
- antoine@capsens.eu
|
121
|
+
- jerome@capsens.eu
|
118
122
|
executables: []
|
119
123
|
extensions: []
|
120
124
|
extra_rdoc_files: []
|
@@ -126,6 +130,8 @@ files:
|
|
126
130
|
- ".ruby-gemset"
|
127
131
|
- ".ruby-version"
|
128
132
|
- ".travis.yml"
|
133
|
+
- CHANGELOG.md
|
134
|
+
- CODE_OF_CONDUCT.md
|
129
135
|
- CapSens_Loan.xlsx
|
130
136
|
- Gemfile
|
131
137
|
- LICENSE.txt
|
@@ -144,9 +150,10 @@ files:
|
|
144
150
|
- lib/loan_creator/standard.rb
|
145
151
|
- lib/loan_creator/term.rb
|
146
152
|
- lib/loan_creator/timetable.rb
|
153
|
+
- lib/loan_creator/uncapitalized_bullet.rb
|
147
154
|
- lib/loan_creator/version.rb
|
148
155
|
- loan_creator.gemspec
|
149
|
-
homepage: https://
|
156
|
+
homepage: https://github.com/CapSens/loan-creator
|
150
157
|
licenses:
|
151
158
|
- MIT
|
152
159
|
metadata: {}
|