Skip to content

feat: optional issuingdate for foreign birthplace encoding - #273

Draft
stefano-rossotti wants to merge 1 commit into
fabiocaccamo:mainfrom
stefano-rossotti:feature/encode-issuingdate
Draft

stefano-rossotti wants to merge 1 commit into
fabiocaccamo:mainfrom
stefano-rossotti:feature/encode-issuingdate

Conversation

@stefano-rossotti

Copy link
Copy Markdown

Summary

  • Adds optional issuingdate to encode() and encode_birthplace().
  • For foreign birthplaces (province EE), the birthplace code is resolved using issuingdate when provided; otherwise behavior is unchanged and uses birthdate.
  • Italian municipalities always use birthdate for birthplace lookup.
  • CLI encode subcommand accepts --issuingdate.
  • Validates that issuingdate parses and is not before birthdate.

Motivation

Italian fiscal codes for people born abroad use the ISTAT country code assigned at first document issuance, not the code valid on the date of birth. Country codes change over time (e.g. Georgia: Z136 until 1994, then Z254).

Test plan

  • pytest (65 tests)
  • Georgia: Z136 at birth vs Z254 with issuingdate=01/01/2000
  • Torino unchanged when issuingdate is set
  • CLI --issuingdate integration test

For foreign countries (province EE), fiscal codes use the country code valid
at first document issuance rather than at birth. Optional issuingdate on
encode and encode_birthplace selects that code; Italian municipalities are
unchanged. CLI adds --issuingdate for the encode subcommand.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants