diff --git a/TransactionProcessor.Aggregates.Tests/TransactionProcessor.Aggregates.Tests.csproj b/TransactionProcessor.Aggregates.Tests/TransactionProcessor.Aggregates.Tests.csproj
index b06c32fc..74f8229c 100644
--- a/TransactionProcessor.Aggregates.Tests/TransactionProcessor.Aggregates.Tests.csproj
+++ b/TransactionProcessor.Aggregates.Tests/TransactionProcessor.Aggregates.Tests.csproj
@@ -10,12 +10,16 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
+
+
+
+
@@ -24,8 +28,8 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
+
+
diff --git a/TransactionProcessor.Aggregates/TransactionProcessor.Aggregates.csproj b/TransactionProcessor.Aggregates/TransactionProcessor.Aggregates.csproj
index 0d024ffc..7181df2a 100644
--- a/TransactionProcessor.Aggregates/TransactionProcessor.Aggregates.csproj
+++ b/TransactionProcessor.Aggregates/TransactionProcessor.Aggregates.csproj
@@ -7,10 +7,11 @@
-
+
+
-
-
+
+
diff --git a/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj b/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj
index 78848b0b..d996b53a 100644
--- a/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj
+++ b/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj
@@ -8,16 +8,20 @@
-
-
-
+
+
+
+
+
+
-
+
+
-
-
+
+
@@ -25,7 +29,7 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/TransactionProcessor.BusinessLogic/TransactionProcessor.BusinessLogic.csproj b/TransactionProcessor.BusinessLogic/TransactionProcessor.BusinessLogic.csproj
index 1a228469..ba7c06f6 100644
--- a/TransactionProcessor.BusinessLogic/TransactionProcessor.BusinessLogic.csproj
+++ b/TransactionProcessor.BusinessLogic/TransactionProcessor.BusinessLogic.csproj
@@ -7,21 +7,25 @@
-
+
-
-
+
+
+
+
+
-
-
-
+
+
+
+
-
-
+
+
diff --git a/TransactionProcessor.DataTransferObjects/TransactionProcessor.DataTransferObjects.csproj b/TransactionProcessor.DataTransferObjects/TransactionProcessor.DataTransferObjects.csproj
index bbd67581..9b1b6f8f 100644
--- a/TransactionProcessor.DataTransferObjects/TransactionProcessor.DataTransferObjects.csproj
+++ b/TransactionProcessor.DataTransferObjects/TransactionProcessor.DataTransferObjects.csproj
@@ -6,8 +6,8 @@
-
-
+
+
diff --git a/TransactionProcessor.Database/Contexts/EstateManagementGenericContext.cs b/TransactionProcessor.Database/Contexts/EstateManagementGenericContext.cs
index 8db346c0..ac47dfd8 100644
--- a/TransactionProcessor.Database/Contexts/EstateManagementGenericContext.cs
+++ b/TransactionProcessor.Database/Contexts/EstateManagementGenericContext.cs
@@ -40,6 +40,9 @@ public EstateManagementContext(DbContextOptions dbContextOptions) : base(dbConte
#region Properties
+ public DbSet FileProfileConfigurations { get; set; }
+ public DbSet RequestTypes { get; set; }
+ public DbSet FileFormatHandlers { get; set; }
public DbSet MerchantOpeningHours { get; set; }
public DbSet MerchantBalanceChangedEntry { get; set; }
@@ -266,10 +269,7 @@ FROM sys.databases
await alterCommand.ExecuteNonQueryAsync(cancellationToken);
}
}
-
-
-
-
+
public static Boolean IsDuplicateInsertsIgnored(String tableName) =>
EstateManagementContext.TablesToIgnoreDuplicates.Contains(tableName.Trim(), StringComparer.InvariantCultureIgnoreCase);
@@ -326,7 +326,10 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.SetupEstateOperator()
.SetupMerchantSchedule()
.SetupMerchantScheduleMonth()
- .SetupMerchantOpeningHours();
+ .SetupMerchantOpeningHours()
+ .SetupFileProfileConfiguration()
+ .SetupRequestType()
+ .SetupFileFormatHandler();
modelBuilder.SetupViewEntities();
@@ -398,7 +401,11 @@ private static String BuildUniqueConstraintExceptionLogMessage(UniqueConstraintE
if (uex.ConstraintProperties != null) {
constraintProperties = String.Join(",", uex.ConstraintProperties);
}
- return $"Unique Constraint Exception. Message [{uex.Message}] Inner Exception [{uex.InnerException.Message}]";
+
+ return uex.InnerException switch {
+ null => $"Unique Constraint Exception. Message [{uex.Message}] Constraint Name [{constraintName}] Constraint Properties [{constraintProperties}]",
+ _ => $"Unique Constraint Exception. Message [{uex.Message}] Inner Exception [{uex.InnerException.Message}]"
+ };
}
diff --git a/TransactionProcessor.Database/Contexts/Extensions.cs b/TransactionProcessor.Database/Contexts/Extensions.cs
index 2b687b52..f7df5f8c 100644
--- a/TransactionProcessor.Database/Contexts/Extensions.cs
+++ b/TransactionProcessor.Database/Contexts/Extensions.cs
@@ -515,6 +515,37 @@ public static ModelBuilder SetupFloatActivity(this ModelBuilder modelBuilder)
return modelBuilder;
}
+ public static ModelBuilder SetupFileProfileConfiguration(this ModelBuilder modelBuilder)
+ {
+ modelBuilder.Entity().HasKey(t => new {
+ t.FileProfileId
+ });
+
+ modelBuilder.Entity().HasIndex(t => new {
+ t.Name
+ }).IsUnique();
+
+ return modelBuilder;
+ }
+
+ public static ModelBuilder SetupFileFormatHandler(this ModelBuilder modelBuilder)
+ {
+ modelBuilder.Entity().HasKey(t => new {
+ t.FileFormatHandlerId
+ });
+ modelBuilder.Entity().HasIndex(t => new { t.Name }).IsUnique();
+
+ return modelBuilder;
+ }
+
+ public static ModelBuilder SetupRequestType(this ModelBuilder modelBuilder) {
+ modelBuilder.Entity().HasKey(t => new { t.RequestTypeId });
+
+ modelBuilder.Entity().HasIndex(t => new { t.Name }).IsUnique();
+
+ return modelBuilder;
+ }
+
#endregion
}
diff --git a/TransactionProcessor.Database/Entities/FileFormatHandler.cs b/TransactionProcessor.Database/Entities/FileFormatHandler.cs
new file mode 100644
index 00000000..475b7a38
--- /dev/null
+++ b/TransactionProcessor.Database/Entities/FileFormatHandler.cs
@@ -0,0 +1,7 @@
+namespace TransactionProcessor.Database.Entities;
+
+public class FileFormatHandler
+{
+ public Guid FileFormatHandlerId { get; set; }
+ public String Name { get; set; }
+}
\ No newline at end of file
diff --git a/TransactionProcessor.Database/Entities/FileProfileConfiguration.cs b/TransactionProcessor.Database/Entities/FileProfileConfiguration.cs
new file mode 100644
index 00000000..38bbf7f8
--- /dev/null
+++ b/TransactionProcessor.Database/Entities/FileProfileConfiguration.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace TransactionProcessor.Database.Entities
+{
+ public class FileProfileConfiguration
+ {
+ public Guid FileProfileId { get; set; }
+ public String Name { get; set; }
+ public String ListeningDirectory { get; set; }
+ public Guid RequestTypeId { get; set; }
+ public Guid OperatorId { get; set; }
+ public String LineTerminator { get; set; }
+ public Guid FileFormatHandlerId { get; set; }
+ }
+}
diff --git a/TransactionProcessor.Database/Entities/RequestType.cs b/TransactionProcessor.Database/Entities/RequestType.cs
new file mode 100644
index 00000000..afda2dac
--- /dev/null
+++ b/TransactionProcessor.Database/Entities/RequestType.cs
@@ -0,0 +1,7 @@
+namespace TransactionProcessor.Database.Entities;
+
+public class RequestType
+{
+ public Guid RequestTypeId { get; set; }
+ public String Name { get; set; }
+}
\ No newline at end of file
diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20260520162516_add_file_import_config_tables.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20260520162516_add_file_import_config_tables.Designer.cs
new file mode 100644
index 00000000..58bfaa26
--- /dev/null
+++ b/TransactionProcessor.Database/Migrations/SqlServer/20260520162516_add_file_import_config_tables.Designer.cs
@@ -0,0 +1,1710 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using TransactionProcessor.Database.Contexts;
+
+#nullable disable
+
+namespace TransactionProcessor.Database.Migrations.SqlServer
+{
+ [DbContext(typeof(EstateManagementContext))]
+ [Migration("20260520162516_add_file_import_config_tables")]
+ partial class add_file_import_config_tables
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "10.0.8")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.Calendar", b =>
+ {
+ b.Property("Date")
+ .HasColumnType("datetime2");
+
+ b.Property("DayOfWeek")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DayOfWeekNumber")
+ .HasColumnType("int");
+
+ b.Property("DayOfWeekShort")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("MonthNameLong")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("MonthNameShort")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("MonthNumber")
+ .HasColumnType("int");
+
+ b.Property("WeekNumber")
+ .HasColumnType("int");
+
+ b.Property("WeekNumberString")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Year")
+ .HasColumnType("int");
+
+ b.Property("YearWeekNumber")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Date");
+
+ b.ToTable("calendar");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.Contract", b =>
+ {
+ b.Property("EstateId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("OperatorId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ContractId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ContractReportingId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ContractReportingId"));
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("EstateId", "OperatorId", "ContractId");
+
+ b.ToTable("contract");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.ContractProduct", b =>
+ {
+ b.Property("ContractProductReportingId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ContractProductReportingId"));
+
+ b.Property("ContractId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ContractProductId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DisplayText")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ProductName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ProductType")
+ .HasColumnType("int");
+
+ b.Property("Value")
+ .HasColumnType("decimal(18,2)");
+
+ b.HasKey("ContractProductReportingId");
+
+ b.HasIndex("ContractProductId", "ContractId")
+ .IsUnique();
+
+ b.ToTable("contractproduct");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.ContractProductTransactionFee", b =>
+ {
+ b.Property("ContractProductTransactionFeeReportingId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ContractProductTransactionFeeReportingId"));
+
+ b.Property("CalculationType")
+ .HasColumnType("int");
+
+ b.Property("ContractProductId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ContractProductTransactionFeeId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FeeType")
+ .HasColumnType("int");
+
+ b.Property("IsEnabled")
+ .HasColumnType("bit");
+
+ b.Property("Value")
+ .HasColumnType("decimal(18,4)");
+
+ b.HasKey("ContractProductTransactionFeeReportingId");
+
+ b.HasIndex("ContractProductTransactionFeeId", "ContractProductId")
+ .IsUnique();
+
+ b.ToTable("contractproducttransactionfee");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.Estate", b =>
+ {
+ b.Property("EstateReportingId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("EstateReportingId"));
+
+ b.Property("CreatedDateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("EstateId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Reference")
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("EstateReportingId");
+
+ b.HasIndex("EstateId")
+ .IsUnique();
+
+ b.ToTable("estate");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.EstateOperator", b =>
+ {
+ b.Property("EstateId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("OperatorId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IsDeleted")
+ .HasColumnType("bit");
+
+ b.HasKey("EstateId", "OperatorId");
+
+ b.ToTable("estateoperator");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.EstateSecurityUser", b =>
+ {
+ b.Property("SecurityUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("EstateId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreatedDateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("EmailAddress")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("SecurityUserId", "EstateId");
+
+ b.ToTable("estatesecurityuser");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.File", b =>
+ {
+ b.Property("FileReportingId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("FileReportingId"));
+
+ b.Property("EstateId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("FileId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("FileImportLogId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("FileLocation")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FileProfileId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("FileReceivedDate")
+ .HasColumnType("date");
+
+ b.Property("FileReceivedDateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("IsCompleted")
+ .HasColumnType("bit");
+
+ b.Property("MerchantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("FileReportingId");
+
+ b.HasIndex("FileId")
+ .IsUnique();
+
+ b.ToTable("file");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.FileFormatHandler", b =>
+ {
+ b.Property("FileFormatHandlerId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(450)");
+
+ b.HasKey("FileFormatHandlerId");
+
+ b.HasIndex("Name")
+ .IsUnique();
+
+ b.ToTable("FileFormatHandlers");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.FileImportLog", b =>
+ {
+ b.Property("EstateId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("FileImportLogReportingId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("FileImportLogReportingId"));
+
+ b.Property("FileImportLogId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ImportLogDate")
+ .HasColumnType("date");
+
+ b.Property("ImportLogDateTime")
+ .HasColumnType("datetime2");
+
+ b.HasKey("EstateId", "FileImportLogReportingId");
+
+ b.HasIndex("EstateId", "FileImportLogId")
+ .IsUnique();
+
+ b.ToTable("fileimportlog");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.FileImportLogFile", b =>
+ {
+ b.Property("FileImportLogId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("FileId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("FilePath")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FileProfileId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("FileUploadedDate")
+ .HasColumnType("date");
+
+ b.Property("FileUploadedDateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("MerchantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("OriginalFileName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("FileImportLogId", "FileId");
+
+ b.ToTable("fileimportlogfile");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.FileLine", b =>
+ {
+ b.Property("FileId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("LineNumber")
+ .HasColumnType("int");
+
+ b.Property("FileLineData")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("TransactionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("FileId", "LineNumber");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("FileId", "LineNumber"));
+
+ b.ToTable("fileline");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.FileProfileConfiguration", b =>
+ {
+ b.Property("FileProfileId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("FileFormatHandlerId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("LineTerminator")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ListeningDirectory")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("OperatorId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("RequestTypeId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("FileProfileId");
+
+ b.HasIndex("Name")
+ .IsUnique();
+
+ b.ToTable("FileProfileConfigurations");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.Float", b =>
+ {
+ b.Property("FloatId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ContractId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreatedDate")
+ .HasColumnType("date");
+
+ b.Property("CreatedDateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("EstateId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ProductId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("FloatId");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("FloatId"), false);
+
+ b.HasIndex("CreatedDate");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("CreatedDate"));
+
+ b.ToTable("Floats");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.FloatActivity", b =>
+ {
+ b.Property("EventId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ActivityDate")
+ .HasColumnType("date");
+
+ b.Property("ActivityDateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("Amount")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("CostPrice")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("CreditOrDebit")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FloatId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("EventId");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("EventId"), false);
+
+ b.HasIndex("ActivityDate");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("ActivityDate"));
+
+ b.ToTable("FloatActivity");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.Merchant", b =>
+ {
+ b.Property("MerchantReportingId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("MerchantReportingId"));
+
+ b.Property("CreatedDateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("EstateId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("LastSaleDate")
+ .HasColumnType("date");
+
+ b.Property("LastSaleDateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("LastStatementGenerated")
+ .HasColumnType("datetime2");
+
+ b.Property("MerchantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Reference")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SettlementSchedule")
+ .HasColumnType("int");
+
+ b.HasKey("MerchantReportingId");
+
+ b.HasIndex("EstateId", "MerchantId")
+ .IsUnique();
+
+ b.ToTable("merchant");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantAddress", b =>
+ {
+ b.Property("MerchantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AddressId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AddressLine1")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("AddressLine2")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("AddressLine3")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("AddressLine4")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Country")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreatedDateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("PostalCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Region")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Town")
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("MerchantId", "AddressId");
+
+ b.ToTable("merchantaddress");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantContact", b =>
+ {
+ b.Property("MerchantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ContactId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreatedDateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("EmailAddress")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PhoneNumber")
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("MerchantId", "ContactId");
+
+ b.ToTable("merchantcontact");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantContract", b =>
+ {
+ b.Property("MerchantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ContractId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IsDeleted")
+ .HasColumnType("bit");
+
+ b.HasKey("MerchantId", "ContractId");
+
+ b.ToTable("MerchantContracts");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantDevice", b =>
+ {
+ b.Property("MerchantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeviceId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreatedDateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("DeviceIdentifier")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("IsEnabled")
+ .HasColumnType("bit");
+
+ b.HasKey("MerchantId", "DeviceId");
+
+ b.ToTable("merchantdevice");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantOpeningHours", b =>
+ {
+ b.Property("MerchantId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("FridayClosing")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FridayOpening")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("MondayClosing")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("MondayOpening")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SaturdayClosing")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SaturdayOpening")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SundayClosing")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SundayOpening")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ThursdayClosing")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ThursdayOpening")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("TuesdayClosing")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("TuesdayOpening")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("WednesdayClosing")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("WednesdayOpening")
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("MerchantId");
+
+ b.ToTable("merchantopeninghours");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantOperator", b =>
+ {
+ b.Property("MerchantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("OperatorId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IsDeleted")
+ .HasColumnType("bit");
+
+ b.Property("MerchantNumber")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("TerminalNumber")
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("MerchantId", "OperatorId");
+
+ b.ToTable("merchantoperator");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantSchedule", b =>
+ {
+ b.Property("MerchantScheduleId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("EstateId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("MerchantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Year")
+ .HasColumnType("int");
+
+ b.HasKey("MerchantScheduleId");
+
+ b.HasIndex("MerchantId", "Year")
+ .IsUnique();
+
+ b.ToTable("merchantschedule");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantScheduleMonth", b =>
+ {
+ b.Property("MerchantScheduleId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Month")
+ .HasColumnType("int");
+
+ b.Property("ClosedDays")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("MerchantScheduleId", "Month");
+
+ b.ToTable("merchantschedulemonth");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantSecurityUser", b =>
+ {
+ b.Property("MerchantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("SecurityUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreatedDateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("EmailAddress")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("MerchantId", "SecurityUserId");
+
+ b.ToTable("merchantsecurityuser");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantSettlementFee", b =>
+ {
+ b.Property("SettlementId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TransactionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ContractProductTransactionFeeId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CalculatedValue")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("FeeCalculatedDateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("FeeValue")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("IsSettled")
+ .HasColumnType("bit");
+
+ b.Property("MerchantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("SettlementId", "TransactionId", "ContractProductTransactionFeeId");
+
+ b.ToTable("merchantsettlementfee");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.Operator", b =>
+ {
+ b.Property("OperatorReportingId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("OperatorReportingId"));
+
+ b.Property("EstateId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OperatorId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("RequireCustomMerchantNumber")
+ .HasColumnType("bit");
+
+ b.Property("RequireCustomTerminalNumber")
+ .HasColumnType("bit");
+
+ b.HasKey("OperatorReportingId");
+
+ b.HasIndex("OperatorId")
+ .IsUnique();
+
+ b.ToTable("operator");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.Reconciliation", b =>
+ {
+ b.Property("TransactionReportingId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("TransactionReportingId"));
+
+ b.Property("DeviceIdentifier")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("IsAuthorised")
+ .HasColumnType("bit");
+
+ b.Property("IsCompleted")
+ .HasColumnType("bit");
+
+ b.Property("MerchantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ResponseCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ResponseMessage")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("TransactionCount")
+ .HasColumnType("int");
+
+ b.Property("TransactionDate")
+ .HasColumnType("date");
+
+ b.Property("TransactionDateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("TransactionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TransactionTime")
+ .HasColumnType("time");
+
+ b.Property("TransactionValue")
+ .HasColumnType("decimal(18,2)");
+
+ b.HasKey("TransactionReportingId");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("TransactionReportingId"), false);
+
+ b.HasIndex("TransactionDate");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("TransactionDate"));
+
+ b.HasIndex("TransactionId", "MerchantId")
+ .IsUnique();
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("TransactionId", "MerchantId"), false);
+
+ b.ToTable("reconciliation");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.RequestType", b =>
+ {
+ b.Property("RequestTypeId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(450)");
+
+ b.HasKey("RequestTypeId");
+
+ b.HasIndex("Name")
+ .IsUnique();
+
+ b.ToTable("RequestTypes");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.ResponseCodes", b =>
+ {
+ b.Property("ResponseCode")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ResponseCode"));
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("ResponseCode");
+
+ b.ToTable("responsecodes");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.Settlement", b =>
+ {
+ b.Property("SettlementReportingId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("SettlementReportingId"));
+
+ b.Property("EstateId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IsCompleted")
+ .HasColumnType("bit");
+
+ b.Property("MerchantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ProcessingStarted")
+ .HasColumnType("bit");
+
+ b.Property("ProcessingStartedDateTIme")
+ .HasColumnType("datetime2");
+
+ b.Property("SettlementDate")
+ .HasColumnType("date");
+
+ b.Property("SettlementId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("SettlementReportingId");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("SettlementReportingId"), false);
+
+ b.HasIndex("SettlementDate");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("SettlementDate"));
+
+ b.HasIndex("EstateId", "SettlementId")
+ .IsUnique();
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("EstateId", "SettlementId"), false);
+
+ b.ToTable("settlement");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.StatementHeader", b =>
+ {
+ b.Property("MerchantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("StatementId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("StatementCreatedDate")
+ .HasColumnType("date");
+
+ b.Property("StatementCreatedDateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("StatementGeneratedDate")
+ .HasColumnType("date");
+
+ b.Property("StatementGeneratedDateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("StatementReportingId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("StatementReportingId"));
+
+ b.HasKey("MerchantId", "StatementId");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("MerchantId", "StatementId"), false);
+
+ b.HasIndex("StatementGeneratedDate");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("StatementGeneratedDate"));
+
+ b.ToTable("statementheader");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.StatementLine", b =>
+ {
+ b.Property("StatementId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TransactionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ActivityDateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("ActivityType")
+ .HasColumnType("int");
+
+ b.Property("ActivityDate")
+ .HasColumnType("date");
+
+ b.Property("ActivityDescription")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("InAmount")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("OutAmount")
+ .HasColumnType("decimal(18,2)");
+
+ b.HasKey("StatementId", "TransactionId", "ActivityDateTime", "ActivityType");
+
+ b.ToTable("statementline");
+ });
+
+ modelBuilder.Entity("TransactionProcessor.Database.Entities.Summary.SettlementSummary", b =>
+ {
+ b.Property("ContractProductReportingId")
+ .HasColumnType("int");
+
+ b.Property("FeeCount")
+ .HasColumnType("int");
+
+ b.Property("FeeValue")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("IsCompleted")
+ .HasColumnType("bit");
+
+ b.Property("IsSettled")
+ .HasColumnType("bit");
+
+ b.Property("MerchantReportingId")
+ .HasColumnType("int");
+
+ b.Property("OperatorReportingId")
+ .HasColumnType("int");
+
+ b.Property("SalesCount")
+ .HasColumnType("int");
+
+ b.Property("SalesValue")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property