"""Deposit-flight playbook, step 2: approve the data contract."""

import sys
from pathlib import Path

sys.path.insert(0, str(Path(__file__).resolve().parents[1]))  # playbooks/playbook_api.py
from playbook_api import Api, State

api, state = Api(), State("deposit-flight")

draft = api.post("/contracts", key="deposit-flight-contract")
print(f"draft contract profiles: {', '.join(sorted(draft.get('event_types') or {}))}")
approved = api.post(f"/contracts/{draft['version']}:approve")
print(f"contract: {approved['status']}")
