from __future__ import annotations

from dataclasses import dataclass


@dataclass(frozen=True)
class Variable:
    code: str
    label: str
    format: str  # number | dollar | decimal | percent


TOPICS: dict[str, list[Variable]] = {
    "population": [
        Variable("B01003_001E", "Total Population", "number"),
        Variable("B01001_002E", "Male", "number"),
        Variable("B01001_026E", "Female", "number"),
        # Male age breakouts
        Variable("B01001_003E", "Male Under 5", "number"),
        Variable("B01001_004E", "Male 5-9", "number"),
        Variable("B01001_005E", "Male 10-14", "number"),
        Variable("B01001_006E", "Male 15-17", "number"),
        Variable("B01001_007E", "Male 18-19", "number"),
        Variable("B01001_008E", "Male 20", "number"),
        Variable("B01001_009E", "Male 21", "number"),
        Variable("B01001_010E", "Male 22-24", "number"),
        Variable("B01001_011E", "Male 25-29", "number"),
        Variable("B01001_012E", "Male 30-34", "number"),
        Variable("B01001_013E", "Male 35-39", "number"),
        Variable("B01001_014E", "Male 40-44", "number"),
        Variable("B01001_015E", "Male 45-49", "number"),
        Variable("B01001_016E", "Male 50-54", "number"),
        Variable("B01001_017E", "Male 55-59", "number"),
        Variable("B01001_018E", "Male 60-61", "number"),
        Variable("B01001_019E", "Male 62-64", "number"),
        Variable("B01001_020E", "Male 65-66", "number"),
        Variable("B01001_021E", "Male 67-69", "number"),
        Variable("B01001_022E", "Male 70-74", "number"),
        Variable("B01001_023E", "Male 75-79", "number"),
        Variable("B01001_024E", "Male 80-84", "number"),
        Variable("B01001_025E", "Male 85+", "number"),
        # Female age breakouts
        Variable("B01001_027E", "Female Under 5", "number"),
        Variable("B01001_028E", "Female 5-9", "number"),
        Variable("B01001_029E", "Female 10-14", "number"),
        Variable("B01001_030E", "Female 15-17", "number"),
        Variable("B01001_031E", "Female 18-19", "number"),
        Variable("B01001_032E", "Female 20", "number"),
        Variable("B01001_033E", "Female 21", "number"),
        Variable("B01001_034E", "Female 22-24", "number"),
        Variable("B01001_035E", "Female 25-29", "number"),
        Variable("B01001_036E", "Female 30-34", "number"),
        Variable("B01001_037E", "Female 35-39", "number"),
        Variable("B01001_038E", "Female 40-44", "number"),
        Variable("B01001_039E", "Female 45-49", "number"),
        Variable("B01001_040E", "Female 50-54", "number"),
        Variable("B01001_041E", "Female 55-59", "number"),
        Variable("B01001_042E", "Female 60-61", "number"),
        Variable("B01001_043E", "Female 62-64", "number"),
        Variable("B01001_044E", "Female 65-66", "number"),
        Variable("B01001_045E", "Female 67-69", "number"),
        Variable("B01001_046E", "Female 70-74", "number"),
        Variable("B01001_047E", "Female 75-79", "number"),
        Variable("B01001_048E", "Female 80-84", "number"),
        Variable("B01001_049E", "Female 85+", "number"),
        # Other demographics
        Variable("B09001_001E", "Under 18", "number"),
        Variable("B05001_002E", "Born in US", "number"),
        Variable("B05001_005E", "Naturalized Citizen", "number"),
        Variable("B05001_006E", "Not a US Citizen", "number"),
        Variable("B11001_001E", "Total Households", "number"),
        Variable("B11001_002E", "Family Households", "number"),
        Variable("B11001_007E", "Nonfamily Households", "number"),
        Variable("B25002_002E", "Occupied Housing Units", "number"),
        Variable("B25002_003E", "Vacant Housing Units", "number"),
    ],
    "income": [
        Variable("B19013_001E", "Median Household Income", "dollar"),
        Variable("B19113_001E", "Median Family Income", "dollar"),
        Variable("B19301_001E", "Per Capita Income", "dollar"),
        Variable("B19083_001E", "Gini Index", "decimal"),
        Variable("B20017_001E", "Median Earnings", "dollar"),
        Variable("B20017_002E", "Median Earnings (Male)", "dollar"),
        Variable("B20017_005E", "Median Earnings (Female)", "dollar"),
        Variable("B19001_001E", "HH Income Total", "number"),
        Variable("B19001_002E", "HH Income < $10k", "number"),
        Variable("B19001_003E", "HH Income $10-15k", "number"),
        Variable("B19001_004E", "HH Income $15-20k", "number"),
        Variable("B19001_005E", "HH Income $20-25k", "number"),
        Variable("B19001_006E", "HH Income $25-30k", "number"),
        Variable("B19001_007E", "HH Income $30-35k", "number"),
        Variable("B19001_008E", "HH Income $35-40k", "number"),
        Variable("B19001_009E", "HH Income $40-45k", "number"),
        Variable("B19001_010E", "HH Income $45-50k", "number"),
        Variable("B19001_011E", "HH Income $50-60k", "number"),
        Variable("B19001_012E", "HH Income $60-75k", "number"),
        Variable("B19001_013E", "HH Income $75-100k", "number"),
        Variable("B19001_014E", "HH Income $100-125k", "number"),
        Variable("B19001_015E", "HH Income $125-150k", "number"),
        Variable("B19001_016E", "HH Income $150-200k", "number"),
        Variable("B19001_017E", "HH Income $200k+", "number"),
        Variable("B19055_002E", "With Social Security", "number"),
        Variable("B19056_002E", "With SSI", "number"),
        Variable("B19057_002E", "With Public Assistance", "number"),
        Variable("B19059_002E", "With Retirement Income", "number"),
    ],
    "age": [
        Variable("B01002_001E", "Median Age", "decimal"),
        Variable("B01002_002E", "Median Age (Male)", "decimal"),
        Variable("B01002_003E", "Median Age (Female)", "decimal"),
    ],
    "poverty": [
        Variable("B17001_001E", "Poverty Universe", "number"),
        Variable("B17001_002E", "Below Poverty Level", "number"),
    ],
    "education": [
        Variable("B15003_001E", "Pop 25+", "number"),
        Variable("B15003_002E", "No Schooling", "number"),
        Variable("B15003_003E", "Nursery School", "number"),
        Variable("B15003_004E", "Kindergarten", "number"),
        Variable("B15003_005E", "1st Grade", "number"),
        Variable("B15003_006E", "2nd Grade", "number"),
        Variable("B15003_007E", "3rd Grade", "number"),
        Variable("B15003_008E", "4th Grade", "number"),
        Variable("B15003_009E", "5th Grade", "number"),
        Variable("B15003_010E", "6th Grade", "number"),
        Variable("B15003_011E", "7th Grade", "number"),
        Variable("B15003_012E", "8th Grade", "number"),
        Variable("B15003_013E", "9th Grade", "number"),
        Variable("B15003_014E", "10th Grade", "number"),
        Variable("B15003_015E", "11th Grade", "number"),
        Variable("B15003_016E", "12th Grade No Diploma", "number"),
        Variable("B15003_017E", "HS Diploma", "number"),
        Variable("B15003_018E", "GED", "number"),
        Variable("B15003_019E", "Some College < 1 Year", "number"),
        Variable("B15003_020E", "Some College 1+ Years No Degree", "number"),
        Variable("B15003_021E", "Associate's Degree", "number"),
        Variable("B15003_022E", "Bachelor's Degree", "number"),
        Variable("B15003_023E", "Master's Degree", "number"),
        Variable("B15003_024E", "Professional School Degree", "number"),
        Variable("B15003_025E", "Doctorate Degree", "number"),
    ],
    "race": [
        Variable("B02001_001E", "Total", "number"),
        Variable("B02001_002E", "White", "number"),
        Variable("B02001_003E", "Black", "number"),
        Variable("B02001_004E", "AIAN", "number"),
        Variable("B02001_005E", "Asian", "number"),
    ],
    "health_insurance": [
        Variable("B27001_001E", "Total Pop (Insurance Universe)", "number"),
        Variable("B27001_004E", "With Health Insurance", "number"),
        Variable("B27001_007E", "Without Health Insurance", "number"),
    ],
    "disability": [
        Variable("B18101_001E", "Total Pop (Disability Universe)", "number"),
        Variable("B18101_004E", "Male With Disability", "number"),
        Variable("B18101_023E", "Female With Disability", "number"),
    ],
    "insurance_income": [
        Variable("B27015_002E", "Under $25k Total", "number"),
        Variable("B27015_003E", "Under $25k With Insurance", "number"),
        Variable("B27015_006E", "Under $25k Without Insurance", "number"),
        Variable("B27015_012E", "$50-75k Total", "number"),
        Variable("B27015_013E", "$50-75k With Insurance", "number"),
        Variable("B27015_016E", "$50-75k Without Insurance", "number"),
    ],
}
