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: c03116320f239a1f9f953742c429298bf629e0731e1938dc1870107bd2e3a74f
4
- data.tar.gz: da5c7c4a877ce2c82cd0300c25c9686f8ea1254bcfd9b82c856ecd99fb8ef5a7
3
+ metadata.gz: '0883e69edbfba633fb3b886139de199303da27bfaa0ed9402c39d7ed036fb778'
4
+ data.tar.gz: e1ea1f2d623086de0e807c1e986cb340b41d10501056960a1f4c7f8b03b84192
5
5
  SHA512:
6
- metadata.gz: 0ae96ca00a9c2cef5bb46b59a58e0b4cf13263cb89903a19bbf8c1a03c709d2a75ac59e4ea394668c4a5f2b2ea298cbfd963c22eb1af810a5fb4c6ed9c266bb3
7
- data.tar.gz: 879a870adbb92ac789ed00096d658e1c729107b94572c4ee66df10c31fcf123b549ceec50499b295cb16e94f446f0218ad7f0c6430fd5839c9c91f31e4ff19fb
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
@@ -1,5 +1,5 @@
1
1
  module Dscf
2
2
  module Credit
3
- VERSION = "0.2.3"
3
+ VERSION = "0.2.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dscf-credit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adoniyas