myfinance 1.3.1 → 1.4.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
  SHA1:
3
- metadata.gz: 63cd8fdeb1a3544c1b83b7ef0e6fcbfb327ad653
4
- data.tar.gz: 16823351a31b55b729ebe198e7fcfa964fd4d2f0
3
+ metadata.gz: d4e81004a6f6c7920181666ec4fd9bc3781dcdd9
4
+ data.tar.gz: 17a3994ee0f04f150d8cc87fd662c0bf6478d98f
5
5
  SHA512:
6
- metadata.gz: b01cd38702ddb2ce63730244b1381641b8cbcaf5b6e5694baf5912f19056c21db3a221a25edee48e05dac2395533ea081563d00033672d481de4cb6fd2d1b921
7
- data.tar.gz: a963cccfe0eb8c582accca87e810b049d4644f67ed24e8728df4c18a619364031112f8dee9744e22da458af3511303a12884d6aa430d28682c3bb2f82c2c3035
6
+ metadata.gz: 7c24b62f71ca61e76f3392eb32993df9858e1555afa9e01df758a6f547906719f309267d6ae34a845275d28060d16356a426eef0bfc5bebc08d6bd958fbfee85
7
+ data.tar.gz: a7ec2973ce7b53ae2a24e0a30a97172f3255006e84859cd56fb42af33f1eaa16481be032cde55053c1ce62a12eccd28b96252da4c25081b3483c8cc7cfca1b84
data/.rubocop.yml CHANGED
@@ -43,3 +43,12 @@ Style/SpaceAroundEqualsInParameterDefault:
43
43
  Style/StringLiterals:
44
44
  StyleGuide: "https://github.com/bbatsov/ruby-style-guide#consistent-string-literals"
45
45
  EnforcedStyle: double_quotes
46
+ Style/PercentLiteralDelimiters:
47
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#percent-literal-braces"
48
+ PreferredDelimiters:
49
+ default: ()
50
+ '%i': '[]'
51
+ '%I': '[]'
52
+ '%r': '{}'
53
+ '%w': '[]'
54
+ '%W': '[]'
data/CHANGELOG.md CHANGED
@@ -1,4 +1,19 @@
1
1
  # Changelog
2
+ ## v1.4.0
3
+ ### New attributes
4
+ - `Sale` now has the following new attributes:
5
+ - `attachments_count`, reflecting the fact that `Sale` can now have attachments
6
+ - `ticket_amount`, amount needed to pay due to some kind of penalty
7
+ - `interest_amount`, interest amount
8
+ - `discount_amount`, amount that will be reduced because of a discount
9
+ - `total_amount`, equals nominal_amount + ticket_amount + interest_amount - discount_amount
10
+ - `api_related`, `true` if `Sale` was created by the API, `false` otherwise
11
+ - `tax_charges_attributes`, reflecting the fact that `Sale` can now have taxes
12
+ ### Attributes renamed
13
+ - `Sale`:
14
+ - `liquidation_week_day` changed to `liquidation_weekday`, conforming to Rails' convention
15
+ - `FinancialAccount`:
16
+ - `financial_account_taxes_attributes` was changed to `tax_charges_attributes`
2
17
  ## v1.3.1
3
18
  ### Fixes
4
19
  - Fix lib require to be relatively
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- myfinance (1.3.1)
4
+ myfinance (1.4.0)
5
5
  mime-types (~> 2.99)
6
6
  multi_json (~> 1.11)
7
7
  require_all (~> 1.4.0)
@@ -22,7 +22,7 @@ module Myfinance
22
22
  end
23
23
  [:created_at, :updated_at].each { |k| attribute k, DateTime }
24
24
 
25
- attribute :financial_account_taxes_attributes, Array[Hash]
25
+ attribute :tax_charges_attributes, Array[Hash]
26
26
  attribute :reconciliations, Hash[String => Array]
27
27
  attribute :links, Array[Hash[String => String]]
28
28
  end
@@ -1,32 +1,40 @@
1
1
  module Myfinance
2
2
  module Entities
3
3
  class Sale < Base
4
- attribute :id
5
- attribute :nominal_amount
6
- attribute :receivable_amount
7
- attribute :fixed_fee_amount
8
- attribute :fee_percentage
9
- attribute :fee_percentage_amount
10
- attribute :issuer
11
- attribute :payment_method
12
- attribute :status
13
- attribute :summary
14
- attribute :description
15
- attribute :observation
4
+ attribute :api_related
5
+ attribute :attachments_count
16
6
  attribute :category_id
17
7
  attribute :classification_center_id
18
- attribute :person_id
8
+ attribute :confirmed_at
9
+ attribute :created_at
10
+ attribute :custom_classifications
11
+ attribute :custom_classifications
19
12
  attribute :days_to_liquidation
20
- attribute :sale_account_id
21
- attribute :financial_account_id
22
- attribute :liquidation_week_day
13
+ attribute :description
14
+ attribute :discount_amount
23
15
  attribute :estimated_liquidated_at
16
+ attribute :fee_percentage
17
+ attribute :fee_percentage_amount
18
+ attribute :financial_account_id
19
+ attribute :fixed_fee_amount
20
+ attribute :id
21
+ attribute :interest_amount
22
+ attribute :issuer
24
23
  attribute :liquidated_at
24
+ attribute :liquidation_weekday
25
+ attribute :nominal_amount
26
+ attribute :observation
25
27
  attribute :occurred_at
26
- attribute :confirmed_at
27
- attribute :created_at
28
+ attribute :payment_method
29
+ attribute :person_id
30
+ attribute :receivable_amount
31
+ attribute :sale_account_id
32
+ attribute :status
33
+ attribute :summary
34
+ attribute :tax_charges_attributes
35
+ attribute :ticket_amount
36
+ attribute :total_amount
28
37
  attribute :updated_at
29
- attribute :custom_classifications
30
38
  end
31
39
  end
32
40
  end
@@ -1,3 +1,3 @@
1
1
  module Myfinance
2
- VERSION = "1.3.1".freeze
2
+ VERSION = "1.4.0".freeze
3
3
  end
@@ -8,6 +8,6 @@ describe Myfinance::Entities::PayableAccount do
8
8
  :discount_amount, :total_amount, :description, :document, :document_emission_date, :observation, :remind,
9
9
  :reminded_at, :income_tax_relevant, :category_id, :classification_center_id, :expected_deposit_account_id,
10
10
  :recurrence_id, :person_id, :recurrent, :parcelled, :recurrence_period, :number_of_parcels, :current_parcel,
11
- :competency_month, :financial_account_taxes_attributes, :reconciliations, :links, :created_at, :updated_at
11
+ :competency_month, :tax_charges_attributes, :reconciliations, :links, :created_at, :updated_at
12
12
  ]
13
13
  end
@@ -8,6 +8,6 @@ describe Myfinance::Entities::ReceivableAccount do
8
8
  :discount_amount, :total_amount, :description, :document, :document_emission_date, :observation, :remind,
9
9
  :reminded_at, :income_tax_relevant, :category_id, :classification_center_id, :expected_deposit_account_id,
10
10
  :recurrence_id, :person_id, :recurrent, :parcelled, :recurrence_period, :number_of_parcels, :current_parcel,
11
- :competency_month, :financial_account_taxes_attributes, :reconciliations, :links, :created_at, :updated_at
11
+ :competency_month, :tax_charges_attributes, :reconciliations, :links, :created_at, :updated_at
12
12
  ]
13
13
  end
@@ -2,31 +2,38 @@ require "spec_helper"
2
2
 
3
3
  describe Myfinance::Entities::Sale do
4
4
  it_behaves_like "entity_attributes", %i[
5
- id
6
- nominal_amount
7
- receivable_amount
8
- fixed_fee_amount
9
- fee_percentage
10
- fee_percentage_amount
11
- issuer
12
- payment_method
13
- status
14
- summary
15
- description
16
- observation
5
+ api_related
6
+ attachments_count
17
7
  category_id
18
8
  classification_center_id
19
- person_id
9
+ confirmed_at
10
+ created_at
11
+ custom_classifications
20
12
  days_to_liquidation
21
- sale_account_id
22
- financial_account_id
23
- liquidation_week_day
13
+ description
14
+ discount_amount
24
15
  estimated_liquidated_at
16
+ fee_percentage
17
+ fee_percentage_amount
18
+ financial_account_id
19
+ fixed_fee_amount
20
+ id
21
+ interest_amount
22
+ issuer
25
23
  liquidated_at
24
+ liquidation_weekday
25
+ nominal_amount
26
+ observation
26
27
  occurred_at
27
- confirmed_at
28
- created_at
28
+ payment_method
29
+ person_id
30
+ receivable_amount
31
+ sale_account_id
32
+ status
33
+ summary
34
+ tax_charges_attributes
35
+ ticket_amount
36
+ total_amount
29
37
  updated_at
30
- custom_classifications
31
38
  ]
32
39
  end
@@ -116,7 +116,7 @@ describe Myfinance::Resources::PayableAccount do
116
116
  expect(subject.number_of_parcels).to be_nil
117
117
  expect(subject.current_parcel).to be_nil
118
118
  expect(subject.competency_month).to eq("2015-08")
119
- expect(subject.financial_account_taxes_attributes).to be_empty
119
+ expect(subject.tax_charges_attributes).to be_empty
120
120
  end
121
121
 
122
122
  context "when the payable_account has occurred_at value defined" do
@@ -117,7 +117,7 @@ describe Myfinance::Resources::ReceivableAccount do
117
117
  expect(subject.number_of_parcels).to be_nil
118
118
  expect(subject.current_parcel).to be_nil
119
119
  expect(subject.competency_month).to eq("2015-08")
120
- expect(subject.financial_account_taxes_attributes).to be_empty
120
+ expect(subject.tax_charges_attributes).to be_empty
121
121
  end
122
122
 
123
123
  context "when the receivable_account has occurred_at value defined" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: myfinance
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo Hertz
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-06-19 00:00:00.000000000 Z
14
+ date: 2017-07-08 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: typhoeus
@@ -413,7 +413,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
413
413
  version: '0'
414
414
  requirements: []
415
415
  rubyforge_project:
416
- rubygems_version: 2.6.11
416
+ rubygems_version: 2.6.8
417
417
  signing_key:
418
418
  specification_version: 4
419
419
  summary: A Ruby client for the Myfinance REST API