# Matching / Destination Planning Audit

ตรวจจาก implementation และ schema ปัจจุบันก่อนแก้ไข

## Reuse ได้

- `lib/matching/matching_engine.dart`: deterministic country gate, period/interests scoring และ cluster planner
- `server/matching_service.dart`: waiting pool, runtime lock, automatic assignment และ `group_members`
- `tour_groups.country/city/image_asset/gallery_json/highlights_json`
- `tour_group_categories` และ `travel_categories` สำหรับ tags เดิม
- `lib/models/app_data.dart` และ `DatabaseTripService` สำหรับ destination cards/images/fallback
- Agency lead API/repository เดิมสำหรับ group summary และ authorization
- Existing winning-agency data in Trip Hub, extended through a member-scoped profile endpoint

## ต้องเพิ่ม/ปรับ

- threshold จาก 50 เป็น 70 และ budget policy แบบ 10%/20% ที่อธิบายได้
- score breakdown สำหรับ explainability
- optional region/city และ destination flexibility ใน preference model
- original/accepted destination history และ deterministic alternative suggestions
- API/UI state สำหรับการยอมรับ alternative โดยไม่ overwrite ประวัติเดิม

## ยังไม่มีใน implementation ปัจจุบัน

- persisted region/city poll และ place/activity poll (เพิ่มแบบ additive ในรอบนี้)
- aggregate lead detail จากสมาชิกและ agency profile endpoint แบบเฉพาะเจาะจง (เพิ่ม API/UI สรุปแบบไม่เปิดเผยตัวตน)

การแก้รอบนี้จึงเพิ่ม Matching V2, destination flexibility, alternative recommendation,
poll หลังจับกลุ่ม และ lead/profile summary โดย reuse catalog เดิม ไม่เปลี่ยน
Voting/Payment/Trip lifecycle และไม่สร้าง image catalog ซ้ำ
