dscf-credit 0.1.0 → 0.1.1

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: 2284e9439102461eb4cb1d93804c47510c1d7b01e476e3ef8986a6b552e4aaea
4
- data.tar.gz: d14c68b09509e8da8e2eb679f2c0a8905238ec761ff701802f2d30fa31e45db4
3
+ metadata.gz: 48da97a9ea6344abf871d97bda581670dbe6091760ff9a0eab34d1816d548236
4
+ data.tar.gz: 1eee4be4d65744fde0baa13e865a82dc1482789a6c6cdabbd16deab05c2f6683
5
5
  SHA512:
6
- metadata.gz: fb0041c463dd58d218524a7ef033bc7c3995cb89aedc70faf2df38d0ad3e2e0d210c80fcb650f8271c8dcc09303d58029cae5e0461400e2293fcdb5c50e849da
7
- data.tar.gz: cb8101b2a8618250a5d961c59746c45e8d364ad921875ad6967ddf458445cb2ea3d8265865a293a04a22a817b7b4653d9301cfed27b55ddd9394f88a73c38560
6
+ metadata.gz: 5b5ecf3fb9ccd373f8ba718348f52d5b06a5c033e0b7a706ef8cc2eb60e35b7a43d5a315e5bb3b9cf7896198ff935cdce46ef6ac2b65f0d6eb6891c90a5a4a42
7
+ data.tar.gz: 66377466c007cb2880434c37fc25db5da940c644e1d2c8c5131e39e7e451fb5e73d1a38e2fa44b383b4692bfc9913e4a8bfbc73dd9fa657dd7fa8b451a0536f2
@@ -64,11 +64,11 @@ module Dscf::Credit
64
64
  end
65
65
 
66
66
  def submit_additional_info
67
- token = params[:token]
67
+ facilitator_id = params[:id] || params[:facilitator_id]
68
68
  additional_info = params[:additional_info]&.permit!.to_h
69
69
 
70
70
  begin
71
- result = FacilitatorAdditionalInfoService.new.submit_info(token, additional_info)
71
+ result = FacilitatorAdditionalInfoService.new.submit_info(facilitator_id, additional_info)
72
72
  render_success("facilitator.success.additional_info_submitted", data: result)
73
73
  rescue StandardError => e
74
74
  render_error("facilitator.errors.additional_info_failed", errors: e.message)
@@ -0,0 +1,10 @@
1
+ module Dscf::Credit
2
+ class FacilitatorPerformanceSerializer < ActiveModel::Serializer
3
+ attributes :id, :score, :total_outstanding_loans, :total_outstanding_amount,
4
+ :approval_required, :previous_performance_id, :input_data,
5
+ :expires_at, :created_at, :updated_at
6
+
7
+ belongs_to :facilitator, serializer: Dscf::Credit::FacilitatorSerializer
8
+ belongs_to :created_by, polymorphic: true
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ module Dscf::Credit
2
+ class FacilitatorSerializer < ActiveModel::Serializer
3
+ attributes :id, :name, :type, :total_limit, :kyc_status,
4
+ :created_at, :updated_at
5
+
6
+ belongs_to :user, serializer: Dscf::Core::UserSerializer
7
+ belongs_to :bank, serializer: Dscf::Credit::BankSerializer
8
+ belongs_to :kyc_approved_by, polymorphic: true
9
+ has_many :facilitator_performances, serializer: Dscf::Credit::FacilitatorPerformanceSerializer
10
+ end
11
+ end
@@ -1,10 +1,6 @@
1
1
  module Dscf::Credit
2
2
  class FacilitatorAdditionalInfoService
3
- def submit_info(token, additional_info)
4
- payload = verify_token(token)
5
-
6
- facilitator_id = payload["facilitator_id"]
7
-
3
+ def submit_info(facilitator_id, additional_info)
8
4
  facilitator = Dscf::Credit::Facilitator.find(facilitator_id)
9
5
 
10
6
  performance = facilitator.facilitator_performances.current.first
@@ -50,13 +46,5 @@ module Dscf::Credit
50
46
  message: "Additional information submitted successfully"
51
47
  }
52
48
  end
53
-
54
- private
55
-
56
- def verify_token(token)
57
- Rails.application.message_verifier("additional_info").verify(token)
58
- rescue ActiveSupport::MessageVerifier::InvalidSignature, ActiveSupport::MessageExpired => e
59
- raise StandardError, "Invalid or expired token: #{e.message}"
60
- end
61
49
  end
62
50
  end
@@ -1,5 +1,5 @@
1
1
  module Dscf
2
2
  module Credit
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
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.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adoniyas
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-09-02 00:00:00.000000000 Z
10
+ date: 2025-09-03 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: dscf-core
@@ -356,6 +356,8 @@ files:
356
356
  - app/serializers/dscf/credit/category_serializer.rb
357
357
  - app/serializers/dscf/credit/credit_line_serializer.rb
358
358
  - app/serializers/dscf/credit/credit_line_spec_serializer.rb
359
+ - app/serializers/dscf/credit/facilitator_performance_serializer.rb
360
+ - app/serializers/dscf/credit/facilitator_serializer.rb
359
361
  - app/serializers/dscf/credit/parameter_normalizer_serializer.rb
360
362
  - app/serializers/dscf/credit/scoring_parameter_serializer.rb
361
363
  - app/serializers/dscf/credit/scoring_table_serializer.rb