assinafy 1.6.0 → 1.7.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: e552b1b827ecb77d5f39f9b6eb64e99e3172173535ef3889a42ae6e17b2c6f9b
4
- data.tar.gz: c5ffe52ec11ba92dcc11544149d233bcb925f71881ea3df20f267fff15980886
3
+ metadata.gz: e3c0bc2e23ab5f9a95c43efb0b1e219f264f2ea6300d191e991850a907a046c3
4
+ data.tar.gz: c991ca2975741b5ca3a9686d01430f8b45221fe0f1e407ebebc53b237262d4e2
5
5
  SHA512:
6
- metadata.gz: cd67d2ab9e3eddec23af125e5bb99e373844dcd2e1c78b40b84011dd6d03feb54d487d12682df11565ba5494e06051e08f6767d273af25ddcf4b0579a78e5eed
7
- data.tar.gz: ec329eab7fcc39c1028dc41554888de5597defdeca50e49bf0dee66a2fb58d4ade1b18ab69466619c62e38a5521a3a810c518b3da754d1eb2afc41ca6e49d86a
6
+ metadata.gz: d3956278a581b59bf431a884053be9b0f618fc3b231803b276182e8e3481b26debcd125ff6ba626cdb84959b1f7994f28398110ba5de32fa9c2a6a1105e9b2be
7
+ data.tar.gz: f6e43c5cc8abc3b7f9d1f13364181f3948a164709c49a188a623a7b3ca5720c7a75a154d427c4f899bdf6c368536c89259418991d01de301765fc03140131156
data/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  All notable changes to the `assinafy` Ruby gem are documented here.
4
4
 
5
+ ## 1.7.0
6
+
7
+ - Require at least one signer on every assignment payload, not just `virtual` ones. The published
8
+ contract marks `signers` as required only for `virtual`, but the API prices per signer in both
9
+ modes and answers a signer-less body with
10
+ `400 "Pelo menos um signatários precisa ser informado."` `build_payload` also dropped the
11
+ `signers` key entirely when the list was empty, so a `collect` estimate could never be priced.
12
+ Both `create` and `estimate_cost` now raise `ValidationError` locally instead of failing upstream.
13
+
5
14
  ## 1.6.0
6
15
 
7
16
  ### Added
@@ -105,7 +105,7 @@ module Assinafy
105
105
  validate_optional_fields!(p)
106
106
 
107
107
  result = { method: method }
108
- result[:signers] = signers.map { |ref| normalise_signer_ref(ref, options) } unless signers.empty?
108
+ result[:signers] = signers.map { |ref| normalise_signer_ref(ref, options) }
109
109
  OPTIONAL_FIELDS.each { |key| result[key] = p[key] if p[key] }
110
110
  result[:entries] = entries if entries
111
111
  Utils.body_params(result)
@@ -118,7 +118,11 @@ module Assinafy
118
118
  raise ValidationError.new("Assignment method must be one of: #{METHODS.join(', ')}")
119
119
  end
120
120
 
121
- if method == 'virtual' && signers.empty?
121
+ # `signers` is required for both methods: creation needs to know who signs, and the
122
+ # estimate is priced per signer. The published contract marks it required only for
123
+ # `virtual`, but the API answers a signer-less body with
124
+ # 400 "Pelo menos um signatários precisa ser informado."
125
+ if signers.empty?
122
126
  raise ValidationError.new(
123
127
  'At least one signer is required',
124
128
  { signers: payload[:signers] || payload[:signer_ids] || payload[:signerIds] }
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Assinafy
4
- VERSION = '1.6.0'
4
+ VERSION = '1.7.0'
5
5
  USER_AGENT = "Assinafy-Ruby-SDK/v#{VERSION}".freeze
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assinafy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Assinafy SDK Contributors