GuestLog - StayEntry - Initial Implementation

- Added new entity "StayEntry" to log stays of guests.
- Added pages for StayEntry management (List and creation).
- New DataList for PaymentMethods.
- Other general changes and improvements.
This commit is contained in:
2026-08-15 19:33:32 +02:00
parent ec7efd867b
commit 6dc2d2426b
29 changed files with 1348 additions and 30 deletions
@@ -0,0 +1,52 @@
using Somnia.GuestLog.Models.DTOs;
using Somnia.GuestLog.Models.Entities;
namespace Somnia.GuestLog.Models;
internal static class EntityMapping
{
public static GuestDocumentDTO MapGuestDocumentEntityToDTO(GuestDocument entity)
{
return new()
{
DocumentType = entity.DocumentType,
DocumentNum = entity.DocumentNum,
IssueDate = entity.IssueDate.ToDateTime(TimeOnly.MinValue),
SupportNum = entity.SupportNum,
Nationality = entity.Nationality,
Name = entity.Name,
Surname = entity.Surname,
Surname2 = entity.Surname2,
BirthDate = entity.BirthDate.ToDateTime(TimeOnly.MinValue),
Gender = entity.Gender,
PhoneNumber = entity.PhoneNumber,
EmailAddress = entity.EmailAddress,
Address = entity.AddressDetails?.Address ?? "",
AddressCity = entity.AddressDetails?.AddressCity ?? "",
AddressProvince = entity.AddressDetails?.AddressProvince ?? "",
AddressState = entity.AddressDetails?.AddressState ?? "",
AddressCountry = entity.AddressDetails?.AddressCountry! ?? "",
ZipCode = entity.AddressDetails?.ZipCode ?? "",
CreateTime = entity.CreateTime,
UpdateTime = entity.UpdateTime,
};
}
public static StayEntryDTO MapStayEntryEntityToDTO(StayEntry entity)
{
return new()
{
Id = entity.Id,
DateIn = entity.DateIn,
DateOut = entity.DateOut,
RoomCount = entity.RoomCount,
RoomNumber = entity.RoomNumber,
PaymentMethod = entity.PaymentMethod,
CreateTime = entity.CreateTime,
UpdateTime = entity.UpdateTime,
GuestDocuments = [.. entity.GuestDocuments.Select(e => MapGuestDocumentEntityToDTO(e))],
};
}
}