Holy db migrations batman

This commit is contained in:
Jonas Linter
2025-12-03 10:41:34 +01:00
parent 7ff3c44747
commit b572f660a7
19 changed files with 752 additions and 84 deletions

View File

@@ -98,7 +98,7 @@ def sample_reservation(sample_customer):
user_comment="Late check-in requested",
fbclid="PAZXh0bgNhZW0BMABhZGlkAasmYBTNE3QBp1jWuJ9zIpfEGRJMP63fMAMI405yvG5EtH-OT0PxSkAbBJaudFHR6cMtkdHu_aem_fopaFtECyVPNW9fmWfEkyA",
gclid="",
hotel_code="HOTEL123",
hotel_id="HOTEL123",
hotel_name="Alpine Paradise Resort",
)
data = reservation.model_dump(exclude_none=True)
@@ -136,7 +136,7 @@ def minimal_reservation(minimal_customer):
num_adults=1,
num_children=0,
children_ages=[],
hotel_code="HOTEL123",
hotel_id="HOTEL123",
created_at=datetime(2024, 12, 2, 12, 0, 0, tzinfo=UTC),
hotel_name="Alpine Paradise Resort",
)
@@ -403,7 +403,7 @@ class TestEdgeCases:
num_adults=1,
num_children=0,
children_ages="",
hotel_code="HOTEL123",
hotel_id="HOTEL123",
created_at=datetime.now(UTC),
)
@@ -434,7 +434,7 @@ class TestEdgeCases:
num_adults=2,
num_children=0,
children_ages=[],
hotel_code="HOTEL123",
hotel_id="HOTEL123",
created_at=datetime.now(UTC),
utm_source="facebook",
utm_medium="social",
@@ -851,7 +851,7 @@ class TestAcknowledgments:
num_adults=2,
num_children=0,
children_ages=[],
hotel_code="HOTEL123",
hotel_id="HOTEL123",
hotel_name="Alpine Paradise Resort",
created_at=datetime(2024, 11, 1, 12, 0, 0, tzinfo=UTC),
)
@@ -863,7 +863,7 @@ class TestAcknowledgments:
num_adults=2,
num_children=1,
children_ages=[10],
hotel_code="HOTEL123",
hotel_id="HOTEL123",
hotel_name="Alpine Paradise Resort",
created_at=datetime(2024, 11, 15, 10, 0, 0, tzinfo=UTC),
)

View File

@@ -523,7 +523,7 @@ class TestGenericWebhookEndpoint:
(r for r in reservations if r.customer_id == customer.id), None
)
assert reservation is not None, "Reservation should be created"
assert reservation.hotel_code == "HOTEL123"
assert reservation.hotel_id == "HOTEL123"
assert reservation.hotel_name == "Test Hotel"
assert reservation.num_adults == 2
assert reservation.num_children == 1
@@ -614,7 +614,7 @@ class TestGenericWebhookEndpoint:
result = await session.execute(select(Reservation))
reservations = result.scalars().all()
reservation = next(
(r for r in reservations if r.hotel_code == "HOTEL123"), None
(r for r in reservations if r.hotel_id == "HOTEL123"), None
)
assert reservation is not None, "Reservation should be created"
assert reservation.num_children == 3

View File

@@ -747,7 +747,7 @@ class TestHashedMatchingLogic:
reservation = Reservation(
customer_id=customer.id,
unique_id="res_6",
hotel_code="hotel_1",
hotel_id="hotel_1",
)
test_db_session.add(reservation)
await test_db_session.commit()