SHA256
feat StayExport - Initial Implementation
- Created models for DB and DTOs: StayExportFile - Added required db migrations. - Added StayExportService and StayExportServiceFactory for stay exporting services. - Added configuration options required for StayExport.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Somnia.GuestLog.Models.Entities;
|
||||
|
||||
namespace Somnia.GuestLog.Infrastructure.EntityConfigs;
|
||||
|
||||
public class StayExportFileEntityConfig : IEntityTypeConfiguration<StayExportFile>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<StayExportFile> builder)
|
||||
{
|
||||
builder.ToTable("StayExportFile");
|
||||
|
||||
//PK
|
||||
builder.HasKey(e => e.Id);
|
||||
|
||||
builder.Property(e => e.Id)
|
||||
.IsRequired()
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
builder.ComplexProperty(e => e.ExportParams, e =>
|
||||
{
|
||||
e.ToJson();
|
||||
});
|
||||
|
||||
builder.Property(e => e.ExportedPath)
|
||||
.HasMaxLength(256);
|
||||
|
||||
|
||||
builder.Property(e => e.ExportTime)
|
||||
.IsRequired()
|
||||
.HasColumnType(DbConsts.DbType_Timestamptz);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user