import random


def generate_activation_code(size: int = 6) -> str:
    """Create a numeric code of predefined size with one character validator.

    :param size: generated string number size.

    Example:
        >>> from phanterpwa.tools import generate_activation_code
        >>> generate_activation_code()
        '425938-E'
        >>> generate_activation_code()
        '762093-A'
        >>> generate_activation_code(4)
        '3624-G'
    """

    if not (isinstance(size, int) and size > 0):
        raise ValueError("The size must be an integer and greater than 0")

    matrix = '0123456789'
    ver = "ABCDEFGHI"
    p = []
    su = 0
    while len(p) < size:
        number = random.randint(0, len(matrix) - 1)
        char = matrix[number]
        if char not in p:
            p.append(char)
            su += int(char)
            if su >= 9:
                su = su - 9
    f = "".join(p)
    return "-".join([f, ver[su]])