Skip to content

refactor: Migrate getCountryIdFormat() to registry #53

@AngusHsu

Description

@AngusHsu

Description

Migrate the getCountryIdFormat() function from switch statement to registry lookup.

Parent Epic

#13 - Convert main dispatcher to registry pattern

Depends On

Current State

  • Incomplete switch statement
  • Many countries missing format info

Target State

```typescript
export function getCountryIdFormat(countryCode: string): IdFormat | null {
const validator = registry.get(countryCode);
if (!validator) {
return null;
}
return validator.getFormat();
}
```

Tasks

  • Add getFormat() to all validators
  • Register format functions
  • Replace switch with registry lookup
  • Complete missing format info
  • Remove old switch code

Acceptance Criteria

  • All existing tests pass
  • All countries have format info
  • No breaking API changes

Labels

refactor, migration, format

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions