SHA256
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user