amortizy 1.0.0 → 2.0.0

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.
data/tasks/todo.md ADDED
@@ -0,0 +1,74 @@
1
+ # Amortizy v2.0 — Dynamic Payment Model
2
+
3
+ ## Goal
4
+
5
+ Replace the hardcoded term/payment lookup table with a dynamic calculation engine.
6
+ Support two entry points: `term_months` (calculate payment count) or `num_payments`
7
+ (calculate end date). Add monthly and bi-weekly frequencies.
8
+
9
+ ---
10
+
11
+ ## Phase 1: Dynamic Payment Engine
12
+
13
+ ### 1.1 Dual input model
14
+ - [ ] Accept `term_months` OR `num_payments` — one required, not both
15
+ - [ ] Validate: raise `ArgumentError` if both provided, or neither
16
+ - [ ] When `term_months` given: calculate `num_payments` from frequency
17
+ - monthly: `term_months`
18
+ - bi-weekly: `term_months * 2` (approx 26/year)
19
+ - weekly: `term_months * 52 / 12` (rounded)
20
+ - daily: calculate actual business/calendar days in the term
21
+ - [ ] When `num_payments` given: calculate end date by walking the payment schedule forward
22
+ - [ ] Remove the hardcoded `calculate_total_payments` lookup table
23
+ - [ ] Remove `validate_term_months!` (any positive integer is now valid)
24
+
25
+ ### 1.2 New frequencies
26
+ - [ ] Add `:monthly` frequency — payment on same day each month (or last business day)
27
+ - [ ] Add `:biweekly` frequency — every 14 days
28
+ - [ ] Update `validate_frequency!` to accept all four
29
+ - [ ] Handle month-end edge cases for monthly (e.g., start Jan 31 — Feb payment is Feb 28)
30
+
31
+ ### 1.3 Dynamic day calculation
32
+ - [ ] Replace static payment counts with actual date walking
33
+ - [ ] For daily + `bank_days_only`: count actual business days in the term
34
+ - [ ] For weekly/biweekly: walk forward by 7/14 days, skip to next bank day if needed
35
+ - [ ] For monthly: advance by calendar month, adjust for bank days
36
+
37
+ ## Phase 2: Public API Cleanup
38
+
39
+ ### 2.1 Expose schedule data
40
+ - [ ] Make `generate_schedule_data` public, rename to `schedule` or `to_a`
41
+ - [ ] Return frozen array of payment hashes
42
+ - [ ] Add `summary` method — returns hash with totals, dates, payment count
43
+ - [ ] Remove `send(:generate_schedule_data)` from README examples
44
+
45
+ ### 2.2 Convenience methods
46
+ - [ ] `#end_date` — last payment date
47
+ - [ ] `#total_interest` — sum of all interest payments
48
+ - [ ] `#total_paid` — sum of all payments
49
+ - [ ] `#payment_amount` — make public (currently private)
50
+
51
+ ## Phase 3: Extract Formatters
52
+
53
+ - [ ] Extract `ConsoleFormatter` — takes schedule data, renders table
54
+ - [ ] Extract `CsvFormatter` — takes schedule data, writes CSV
55
+ - [ ] `generate(output:)` delegates to formatter
56
+ - [ ] Engine class focuses on math only
57
+
58
+ ## Phase 4: Polish
59
+
60
+ - [ ] Fix README broken markdown in Development section
61
+ - [ ] Update README examples for new API
62
+ - [ ] Update gemspec description
63
+ - [ ] Add CHANGELOG entry for v2.0
64
+ - [ ] Bump version
65
+ - [ ] Update Ruby requirement to >= 3.0
66
+ - [ ] Run full spec suite, update/add specs for new features
67
+
68
+ ---
69
+
70
+ ## Breaking changes (v2.0)
71
+
72
+ - `term_months` no longer restricted to [6, 9, 12, 15, 18]
73
+ - `generate_schedule_data` renamed to public method
74
+ - New frequencies may change default behavior for existing users (unlikely — additive)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amortizy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rich Zapata
@@ -23,26 +23,27 @@ dependencies:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
25
  version: '8.0'
26
- description: A comprehensive Ruby gem for generating loan amortization schedules with
27
- advanced features including grace periods, interest-only payments, federal bank
28
- holidays, and multiple interest calculation methods
26
+ description: Generate loan amortization schedules with monthly, bi-weekly, weekly,
27
+ or daily payments. Supports grace periods, interest-only payments, federal bank
28
+ holidays, and multiple interest calculation methods.
29
29
  email:
30
30
  - rzapata@gmail.com
31
31
  executables: []
32
32
  extensions: []
33
33
  extra_rdoc_files: []
34
34
  files:
35
- - ".DS_Store"
36
35
  - CHANGELOG.md
37
- - CODE_OF_CONDUCT.md
36
+ - CONTRIBUTING.md
38
37
  - LICENSE.txt
39
38
  - README.md
40
39
  - Rakefile
41
- - lib/.DS_Store
42
40
  - lib/amortizy.rb
41
+ - lib/amortizy/console_formatter.rb
42
+ - lib/amortizy/csv_formatter.rb
43
43
  - lib/amortizy/engine.rb
44
44
  - lib/amortizy/version.rb
45
45
  - sig/amortizy.rbs
46
+ - tasks/todo.md
46
47
  homepage: https://github.com/zapatify/amortizy
47
48
  licenses:
48
49
  - MIT
@@ -51,6 +52,7 @@ metadata:
51
52
  homepage_uri: https://github.com/zapatify/amortizy
52
53
  source_code_uri: https://github.com/zapatify/amortizy
53
54
  changelog_uri: https://github.com/zapatify/amortizy/blob/main/CHANGELOG.md
55
+ rubygems_mfa_required: 'true'
54
56
  rdoc_options: []
55
57
  require_paths:
56
58
  - lib
@@ -58,14 +60,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
58
60
  requirements:
59
61
  - - ">="
60
62
  - !ruby/object:Gem::Version
61
- version: 2.7.0
63
+ version: 3.0.0
62
64
  required_rubygems_version: !ruby/object:Gem::Requirement
63
65
  requirements:
64
66
  - - ">="
65
67
  - !ruby/object:Gem::Version
66
68
  version: '0'
67
69
  requirements: []
68
- rubygems_version: 3.7.2
70
+ rubygems_version: 4.0.6
69
71
  specification_version: 4
70
72
  summary: A gem to generate amortization schedules
71
73
  test_files: []
data/.DS_Store DELETED
Binary file
data/CODE_OF_CONDUCT.md DELETED
@@ -1,132 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our
6
- community a harassment-free experience for everyone, regardless of age, body
7
- size, visible or invisible disability, ethnicity, sex characteristics, gender
8
- identity and expression, level of experience, education, socio-economic status,
9
- nationality, personal appearance, race, caste, color, religion, or sexual
10
- identity and orientation.
11
-
12
- We pledge to act and interact in ways that contribute to an open, welcoming,
13
- diverse, inclusive, and healthy community.
14
-
15
- ## Our Standards
16
-
17
- Examples of behavior that contributes to a positive environment for our
18
- community include:
19
-
20
- * Demonstrating empathy and kindness toward other people
21
- * Being respectful of differing opinions, viewpoints, and experiences
22
- * Giving and gracefully accepting constructive feedback
23
- * Accepting responsibility and apologizing to those affected by our mistakes,
24
- and learning from the experience
25
- * Focusing on what is best not just for us as individuals, but for the overall
26
- community
27
-
28
- Examples of unacceptable behavior include:
29
-
30
- * The use of sexualized language or imagery, and sexual attention or advances of
31
- any kind
32
- * Trolling, insulting or derogatory comments, and personal or political attacks
33
- * Public or private harassment
34
- * Publishing others' private information, such as a physical or email address,
35
- without their explicit permission
36
- * Other conduct which could reasonably be considered inappropriate in a
37
- professional setting
38
-
39
- ## Enforcement Responsibilities
40
-
41
- Community leaders are responsible for clarifying and enforcing our standards of
42
- acceptable behavior and will take appropriate and fair corrective action in
43
- response to any behavior that they deem inappropriate, threatening, offensive,
44
- or harmful.
45
-
46
- Community leaders have the right and responsibility to remove, edit, or reject
47
- comments, commits, code, wiki edits, issues, and other contributions that are
48
- not aligned to this Code of Conduct, and will communicate reasons for moderation
49
- decisions when appropriate.
50
-
51
- ## Scope
52
-
53
- This Code of Conduct applies within all community spaces, and also applies when
54
- an individual is officially representing the community in public spaces.
55
- Examples of representing our community include using an official email address,
56
- posting via an official social media account, or acting as an appointed
57
- representative at an online or offline event.
58
-
59
- ## Enforcement
60
-
61
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
- reported to the community leaders responsible for enforcement at
63
- [INSERT CONTACT METHOD].
64
- All complaints will be reviewed and investigated promptly and fairly.
65
-
66
- All community leaders are obligated to respect the privacy and security of the
67
- reporter of any incident.
68
-
69
- ## Enforcement Guidelines
70
-
71
- Community leaders will follow these Community Impact Guidelines in determining
72
- the consequences for any action they deem in violation of this Code of Conduct:
73
-
74
- ### 1. Correction
75
-
76
- **Community Impact**: Use of inappropriate language or other behavior deemed
77
- unprofessional or unwelcome in the community.
78
-
79
- **Consequence**: A private, written warning from community leaders, providing
80
- clarity around the nature of the violation and an explanation of why the
81
- behavior was inappropriate. A public apology may be requested.
82
-
83
- ### 2. Warning
84
-
85
- **Community Impact**: A violation through a single incident or series of
86
- actions.
87
-
88
- **Consequence**: A warning with consequences for continued behavior. No
89
- interaction with the people involved, including unsolicited interaction with
90
- those enforcing the Code of Conduct, for a specified period of time. This
91
- includes avoiding interactions in community spaces as well as external channels
92
- like social media. Violating these terms may lead to a temporary or permanent
93
- ban.
94
-
95
- ### 3. Temporary Ban
96
-
97
- **Community Impact**: A serious violation of community standards, including
98
- sustained inappropriate behavior.
99
-
100
- **Consequence**: A temporary ban from any sort of interaction or public
101
- communication with the community for a specified period of time. No public or
102
- private interaction with the people involved, including unsolicited interaction
103
- with those enforcing the Code of Conduct, is allowed during this period.
104
- Violating these terms may lead to a permanent ban.
105
-
106
- ### 4. Permanent Ban
107
-
108
- **Community Impact**: Demonstrating a pattern of violation of community
109
- standards, including sustained inappropriate behavior, harassment of an
110
- individual, or aggression toward or disparagement of classes of individuals.
111
-
112
- **Consequence**: A permanent ban from any sort of public interaction within the
113
- community.
114
-
115
- ## Attribution
116
-
117
- This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
- version 2.1, available at
119
- [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
-
121
- Community Impact Guidelines were inspired by
122
- [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
-
124
- For answers to common questions about this code of conduct, see the FAQ at
125
- [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
- [https://www.contributor-covenant.org/translations][translations].
127
-
128
- [homepage]: https://www.contributor-covenant.org
129
- [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
- [Mozilla CoC]: https://github.com/mozilla/diversity
131
- [FAQ]: https://www.contributor-covenant.org/faq
132
- [translations]: https://www.contributor-covenant.org/translations
data/lib/.DS_Store DELETED
Binary file