Skip to content

feat(postcodes/SM): add San Marino postcodes (#1039)#1405

Merged
dr5hn merged 1 commit into
masterfrom
feat/postcodes-san-marino
Apr 25, 2026
Merged

feat(postcodes/SM): add San Marino postcodes (#1039)#1405
dr5hn merged 1 commit into
masterfrom
feat/postcodes-san-marino

Conversation

@dr5hn
Copy link
Copy Markdown
Owner

@dr5hn dr5hn commented Apr 25, 2026

Summary

Adds the 9 San Marino postal codes (47890–47898) covering all 9 castelli (municipalities). San Marino uses the Italian CAP system; the country code range 4789x is reserved for it and each castello has a unique code (a clean 1:1 mapping, unlike Italy proper where one code spans many cities).

Mapping

state_code Castello Postcode
01 Acquaviva 47892
02 Chiesanuova 47894
03 Domagnano 47895
04 Faetano 47896
05 Fiorentino 47897
06 Borgo Maggiore 47893
07 San Marino (capital) 47890
08 Montegiardino 47898
09 Serravalle 47891

Source

source: "manual" — composed from common knowledge. SM postal codes are stable and universally documented; the country's postal_code_format (4789#) and regex (^(4789\d)$) already exist in countries.json and were used to validate every code.

Validation

  • ✅ 9 records pass schema rules in .github/scripts/utils.js
  • ✅ All country_id: 192 / country_code: "SM" agree
  • ✅ All state_id values resolve to SM castelli, and state_code matches the corresponding state.iso2
  • ✅ All codes match countries.postal_code_regex for SM (^(4789\d)$)
  • ✅ No auto-managed fields present

Refs: #1039

🤖 Generated with Claude Code

Adds the 9 San Marino postal codes (47890-47898) covering all 9
castelli (municipalities). San Marino uses the Italian CAP system;
codes are stable and universally documented.

Mapping (state_code -> code -> castello):
  01 Acquaviva       -> 47892
  02 Chiesanuova     -> 47894
  03 Domagnano       -> 47895
  04 Faetano         -> 47896
  05 Fiorentino      -> 47897
  06 Borgo Maggiore  -> 47893
  07 San Marino      -> 47890 (capital)
  08 Montegiardino   -> 47898
  09 Serravalle      -> 47891

source: "manual" — composed from common knowledge. SM uses the
Italian CAP system with codes assigned per castello (1:1 mapping,
unlike Italy itself).

Validated:
- 9 records pass schema rules
- All country_id/state_id FKs resolve to SM and its castelli
- All state_code values match state.iso2
- All codes match countries.postal_code_regex (^(4789\\d)$)

Refs: #1039

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 25, 2026 15:12
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Apr 25, 2026
@dosubot dosubot Bot added the enhancement New feature or request label Apr 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

CSC Validation Report

PR Format

  • ✅ Description provided
  • ✅ Data source linked
  • ✅ Issue linked (recommended for data changes)
  • ✅ Justification / context provided

Labels applied: data:postcodes

Schema Validation (9 records)

✅ All records passed validation

Cross-Reference Validation

✅ 18 reference(s) verified

Source URL Verification

✅ 1 source URL(s) accessible


All checks passed | Status: Ready for review

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds San Marino (SM) postal codes to the new postcodes contributions dataset, enabling state-level postcode lookup for all 9 castelli.

Changes:

  • Introduces contributions/postcodes/SM.json with 9 CAP codes (47890–47898).
  • Includes state_id/state_code mappings to San Marino’s municipalities plus locality_name, type, and source.

@dr5hn dr5hn merged commit 09440a5 into master Apr 25, 2026
5 checks passed
@dr5hn dr5hn deleted the feat/postcodes-san-marino branch April 25, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data:postcodes enhancement New feature or request ready-for-review size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants