fintoc 1.1.0 → 1.2.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: 2ce93ceec460af064e29aa8b4108858087ab74c623ba328785f160165c8a8b2f
4
- data.tar.gz: a3f1f7dce733d2a9fbdbba43176467d95c03aa60407e2cfef2cce897fea6341c
3
+ metadata.gz: a1a0932a63c0c93038089b3054adbe8c105e82248627ce22105fa7e785548ecf
4
+ data.tar.gz: 03e8f9737a40f23f03dec7d293b0741e6b95477ef3330181f7d0d0396fa98b03
5
5
  SHA512:
6
- metadata.gz: 8e33500d7c444114ed0d8d8fbd7e50179b1789faefe70f4e87e9b38badf0a9458f97a3c8fb46bea6a73e50b10225aa263d86ae045ee7fe1db050e5742ecd4427
7
- data.tar.gz: 848d3e8b713c20c6ca4d01060aafbb8672f9607f17332e1ff55bb443df19bb14ae8ba2b25eb69394c9b06410ce978c1a78cad9a530cfd4904bacc4ffd6c23b26
6
+ metadata.gz: 67767ca7af9b52848bb8224134b352c1e83999cb3e4650ee248a0b241d31d476521c2422fbb821130463968d18b4e828bf55aedcf9269702483f478bd4665cc9
7
+ data.tar.gz: 934617f315dfb320eb14fe2974272e17b9b17b87bf942c1b6fa6fb23192bf56cf4bd113724e89390282b1966d53d3f7f7392a11c68644ccb372e36d13e00bb2c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.0 - 2026-04-08
4
+
5
+ ### 🚀 New Features
6
+
7
+ - **Account Statements**: Added `account_statements` resource under v2 accounts for retrieving account statements
8
+ - **Account Number Deletion**: Added `delete` method for account numbers in the v2 API
9
+ - **Movements**: Added `movements` resource under v2 accounts
10
+
3
11
  ## 1.1.0 - 2025-09-15
4
12
 
5
13
  ### 🚀 New Features
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fintoc (1.1.0)
4
+ fintoc (1.2.0)
5
5
  http
6
6
  money-rails
7
7
  tabulate
@@ -29,6 +29,10 @@ module Fintoc
29
29
  build_account_number(data)
30
30
  end
31
31
 
32
+ def delete(account_number_id)
33
+ _delete_account_number(account_number_id)
34
+ end
35
+
32
36
  private
33
37
 
34
38
  def _create_account_number(
@@ -55,6 +59,10 @@ module Fintoc
55
59
  .call("account_numbers/#{account_number_id}", **params)
56
60
  end
57
61
 
62
+ def _delete_account_number(account_number_id)
63
+ @client.delete(version: :v2).call("account_numbers/#{account_number_id}")
64
+ end
65
+
58
66
  def build_account_number(data)
59
67
  Fintoc::V2::AccountNumber.new(**data, client: @client)
60
68
  end
@@ -0,0 +1,28 @@
1
+ require 'fintoc/v2/resources/account_statement'
2
+
3
+ module Fintoc
4
+ module V2
5
+ module Managers
6
+ class AccountStatementsManager
7
+ def initialize(client, account_id)
8
+ @client = client
9
+ @account_id = account_id
10
+ end
11
+
12
+ def list(**params)
13
+ _list_account_statements(**params).map { |data| build_account_statement(data) }
14
+ end
15
+
16
+ private
17
+
18
+ def _list_account_statements(**params)
19
+ @client.get(version: :v2).call("accounts/#{@account_id}/account_statements", **params)
20
+ end
21
+
22
+ def build_account_statement(data)
23
+ Fintoc::V2::AccountStatement.new(**data)
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,38 @@
1
+ require 'fintoc/v2/resources/movement'
2
+
3
+ module Fintoc
4
+ module V2
5
+ module Managers
6
+ class MovementsManager
7
+ def initialize(client, account_id)
8
+ @client = client
9
+ @account_id = account_id
10
+ end
11
+
12
+ def list(**params)
13
+ _list_movements(**params).map { |data| build_movement(data) }
14
+ end
15
+
16
+ def get(movement_id, **params)
17
+ data = _get_movement(movement_id, **params)
18
+ build_movement(data)
19
+ end
20
+
21
+ private
22
+
23
+ def _list_movements(**params)
24
+ @client.get(version: :v2).call("accounts/#{@account_id}/movements", **params)
25
+ end
26
+
27
+ def _get_movement(movement_id, **params)
28
+ path = "accounts/#{@account_id}/movements/#{movement_id}"
29
+ @client.get(version: :v2).call(path, **params)
30
+ end
31
+
32
+ def build_movement(data)
33
+ Fintoc::V2::Movement.new(**data)
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -1,4 +1,6 @@
1
1
  require 'money'
2
+ require 'fintoc/v2/managers/account_statements_manager'
3
+ require 'fintoc/v2/managers/movements_manager'
2
4
 
3
5
  module Fintoc
4
6
  module V2
@@ -81,6 +83,14 @@ module Fintoc
81
83
  )
82
84
  end
83
85
 
86
+ def account_statements
87
+ @account_statements ||= Managers::AccountStatementsManager.new(@client, @id)
88
+ end
89
+
90
+ def movements
91
+ @movements ||= Managers::MovementsManager.new(@client, @id)
92
+ end
93
+
84
94
  private
85
95
 
86
96
  def refresh_from_account(account)
@@ -2,7 +2,8 @@ module Fintoc
2
2
  module V2
3
3
  class AccountNumber
4
4
  attr_reader :id, :object, :description, :number, :created_at, :updated_at,
5
- :mode, :status, :is_root, :account_id, :metadata
5
+ :mode, :status, :is_root, :account_id, :metadata,
6
+ :last_transfer_at, :deleted_at
6
7
 
7
8
  def initialize(
8
9
  id:,
@@ -16,6 +17,8 @@ module Fintoc
16
17
  is_root:,
17
18
  account_id:,
18
19
  metadata:,
20
+ last_transfer_at: nil,
21
+ deleted_at: nil,
19
22
  client: nil,
20
23
  **
21
24
  )
@@ -30,6 +33,8 @@ module Fintoc
30
33
  @is_root = is_root
31
34
  @account_id = account_id
32
35
  @metadata = metadata
36
+ @last_transfer_at = last_transfer_at
37
+ @deleted_at = deleted_at
33
38
  @client = client
34
39
  end
35
40
 
@@ -84,9 +89,8 @@ module Fintoc
84
89
  private
85
90
 
86
91
  def refresh_from_account_number(account_number)
87
- unless account_number.id == @id
88
- raise ArgumentError, 'AccountNumber must be the same instance'
89
- end
92
+ raise ArgumentError, 'AccountNumber must be the same instance' unless
93
+ account_number.id == @id
90
94
 
91
95
  @object = account_number.object
92
96
  @description = account_number.description
@@ -98,6 +102,8 @@ module Fintoc
98
102
  @is_root = account_number.is_root
99
103
  @account_id = account_number.account_id
100
104
  @metadata = account_number.metadata
105
+ @last_transfer_at = account_number.last_transfer_at
106
+ @deleted_at = account_number.deleted_at
101
107
 
102
108
  self
103
109
  end
@@ -0,0 +1,48 @@
1
+ module Fintoc
2
+ module V2
3
+ class AccountStatement
4
+ attr_reader :id, :object, :start_date, :end_date, :total_debited_cents,
5
+ :total_credited_cents, :initial_balance_cents, :final_balance_cents,
6
+ :download_url, :created_at
7
+
8
+ def initialize(
9
+ id:,
10
+ object:,
11
+ start_date:,
12
+ end_date:,
13
+ total_debited_cents:,
14
+ total_credited_cents:,
15
+ initial_balance_cents:,
16
+ final_balance_cents:,
17
+ download_url:,
18
+ created_at:,
19
+ **
20
+ )
21
+ @id = id
22
+ @object = object
23
+ @start_date = start_date
24
+ @end_date = end_date
25
+ @total_debited_cents = total_debited_cents
26
+ @total_credited_cents = total_credited_cents
27
+ @initial_balance_cents = initial_balance_cents
28
+ @final_balance_cents = final_balance_cents
29
+ @download_url = download_url
30
+ @created_at = created_at
31
+ end
32
+
33
+ def ==(other)
34
+ @id == other.id
35
+ end
36
+
37
+ alias eql? ==
38
+
39
+ def hash
40
+ @id.hash
41
+ end
42
+
43
+ def to_s
44
+ "AccountStatement(#{@id}) #{@start_date} - #{@end_date}"
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,52 @@
1
+ module Fintoc
2
+ module V2
3
+ class Movement
4
+ attr_reader :id, :object, :type, :direction, :resource_id, :mode,
5
+ :amount, :currency, :transaction_date, :return_pair_id,
6
+ :balance, :account_id
7
+
8
+ def initialize(
9
+ id:,
10
+ object:,
11
+ type:,
12
+ direction:,
13
+ mode:,
14
+ amount:,
15
+ currency:,
16
+ transaction_date:,
17
+ balance:,
18
+ account_id:,
19
+ resource_id: nil,
20
+ return_pair_id: nil,
21
+ **
22
+ )
23
+ @id = id
24
+ @object = object
25
+ @type = type
26
+ @direction = direction
27
+ @resource_id = resource_id
28
+ @mode = mode
29
+ @amount = amount
30
+ @currency = currency
31
+ @transaction_date = transaction_date
32
+ @return_pair_id = return_pair_id
33
+ @balance = balance
34
+ @account_id = account_id
35
+ end
36
+
37
+ def ==(other)
38
+ @id == other.id
39
+ end
40
+
41
+ alias eql? ==
42
+
43
+ def hash
44
+ @id.hash
45
+ end
46
+
47
+ def to_s
48
+ "#{@direction} #{@amount} #{@currency} (#{@type})"
49
+ end
50
+ end
51
+ end
52
+ end
@@ -1,3 +1,3 @@
1
1
  module Fintoc
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fintoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Ca Sardin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-10-16 00:00:00.000000000 Z
11
+ date: 2026-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -92,15 +92,19 @@ files:
92
92
  - lib/fintoc/v1/resources/transfer_account.rb
93
93
  - lib/fintoc/v2/client/client.rb
94
94
  - lib/fintoc/v2/managers/account_numbers_manager.rb
95
+ - lib/fintoc/v2/managers/account_statements_manager.rb
95
96
  - lib/fintoc/v2/managers/account_verifications_manager.rb
96
97
  - lib/fintoc/v2/managers/accounts_manager.rb
97
98
  - lib/fintoc/v2/managers/entities_manager.rb
99
+ - lib/fintoc/v2/managers/movements_manager.rb
98
100
  - lib/fintoc/v2/managers/simulate_manager.rb
99
101
  - lib/fintoc/v2/managers/transfers_manager.rb
100
102
  - lib/fintoc/v2/resources/account.rb
101
103
  - lib/fintoc/v2/resources/account_number.rb
104
+ - lib/fintoc/v2/resources/account_statement.rb
102
105
  - lib/fintoc/v2/resources/account_verification.rb
103
106
  - lib/fintoc/v2/resources/entity.rb
107
+ - lib/fintoc/v2/resources/movement.rb
104
108
  - lib/fintoc/v2/resources/transfer.rb
105
109
  - lib/fintoc/version.rb
106
110
  - lib/fintoc/webhook_signature.rb