mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-21 06:11:45 +00:00
feat(reservations): native booking-confirmation import via KDE KItinerary (#1102)
* feat(reservations): native booking-confirmation import via KDE KItinerary
Adds a two-step preview → confirm flow for importing booking emails,
PDFs, PKPass and HTML confirmations. The server invokes the KDE
kitinerary-extractor binary, maps JSON-LD schema.org output to TREK
reservation shapes, and persists via the existing createReservation
pipeline (accommodations, budget, places, WebSocket broadcasts).
- NestJS BookingImportModule: preview + confirm endpoints under
/api/trips/:tripId/reservations/import/booking{,/confirm}
- KitineraryExtractorService: spawns the binary, filters stderr noise,
handles QDateTime (@value) timezone-aware datetimes
- kitinerary-mapper: FlightReservation, TrainReservation, BusReservation,
BoatReservation, LodgingReservation, FoodEstablishmentReservation,
RentalCarReservation, EventReservation → typed preview items
- BookingImportService: auto-creates place rows; geocodes venues without
coordinates via Nominatim (name+address → address → name fallback);
resolves day IDs for accommodation linking
- BookingImportModal: drag-and-drop multi-file upload, preview cards
with type icons, per-item exclude toggle, confirm step
- Shared Zod contracts: BookingImportPreviewItem, PreviewResponse,
ConfirmRequest, ConfirmResponse — consumed by controller, service,
API client and modal
- Dockerfile: node:24-trixie-slim runtime; amd64 downloads KDE static
binary + locales; arm64 installs libkitinerary-bin + symlinks to
fixed path; ENV KITINERARY_EXTRACTOR_PATH set for both arches
- /api/health/features exposes { bookingImport: boolean } so the UI
hides the Import button when the binary is absent
- i18n keys (English), wiki docs, API.md, README one-liner
* i18n: add booking import translations for all 19 non-English locales
Adds 17 reservations.import.* keys and undo.importBooking to ar, br, cs,
de, es, fr, gr, hu, id, it, ja, ko, nl, pl, ru, tr, uk, zh, zh-TW.
* chore: enforce i18n parity
* docs(wiki): add KItinerary local setup instructions to dev environment guide
This commit is contained in:
@@ -117,5 +117,22 @@ const reservations: TranslationStrings = {
|
||||
'reservations.validation.endBeforeStart':
|
||||
'終了日時は開始日時より後である必要があります',
|
||||
'reservations.addBooking': '予約を追加',
|
||||
'reservations.import.title': '予約確認書のインポート',
|
||||
'reservations.import.cta': 'ファイルからインポート',
|
||||
'reservations.import.dropHere': '予約確認ファイルをここにドロップするか、クリックして選択',
|
||||
'reservations.import.dropActive': 'ファイルをドロップしてインポート',
|
||||
'reservations.import.acceptedFormats': '対応形式:EML、PDF、PKPass、HTML、TXT(各最大 10 MB、最大 5 ファイル)',
|
||||
'reservations.import.parsing': 'ファイルを解析中…',
|
||||
'reservations.import.previewHeading': '{count} 件の予約が見つかりました',
|
||||
'reservations.import.previewEmpty': 'アップロードされたファイルから予約を抽出できませんでした。',
|
||||
'reservations.import.removeItem': '削除',
|
||||
'reservations.import.confirm': '{count} 件の予約をインポート',
|
||||
'reservations.import.back': '戻る',
|
||||
'reservations.import.success': '{count} 件の予約をインポートしました',
|
||||
'reservations.import.partialFailure': '{created} 件インポート済み、{failed} 件失敗',
|
||||
'reservations.import.error': '解析に失敗しました。ファイルが有効な予約確認書であることを確認してください。',
|
||||
'reservations.import.unavailable': 'このサーバーでは予約インポート機能が利用できません。',
|
||||
'reservations.import.unsupportedFormat': '対応していないファイル形式です。EML、PDF、PKPass、HTML、または TXT を使用してください。',
|
||||
'reservations.import.fileTooLarge': 'ファイル「{name}」は 10 MB の制限を超えています。',
|
||||
};
|
||||
export default reservations;
|
||||
|
||||
@@ -17,5 +17,6 @@ const undo: TranslationStrings = {
|
||||
'undo.importNaverList': 'Naverマップをインポート',
|
||||
'undo.addPlace': '場所を追加',
|
||||
'undo.done': '元に戻しました: {action}',
|
||||
'undo.importBooking': '予約確認書インポート',
|
||||
};
|
||||
export default undo;
|
||||
|
||||
Reference in New Issue
Block a user