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 +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/assinafy/resources/assignment_resource.rb +6 -2
- data/lib/assinafy/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e3c0bc2e23ab5f9a95c43efb0b1e219f264f2ea6300d191e991850a907a046c3
|
|
4
|
+
data.tar.gz: c991ca2975741b5ca3a9686d01430f8b45221fe0f1e407ebebc53b237262d4e2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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) }
|
|
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
|
-
|
|
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] }
|
data/lib/assinafy/version.rb
CHANGED