from __future__ import annotations

from typing import Any


class WbsScheduleParserMixin:
    """Bóc tách các dòng biểu giá hợp đồng tự do của người dùng."""

    def _parse_contract_schedule_text(self, text: str | None) -> list[dict[str, Any]]:
        """Bóc tách các dòng biểu giá hợp đồng tự do của người dùng."""
        if not text or not text.strip():
            return []
        items = []
        lines = [l.strip() for l in text.strip().split("\n") if l.strip()]
        for line in lines:
            items.append({"raw_line": line})
        return items
