Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Region#tax_type accessor, cut v1.14.0 #300

Merged
merged 2 commits into from
Nov 7, 2024
Merged

Conversation

DominiqueFlaaa
Copy link
Contributor

@DominiqueFlaaa DominiqueFlaaa commented Nov 6, 2024

What are you trying to accomplish?

Region ymls contain data on the zone tax_types

tax_name: HST
tax_type: harmonized

This PR makes the tax type available via the Region object.

Also cuts version 1.14.0.

What approach did you choose and why?

Added region territory accessor for tax_type. Unlike tax_name and tax_rate, the tax_type is only defined on the territory or zone level.

What should reviewers focus on?

...

The impact of these changes

 ❯ bin/console
irb(main):001> ca = Worldwide.region(code: "CA")
=> #<Worldwide::Region:26800 @alpha_three="CAN", @building_number_required=true, @currency=#<Worldwide::Currency:0x00000001391edf40 @currency_code="CAD", @numeric_code=124>, @example_city=nil, @example_city_zip=nil, @example_address={"address1"=>"1 ...
irb(main):002> ca.zone(code: "ON").tax_type
=> "harmonized"
irb(main):003> Worldwide.region(code: "US").zone(code: "CA").tax_type
=> nil

on a country-level region, returns nil

irb(main):001> ca = Worldwide.region(code:'CA')
=> #<Worldwide::Region:28280 @alpha_three="CAN", @building_number_required=true, @currency=#<Worldwide::Currency:0x000000011ea12538 @currency_code="CAD", @numeric_code=124>, @example_city=nil, @example_city_zip=nil, @example_address={"address1"=>"1 Sussex Drive", ...
irb(main):002> ca.tax_type
=> nil

Checklist

  • I have added a CHANGELOG entry for this change (or determined that it isn't needed)

@DominiqueFlaaa DominiqueFlaaa changed the base branch from main to df.add_example_city_zip November 6, 2024 21:33
Base automatically changed from df.add_example_city_zip to main November 6, 2024 21:40
@DominiqueFlaaa DominiqueFlaaa changed the title Add Region#tax_type accessor Add Region#tax_type accessor, cut v1.14.0 Nov 7, 2024
@DominiqueFlaaa
Copy link
Contributor Author

Updated to cut a new minor version.

@DominiqueFlaaa DominiqueFlaaa merged commit 1b0bbe3 into main Nov 7, 2024
10 checks passed
@DominiqueFlaaa DominiqueFlaaa deleted the df.add_tax_type branch November 7, 2024 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants