{
    "ok": true,
    "mode": "read_only_analytics_bridge",
    "version": "0.2",
    "generated_at": "2026-07-22T22:31:16+02:00",
    "filters": {
        "unit": "",
        "year": "2026",
        "ym": "",
        "log_month": "2026-07"
    },
    "reservations": {
        "records_total": 10,
        "confirmed": 8,
        "cancelled": 2,
        "soft_hold": 0,
        "local_blocks": 0,
        "nights_confirmed": 34,
        "nights_cancelled": 8,
        "nights_soft_hold": 0,
        "revenue_confirmed": 0,
        "revenue_cancelled": 0,
        "missing_calc": 8,
        "missing_payment_block": 0,
        "by_unit": {
            "T1": {
                "confirmed": 8,
                "cancelled": 2,
                "soft_hold": 0,
                "local_blocks": 0,
                "nights_confirmed": 34,
                "revenue_confirmed": 0
            }
        },
        "by_source": {
            "public": 4,
            "external": 3,
            "test": 3
        }
    },
    "payments": {
        "methods": {
            "sepa": 6,
            "at_arrival": 1,
            "unknown": 0,
            "external": 3
        },
        "statuses": {
            "paid": 4,
            "awaiting_payment": 1,
            "late": 0,
            "cancelled_unpaid": 4,
            "unknown": 1
        }
    },
    "ev_charging": {
        "requested_records": 1,
        "revenue": 0
    },
    "trends": {
        "months": {
            "2026-01": {
                "confirmed": 0,
                "cancelled": 0,
                "soft_hold": 0,
                "local_blocks": 0,
                "confirmed_nights": 0,
                "cancelled_nights": 0,
                "soft_hold_nights": 0,
                "revenue_confirmed": 0,
                "missing_calc": 0,
                "missing_payment_method": 0
            },
            "2026-02": {
                "confirmed": 0,
                "cancelled": 0,
                "soft_hold": 0,
                "local_blocks": 0,
                "confirmed_nights": 0,
                "cancelled_nights": 0,
                "soft_hold_nights": 0,
                "revenue_confirmed": 0,
                "missing_calc": 0,
                "missing_payment_method": 0
            },
            "2026-03": {
                "confirmed": 0,
                "cancelled": 0,
                "soft_hold": 0,
                "local_blocks": 0,
                "confirmed_nights": 0,
                "cancelled_nights": 0,
                "soft_hold_nights": 0,
                "revenue_confirmed": 0,
                "missing_calc": 0,
                "missing_payment_method": 0
            },
            "2026-04": {
                "confirmed": 0,
                "cancelled": 0,
                "soft_hold": 0,
                "local_blocks": 0,
                "confirmed_nights": 0,
                "cancelled_nights": 0,
                "soft_hold_nights": 0,
                "revenue_confirmed": 0,
                "missing_calc": 0,
                "missing_payment_method": 0
            },
            "2026-05": {
                "confirmed": 0,
                "cancelled": 0,
                "soft_hold": 0,
                "local_blocks": 0,
                "confirmed_nights": 0,
                "cancelled_nights": 0,
                "soft_hold_nights": 0,
                "revenue_confirmed": 0,
                "missing_calc": 0,
                "missing_payment_method": 0
            },
            "2026-06": {
                "confirmed": 0,
                "cancelled": 1,
                "soft_hold": 0,
                "local_blocks": 0,
                "confirmed_nights": 0,
                "cancelled_nights": 5,
                "soft_hold_nights": 0,
                "revenue_confirmed": 0,
                "missing_calc": 0,
                "missing_payment_method": 0
            },
            "2026-07": {
                "confirmed": 1,
                "cancelled": 0,
                "soft_hold": 0,
                "local_blocks": 0,
                "confirmed_nights": 6,
                "cancelled_nights": 0,
                "soft_hold_nights": 0,
                "revenue_confirmed": 0,
                "missing_calc": 1,
                "missing_payment_method": 0
            },
            "2026-08": {
                "confirmed": 1,
                "cancelled": 1,
                "soft_hold": 0,
                "local_blocks": 0,
                "confirmed_nights": 4,
                "cancelled_nights": 3,
                "soft_hold_nights": 0,
                "revenue_confirmed": 0,
                "missing_calc": 1,
                "missing_payment_method": 0
            },
            "2026-09": {
                "confirmed": 2,
                "cancelled": 0,
                "soft_hold": 0,
                "local_blocks": 0,
                "confirmed_nights": 11,
                "cancelled_nights": 0,
                "soft_hold_nights": 0,
                "revenue_confirmed": 0,
                "missing_calc": 2,
                "missing_payment_method": 0
            },
            "2026-10": {
                "confirmed": 1,
                "cancelled": 0,
                "soft_hold": 0,
                "local_blocks": 0,
                "confirmed_nights": 7,
                "cancelled_nights": 0,
                "soft_hold_nights": 0,
                "revenue_confirmed": 0,
                "missing_calc": 1,
                "missing_payment_method": 0
            },
            "2026-11": {
                "confirmed": 0,
                "cancelled": 0,
                "soft_hold": 0,
                "local_blocks": 0,
                "confirmed_nights": 0,
                "cancelled_nights": 0,
                "soft_hold_nights": 0,
                "revenue_confirmed": 0,
                "missing_calc": 0,
                "missing_payment_method": 0
            },
            "2026-12": {
                "confirmed": 3,
                "cancelled": 0,
                "soft_hold": 0,
                "local_blocks": 0,
                "confirmed_nights": 6,
                "cancelled_nights": 0,
                "soft_hold_nights": 0,
                "revenue_confirmed": 0,
                "missing_calc": 3,
                "missing_payment_method": 0
            }
        },
        "period": {
            "year": "2026",
            "ym": "",
            "unit": ""
        },
        "notes": [
            "Revenue is allocated proportionally by nights for reservations spanning multiple months.",
            "Month trends are read-only and based on existing reservation/cancellation/soft-hold records."
        ]
    },
    "time_engine": {
        "state_exists": true,
        "state_updated_at": "2026-07-22T22:30:01+02:00",
        "jobs": {
            "accepted_inquiry_expiry": {
                "last_run_id": "20260722223001-ddf78581",
                "last_run_at": "2026-07-22T22:30:01+02:00",
                "last_ok": true,
                "last_summary": {
                    "checked": 0,
                    "expired": 0,
                    "awaiting_payment": null
                }
            },
            "payment_lifecycle_scan": {
                "last_run_id": "20260722223001-ddf78581",
                "last_run_at": "2026-07-22T22:30:01+02:00",
                "last_ok": true,
                "last_summary": {
                    "checked": 8,
                    "expired": null,
                    "awaiting_payment": 1
                }
            }
        },
        "log_month": "2026-07",
        "run_log_entries": 100,
        "last_run": {
            "ok": true,
            "engine": "CM PRO Time Engine",
            "version": "0.1",
            "run_id": "20260722223001-ddf78581",
            "timezone": "Europe/Ljubljana",
            "started_at": "2026-07-22T22:30:01+02:00",
            "finished_at": "2026-07-22T22:30:01+02:00",
            "jobs": [
                {
                    "job": "accepted_inquiry_expiry",
                    "ok": true,
                    "checked": 0,
                    "expired": 0,
                    "soft_holds_removed": 0,
                    "units_touched": [],
                    "errors": [],
                    "started_at": "2026-07-22T22:30:01+02:00",
                    "finished_at": "2026-07-22T22:30:01+02:00"
                },
                {
                    "job": "payment_lifecycle_scan",
                    "ok": true,
                    "mode": "mutate_v0_3e_payment_lifecycle_safety_config",
                    "now": "2026-07-22T22:30:01+02:00",
                    "checked": 8,
                    "with_payment_block": 8,
                    "missing_payment_block": 0,
                    "legacy_deadline_only": 0,
                    "awaiting_payment": 1,
                    "sepa_awaiting_payment": 1,
                    "non_sepa_awaiting_payment": 0,
                    "bonus_expired_candidates": 0,
                    "bonus_deactivated": 0,
                    "reminder_candidates": 0,
                    "reminder_due_logged": 0,
                    "reminder_email_candidates": 0,
                    "reminder_email_sent": 0,
                    "reminder_email_failed": 0,
                    "payment_deadline_candidates": 0,
                    "auto_cancel_due_logged": 0,
                    "auto_cancel_status_mutated": 0,
                    "occupancy_release_candidates": 0,
                    "occupancy_released": 0,
                    "occupancy_release_failed": 0,
                    "deadline_expired_email_candidates": 0,
                    "deadline_expired_email_sent": 0,
                    "deadline_expired_email_failed": 0,
                    "parse_errors": [],
                    "write_errors": [],
                    "email_errors": [],
                    "emails_skipped_by_config": 0,
                    "config": {
                        "settings_path": "/var/www/html/app_pro/common/data/json/scheduler/settings.json",
                        "payment_lifecycle_enabled": true,
                        "business_mutations_enabled": true,
                        "emails_enabled": true,
                        "dry_run_emails": false,
                        "send_emails_from": "2026-06-13T16:58:26.084198+02:00",
                        "reminder_emails_enabled": true,
                        "deadline_expired_emails_enabled": true
                    },
                    "items": [],
                    "notes": [
                        "v0.3e keeps v0.3d behavior and adds payment lifecycle safety/config guards.",
                        "Payment deadline due is logged and reservation/payment status is changed to cancelled_unpaid.",
                        "Reservation status is cancelled and occupancy is released through cm_regen_merged_for_unit().",
                        "Occupancy is released by regenerating occupancy_merged.json and publishing occupancy.json.",
                        "Guest notification emails are controlled by payment_lifecycle settings, dry-run flag and send_emails_from watermark.",
                        "The operational payment lifecycle source is active reservations JSON, not confirmed inquiry archive copies."
                    ],
                    "started_at": "2026-07-22T22:30:01+02:00",
                    "finished_at": "2026-07-22T22:30:01+02:00"
                }
            ],
            "logged_at": "2026-07-22T22:30:01+02:00"
        }
    },
    "price_engine": {
        "audit_exists": true,
        "log_month": "2026-07",
        "audit_entries": 1,
        "price_copy_apply_entries": 0,
        "writes": 0,
        "added": 0,
        "overwritten": 0,
        "last_apply_at": null,
        "last_audit_id": null
    },
    "warnings_count": 8,
    "warnings": [
        {
            "code": "confirmed_record_missing_calc",
            "context": {
                "id": "20260710093000-bk01-T1",
                "unit": "T1"
            }
        },
        {
            "code": "confirmed_record_missing_calc",
            "context": {
                "id": "20260715141500-abnb-T1",
                "unit": "T1"
            }
        },
        {
            "code": "confirmed_record_missing_calc",
            "context": {
                "id": "20260701160000-drct-T1",
                "unit": "T1"
            }
        },
        {
            "code": "confirmed_record_missing_calc",
            "context": {
                "id": "20260521230615-312d-T1",
                "unit": "T1"
            }
        },
        {
            "code": "confirmed_record_missing_calc",
            "context": {
                "id": "20260605110527-dcf4-T1",
                "unit": "T1"
            }
        },
        {
            "code": "confirmed_record_missing_calc",
            "context": {
                "id": "TE-TEST-BONUS-EXPIRED-T1",
                "unit": "T1"
            }
        },
        {
            "code": "confirmed_record_missing_calc",
            "context": {
                "id": "TE-TEST-REMINDER-DUE-T1",
                "unit": "T1"
            }
        },
        {
            "code": "confirmed_record_missing_calc",
            "context": {
                "id": "TE-TEST-PAYMENT-DEADLINE-T1",
                "unit": "T1"
            }
        }
    ],
    "notes": [
        "Read-only bridge. No writes are performed.",
        "Revenue is extracted from common calc total keys where available.",
        "Missing calc/payment fields are reported as warnings, not fatal errors.",
        "Monthly trends are calculated from the same read-only record set."
    ]
}