SHA256
- 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.
250 lines
9.7 KiB
C#
250 lines
9.7 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
using Somnia.GuestLog.Infrastructure;
|
|
|
|
#nullable disable
|
|
|
|
namespace Somnia.GuestLog.Infrastructure.Migrations
|
|
{
|
|
[DbContext(typeof(GuestLogContext))]
|
|
[Migration("20260901161146_AddTable_StayExportFile")]
|
|
partial class AddTable_StayExportFile
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "10.0.7")
|
|
.HasAnnotation("Proxies:ChangeTracking", false)
|
|
.HasAnnotation("Proxies:CheckEquality", false)
|
|
.HasAnnotation("Proxies:LazyLoading", true)
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("GuestDocumentStayEntry", b =>
|
|
{
|
|
b.Property<long>("StayEntryId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<long>("GuestDocumentsId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<int>("GuestDocumentsVersion")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("StayEntryId", "GuestDocumentsId", "GuestDocumentsVersion");
|
|
|
|
b.HasIndex("GuestDocumentsId", "GuestDocumentsVersion");
|
|
|
|
b.ToTable("GuestDocumentStayEntry");
|
|
});
|
|
|
|
modelBuilder.Entity("Somnia.GuestLog.Models.Entities.GuestDocument", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<int>("Version")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateOnly>("BirthDate")
|
|
.HasColumnType("date");
|
|
|
|
b.Property<DateTime>("CreateTime")
|
|
.HasColumnType("timestamp(3) with time zone");
|
|
|
|
b.Property<string>("DocumentNum")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<string>("DocumentType")
|
|
.IsRequired()
|
|
.HasMaxLength(8)
|
|
.HasColumnType("character varying(8)");
|
|
|
|
b.Property<string>("EmailAddress")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<string>("Gender")
|
|
.HasMaxLength(1)
|
|
.HasColumnType("character varying(1)");
|
|
|
|
b.Property<bool>("IsLastVersion")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<DateOnly>("IssueDate")
|
|
.HasColumnType("date");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<string>("Nationality")
|
|
.IsRequired()
|
|
.HasMaxLength(3)
|
|
.HasColumnType("character varying(3)");
|
|
|
|
b.Property<string>("PhoneNumber")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("character varying(32)");
|
|
|
|
b.Property<string>("SupportNum")
|
|
.HasMaxLength(10)
|
|
.HasColumnType("character varying(10)");
|
|
|
|
b.Property<string>("Surname")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<string>("Surname2")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<DateTime>("UpdateTime")
|
|
.HasColumnType("timestamp(3) with time zone");
|
|
|
|
b.ComplexProperty(typeof(Dictionary<string, object>), "AddressDetails", "Somnia.GuestLog.Models.Entities.GuestDocument.AddressDetails#GuestAddress", b1 =>
|
|
{
|
|
b1.Property<string>("Address")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b1.Property<string>("AddressCity")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b1.Property<string>("AddressCountry")
|
|
.IsRequired()
|
|
.HasMaxLength(3)
|
|
.HasColumnType("character varying(3)");
|
|
|
|
b1.Property<string>("AddressProvince")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b1.Property<string>("AddressState")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b1.Property<string>("ZipCode")
|
|
.HasMaxLength(12)
|
|
.HasColumnType("character varying(12)");
|
|
});
|
|
|
|
b.HasKey("Id", "Version");
|
|
|
|
b.ToTable("GuestDocument", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Somnia.GuestLog.Models.Entities.StayEntry", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<DateTime>("CreateTime")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateTime>("DateIn")
|
|
.HasColumnType("timestamp(0) with time zone");
|
|
|
|
b.Property<DateTime>("DateOut")
|
|
.HasColumnType("timestamp(0) with time zone");
|
|
|
|
b.Property<string>("PaymentMethod")
|
|
.IsRequired()
|
|
.HasMaxLength(5)
|
|
.HasColumnType("character varying(5)");
|
|
|
|
b.Property<int>("RoomCount")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("RoomNumber")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("character varying(32)");
|
|
|
|
b.Property<DateTime>("UpdateTime")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("StayEntry", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Somnia.GuestLog.Models.Entities.StayExportFile", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<int>("ExportFormat")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("ExportResult")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTime>("ExportTime")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("ExportedPath")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.ComplexProperty(typeof(Dictionary<string, object>), "ExportParams", "Somnia.GuestLog.Models.Entities.StayExportFile.ExportParams#StayExportParams", b1 =>
|
|
{
|
|
b1.IsRequired();
|
|
|
|
b1.Property<DateTime?>("ExportPeriodEnd");
|
|
|
|
b1.Property<DateTime?>("ExportPeriodStart");
|
|
|
|
b1.Property<int>("ExportType");
|
|
|
|
b1
|
|
.ToJson("ExportParams")
|
|
.HasColumnType("jsonb");
|
|
});
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("StayExportFile", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("GuestDocumentStayEntry", b =>
|
|
{
|
|
b.HasOne("Somnia.GuestLog.Models.Entities.StayEntry", null)
|
|
.WithMany()
|
|
.HasForeignKey("StayEntryId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Somnia.GuestLog.Models.Entities.GuestDocument", null)
|
|
.WithMany()
|
|
.HasForeignKey("GuestDocumentsId", "GuestDocumentsVersion")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|