from typing import List
import random
import string


def get_addresses(n=50) -> List[dict]:
    """
    Generate random addresses
    """

    def _get_address() -> dict:
        return {
            "name": "John Doe",
            "companyName": "Test Co",
            "streetAddress": "{} Test St".format(random.randint(10, 100)),
            "postCode": str((random.randrange(10**4, 10**5))),
            "city": "Test City",
            "state": "Test State",
            "country": "".join(random.choices(string.ascii_uppercase, k=2)),
            "phoneNumber": "+{}".format(random.randrange(10**9, 10**10))
        }

    return [_get_address() for _ in range(n)]