"""Optovia Data - Dagster orchestration for data freshness."""

from dagster import Definitions, load_assets_from_modules

from optovia_data import assets
from optovia_data.resources import (
    egrul_agent_resource,
    postgres_resource,
    mongo_resource,
    kyc_postgres_resource,
)
from optovia_data.jobs import refresh_egrul_job
from optovia_data.schedules import weekly_egrul_schedule

all_assets = load_assets_from_modules([assets])

defs = Definitions(
    assets=all_assets,
    resources={
        "egrul_agent": egrul_agent_resource,
        "postgres": postgres_resource,
        "mongo": mongo_resource,
        "kyc_postgres": kyc_postgres_resource,
    },
    jobs=[refresh_egrul_job],
    schedules=[weekly_egrul_schedule],
)
