voltaria_sdk 2.38.2 → 2.40.0

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: 6095890459b2bb1e8524e4d8d0f4334cb7b28cbe01eaf2d5f36e20463fa6201d
4
- data.tar.gz: f101e5811fbbb22b70f3ea48dac111d6df5b826e2311a502656537df12523d1a
3
+ metadata.gz: fa3a57b1b9c8993bd0e429d8d57d0bfcc06597e3b00f338f03401739292dfa64
4
+ data.tar.gz: 6d9577466d3c30a5076ba06ac6108bc80ebc5f5a19f04c1cf95b5e11ac1a772f
5
5
  SHA512:
6
- metadata.gz: '067309d18e77b44409573fd27608c7f7b8b7d42c7aaf6ce514539cc6a263ddb7a08a189b5fb456321b99fc241d846f7925edfda3ee2b25e407c5b44634cab247'
7
- data.tar.gz: '0791433a7509d7ef6f122a3ada65bee8bd0d7ba17d0b13db1bab7c234d7e46bbdef261e214e9d2822dcbc35dfd5d1ae37de9e68570bcbd725fbf8ef1600d1ed4'
6
+ metadata.gz: d28a73814ee80ca6072c96d13afa1917021f875685ececade8411058128808721605144179359866683f38016638740275cebddc2a330f44eaaf88a3c52ce8ef
7
+ data.tar.gz: '01679e6401ea2f6cccf78f76f785ca98c5d6a69fbfa5f9bb1f753f97e941d122c1206f5fce91ab47a0170f2a6ad6ac253fac4ddd2dfd8aacfd9ce55c0fddfe2c'
@@ -276,6 +276,47 @@ module Voltaria
276
276
  raise error_class.new(response.body, code: code)
277
277
  end
278
278
 
279
+ # Calculate the indicative early settlement figure for a loan as of the given settlement date. The amount is
280
+ # indicative only, not a binding quote, and has no validity period — it changes as repayments are recorded and as
281
+ # the settlement date moves. Confirm the final amount with Voltaria before collecting from the borrower.
282
+ #
283
+ # @param request_options [Hash]
284
+ # @param params [Voltaria::Loans::Types::EarlySettlementPayload]
285
+ # @option request_options [String] :base_url
286
+ # @option request_options [Hash{String => Object}] :additional_headers
287
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
288
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
289
+ # @option request_options [Integer] :timeout_in_seconds
290
+ # @option params [String] :loan_id
291
+ #
292
+ # @return [Voltaria::Types::EarlySettlementResponse]
293
+ def calculate_settlement(request_options: {}, **params)
294
+ params = Voltaria::Internal::Types::Utils.normalize_keys(params)
295
+ request_data = Voltaria::Loans::Types::EarlySettlementPayload.new(params).to_h
296
+ non_body_param_names = ["loan_id"]
297
+ body = request_data.except(*non_body_param_names)
298
+
299
+ request = Voltaria::Internal::JSON::Request.new(
300
+ base_url: request_options[:base_url],
301
+ method: "POST",
302
+ path: "v2/loans/#{URI.encode_uri_component(params[:loan_id].to_s)}/calculate-settlement",
303
+ body: body,
304
+ request_options: request_options
305
+ )
306
+ begin
307
+ response = @client.send(request)
308
+ rescue Net::HTTPRequestTimeout
309
+ raise Voltaria::Errors::TimeoutError
310
+ end
311
+ code = response.code.to_i
312
+ if code.between?(200, 299)
313
+ Voltaria::Types::EarlySettlementResponse.load(response.body)
314
+ else
315
+ error_class = Voltaria::Errors::ResponseError.subclass_for_code(code)
316
+ raise error_class.new(response.body, code: code)
317
+ end
318
+ end
319
+
279
320
  # Create multiple loans in a single request. Processing happens asynchronously. Returns a task ID for tracking
280
321
  # progress.
281
322
  #
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Voltaria
4
+ module Loans
5
+ module Types
6
+ class EarlySettlementPayload < Internal::Types::Model
7
+ field :loan_id, -> { String }, optional: false, nullable: false
8
+ field :settlement_date, -> { String }, optional: true, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Voltaria
4
+ module Types
5
+ class EarlySettlementResponse < Internal::Types::Model
6
+ field :loan_id, -> { String }, optional: false, nullable: false
7
+ field :settlement_date, -> { String }, optional: false, nullable: false
8
+ field :settlement_amount, -> { String }, optional: false, nullable: false
9
+ field :settlement_irr, -> { String }, optional: false, nullable: false
10
+ field :original_irr, -> { String }, optional: true, nullable: false
11
+ field :minimum_fee, -> { String }, optional: true, nullable: false
12
+ end
13
+ end
14
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Voltaria
4
- VERSION = "2.38.2"
4
+ VERSION = "2.40.0"
5
5
  end
data/lib/voltaria.rb CHANGED
@@ -90,6 +90,7 @@ require_relative "voltaria/types/document_response"
90
90
  require_relative "voltaria/types/drawdown_checklist_response"
91
91
  require_relative "voltaria/types/drawdown_status_enum"
92
92
  require_relative "voltaria/types/drawdown_response"
93
+ require_relative "voltaria/types/early_settlement_response"
93
94
  require_relative "voltaria/types/validation_error_loc_item"
94
95
  require_relative "voltaria/types/validation_error"
95
96
  require_relative "voltaria/types/http_validation_error"
@@ -203,6 +204,7 @@ require_relative "voltaria/loans/types/list_loans_request"
203
204
  require_relative "voltaria/loans/types/loan_create_payload"
204
205
  require_relative "voltaria/loans/types/get_loan_by_id_request"
205
206
  require_relative "voltaria/loans/types/delete_loan_request"
207
+ require_relative "voltaria/loans/types/early_settlement_payload"
206
208
  require_relative "voltaria/loans/types/bulk_loan_create_payload"
207
209
  require_relative "voltaria/loans/types/get_bulk_loan_status_request"
208
210
  require_relative "voltaria/loans/types/loan_default_payload"
data/reference.md CHANGED
@@ -4211,6 +4211,76 @@ client.loans.delete_loan(loan_id: "loan_id")
4211
4211
  </dl>
4212
4212
 
4213
4213
 
4214
+ </dd>
4215
+ </dl>
4216
+ </details>
4217
+
4218
+ <details><summary><code>client.loans.<a href="/lib/voltaria/loans/client.rb">calculate_settlement</a>(loan_id, request) -> Voltaria::Types::EarlySettlementResponse</code></summary>
4219
+ <dl>
4220
+ <dd>
4221
+
4222
+ #### 📝 Description
4223
+
4224
+ <dl>
4225
+ <dd>
4226
+
4227
+ <dl>
4228
+ <dd>
4229
+
4230
+ Calculate the indicative early settlement figure for a loan as of the given settlement date. The amount is indicative only, not a binding quote, and has no validity period — it changes as repayments are recorded and as the settlement date moves. Confirm the final amount with Voltaria before collecting from the borrower.
4231
+ </dd>
4232
+ </dl>
4233
+ </dd>
4234
+ </dl>
4235
+
4236
+ #### 🔌 Usage
4237
+
4238
+ <dl>
4239
+ <dd>
4240
+
4241
+ <dl>
4242
+ <dd>
4243
+
4244
+ ```ruby
4245
+ client.loans.calculate_settlement(loan_id: "loan_id")
4246
+ ```
4247
+ </dd>
4248
+ </dl>
4249
+ </dd>
4250
+ </dl>
4251
+
4252
+ #### ⚙️ Parameters
4253
+
4254
+ <dl>
4255
+ <dd>
4256
+
4257
+ <dl>
4258
+ <dd>
4259
+
4260
+ **loan_id:** `String`
4261
+
4262
+ </dd>
4263
+ </dl>
4264
+
4265
+ <dl>
4266
+ <dd>
4267
+
4268
+ **settlement_date:** `String` — Date the loan would be settled. Must be today or later. Defaults to today when omitted.
4269
+
4270
+ </dd>
4271
+ </dl>
4272
+
4273
+ <dl>
4274
+ <dd>
4275
+
4276
+ **request_options:** `Voltaria::Loans::RequestOptions`
4277
+
4278
+ </dd>
4279
+ </dl>
4280
+ </dd>
4281
+ </dl>
4282
+
4283
+
4214
4284
  </dd>
4215
4285
  </dl>
4216
4286
  </details>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: voltaria_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.38.2
4
+ version: 2.40.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Voltaria
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-08-24 00:00:00.000000000 Z
11
+ date: 2026-09-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: The Voltaria Ruby library provides convenient access to the Voltaria
14
14
  API from Ruby.
@@ -114,6 +114,7 @@ files:
114
114
  - lib/voltaria/loans/client.rb
115
115
  - lib/voltaria/loans/types/bulk_loan_create_payload.rb
116
116
  - lib/voltaria/loans/types/delete_loan_request.rb
117
+ - lib/voltaria/loans/types/early_settlement_payload.rb
117
118
  - lib/voltaria/loans/types/get_bulk_loan_status_request.rb
118
119
  - lib/voltaria/loans/types/get_loan_by_id_request.rb
119
120
  - lib/voltaria/loans/types/get_loan_review_request_request.rb
@@ -182,6 +183,7 @@ files:
182
183
  - lib/voltaria/types/drawdown_checklist_response.rb
183
184
  - lib/voltaria/types/drawdown_response.rb
184
185
  - lib/voltaria/types/drawdown_status_enum.rb
186
+ - lib/voltaria/types/early_settlement_response.rb
185
187
  - lib/voltaria/types/http_validation_error.rb
186
188
  - lib/voltaria/types/installment_response.rb
187
189
  - lib/voltaria/types/installment_response_with_client_info.rb