nova-api 1.7.0 → 1.8.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: b026da760acc06cb5fbed6d9b9e2b61933de4bbef1bc04057fbea037f4173dcb
4
- data.tar.gz: 4955a3638e0d9a5f17a56ab063750dc5aa10f187ede22f314b9325f59a9f7cc6
3
+ metadata.gz: 577247914642aa6fae4ea3edd33708b6b330ce0ac28c4cd17a69415d7ab2ff2f
4
+ data.tar.gz: 590fe4e8ac7d4b9c8d8c8c45dbf283622b378326956ce4f6488ef90750c282da
5
5
  SHA512:
6
- metadata.gz: 0c875edfef3a39d9834afeee41f50c5078d63a69a4a995ef87f22ee0c4129359ee5ba0aa7003948464ea150b1eb83809c93898ae1e348b33664aaaaa4a3fb810
7
- data.tar.gz: ab441f060402677f0a56d929b17972dcfc98ecbe7c6da7875f3ac66f51aa4ca83629eb064d5b3b7f52cd713250752f1a64018a3179ffcf140197be6b640144ff
6
+ metadata.gz: 885f77c1523bc2a108c41824799bf50a573df21e14e9c4b9ab2c710434ed9f3e253b0c80b70ba37627f3f2b600f026a616dbde0c0f8584aaa8571df6e4e0e22e
7
+ data.tar.gz: 2fdd746ddcd0c21ad3b129ecb4d70ea38b901ca424ca59135a00b4a198d09728cb8bd8b6e848ed73460a28da07cd889541c6ec413d2c44ef5239316dfe63029d
data/CHANGELOG.md CHANGED
@@ -5,6 +5,102 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.8.0] - 2026-11-09
9
+
10
+ ### Added
11
+
12
+ - Forecast resource
13
+
14
+ - Forecast confirmation endpoint (`Forecast.confirm` and `Forecast#confirm`)
15
+
16
+ - Forecast confirmation from an installment (`Installment#confirm`)
17
+
18
+ ## [1.7.0] - 2026-03-26
19
+
20
+ ### Added
21
+
22
+ - Installment write offs cancellation endpoint (`Installment.cancel_write_offs` and `Installment#cancel_write_offs`)
23
+
24
+ ## [1.6.1] - 2025-09-11
25
+
26
+ ### Added
27
+
28
+ - Missing fields for company resource: `city`, `complement`, `email`, `logo`, `municipal_inscription`, `neighborhood`, `number`, `social_reason`, `state`, `tax_regime` and `zipcode`
29
+
30
+ ### Removed
31
+
32
+ - `social_contract_date` and `social_contract_number` fields from company resource
33
+
34
+ ## [1.6.0] - 2025-09-04
35
+
36
+ ### Added
37
+
38
+ - Invoice resource, with `STATUS` and `TYPE` enums
39
+
40
+ - Invoice creation endpoint for payables and receivables (`save_invoice`)
41
+
42
+ ## [1.5.0] - 2025-09-01
43
+
44
+ ### Added
45
+
46
+ - Installment write off endpoint (`Installment.write_off` and `Installment#write_off`)
47
+
48
+ - `installments` accessor on `Nova::API::Client`
49
+
50
+ - Find endpoint for payables and receivables (`Payable.find` and `Receivable.find`)
51
+
52
+ ### Fixed
53
+
54
+ - Nested attributes without an allowed attributes list were not being serialized to plain values
55
+
56
+ ## [1.4.7] - 2024-05-20
57
+
58
+ ### Changed
59
+
60
+ - Requests now build the full URL from the current configuration on each call instead of changing the HTTParty base URI on the class
61
+
62
+ ### Removed
63
+
64
+ - `HTTParty` is no longer included in `Nova::API::Base`
65
+
66
+ ## [1.4.6] - 2024-04-29
67
+
68
+ ### Changed
69
+
70
+ - Debug messages now show the full request URL
71
+
72
+ ## [1.4.5] - 2024-04-05
73
+
74
+ ### Changed
75
+
76
+ - Debug messages now report base URI changes
77
+
78
+ ## [1.4.4] - 2024-04-05
79
+
80
+ ### Added
81
+
82
+ - Debug message when the subdomain is changed
83
+
84
+ ### Removed
85
+
86
+ - Unused `host` and `scheme` readers from the configuration
87
+
88
+ ## [1.4.3] - 2024-04-03
89
+
90
+ ### Added
91
+
92
+ - Configuration to enable debug output (`debug`)
93
+
94
+ ### Changed
95
+
96
+ - Request logs are now only printed when `debug` is enabled
97
+
98
+ ## [1.4.2] - 2024-04-03
99
+
100
+ ### Added
101
+
102
+ - Request logging to stdout, including the request headers
103
+
8
104
  ## [1.4.1] - 2023-10-03
9
105
 
10
106
  ### Fixed
@@ -126,7 +222,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
126
222
 
127
223
  - Apportionment related stuff
128
224
 
129
- [unreleased]: https://github.com/coyosoftware/nova-api/compare/1.4.1...HEAD
225
+ [unreleased]: https://github.com/coyosoftware/nova-api/compare/v1.8.0...HEAD
226
+ [1.8.0]: https://github.com/coyosoftware/nova-api/releases/tag/v1.8.0
227
+ [1.7.0]: https://github.com/coyosoftware/nova-api/releases/tag/v1.7.0
228
+ [1.6.1]: https://github.com/coyosoftware/nova-api/releases/tag/v1.6.1
229
+ [1.6.0]: https://github.com/coyosoftware/nova-api/releases/tag/v1.6.0
230
+ [1.5.0]: https://github.com/coyosoftware/nova-api/releases/tag/v1.5.0
231
+ [1.4.7]: https://github.com/coyosoftware/nova-api/releases/tag/v1.4.7
232
+ [1.4.6]: https://github.com/coyosoftware/nova-api/releases/tag/v1.4.6
233
+ [1.4.5]: https://github.com/coyosoftware/nova-api/releases/tag/v1.4.5
234
+ [1.4.4]: https://github.com/coyosoftware/nova-api/releases/tag/v1.4.4
235
+ [1.4.3]: https://github.com/coyosoftware/nova-api/releases/tag/v1.4.3
236
+ [1.4.2]: https://github.com/coyosoftware/nova-api/releases/tag/v1.4.2
130
237
  [1.4.1]: https://github.com/coyosoftware/nova-api/releases/tag/1.4.1
131
238
  [1.3.0]: https://github.com/coyosoftware/nova-api/releases/tag/1.3.0
132
239
  [1.2.0]: https://github.com/coyosoftware/nova-api/releases/tag/1.2.0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nova-api (1.7.0)
4
+ nova-api (1.8.0)
5
5
  dry-struct (~> 1.6)
6
6
  dry-types (~> 1.7)
7
7
  httparty (~> 0.1)
@@ -0,0 +1,45 @@
1
+ module Nova
2
+ module API
3
+ module Resource
4
+ class Forecast < Nova::API::Base
5
+ ALLOWED_ATTRIBUTES = [
6
+ :additional_information, :apportionments, :close, :date, :document_type, :document_number, :due_date, :financial_accounts, :gross_value, :value
7
+ ]
8
+
9
+ attribute? :id, Dry::Types['coercible.integer'].optional
10
+ attribute? :additional_information, Dry::Types['coercible.string'].optional
11
+ attribute? :apportionments, Dry::Types['strict.array'].of(Nova::API::Resource::Bill::Apportionment).optional
12
+ attribute :close, Dry::Types['strict.bool']
13
+ attribute :date, Dry::Types['coercible.string'].constrained(format: DATE_REGEX)
14
+ attribute :document_type, Dry::Types['coercible.integer']
15
+ attribute? :document_number, Dry::Types['coercible.string']
16
+ attribute :due_date, Dry::Types['coercible.string'].constrained(format: DATE_REGEX)
17
+ attribute? :financial_accounts, Dry::Types['strict.array'].of(Nova::API::Resource::Bill::FinancialAccount).optional
18
+ attribute? :gross_value, Dry::Types['coercible.float'].optional
19
+ attribute :value, Dry::Types['coercible.float']
20
+
21
+ def self.endpoint
22
+ '/api/forecasts'
23
+ end
24
+
25
+ def self.confirm(id, parameters)
26
+ model = new(parameters.merge(id:))
27
+
28
+ model.confirm
29
+ end
30
+
31
+ def endpoint
32
+ protect_operation_from_missing_value
33
+
34
+ "/api/forecasts/#{id}"
35
+ end
36
+
37
+ def confirm
38
+ protect_operation_from_missing_value
39
+
40
+ do_post("#{self.class.endpoint}/#{id}/confirm", allowed_attributes)
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -74,6 +74,12 @@ module Nova
74
74
 
75
75
  do_delete("#{endpoint}/cancel_write_offs")
76
76
  end
77
+
78
+ def confirm(parameters)
79
+ model = Forecast.new(parameters.merge(id:))
80
+
81
+ model.confirm
82
+ end
77
83
  end
78
84
  end
79
85
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Nova
4
4
  module API
5
- VERSION = '1.7.0'
5
+ VERSION = '1.8.0'
6
6
  end
7
7
  end
data/lib/nova/api.rb CHANGED
@@ -15,6 +15,7 @@ require "nova/api/resource/bill"
15
15
  require "nova/api/resource/payable"
16
16
  require "nova/api/resource/receivable"
17
17
  require "nova/api/resource/invoice"
18
+ require "nova/api/resource/forecast"
18
19
 
19
20
  require "nova/api/resource/direct_bill"
20
21
  require "nova/api/resource/direct_payable"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nova-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Coyô Software
@@ -184,6 +184,7 @@ files:
184
184
  - lib/nova/api/resource/direct_payable.rb
185
185
  - lib/nova/api/resource/direct_receivable.rb
186
186
  - lib/nova/api/resource/financial_account.rb
187
+ - lib/nova/api/resource/forecast.rb
187
188
  - lib/nova/api/resource/installment.rb
188
189
  - lib/nova/api/resource/invoice.rb
189
190
  - lib/nova/api/resource/payable.rb