Files
SomniaGuestLog/src/Somnia.GuestLog/Infrastructure/EntityConfigs/StayEntryEntityConfig.cs
T
Daniel-Garmig 2f0062b313 StayExportTracking - Changes to Models
- Added new fields to track stay export uploading.
- Added methods in EntityServices to update this fields.
- Show new fields in UI (with required locale).
2026-10-06 14:34:58 +02:00

49 lines
1.4 KiB
C#

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.StayUploadStatus)
.IsRequired();
builder.Property(e => e.StayUploadStatusTime)
.HasColumnType(DbConsts.DbType_Timestamptz);
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();
}
}