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,45 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Somnia.GuestLog.Models.Entities;
namespace Somnia.GuestLog.Infrastructure.EntityConfigs;
public class StayEntryEntityConfig : IEntityTypeConfiguration<StayEntry>
{
public void Configure(EntityTypeBuilder<StayEntry> builder)
{
builder.ToTable("StayEntry");
//PK
builder.HasKey(e => e.Id);
builder.Property(e => e.Id)
.IsRequired()
.UseIdentityByDefaultColumn();
builder.Property(e => e.DateIn)
.IsRequired()
.HasColumnType(DbConsts.DbType_Timestamptz_0);
builder.Property(e => e.DateOut)
.IsRequired()
.HasColumnType(DbConsts.DbType_Timestamptz_0);
builder.Property(e => e.RoomNumber)
.HasMaxLength(32);
builder.Property(e => e.PaymentMethod)
.IsRequired()
.HasMaxLength(5);
builder.Property(e => e.CreateTime)
.IsRequired()
.HasColumnType(DbConsts.DbType_Timestamptz);
builder.Property(e => e.UpdateTime)
.IsRequired()
.HasColumnType(DbConsts.DbType_Timestamptz);
builder.HasMany(e => e.GuestDocuments)
.WithMany();
}
}