package de.effigenix.shared.common;

public record Country(String code, String name) {

    public Country {
        if (code == null || !code.matches("^[A-Z]{2}$")) {
            throw new IllegalArgumentException("Country code must be exactly 2 uppercase letters, got: " + code);
        }
        if (name == null || name.isBlank()) {
            throw new IllegalArgumentException("Country name must not be blank");
        }
    }
}
