Fix sync not updating arrival/departure dates on re-sync
ON CONFLICT clause was missing arrival_date, departure_date, nights, and room_number — so early checkouts (where NewBook updates booking_departure to the actual checkout date) never propagated to the DB columns. Reverts the COUNT(DISTINCT) workaround since the root cause is now fixed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7ebc31756d
commit
1fae3ce60b
2 changed files with 5 additions and 4 deletions
|
|
@ -455,6 +455,10 @@ def run_bookings_data_sync(
|
|||
ON CONFLICT (newbook_id) DO UPDATE SET
|
||||
booking_reference = EXCLUDED.booking_reference,
|
||||
booking_placed = COALESCE(EXCLUDED.booking_placed, newbook_bookings_data.booking_placed),
|
||||
arrival_date = EXCLUDED.arrival_date,
|
||||
departure_date = EXCLUDED.departure_date,
|
||||
nights = EXCLUDED.nights,
|
||||
room_number = EXCLUDED.room_number,
|
||||
status = EXCLUDED.status,
|
||||
total_amount = EXCLUDED.total_amount,
|
||||
tariff_total = EXCLUDED.tariff_total,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue