dscf-credit 0.2.3 → 0.2.4
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: '0883e69edbfba633fb3b886139de199303da27bfaa0ed9402c39d7ed036fb778'
|
4
|
+
data.tar.gz: e1ea1f2d623086de0e807c1e986cb340b41d10501056960a1f4c7f8b03b84192
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f624bce3e341b942f97bc54201f94f995db7dc8a507083c8061d6fdfc58e982f0f2c2f13b573c881b37ffc5e1170184db026c9ae247473a05aef86620620117f
|
7
|
+
data.tar.gz: ba02250152266b20ecca88cf929b2379b3931fd7d1f0dd9561d632e1928a6c15c7b83deaac2ffa8930601f8bd6de9969b7578a140a08d43aeb272070a95f5138
|
@@ -145,6 +145,24 @@ module Dscf::Credit
|
|
145
145
|
end
|
146
146
|
end
|
147
147
|
|
148
|
+
def create_loan_profile_for_approved_application(loan_application, score)
|
149
|
+
profile_service = LoanProfileCreationService.new(loan_application, score)
|
150
|
+
profile_result = profile_service.create_loan_profile
|
151
|
+
|
152
|
+
unless profile_result[:success]
|
153
|
+
error_message = "Failed to create loan profile for approved application #{loan_application.id}: #{profile_result[:error]}"
|
154
|
+
Rails.logger.error error_message
|
155
|
+
# Raise error to rollback the entire transaction including score and review status
|
156
|
+
raise StandardError, error_message
|
157
|
+
else
|
158
|
+
Rails.logger.info "Loan profile created successfully for approved application #{loan_application.id}"
|
159
|
+
end
|
160
|
+
|
161
|
+
profile_result
|
162
|
+
end
|
163
|
+
|
164
|
+
|
165
|
+
|
148
166
|
private
|
149
167
|
|
150
168
|
def update_review_status(loan_application, status)
|
@@ -191,22 +209,6 @@ module Dscf::Credit
|
|
191
209
|
end
|
192
210
|
|
193
211
|
# Create loan profile for approved applications
|
194
|
-
def create_loan_profile_for_approved_application(loan_application, score)
|
195
|
-
profile_service = LoanProfileCreationService.new(loan_application, score)
|
196
|
-
profile_result = profile_service.create_loan_profile
|
197
|
-
|
198
|
-
unless profile_result[:success]
|
199
|
-
error_message = "Failed to create loan profile for approved application #{loan_application.id}: #{profile_result[:error]}"
|
200
|
-
Rails.logger.error error_message
|
201
|
-
# Raise error to rollback the entire transaction including score and review status
|
202
|
-
raise StandardError, error_message
|
203
|
-
else
|
204
|
-
Rails.logger.info "Loan profile created successfully for approved application #{loan_application.id}"
|
205
|
-
end
|
206
|
-
|
207
|
-
profile_result
|
208
|
-
end
|
209
|
-
|
210
212
|
def create_loan_profile_from_review(review)
|
211
213
|
loan_application = review.reviewable # Assumes Review belongs_to :reviewable (polymorphic or direct association to LoanApplication)
|
212
214
|
score = loan_application.score # Assumes score is already set on the loan application
|
data/lib/dscf/credit/version.rb
CHANGED