GuestLog - StayEntry detail view and improvements:

- Added detail view for StayEntries.
- Added button to delete StayEntries.
- Improve queries of StayEntries using a "query config" record.
- Enabled LazyLoading for all database relations. This will make easier to find cases where required relations aren't explicitly loaded.
This commit is contained in:
2026-08-17 21:28:26 +02:00
parent 3e0ef34f66
commit 67845e250f
15 changed files with 229 additions and 45 deletions
+2 -2
View File
@@ -33,7 +33,7 @@ internal static class EntityMapping
};
}
public static StayEntryDTO MapStayEntryEntityToDTO(StayEntry entity)
public static StayEntryDTO MapStayEntryEntityToDTO(StayEntry entity, bool includeGuests)
{
return new()
{
@@ -45,7 +45,7 @@ internal static class EntityMapping
PaymentMethod = entity.PaymentMethod,
CreateTime = entity.CreateTime,
UpdateTime = entity.UpdateTime,
GuestDocuments = [.. entity.GuestDocuments.Select(e => MapGuestDocumentEntityToDTO(e))],
GuestDocuments = includeGuests ? [.. entity.GuestDocuments.Select(e => MapGuestDocumentEntityToDTO(e))] : null,
};
}