dscf-credit 0.3.6 → 0.3.7
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1443779ba67dff25e894c91b282acabdd8e6872728ced4a0dd9066a935da2c12
|
4
|
+
data.tar.gz: 141228623b227b54ac146125203dde6bb4adcb40a1c3e39e81062b5e64f50aa9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5991cb4fb11b1adbd0ca101d7ed8a27cf6f3f91f634f56aeb800477d1f275c586916d47bf5c5a0a70f657f331d68fdd1c5a77564aa6047103d71d5468eb31ce8
|
7
|
+
data.tar.gz: 60d7fec2c04ceb1f5485f4b8cbcf39375219be4ae6e5c79a21ea204203eb6ade319a1709dd90eacc62ec362baf8ed25bb376341aae929c2cadab8de04a4e217b
|
@@ -312,14 +312,20 @@ module Dscf::Credit
|
|
312
312
|
|
313
313
|
# Create an eligible credit line record with the calculated limit
|
314
314
|
#
|
315
|
-
#
|
316
|
-
#
|
317
|
-
#
|
315
|
+
# Finds an existing EligibleCreditLine for the loan profile and credit line combination.
|
316
|
+
# If one already exists, it skips creation and returns the existing record to prevent
|
317
|
+
# duplicates. If none exists, creates a new one with the calculated limits.
|
318
|
+
#
|
319
|
+
# This ensures that existing eligible credit lines are preserved with their current
|
320
|
+
# available_limit values (which may have been reduced by loan disbursements).
|
318
321
|
#
|
319
322
|
# @param credit_line [CreditLine] The credit line to create eligibility for
|
320
323
|
# @param limit [Float] The calculated credit limit
|
321
|
-
# @return [EligibleCreditLine] The created eligible credit line record
|
324
|
+
# @return [EligibleCreditLine, nil] The existing or newly created eligible credit line record, or nil if already exists
|
322
325
|
def create_eligible_credit_line(credit_line, limit)
|
326
|
+
existing = loan_profile.eligible_credit_lines.find_by(credit_line: credit_line)
|
327
|
+
return existing if existing
|
328
|
+
|
323
329
|
loan_profile.eligible_credit_lines.create!(
|
324
330
|
credit_line: credit_line,
|
325
331
|
credit_limit: limit,
|
data/lib/dscf/credit/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dscf-credit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adoniyas
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-10-
|
10
|
+
date: 2025-10-16 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: dscf-core
|