Files
trip-plan/src/server/data/countryPlugs.json
T
grabowski e342cd9a91 Add trip checklists with rule-based packing advice
Each trip gets a checklist whose items group under free-text categories
(Documents, Clothing, Toiletries, Health, Electronics, Extras first, then
any custom ones alphabetically). Items are either shared — every member
sees and can tick them, and checked_by records who — or personal to one
member, which nobody else can see or touch. Items carry an optional
quantity, drag-reorder within their category, and "Uncheck all" resets the
list for the trip home.

The "Suggestions" modal is deterministic, offline advice derived from the
trip itself (src/server/util/packing.js) — no LLM and no external calls, so
it stays unit-testable and works on a self-hosted box. Nights scale
clothing quantities, flights add liquids/power-bank/check-in, rentals add
licence + IDP, ferries add motion-sickness tablets, tropical stops add sun
cream and repellent, and the destination country picks the plug type from a
bundled ~50-country table. Every suggestion carries a short reason, and
already-added ones are keyed by suggestion_key so they can't be duplicated.

Two rules deliberately differ from the naive reading, both regression-tested:
a latitude floor stops a December trip to Bangkok being tagged cold as well
as tropical, and only a flight segment's arrival airport counts, since the
first segment's departure airport is home rather than a destination.

checklist_items is a new table, so the existing CREATE TABLE IF NOT EXISTS
path creates it on upgrade; no MIGRATIONS entry is needed and existing data
is untouched.

docs/API.md documents the full contract. 113/113 tests pass.
2026-08-03 18:18:25 +07:00

54 lines
2.6 KiB
JSON

{
"US": { "name": "United States", "plugs": ["A", "B"] },
"CA": { "name": "Canada", "plugs": ["A", "B"] },
"MX": { "name": "Mexico", "plugs": ["A", "B"] },
"GB": { "name": "United Kingdom", "plugs": ["G"] },
"IE": { "name": "Ireland", "plugs": ["G"] },
"FR": { "name": "France", "plugs": ["C", "E"] },
"DE": { "name": "Germany", "plugs": ["C", "F"] },
"IT": { "name": "Italy", "plugs": ["C", "F", "L"] },
"ES": { "name": "Spain", "plugs": ["C", "F"] },
"PT": { "name": "Portugal", "plugs": ["C", "F"] },
"NL": { "name": "Netherlands", "plugs": ["C", "F"] },
"BE": { "name": "Belgium", "plugs": ["C", "E"] },
"CH": { "name": "Switzerland", "plugs": ["C", "J"] },
"AT": { "name": "Austria", "plugs": ["C", "F"] },
"GR": { "name": "Greece", "plugs": ["C", "F"] },
"SE": { "name": "Sweden", "plugs": ["C", "F"] },
"NO": { "name": "Norway", "plugs": ["C", "F"] },
"DK": { "name": "Denmark", "plugs": ["C", "K"] },
"FI": { "name": "Finland", "plugs": ["C", "F"] },
"PL": { "name": "Poland", "plugs": ["C", "E"] },
"CZ": { "name": "Czechia", "plugs": ["C", "E"] },
"HU": { "name": "Hungary", "plugs": ["C", "F"] },
"HR": { "name": "Croatia", "plugs": ["C", "F"] },
"IS": { "name": "Iceland", "plugs": ["C", "F"] },
"RU": { "name": "Russia", "plugs": ["C", "F"] },
"TR": { "name": "Turkey", "plugs": ["C", "F"] },
"TH": { "name": "Thailand", "plugs": ["A", "B", "C"] },
"VN": { "name": "Vietnam", "plugs": ["A", "C"] },
"KH": { "name": "Cambodia", "plugs": ["A", "C", "G"] },
"LA": { "name": "Laos", "plugs": ["A", "B", "C"] },
"JP": { "name": "Japan", "plugs": ["A", "B"] },
"CN": { "name": "China", "plugs": ["A", "C", "I"] },
"KR": { "name": "South Korea", "plugs": ["C", "F"] },
"IN": { "name": "India", "plugs": ["C", "D", "M"] },
"ID": { "name": "Indonesia", "plugs": ["C", "F"] },
"MY": { "name": "Malaysia", "plugs": ["G"] },
"SG": { "name": "Singapore", "plugs": ["G"] },
"PH": { "name": "Philippines", "plugs": ["A", "B", "C"] },
"AU": { "name": "Australia", "plugs": ["I"] },
"NZ": { "name": "New Zealand", "plugs": ["I"] },
"ZA": { "name": "South Africa", "plugs": ["M", "N"] },
"EG": { "name": "Egypt", "plugs": ["C", "F"] },
"AE": { "name": "United Arab Emirates", "plugs": ["G", "C"] },
"IL": { "name": "Israel", "plugs": ["C", "H"] },
"BR": { "name": "Brazil", "plugs": ["N", "C"] },
"AR": { "name": "Argentina", "plugs": ["C", "I"] },
"CL": { "name": "Chile", "plugs": ["C", "L"] },
"PE": { "name": "Peru", "plugs": ["A", "C"] },
"CO": { "name": "Colombia", "plugs": ["A", "B"] },
"MA": { "name": "Morocco", "plugs": ["C", "E"] },
"KE": { "name": "Kenya", "plugs": ["G"] }
}