conexa 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: 76a95e870fc63f79b15b5227f1f0a10d94471efe573662dc626e42e57cf77b82
4
- data.tar.gz: 92fce7222c5b9adad92e6524e6dbfb3466bc1282a81768c5872922af37d2085b
3
+ metadata.gz: c71329999c6d13c4e935ef1e37a8eca6df5811c44d0326184cc1676d31fb199b
4
+ data.tar.gz: c6f6946375a05712ed7d952a4314738e86a2429bf3a249e269d2fd40b254c11f
5
5
  SHA512:
6
- metadata.gz: 4071bc748f2855c39eb48e7360bf4d519f0502d898ca7e915c88c41115bb85422766a2e0274d9ab39ac032de69507dd2275b5fa976de26b8dc586846f3089814
7
- data.tar.gz: 2962227ceb63eb324be8289502669995d4ac4d1136fd18570f972024b0774e0ff874c5c71d7fca8c296cd882850284415d8ce784312d1867d7471b3783ec79d3
6
+ metadata.gz: 13fc7859937cd156cd8ae68b78d6c303b62460d4f6e682f270f58927e87c8a99e29e7d43a4814318b53ed5c5e20ce5e0ea3892d46db8d4d08147e9aea79a690e
7
+ data.tar.gz: c1ae89758b0cea23df6c5f5cc16895c060baef04da9a31fefd58eb7ac9c7ba1b1483dfc44b81c00ddfb592cada2e34cace170237e5f298b3ea8b3217572bd1c9
data/CHANGELOG.md CHANGED
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.1] - 2026-03-31
11
+
12
+ ### Added
13
+ - Instance methods `Customer#persons`, `Customer#contracts`, `Customer#charges` for idiomatic Ruby usage
14
+ - `customer = Conexa::Customer.find(127); customer.persons` — fetches persons for the loaded customer
15
+ - Class methods `Customer.persons(id)`, `Customer.contracts(id)`, `Customer.charges(id)` remain available
16
+ - Useful to save a request when you don't need the customer data itself
17
+
18
+ ### Changed
19
+ - Customer sub-resource methods now available in both class and instance forms
20
+
10
21
  ## [0.1.0] - 2026-03-31
11
22
 
12
23
  ### Added
@@ -122,7 +133,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
122
133
  - Charge with settle and PIX methods
123
134
  - Pagination support
124
135
 
125
- [Unreleased]: https://github.com/guilhermegazzinelli/conexa-ruby/compare/v0.1.0...HEAD
136
+ [Unreleased]: https://github.com/guilhermegazzinelli/conexa-ruby/compare/v0.1.1...HEAD
137
+ [0.1.1]: https://github.com/guilhermegazzinelli/conexa-ruby/compare/v0.1.0...v0.1.1
126
138
  [0.1.0]: https://github.com/guilhermegazzinelli/conexa-ruby/compare/v0.0.9...v0.1.0
127
139
  [0.0.9]: https://github.com/guilhermegazzinelli/conexa-ruby/compare/v0.0.8...v0.0.9
128
140
  [0.0.8]: https://github.com/guilhermegazzinelli/conexa-ruby/compare/v0.0.7...v0.0.8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- conexa (0.1.0)
4
+ conexa (0.1.1)
5
5
  jwt
6
6
  multi_json
7
7
  rest-client
data/README.md CHANGED
@@ -129,6 +129,17 @@ customers = Conexa::Customer.all(
129
129
  is_active: true,
130
130
  limit: 20
131
131
  )
132
+
133
+ # Sub-resources (instance methods)
134
+ customer = Conexa::Customer.find(127)
135
+ customer.persons # => persons for this customer
136
+ customer.contracts # => contracts for this customer
137
+ customer.charges # => charges for this customer
138
+
139
+ # Sub-resources (class methods — saves a request)
140
+ Conexa::Customer.persons(127)
141
+ Conexa::Customer.contracts(127)
142
+ Conexa::Customer.charges(127)
132
143
  ```
133
144
 
134
145
  ### Contract
data/README_pt-BR.md CHANGED
@@ -452,6 +452,21 @@ cliente.destroy
452
452
  clientes = Conexa::Customer.find({ name: 'João Silva' }, 1, 20)
453
453
  ```
454
454
 
455
+ ##### Sub-recursos do Cliente
456
+
457
+ ```ruby
458
+ # Via instância (quando já possui o customer carregado)
459
+ cliente = Conexa::Customer.find(127)
460
+ cliente.persons # => Lista de persons deste cliente
461
+ cliente.contracts # => Lista de contratos deste cliente
462
+ cliente.charges # => Lista de cobranças deste cliente
463
+
464
+ # Via classe (economiza um request, não precisa buscar o customer)
465
+ Conexa::Customer.persons(127)
466
+ Conexa::Customer.contracts(127)
467
+ Conexa::Customer.charges(127)
468
+ ```
469
+
455
470
  #### Faturas (Bills)
456
471
 
457
472
  ##### Criando uma Fatura
data/REFERENCE.md CHANGED
@@ -32,7 +32,7 @@ Conexa is a Brazilian SaaS platform for **recurring billing**, **subscription ma
32
32
 
33
33
  ```ruby
34
34
  # Gemfile
35
- gem 'conexa', '~> 0.1.0'
35
+ gem 'conexa', '~> 0.1.1'
36
36
 
37
37
  # Or install directly
38
38
  gem install conexa
@@ -211,7 +211,13 @@ customer.destroy
211
211
  # or
212
212
  Conexa::Customer.destroy(127)
213
213
 
214
- # Sub-resources
214
+ # Sub-resources (instance methods — requires fetching customer first)
215
+ customer = Conexa::Customer.find(127)
216
+ customer.persons # List persons for this customer
217
+ customer.contracts # List contracts for this customer
218
+ customer.charges # List charges for this customer
219
+
220
+ # Sub-resources (class methods — saves a request, no need to fetch customer)
215
221
  Conexa::Customer.persons(127) # List persons for customer
216
222
  Conexa::Customer.contracts(127) # List contracts for customer
217
223
  Conexa::Customer.charges(127) # List charges for customer
@@ -1265,6 +1271,10 @@ The API enforces a limit of 100 requests per minute (changing to **60 requests p
1265
1271
 
1266
1272
  ## Version History
1267
1273
 
1274
+ - **v0.1.1** - Add instance methods for Customer sub-resources (persons, contracts, charges)
1275
+ - **v0.1.0** - Default new pagination, Result#next_page, code review fixes, 502 specs
1276
+ - **v0.0.9** - New pagination model (limit/offset), new API v2 resources
1277
+ - **v0.0.8** - Fix Auth.login, integration tests, REFERENCE.md rewrite
1268
1278
  - **v0.0.7** - Add Auth resource, fix Auth.login, add test suite with VCR
1269
1279
  - **v0.0.6** - Fix nil guard in camelize_hash, fix Result#empty? delegation
1270
1280
  - **v0.0.5** - Initial public release
@@ -71,22 +71,40 @@ module Conexa
71
71
  Address.new(@attributes['address'])
72
72
  end
73
73
 
74
+ # List persons (requesters) for this customer
75
+ # @return [Result] List of persons
76
+ def persons
77
+ Conexa::Person.all(customer_id: id, limit: 100)
78
+ end
79
+
80
+ # List contracts for this customer
81
+ # @return [Result] List of contracts
82
+ def contracts
83
+ Conexa::Contract.all(customer_id: [id], limit: 100)
84
+ end
85
+
86
+ # List charges for this customer
87
+ # @return [Result] List of charges
88
+ def charges
89
+ Conexa::Charge.all(customer_id: [id], limit: 100)
90
+ end
91
+
74
92
  class << self
75
- # List persons (requesters) for a customer
93
+ # List persons (requesters) for a customer without fetching the customer first
76
94
  # @param customer_id [Integer] Customer ID
77
95
  # @return [Result] List of persons
78
96
  def persons(customer_id)
79
97
  Conexa::Person.all(customer_id: customer_id, limit: 100)
80
98
  end
81
99
 
82
- # List contracts for a customer
100
+ # List contracts for a customer without fetching the customer first
83
101
  # @param customer_id [Integer] Customer ID
84
102
  # @return [Result] List of contracts
85
103
  def contracts(customer_id)
86
104
  Conexa::Contract.all(customer_id: [customer_id], limit: 100)
87
105
  end
88
106
 
89
- # List charges for a customer
107
+ # List charges for a customer without fetching the customer first
90
108
  # @param customer_id [Integer] Customer ID
91
109
  # @return [Result] List of charges
92
110
  def charges(customer_id)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Conexa
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conexa
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
  - Guilherme Gazzinelli