diff --git a/resources/subdivision/NZ.json b/resources/subdivision/NZ.json new file mode 100644 index 00000000..8c8c7be7 --- /dev/null +++ b/resources/subdivision/NZ.json @@ -0,0 +1,73 @@ +{ + "country_code": "NZ", + "subdivisions": { + "AUK": { + "code": "AUK", + "name": "Auckland" + }, + "BOP": { + "code": "BOP", + "name": "Bay of Plenty" + }, + "CAN": { + "code": "CAN", + "name": "Canterbury" + }, + "CIT": { + "code": "CIT", + "name": "Chatham Islands Territory" + }, + "GIS": { + "code": "GIS", + "name": "Gisborne" + }, + "WGN": { + "code": "WGN", + "name": "Greater Wellington" + }, + "HKB": { + "code": "HKB", + "name": "Hawke's Bay" + }, + "MWT": { + "code": "MWT", + "name": "Manawatu-Wanganui" + }, + "MBH": { + "code": "MBH", + "name": "Marlborough" + }, + "NSN": { + "code": "NSN", + "name": "Nelson" + }, + "NTL": { + "code": "NTL", + "name": "Northland" + }, + "OTA": { + "code": "OTA", + "name": "Otago" + }, + "STL": { + "code": "STL", + "name": "Southland" + }, + "TKI": { + "code": "TKI", + "name": "Taranaki" + }, + "TAS": { + "code": "TAS", + "name": "Tasman" + }, + "WKO": { + "code": "WKO", + "name": "Waikato" + }, + "WTC": { + "code": "WTC", + "name": "West Coast" + } + } +} \ No newline at end of file diff --git a/src/AddressFormat/AddressFormatRepository.php b/src/AddressFormat/AddressFormatRepository.php index b7833aee..65ba9ebd 100644 --- a/src/AddressFormat/AddressFormatRepository.php +++ b/src/AddressFormat/AddressFormatRepository.php @@ -1075,11 +1075,12 @@ protected function getDefinitions(): array 'subdivision_depth' => 1, ], 'NZ' => [ - 'format' => "%givenName %familyName\n%organization\n%addressLine1\n%addressLine2\n%addressLine3\n%dependentLocality\n%locality %postalCode", + 'format' => "%givenName %familyName\n%organization\n%addressLine1\n%addressLine2\n%addressLine3\n%dependentLocality\n%locality, %administrativeArea %postalCode", 'required_fields' => [ - 'addressLine1', 'locality', 'postalCode', + 'addressLine1', 'locality', 'postalCode', 'administrativeArea' ], 'postal_code_pattern' => '\d{4}', + 'subdivision_depth' => 1 ], 'OM' => [ 'format' => "%givenName %familyName\n%organization\n%addressLine1\n%addressLine2\n%addressLine3\n%postalCode\n%locality",