Skip to content

refactor: Migrate parseIdInfo() to registry #52

@AngusHsu

Description

@AngusHsu

Description

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

Parent Epic

#13 - Convert main dispatcher to registry pattern

Depends On

Current State

  • Large switch statement
  • Many empty case statements (to be removed first)

Target State

```typescript
export function parseIdInfo(countryCode: string, id: string): ParsedInfo | null {
const validator = registry.get(countryCode);
if (!validator) {
return null;
}
return validator.parse(id);
}
```

Tasks

  • Add parse() to all validators
  • Register parse functions
  • Replace switch with registry lookup
  • Ensure all tests still pass
  • Remove old switch code

Acceptance Criteria

  • All existing tests pass
  • No breaking API changes
  • Empty cases removed

Labels

refactor, migration, parse

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