Skip to content
This repository was archived by the owner on Jan 8, 2025. It is now read-only.

Commit e270a09

Browse files
authored
Fix #244 - link Croatia TIN with OIB for both entity and individual (#259)
1 parent 672e39a commit e270a09

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

idnumbers/nationalid/HRV.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
from types import SimpleNamespace
12
from .hrv.personal_id import PersonalID
23
from .util import alias_of
34

4-
55
NationalID = alias_of(PersonalID)
66
"""
77
alias of PersonalID
@@ -10,3 +10,15 @@
1010
"""
1111
alias of PersonalID
1212
"""
13+
PIN = alias_of(PersonalID)
14+
"""
15+
alias of PersonalID
16+
"""
17+
TIN = SimpleNamespace(**{
18+
'individual': PersonalID,
19+
'entity': PersonalID
20+
})
21+
"""
22+
According to the doc in https://www.porezna-uprava.hr/en/Pages/PIN.aspx, we know the TIN for individual and entity are
23+
the same.
24+
"""

idnumbers/nationalid/hrv/personal_id.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ class PersonalID:
1919
'alias_of': None,
2020
'names': ['Personal ID Number',
2121
'Osobni identifikacijski broj',
22-
'OIB'],
23-
'links': ['https://en.wikipedia.org/wiki/Personal_identification_number_(Croatia)'],
22+
'OIB',
23+
'PIN'],
24+
'links': ['https://en.wikipedia.org/wiki/Personal_identification_number_(Croatia)',
25+
'https://www.porezna-uprava.hr/en/Pages/PIN.aspx'],
2426
'deprecated': False
2527

2628
})

tests/nationalid/test_HRV.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from unittest import TestCase, main
1+
from unittest import TestCase
22
from idnumbers.nationalid import HRV
33

44

@@ -11,6 +11,6 @@ def test_error_case(self):
1111
self.assertFalse(HRV.PersonalID.validate('6943515153'))
1212
self.assertFalse(HRV.PersonalID.validate('69435151531'))
1313

14-
15-
if __name__ == '__main__':
16-
main()
14+
def test_tin_cases(self):
15+
self.assertTrue(HRV.TIN.individual.validate('94577403194'))
16+
self.assertTrue(HRV.TIN.entity.validate('23961056387'))

0 commit comments

Comments
 (0)