feature/airbnb-email-import #6

Merged
hume merged 31 commits from feature/airbnb-email-import into main 2026-08-19 16:49:38 +00:00
Owner
No description provided.
hume added 31 commits 2026-08-19 16:49:02 +00:00
fix: frontend uses public API URL via VITE_API_URL, removes nginx proxy to backend
All checks were successful
Frontend / frontend (push) Successful in 22s
19ba715ee4
feat: add Airbnb email import for reservations
All checks were successful
Backend / backend (push) Successful in 39s
ab14b8177f
- New email_import_service.py: parses 3 email types (Created, Coming Soon, Canceled)
  - Extracts property, dates, guests, pet, pricing (taxes séjour, payout, fees)
  - Handles quoted-printable encoding
  - Idempotent via Airbnb confirmation code
- New imap_poller.py: IMAP polling with UID tracking
- New scripts/poll_airbnb_emails.py: cron-compatible entry point
- Updated imports routes: POST /email/preview and POST /email
- Added airbnb_email to ImportStatusResponse
- 22 unit tests in test_email_import.py
- All 71 tests passing
fix: update imap_poller imports and script path for standalone execution
All checks were successful
Backend / backend (push) Successful in 40s
12edf48a9d
feat: add include_seen option to process already-read Airbnb emails
All checks were successful
Backend / backend (push) Successful in 38s
6343dcbdc9
- New IMAP_INCLUDE_SEEN env var (default: false)
- search_airbnb_emails(include_seen) and process_emails(include_seen)
- Allows processing emails already opened by other mailbox users
- All 71 tests passing
fix: handle bytes email_id in IMAP fetch/store commands
All checks were successful
Backend / backend (push) Successful in 39s
b1232cc66c
fix: split guest_name into firstname/lastname for tenant matching
All checks were successful
Backend / backend (push) Successful in 40s
73cdea159d
fix: use find_existing_booking_by_reference for confirmation code lookup
All checks were successful
Backend / backend (push) Successful in 40s
b06069b829
fix: create tenant inline instead of missing create_tenant function
All checks were successful
Backend / backend (push) Successful in 40s
6fbf02ea88
fix: remove create_tenant import, use inline Tenant creation
All checks were successful
Backend / backend (push) Successful in 38s
62bade5158
feat: add multi-folder IMAP support (INBOX + Trash)
All checks were successful
Backend / backend (push) Successful in 38s
d653847e5c
- New IMAP_FOLDERS env var (comma-separated, e.g. INBOX,[Gmail]/Trash)
- AirbnbEmailPoller now searches all configured folders
- Legacy IMAP_FOLDER still works as fallback
- All 71 tests passing
feat: sort emails chronologically (Created -> Coming Soon)
All checks were successful
Backend / backend (push) Successful in 40s
2a9e3bd407
- IMAP returns IDs in chronological order by default
- CREATED emails now have confirmation_code = None (wait for COMING_SOON)
- COMING_SOON/CANCELED still extract real HMxxxxxxxx code
- All 71 tests passing
feat: complete Airbnb email import with CREATED->COMING_SOON->CANCELED lifecycle
All checks were successful
Backend / backend (push) Successful in 40s
62bfec813e
- Added airbnb_listing_id, check_in_time, check_out_time, platform_fee, net_revenue to Booking model
- Implemented composite key matching (listing_id + dates) for CREATED emails
- Fallback matching: COMING_SOON first tries confirmation_code, then listing_id+dates
- Fixed pricing extraction for mis-encoded euro signs (¬/¬)
- Fixed date parsing for 'sam. 28 déc.' format
- All 72 tests pass
test: add CSV sync test for CREATED->COMING_SOON->CSV flow
All checks were successful
Backend / backend (push) Successful in 42s
3dd7845143
- Verifies CREATED email creates booking without confirmation_code
- COMING_SOON finds booking by listing_id+dates and adds confirmation_code
- CSV import finds booking by external_reference and skips (no duplicate)
fix: shorten alembic revision IDs to fit 32-char limit
All checks were successful
Backend / backend (push) Successful in 40s
91a35c3234
- 20260817_add_airbnb_listing_id -> 20260817_add_listing_id (31 chars)
- 20260817_add_checkin_checkout -> 20260817_add_checkin (26 chars)
- 20260817_add_platform_fee_net_revenue -> 20260817_add_fee_rev (26 chars)
- Updated down_revision references accordingly
- Use .get() with default for 'created' and 'skipped' keys
- These keys only exist for successful imports, not for errors
fix: change notes column to TEXT for longer email content
All checks were successful
Backend / backend (push) Successful in 39s
84f588069b
- Emails Airbnb avec URLs de tracking dépassent 1000 chars
- Migration 20260818_notes_text (ID < 32 chars)
fix: keep notes as VARCHAR(1000) for manual entry only
All checks were successful
Backend / backend (push) Successful in 37s
4a515800a4
- Removed auto-population of notes from email content
- notes field reserved for manual operational notes (special requests, arrival times, pets, etc.)
- Reverted notes column to VARCHAR(1000)
- Deleted migration 20260818_notes_text
- Reuse parse_airbnb_guest_name() for consistency with CSV import
- Single guest names (e.g. 'MARION') now get 'AIRBNB' as lastname
- Matches CSV behavior: 'Caroline' -> ('Caroline', 'AIRBNB')
- Enables tenant matching between email and CSV imports
fix: update existing tenant info from email when available
All checks were successful
Backend / backend (push) Successful in 39s
85c134ce79
- If tenant exists, update email/phone from email if not already set
- Uses parse_airbnb_guest_name() for consistent tenant matching with CSV
fix: set adults_count on CSV Airbnb import
All checks were successful
Backend / backend (push) Successful in 38s
d545a123e8
- adults_count was missing from booking creation, only tax_adults_count was set
- Now adults_count = calculated adults from tax (or 1 default)
- Matches mobile app expectation for adults_count field
feat: parse adults, children, pets from CSV Airbnb import
All checks were successful
Backend / backend (push) Successful in 43s
cd17ea440a
- Parse 'Nombre de voyageurs' column (formats: '2 adultes, 1 enfant', '3', '2 adultes')
- Parse 'Animaux' / 'Animal de compagnie' / 'Pets' column (oui/yes/1/true)
- Use CSV data for adults_count, children_count, has_dog on booking creation
- Fallback to tax-based calculation if CSV doesn't provide data
- Added 2 unit tests in TestCsvAirbnbImport
feat: add guest details and notes to dashboard booking cards
All checks were successful
Frontend / frontend (push) Successful in 20s
Mobile Frontend / Build Web Assets (push) Successful in 9m52s
7f7b9163f8
Web (frontend/src/views/DashboardView.vue):
- 'Locations en cours' cards: show adults_count, children_count, has_dog, notes
- 'Arrivées prochaines' cards: show adults_count, children_count, has_dog, notes
- Added .booking-details and .booking-notes CSS styling

Mobile (mobile/src/components/BookingCard.vue):
- Added notes display with .notes-badge styling
- Added notes to Props interface
fix: financial dashboard for year with no bookings + init script with dedup
All checks were successful
Backend / backend (push) Successful in 43s
dc460e0519
- Fix UnboundLocalError in get_financial_dashboard when no bookings for year
- Handle booking.amount = None in monthly revenue calculation
- Add init_database.py script with official_data, properties, and dedup logic
- keep = booking with external_reference (CSV)
- remove = booking without (email)
- Merge: children_count, tax_amount, tax_per_day, tax_adults_count, has_dog from email into CSV
fix: email import merges data at import time (no dedup needed)
All checks were successful
Backend / backend (push) Successful in 43s
bc0966d4d3
- Added fallback to find_equivalent_booking (property + dates) in email import
- Merge strategy at import: if existing has external_reference (CSV), keep financial data, add email-specific fields (children, pets, tax)
- Added find_equivalent_booking import dynamically to avoid circular imports
- Fixed tests with proper mocking for find_existing_booking and find_equivalent_booking
- init_database.py dedup script also updated with merge logic
feat: test environment setup with isolated DB + email import fixes
All checks were successful
Backend / backend (push) Successful in 43s
Frontend / frontend (push) Successful in 19s
a8bb8337df
- Added docker-compose.test.yml with isolated PostgreSQL on port 5433
- Updated vite.config.ts: host 0.0.0.0, proxy to 192.168.8.111:8000
- Fixed email import: extract_dates now uses subject for canceled emails (parses 'le 30 juin 2024' + '30 juin – 4 juil.' from body)
- All 75 tests pass
feat: IMAP config panel with timezone fix, separators, theme support, and checkbox fixes
All checks were successful
Backend / backend (push) Successful in 43s
Frontend / frontend (push) Successful in 18s
Mobile Frontend / Build Web Assets (push) Successful in 10m18s
d388c77bf1
- ImapConfigPanel.vue: complete rewrite with PrimeVue Aura theme variables
- Timezone fix: formatDate() parses UTC timestamps and displays in local timezone
- Visual separators between config sections
- Title truncation fixes for .p-card-title, .p-card-subtitle, .config-section legend
- Folder checkboxes: fixed with individual boolean refs + watchers (no more array binding issues)
- Recursive update prevention: flush: 'post' + equality check
- Proper initialization order: syncFolderChecked() called after API load
- Collapsible 'Paramètres avancés' with all settings
- Connection summary always visible
- Auto-sync config with Démarré/Terminé/Statut/Résultat timestamps

Also includes:
- ImportEmailPanel.vue: timezone fix for import timestamps
- Backend: ImapConfig model with last_sync_started_at/last_sync_completed_at
- Auto-sync cron script reading config from DB
- All import endpoints restored (CSV, Excel, iCal, Email)
fix folders checkbox issue
All checks were successful
Frontend / frontend (push) Successful in 20s
Backend / backend (pull_request) Successful in 40s
Frontend / frontend (pull_request) Successful in 19s
Mobile Frontend / Build Web Assets (pull_request) Successful in 9m50s
6e0eaf4232
hume merged commit c2611e9cca into main 2026-08-19 16:49:38 +00:00
hume deleted branch feature/airbnb-email-import 2026-08-19 16:49:39 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hume/sci-rental-manager!6
No description provided.