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:
    os.environ["APP_HOST"] = "remote_host"
    return risc_lasagna.build(
        ApplicationConfig,
        [
            layer.EnvironmentLayer(),
            layer.DataClassDefaultLayer(ApplicationConfig("localhost", 12345)),
        ],
    )


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