import os  # for testing purposes
from dataclasses import dataclass

import risc_lasagna
import risc_lasagna.layer as layer


@dataclass
class ApplicationConfig:
    app_host: str
    app_port: int


def load_application_config() -> ApplicationConfig:
    # add environment for testing, this should be set by your deployment tool
    os.environ["APP_HOST"] = "localhost"
    os.environ["APP_PORT"] = "12345"
    return risc_lasagna.build(ApplicationConfig, layer.EnvironmentLayer())


if __name__ == "__main__":
    config = load_application_config()
    print(config)
