Sfoglia il codice sorgente

scafffold from EBUS DB

Robert 1 anno fa
parent
commit
04c17ffcc9
23 ha cambiato i file con 85 aggiunte e 5215 eliminazioni
  1. 18 6
      EVCB_OCPP.Domain/ConnectionLogDBContext.cs
  2. 3 0
      EVCB_OCPP.Domain/EVCB_OCPP.Domain.csproj
  3. 4 24
      EVCB_OCPP.Domain/MainDBContext.cs
  4. 20 3
      EVCB_OCPP.Domain/MeterValueDBContext.cs
  5. 0 1074
      EVCB_OCPP.Domain/Migrations/20231019085717_InitialCreate.Designer.cs
  6. 0 438
      EVCB_OCPP.Domain/Migrations/20231019085717_InitialCreate.cs
  7. 0 1077
      EVCB_OCPP.Domain/Migrations/20231019090745_Updatetest.Designer.cs
  8. 0 28
      EVCB_OCPP.Domain/Migrations/20231019090745_Updatetest.cs
  9. 0 1074
      EVCB_OCPP.Domain/Migrations/20231019090908_RemoveUpdatetest.Designer.cs
  10. 0 28
      EVCB_OCPP.Domain/Migrations/20231019090908_RemoveUpdatetest.cs
  11. 0 75
      EVCB_OCPP.Domain/Migrations/ConnectionLogDB/20231019091533_InitialCreate.Designer.cs
  12. 0 42
      EVCB_OCPP.Domain/Migrations/ConnectionLogDB/20231019091533_InitialCreate.cs
  13. 0 72
      EVCB_OCPP.Domain/Migrations/ConnectionLogDB/ConnectionLogDBContextModelSnapshot.cs
  14. 0 1071
      EVCB_OCPP.Domain/Migrations/MainDBContextModelSnapshot.cs
  15. 0 74
      EVCB_OCPP.Domain/Migrations/MeterValueDB/20231019091245_InitialCreate.Designer.cs
  16. 0 43
      EVCB_OCPP.Domain/Migrations/MeterValueDB/20231019091245_InitialCreate.cs
  17. 0 71
      EVCB_OCPP.Domain/Migrations/MeterValueDB/MeterValueDBContextModelSnapshot.cs
  18. 15 0
      EVCB_OCPP.Domain/Models/ConnectionLogDB/MigrationHistory.cs
  19. 0 1
      EVCB_OCPP.Domain/Models/MainDb/MachineOperateRecord.cs
  20. 1 0
      EVCB_OCPP.Domain/Models/MainDb/ServerMessage.cs
  21. 5 10
      EVCB_OCPP.Domain/Models/MainDb/TransactionRecord.cs
  22. 15 0
      EVCB_OCPP.Domain/Models/MeterValueDb/MigrationHistory.cs
  23. 4 4
      migration_commands.txt

+ 18 - 6
EVCB_OCPP.Domain/ConnectionLogDBContext.cs

@@ -18,9 +18,7 @@ public partial class ConnectionLogDBContext : DbContext
 
     public virtual DbSet<MachineConnectionLog> MachineConnectionLogs { get; set; }
 
-//    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
-//#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
-//        => optionsBuilder.UseSqlServer("data source=zerova-ev-dev.database.windows.net;initial catalog=StandardOCPP_ConnectionLog;persist security info=True;user id=azdevsoftware;password=1h52dev#az;MultipleActiveResultSets=True;App=EntityFramework");
+    public virtual DbSet<MigrationHistory> MigrationHistories { get; set; }
 
     protected override void OnModelCreating(ModelBuilder modelBuilder)
     {
@@ -28,13 +26,12 @@ public partial class ConnectionLogDBContext : DbContext
 
         modelBuilder.Entity<MachineConnectionLog>(entity =>
         {
-            entity.HasKey(e => new { e.Id, e.CreatedOn });
+            entity.HasKey(e => e.Id).HasName("PK_dbo.MachineConnectionLog");
 
             entity.ToTable("MachineConnectionLog");
 
-            entity.Property(e => e.Id).ValueGeneratedOnAdd();
-            entity.Property(e => e.CreatedOn).HasColumnType("datetime");
             entity.Property(e => e.ChargeBoxId).HasMaxLength(128);
+            entity.Property(e => e.CreatedOn).HasColumnType("datetime");
             entity.Property(e => e.Data).HasMaxLength(3600);
             entity.Property(e => e.EvseendPoint)
                 .HasMaxLength(25)
@@ -44,6 +41,21 @@ public partial class ConnectionLogDBContext : DbContext
             entity.Property(e => e.Session).HasMaxLength(36);
         });
 
+
+        modelBuilder.Entity<MigrationHistory>(entity =>
+        {
+            entity.HasKey(e => new { e.MigrationId, e.ContextKey }).HasName("PK_dbo.__MigrationHistory");
+
+            entity.ToTable("__MigrationHistory");
+
+            entity.Property(e => e.MigrationId).HasMaxLength(150);
+            entity.Property(e => e.ContextKey).HasMaxLength(300);
+            entity.Property(e => e.Model).IsRequired();
+            entity.Property(e => e.ProductVersion)
+                .IsRequired()
+                .HasMaxLength(32);
+        });
+
         OnModelCreatingPartial(modelBuilder);
     }
 

+ 3 - 0
EVCB_OCPP.Domain/EVCB_OCPP.Domain.csproj

@@ -27,6 +27,9 @@
     <Content Include="Doc\ReadMe.txt" />
     <Content Include="StoredProcedure\uspInsertMachineConnectionLog.sql" />
   </ItemGroup>
+  <ItemGroup>
+    <Folder Include="Models\" />
+  </ItemGroup>
   <PropertyGroup>
     <PreBuildEvent>GitVersion.exe $(ProjectDir) /updateassemblyinfo</PreBuildEvent>
   </PropertyGroup>

+ 4 - 24
EVCB_OCPP.Domain/MainDBContext.cs

@@ -52,10 +52,6 @@ public partial class MainDBContext : DbContext
 
     public virtual DbSet<VMachineCombind> VMachineCombinds { get; set; }
 
-//    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
-//#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
-//        => optionsBuilder.UseSqlServer("data source=zerova-ev-dev.database.windows.net;initial catalog=StandardOCPP_Main;persist security info=True;user id=azdevsoftware;password=1h52dev#az;MultipleActiveResultSets=True;App=EntityFramework");
-
     protected override void OnModelCreating(ModelBuilder modelBuilder)
     {
         modelBuilder.UseCollation("Chinese_Taiwan_Stroke_CI_AS");
@@ -77,8 +73,6 @@ public partial class MainDBContext : DbContext
 
             entity.ToTable("ConnectorStatus");
 
-            entity.HasIndex(e => new { e.ChargeBoxId, e.ConnectorId }, "IX_ConnectorStatus").IsUnique();
-
             entity.Property(e => e.Id).HasMaxLength(36);
             entity.Property(e => e.ChargeBoxId).HasMaxLength(50);
             entity.Property(e => e.CreatedOn).HasColumnType("datetime");
@@ -116,10 +110,10 @@ public partial class MainDBContext : DbContext
             entity.Property(e => e.Name).HasMaxLength(50);
             entity.Property(e => e.PartnerId).HasMaxLength(36);
             entity.Property(e => e.TtiaApikey)
-                .HasMaxLength(10)
+                .HasMaxLength(12)
                 .HasColumnName("TTIA_APIKey");
             entity.Property(e => e.TtiaApiurl)
-                .HasMaxLength(100)
+                .HasMaxLength(110)
                 .HasColumnName("TTIA_APIUrl");
             entity.Property(e => e.TtiaCustomerId).HasColumnName("TTIA_CustomerId");
             entity.Property(e => e.TtiaEquipmentProvider)
@@ -147,8 +141,6 @@ public partial class MainDBContext : DbContext
 
             entity.ToTable("Machine");
 
-            entity.HasIndex(e => new { e.CustomerId, e.ChargeBoxId }, "nci_wi_Machine_7CD4A9D1688F96F6967B2244A0666F62");
-
             entity.Property(e => e.Id).HasMaxLength(36);
             entity.Property(e => e.ChargeBoxId).HasMaxLength(50);
             entity.Property(e => e.ChargeBoxSerialNumber).HasMaxLength(25);
@@ -190,14 +182,11 @@ public partial class MainDBContext : DbContext
 
         modelBuilder.Entity<MachineConfiguration>(entity =>
         {
-            entity.HasKey(e => new { e.ConfigureName, e.ChargeBoxId }).HasName("PK_dbo.MachineConfigurations");
-
-            entity.HasIndex(e => new { e.ConfigureName, e.ConfigureSetting }, "nci_wi_MachineConfigurations_132E765C043BF95A2570D2EA019DD783");
+            entity.HasKey(e => e.Id).HasName("PK_dbo.MachineConfigurations");
 
-            entity.Property(e => e.ConfigureName).HasMaxLength(50);
             entity.Property(e => e.ChargeBoxId).HasMaxLength(50);
+            entity.Property(e => e.ConfigureName).HasMaxLength(50);
             entity.Property(e => e.ConfigureSetting).HasMaxLength(500);
-            entity.Property(e => e.Id).ValueGeneratedOnAdd();
         });
 
         modelBuilder.Entity<MachineError>(entity =>
@@ -276,8 +265,6 @@ public partial class MainDBContext : DbContext
 
             entity.ToTable("ServerMessage");
 
-            entity.HasIndex(e => new { e.ReceivedOn, e.UpdatedOn, e.CreatedOn }, "nci_wi_ServerMessage_EC00C205420F6CB01974705B93F9507F");
-
             entity.Property(e => e.ChargeBoxId).HasMaxLength(50);
             entity.Property(e => e.CreatedBy).HasMaxLength(36);
             entity.Property(e => e.CreatedOn).HasColumnType("datetime");
@@ -293,18 +280,11 @@ public partial class MainDBContext : DbContext
 
             entity.ToTable("TransactionRecord");
 
-            entity.HasIndex(e => new { e.CustomerId, e.ConnectorId, e.StartTime, e.ChargeBoxId }, "IX_TransactionRecord_StartTime");
-
-            entity.HasIndex(e => new { e.CustomerId, e.StopTransactionReportedOn, e.StopTime }, "nci_wi_TransactionRecord_92D4DF08E7034102014AC91760F890FE");
-
             entity.Property(e => e.ChargeBoxId)
                 .IsRequired()
                 .HasMaxLength(50);
             entity.Property(e => e.Cost).HasColumnType("decimal(18, 2)");
             entity.Property(e => e.CreatedOn).HasColumnType("datetime");
-            entity.Property(e => e.Evccid)
-                .HasMaxLength(30)
-                .HasColumnName("EVCCID");
             entity.Property(e => e.Fee).HasMaxLength(1500);
             entity.Property(e => e.MeterStart).HasColumnType("decimal(18, 2)");
             entity.Property(e => e.MeterStop).HasColumnType("decimal(18, 2)");

+ 20 - 3
EVCB_OCPP.Domain/MeterValueDBContext.cs

@@ -16,10 +16,9 @@ public partial class MeterValueDBContext : DbContext
     {
     }
 
-//    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
-//#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
-//        => optionsBuilder.UseSqlServer("data source=zerova-ev-dev.database.windows.net;initial catalog=StandardOCPP_MeterValue;persist security info=True;user id=azdevsoftware;password=1h52dev#az;MultipleActiveResultSets=True;App=EntityFramework");
+    public virtual DbSet<ConnectorMeterValueRecord> ConnectorMeterValueRecords { get; set; }
 
+    public virtual DbSet<MigrationHistory> MigrationHistories { get; set; }
     protected override void OnModelCreating(ModelBuilder modelBuilder)
     {
         modelBuilder.UseCollation("Chinese_Taiwan_Stroke_CI_AS");
@@ -35,6 +34,24 @@ public partial class MeterValueDBContext : DbContext
             entity.Property(e => e.Value).HasMaxLength(10);
         });
 
+        modelBuilder.Entity<MigrationHistory>(entity =>
+        {
+            entity
+                .HasNoKey()
+                .ToTable("__MigrationHistory");
+
+            entity.Property(e => e.ContextKey)
+                .IsRequired()
+                .HasMaxLength(300);
+            entity.Property(e => e.MigrationId)
+                .IsRequired()
+                .HasMaxLength(150);
+            entity.Property(e => e.Model).IsRequired();
+            entity.Property(e => e.ProductVersion)
+                .IsRequired()
+                .HasMaxLength(32);
+        });
+
         OnModelCreatingPartial(modelBuilder);
     }
 

+ 0 - 1074
EVCB_OCPP.Domain/Migrations/20231019085717_InitialCreate.Designer.cs

@@ -1,1074 +0,0 @@
-// <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
-        }
-    }
-}

+ 0 - 438
EVCB_OCPP.Domain/Migrations/20231019085717_InitialCreate.cs

@@ -1,438 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace EVCB_OCPP.Domain.Migrations
-{
-    /// <inheritdoc />
-    public partial class InitialCreate : Migration
-    {
-        /// <inheritdoc />
-        protected override void Up(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.CreateTable(
-                name: "__MigrationHistory",
-                columns: table => new
-                {
-                    MigrationId = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: false),
-                    ContextKey = table.Column<string>(type: "nvarchar(300)", maxLength: 300, nullable: false),
-                    Model = table.Column<byte[]>(type: "varbinary(max)", nullable: false),
-                    ProductVersion = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_dbo.__MigrationHistory", x => new { x.MigrationId, x.ContextKey });
-                });
-
-            migrationBuilder.CreateTable(
-                name: "ConnectorMeterValueRecord",
-                columns: table => new
-                {
-                    Id = table.Column<long>(type: "bigint", nullable: false)
-                        .Annotation("SqlServer:Identity", "1, 1"),
-                    ConnectorId = table.Column<byte>(type: "tinyint", nullable: false),
-                    Value = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
-                    CreatedOn = table.Column<DateTime>(type: "datetime", nullable: false),
-                    ContextId = table.Column<int>(type: "int", nullable: false),
-                    FormatId = table.Column<int>(type: "int", nullable: false),
-                    MeasurandId = table.Column<int>(type: "int", nullable: false),
-                    PhaseId = table.Column<int>(type: "int", nullable: false),
-                    LocationId = table.Column<int>(type: "int", nullable: false),
-                    UnitId = table.Column<int>(type: "int", nullable: false),
-                    ChargeBoxId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
-                    TransactionId = table.Column<int>(type: "int", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_dbo.ConnectorMeterValueRecord", x => x.Id);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "ConnectorStatus",
-                columns: table => new
-                {
-                    Id = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
-                    ConnectorId = table.Column<byte>(type: "tinyint", nullable: false),
-                    Status = table.Column<int>(type: "int", nullable: false),
-                    ErrorInfo = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
-                    VendorId = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
-                    CreatedOn = table.Column<DateTime>(type: "datetime", nullable: false),
-                    VendorErrorCode = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
-                    ChargePointErrorCodeId = table.Column<int>(type: "int", nullable: false),
-                    ChargeBoxId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
-                    TotalEnergy = table.Column<decimal>(type: "decimal(10,2)", nullable: false),
-                    Type = table.Column<int>(type: "int", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_dbo.ConnectorStatus", x => x.Id);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "Customer",
-                columns: table => new
-                {
-                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
-                    Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
-                    CreatedOn = table.Column<DateTime>(type: "datetime", nullable: false),
-                    CreatedBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
-                    Deadline = table.Column<DateTime>(type: "datetime", nullable: true),
-                    UpdatedOn = table.Column<DateTime>(type: "datetime", nullable: true),
-                    UpdatedBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
-                    ApiUrl = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
-                    ApiKey = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
-                    ApiKeyUpdatedOn = table.Column<DateTime>(type: "datetime", nullable: true),
-                    PartnerId = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
-                    ApiCustomerId = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
-                    CallPartnerApiOnSchedule = table.Column<bool>(type: "bit", nullable: false),
-                    IsShow = table.Column<bool>(type: "bit", nullable: false),
-                    FTPPath = table.Column<string>(type: "nvarchar(max)", nullable: true),
-                    FTPHost = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
-                    FTPUser = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
-                    FTPPassword = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
-                    EnableTTIA = table.Column<bool>(type: "bit", nullable: false),
-                    TTIA_EquipmentProvider = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
-                    TTIA_CustomerId = table.Column<int>(type: "int", nullable: false),
-                    TTIA_APIUrl = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
-                    TTIA_APIKey = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
-                    InstantStopTxReport = table.Column<bool>(type: "bit", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_dbo.Customer", x => x.Id);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "LoadingBalance",
-                columns: table => new
-                {
-                    Id = table.Column<long>(type: "bigint", nullable: false)
-                        .Annotation("SqlServer:Identity", "1, 1"),
-                    StationId = table.Column<int>(type: "int", nullable: false),
-                    MachineId = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
-                    Power = table.Column<decimal>(type: "decimal(10,2)", nullable: false),
-                    CreatedOn = table.Column<DateTime>(type: "datetime", nullable: false),
-                    FinishedOn = table.Column<DateTime>(type: "datetime", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_LoadingBalance", x => x.Id);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "MachineConfigurations",
-                columns: table => new
-                {
-                    ConfigureName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
-                    ChargeBoxId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
-                    Id = table.Column<int>(type: "int", nullable: false)
-                        .Annotation("SqlServer:Identity", "1, 1"),
-                    ConfigureSetting = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
-                    ReadOnly = table.Column<bool>(type: "bit", nullable: false),
-                    Exists = table.Column<bool>(type: "bit", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_dbo.MachineConfigurations", x => new { x.ConfigureName, x.ChargeBoxId });
-                });
-
-            migrationBuilder.CreateTable(
-                name: "MachineError",
-                columns: table => new
-                {
-                    Id = table.Column<int>(type: "int", nullable: false)
-                        .Annotation("SqlServer:Identity", "1, 1"),
-                    ConnectorId = table.Column<byte>(type: "tinyint", nullable: false),
-                    PreStatus = table.Column<int>(type: "int", nullable: false),
-                    Status = table.Column<int>(type: "int", nullable: false),
-                    ErrorInfo = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
-                    VendorId = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
-                    CreatedOn = table.Column<DateTime>(type: "datetime", nullable: false),
-                    ErrorCodeId = table.Column<int>(type: "int", nullable: false),
-                    VendorErrorCode = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
-                    ChargeBoxId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_dbo.MachineError", x => x.Id);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "MachineOperateRecord",
-                columns: table => new
-                {
-                    Id = table.Column<int>(type: "int", nullable: false)
-                        .Annotation("SqlServer:Identity", "1, 1"),
-                    SerialNo = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
-                    RequestType = table.Column<int>(type: "int", nullable: false),
-                    RequestContent = table.Column<string>(type: "nvarchar(max)", nullable: true),
-                    Status = table.Column<int>(type: "int", nullable: false),
-                    CreatedOn = table.Column<DateTime>(type: "datetime", nullable: false),
-                    FinishedOn = table.Column<DateTime>(type: "datetime", nullable: false),
-                    EVSE_Value = table.Column<string>(type: "nvarchar(max)", nullable: true),
-                    EVSE_Status = table.Column<int>(type: "int", nullable: false),
-                    ChargeBoxId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
-                    Action = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
-                    ReportedOn = table.Column<DateTime>(type: "datetime", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_dbo.MachineOperateRecord", x => x.Id);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "OCMF",
-                columns: table => new
-                {
-                    Id = table.Column<int>(type: "int", nullable: false)
-                        .Annotation("SqlServer:Identity", "1, 1"),
-                    TransactionId = table.Column<int>(type: "int", nullable: false),
-                    DataString = table.Column<string>(type: "nvarchar(2048)", maxLength: 2048, nullable: true),
-                    PublicKey = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_dbo.OCMF", x => x.Id);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "ServerMessage",
-                columns: table => new
-                {
-                    Id = table.Column<int>(type: "int", nullable: false)
-                        .Annotation("SqlServer:Identity", "1, 1"),
-                    SerialNo = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
-                    OutAction = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
-                    OutRequest = table.Column<string>(type: "nvarchar(max)", nullable: true),
-                    InMessage = table.Column<string>(type: "nvarchar(max)", nullable: true),
-                    CreatedOn = table.Column<DateTime>(type: "datetime", nullable: false),
-                    CreatedBy = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
-                    ReceivedOn = table.Column<DateTime>(type: "datetime", nullable: false),
-                    ChargeBoxId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
-                    UpdatedOn = table.Column<DateTime>(type: "datetime", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_dbo.ServerMessage", x => x.Id);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "TransactionRecord",
-                columns: table => new
-                {
-                    Id = table.Column<int>(type: "int", nullable: false)
-                        .Annotation("SqlServer:Identity", "1, 1"),
-                    StartTime = table.Column<DateTime>(type: "datetime", nullable: false),
-                    StopTime = table.Column<DateTime>(type: "datetime", nullable: false),
-                    CustomerId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
-                    ConnectorId = table.Column<byte>(type: "tinyint", nullable: false),
-                    MeterStart = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
-                    MeterStop = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
-                    CreatedOn = table.Column<DateTime>(type: "datetime", nullable: false),
-                    UpdatedOn = table.Column<DateTime>(type: "datetime", nullable: false),
-                    StartTransactionReportedOn = table.Column<DateTime>(type: "datetime", nullable: false),
-                    RetryStartTransactionTimes = table.Column<int>(type: "int", nullable: false),
-                    StopTransactionReportedOn = table.Column<DateTime>(type: "datetime", nullable: false),
-                    ErrorMsg = table.Column<string>(type: "nvarchar(max)", nullable: true),
-                    StartIdTag = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
-                    StopIdTag = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
-                    ReservationId = table.Column<int>(type: "int", nullable: false),
-                    StopReasonId = table.Column<int>(type: "int", nullable: false),
-                    ChargeBoxId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
-                    RetryStopTransactionTimes = table.Column<int>(type: "int", nullable: false),
-                    UploadedtoTTIA = table.Column<bool>(type: "bit", nullable: false),
-                    Cost = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
-                    Fee = table.Column<string>(type: "nvarchar(1500)", maxLength: 1500, nullable: true),
-                    Receipt = table.Column<string>(type: "nvarchar(3000)", maxLength: 3000, nullable: true),
-                    BillingDone = table.Column<bool>(type: "bit", nullable: false),
-                    StopReason = table.Column<string>(type: "nvarchar(60)", maxLength: 60, nullable: true),
-                    StartSOC = table.Column<string>(type: "nvarchar(3)", maxLength: 3, nullable: true),
-                    StopSOC = table.Column<string>(type: "nvarchar(3)", maxLength: 3, nullable: true),
-                    NotifyPnC = table.Column<bool>(type: "bit", nullable: false),
-                    EVCCID = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_dbo.TransactionRecord", x => x.Id);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "UploadFile",
-                columns: table => new
-                {
-                    Id = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
-                    FileName = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false),
-                    OriginName = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false),
-                    FileSize = table.Column<int>(type: "int", nullable: false),
-                    FileType = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
-                    FileExtensionName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
-                    FilePath = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false),
-                    CreatedOn = table.Column<DateTime>(type: "datetime", nullable: false),
-                    CreatedBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
-                    FileMD5 = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
-                    FileUrl = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
-                    VendorId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
-                    ModelName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
-                    ModuleId = table.Column<int>(type: "int", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_dbo.UploadFile", x => x.Id);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "Machine",
-                columns: table => new
-                {
-                    Id = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
-                    ChargePointSerialNumber = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
-                    ChargeBoxSerialNumber = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
-                    ChargePointModel = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
-                    ChargePointVendor = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
-                    Iccid = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
-                    Imsi = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
-                    MeterType = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
-                    MeterSerialNumber = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
-                    CreatedOn = table.Column<DateTime>(type: "datetime", nullable: false),
-                    CreatedBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
-                    Comment = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
-                    CustomerId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
-                    GunAmt = table.Column<int>(type: "int", nullable: false),
-                    HeartbeatUpdatedOn = table.Column<DateTime>(type: "datetime", nullable: false),
-                    FW_VersionReport = table.Column<int>(type: "int", nullable: true),
-                    FW_AssignedVersion = table.Column<int>(type: "int", nullable: true),
-                    Online = table.Column<bool>(type: "bit", nullable: false),
-                    OfflineOn = table.Column<DateTime>(type: "datetime", nullable: true),
-                    FW_CurrentVersion = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
-                    ChargeBoxId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
-                    ConnectionType = table.Column<int>(type: "int", nullable: false),
-                    RatedPower = table.Column<decimal>(type: "decimal(6,2)", nullable: false),
-                    ConnectorType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
-                    ConnectorPowerType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
-                    Latitude = table.Column<decimal>(type: "decimal(10,6)", nullable: false),
-                    Longitude = table.Column<decimal>(type: "decimal(10,6)", nullable: false),
-                    VendorId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, defaultValueSql: "('Zerova')"),
-                    ModelName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false, defaultValueSql: "('')"),
-                    BoardVersions = table.Column<string>(type: "nvarchar(max)", nullable: true),
-                    IsDelete = table.Column<bool>(type: "bit", nullable: false),
-                    TTIATag = table.Column<int>(type: "int", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_dbo.Machine", x => x.Id);
-                    table.ForeignKey(
-                        name: "FK_dbo.Machine_dbo.Customer_CustomerId",
-                        column: x => x.CustomerId,
-                        principalTable: "Customer",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "MachineVersionFile",
-                columns: table => new
-                {
-                    Id = table.Column<int>(type: "int", nullable: false)
-                        .Annotation("SqlServer:Identity", "1, 1"),
-                    CreatedOn = table.Column<DateTime>(type: "datetime", nullable: false),
-                    UploadFileId = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
-                    Seq = table.Column<int>(type: "int", nullable: false),
-                    ChargeBoxId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_dbo.MachineVersionFile", x => x.Id);
-                    table.ForeignKey(
-                        name: "FK_dbo.MachineVersionFile_dbo.UploadFile_UploadFileId",
-                        column: x => x.UploadFileId,
-                        principalTable: "UploadFile",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                });
-
-            migrationBuilder.CreateIndex(
-                name: "IX_ConnectorStatus",
-                table: "ConnectorStatus",
-                columns: new[] { "ChargeBoxId", "ConnectorId" },
-                unique: true,
-                filter: "[ChargeBoxId] IS NOT NULL");
-
-            migrationBuilder.CreateIndex(
-                name: "nci_wi_Machine_7CD4A9D1688F96F6967B2244A0666F62",
-                table: "Machine",
-                columns: new[] { "CustomerId", "ChargeBoxId" });
-
-            migrationBuilder.CreateIndex(
-                name: "nci_wi_MachineConfigurations_132E765C043BF95A2570D2EA019DD783",
-                table: "MachineConfigurations",
-                columns: new[] { "ConfigureName", "ConfigureSetting" });
-
-            migrationBuilder.CreateIndex(
-                name: "IX_MachineVersionFile_UploadFileId",
-                table: "MachineVersionFile",
-                column: "UploadFileId");
-
-            migrationBuilder.CreateIndex(
-                name: "nci_wi_ServerMessage_EC00C205420F6CB01974705B93F9507F",
-                table: "ServerMessage",
-                columns: new[] { "ReceivedOn", "UpdatedOn", "CreatedOn" });
-
-            migrationBuilder.CreateIndex(
-                name: "IX_TransactionRecord_StartTime",
-                table: "TransactionRecord",
-                columns: new[] { "CustomerId", "ConnectorId", "StartTime", "ChargeBoxId" });
-
-            migrationBuilder.CreateIndex(
-                name: "nci_wi_TransactionRecord_92D4DF08E7034102014AC91760F890FE",
-                table: "TransactionRecord",
-                columns: new[] { "CustomerId", "StopTransactionReportedOn", "StopTime" });
-        }
-
-        /// <inheritdoc />
-        protected override void Down(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.DropTable(
-                name: "__MigrationHistory");
-
-            migrationBuilder.DropTable(
-                name: "ConnectorMeterValueRecord");
-
-            migrationBuilder.DropTable(
-                name: "ConnectorStatus");
-
-            migrationBuilder.DropTable(
-                name: "LoadingBalance");
-
-            migrationBuilder.DropTable(
-                name: "Machine");
-
-            migrationBuilder.DropTable(
-                name: "MachineConfigurations");
-
-            migrationBuilder.DropTable(
-                name: "MachineError");
-
-            migrationBuilder.DropTable(
-                name: "MachineOperateRecord");
-
-            migrationBuilder.DropTable(
-                name: "MachineVersionFile");
-
-            migrationBuilder.DropTable(
-                name: "OCMF");
-
-            migrationBuilder.DropTable(
-                name: "ServerMessage");
-
-            migrationBuilder.DropTable(
-                name: "TransactionRecord");
-
-            migrationBuilder.DropTable(
-                name: "Customer");
-
-            migrationBuilder.DropTable(
-                name: "UploadFile");
-        }
-    }
-}

+ 0 - 1077
EVCB_OCPP.Domain/Migrations/20231019090745_Updatetest.Designer.cs

@@ -1,1077 +0,0 @@
-// <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("20231019090745_Updatetest")]
-    partial class Updatetest
-    {
-        /// <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<string>("Name")
-                        .HasColumnType("nvarchar(max)");
-
-                    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
-        }
-    }
-}

+ 0 - 28
EVCB_OCPP.Domain/Migrations/20231019090745_Updatetest.cs

@@ -1,28 +0,0 @@
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace EVCB_OCPP.Domain.Migrations
-{
-    /// <inheritdoc />
-    public partial class Updatetest : Migration
-    {
-        /// <inheritdoc />
-        protected override void Up(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.AddColumn<string>(
-                name: "Name",
-                table: "Machine",
-                type: "nvarchar(max)",
-                nullable: true);
-        }
-
-        /// <inheritdoc />
-        protected override void Down(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.DropColumn(
-                name: "Name",
-                table: "Machine");
-        }
-    }
-}

+ 0 - 1074
EVCB_OCPP.Domain/Migrations/20231019090908_RemoveUpdatetest.Designer.cs

@@ -1,1074 +0,0 @@
-// <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("20231019090908_RemoveUpdatetest")]
-    partial class RemoveUpdatetest
-    {
-        /// <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
-        }
-    }
-}

+ 0 - 28
EVCB_OCPP.Domain/Migrations/20231019090908_RemoveUpdatetest.cs

@@ -1,28 +0,0 @@
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace EVCB_OCPP.Domain.Migrations
-{
-    /// <inheritdoc />
-    public partial class RemoveUpdatetest : Migration
-    {
-        /// <inheritdoc />
-        protected override void Up(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.DropColumn(
-                name: "Name",
-                table: "Machine");
-        }
-
-        /// <inheritdoc />
-        protected override void Down(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.AddColumn<string>(
-                name: "Name",
-                table: "Machine",
-                type: "nvarchar(max)",
-                nullable: true);
-        }
-    }
-}

+ 0 - 75
EVCB_OCPP.Domain/Migrations/ConnectionLogDB/20231019091533_InitialCreate.Designer.cs

@@ -1,75 +0,0 @@
-// <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.ConnectionLogDB
-{
-    [DbContext(typeof(ConnectionLogDBContext))]
-    [Migration("20231019091533_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.ConnectionLogDB.MachineConnectionLog", b =>
-                {
-                    b.Property<long>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("bigint");
-
-                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
-
-                    b.Property<DateTime>("CreatedOn")
-                        .HasColumnType("datetime");
-
-                    b.Property<string>("ChargeBoxId")
-                        .HasMaxLength(128)
-                        .HasColumnType("nvarchar(128)");
-
-                    b.Property<string>("Data")
-                        .HasMaxLength(3600)
-                        .HasColumnType("nvarchar(3600)");
-
-                    b.Property<string>("EvseendPoint")
-                        .HasMaxLength(25)
-                        .HasColumnType("nvarchar(25)")
-                        .HasColumnName("EVSEEndPoint");
-
-                    b.Property<bool>("IsSent")
-                        .HasColumnType("bit");
-
-                    b.Property<string>("MessageType")
-                        .HasMaxLength(50)
-                        .HasColumnType("nvarchar(50)");
-
-                    b.Property<string>("Msg")
-                        .HasMaxLength(200)
-                        .HasColumnType("nvarchar(200)");
-
-                    b.Property<string>("Session")
-                        .HasMaxLength(36)
-                        .HasColumnType("nvarchar(36)");
-
-                    b.HasKey("Id", "CreatedOn");
-
-                    b.ToTable("MachineConnectionLog", (string)null);
-                });
-#pragma warning restore 612, 618
-        }
-    }
-}

+ 0 - 42
EVCB_OCPP.Domain/Migrations/ConnectionLogDB/20231019091533_InitialCreate.cs

@@ -1,42 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace EVCB_OCPP.Domain.Migrations.ConnectionLogDB
-{
-    /// <inheritdoc />
-    public partial class InitialCreate : Migration
-    {
-        /// <inheritdoc />
-        protected override void Up(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.CreateTable(
-                name: "MachineConnectionLog",
-                columns: table => new
-                {
-                    Id = table.Column<long>(type: "bigint", nullable: false)
-                        .Annotation("SqlServer:Identity", "1, 1"),
-                    CreatedOn = table.Column<DateTime>(type: "datetime", nullable: false),
-                    MessageType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
-                    Data = table.Column<string>(type: "nvarchar(3600)", maxLength: 3600, nullable: true),
-                    Msg = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
-                    ChargeBoxId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
-                    IsSent = table.Column<bool>(type: "bit", nullable: false),
-                    EVSEEndPoint = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
-                    Session = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_MachineConnectionLog", x => new { x.Id, x.CreatedOn });
-                });
-        }
-
-        /// <inheritdoc />
-        protected override void Down(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.DropTable(
-                name: "MachineConnectionLog");
-        }
-    }
-}

+ 0 - 72
EVCB_OCPP.Domain/Migrations/ConnectionLogDB/ConnectionLogDBContextModelSnapshot.cs

@@ -1,72 +0,0 @@
-// <auto-generated />
-using System;
-using EVCB_OCPP.Domain;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Metadata;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-
-#nullable disable
-
-namespace EVCB_OCPP.Domain.Migrations.ConnectionLogDB
-{
-    [DbContext(typeof(ConnectionLogDBContext))]
-    partial class ConnectionLogDBContextModelSnapshot : ModelSnapshot
-    {
-        protected override void BuildModel(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.ConnectionLogDB.MachineConnectionLog", b =>
-                {
-                    b.Property<long>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("bigint");
-
-                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
-
-                    b.Property<DateTime>("CreatedOn")
-                        .HasColumnType("datetime");
-
-                    b.Property<string>("ChargeBoxId")
-                        .HasMaxLength(128)
-                        .HasColumnType("nvarchar(128)");
-
-                    b.Property<string>("Data")
-                        .HasMaxLength(3600)
-                        .HasColumnType("nvarchar(3600)");
-
-                    b.Property<string>("EvseendPoint")
-                        .HasMaxLength(25)
-                        .HasColumnType("nvarchar(25)")
-                        .HasColumnName("EVSEEndPoint");
-
-                    b.Property<bool>("IsSent")
-                        .HasColumnType("bit");
-
-                    b.Property<string>("MessageType")
-                        .HasMaxLength(50)
-                        .HasColumnType("nvarchar(50)");
-
-                    b.Property<string>("Msg")
-                        .HasMaxLength(200)
-                        .HasColumnType("nvarchar(200)");
-
-                    b.Property<string>("Session")
-                        .HasMaxLength(36)
-                        .HasColumnType("nvarchar(36)");
-
-                    b.HasKey("Id", "CreatedOn");
-
-                    b.ToTable("MachineConnectionLog", (string)null);
-                });
-#pragma warning restore 612, 618
-        }
-    }
-}

+ 0 - 1071
EVCB_OCPP.Domain/Migrations/MainDBContextModelSnapshot.cs

@@ -1,1071 +0,0 @@
-// <auto-generated />
-using System;
-using EVCB_OCPP.Domain;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Metadata;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-
-#nullable disable
-
-namespace EVCB_OCPP.Domain.Migrations
-{
-    [DbContext(typeof(MainDBContext))]
-    partial class MainDBContextModelSnapshot : ModelSnapshot
-    {
-        protected override void BuildModel(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
-        }
-    }
-}

+ 0 - 74
EVCB_OCPP.Domain/Migrations/MeterValueDB/20231019091245_InitialCreate.Designer.cs

@@ -1,74 +0,0 @@
-// <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.MeterValueDB
-{
-    [DbContext(typeof(MeterValueDBContext))]
-    [Migration("20231019091245_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.MeterValueDb.ConnectorMeterValueRecord", b =>
-                {
-                    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("smalldatetime");
-
-                    b.Property<int>("FormatId")
-                        .HasColumnType("int");
-
-                    b.Property<long>("Id")
-                        .HasColumnType("bigint");
-
-                    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.ToTable("ConnectorMeterValueRecord", (string)null);
-                });
-#pragma warning restore 612, 618
-        }
-    }
-}

+ 0 - 43
EVCB_OCPP.Domain/Migrations/MeterValueDB/20231019091245_InitialCreate.cs

@@ -1,43 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace EVCB_OCPP.Domain.Migrations.MeterValueDB
-{
-    /// <inheritdoc />
-    public partial class InitialCreate : Migration
-    {
-        /// <inheritdoc />
-        protected override void Up(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.CreateTable(
-                name: "ConnectorMeterValueRecord",
-                columns: table => new
-                {
-                    Id = table.Column<long>(type: "bigint", nullable: false),
-                    ConnectorId = table.Column<byte>(type: "tinyint", nullable: false),
-                    Value = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
-                    CreatedOn = table.Column<DateTime>(type: "smalldatetime", nullable: false),
-                    ContextId = table.Column<int>(type: "int", nullable: false),
-                    FormatId = table.Column<int>(type: "int", nullable: false),
-                    MeasurandId = table.Column<int>(type: "int", nullable: false),
-                    PhaseId = table.Column<int>(type: "int", nullable: false),
-                    LocationId = table.Column<int>(type: "int", nullable: false),
-                    UnitId = table.Column<int>(type: "int", nullable: false),
-                    ChargeBoxId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
-                    TransactionId = table.Column<int>(type: "int", nullable: false)
-                },
-                constraints: table =>
-                {
-                });
-        }
-
-        /// <inheritdoc />
-        protected override void Down(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.DropTable(
-                name: "ConnectorMeterValueRecord");
-        }
-    }
-}

+ 0 - 71
EVCB_OCPP.Domain/Migrations/MeterValueDB/MeterValueDBContextModelSnapshot.cs

@@ -1,71 +0,0 @@
-// <auto-generated />
-using System;
-using EVCB_OCPP.Domain;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Metadata;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-
-#nullable disable
-
-namespace EVCB_OCPP.Domain.Migrations.MeterValueDB
-{
-    [DbContext(typeof(MeterValueDBContext))]
-    partial class MeterValueDBContextModelSnapshot : ModelSnapshot
-    {
-        protected override void BuildModel(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.MeterValueDb.ConnectorMeterValueRecord", b =>
-                {
-                    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("smalldatetime");
-
-                    b.Property<int>("FormatId")
-                        .HasColumnType("int");
-
-                    b.Property<long>("Id")
-                        .HasColumnType("bigint");
-
-                    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.ToTable("ConnectorMeterValueRecord", (string)null);
-                });
-#pragma warning restore 612, 618
-        }
-    }
-}

+ 15 - 0
EVCB_OCPP.Domain/Models/ConnectionLogDB/MigrationHistory.cs

@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+
+namespace EVCB_OCPP.Domain.Models.ConnectionLogDB;
+
+public partial class MigrationHistory
+{
+    public string MigrationId { get; set; }
+
+    public string ContextKey { get; set; }
+
+    public byte[] Model { get; set; }
+
+    public string ProductVersion { get; set; }
+}

+ 0 - 1
EVCB_OCPP.Domain/Models/MainDb/MachineOperateRecord.cs

@@ -12,7 +12,6 @@ public partial class MachineOperateRecord
         ReportedOn = new DateTime(1991, 1, 1);
 
     }
-
     public int Id { get; set; }
 
     public string SerialNo { get; set; }

+ 1 - 0
EVCB_OCPP.Domain/Models/MainDb/ServerMessage.cs

@@ -10,6 +10,7 @@ public partial class ServerMessage
         ReceivedOn = new DateTime(1991, 1, 1);
         UpdatedOn = new DateTime(1991, 1, 1);
     }
+
     public int Id { get; set; }
 
     public string SerialNo { get; set; }

+ 5 - 10
EVCB_OCPP.Domain/Models/MainDb/TransactionRecord.cs

@@ -20,19 +20,18 @@ public partial class TransactionRecord
         ErrorMsg = string.Empty;
         StartSoc = string.Empty;
         StopSoc = string.Empty;
-        Evccid = string.Empty;
-        NotifyPnC = false;
     }
-    public int Id { get; set; }
-
-    public DateTime StartTime { get; set; }
 
-    public DateTime StopTime { get; set; }
+    public int Id { get; set; }
 
     public Guid CustomerId { get; set; }
 
     public byte ConnectorId { get; set; }
 
+    public DateTime StartTime { get; set; }
+
+    public DateTime StopTime { get; set; }
+
     public decimal MeterStart { get; set; }
 
     public decimal MeterStop { get; set; }
@@ -76,8 +75,4 @@ public partial class TransactionRecord
     public string StartSoc { get; set; }
 
     public string StopSoc { get; set; }
-
-    public bool NotifyPnC { get; set; }
-
-    public string Evccid { get; set; }
 }

+ 15 - 0
EVCB_OCPP.Domain/Models/MeterValueDb/MigrationHistory.cs

@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+
+namespace EVCB_OCPP.Domain.Models.MeterValueDb;
+
+public partial class MigrationHistory
+{
+    public string MigrationId { get; set; }
+
+    public string ContextKey { get; set; }
+
+    public byte[] Model { get; set; }
+
+    public string ProductVersion { get; set; }
+}

+ 4 - 4
migration_commands.txt

@@ -1,11 +1,11 @@
-dotnet ef dbcontext scaffold --project ./EVCB_OCPP.Domain/EVCB_OCPP.Domain.csproj "data source=zerova-ev-dev.database.windows.net;initial catalog=StandardOCPP_ConnectionLog;persist security info=True;user id=azdevsoftware;password=1h52dev#az;MultipleActiveResultSets=True;App=EntityFramework" Microsoft.EntityFrameworkCore.SqlServer
+dotnet ef dbcontext scaffold --project ./EVCB_OCPP.Domain/EVCB_OCPP.Domain.csproj "data source=dev-ebus.database.windows.net;initial catalog=StandardOCPP_ConnectionLog;persist security info=True;user id=dev-ebus;password=ex#1r$vaz;MultipleActiveResultSets=True;App=EntityFramework" Microsoft.EntityFrameworkCore.SqlServer
 
-dotnet ef dbcontext scaffold --project ./EVCB_OCPP.Domain/EVCB_OCPP.Domain.csproj "data source=zerova-ev-dev.database.windows.net;initial catalog=StandardOCPP_Main;persist security info=True;user id=azdevsoftware;password=1h52dev#az;MultipleActiveResultSets=True;App=EntityFramework" Microsoft.EntityFrameworkCore.SqlServer --output-dir "./Models/MainDb" --context-dir "./"
+dotnet ef dbcontext scaffold --project ./EVCB_OCPP.Domain/EVCB_OCPP.Domain.csproj "data source=dev-ebus.database.windows.net;initial catalog=StandardOCPP_Main;persist security info=True;user id=dev-ebus;password=ex#1r$vaz;MultipleActiveResultSets=True;App=EntityFramework" Microsoft.EntityFrameworkCore.SqlServer --output-dir "./Models/MainDb" --context-dir "./"
 
 
-dotnet ef dbcontext scaffold --project ./EVCB_OCPP.Domain/EVCB_OCPP.Domain.csproj "data source=zerova-ev-dev.database.windows.net;initial catalog=StandardOCPP_MeterValue;persist security info=True;user id=azdevsoftware;password=1h52dev#az;MultipleActiveResultSets=True;App=EntityFramework" Microsoft.EntityFrameworkCore.SqlServer --output-dir "./Models/MeterValueDb" --context-dir "./"
+dotnet ef dbcontext scaffold --project ./EVCB_OCPP.Domain/EVCB_OCPP.Domain.csproj "data source=dev-ebus.database.windows.net;initial catalog=StandardOCPP_MeterValue;persist security info=True;user id=dev-ebus;password=ex#1r$vaz;MultipleActiveResultSets=True;App=EntityFramework" Microsoft.EntityFrameworkCore.SqlServer --output-dir "./Models/MeterValueDb" --context-dir "./"
 
-dotnet ef dbcontext scaffold --project ./EVCB_OCPP.Domain/EVCB_OCPP.Domain.csproj "data source=zerova-ev-dev.database.windows.net;initial catalog=StandardOCPP_ConnectionLog;persist security info=True;user id=azdevsoftware;password=1h52dev#az;MultipleActiveResultSets=True;App=EntityFramework" Microsoft.EntityFrameworkCore.SqlServer --output-dir "./Models/ConnectionLogDB" --context-dir "./"
+dotnet ef dbcontext scaffold --project ./EVCB_OCPP.Domain/EVCB_OCPP.Domain.csproj "data source=dev-ebus.database.windows.net;initial catalog=StandardOCPP_ConnectionLog;persist security info=True;user id=dev-ebus;password=ex#1r$vaz;MultipleActiveResultSets=True;App=EntityFramework" Microsoft.EntityFrameworkCore.SqlServer --output-dir "./Models/ConnectionLogDB" --context-dir "./"
 
 dotnet ef migrations add InitialCreate --project ./EVCB_OCPP.Domain/EVCB_OCPP.Domain.csproj --context MainDBContext