"""Dagster Definitions for the B0 lifecycle graph — the 4 combined-book assets + a daily schedule that
materializes the track (replaces the fxhnt-forward cron, same 23:30 UTC slot).

NOTE: no `from __future__ import annotations` — Dagster 1.12 runtime type-hint inspection."""
from dagster import DefaultScheduleStatus, Definitions, ScheduleDefinition, define_asset_job

from fxhnt.adapters.orchestration.assets import (
    cockpit_forward,
    combined_forward_nav,
    crossvenue_nav,
    crypto_bars,
    funding_nav,
    futures_bars,
    gd_nav,
    multistrat_nav,
    poc_nav,
    sixtyforty_nav,
)

combined_book_job = define_asset_job(
    name="combined_book_forward_job",
    selection=[
        crypto_bars, futures_bars, combined_forward_nav,
        sixtyforty_nav, multistrat_nav, gd_nav, funding_nav, crossvenue_nav, poc_nav,
        cockpit_forward,
    ],
)

daily_combined_book_schedule = ScheduleDefinition(
    name="combined_book_daily",
    job=combined_book_job,
    cron_schedule="30 23 * * *",
    execution_timezone="UTC",
    default_status=DefaultScheduleStatus.RUNNING,   # auto-arm on a fresh deploy (else the nightly track silently stalls)
)

defs = Definitions(
    assets=[
        crypto_bars, futures_bars, combined_forward_nav,
        sixtyforty_nav, multistrat_nav, gd_nav, funding_nav, crossvenue_nav, poc_nav,
        cockpit_forward,
    ],
    jobs=[combined_book_job],
    schedules=[daily_combined_book_schedule],
)
