"""reservation_logic - 高价值福袋预约核心逻辑子包。 原 douyin/reservation/douyin_reservation_logic.py 拆成 6 个子模块: - _common 共享:错误处理工具占位 + ReservationItem 类型 - helpers 内部工具:标题归一化 / 相似度 / 排序 / 时间戳 - add add_reservation_core_logic 添加新预约 - cleanup_validate validate_back_to_reservation / cleanup_expired_reservations - queue_full handle_queue_full_wait_at_earliest 队列满时等待策略 - attend_window process_reservation_attend_window 进入预约窗口的处理(最大头) - record record_high_value_reservation 高价值预约登记入口 外部 import 路径不变: ``from douyin.reservation.douyin_reservation_logic import process_reservation_attend_window`` 仍可用(原文件改成 re-export shim)。 """ from ._common import ( ReservationItem, _RESERVATION_ERROR_UTILS_AVAILABLE, format_reservation_context, log_reservation_error, safe_write_state, validate_reservation_item, ) from .helpers import ( _calculate_string_similarity, _extract_content_core, _normalize_room_title_for_matching, _now_ts, _sort_reservations_inplace, ) from .add import add_reservation_core_logic from .cleanup_validate import ( cleanup_expired_reservations, validate_back_to_reservation, ) from .queue_full import handle_queue_full_wait_at_earliest from .attend_window import process_reservation_attend_window from .record import record_high_value_reservation __all__ = [ "ReservationItem", "_RESERVATION_ERROR_UTILS_AVAILABLE", "log_reservation_error", "safe_write_state", "format_reservation_context", "validate_reservation_item", "_now_ts", "_normalize_room_title_for_matching", "_calculate_string_similarity", "_extract_content_core", "_sort_reservations_inplace", "add_reservation_core_logic", "validate_back_to_reservation", "cleanup_expired_reservations", "handle_queue_full_wait_at_earliest", "process_reservation_attend_window", "record_high_value_reservation", ]