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

fix italy VAT and add italy condominium fiscal code generator #2491

Merged
merged 3 commits into from
Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lib/faker/default/finance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,20 @@ def ticker(*markets)
def stock_market
fetch('finance.stock_market')
end

##
# Returns a random condominium fiscal code.
#
# @param country [String] Two capital letter country code to use for the vat number.
# @return [String]
#
# @example
# Faker::Finance.condominium_fiscal_code #=> "012345678"
#
# @faker.version next
def condominium_fiscal_code(country: 'IT')
FiloSpaTeam marked this conversation as resolved.
Show resolved Hide resolved
numerify(fetch("finance.condominium_fiscal_code.#{country}"))
end
end
end
end
4 changes: 3 additions & 1 deletion lib/locales/en/finance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ en:
- /6706#########{5,6}L/
- /6771#########{5,6}L/
- /6709#########{5,6}L/
condominium_fiscal_code:
IT: "#########"
vat_number:
AT: "ATU########"
AR: "AR###########"
Expand Down Expand Up @@ -79,7 +81,7 @@ en:
HR: "HR### ### ### ##"
"NO": "NO#########"
HU: "HU########"
IT: "IT##########"
IT: "IT###########"
LT:
- "LT#########"
- "LT############"
Expand Down