import json

from src.data.model.schemas import BaseSchemaModel

path = "config.json"


class ShopsConfiguration(BaseSchemaModel):
    mobi_season: int
    allow_price_list: list[int]


def load_shops_config():
    return ShopsConfiguration(mobi_season=41, allow_price_list=[])
    # todo: load configuraton from file
    with open("config.json", "r") as file:
        config = ShopsConfiguration(**json.load(file))
    return config


def update_shops_config(config: ShopsConfiguration):
    with open(path, "w") as file:
        json.dump(config.dict(), file, indent=4)
