dscf-banking 0.5.4 → 0.5.5
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/app/models/dscf/banking/interest_configuration.rb +16 -10
- data/lib/dscf/banking/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e91b4944ed5da04e89193cc1e06db5150ea053f3f4cd4a8098a576f25585c8c9
|
|
4
|
+
data.tar.gz: 0c1ef04c3785327d68b9d87d6a62ad228329a9fde73e68b6893253614b31284a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a9f07e8d19d474514261bb9189ed89b804525f34839b3ea55704861647a37aa69b840a5ad995b4d3e53c5d6d89237384db92f262173a5021f312257d3abd392e
|
|
7
|
+
data.tar.gz: af083b3874ca0b5e8161125409ed7c06974b8ccf3404f615d0e044bfe434e66022e4f691e6450f7f63a5cd5e15b49061151f4fa27c28ba0acb83aceb330c0a70
|
|
@@ -7,16 +7,18 @@ module Dscf::Banking
|
|
|
7
7
|
before_validation :normalize_rate_attributes
|
|
8
8
|
validate :interest_free_configuration_guidance
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
with_options unless: :interest_free_configuration_request? do
|
|
11
|
+
validates :annual_interest_rate, presence: true, numericality: { greater_than: 0, less_than_or_equal_to: 1 }
|
|
12
|
+
validates :income_tax_rate, presence: true, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 1 }
|
|
13
|
+
validates :minimum_balance_for_interest, presence: true, numericality: { greater_than_or_equal_to: 0 }
|
|
14
|
+
validates :calculation_method, presence: true
|
|
15
|
+
|
|
16
|
+
validates :interest_basis, presence: true
|
|
17
|
+
validates :accrual_frequency, presence: true
|
|
18
|
+
validates :rounding_rule, presence: true
|
|
19
|
+
validates :calculation_timing, presence: true
|
|
20
|
+
validates :is_active, inclusion: { in: [ true, false ] }
|
|
21
|
+
end
|
|
20
22
|
validate :promotional_dates_consistency
|
|
21
23
|
|
|
22
24
|
enum :calculation_method, {
|
|
@@ -72,6 +74,10 @@ module Dscf::Banking
|
|
|
72
74
|
)
|
|
73
75
|
end
|
|
74
76
|
|
|
77
|
+
def interest_free_configuration_request?
|
|
78
|
+
no_interest_requested? && required_calculation_fields_missing?
|
|
79
|
+
end
|
|
80
|
+
|
|
75
81
|
def normalize_rate_attributes
|
|
76
82
|
self.annual_interest_rate = normalize_rate_value(annual_interest_rate_before_type_cast)
|
|
77
83
|
self.income_tax_rate = normalize_rate_value(income_tax_rate_before_type_cast)
|
data/lib/dscf/banking/version.rb
CHANGED