// <auto-generated />
using System;
using EVCB_OCPP.Domain;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;

#nullable disable

namespace EVCB_OCPP.Domain.Migrations
{
    [DbContext(typeof(MainDBContext))]
    [Migration("20231019085717_InitialCreate")]
    partial class InitialCreate
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .UseCollation("Chinese_Taiwan_Stroke_CI_AS")
                .HasAnnotation("ProductVersion", "7.0.12")
                .HasAnnotation("Relational:MaxIdentifierLength", 128);

            SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);

            modelBuilder.Entity("EVCB_OCPP.Domain.Models.MainDb.ConnectorMeterValueRecord", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<string>("ChargeBoxId")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<byte>("ConnectorId")
                        .HasColumnType("tinyint");

                    b.Property<int>("ContextId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedOn")
                        .HasColumnType("datetime");

                    b.Property<int>("FormatId")
                        .HasColumnType("int");

                    b.Property<int>("LocationId")
                        .HasColumnType("int");

                    b.Property<int>("MeasurandId")
                        .HasColumnType("int");

                    b.Property<int>("PhaseId")
                        .HasColumnType("int");

                    b.Property<int>("TransactionId")
                        .HasColumnType("int");

                    b.Property<int>("UnitId")
                        .HasColumnType("int");

                    b.Property<string>("Value")
                        .HasMaxLength(10)
                        .HasColumnType("nvarchar(10)");

                    b.HasKey("Id")
                        .HasName("PK_dbo.ConnectorMeterValueRecord");

                    b.ToTable("ConnectorMeterValueRecord", (string)null);
                });

            modelBuilder.Entity("EVCB_OCPP.Domain.Models.MainDb.ConnectorStatus", b =>
                {
                    b.Property<string>("Id")
                        .HasMaxLength(36)
                        .HasColumnType("nvarchar(36)");

                    b.Property<string>("ChargeBoxId")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<int>("ChargePointErrorCodeId")
                        .HasColumnType("int");

                    b.Property<byte>("ConnectorId")
                        .HasColumnType("tinyint");

                    b.Property<DateTime>("CreatedOn")
                        .HasColumnType("datetime");

                    b.Property<string>("ErrorInfo")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<decimal>("TotalEnergy")
                        .HasColumnType("decimal(10, 2)");

                    b.Property<int>("Type")
                        .HasColumnType("int");

                    b.Property<string>("VendorErrorCode")
                        .HasMaxLength(100)
                        .HasColumnType("nvarchar(100)");

                    b.Property<string>("VendorId")
                        .HasMaxLength(255)
                        .HasColumnType("nvarchar(255)");

                    b.HasKey("Id")
                        .HasName("PK_dbo.ConnectorStatus");

                    b.HasIndex(new[] { "ChargeBoxId", "ConnectorId" }, "IX_ConnectorStatus")
                        .IsUnique()
                        .HasFilter("[ChargeBoxId] IS NOT NULL");

                    b.ToTable("ConnectorStatus", (string)null);
                });

            modelBuilder.Entity("EVCB_OCPP.Domain.Models.MainDb.Customer", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uniqueidentifier");

                    b.Property<string>("ApiCustomerId")
                        .HasMaxLength(36)
                        .HasColumnType("nvarchar(36)");

                    b.Property<string>("ApiKey")
                        .HasMaxLength(128)
                        .HasColumnType("nvarchar(128)");

                    b.Property<DateTime?>("ApiKeyUpdatedOn")
                        .HasColumnType("datetime");

                    b.Property<string>("ApiUrl")
                        .HasMaxLength(256)
                        .HasColumnType("nvarchar(256)");

                    b.Property<bool>("CallPartnerApiOnSchedule")
                        .HasColumnType("bit");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<DateTime>("CreatedOn")
                        .HasColumnType("datetime");

                    b.Property<DateTime?>("Deadline")
                        .HasColumnType("datetime");

                    b.Property<bool>("EnableTtia")
                        .HasColumnType("bit")
                        .HasColumnName("EnableTTIA");

                    b.Property<string>("Ftphost")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)")
                        .HasColumnName("FTPHost");

                    b.Property<string>("Ftppassword")
                        .HasMaxLength(20)
                        .HasColumnType("nvarchar(20)")
                        .HasColumnName("FTPPassword");

                    b.Property<string>("Ftppath")
                        .HasColumnType("nvarchar(max)")
                        .HasColumnName("FTPPath");

                    b.Property<string>("Ftpuser")
                        .HasMaxLength(20)
                        .HasColumnType("nvarchar(20)")
                        .HasColumnName("FTPUser");

                    b.Property<bool>("InstantStopTxReport")
                        .HasColumnType("bit");

                    b.Property<bool>("IsShow")
                        .HasColumnType("bit");

                    b.Property<string>("Name")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<string>("PartnerId")
                        .HasMaxLength(36)
                        .HasColumnType("nvarchar(36)");

                    b.Property<string>("TtiaApikey")
                        .HasMaxLength(10)
                        .HasColumnType("nvarchar(10)")
                        .HasColumnName("TTIA_APIKey");

                    b.Property<string>("TtiaApiurl")
                        .HasMaxLength(100)
                        .HasColumnType("nvarchar(100)")
                        .HasColumnName("TTIA_APIUrl");

                    b.Property<int>("TtiaCustomerId")
                        .HasColumnType("int")
                        .HasColumnName("TTIA_CustomerId");

                    b.Property<string>("TtiaEquipmentProvider")
                        .HasMaxLength(10)
                        .HasColumnType("nvarchar(10)")
                        .HasColumnName("TTIA_EquipmentProvider");

                    b.Property<string>("UpdatedBy")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<DateTime?>("UpdatedOn")
                        .HasColumnType("datetime");

                    b.HasKey("Id")
                        .HasName("PK_dbo.Customer");

                    b.ToTable("Customer", (string)null);
                });

            modelBuilder.Entity("EVCB_OCPP.Domain.Models.MainDb.LoadingBalance", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<DateTime>("CreatedOn")
                        .HasColumnType("datetime");

                    b.Property<DateTime>("FinishedOn")
                        .HasColumnType("datetime");

                    b.Property<string>("MachineId")
                        .IsRequired()
                        .HasMaxLength(36)
                        .HasColumnType("nvarchar(36)");

                    b.Property<decimal>("Power")
                        .HasColumnType("decimal(10, 2)");

                    b.Property<int>("StationId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.ToTable("LoadingBalance", (string)null);
                });

            modelBuilder.Entity("EVCB_OCPP.Domain.Models.MainDb.Machine", b =>
                {
                    b.Property<string>("Id")
                        .HasMaxLength(36)
                        .HasColumnType("nvarchar(36)");

                    b.Property<string>("BoardVersions")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ChargeBoxId")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<string>("ChargeBoxSerialNumber")
                        .HasMaxLength(25)
                        .HasColumnType("nvarchar(25)");

                    b.Property<string>("ChargePointModel")
                        .HasMaxLength(20)
                        .HasColumnType("nvarchar(20)");

                    b.Property<string>("ChargePointSerialNumber")
                        .HasMaxLength(25)
                        .HasColumnType("nvarchar(25)");

                    b.Property<string>("ChargePointVendor")
                        .HasMaxLength(20)
                        .HasColumnType("nvarchar(20)");

                    b.Property<string>("Comment")
                        .HasMaxLength(100)
                        .HasColumnType("nvarchar(100)");

                    b.Property<int>("ConnectionType")
                        .HasColumnType("int");

                    b.Property<string>("ConnectorPowerType")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<string>("ConnectorType")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<DateTime>("CreatedOn")
                        .HasColumnType("datetime");

                    b.Property<Guid>("CustomerId")
                        .HasColumnType("uniqueidentifier");

                    b.Property<int?>("FwAssignedVersion")
                        .HasColumnType("int")
                        .HasColumnName("FW_AssignedVersion");

                    b.Property<string>("FwCurrentVersion")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)")
                        .HasColumnName("FW_CurrentVersion");

                    b.Property<int?>("FwVersionReport")
                        .HasColumnType("int")
                        .HasColumnName("FW_VersionReport");

                    b.Property<int>("GunAmt")
                        .HasColumnType("int");

                    b.Property<DateTime>("HeartbeatUpdatedOn")
                        .HasColumnType("datetime");

                    b.Property<string>("Iccid")
                        .HasMaxLength(20)
                        .HasColumnType("nvarchar(20)");

                    b.Property<string>("Imsi")
                        .HasMaxLength(20)
                        .HasColumnType("nvarchar(20)");

                    b.Property<bool>("IsDelete")
                        .HasColumnType("bit");

                    b.Property<decimal>("Latitude")
                        .HasColumnType("decimal(10, 6)");

                    b.Property<decimal>("Longitude")
                        .HasColumnType("decimal(10, 6)");

                    b.Property<string>("MeterSerialNumber")
                        .HasMaxLength(25)
                        .HasColumnType("nvarchar(25)");

                    b.Property<string>("MeterType")
                        .HasMaxLength(25)
                        .HasColumnType("nvarchar(25)");

                    b.Property<string>("ModelName")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)")
                        .HasDefaultValueSql("('')");

                    b.Property<DateTime?>("OfflineOn")
                        .HasColumnType("datetime");

                    b.Property<bool>("Online")
                        .HasColumnType("bit");

                    b.Property<decimal>("RatedPower")
                        .HasColumnType("decimal(6, 2)");

                    b.Property<int>("Ttiatag")
                        .HasColumnType("int")
                        .HasColumnName("TTIATag");

                    b.Property<string>("VendorId")
                        .ValueGeneratedOnAdd()
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)")
                        .HasDefaultValueSql("('Zerova')");

                    b.HasKey("Id")
                        .HasName("PK_dbo.Machine");

                    b.HasIndex(new[] { "CustomerId", "ChargeBoxId" }, "nci_wi_Machine_7CD4A9D1688F96F6967B2244A0666F62");

                    b.ToTable("Machine", (string)null);
                });

            modelBuilder.Entity("EVCB_OCPP.Domain.Models.MainDb.MachineConfiguration", b =>
                {
                    b.Property<string>("ConfigureName")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<string>("ChargeBoxId")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<string>("ConfigureSetting")
                        .HasMaxLength(500)
                        .HasColumnType("nvarchar(500)");

                    b.Property<bool>("Exists")
                        .HasColumnType("bit");

                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<bool>("ReadOnly")
                        .HasColumnType("bit");

                    b.HasKey("ConfigureName", "ChargeBoxId")
                        .HasName("PK_dbo.MachineConfigurations");

                    b.HasIndex(new[] { "ConfigureName", "ConfigureSetting" }, "nci_wi_MachineConfigurations_132E765C043BF95A2570D2EA019DD783");

                    b.ToTable("MachineConfigurations");
                });

            modelBuilder.Entity("EVCB_OCPP.Domain.Models.MainDb.MachineError", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("ChargeBoxId")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<byte>("ConnectorId")
                        .HasColumnType("tinyint");

                    b.Property<DateTime>("CreatedOn")
                        .HasColumnType("datetime");

                    b.Property<int>("ErrorCodeId")
                        .HasColumnType("int");

                    b.Property<string>("ErrorInfo")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<int>("PreStatus")
                        .HasColumnType("int");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<string>("VendorErrorCode")
                        .HasMaxLength(100)
                        .HasColumnType("nvarchar(100)");

                    b.Property<string>("VendorId")
                        .HasMaxLength(255)
                        .HasColumnType("nvarchar(255)");

                    b.HasKey("Id")
                        .HasName("PK_dbo.MachineError");

                    b.ToTable("MachineError", (string)null);
                });

            modelBuilder.Entity("EVCB_OCPP.Domain.Models.MainDb.MachineOperateRecord", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Action")
                        .HasMaxLength(30)
                        .HasColumnType("nvarchar(30)");

                    b.Property<string>("ChargeBoxId")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<DateTime>("CreatedOn")
                        .HasColumnType("datetime");

                    b.Property<int>("EvseStatus")
                        .HasColumnType("int")
                        .HasColumnName("EVSE_Status");

                    b.Property<string>("EvseValue")
                        .HasColumnType("nvarchar(max)")
                        .HasColumnName("EVSE_Value");

                    b.Property<DateTime>("FinishedOn")
                        .HasColumnType("datetime");

                    b.Property<DateTime>("ReportedOn")
                        .HasColumnType("datetime");

                    b.Property<string>("RequestContent")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("RequestType")
                        .HasColumnType("int");

                    b.Property<string>("SerialNo")
                        .HasMaxLength(36)
                        .HasColumnType("nvarchar(36)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.HasKey("Id")
                        .HasName("PK_dbo.MachineOperateRecord");

                    b.ToTable("MachineOperateRecord", (string)null);
                });

            modelBuilder.Entity("EVCB_OCPP.Domain.Models.MainDb.MachineVersionFile", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("ChargeBoxId")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<DateTime>("CreatedOn")
                        .HasColumnType("datetime");

                    b.Property<int>("Seq")
                        .HasColumnType("int");

                    b.Property<string>("UploadFileId")
                        .IsRequired()
                        .HasMaxLength(36)
                        .HasColumnType("nvarchar(36)");

                    b.HasKey("Id")
                        .HasName("PK_dbo.MachineVersionFile");

                    b.HasIndex("UploadFileId");

                    b.ToTable("MachineVersionFile", (string)null);
                });

            modelBuilder.Entity("EVCB_OCPP.Domain.Models.MainDb.MigrationHistory", b =>
                {
                    b.Property<string>("MigrationId")
                        .HasMaxLength(150)
                        .HasColumnType("nvarchar(150)");

                    b.Property<string>("ContextKey")
                        .HasMaxLength(300)
                        .HasColumnType("nvarchar(300)");

                    b.Property<byte[]>("Model")
                        .IsRequired()
                        .HasColumnType("varbinary(max)");

                    b.Property<string>("ProductVersion")
                        .IsRequired()
                        .HasMaxLength(32)
                        .HasColumnType("nvarchar(32)");

                    b.HasKey("MigrationId", "ContextKey")
                        .HasName("PK_dbo.__MigrationHistory");

                    b.ToTable("__MigrationHistory", (string)null);
                });

            modelBuilder.Entity("EVCB_OCPP.Domain.Models.MainDb.Ocmf", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("DataString")
                        .HasMaxLength(2048)
                        .HasColumnType("nvarchar(2048)");

                    b.Property<string>("PublicKey")
                        .HasMaxLength(256)
                        .HasColumnType("nvarchar(256)");

                    b.Property<int>("TransactionId")
                        .HasColumnType("int");

                    b.HasKey("Id")
                        .HasName("PK_dbo.OCMF");

                    b.ToTable("OCMF", (string)null);
                });

            modelBuilder.Entity("EVCB_OCPP.Domain.Models.MainDb.ServerMessage", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("ChargeBoxId")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(36)
                        .HasColumnType("nvarchar(36)");

                    b.Property<DateTime>("CreatedOn")
                        .HasColumnType("datetime");

                    b.Property<string>("InMessage")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("OutAction")
                        .HasMaxLength(30)
                        .HasColumnType("nvarchar(30)");

                    b.Property<string>("OutRequest")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("ReceivedOn")
                        .HasColumnType("datetime");

                    b.Property<string>("SerialNo")
                        .HasMaxLength(36)
                        .HasColumnType("nvarchar(36)");

                    b.Property<DateTime>("UpdatedOn")
                        .HasColumnType("datetime");

                    b.HasKey("Id")
                        .HasName("PK_dbo.ServerMessage");

                    b.HasIndex(new[] { "ReceivedOn", "UpdatedOn", "CreatedOn" }, "nci_wi_ServerMessage_EC00C205420F6CB01974705B93F9507F");

                    b.ToTable("ServerMessage", (string)null);
                });

            modelBuilder.Entity("EVCB_OCPP.Domain.Models.MainDb.TransactionRecord", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<bool>("BillingDone")
                        .HasColumnType("bit");

                    b.Property<string>("ChargeBoxId")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<byte>("ConnectorId")
                        .HasColumnType("tinyint");

                    b.Property<decimal>("Cost")
                        .HasColumnType("decimal(18, 2)");

                    b.Property<DateTime>("CreatedOn")
                        .HasColumnType("datetime");

                    b.Property<Guid>("CustomerId")
                        .HasColumnType("uniqueidentifier");

                    b.Property<string>("ErrorMsg")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Evccid")
                        .HasMaxLength(30)
                        .HasColumnType("nvarchar(30)")
                        .HasColumnName("EVCCID");

                    b.Property<string>("Fee")
                        .HasMaxLength(1500)
                        .HasColumnType("nvarchar(1500)");

                    b.Property<decimal>("MeterStart")
                        .HasColumnType("decimal(18, 2)");

                    b.Property<decimal>("MeterStop")
                        .HasColumnType("decimal(18, 2)");

                    b.Property<bool>("NotifyPnC")
                        .HasColumnType("bit");

                    b.Property<string>("Receipt")
                        .HasMaxLength(3000)
                        .HasColumnType("nvarchar(3000)");

                    b.Property<int>("ReservationId")
                        .HasColumnType("int");

                    b.Property<int>("RetryStartTransactionTimes")
                        .HasColumnType("int");

                    b.Property<int>("RetryStopTransactionTimes")
                        .HasColumnType("int");

                    b.Property<string>("StartIdTag")
                        .HasMaxLength(20)
                        .HasColumnType("nvarchar(20)");

                    b.Property<string>("StartSoc")
                        .HasMaxLength(3)
                        .HasColumnType("nvarchar(3)")
                        .HasColumnName("StartSOC");

                    b.Property<DateTime>("StartTime")
                        .HasColumnType("datetime");

                    b.Property<DateTime>("StartTransactionReportedOn")
                        .HasColumnType("datetime");

                    b.Property<string>("StopIdTag")
                        .HasMaxLength(20)
                        .HasColumnType("nvarchar(20)");

                    b.Property<string>("StopReason")
                        .HasMaxLength(60)
                        .HasColumnType("nvarchar(60)");

                    b.Property<int>("StopReasonId")
                        .HasColumnType("int");

                    b.Property<string>("StopSoc")
                        .HasMaxLength(3)
                        .HasColumnType("nvarchar(3)")
                        .HasColumnName("StopSOC");

                    b.Property<DateTime>("StopTime")
                        .HasColumnType("datetime");

                    b.Property<DateTime>("StopTransactionReportedOn")
                        .HasColumnType("datetime");

                    b.Property<DateTime>("UpdatedOn")
                        .HasColumnType("datetime");

                    b.Property<bool>("UploadedtoTtia")
                        .HasColumnType("bit")
                        .HasColumnName("UploadedtoTTIA");

                    b.HasKey("Id")
                        .HasName("PK_dbo.TransactionRecord");

                    b.HasIndex(new[] { "CustomerId", "ConnectorId", "StartTime", "ChargeBoxId" }, "IX_TransactionRecord_StartTime");

                    b.HasIndex(new[] { "CustomerId", "StopTransactionReportedOn", "StopTime" }, "nci_wi_TransactionRecord_92D4DF08E7034102014AC91760F890FE");

                    b.ToTable("TransactionRecord", (string)null);
                });

            modelBuilder.Entity("EVCB_OCPP.Domain.Models.MainDb.UploadFile", b =>
                {
                    b.Property<string>("Id")
                        .HasMaxLength(36)
                        .HasColumnType("nvarchar(36)");

                    b.Property<string>("CreatedBy")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<DateTime>("CreatedOn")
                        .HasColumnType("datetime");

                    b.Property<string>("FileExtensionName")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<string>("FileMd5")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)")
                        .HasColumnName("FileMD5");

                    b.Property<string>("FileName")
                        .IsRequired()
                        .HasMaxLength(500)
                        .HasColumnType("nvarchar(500)");

                    b.Property<string>("FilePath")
                        .IsRequired()
                        .HasMaxLength(500)
                        .HasColumnType("nvarchar(500)");

                    b.Property<int>("FileSize")
                        .HasColumnType("int");

                    b.Property<string>("FileType")
                        .HasMaxLength(200)
                        .HasColumnType("nvarchar(200)");

                    b.Property<string>("FileUrl")
                        .HasMaxLength(512)
                        .HasColumnType("nvarchar(512)");

                    b.Property<string>("ModelName")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<int>("ModuleId")
                        .HasColumnType("int");

                    b.Property<string>("OriginName")
                        .IsRequired()
                        .HasMaxLength(500)
                        .HasColumnType("nvarchar(500)");

                    b.Property<string>("VendorId")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.HasKey("Id")
                        .HasName("PK_dbo.UploadFile");

                    b.ToTable("UploadFile", (string)null);
                });

            modelBuilder.Entity("EVCB_OCPP.Domain.Models.MainDb.VConnectorStatus", b =>
                {
                    b.Property<string>("ChargeBoxId")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<int>("ChargePointErrorCodeId")
                        .HasColumnType("int");

                    b.Property<byte>("ConnectorId")
                        .HasColumnType("tinyint");

                    b.Property<DateTime>("CreatedOn")
                        .HasColumnType("datetime");

                    b.Property<string>("ErrorInfo")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<string>("Id")
                        .IsRequired()
                        .HasMaxLength(36)
                        .HasColumnType("nvarchar(36)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<decimal>("TotalEnergy")
                        .HasColumnType("decimal(10, 2)");

                    b.Property<int>("Type")
                        .HasColumnType("int");

                    b.Property<string>("VendorErrorCode")
                        .HasMaxLength(100)
                        .HasColumnType("nvarchar(100)");

                    b.Property<string>("VendorId")
                        .HasMaxLength(255)
                        .HasColumnType("nvarchar(255)");

                    b.ToTable((string)null);

                    b.ToView("vConnectorStatus", (string)null);
                });

            modelBuilder.Entity("EVCB_OCPP.Domain.Models.MainDb.VConnectorStatusCombind", b =>
                {
                    b.Property<string>("ChargeBoxId")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<int>("ChargePointErrorCodeId")
                        .HasColumnType("int");

                    b.Property<byte>("ConnectorId")
                        .HasColumnType("tinyint");

                    b.Property<string>("Ocpp")
                        .IsRequired()
                        .HasMaxLength(3)
                        .IsUnicode(false)
                        .HasColumnType("varchar(3)")
                        .HasColumnName("OCPP");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<decimal>("TotalEnergy")
                        .HasColumnType("decimal(10, 2)");

                    b.Property<int>("Type")
                        .HasColumnType("int");

                    b.Property<string>("VendorErrorCode")
                        .HasMaxLength(100)
                        .HasColumnType("nvarchar(100)");

                    b.ToTable((string)null);

                    b.ToView("vConnectorStatusCombind", (string)null);
                });

            modelBuilder.Entity("EVCB_OCPP.Domain.Models.MainDb.VMachine", b =>
                {
                    b.Property<string>("ChargeBoxId")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<int>("ConnectionType")
                        .HasColumnType("int");

                    b.Property<string>("ConnectorType")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<Guid>("CustomerId")
                        .HasColumnType("uniqueidentifier");

                    b.Property<int>("GunAmt")
                        .HasColumnType("int");

                    b.Property<DateTime>("HeartbeatUpdatedOn")
                        .HasColumnType("datetime");

                    b.Property<string>("Id")
                        .IsRequired()
                        .HasMaxLength(36)
                        .HasColumnType("nvarchar(36)");

                    b.Property<bool>("IsDelete")
                        .HasColumnType("bit");

                    b.Property<string>("ModelName")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<DateTime?>("OfflineOn")
                        .HasColumnType("datetime");

                    b.Property<bool>("Online")
                        .HasColumnType("bit");

                    b.Property<decimal>("RatedPower")
                        .HasColumnType("decimal(6, 2)");

                    b.Property<int>("Ttiatag")
                        .HasColumnType("int")
                        .HasColumnName("TTIATag");

                    b.Property<string>("VendorId")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.ToTable((string)null);

                    b.ToView("vMachine", (string)null);
                });

            modelBuilder.Entity("EVCB_OCPP.Domain.Models.MainDb.VMachineCombind", b =>
                {
                    b.Property<string>("ChargeBoxId")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<int>("ConnectionType")
                        .HasColumnType("int");

                    b.Property<string>("ConnectorType")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<Guid>("CustomerId")
                        .HasColumnType("uniqueidentifier");

                    b.Property<int>("GunAmt")
                        .HasColumnType("int");

                    b.Property<DateTime>("HeartbeatUpdatedOn")
                        .HasColumnType("datetime");

                    b.Property<string>("Id")
                        .IsRequired()
                        .HasMaxLength(36)
                        .HasColumnType("nvarchar(36)");

                    b.Property<bool>("IsDelete")
                        .HasColumnType("bit");

                    b.Property<string>("ModelName")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<string>("Ocpp")
                        .IsRequired()
                        .HasMaxLength(3)
                        .IsUnicode(false)
                        .HasColumnType("varchar(3)")
                        .HasColumnName("OCPP");

                    b.Property<DateTime?>("OfflineOn")
                        .HasColumnType("datetime");

                    b.Property<bool>("Online")
                        .HasColumnType("bit");

                    b.Property<decimal>("RatedPower")
                        .HasColumnType("decimal(6, 2)");

                    b.Property<int>("Ttiatag")
                        .HasColumnType("int")
                        .HasColumnName("TTIATag");

                    b.Property<string>("VendorId")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.ToTable((string)null);

                    b.ToView("vMachineCombind", (string)null);
                });

            modelBuilder.Entity("EVCB_OCPP.Domain.Models.MainDb.Machine", b =>
                {
                    b.HasOne("EVCB_OCPP.Domain.Models.MainDb.Customer", "Customer")
                        .WithMany("Machines")
                        .HasForeignKey("CustomerId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("FK_dbo.Machine_dbo.Customer_CustomerId");

                    b.Navigation("Customer");
                });

            modelBuilder.Entity("EVCB_OCPP.Domain.Models.MainDb.MachineVersionFile", b =>
                {
                    b.HasOne("EVCB_OCPP.Domain.Models.MainDb.UploadFile", "UploadFile")
                        .WithMany("MachineVersionFiles")
                        .HasForeignKey("UploadFileId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("FK_dbo.MachineVersionFile_dbo.UploadFile_UploadFileId");

                    b.Navigation("UploadFile");
                });

            modelBuilder.Entity("EVCB_OCPP.Domain.Models.MainDb.Customer", b =>
                {
                    b.Navigation("Machines");
                });

            modelBuilder.Entity("EVCB_OCPP.Domain.Models.MainDb.UploadFile", b =>
                {
                    b.Navigation("MachineVersionFiles");
                });
#pragma warning restore 612, 618
        }
    }
}