diff --git a/.github/workflows/buildwindowsimage.yml b/.github/workflows/buildwindowsimage.yml index 35efb433..9b8b29e4 100644 --- a/.github/workflows/buildwindowsimage.yml +++ b/.github/workflows/buildwindowsimage.yml @@ -14,6 +14,11 @@ jobs: steps: - uses: actions/checkout@v2.3.4 + + - name: Install NET 9 + uses: actions/setup-dotnet@v4.0.1 + with: + dotnet-version: '9.0.x' - name: Get the version id: get_version diff --git a/.github/workflows/createrelease.yml b/.github/workflows/createrelease.yml index 125fb9f9..226ddd08 100644 --- a/.github/workflows/createrelease.yml +++ b/.github/workflows/createrelease.yml @@ -14,6 +14,11 @@ jobs: steps: - uses: actions/checkout@v2.3.4 + + - name: Install NET 9 + uses: actions/setup-dotnet@v4.0.1 + with: + dotnet-version: '9.0.x' - name: Get the version id: get_version diff --git a/.github/workflows/nightlybuild.yml b/.github/workflows/nightlybuild.yml index 2689db2f..9521488d 100644 --- a/.github/workflows/nightlybuild.yml +++ b/.github/workflows/nightlybuild.yml @@ -16,6 +16,11 @@ jobs: steps: - uses: actions/checkout@v2.3.4 + - name: Install NET 9 + uses: actions/setup-dotnet@v4.0.1 + with: + dotnet-version: '9.0.x' + - name: Set Up Variables run: echo "action_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index 6ae44e3e..ea79b47b 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -15,6 +15,11 @@ jobs: steps: - uses: actions/checkout@v2.3.4 + + - name: Install NET 9 + uses: actions/setup-dotnet@v4.0.1 + with: + dotnet-version: '9.0.x' - name: Restore Nuget Packages run: dotnet restore TransactionProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} diff --git a/.github/workflows/pushtomaster.yml b/.github/workflows/pushtomaster.yml index 59ace93a..880a1609 100644 --- a/.github/workflows/pushtomaster.yml +++ b/.github/workflows/pushtomaster.yml @@ -19,6 +19,11 @@ jobs: with: fetch-depth: 0 + - name: Install NET 9 + uses: actions/setup-dotnet@v4.0.1 + with: + dotnet-version: '9.0.x' + - name: Restore Nuget Packages run: dotnet restore TransactionProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} diff --git a/TransactionProcessor.Aggregates.Tests/TransactionProcessor.Aggregates.Tests.csproj b/TransactionProcessor.Aggregates.Tests/TransactionProcessor.Aggregates.Tests.csproj index 7110422f..685afdcc 100644 --- a/TransactionProcessor.Aggregates.Tests/TransactionProcessor.Aggregates.Tests.csproj +++ b/TransactionProcessor.Aggregates.Tests/TransactionProcessor.Aggregates.Tests.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 enable enable None @@ -14,17 +14,18 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + - - - + + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive + + diff --git a/TransactionProcessor.Aggregates/TransactionProcessor.Aggregates.csproj b/TransactionProcessor.Aggregates/TransactionProcessor.Aggregates.csproj index 52848f17..22fe75e1 100644 --- a/TransactionProcessor.Aggregates/TransactionProcessor.Aggregates.csproj +++ b/TransactionProcessor.Aggregates/TransactionProcessor.Aggregates.csproj @@ -1,14 +1,16 @@  - net8.0 + net9.0 enable enable - - + + + + diff --git a/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/VoucherDomainEventHandlerTests.cs b/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/VoucherDomainEventHandlerTests.cs index bbe8fd47..94cea990 100644 --- a/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/VoucherDomainEventHandlerTests.cs +++ b/TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/VoucherDomainEventHandlerTests.cs @@ -35,20 +35,20 @@ public enum TestDatabaseType public class VoucherDomainEventHandlerTests { - private Mock> GetMockDbContextFactory() + private Mock> GetMockDbContextFactory() { - return new Mock>(); + return new Mock>(); } - private async Task GetContext(String databaseName, TestDatabaseType databaseType = TestDatabaseType.InMemory) + private async Task GetContext(String databaseName, TestDatabaseType databaseType = TestDatabaseType.InMemory) { - EstateManagementGenericContext context = null; + EstateManagementContext context = null; if (databaseType == TestDatabaseType.InMemory) { - DbContextOptionsBuilder builder = new DbContextOptionsBuilder() + DbContextOptionsBuilder builder = new DbContextOptionsBuilder() .UseInMemoryDatabase(databaseName) .ConfigureWarnings(w => w.Ignore(InMemoryEventId.TransactionIgnoredWarning)); - context = new EstateManagementSqlServerContext(builder.Options); + context = new EstateManagementContext(builder.Options); } else { @@ -72,7 +72,7 @@ public async Task VoucherDomainEventHandler_VoucherIssuedEvent_WithEmailAddress_ aggregateService.Setup(t => t.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.GetVoucherAggregateWithRecipientEmail())); - EstateManagementGenericContext context = await this.GetContext(Guid.NewGuid().ToString("N"), TestDatabaseType.InMemory); + EstateManagementContext context = await this.GetContext(Guid.NewGuid().ToString("N"), TestDatabaseType.InMemory); context.Transactions.Add(new Database.Entities.Transaction() { TransactionId = TestData.TransactionId, @@ -121,7 +121,7 @@ public async Task VoucherDomainEventHandler_VoucherIssuedEvent_WithRecipientMobi aggregateService.Setup(t => t.Get(It.IsAny(), It.IsAny())) .ReturnsAsync(Result.Success(TestData.GetVoucherAggregateWithRecipientMobile())); - EstateManagementGenericContext context = await this.GetContext(Guid.NewGuid().ToString("N"), TestDatabaseType.InMemory); + EstateManagementContext context = await this.GetContext(Guid.NewGuid().ToString("N"), TestDatabaseType.InMemory); context.Transactions.Add(new Database.Entities.Transaction() { TransactionId = TestData.TransactionId, @@ -136,7 +136,7 @@ public async Task VoucherDomainEventHandler_VoucherIssuedEvent_WithRecipientMobi }); await context.SaveChangesAsync(CancellationToken.None); - Mock> dbContextFactory = this.GetMockDbContextFactory(); + Mock> dbContextFactory = this.GetMockDbContextFactory(); dbContextFactory.Setup(d => d.GetContext(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(context); Mock messagingServiceClient = new Mock(); diff --git a/TransactionProcessor.BusinessLogic.Tests/Manager/VoucherManagementManagerTests.cs b/TransactionProcessor.BusinessLogic.Tests/Manager/VoucherManagementManagerTests.cs index 792242b6..10fa4d85 100644 --- a/TransactionProcessor.BusinessLogic.Tests/Manager/VoucherManagementManagerTests.cs +++ b/TransactionProcessor.BusinessLogic.Tests/Manager/VoucherManagementManagerTests.cs @@ -26,20 +26,20 @@ namespace TransactionProcessor.BusinessLogic.Tests.Manager public class VoucherManagementManagerTests { - private Mock> GetMockDbContextFactory() + private Mock> GetMockDbContextFactory() { - return new Mock>(); + return new Mock>(); } - private async Task GetContext(String databaseName, TestDatabaseType databaseType = TestDatabaseType.InMemory) + private async Task GetContext(String databaseName, TestDatabaseType databaseType = TestDatabaseType.InMemory) { - EstateManagementGenericContext context = null; + EstateManagementContext context = null; if (databaseType == TestDatabaseType.InMemory) { - DbContextOptionsBuilder builder = new DbContextOptionsBuilder() + DbContextOptionsBuilder builder = new DbContextOptionsBuilder() .UseInMemoryDatabase(databaseName) .ConfigureWarnings(w => w.Ignore(InMemoryEventId.TransactionIgnoredWarning)); - context = new EstateManagementSqlServerContext(builder.Options); + context = new EstateManagementContext(builder.Options); } else { @@ -63,7 +63,7 @@ await context.VoucherProjectionStates.AddAsync(new VoucherProjectionState }); await context.SaveChangesAsync(CancellationToken.None); - Mock> dbContextFactory = this.GetMockDbContextFactory(); + Mock> dbContextFactory = this.GetMockDbContextFactory(); dbContextFactory.Setup(d => d.GetContext(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(context); Mock aggregateService = new(); @@ -80,11 +80,11 @@ await context.VoucherProjectionStates.AddAsync(new VoucherProjectionState [Fact] public async Task VoucherManagementManager_GetVoucherByCode_VoucherNotFound_ErrorThrown() { - EstateManagementGenericContext context = await this.GetContext(Guid.NewGuid().ToString("N"), TestDatabaseType.InMemory); + EstateManagementContext context = await this.GetContext(Guid.NewGuid().ToString("N"), TestDatabaseType.InMemory); await context.SaveChangesAsync(CancellationToken.None); - Mock> dbContextFactory = this.GetMockDbContextFactory(); + Mock> dbContextFactory = this.GetMockDbContextFactory(); dbContextFactory.Setup(d => d.GetContext(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(context); Mock aggregateService = new(); @@ -103,7 +103,7 @@ public async Task VoucherManagementManager_GetVoucherByTransactionId_VoucherRetr { Byte[] b = new Byte[5]; - EstateManagementGenericContext context = await this.GetContext(Guid.NewGuid().ToString("N"), TestDatabaseType.InMemory); + EstateManagementContext context = await this.GetContext(Guid.NewGuid().ToString("N"), TestDatabaseType.InMemory); await context.VoucherProjectionStates.AddAsync(new VoucherProjectionState { TransactionId = TestData.TransactionId, @@ -114,7 +114,7 @@ await context.VoucherProjectionStates.AddAsync(new VoucherProjectionState }); await context.SaveChangesAsync(CancellationToken.None); - Mock> dbContextFactory = this.GetMockDbContextFactory(); + Mock> dbContextFactory = this.GetMockDbContextFactory(); dbContextFactory.Setup(d => d.GetContext(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(context); Mock aggregateService = new(); @@ -131,11 +131,11 @@ await context.VoucherProjectionStates.AddAsync(new VoucherProjectionState [Fact] public async Task VoucherManagementManager_GetVoucherByTransactionId_VoucherNotFound_ErrorThrown() { - EstateManagementGenericContext context = await this.GetContext(Guid.NewGuid().ToString("N"), TestDatabaseType.InMemory); + EstateManagementContext context = await this.GetContext(Guid.NewGuid().ToString("N"), TestDatabaseType.InMemory); await context.SaveChangesAsync(CancellationToken.None); - Mock> dbContextFactory = this.GetMockDbContextFactory(); + Mock> dbContextFactory = this.GetMockDbContextFactory(); dbContextFactory.Setup(d => d.GetContext(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(context); Mock aggregateService = new(); diff --git a/TransactionProcessor.BusinessLogic.Tests/Services/VoucherDomainServiceTests.cs b/TransactionProcessor.BusinessLogic.Tests/Services/VoucherDomainServiceTests.cs index 9cf7fe73..f2f8206d 100644 --- a/TransactionProcessor.BusinessLogic.Tests/Services/VoucherDomainServiceTests.cs +++ b/TransactionProcessor.BusinessLogic.Tests/Services/VoucherDomainServiceTests.cs @@ -26,7 +26,7 @@ public class VoucherDomainServiceTests #region Methods private Mock AggregateService; - private Mock> DbContextFactory; + private Mock> DbContextFactory; private VoucherDomainService VoucherDomainService; public VoucherDomainServiceTests() { IConfigurationRoot configurationRoot = new ConfigurationBuilder().AddInMemoryCollection(TestData.DefaultAppSettings).Build(); @@ -35,7 +35,7 @@ public VoucherDomainServiceTests() { Logger.Initialise(NullLogger.Instance); this.AggregateService = new Mock(); - this.DbContextFactory = new Mock>(); + this.DbContextFactory = new Mock>(); this.VoucherDomainService = new VoucherDomainService(this.AggregateService.Object, DbContextFactory.Object); } @@ -43,7 +43,7 @@ public VoucherDomainServiceTests() { public async Task VoucherDomainService_IssueVoucher_EstateWithNoOperators_ErrorThrown() { this.AggregateService.Setup(v => v.GetLatest(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(new VoucherAggregate())); - EstateManagementGenericContext context = await this.GetContext(Guid.NewGuid().ToString("N")); + EstateManagementContext context = await this.GetContext(Guid.NewGuid().ToString("N")); DbContextFactory.Setup(d => d.GetContext(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(context); this.AggregateService.Setup(f => f.Get(It.IsAny(), It.IsAny())).ReturnsAsync(TestData.Aggregates.CreatedEstateAggregate()); var result = await this.VoucherDomainService.IssueVoucher(TestData.VoucherId, @@ -100,7 +100,7 @@ public async Task VoucherDomainService_IssueVoucher_InvalidEstate_ErrorThrown() this.AggregateService.Setup(v => v.GetLatest(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(new VoucherAggregate())); this.AggregateService.Setup(f => f.Get(It.IsAny(), It.IsAny())).ReturnsAsync(TestData.Aggregates.EmptyEstateAggregate); - EstateManagementGenericContext context = await this.GetContext(Guid.NewGuid().ToString("N")); + EstateManagementContext context = await this.GetContext(Guid.NewGuid().ToString("N")); DbContextFactory.Setup(d => d.GetContext(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(context); var result = await this.VoucherDomainService.IssueVoucher(TestData.VoucherId, @@ -120,7 +120,7 @@ public async Task VoucherDomainService_IssueVoucher_OperatorNotSupportedByEstate this.AggregateService.Setup(v => v.GetLatest(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(new VoucherAggregate())); this.AggregateService.Setup(f => f.Get(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperator())); - EstateManagementGenericContext context = await this.GetContext(Guid.NewGuid().ToString("N")); + EstateManagementContext context = await this.GetContext(Guid.NewGuid().ToString("N")); DbContextFactory.Setup(d => d.GetContext(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(context); var result = await this.VoucherDomainService.IssueVoucher(TestData.VoucherId, @@ -142,7 +142,7 @@ public async Task VoucherDomainService_IssueVoucher_VoucherIssued() { this.AggregateService.Setup(v => v.Save(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success); this.AggregateService.Setup(f => f.Get(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.Aggregates.EstateAggregateWithOperator())); - EstateManagementGenericContext context = await this.GetContext(Guid.NewGuid().ToString("N")); + EstateManagementContext context = await this.GetContext(Guid.NewGuid().ToString("N")); DbContextFactory.Setup(d => d.GetContext(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(context); var result = await this.VoucherDomainService.IssueVoucher(TestData.VoucherId, @@ -166,7 +166,7 @@ public async Task VoucherDomainService_RedeemVoucher_InvalidEstate_ErrorThrown() .ReturnsAsync(Result.Success(TestData.GetVoucherAggregateWithRecipientMobile())); this.AggregateService.Setup(f => f.Get(It.IsAny(), It.IsAny())).ReturnsAsync(TestData.Aggregates.EmptyEstateAggregate); - EstateManagementGenericContext context = await this.GetContext(Guid.NewGuid().ToString("N")); + EstateManagementContext context = await this.GetContext(Guid.NewGuid().ToString("N")); context.VoucherProjectionStates.Add(new TransactionProcessor.Database.Entities.VoucherProjectionState() { VoucherCode = TestData.VoucherCode, OperatorIdentifier = TestData.OperatorIdentifier, @@ -192,7 +192,7 @@ public async Task VoucherDomainService_RedeemVoucher_VoucherRedeemed() { .ReturnsAsync(Result.Success); this.AggregateService.Setup(f => f.Get(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.Aggregates.CreatedEstateAggregate())); - EstateManagementGenericContext context = await this.GetContext(Guid.NewGuid().ToString("N")); + EstateManagementContext context = await this.GetContext(Guid.NewGuid().ToString("N")); context.VoucherProjectionStates.Add(new TransactionProcessor.Database.Entities.VoucherProjectionState() { VoucherCode = TestData.VoucherCode, OperatorIdentifier = TestData.OperatorIdentifier, @@ -217,7 +217,7 @@ public async Task VoucherDomainService_RedeemVoucher_VoucherNotFound_ErrorThrown .ReturnsAsync(Result.Success(TestData.GetVoucherAggregateWithRecipientMobile())); this.AggregateService.Setup(f => f.Get(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success(TestData.Aggregates.CreatedEstateAggregate())); - EstateManagementGenericContext context = await this.GetContext(Guid.NewGuid().ToString("N")); + EstateManagementContext context = await this.GetContext(Guid.NewGuid().ToString("N")); DbContextFactory.Setup(d => d.GetContext(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(context); var result = await this.VoucherDomainService.RedeemVoucher(TestData.EstateId, @@ -227,14 +227,14 @@ public async Task VoucherDomainService_RedeemVoucher_VoucherNotFound_ErrorThrown result.IsFailed.ShouldBeTrue(); } - private async Task GetContext(String databaseName, + private async Task GetContext(String databaseName, TestDatabaseType databaseType = TestDatabaseType.InMemory) { - EstateManagementGenericContext context = null; + EstateManagementContext context = null; if (databaseType == TestDatabaseType.InMemory) { - DbContextOptionsBuilder builder = new DbContextOptionsBuilder() + DbContextOptionsBuilder builder = new DbContextOptionsBuilder() .UseInMemoryDatabase(databaseName) .ConfigureWarnings(w => w.Ignore(InMemoryEventId.TransactionIgnoredWarning)); - context = new EstateManagementSqlServerContext(builder.Options); + context = new EstateManagementContext(builder.Options); } else { throw new NotSupportedException($"Database type [{databaseType}] not supported"); diff --git a/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj b/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj index 0b867c81..880f67dd 100644 --- a/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj +++ b/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj @@ -1,27 +1,28 @@  - net8.0 + net9.0 Full false - - - - - + + + + + - - - - - + + + + + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/TransactionProcessor.BusinessLogic/EventHandling/VoucherDomainEventHandler.cs b/TransactionProcessor.BusinessLogic/EventHandling/VoucherDomainEventHandler.cs index 9de2fcb5..3ac9a8c0 100644 --- a/TransactionProcessor.BusinessLogic/EventHandling/VoucherDomainEventHandler.cs +++ b/TransactionProcessor.BusinessLogic/EventHandling/VoucherDomainEventHandler.cs @@ -31,7 +31,7 @@ public class VoucherDomainEventHandler : IDomainEventHandler /// /// The database context factory /// - private readonly Shared.EntityFramework.IDbContextFactory DbContextFactory; + private readonly Shared.EntityFramework.IDbContextFactory DbContextFactory; /// /// The file system @@ -60,7 +60,7 @@ public class VoucherDomainEventHandler : IDomainEventHandler public VoucherDomainEventHandler(ISecurityServiceClient securityServiceClient, IAggregateService aggregateService, - Shared.EntityFramework.IDbContextFactory dbContextFactory, + Shared.EntityFramework.IDbContextFactory dbContextFactory, IMessagingServiceClient messagingServiceClient, IFileSystem fileSystem) { @@ -125,7 +125,7 @@ private async Task GetVoucherOperator(Models.Voucher voucherModel, { // TODO: Can this be done in a better way than direct db access ? - EstateManagementGenericContext context = await this.DbContextFactory.GetContext(voucherModel.EstateId, ConnectionStringIdentifier, cancellationToken); + EstateManagementContext context = await this.DbContextFactory.GetContext(voucherModel.EstateId, ConnectionStringIdentifier, cancellationToken); Database.Entities.Transaction transaction = await context.Transactions.SingleOrDefaultAsync(t => t.TransactionId == voucherModel.TransactionId, cancellationToken); if (transaction == null) diff --git a/TransactionProcessor.BusinessLogic/Manager/IVoucherManagementManager.cs b/TransactionProcessor.BusinessLogic/Manager/IVoucherManagementManager.cs index 34241a95..16d86988 100644 --- a/TransactionProcessor.BusinessLogic/Manager/IVoucherManagementManager.cs +++ b/TransactionProcessor.BusinessLogic/Manager/IVoucherManagementManager.cs @@ -47,7 +47,7 @@ public class VoucherManagementManager : IVoucherManagementManager /// /// The database context factory /// - private readonly Shared.EntityFramework.IDbContextFactory DbContextFactory; + private readonly Shared.EntityFramework.IDbContextFactory DbContextFactory; private readonly IAggregateService AggregateService; @@ -57,7 +57,7 @@ public class VoucherManagementManager : IVoucherManagementManager #region Constructors - public VoucherManagementManager(Shared.EntityFramework.IDbContextFactory dbContextFactory, + public VoucherManagementManager(Shared.EntityFramework.IDbContextFactory dbContextFactory, IAggregateService aggregateService) { this.DbContextFactory = dbContextFactory; @@ -80,7 +80,7 @@ public async Task> GetVoucherByCode(Guid estateId, String voucherCode, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.DbContextFactory.GetContext(estateId,VoucherManagementManager.ConnectionStringIdentifier, cancellationToken); + EstateManagementContext context = await this.DbContextFactory.GetContext(estateId,VoucherManagementManager.ConnectionStringIdentifier, cancellationToken); VoucherProjectionState voucher = await context.VoucherProjectionStates.SingleOrDefaultAsync(v => v.VoucherCode == voucherCode, cancellationToken); @@ -103,7 +103,7 @@ public async Task> GetVoucherByTransactionId(Guid estateId, Guid transactionId, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.DbContextFactory.GetContext(estateId, ConnectionStringIdentifier, cancellationToken); + EstateManagementContext context = await this.DbContextFactory.GetContext(estateId, ConnectionStringIdentifier, cancellationToken); VoucherProjectionState voucher = await context.VoucherProjectionStates.SingleOrDefaultAsync(v => v.TransactionId == transactionId, cancellationToken); if (voucher == null) diff --git a/TransactionProcessor.BusinessLogic/Services/VoucherDomainService.cs b/TransactionProcessor.BusinessLogic/Services/VoucherDomainService.cs index b390484f..55e73b4f 100644 --- a/TransactionProcessor.BusinessLogic/Services/VoucherDomainService.cs +++ b/TransactionProcessor.BusinessLogic/Services/VoucherDomainService.cs @@ -65,14 +65,14 @@ public class VoucherDomainService : IVoucherDomainService { private readonly IAggregateService AggregateService; - private readonly Shared.EntityFramework.IDbContextFactory DbContextFactory; + private readonly Shared.EntityFramework.IDbContextFactory DbContextFactory; private const String ConnectionStringIdentifier = "EstateReportingReadModel"; #region Constructors public VoucherDomainService(IAggregateService aggregateService, - Shared.EntityFramework.IDbContextFactory dbContextFactory) + Shared.EntityFramework.IDbContextFactory dbContextFactory) { this.AggregateService = aggregateService; this.DbContextFactory = dbContextFactory; @@ -160,7 +160,7 @@ public async Task> RedeemVoucher(Guid estateId, CancellationToken cancellationToken) { // Find the voucher based on the voucher code - EstateManagementGenericContext context = await this.DbContextFactory.GetContext(estateId, VoucherDomainService.ConnectionStringIdentifier, cancellationToken); + EstateManagementContext context = await this.DbContextFactory.GetContext(estateId, VoucherDomainService.ConnectionStringIdentifier, cancellationToken); TransactionProcessor.Database.Entities.VoucherProjectionState voucher = await context.VoucherProjectionStates.SingleOrDefaultAsync(v => v.VoucherCode == voucherCode, cancellationToken); diff --git a/TransactionProcessor.BusinessLogic/TransactionProcessor.BusinessLogic.csproj b/TransactionProcessor.BusinessLogic/TransactionProcessor.BusinessLogic.csproj index 17c6f90b..58f6da8b 100644 --- a/TransactionProcessor.BusinessLogic/TransactionProcessor.BusinessLogic.csproj +++ b/TransactionProcessor.BusinessLogic/TransactionProcessor.BusinessLogic.csproj @@ -1,28 +1,29 @@  - net8.0 + net9.0 - - - - - + + + + + - - - - - - - + + + + + + - - - + + + + + diff --git a/TransactionProcessor.Client/TransactionProcessor.Client.csproj b/TransactionProcessor.Client/TransactionProcessor.Client.csproj index cc0ded17..e29fa048 100644 --- a/TransactionProcessor.Client/TransactionProcessor.Client.csproj +++ b/TransactionProcessor.Client/TransactionProcessor.Client.csproj @@ -1,13 +1,13 @@  - net8.0 + net9.0 $(TargetsForTfmSpecificBuildOutput);IncludeP2PAssets - - + + diff --git a/TransactionProcessor.DataTransferObjects/TransactionProcessor.DataTransferObjects.csproj b/TransactionProcessor.DataTransferObjects/TransactionProcessor.DataTransferObjects.csproj index 5e21a7aa..9ec9b182 100644 --- a/TransactionProcessor.DataTransferObjects/TransactionProcessor.DataTransferObjects.csproj +++ b/TransactionProcessor.DataTransferObjects/TransactionProcessor.DataTransferObjects.csproj @@ -1,14 +1,14 @@  - net8.0;netstandard2.1 + net9.0 None - + - + diff --git a/TransactionProcessor.Database/Contexts/EstateManagementGenericContext.cs b/TransactionProcessor.Database/Contexts/EstateManagementGenericContext.cs index 05fd4913..4c10d1d8 100644 --- a/TransactionProcessor.Database/Contexts/EstateManagementGenericContext.cs +++ b/TransactionProcessor.Database/Contexts/EstateManagementGenericContext.cs @@ -1,4 +1,5 @@ using EntityFramework.Exceptions.Common; +using EntityFramework.Exceptions.SqlServer; using Microsoft.EntityFrameworkCore; using Shared.DomainDrivenDesign.EventSourcing; using Shared.Exceptions; @@ -14,28 +15,24 @@ namespace TransactionProcessor.Database.Contexts; -public abstract class EstateManagementGenericContext : DbContext +public class EstateManagementContext : DbContext { #region Fields protected readonly String ConnectionString; - protected readonly String DatabaseEngine; - protected static List TablesToIgnoreDuplicates = new List(); #endregion #region Constructors - protected EstateManagementGenericContext(String databaseEngine, - String connectionString) + public EstateManagementContext(String connectionString) { - this.DatabaseEngine = databaseEngine; this.ConnectionString = connectionString; } - public EstateManagementGenericContext(DbContextOptions dbContextOptions) : base(dbContextOptions) + public EstateManagementContext(DbContextOptions dbContextOptions) : base(dbContextOptions) { } @@ -125,7 +122,7 @@ private async Task CreateStoredProcedures(CancellationToken cancellationToken) String executingAssemblyLocation = Assembly.GetExecutingAssembly().Location; String executingAssemblyFolder = Path.GetDirectoryName(executingAssemblyLocation); - String scriptsFolder = $@"{executingAssemblyFolder}/StoredProcedures/{this.DatabaseEngine}"; + String scriptsFolder = $@"{executingAssemblyFolder}/StoredProcedures"; String[] directories = Directory.GetDirectories(scriptsFolder); if (directories.Length == 0) @@ -152,19 +149,29 @@ private async Task CreateStoredProcedures(CancellationToken cancellationToken) // Create the new view using the original sql from file await this.Database.ExecuteSqlRawAsync(sql, cancellationToken); - Logger.LogInformation($"Created Stored Procedure [{sqlFile}] successfully."); + Logger.LogWarning($"Created Stored Procedure [{sqlFile}] successfully."); } } } + protected override void OnConfiguring(DbContextOptionsBuilder options) + { + if (!string.IsNullOrWhiteSpace(this.ConnectionString)) + { + options.UseSqlServer(this.ConnectionString); + } + + options.UseExceptionProcessor(); + } + private async Task CreateViews(CancellationToken cancellationToken) { String executingAssemblyLocation = Assembly.GetExecutingAssembly().Location; String executingAssemblyFolder = Path.GetDirectoryName(executingAssemblyLocation); - String scriptsFolder = $@"{executingAssemblyFolder}/Views/{this.DatabaseEngine}"; + String scriptsFolder = $@"{executingAssemblyFolder}/Views"; - String[] directiories = Directory.GetDirectories(scriptsFolder); + String[] directiories = Directory.GetDirectories(scriptsFolder, "", SearchOption.AllDirectories); directiories = directiories.OrderBy(d => d).ToArray(); foreach (String directiory in directiories) @@ -184,7 +191,7 @@ private async Task CreateViews(CancellationToken cancellationToken) // Create the new view using the original sql from file await this.Database.ExecuteSqlRawAsync(sql, cancellationToken); - Logger.LogInformation($"Created View [{sqlFile}] successfully."); + Logger.LogWarning($"Created View [{sqlFile}] successfully."); } } } @@ -194,7 +201,7 @@ private async Task SeedStandingData(CancellationToken cancellationToken) String executingAssemblyLocation = Assembly.GetExecutingAssembly().Location; String executingAssemblyFolder = Path.GetDirectoryName(executingAssemblyLocation); - String scriptsFolder = $@"{executingAssemblyFolder}/SeedingScripts"; ///{this.DatabaseEngine}"; + String scriptsFolder = $@"{executingAssemblyFolder}/SeedingScripts"; String[] sqlFiles = Directory.GetFiles(scriptsFolder, "*.sql"); foreach (String sqlFile in sqlFiles.OrderBy(x => x)) @@ -211,25 +218,21 @@ private async Task SeedStandingData(CancellationToken cancellationToken) // Create the new view using the original sql from file await this.Database.ExecuteSqlRawAsync(sql, cancellationToken); - Logger.LogInformation($"Run Seeding Script [{sqlFile}] successfully."); + Logger.LogWarning($"Run Seeding Script [{sqlFile}] successfully."); } } public static Boolean IsDuplicateInsertsIgnored(String tableName) => - EstateManagementGenericContext.TablesToIgnoreDuplicates.Contains(tableName.Trim(), StringComparer.InvariantCultureIgnoreCase); + EstateManagementContext.TablesToIgnoreDuplicates.Contains(tableName.Trim(), StringComparer.InvariantCultureIgnoreCase); public virtual async Task MigrateAsync(CancellationToken cancellationToken) { - if (this.Database.IsSqlServer() || this.Database.IsMySql()) + if (this.Database.IsSqlServer()) { await this.Database.MigrateAsync(cancellationToken); await this.SetIgnoreDuplicates(cancellationToken); await this.CreateViews(cancellationToken); await this.SeedStandingData(cancellationToken); - } - - if (this.Database.IsSqlServer()) - { await this.CreateStoredProcedures(cancellationToken); } } @@ -295,10 +298,16 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) protected virtual async Task SetIgnoreDuplicates(CancellationToken cancellationToken) { - EstateManagementGenericContext.TablesToIgnoreDuplicates = new List { + EstateManagementContext.TablesToIgnoreDuplicates = new List { nameof(this.ResponseCodes), nameof(this.MerchantBalanceProjectionState), }; + + var tableList = EstateManagementContext.TablesToIgnoreDuplicates.Select(x => $"ALTER TABLE [{x}] REBUILD WITH (IGNORE_DUP_KEY = ON)").ToList(); + + String sql = string.Join(";", tableList); + + await this.Database.ExecuteSqlRawAsync(sql, cancellationToken); } public new async Task SaveChangesAsync(CancellationToken cancellationToken) { @@ -343,8 +352,9 @@ private static String BuildUniqueConstraintExceptionLogMessage(UniqueConstraintE #endregion } -public static class EstateManagementGenericContextExtensions { - public static async Task> LoadEstate(this EstateManagementGenericContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) +public static class EstateManagementContextExtensions +{ + public static async Task> LoadEstate(this EstateManagementContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) { Guid estateId = DomainEventHelper.GetEstateId(domainEvent); Estate estate = await context.Estates.SingleOrDefaultAsync(e => e.EstateId == estateId, cancellationToken); @@ -355,7 +365,7 @@ public static async Task> LoadEstate(this EstateManagementGeneric }; } - public static async Task> LoadOperator(this EstateManagementGenericContext context, Guid operatorId, CancellationToken cancellationToken) + public static async Task> LoadOperator(this EstateManagementContext context, Guid operatorId, CancellationToken cancellationToken) { Operator @operator = await context.Operators.SingleOrDefaultAsync(e => e.OperatorId == operatorId, cancellationToken); @@ -366,7 +376,7 @@ public static async Task> LoadOperator(this EstateManagementGen }; } - public static async Task> LoadOperator(this EstateManagementGenericContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) + public static async Task> LoadOperator(this EstateManagementContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) { Guid operatorId = DomainEventHelper.GetOperatorId(domainEvent); Result loadOperatorResult = await context.LoadOperator(operatorId, cancellationToken); @@ -374,7 +384,7 @@ public static async Task> LoadOperator(this EstateManagementGen return loadOperatorResult; } - public static async Task> LoadMerchantDevice(this EstateManagementGenericContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) + public static async Task> LoadMerchantDevice(this EstateManagementContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) { Guid merchantId = DomainEventHelper.GetMerchantId(domainEvent); Guid deviceId = DomainEventHelper.GetDeviceId(domainEvent); @@ -388,7 +398,7 @@ public static async Task> LoadMerchantDevice(this EstateM }; } - public static async Task> LoadFile(this EstateManagementGenericContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) + public static async Task> LoadFile(this EstateManagementContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) { Guid fileId = DomainEventHelper.GetFileId(domainEvent); File file = await context.Files.SingleOrDefaultAsync(e => e.FileId == fileId, cancellationToken: cancellationToken); @@ -400,7 +410,7 @@ public static async Task> LoadFile(this EstateManagementGenericCont }; } - public static async Task> LoadMerchant(this EstateManagementGenericContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) + public static async Task> LoadMerchant(this EstateManagementContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) { Guid merchantId = DomainEventHelper.GetMerchantId(domainEvent); Merchant merchant = await context.Merchants.SingleOrDefaultAsync(e => e.MerchantId == merchantId, cancellationToken: cancellationToken); @@ -411,7 +421,7 @@ public static async Task> LoadMerchant(this EstateManagementGen }; } - public static async Task> LoadMerchantAddress(this EstateManagementGenericContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) + public static async Task> LoadMerchantAddress(this EstateManagementContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) { Guid merchantId = DomainEventHelper.GetMerchantId(domainEvent); Guid addressId = DomainEventHelper.GetAddressId(domainEvent); @@ -426,7 +436,7 @@ public static async Task> LoadMerchantAddress(this Estat }; } - public static async Task> LoadMerchantContact(this EstateManagementGenericContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) + public static async Task> LoadMerchantContact(this EstateManagementContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) { Guid merchantId = DomainEventHelper.GetMerchantId(domainEvent); @@ -440,7 +450,7 @@ public static async Task> LoadMerchantContact(this Estat }; } - public static async Task> LoadReconcilation(this EstateManagementGenericContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) + public static async Task> LoadReconcilation(this EstateManagementContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) { Guid transactionId = DomainEventHelper.GetTransactionId(domainEvent); Reconciliation reconciliation = @@ -452,7 +462,7 @@ public static async Task> LoadReconcilation(this EstateMa }; } - public static async Task> LoadSettlement(this EstateManagementGenericContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) + public static async Task> LoadSettlement(this EstateManagementContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) { Guid settlementId = DomainEventHelper.GetSettlementId(domainEvent); Settlement settlement = await context.Settlements.SingleOrDefaultAsync(e => e.SettlementId == settlementId, cancellationToken: cancellationToken); @@ -464,7 +474,7 @@ public static async Task> LoadSettlement(this EstateManagemen }; } - public static async Task> LoadStatementHeader(this EstateManagementGenericContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) + public static async Task> LoadStatementHeader(this EstateManagementContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) { Guid statementHeaderId = DomainEventHelper.GetStatementHeaderId(domainEvent); StatementHeader statementHeader = await context.StatementHeaders.SingleOrDefaultAsync(e => e.StatementId == statementHeaderId, cancellationToken: cancellationToken); @@ -476,7 +486,7 @@ public static async Task> LoadStatementHeader(this Estat }; } - public static async Task> LoadTransaction(this EstateManagementGenericContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) + public static async Task> LoadTransaction(this EstateManagementContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) { Guid transactionId = DomainEventHelper.GetTransactionId(domainEvent); Transaction transaction = await context.Transactions.SingleOrDefaultAsync(e => e.TransactionId == transactionId, cancellationToken: cancellationToken); @@ -500,7 +510,7 @@ public static async Task> LoadTransaction(this EstateManagem // }; //} - public static async Task> LoadContract(this EstateManagementGenericContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) + public static async Task> LoadContract(this EstateManagementContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) { Guid contractId = DomainEventHelper.GetContractId(domainEvent); Entities.Contract contract = await context.Contracts.SingleOrDefaultAsync(e => e.ContractId == contractId, cancellationToken: cancellationToken); @@ -512,7 +522,7 @@ public static async Task> LoadTransaction(this EstateManagem }; } - public static async Task> LoadContractProductTransactionFee(this EstateManagementGenericContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) + public static async Task> LoadContractProductTransactionFee(this EstateManagementContext context, IDomainEvent domainEvent, CancellationToken cancellationToken) { Guid contractProductTransactionFeeId = DomainEventHelper.GetContractProductTransactionFeeId(domainEvent); ContractProductTransactionFee contractProductTransactionFee = await context.ContractProductTransactionFees.SingleOrDefaultAsync(e => e.ContractProductTransactionFeeId == contractProductTransactionFeeId, cancellationToken: cancellationToken); diff --git a/TransactionProcessor.Database/Contexts/EstateManagementMySqlContext.cs b/TransactionProcessor.Database/Contexts/EstateManagementMySqlContext.cs deleted file mode 100644 index e3b7d21b..00000000 --- a/TransactionProcessor.Database/Contexts/EstateManagementMySqlContext.cs +++ /dev/null @@ -1,30 +0,0 @@ -using EntityFramework.Exceptions.MySQL.Pomelo; -using Microsoft.EntityFrameworkCore; -using Shared.General; - -namespace TransactionProcessor.Database.Contexts; - -public class EstateManagementMySqlContext : EstateManagementGenericContext -{ - public EstateManagementMySqlContext() : base("MySql", ConfigurationReader.GetConnectionString("EstateReportingReadModel")) - { - } - - public EstateManagementMySqlContext(String connectionString) : base("MySql", connectionString) - { - } - - public EstateManagementMySqlContext(DbContextOptions dbContextOptions) : base(dbContextOptions) - { - } - - protected override void OnConfiguring(DbContextOptionsBuilder options) - { - if (!string.IsNullOrWhiteSpace(this.ConnectionString)) - { - options.UseMySql(this.ConnectionString, ServerVersion.Parse("8.0.27")).AddInterceptors(new MySqlIgnoreDuplicatesOnInsertInterceptor()); - } - - options.UseExceptionProcessor(); - } -} \ No newline at end of file diff --git a/TransactionProcessor.Database/Contexts/EstateManagementSqlServerContext.cs b/TransactionProcessor.Database/Contexts/EstateManagementSqlServerContext.cs deleted file mode 100644 index 744461a2..00000000 --- a/TransactionProcessor.Database/Contexts/EstateManagementSqlServerContext.cs +++ /dev/null @@ -1,48 +0,0 @@ -using EntityFramework.Exceptions.SqlServer; -using Microsoft.EntityFrameworkCore; -using Shared.General; - -namespace TransactionProcessor.Database.Contexts; - -public class EstateManagementSqlServerContext : EstateManagementGenericContext -{ - public EstateManagementSqlServerContext() : base("SqlServer", ConfigurationReader.GetConnectionString("EstateReportingReadModel")) - { - } - - public EstateManagementSqlServerContext(String connectionString) : base("SqlServer", connectionString) - { - } - - public EstateManagementSqlServerContext(DbContextOptions dbContextOptions) : base(dbContextOptions) - { - } - - protected override void OnConfiguring(DbContextOptionsBuilder options) - { - if (!string.IsNullOrWhiteSpace(this.ConnectionString)) - { - options.UseSqlServer(this.ConnectionString); - } - - options.UseExceptionProcessor(); - } - - protected override async Task SetIgnoreDuplicates(CancellationToken cancellationToken) - { - base.SetIgnoreDuplicates(cancellationToken); - - var tableList = EstateManagementGenericContext.TablesToIgnoreDuplicates.Select(x => $"ALTER TABLE [{x}] REBUILD WITH (IGNORE_DUP_KEY = ON)").ToList(); - - String sql = string.Join(";", tableList); - - await this.Database.ExecuteSqlRawAsync(sql, cancellationToken); - - //var tableList2 = new List(); - //tableList2.AddRange(EstateManagementGenericContext.TablesToIgnoreDuplicates.Select(x => $"DECLARE @TableName NVARCHAR(128);\r\nDECLARE @IndexScript NVARCHAR(MAX) = '';\r\nSET @TableName = '{x}';\r\n\r\nSELECT @IndexScript = @IndexScript + 'ALTER INDEX ' + QUOTENAME(i.name) + ' ON ' + QUOTENAME(OBJECT_SCHEMA_NAME(i.object_id)) + '.' + QUOTENAME(OBJECT_NAME(i.object_id)) + ' SET ( IGNORE_DUP_KEY = ON );'\r\nFROM sys.indexes AS i\r\nWHERE i.object_id = OBJECT_ID(@TableName) AND i.index_id > 0 and is_primary_key = 0 and is_unique = 1;\r\n\r\nEXEC sp_executesql @IndexScript;").ToList()); - - //foreach (String sql2 in tableList2){ - // await this.Database.ExecuteSqlRawAsync(sql2, cancellationToken); - //} - } -} \ No newline at end of file diff --git a/TransactionProcessor.Database/Contexts/MySqlIgnoreDuplicatesOnInsertInterceptor.cs b/TransactionProcessor.Database/Contexts/MySqlIgnoreDuplicatesOnInsertInterceptor.cs deleted file mode 100644 index b2dedbd3..00000000 --- a/TransactionProcessor.Database/Contexts/MySqlIgnoreDuplicatesOnInsertInterceptor.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System.Data.Common; -using Microsoft.EntityFrameworkCore.Diagnostics; - -namespace TransactionProcessor.Database.Contexts -{ - public class MySqlIgnoreDuplicatesOnInsertInterceptor : DbCommandInterceptor - { - public override ValueTask> NonQueryExecutingAsync(DbCommand command, - CommandEventData eventData, - InterceptionResult result, - CancellationToken cancellationToken = new CancellationToken()) - { - command.CommandText = this.SetIgnoreDuplicates(command.CommandText); - return new ValueTask>(result); - } - - public override ValueTask> ScalarExecutingAsync(DbCommand command, - CommandEventData eventData, - InterceptionResult result, - CancellationToken cancellationToken = new CancellationToken()) - { - command.CommandText = this.SetIgnoreDuplicates(command.CommandText); - return new ValueTask>(result); - } - - public override ValueTask> ReaderExecutingAsync(DbCommand command, - CommandEventData eventData, - InterceptionResult result, - CancellationToken cancellationToken = new CancellationToken()) - { - command.CommandText = this.SetIgnoreDuplicates(command.CommandText); - - return new ValueTask>(result); - } - - public override InterceptionResult ScalarExecuting(DbCommand command, - CommandEventData eventData, - InterceptionResult result) - { - command.CommandText = this.SetIgnoreDuplicates(command.CommandText); - return result; - } - - public override InterceptionResult NonQueryExecuting(DbCommand command, - CommandEventData eventData, - InterceptionResult result) - { - command.CommandText = this.SetIgnoreDuplicates(command.CommandText); - return result; - } - - public override InterceptionResult ReaderExecuting(DbCommand command, - CommandEventData eventData, - InterceptionResult result) - { - command.CommandText = this.SetIgnoreDuplicates(command.CommandText); - return result; - } - - private String SetIgnoreDuplicates(String commandText) - { - if (this.IsCommandInsert(commandText)) - { - if (EstateManagementGenericContext.IsDuplicateInsertsIgnored(this.GetTableName(commandText))) - { - // Swap the insert to ignore duplicates - return commandText.Replace("INSERT INTO", "INSERT IGNORE INTO"); - } - } - - return commandText; - } - - private Boolean IsCommandInsert(String commandText) => commandText.Contains("INSERT INTO", StringComparison.InvariantCultureIgnoreCase); - - private String GetTableName(String commandText) - { - // Extract table and check if we are ignoring duplicates - Int32 tablenameEnd = commandText.IndexOf("("); - Int32 tablenameStart = 11; - String tableName = commandText.Substring(tablenameStart, tablenameEnd - tablenameStart); - tableName = tableName.Replace("`", ""); - return tableName; - } - } -} \ No newline at end of file diff --git a/TransactionProcessor.Database/Migrations/MySql/20221115193718_InitialDatabase.Designer.cs b/TransactionProcessor.Database/Migrations/MySql/20221115193718_InitialDatabase.Designer.cs deleted file mode 100644 index 9f623bc5..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20221115193718_InitialDatabase.Designer.cs +++ /dev/null @@ -1,1065 +0,0 @@ -// - -#nullable disable - -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using TransactionProcessor.Database.Contexts; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - [DbContext(typeof(EstateManagementMySqlContext))] - [Migration("20221115193718_InitialDatabase")] - partial class InitialDatabase - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.5") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("EstateManagement.Database.Entities.Calendar", b => - { - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DayOfWeekNumber") - .HasColumnType("int"); - - b.Property("DayOfWeekShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameLong") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("WeekNumberString") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Year") - .HasColumnType("int"); - - b.Property("YearWeekNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Date"); - - b.ToTable("calendar"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Contract", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateId", "OperatorId", "ContractId"); - - b.ToTable("contract"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProduct", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("DisplayText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.HasKey("EstateId", "ContractId", "ProductId"); - - b.ToTable("contractproduct"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProductTransactionFee", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("TransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Value") - .HasColumnType("decimal(18,4)"); - - b.HasKey("EstateId", "ContractId", "ProductId", "TransactionFeeId"); - - b.ToTable("contractproducttransactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Estate", b => - { - b.Property("EstateId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.HasKey("EstateId"); - - b.ToTable("estate"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateOperator", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RequireCustomMerchantNumber") - .HasColumnType("tinyint(1)"); - - b.Property("RequireCustomTerminalNumber") - .HasColumnType("tinyint(1)"); - - b.HasKey("EstateId", "OperatorId"); - - b.ToTable("estateoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateSecurityUser", b => - { - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("SecurityUserId", "EstateId"); - - b.ToTable("estatesecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.File", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("EstateId", "FileImportLogId", "FileId"); - - b.ToTable("file"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLog", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateId", "FileImportLogId"); - - b.ToTable("fileimportlog"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLogFile", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileUploadedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OriginalFileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("EstateId", "FileImportLogId", "FileId"); - - b.ToTable("fileimportlogfile"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileLine", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("LineNumber") - .HasColumnType("int"); - - b.Property("FileLineData") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.HasKey("EstateId", "FileId", "LineNumber"); - - b.ToTable("fileline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Merchant", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastStatementGenerated") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.Property("SettlementSchedule") - .HasColumnType("int"); - - b.HasKey("EstateId", "MerchantId"); - - b.ToTable("merchant"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantAddress", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("AddressId") - .HasColumnType("char(36)"); - - b.Property("AddressLine1") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AddressLine2") - .HasColumnType("longtext"); - - b.Property("AddressLine3") - .HasColumnType("longtext"); - - b.Property("AddressLine4") - .HasColumnType("longtext"); - - b.Property("Country") - .HasColumnType("longtext"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("PostalCode") - .HasColumnType("longtext"); - - b.Property("Region") - .HasColumnType("longtext"); - - b.Property("Town") - .HasColumnType("longtext"); - - b.HasKey("EstateId", "MerchantId", "AddressId"); - - b.ToTable("merchantaddress"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContact", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("ContactId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.HasKey("EstateId", "MerchantId", "ContactId"); - - b.ToTable("merchantcontact"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantDevice", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("DeviceId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateId", "MerchantId", "DeviceId"); - - b.ToTable("merchantdevice"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantOperator", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("MerchantNumber") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TerminalNumber") - .HasColumnType("longtext"); - - b.HasKey("EstateId", "MerchantId", "OperatorId"); - - b.ToTable("merchantoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSecurityUser", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateId", "MerchantId", "SecurityUserId"); - - b.ToTable("merchantsecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSettlementFee", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("FeeId") - .HasColumnType("char(36)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("FeeCalculatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.HasKey("EstateId", "SettlementId", "TransactionId", "FeeId"); - - b.ToTable("merchantsettlementfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Reconciliation", b => - { - b.Property("TransactionId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("ResponseCode") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionCount") - .HasColumnType("int"); - - b.Property("TransactionDate") - .HasColumnType("datetime(6)"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionId"); - - b.ToTable("reconciliation"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ResponseCodes", b => - { - b.Property("ResponseCode") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ResponseCode"); - - b.ToTable("responsecodes"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Settlement", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateId", "SettlementId"); - - b.ToTable("settlement"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementHeader", b => - { - b.Property("StatementId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("StatementCreatedDate") - .HasColumnType("datetime(6)"); - - b.Property("StatementGeneratedDate") - .HasColumnType("datetime(6)"); - - b.HasKey("StatementId"); - - b.ToTable("statementheader"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementLine", b => - { - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ActivityType") - .HasColumnType("int"); - - b.Property("ActivityDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("InAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OutAmount") - .HasColumnType("decimal(65,30)"); - - b.HasKey("StatementId", "TransactionId", "ActivityDateTime", "ActivityType"); - - b.ToTable("statementline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Transaction", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("AuthorisationCode") - .HasColumnType("longtext"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("OperatorIdentifier") - .HasColumnType("longtext"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionDate") - .HasColumnType("datetime(6)"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionNumber") - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .HasColumnType("longtext"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .HasColumnType("longtext"); - - b.HasKey("EstateId", "MerchantId", "TransactionId"); - - b.ToTable("transaction"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalRequestData", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("Amount") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("CustomerAccountNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateId", "MerchantId", "TransactionId"); - - b.ToTable("transactionadditionalrequestdata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalResponseData", b => - { - b.Property("TransactionId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.HasKey("TransactionId"); - - b.ToTable("transactionadditionalresponsedata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionFee", b => - { - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("FeeId") - .HasColumnType("char(36)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("EventId") - .HasColumnType("char(36)"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionId", "FeeId"); - - b.ToTable("transactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Voucher", b => - { - b.Property("VoucherId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ExpiryDate") - .HasColumnType("datetime(6)"); - - b.Property("GenerateDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsGenerated") - .HasColumnType("tinyint(1)"); - - b.Property("IsIssued") - .HasColumnType("tinyint(1)"); - - b.Property("IsRedeemed") - .HasColumnType("tinyint(1)"); - - b.Property("IssuedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RecipientEmail") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RecipientMobile") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RedeemedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.Property("VoucherCode") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("VoucherId"); - - b.ToTable("voucher"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.FileImportLogView", b => - { - b.Property("FileCount") - .HasColumnType("int"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDate") - .HasColumnType("datetime(6)"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ImportLogTime") - .HasColumnType("time(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.ToTable("uvwFileImportLogView"); - - b.ToView("uvwFileImportLog"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.FileView", b => - { - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FailedCount") - .HasColumnType("int"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDate") - .HasColumnType("datetime(6)"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FileReceivedTime") - .HasColumnType("time(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("LineCount") - .HasColumnType("int"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PendingCount") - .HasColumnType("int"); - - b.Property("SuccessCount") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.ToTable("uvwFileView"); - - b.ToView("uvwFile"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.SettlementView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FeeDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToView("uvwSettlements"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.TransactionsView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ResponseCode") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionDate") - .HasColumnType("datetime(6)"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionType") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable("uvwTransactionsView"); - - b.ToView("uvwTransactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20221115193718_InitialDatabase.cs b/TransactionProcessor.Database/Migrations/MySql/20221115193718_InitialDatabase.cs deleted file mode 100644 index 8aab124a..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20221115193718_InitialDatabase.cs +++ /dev/null @@ -1,752 +0,0 @@ -#nullable disable - -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - public partial class InitialDatabase : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterDatabase() - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "calendar", - columns: table => new - { - Date = table.Column(type: "datetime(6)", nullable: false), - DayOfWeek = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - DayOfWeekNumber = table.Column(type: "int", nullable: false), - DayOfWeekShort = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - MonthNameLong = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - MonthNameShort = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - MonthNumber = table.Column(type: "int", nullable: false), - WeekNumber = table.Column(type: "int", nullable: true), - WeekNumberString = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Year = table.Column(type: "int", nullable: false), - YearWeekNumber = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_calendar", x => x.Date); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "contract", - columns: table => new - { - ContractId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - OperatorId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - Description = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_contract", x => new { x.EstateId, x.OperatorId, x.ContractId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "contractproduct", - columns: table => new - { - ContractId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - ProductId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - DisplayText = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ProductName = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Value = table.Column(type: "decimal(65,30)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_contractproduct", x => new { x.EstateId, x.ContractId, x.ProductId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "contractproducttransactionfee", - columns: table => new - { - ContractId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - ProductId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - TransactionFeeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - CalculationType = table.Column(type: "int", nullable: false), - FeeType = table.Column(type: "int", nullable: false), - IsEnabled = table.Column(type: "tinyint(1)", nullable: false), - Description = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Value = table.Column(type: "decimal(18,4)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_contractproducttransactionfee", x => new { x.EstateId, x.ContractId, x.ProductId, x.TransactionFeeId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "estate", - columns: table => new - { - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - CreatedDateTime = table.Column(type: "datetime(6)", nullable: false), - Name = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Reference = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_estate", x => x.EstateId); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "estateoperator", - columns: table => new - { - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - OperatorId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - Name = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - RequireCustomMerchantNumber = table.Column(type: "tinyint(1)", nullable: false), - RequireCustomTerminalNumber = table.Column(type: "tinyint(1)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_estateoperator", x => new { x.EstateId, x.OperatorId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "estatesecurityuser", - columns: table => new - { - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - SecurityUserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - CreatedDateTime = table.Column(type: "datetime(6)", nullable: false), - EmailAddress = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_estatesecurityuser", x => new { x.SecurityUserId, x.EstateId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "file", - columns: table => new - { - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - FileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - FileImportLogId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - FileLocation = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - FileProfileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - FileReceivedDateTime = table.Column(type: "datetime(6)", nullable: false), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - IsCompleted = table.Column(type: "tinyint(1)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_file", x => new { x.EstateId, x.FileImportLogId, x.FileId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "fileimportlog", - columns: table => new - { - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - FileImportLogId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - ImportLogDateTime = table.Column(type: "datetime(6)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_fileimportlog", x => new { x.EstateId, x.FileImportLogId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "fileimportlogfile", - columns: table => new - { - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - FileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - FileImportLogId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - FilePath = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - FileProfileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - FileUploadedDateTime = table.Column(type: "datetime(6)", nullable: false), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - OriginalFileName = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") - }, - constraints: table => - { - table.PrimaryKey("PK_fileimportlogfile", x => new { x.EstateId, x.FileImportLogId, x.FileId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "fileline", - columns: table => new - { - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - FileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - LineNumber = table.Column(type: "int", nullable: false), - FileLineData = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Status = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - TransactionId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") - }, - constraints: table => - { - table.PrimaryKey("PK_fileline", x => new { x.EstateId, x.FileId, x.LineNumber }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "merchant", - columns: table => new - { - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - CreatedDateTime = table.Column(type: "datetime(6)", nullable: false), - Name = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - SettlementSchedule = table.Column(type: "int", nullable: false), - Reference = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - LastStatementGenerated = table.Column(type: "datetime(6)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_merchant", x => new { x.EstateId, x.MerchantId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "merchantaddress", - columns: table => new - { - AddressId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - AddressLine1 = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - AddressLine2 = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - AddressLine3 = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - AddressLine4 = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Country = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - CreatedDateTime = table.Column(type: "datetime(6)", nullable: false), - PostalCode = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Region = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Town = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_merchantaddress", x => new { x.EstateId, x.MerchantId, x.AddressId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "merchantcontact", - columns: table => new - { - ContactId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - CreatedDateTime = table.Column(type: "datetime(6)", nullable: false), - EmailAddress = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Name = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - PhoneNumber = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_merchantcontact", x => new { x.EstateId, x.MerchantId, x.ContactId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "merchantdevice", - columns: table => new - { - DeviceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - CreatedDateTime = table.Column(type: "datetime(6)", nullable: false), - DeviceIdentifier = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_merchantdevice", x => new { x.EstateId, x.MerchantId, x.DeviceId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "merchantoperator", - columns: table => new - { - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - OperatorId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - MerchantNumber = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Name = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - TerminalNumber = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_merchantoperator", x => new { x.EstateId, x.MerchantId, x.OperatorId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "merchantsecurityuser", - columns: table => new - { - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - SecurityUserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - CreatedDateTime = table.Column(type: "datetime(6)", nullable: false), - EmailAddress = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_merchantsecurityuser", x => new { x.EstateId, x.MerchantId, x.SecurityUserId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "merchantsettlementfee", - columns: table => new - { - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - FeeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - SettlementId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - TransactionId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - CalculatedValue = table.Column(type: "decimal(65,30)", nullable: false), - FeeCalculatedDateTime = table.Column(type: "datetime(6)", nullable: false), - FeeValue = table.Column(type: "decimal(65,30)", nullable: false), - IsSettled = table.Column(type: "tinyint(1)", nullable: false), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") - }, - constraints: table => - { - table.PrimaryKey("PK_merchantsettlementfee", x => new { x.EstateId, x.SettlementId, x.TransactionId, x.FeeId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "reconciliation", - columns: table => new - { - TransactionId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - DeviceIdentifier = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - IsAuthorised = table.Column(type: "tinyint(1)", nullable: false), - IsCompleted = table.Column(type: "tinyint(1)", nullable: false), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - ResponseCode = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ResponseMessage = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - TransactionCount = table.Column(type: "int", nullable: false), - TransactionDate = table.Column(type: "datetime(6)", nullable: false), - TransactionDateTime = table.Column(type: "datetime(6)", nullable: false), - TransactionTime = table.Column(type: "time(6)", nullable: false), - TransactionValue = table.Column(type: "decimal(65,30)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_reconciliation", x => x.TransactionId); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "responsecodes", - columns: table => new - { - ResponseCode = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Description = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_responsecodes", x => x.ResponseCode); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "settlement", - columns: table => new - { - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - SettlementId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - IsCompleted = table.Column(type: "tinyint(1)", nullable: false), - SettlementDate = table.Column(type: "datetime(6)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_settlement", x => new { x.EstateId, x.SettlementId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "statementheader", - columns: table => new - { - StatementId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - StatementCreatedDate = table.Column(type: "datetime(6)", nullable: false), - StatementGeneratedDate = table.Column(type: "datetime(6)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_statementheader", x => x.StatementId); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "statementline", - columns: table => new - { - StatementId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - ActivityDateTime = table.Column(type: "datetime(6)", nullable: false), - ActivityType = table.Column(type: "int", nullable: false), - TransactionId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - ActivityDescription = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - InAmount = table.Column(type: "decimal(65,30)", nullable: false), - OutAmount = table.Column(type: "decimal(65,30)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_statementline", x => new { x.StatementId, x.TransactionId, x.ActivityDateTime, x.ActivityType }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "transaction", - columns: table => new - { - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - TransactionId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - AuthorisationCode = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ContractId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - DeviceIdentifier = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - IsAuthorised = table.Column(type: "tinyint(1)", nullable: false), - IsCompleted = table.Column(type: "tinyint(1)", nullable: false), - OperatorIdentifier = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ProductId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - ResponseCode = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ResponseMessage = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - TransactionDate = table.Column(type: "datetime(6)", nullable: false), - TransactionDateTime = table.Column(type: "datetime(6)", nullable: false), - TransactionNumber = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - TransactionReference = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - TransactionTime = table.Column(type: "time(6)", nullable: false), - TransactionType = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - TransactionSource = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_transaction", x => new { x.EstateId, x.MerchantId, x.TransactionId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "transactionadditionalrequestdata", - columns: table => new - { - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - TransactionId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - Amount = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - CustomerAccountNumber = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_transactionadditionalrequestdata", x => new { x.EstateId, x.MerchantId, x.TransactionId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "transactionadditionalresponsedata", - columns: table => new - { - TransactionId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") - }, - constraints: table => - { - table.PrimaryKey("PK_transactionadditionalresponsedata", x => x.TransactionId); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "transactionfee", - columns: table => new - { - FeeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - TransactionId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - CalculatedValue = table.Column(type: "decimal(65,30)", nullable: false), - CalculationType = table.Column(type: "int", nullable: false), - EventId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - FeeType = table.Column(type: "int", nullable: false), - FeeValue = table.Column(type: "decimal(65,30)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_transactionfee", x => new { x.TransactionId, x.FeeId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "uvwFileImportLogView", - columns: table => new - { - FileImportLogId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - ImportLogDateTime = table.Column(type: "datetime(6)", nullable: false), - ImportLogDate = table.Column(type: "datetime(6)", nullable: false), - ImportLogTime = table.Column(type: "time(6)", nullable: false), - FileCount = table.Column(type: "int", nullable: false), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") - }, - constraints: table => - { - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "uvwFileView", - columns: table => new - { - FileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - FileReceivedDateTime = table.Column(type: "datetime(6)", nullable: false), - FileReceivedDate = table.Column(type: "datetime(6)", nullable: false), - FileReceivedTime = table.Column(type: "time(6)", nullable: false), - IsCompleted = table.Column(type: "tinyint(1)", nullable: false), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - MerchantName = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - EmailAddress = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - LineCount = table.Column(type: "int", nullable: false), - PendingCount = table.Column(type: "int", nullable: false), - FailedCount = table.Column(type: "int", nullable: false), - SuccessCount = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "uvwTransactionsView", - columns: table => new - { - TransactionId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - TransactionDateTime = table.Column(type: "datetime(6)", nullable: false), - TransactionDate = table.Column(type: "datetime(6)", nullable: false), - DayOfWeek = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - WeekNumber = table.Column(type: "int", nullable: false), - Month = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - MonthNumber = table.Column(type: "int", nullable: false), - YearNumber = table.Column(type: "int", nullable: false), - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - IsAuthorised = table.Column(type: "tinyint(1)", nullable: false), - IsCompleted = table.Column(type: "tinyint(1)", nullable: false), - TransactionType = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ResponseCode = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Amount = table.Column(type: "decimal(65,30)", nullable: false), - OperatorIdentifier = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "voucher", - columns: table => new - { - VoucherId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - ExpiryDate = table.Column(type: "datetime(6)", nullable: false), - IsGenerated = table.Column(type: "tinyint(1)", nullable: false), - IsIssued = table.Column(type: "tinyint(1)", nullable: false), - IsRedeemed = table.Column(type: "tinyint(1)", nullable: false), - OperatorIdentifier = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - RecipientEmail = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - RecipientMobile = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Value = table.Column(type: "decimal(65,30)", nullable: false), - VoucherCode = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - TransactionId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - GenerateDateTime = table.Column(type: "datetime(6)", nullable: false), - IssuedDateTime = table.Column(type: "datetime(6)", nullable: false), - RedeemedDateTime = table.Column(type: "datetime(6)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_voucher", x => x.VoucherId); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "calendar"); - - migrationBuilder.DropTable( - name: "contract"); - - migrationBuilder.DropTable( - name: "contractproduct"); - - migrationBuilder.DropTable( - name: "contractproducttransactionfee"); - - migrationBuilder.DropTable( - name: "estate"); - - migrationBuilder.DropTable( - name: "estateoperator"); - - migrationBuilder.DropTable( - name: "estatesecurityuser"); - - migrationBuilder.DropTable( - name: "file"); - - migrationBuilder.DropTable( - name: "fileimportlog"); - - migrationBuilder.DropTable( - name: "fileimportlogfile"); - - migrationBuilder.DropTable( - name: "fileline"); - - migrationBuilder.DropTable( - name: "merchant"); - - migrationBuilder.DropTable( - name: "merchantaddress"); - - migrationBuilder.DropTable( - name: "merchantcontact"); - - migrationBuilder.DropTable( - name: "merchantdevice"); - - migrationBuilder.DropTable( - name: "merchantoperator"); - - migrationBuilder.DropTable( - name: "merchantsecurityuser"); - - migrationBuilder.DropTable( - name: "merchantsettlementfee"); - - migrationBuilder.DropTable( - name: "reconciliation"); - - migrationBuilder.DropTable( - name: "responsecodes"); - - migrationBuilder.DropTable( - name: "settlement"); - - migrationBuilder.DropTable( - name: "statementheader"); - - migrationBuilder.DropTable( - name: "statementline"); - - migrationBuilder.DropTable( - name: "transaction"); - - migrationBuilder.DropTable( - name: "transactionadditionalrequestdata"); - - migrationBuilder.DropTable( - name: "transactionadditionalresponsedata"); - - migrationBuilder.DropTable( - name: "transactionfee"); - - migrationBuilder.DropTable( - name: "uvwFileImportLogView"); - - migrationBuilder.DropTable( - name: "uvwFileView"); - - migrationBuilder.DropTable( - name: "uvwTransactionsView"); - - migrationBuilder.DropTable( - name: "voucher"); - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20221116082041_somenullfixes.Designer.cs b/TransactionProcessor.Database/Migrations/MySql/20221116082041_somenullfixes.Designer.cs deleted file mode 100644 index c8df65fc..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20221116082041_somenullfixes.Designer.cs +++ /dev/null @@ -1,1057 +0,0 @@ -// - -#nullable disable - -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using TransactionProcessor.Database.Contexts; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - [DbContext(typeof(EstateManagementMySqlContext))] - [Migration("20221116082041_somenullfixes")] - partial class somenullfixes - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.5") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("EstateManagement.Database.Entities.Calendar", b => - { - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DayOfWeekNumber") - .HasColumnType("int"); - - b.Property("DayOfWeekShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameLong") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("WeekNumberString") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Year") - .HasColumnType("int"); - - b.Property("YearWeekNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Date"); - - b.ToTable("calendar"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Contract", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateId", "OperatorId", "ContractId"); - - b.ToTable("contract"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProduct", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("DisplayText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.HasKey("EstateId", "ContractId", "ProductId"); - - b.ToTable("contractproduct"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProductTransactionFee", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("TransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Value") - .HasColumnType("decimal(18,4)"); - - b.HasKey("EstateId", "ContractId", "ProductId", "TransactionFeeId"); - - b.ToTable("contractproducttransactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Estate", b => - { - b.Property("EstateId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.HasKey("EstateId"); - - b.ToTable("estate"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateOperator", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RequireCustomMerchantNumber") - .HasColumnType("tinyint(1)"); - - b.Property("RequireCustomTerminalNumber") - .HasColumnType("tinyint(1)"); - - b.HasKey("EstateId", "OperatorId"); - - b.ToTable("estateoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateSecurityUser", b => - { - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("SecurityUserId", "EstateId"); - - b.ToTable("estatesecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.File", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("EstateId", "FileImportLogId", "FileId"); - - b.ToTable("file"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLog", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateId", "FileImportLogId"); - - b.ToTable("fileimportlog"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLogFile", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileUploadedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OriginalFileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("EstateId", "FileImportLogId", "FileId"); - - b.ToTable("fileimportlogfile"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileLine", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("LineNumber") - .HasColumnType("int"); - - b.Property("FileLineData") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.HasKey("EstateId", "FileId", "LineNumber"); - - b.ToTable("fileline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Merchant", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastStatementGenerated") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.Property("SettlementSchedule") - .HasColumnType("int"); - - b.HasKey("EstateId", "MerchantId"); - - b.ToTable("merchant"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantAddress", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("AddressId") - .HasColumnType("char(36)"); - - b.Property("AddressLine1") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AddressLine2") - .HasColumnType("longtext"); - - b.Property("AddressLine3") - .HasColumnType("longtext"); - - b.Property("AddressLine4") - .HasColumnType("longtext"); - - b.Property("Country") - .HasColumnType("longtext"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("PostalCode") - .HasColumnType("longtext"); - - b.Property("Region") - .HasColumnType("longtext"); - - b.Property("Town") - .HasColumnType("longtext"); - - b.HasKey("EstateId", "MerchantId", "AddressId"); - - b.ToTable("merchantaddress"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContact", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("ContactId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.HasKey("EstateId", "MerchantId", "ContactId"); - - b.ToTable("merchantcontact"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantDevice", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("DeviceId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateId", "MerchantId", "DeviceId"); - - b.ToTable("merchantdevice"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantOperator", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("MerchantNumber") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TerminalNumber") - .HasColumnType("longtext"); - - b.HasKey("EstateId", "MerchantId", "OperatorId"); - - b.ToTable("merchantoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSecurityUser", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateId", "MerchantId", "SecurityUserId"); - - b.ToTable("merchantsecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSettlementFee", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("FeeId") - .HasColumnType("char(36)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("FeeCalculatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.HasKey("EstateId", "SettlementId", "TransactionId", "FeeId"); - - b.ToTable("merchantsettlementfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Reconciliation", b => - { - b.Property("TransactionId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionCount") - .HasColumnType("int"); - - b.Property("TransactionDate") - .HasColumnType("datetime(6)"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionId"); - - b.ToTable("reconciliation"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ResponseCodes", b => - { - b.Property("ResponseCode") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ResponseCode"); - - b.ToTable("responsecodes"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Settlement", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateId", "SettlementId"); - - b.ToTable("settlement"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementHeader", b => - { - b.Property("StatementId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("StatementCreatedDate") - .HasColumnType("datetime(6)"); - - b.Property("StatementGeneratedDate") - .HasColumnType("datetime(6)"); - - b.HasKey("StatementId"); - - b.ToTable("statementheader"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementLine", b => - { - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ActivityType") - .HasColumnType("int"); - - b.Property("ActivityDescription") - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("InAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OutAmount") - .HasColumnType("decimal(65,30)"); - - b.HasKey("StatementId", "TransactionId", "ActivityDateTime", "ActivityType"); - - b.ToTable("statementline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Transaction", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("AuthorisationCode") - .HasColumnType("longtext"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("OperatorIdentifier") - .HasColumnType("longtext"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionDate") - .HasColumnType("datetime(6)"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionNumber") - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .HasColumnType("longtext"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .HasColumnType("longtext"); - - b.HasKey("EstateId", "MerchantId", "TransactionId"); - - b.ToTable("transaction"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalRequestData", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("Amount") - .HasColumnType("longtext"); - - b.Property("CustomerAccountNumber") - .HasColumnType("longtext"); - - b.HasKey("EstateId", "MerchantId", "TransactionId"); - - b.ToTable("transactionadditionalrequestdata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalResponseData", b => - { - b.Property("TransactionId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.HasKey("TransactionId"); - - b.ToTable("transactionadditionalresponsedata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionFee", b => - { - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("FeeId") - .HasColumnType("char(36)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("EventId") - .HasColumnType("char(36)"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionId", "FeeId"); - - b.ToTable("transactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Voucher", b => - { - b.Property("VoucherId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ExpiryDate") - .HasColumnType("datetime(6)"); - - b.Property("GenerateDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsGenerated") - .HasColumnType("tinyint(1)"); - - b.Property("IsIssued") - .HasColumnType("tinyint(1)"); - - b.Property("IsRedeemed") - .HasColumnType("tinyint(1)"); - - b.Property("IssuedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RecipientEmail") - .HasColumnType("longtext"); - - b.Property("RecipientMobile") - .HasColumnType("longtext"); - - b.Property("RedeemedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.Property("VoucherCode") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("VoucherId"); - - b.ToTable("voucher"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.FileImportLogView", b => - { - b.Property("FileCount") - .HasColumnType("int"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDate") - .HasColumnType("datetime(6)"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ImportLogTime") - .HasColumnType("time(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.ToTable("uvwFileImportLogView"); - - b.ToView("uvwFileImportLog"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.FileView", b => - { - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FailedCount") - .HasColumnType("int"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDate") - .HasColumnType("datetime(6)"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FileReceivedTime") - .HasColumnType("time(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("LineCount") - .HasColumnType("int"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PendingCount") - .HasColumnType("int"); - - b.Property("SuccessCount") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.ToTable("uvwFileView"); - - b.ToView("uvwFile"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.SettlementView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FeeDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToView("uvwSettlements"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.TransactionsView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ResponseCode") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionDate") - .HasColumnType("datetime(6)"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionType") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable("uvwTransactionsView"); - - b.ToView("uvwTransactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20221116082041_somenullfixes.cs b/TransactionProcessor.Database/Migrations/MySql/20221116082041_somenullfixes.cs deleted file mode 100644 index f758efad..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20221116082041_somenullfixes.cs +++ /dev/null @@ -1,239 +0,0 @@ -#nullable disable - -using Microsoft.EntityFrameworkCore.Migrations; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - public partial class somenullfixes : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "RecipientMobile", - table: "voucher", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "RecipientEmail", - table: "voucher", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "CustomerAccountNumber", - table: "transactionadditionalrequestdata", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "Amount", - table: "transactionadditionalrequestdata", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "ActivityDescription", - table: "statementline", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "ResponseMessage", - table: "reconciliation", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "ResponseCode", - table: "reconciliation", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "DeviceIdentifier", - table: "reconciliation", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "voucher", - keyColumn: "RecipientMobile", - keyValue: null, - column: "RecipientMobile", - value: ""); - - migrationBuilder.AlterColumn( - name: "RecipientMobile", - table: "voucher", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "voucher", - keyColumn: "RecipientEmail", - keyValue: null, - column: "RecipientEmail", - value: ""); - - migrationBuilder.AlterColumn( - name: "RecipientEmail", - table: "voucher", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "transactionadditionalrequestdata", - keyColumn: "CustomerAccountNumber", - keyValue: null, - column: "CustomerAccountNumber", - value: ""); - - migrationBuilder.AlterColumn( - name: "CustomerAccountNumber", - table: "transactionadditionalrequestdata", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "transactionadditionalrequestdata", - keyColumn: "Amount", - keyValue: null, - column: "Amount", - value: ""); - - migrationBuilder.AlterColumn( - name: "Amount", - table: "transactionadditionalrequestdata", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "statementline", - keyColumn: "ActivityDescription", - keyValue: null, - column: "ActivityDescription", - value: ""); - - migrationBuilder.AlterColumn( - name: "ActivityDescription", - table: "statementline", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "reconciliation", - keyColumn: "ResponseMessage", - keyValue: null, - column: "ResponseMessage", - value: ""); - - migrationBuilder.AlterColumn( - name: "ResponseMessage", - table: "reconciliation", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "reconciliation", - keyColumn: "ResponseCode", - keyValue: null, - column: "ResponseCode", - value: ""); - - migrationBuilder.AlterColumn( - name: "ResponseCode", - table: "reconciliation", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "reconciliation", - keyColumn: "DeviceIdentifier", - keyValue: null, - column: "DeviceIdentifier", - value: ""); - - migrationBuilder.AlterColumn( - name: "DeviceIdentifier", - table: "reconciliation", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20230116113800_recordproducttype.Designer.cs b/TransactionProcessor.Database/Migrations/MySql/20230116113800_recordproducttype.Designer.cs deleted file mode 100644 index 8d396a35..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20230116113800_recordproducttype.Designer.cs +++ /dev/null @@ -1,1063 +0,0 @@ -// - -#nullable disable - -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using TransactionProcessor.Database.Contexts; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - [DbContext(typeof(EstateManagementMySqlContext))] - [Migration("20230116113800_recordproducttype")] - partial class recordproducttype - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("EstateManagement.Database.Entities.Calendar", b => - { - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DayOfWeekNumber") - .HasColumnType("int"); - - b.Property("DayOfWeekShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameLong") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("WeekNumberString") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Year") - .HasColumnType("int"); - - b.Property("YearWeekNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Date"); - - b.ToTable("calendar"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Contract", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateId", "OperatorId", "ContractId"); - - b.ToTable("contract"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProduct", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("DisplayText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductType") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.HasKey("EstateId", "ContractId", "ProductId"); - - b.ToTable("contractproduct"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProductTransactionFee", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("TransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Value") - .HasColumnType("decimal(18,4)"); - - b.HasKey("EstateId", "ContractId", "ProductId", "TransactionFeeId"); - - b.ToTable("contractproducttransactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Estate", b => - { - b.Property("EstateId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.HasKey("EstateId"); - - b.ToTable("estate"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateOperator", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RequireCustomMerchantNumber") - .HasColumnType("tinyint(1)"); - - b.Property("RequireCustomTerminalNumber") - .HasColumnType("tinyint(1)"); - - b.HasKey("EstateId", "OperatorId"); - - b.ToTable("estateoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateSecurityUser", b => - { - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("SecurityUserId", "EstateId"); - - b.ToTable("estatesecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.File", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("EstateId", "FileImportLogId", "FileId"); - - b.ToTable("file"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLog", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateId", "FileImportLogId"); - - b.ToTable("fileimportlog"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLogFile", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileUploadedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OriginalFileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("EstateId", "FileImportLogId", "FileId"); - - b.ToTable("fileimportlogfile"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileLine", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("LineNumber") - .HasColumnType("int"); - - b.Property("FileLineData") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.HasKey("EstateId", "FileId", "LineNumber"); - - b.ToTable("fileline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Merchant", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastStatementGenerated") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.Property("SettlementSchedule") - .HasColumnType("int"); - - b.HasKey("EstateId", "MerchantId"); - - b.ToTable("merchant"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantAddress", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("AddressId") - .HasColumnType("char(36)"); - - b.Property("AddressLine1") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AddressLine2") - .HasColumnType("longtext"); - - b.Property("AddressLine3") - .HasColumnType("longtext"); - - b.Property("AddressLine4") - .HasColumnType("longtext"); - - b.Property("Country") - .HasColumnType("longtext"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("PostalCode") - .HasColumnType("longtext"); - - b.Property("Region") - .HasColumnType("longtext"); - - b.Property("Town") - .HasColumnType("longtext"); - - b.HasKey("EstateId", "MerchantId", "AddressId"); - - b.ToTable("merchantaddress"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContact", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("ContactId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.HasKey("EstateId", "MerchantId", "ContactId"); - - b.ToTable("merchantcontact"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantDevice", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("DeviceId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateId", "MerchantId", "DeviceId"); - - b.ToTable("merchantdevice"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantOperator", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("MerchantNumber") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TerminalNumber") - .HasColumnType("longtext"); - - b.HasKey("EstateId", "MerchantId", "OperatorId"); - - b.ToTable("merchantoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSecurityUser", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateId", "MerchantId", "SecurityUserId"); - - b.ToTable("merchantsecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSettlementFee", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("FeeId") - .HasColumnType("char(36)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("FeeCalculatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.HasKey("EstateId", "SettlementId", "TransactionId", "FeeId"); - - b.ToTable("merchantsettlementfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Reconciliation", b => - { - b.Property("TransactionId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionCount") - .HasColumnType("int"); - - b.Property("TransactionDate") - .HasColumnType("datetime(6)"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionId"); - - b.ToTable("reconciliation"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ResponseCodes", b => - { - b.Property("ResponseCode") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ResponseCode"); - - b.ToTable("responsecodes"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Settlement", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateId", "SettlementId"); - - b.ToTable("settlement"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementHeader", b => - { - b.Property("StatementId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("StatementCreatedDate") - .HasColumnType("datetime(6)"); - - b.Property("StatementGeneratedDate") - .HasColumnType("datetime(6)"); - - b.HasKey("StatementId"); - - b.ToTable("statementheader"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementLine", b => - { - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ActivityType") - .HasColumnType("int"); - - b.Property("ActivityDescription") - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("InAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OutAmount") - .HasColumnType("decimal(65,30)"); - - b.HasKey("StatementId", "TransactionId", "ActivityDateTime", "ActivityType"); - - b.ToTable("statementline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Transaction", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("AuthorisationCode") - .HasColumnType("longtext"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("OperatorIdentifier") - .HasColumnType("longtext"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionDate") - .HasColumnType("datetime(6)"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionNumber") - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .HasColumnType("longtext"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .HasColumnType("longtext"); - - b.HasKey("EstateId", "MerchantId", "TransactionId"); - - b.ToTable("transaction"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalRequestData", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("Amount") - .HasColumnType("longtext"); - - b.Property("CustomerAccountNumber") - .HasColumnType("longtext"); - - b.HasKey("EstateId", "MerchantId", "TransactionId"); - - b.ToTable("transactionadditionalrequestdata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalResponseData", b => - { - b.Property("TransactionId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.HasKey("TransactionId"); - - b.ToTable("transactionadditionalresponsedata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionFee", b => - { - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("FeeId") - .HasColumnType("char(36)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("EventId") - .HasColumnType("char(36)"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionId", "FeeId"); - - b.ToTable("transactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Voucher", b => - { - b.Property("VoucherId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ExpiryDate") - .HasColumnType("datetime(6)"); - - b.Property("GenerateDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsGenerated") - .HasColumnType("tinyint(1)"); - - b.Property("IsIssued") - .HasColumnType("tinyint(1)"); - - b.Property("IsRedeemed") - .HasColumnType("tinyint(1)"); - - b.Property("IssuedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RecipientEmail") - .HasColumnType("longtext"); - - b.Property("RecipientMobile") - .HasColumnType("longtext"); - - b.Property("RedeemedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.Property("VoucherCode") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("VoucherId"); - - b.ToTable("voucher"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.FileImportLogView", b => - { - b.Property("FileCount") - .HasColumnType("int"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDate") - .HasColumnType("datetime(6)"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ImportLogTime") - .HasColumnType("time(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.ToTable("uvwFileImportLogView"); - - b.ToView("uvwFileImportLog", (string)null); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.FileView", b => - { - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FailedCount") - .HasColumnType("int"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDate") - .HasColumnType("datetime(6)"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FileReceivedTime") - .HasColumnType("time(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("LineCount") - .HasColumnType("int"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PendingCount") - .HasColumnType("int"); - - b.Property("SuccessCount") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.ToTable("uvwFileView"); - - b.ToView("uvwFile", (string)null); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.SettlementView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FeeDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable((string)null); - - b.ToView("uvwSettlements", (string)null); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.TransactionsView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ResponseCode") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionDate") - .HasColumnType("datetime(6)"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionType") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable("uvwTransactionsView"); - - b.ToView("uvwTransactions", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20230116113800_recordproducttype.cs b/TransactionProcessor.Database/Migrations/MySql/20230116113800_recordproducttype.cs deleted file mode 100644 index dc02bbf4..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20230116113800_recordproducttype.cs +++ /dev/null @@ -1,29 +0,0 @@ -#nullable disable - -using Microsoft.EntityFrameworkCore.Migrations; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - /// - public partial class recordproducttype : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "ProductType", - table: "contractproduct", - type: "int", - nullable: false, - defaultValue: 0); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "ProductType", - table: "contractproduct"); - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20230630115550_task384_datamodelrefactoring.Designer.cs b/TransactionProcessor.Database/Migrations/MySql/20230630115550_task384_datamodelrefactoring.Designer.cs deleted file mode 100644 index 415b1977..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20230630115550_task384_datamodelrefactoring.Designer.cs +++ /dev/null @@ -1,992 +0,0 @@ -// - -#nullable disable - -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using TransactionProcessor.Database.Contexts; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - [DbContext(typeof(EstateManagementMySqlContext))] - [Migration("20230630115550_task384_datamodelrefactoring")] - partial class task384_datamodelrefactoring - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.7") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("EstateManagement.Database.Entities.Calendar", b => - { - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DayOfWeekNumber") - .HasColumnType("int"); - - b.Property("DayOfWeekShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameLong") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("WeekNumberString") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Year") - .HasColumnType("int"); - - b.Property("YearWeekNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Date"); - - b.ToTable("calendar"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Contract", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId", "OperatorId", "ContractId"); - - b.ToTable("contract"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProduct", b => - { - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("ContractProductReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DisplayText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductType") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.HasKey("ContractReportingId", "ProductId"); - - b.ToTable("contractproduct"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProductTransactionFee", b => - { - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("TransactionFeeReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(18,4)"); - - b.HasKey("ContractProductReportingId", "TransactionFeeId"); - - b.ToTable("contractproducttransactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Estate", b => - { - b.Property("EstateReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId"); - - b.HasIndex("EstateId") - .IsUnique(); - - b.ToTable("estate"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateOperator", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RequireCustomMerchantNumber") - .HasColumnType("tinyint(1)"); - - b.Property("RequireCustomTerminalNumber") - .HasColumnType("tinyint(1)"); - - b.HasKey("EstateReportingId", "OperatorId"); - - b.ToTable("estateoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateSecurityUser", b => - { - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("SecurityUserId", "EstateReportingId"); - - b.ToTable("estatesecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.File", b => - { - b.Property("FileReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDate") - .HasColumnType("date"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileReportingId"); - - b.HasIndex("FileId") - .IsUnique(); - - b.ToTable("file"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLog", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileImportLogReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDate") - .HasColumnType("date"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateReportingId", "FileImportLogReportingId"); - - b.HasIndex("EstateReportingId", "FileImportLogId") - .IsUnique(); - - b.ToTable("fileimportlog"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLogFile", b => - { - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileUploadedDate") - .HasColumnType("date"); - - b.Property("FileUploadedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OriginalFileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileImportLogReportingId", "FileReportingId"); - - b.ToTable("fileimportlogfile"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileLine", b => - { - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("LineNumber") - .HasColumnType("int"); - - b.Property("FileLineData") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("FileReportingId", "LineNumber") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("fileline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Merchant", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("MerchantReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastStatementGenerated") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.Property("SettlementSchedule") - .HasColumnType("int"); - - b.HasKey("EstateReportingId", "MerchantReportingId"); - - b.HasIndex("EstateReportingId", "MerchantId") - .IsUnique(); - - b.ToTable("merchant"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantAddress", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("AddressId") - .HasColumnType("char(36)"); - - b.Property("AddressLine1") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AddressLine2") - .HasColumnType("longtext"); - - b.Property("AddressLine3") - .HasColumnType("longtext"); - - b.Property("AddressLine4") - .HasColumnType("longtext"); - - b.Property("Country") - .HasColumnType("longtext"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("PostalCode") - .HasColumnType("longtext"); - - b.Property("Region") - .HasColumnType("longtext"); - - b.Property("Town") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "AddressId"); - - b.ToTable("merchantaddress"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContact", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContactId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "ContactId"); - - b.ToTable("merchantcontact"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantDevice", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("DeviceId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "DeviceId"); - - b.ToTable("merchantdevice"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantOperator", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("MerchantNumber") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TerminalNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "OperatorId"); - - b.ToTable("merchantoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSecurityUser", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "SecurityUserId"); - - b.ToTable("merchantsecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSettlementFee", b => - { - b.Property("SettlementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeReportingId") - .HasColumnType("int"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("FeeCalculatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.HasKey("SettlementReportingId", "TransactionReportingId", "TransactionFeeReportingId"); - - b.ToTable("merchantsettlementfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Reconciliation", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionCount") - .HasColumnType("int"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("reconciliation"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ResponseCodes", b => - { - b.Property("ResponseCode") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ResponseCode"); - - b.ToTable("responsecodes"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Settlement", b => - { - b.Property("SettlementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("SettlementDate") - .HasColumnType("date"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("EstateReportingId", "SettlementId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("SettlementDate", "EstateReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("settlement"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementHeader", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("StatementCreatedDate") - .HasColumnType("date"); - - b.Property("StatementCreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementGeneratedDate") - .HasColumnType("date"); - - b.Property("StatementGeneratedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.HasKey("MerchantReportingId", "StatementId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("MerchantReportingId", "StatementGeneratedDate") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("statementheader"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementLine", b => - { - b.Property("StatementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ActivityType") - .HasColumnType("int"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDescription") - .HasColumnType("longtext"); - - b.Property("InAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("OutAmount") - .HasColumnType("decimal(65,30)"); - - b.HasKey("StatementReportingId", "TransactionReportingId", "ActivityDateTime", "ActivityType"); - - b.ToTable("statementline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Transaction", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("AuthorisationCode") - .HasColumnType("longtext"); - - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .HasColumnType("longtext"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .HasColumnType("longtext"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("transaction"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalRequestData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("longtext"); - - b.Property("CustomerAccountNumber") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalrequestdata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalResponseData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalresponsedata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionFee", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("EventId") - .HasColumnType("char(36)"); - - b.Property("FeeId") - .HasColumnType("char(36)"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionReportingId", "TransactionFeeReportingId"); - - b.HasIndex("FeeId") - .IsUnique(); - - b.ToTable("transactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Voucher", b => - { - b.Property("VoucherId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ExpiryDate") - .HasColumnType("date"); - - b.Property("ExpiryDateTime") - .HasColumnType("datetime(6)"); - - b.Property("GenerateDate") - .HasColumnType("date"); - - b.Property("GenerateDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsGenerated") - .HasColumnType("tinyint(1)"); - - b.Property("IsIssued") - .HasColumnType("tinyint(1)"); - - b.Property("IsRedeemed") - .HasColumnType("tinyint(1)"); - - b.Property("IssuedDate") - .HasColumnType("date"); - - b.Property("IssuedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RecipientEmail") - .HasColumnType("longtext"); - - b.Property("RecipientMobile") - .HasColumnType("longtext"); - - b.Property("RedeemedDate") - .HasColumnType("datetime(6)"); - - b.Property("RedeemedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.Property("VoucherCode") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("VoucherId"); - - b.HasIndex("TransactionReportingId"); - - b.HasIndex("VoucherCode"); - - b.ToTable("voucher"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.SettlementView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FeeDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable((string)null); - - b.ToView("uvwSettlements", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20230630115550_task384_datamodelrefactoring.cs b/TransactionProcessor.Database/Migrations/MySql/20230630115550_task384_datamodelrefactoring.cs deleted file mode 100644 index 0f06f6a0..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20230630115550_task384_datamodelrefactoring.cs +++ /dev/null @@ -1,2144 +0,0 @@ -#nullable disable - -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - /// - public partial class task384_datamodelrefactoring : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "uvwFileImportLogView"); - - migrationBuilder.DropTable( - name: "uvwFileView"); - - migrationBuilder.DropTable( - name: "uvwTransactionsView"); - - migrationBuilder.DropPrimaryKey( - name: "PK_transactionfee", - table: "transactionfee"); - - migrationBuilder.DropPrimaryKey( - name: "PK_transactionadditionalresponsedata", - table: "transactionadditionalresponsedata"); - - migrationBuilder.DropPrimaryKey( - name: "PK_transactionadditionalrequestdata", - table: "transactionadditionalrequestdata"); - - migrationBuilder.DropPrimaryKey( - name: "PK_transaction", - table: "transaction"); - - migrationBuilder.DropPrimaryKey( - name: "PK_statementline", - table: "statementline"); - - migrationBuilder.DropPrimaryKey( - name: "PK_statementheader", - table: "statementheader"); - - migrationBuilder.DropPrimaryKey( - name: "PK_settlement", - table: "settlement"); - - migrationBuilder.DropPrimaryKey( - name: "PK_reconciliation", - table: "reconciliation"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantsettlementfee", - table: "merchantsettlementfee"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantsecurityuser", - table: "merchantsecurityuser"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantoperator", - table: "merchantoperator"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantdevice", - table: "merchantdevice"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantcontact", - table: "merchantcontact"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantaddress", - table: "merchantaddress"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchant", - table: "merchant"); - - migrationBuilder.DropPrimaryKey( - name: "PK_fileline", - table: "fileline"); - - migrationBuilder.DropPrimaryKey( - name: "PK_fileimportlogfile", - table: "fileimportlogfile"); - - migrationBuilder.DropPrimaryKey( - name: "PK_fileimportlog", - table: "fileimportlog"); - - migrationBuilder.DropPrimaryKey( - name: "PK_file", - table: "file"); - - migrationBuilder.DropPrimaryKey( - name: "PK_estatesecurityuser", - table: "estatesecurityuser"); - - migrationBuilder.DropPrimaryKey( - name: "PK_estateoperator", - table: "estateoperator"); - - migrationBuilder.DropPrimaryKey( - name: "PK_estate", - table: "estate"); - - migrationBuilder.DropPrimaryKey( - name: "PK_contractproducttransactionfee", - table: "contractproducttransactionfee"); - - migrationBuilder.DropPrimaryKey( - name: "PK_contractproduct", - table: "contractproduct"); - - migrationBuilder.DropPrimaryKey( - name: "PK_contract", - table: "contract"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "voucher"); - - migrationBuilder.DropColumn( - name: "TransactionId", - table: "voucher"); - - migrationBuilder.DropColumn( - name: "TransactionId", - table: "transactionfee"); - - migrationBuilder.AddColumn( - name: "TransactionReportingId", - table: "transactionadditionalresponsedata", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "TransactionReportingId", - table: "transactionadditionalrequestdata", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.DropColumn( - name: "TransactionId", - table: "transactionadditionalresponsedata"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "transactionadditionalresponsedata"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "transactionadditionalresponsedata"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "transactionadditionalrequestdata"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "transactionadditionalrequestdata"); - - migrationBuilder.DropColumn( - name: "TransactionId", - table: "transactionadditionalrequestdata"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "transaction"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "transaction"); - - migrationBuilder.DropColumn( - name: "ContractId", - table: "transaction"); - - migrationBuilder.DropColumn( - name: "ProductId", - table: "transaction"); - - migrationBuilder.DropColumn( - name: "StatementId", - table: "statementline"); - - migrationBuilder.DropColumn( - name: "TransactionId", - table: "statementline"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "statementline"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "statementline"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "statementheader"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "statementheader"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "settlement"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "reconciliation"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "reconciliation"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "merchantsettlementfee"); - - migrationBuilder.DropColumn( - name: "SettlementId", - table: "merchantsettlementfee"); - - migrationBuilder.DropColumn( - name: "TransactionId", - table: "merchantsettlementfee"); - - migrationBuilder.DropColumn( - name: "FeeId", - table: "merchantsettlementfee"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "merchantsettlementfee"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "merchantsecurityuser"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "merchantsecurityuser"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "merchantoperator"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "merchantoperator"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "merchantdevice"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "merchantdevice"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "merchantcontact"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "merchantcontact"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "merchantaddress"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "merchantaddress"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "merchant"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "fileline"); - - migrationBuilder.DropColumn( - name: "FileId", - table: "fileline"); - - migrationBuilder.DropColumn( - name: "TransactionId", - table: "fileline"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "fileimportlogfile"); - - migrationBuilder.DropColumn( - name: "FileImportLogId", - table: "fileimportlogfile"); - - migrationBuilder.DropColumn( - name: "FileId", - table: "fileimportlogfile"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "fileimportlogfile"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "fileimportlog"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "file"); - - migrationBuilder.DropColumn( - name: "FileImportLogId", - table: "file"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "file"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "estatesecurityuser"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "estateoperator"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "contractproducttransactionfee"); - - migrationBuilder.DropColumn( - name: "ContractId", - table: "contractproducttransactionfee"); - - migrationBuilder.DropColumn( - name: "ProductId", - table: "contractproducttransactionfee"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "contractproduct"); - - migrationBuilder.DropColumn( - name: "ContractId", - table: "contractproduct"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "contract"); - - migrationBuilder.AlterColumn( - name: "VoucherCode", - table: "voucher", - type: "varchar(255)", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "ExpiryDate", - table: "voucher", - type: "date", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "datetime(6)"); - - migrationBuilder.AddColumn( - name: "ExpiryDateTime", - table: "voucher", - type: "datetime(6)", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn( - name: "GenerateDate", - table: "voucher", - type: "date", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn( - name: "IssuedDate", - table: "voucher", - type: "date", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn( - name: "RedeemedDate", - table: "voucher", - type: "datetime(6)", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn( - name: "TransactionReportingId", - table: "voucher", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "TransactionReportingId", - table: "transactionfee", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "TransactionFeeReportingId", - table: "transactionfee", - type: "int", - nullable: false, - defaultValue: 0) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "TransactionDate", - table: "transaction", - type: "date", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "datetime(6)"); - - migrationBuilder.AddColumn( - name: "TransactionReportingId", - table: "transaction", - type: "int", - nullable: false, - defaultValue: 0) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AddColumn( - name: "ContractProductReportingId", - table: "transaction", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "ContractReportingId", - table: "transaction", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "transaction", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "StatementReportingId", - table: "statementline", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "TransactionReportingId", - table: "statementline", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "ActivityDate", - table: "statementline", - type: "date", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AlterColumn( - name: "StatementGeneratedDate", - table: "statementheader", - type: "date", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "datetime(6)"); - - migrationBuilder.AlterColumn( - name: "StatementCreatedDate", - table: "statementheader", - type: "date", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "datetime(6)"); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "statementheader", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "StatementCreatedDateTime", - table: "statementheader", - type: "datetime(6)", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn( - name: "StatementGeneratedDateTime", - table: "statementheader", - type: "datetime(6)", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn( - name: "StatementReportingId", - table: "statementheader", - type: "int", - nullable: false, - defaultValue: 0) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "SettlementDate", - table: "settlement", - type: "date", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "datetime(6)"); - - migrationBuilder.AddColumn( - name: "SettlementReportingId", - table: "settlement", - type: "int", - nullable: false, - defaultValue: 0) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AddColumn( - name: "EstateReportingId", - table: "settlement", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AlterColumn( - name: "TransactionDate", - table: "reconciliation", - type: "date", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "datetime(6)"); - - migrationBuilder.AddColumn( - name: "TransactionReportingId", - table: "reconciliation", - type: "int", - nullable: false, - defaultValue: 0) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "reconciliation", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "SettlementReportingId", - table: "merchantsettlementfee", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "TransactionReportingId", - table: "merchantsettlementfee", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "TransactionFeeReportingId", - table: "merchantsettlementfee", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "merchantsettlementfee", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "merchantsecurityuser", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "merchantoperator", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "merchantdevice", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "merchantcontact", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "merchantaddress", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "EstateReportingId", - table: "merchant", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "merchant", - type: "int", - nullable: false, - defaultValue: 0) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AddColumn( - name: "FileReportingId", - table: "fileline", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "TransactionReportingId", - table: "fileline", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "FileImportLogReportingId", - table: "fileimportlogfile", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "FileReportingId", - table: "fileimportlogfile", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "FileUploadedDate", - table: "fileimportlogfile", - type: "date", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "fileimportlogfile", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "EstateReportingId", - table: "fileimportlog", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "FileImportLogReportingId", - table: "fileimportlog", - type: "int", - nullable: false, - defaultValue: 0) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AddColumn( - name: "ImportLogDate", - table: "fileimportlog", - type: "date", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn( - name: "FileReportingId", - table: "file", - type: "int", - nullable: false, - defaultValue: 0) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AddColumn( - name: "EstateReportingId", - table: "file", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "FileImportLogReportingId", - table: "file", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "FileReceivedDate", - table: "file", - type: "date", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "file", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "EstateReportingId", - table: "estatesecurityuser", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "EstateReportingId", - table: "estateoperator", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "EstateReportingId", - table: "estate", - type: "int", - nullable: false, - defaultValue: 0) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AddColumn( - name: "ContractProductReportingId", - table: "contractproducttransactionfee", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "TransactionFeeReportingId", - table: "contractproducttransactionfee", - type: "int", - nullable: false, - defaultValue: 0) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AddColumn( - name: "ContractReportingId", - table: "contractproduct", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "ContractProductReportingId", - table: "contractproduct", - type: "int", - nullable: false, - defaultValue: 0) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AddColumn( - name: "EstateReportingId", - table: "contract", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "ContractReportingId", - table: "contract", - type: "int", - nullable: false, - defaultValue: 0) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AddPrimaryKey( - name: "PK_transactionfee", - table: "transactionfee", - columns: new[] { "TransactionReportingId", "TransactionFeeReportingId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_transactionadditionalresponsedata", - table: "transactionadditionalresponsedata", - column: "TransactionReportingId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_transactionadditionalrequestdata", - table: "transactionadditionalrequestdata", - column: "TransactionReportingId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_transaction", - table: "transaction", - column: "TransactionReportingId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_statementline", - table: "statementline", - columns: new[] { "StatementReportingId", "TransactionReportingId", "ActivityDateTime", "ActivityType" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_statementheader", - table: "statementheader", - columns: new[] { "MerchantReportingId", "StatementId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_settlement", - table: "settlement", - column: "SettlementReportingId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_reconciliation", - table: "reconciliation", - column: "TransactionReportingId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantsettlementfee", - table: "merchantsettlementfee", - columns: new[] { "SettlementReportingId", "TransactionReportingId", "TransactionFeeReportingId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantsecurityuser", - table: "merchantsecurityuser", - columns: new[] { "MerchantReportingId", "SecurityUserId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantoperator", - table: "merchantoperator", - columns: new[] { "MerchantReportingId", "OperatorId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantdevice", - table: "merchantdevice", - columns: new[] { "MerchantReportingId", "DeviceId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantcontact", - table: "merchantcontact", - columns: new[] { "MerchantReportingId", "ContactId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantaddress", - table: "merchantaddress", - columns: new[] { "MerchantReportingId", "AddressId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchant", - table: "merchant", - columns: new[] { "EstateReportingId", "MerchantReportingId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_fileline", - table: "fileline", - columns: new[] { "FileReportingId", "LineNumber" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_fileimportlogfile", - table: "fileimportlogfile", - columns: new[] { "FileImportLogReportingId", "FileReportingId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_fileimportlog", - table: "fileimportlog", - columns: new[] { "EstateReportingId", "FileImportLogReportingId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_file", - table: "file", - column: "FileReportingId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_estatesecurityuser", - table: "estatesecurityuser", - columns: new[] { "SecurityUserId", "EstateReportingId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_estateoperator", - table: "estateoperator", - columns: new[] { "EstateReportingId", "OperatorId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_estate", - table: "estate", - column: "EstateReportingId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_contractproducttransactionfee", - table: "contractproducttransactionfee", - columns: new[] { "ContractProductReportingId", "TransactionFeeId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_contractproduct", - table: "contractproduct", - columns: new[] { "ContractReportingId", "ProductId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_contract", - table: "contract", - columns: new[] { "EstateReportingId", "OperatorId", "ContractId" }); - - migrationBuilder.CreateIndex( - name: "IX_voucher_TransactionReportingId", - table: "voucher", - column: "TransactionReportingId"); - - migrationBuilder.CreateIndex( - name: "IX_voucher_VoucherCode", - table: "voucher", - column: "VoucherCode"); - - migrationBuilder.CreateIndex( - name: "IX_transactionfee_FeeId", - table: "transactionfee", - column: "FeeId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_transaction_TransactionDate_MerchantReportingId", - table: "transaction", - columns: new[] { "TransactionDate", "MerchantReportingId" }); - - migrationBuilder.CreateIndex( - name: "IX_transaction_TransactionId_MerchantReportingId", - table: "transaction", - columns: new[] { "TransactionId", "MerchantReportingId" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_statementheader_MerchantReportingId_StatementGeneratedDate", - table: "statementheader", - columns: new[] { "MerchantReportingId", "StatementGeneratedDate" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_settlement_EstateReportingId_SettlementId", - table: "settlement", - columns: new[] { "EstateReportingId", "SettlementId" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_settlement_SettlementDate_EstateReportingId", - table: "settlement", - columns: new[] { "SettlementDate", "EstateReportingId" }); - - migrationBuilder.CreateIndex( - name: "IX_reconciliation_TransactionDate_MerchantReportingId", - table: "reconciliation", - columns: new[] { "TransactionDate", "MerchantReportingId" }); - - migrationBuilder.CreateIndex( - name: "IX_reconciliation_TransactionId_MerchantReportingId", - table: "reconciliation", - columns: new[] { "TransactionId", "MerchantReportingId" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_merchant_EstateReportingId_MerchantId", - table: "merchant", - columns: new[] { "EstateReportingId", "MerchantId" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_fileline_TransactionReportingId", - table: "fileline", - column: "TransactionReportingId"); - - migrationBuilder.CreateIndex( - name: "IX_fileimportlog_EstateReportingId_FileImportLogId", - table: "fileimportlog", - columns: new[] { "EstateReportingId", "FileImportLogId" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_file_FileId", - table: "file", - column: "FileId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_estate_EstateId", - table: "estate", - column: "EstateId", - unique: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_voucher_TransactionReportingId", - table: "voucher"); - - migrationBuilder.DropIndex( - name: "IX_voucher_VoucherCode", - table: "voucher"); - - migrationBuilder.DropPrimaryKey( - name: "PK_transactionfee", - table: "transactionfee"); - - migrationBuilder.DropIndex( - name: "IX_transactionfee_FeeId", - table: "transactionfee"); - - migrationBuilder.DropPrimaryKey( - name: "PK_transactionadditionalresponsedata", - table: "transactionadditionalresponsedata"); - - migrationBuilder.DropPrimaryKey( - name: "PK_transactionadditionalrequestdata", - table: "transactionadditionalrequestdata"); - - migrationBuilder.DropPrimaryKey( - name: "PK_transaction", - table: "transaction"); - - migrationBuilder.DropIndex( - name: "IX_transaction_TransactionDate_MerchantReportingId", - table: "transaction"); - - migrationBuilder.DropIndex( - name: "IX_transaction_TransactionId_MerchantReportingId", - table: "transaction"); - - migrationBuilder.DropPrimaryKey( - name: "PK_statementline", - table: "statementline"); - - migrationBuilder.DropPrimaryKey( - name: "PK_statementheader", - table: "statementheader"); - - migrationBuilder.DropIndex( - name: "IX_statementheader_MerchantReportingId_StatementGeneratedDate", - table: "statementheader"); - - migrationBuilder.DropPrimaryKey( - name: "PK_settlement", - table: "settlement"); - - migrationBuilder.DropIndex( - name: "IX_settlement_EstateReportingId_SettlementId", - table: "settlement"); - - migrationBuilder.DropIndex( - name: "IX_settlement_SettlementDate_EstateReportingId", - table: "settlement"); - - migrationBuilder.DropPrimaryKey( - name: "PK_reconciliation", - table: "reconciliation"); - - migrationBuilder.DropIndex( - name: "IX_reconciliation_TransactionDate_MerchantReportingId", - table: "reconciliation"); - - migrationBuilder.DropIndex( - name: "IX_reconciliation_TransactionId_MerchantReportingId", - table: "reconciliation"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantsettlementfee", - table: "merchantsettlementfee"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantsecurityuser", - table: "merchantsecurityuser"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantoperator", - table: "merchantoperator"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantdevice", - table: "merchantdevice"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantcontact", - table: "merchantcontact"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantaddress", - table: "merchantaddress"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchant", - table: "merchant"); - - migrationBuilder.DropIndex( - name: "IX_merchant_EstateReportingId_MerchantId", - table: "merchant"); - - migrationBuilder.DropPrimaryKey( - name: "PK_fileline", - table: "fileline"); - - migrationBuilder.DropIndex( - name: "IX_fileline_TransactionReportingId", - table: "fileline"); - - migrationBuilder.DropPrimaryKey( - name: "PK_fileimportlogfile", - table: "fileimportlogfile"); - - migrationBuilder.DropPrimaryKey( - name: "PK_fileimportlog", - table: "fileimportlog"); - - migrationBuilder.DropIndex( - name: "IX_fileimportlog_EstateReportingId_FileImportLogId", - table: "fileimportlog"); - - migrationBuilder.DropPrimaryKey( - name: "PK_file", - table: "file"); - - migrationBuilder.DropIndex( - name: "IX_file_FileId", - table: "file"); - - migrationBuilder.DropPrimaryKey( - name: "PK_estatesecurityuser", - table: "estatesecurityuser"); - - migrationBuilder.DropPrimaryKey( - name: "PK_estateoperator", - table: "estateoperator"); - - migrationBuilder.DropPrimaryKey( - name: "PK_estate", - table: "estate"); - - migrationBuilder.DropIndex( - name: "IX_estate_EstateId", - table: "estate"); - - migrationBuilder.DropPrimaryKey( - name: "PK_contractproducttransactionfee", - table: "contractproducttransactionfee"); - - migrationBuilder.DropPrimaryKey( - name: "PK_contractproduct", - table: "contractproduct"); - - migrationBuilder.DropPrimaryKey( - name: "PK_contract", - table: "contract"); - - migrationBuilder.DropColumn( - name: "ExpiryDateTime", - table: "voucher"); - - migrationBuilder.DropColumn( - name: "GenerateDate", - table: "voucher"); - - migrationBuilder.DropColumn( - name: "IssuedDate", - table: "voucher"); - - migrationBuilder.DropColumn( - name: "RedeemedDate", - table: "voucher"); - - migrationBuilder.DropColumn( - name: "TransactionReportingId", - table: "voucher"); - - migrationBuilder.DropColumn( - name: "TransactionReportingId", - table: "transactionfee"); - - migrationBuilder.DropColumn( - name: "TransactionFeeReportingId", - table: "transactionfee"); - - migrationBuilder.DropColumn( - name: "TransactionReportingId", - table: "transactionadditionalresponsedata"); - - migrationBuilder.DropColumn( - name: "TransactionReportingId", - table: "transactionadditionalrequestdata"); - - migrationBuilder.DropColumn( - name: "TransactionReportingId", - table: "transaction"); - - migrationBuilder.DropColumn( - name: "ContractProductReportingId", - table: "transaction"); - - migrationBuilder.DropColumn( - name: "ContractReportingId", - table: "transaction"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "transaction"); - - migrationBuilder.DropColumn( - name: "StatementReportingId", - table: "statementline"); - - migrationBuilder.DropColumn( - name: "TransactionReportingId", - table: "statementline"); - - migrationBuilder.DropColumn( - name: "ActivityDate", - table: "statementline"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "statementheader"); - - migrationBuilder.DropColumn( - name: "StatementCreatedDateTime", - table: "statementheader"); - - migrationBuilder.DropColumn( - name: "StatementGeneratedDateTime", - table: "statementheader"); - - migrationBuilder.DropColumn( - name: "StatementReportingId", - table: "statementheader"); - - migrationBuilder.DropColumn( - name: "SettlementReportingId", - table: "settlement"); - - migrationBuilder.DropColumn( - name: "EstateReportingId", - table: "settlement"); - - migrationBuilder.DropColumn( - name: "TransactionReportingId", - table: "reconciliation"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "reconciliation"); - - migrationBuilder.DropColumn( - name: "SettlementReportingId", - table: "merchantsettlementfee"); - - migrationBuilder.DropColumn( - name: "TransactionReportingId", - table: "merchantsettlementfee"); - - migrationBuilder.DropColumn( - name: "TransactionFeeReportingId", - table: "merchantsettlementfee"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "merchantsettlementfee"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "merchantsecurityuser"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "merchantoperator"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "merchantdevice"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "merchantcontact"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "merchantaddress"); - - migrationBuilder.DropColumn( - name: "EstateReportingId", - table: "merchant"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "merchant"); - - migrationBuilder.DropColumn( - name: "FileReportingId", - table: "fileline"); - - migrationBuilder.DropColumn( - name: "TransactionReportingId", - table: "fileline"); - - migrationBuilder.DropColumn( - name: "FileImportLogReportingId", - table: "fileimportlogfile"); - - migrationBuilder.DropColumn( - name: "FileReportingId", - table: "fileimportlogfile"); - - migrationBuilder.DropColumn( - name: "FileUploadedDate", - table: "fileimportlogfile"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "fileimportlogfile"); - - migrationBuilder.DropColumn( - name: "EstateReportingId", - table: "fileimportlog"); - - migrationBuilder.DropColumn( - name: "FileImportLogReportingId", - table: "fileimportlog"); - - migrationBuilder.DropColumn( - name: "ImportLogDate", - table: "fileimportlog"); - - migrationBuilder.DropColumn( - name: "FileReportingId", - table: "file"); - - migrationBuilder.DropColumn( - name: "EstateReportingId", - table: "file"); - - migrationBuilder.DropColumn( - name: "FileImportLogReportingId", - table: "file"); - - migrationBuilder.DropColumn( - name: "FileReceivedDate", - table: "file"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "file"); - - migrationBuilder.DropColumn( - name: "EstateReportingId", - table: "estatesecurityuser"); - - migrationBuilder.DropColumn( - name: "EstateReportingId", - table: "estateoperator"); - - migrationBuilder.DropColumn( - name: "EstateReportingId", - table: "estate"); - - migrationBuilder.DropColumn( - name: "ContractProductReportingId", - table: "contractproducttransactionfee"); - - migrationBuilder.DropColumn( - name: "TransactionFeeReportingId", - table: "contractproducttransactionfee"); - - migrationBuilder.DropColumn( - name: "ContractReportingId", - table: "contractproduct"); - - migrationBuilder.DropColumn( - name: "ContractProductReportingId", - table: "contractproduct"); - - migrationBuilder.DropColumn( - name: "EstateReportingId", - table: "contract"); - - migrationBuilder.DropColumn( - name: "ContractReportingId", - table: "contract"); - - migrationBuilder.AlterColumn( - name: "VoucherCode", - table: "voucher", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "varchar(255)") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "ExpiryDate", - table: "voucher", - type: "datetime(6)", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "date"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "voucher", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TransactionId", - table: "voucher", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TransactionId", - table: "transactionfee", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TransactionId", - table: "transactionadditionalresponsedata", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "transactionadditionalresponsedata", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "transactionadditionalresponsedata", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "transactionadditionalrequestdata", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "transactionadditionalrequestdata", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TransactionId", - table: "transactionadditionalrequestdata", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AlterColumn( - name: "TransactionDate", - table: "transaction", - type: "datetime(6)", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "date"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "transaction", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "transaction", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "ContractId", - table: "transaction", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "ProductId", - table: "transaction", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "StatementId", - table: "statementline", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TransactionId", - table: "statementline", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "statementline", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "statementline", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AlterColumn( - name: "StatementGeneratedDate", - table: "statementheader", - type: "datetime(6)", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "date"); - - migrationBuilder.AlterColumn( - name: "StatementCreatedDate", - table: "statementheader", - type: "datetime(6)", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "date"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "statementheader", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "statementheader", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AlterColumn( - name: "SettlementDate", - table: "settlement", - type: "datetime(6)", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "date"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "settlement", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AlterColumn( - name: "TransactionDate", - table: "reconciliation", - type: "datetime(6)", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "date"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "reconciliation", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "reconciliation", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "merchantsettlementfee", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "SettlementId", - table: "merchantsettlementfee", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TransactionId", - table: "merchantsettlementfee", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "FeeId", - table: "merchantsettlementfee", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "merchantsettlementfee", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "merchantsecurityuser", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "merchantsecurityuser", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "merchantoperator", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "merchantoperator", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "merchantdevice", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "merchantdevice", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "merchantcontact", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "merchantcontact", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "merchantaddress", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "merchantaddress", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "merchant", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "fileline", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "FileId", - table: "fileline", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TransactionId", - table: "fileline", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "fileimportlogfile", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "FileImportLogId", - table: "fileimportlogfile", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "FileId", - table: "fileimportlogfile", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "fileimportlogfile", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "fileimportlog", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "file", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "FileImportLogId", - table: "file", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "file", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "estatesecurityuser", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "estateoperator", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "contractproducttransactionfee", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "ContractId", - table: "contractproducttransactionfee", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "ProductId", - table: "contractproducttransactionfee", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "contractproduct", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "ContractId", - table: "contractproduct", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "contract", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddPrimaryKey( - name: "PK_transactionfee", - table: "transactionfee", - columns: new[] { "TransactionId", "FeeId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_transactionadditionalresponsedata", - table: "transactionadditionalresponsedata", - column: "TransactionId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_transactionadditionalrequestdata", - table: "transactionadditionalrequestdata", - columns: new[] { "EstateId", "MerchantId", "TransactionId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_transaction", - table: "transaction", - columns: new[] { "EstateId", "MerchantId", "TransactionId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_statementline", - table: "statementline", - columns: new[] { "StatementId", "TransactionId", "ActivityDateTime", "ActivityType" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_statementheader", - table: "statementheader", - column: "StatementId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_settlement", - table: "settlement", - columns: new[] { "EstateId", "SettlementId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_reconciliation", - table: "reconciliation", - column: "TransactionId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantsettlementfee", - table: "merchantsettlementfee", - columns: new[] { "EstateId", "SettlementId", "TransactionId", "FeeId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantsecurityuser", - table: "merchantsecurityuser", - columns: new[] { "EstateId", "MerchantId", "SecurityUserId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantoperator", - table: "merchantoperator", - columns: new[] { "EstateId", "MerchantId", "OperatorId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantdevice", - table: "merchantdevice", - columns: new[] { "EstateId", "MerchantId", "DeviceId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantcontact", - table: "merchantcontact", - columns: new[] { "EstateId", "MerchantId", "ContactId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantaddress", - table: "merchantaddress", - columns: new[] { "EstateId", "MerchantId", "AddressId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchant", - table: "merchant", - columns: new[] { "EstateId", "MerchantId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_fileline", - table: "fileline", - columns: new[] { "EstateId", "FileId", "LineNumber" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_fileimportlogfile", - table: "fileimportlogfile", - columns: new[] { "EstateId", "FileImportLogId", "FileId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_fileimportlog", - table: "fileimportlog", - columns: new[] { "EstateId", "FileImportLogId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_file", - table: "file", - columns: new[] { "EstateId", "FileImportLogId", "FileId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_estatesecurityuser", - table: "estatesecurityuser", - columns: new[] { "SecurityUserId", "EstateId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_estateoperator", - table: "estateoperator", - columns: new[] { "EstateId", "OperatorId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_estate", - table: "estate", - column: "EstateId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_contractproducttransactionfee", - table: "contractproducttransactionfee", - columns: new[] { "EstateId", "ContractId", "ProductId", "TransactionFeeId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_contractproduct", - table: "contractproduct", - columns: new[] { "EstateId", "ContractId", "ProductId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_contract", - table: "contract", - columns: new[] { "EstateId", "OperatorId", "ContractId" }); - - migrationBuilder.CreateTable( - name: "uvwFileImportLogView", - columns: table => new - { - FileCount = table.Column(type: "int", nullable: false), - FileImportLogId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - ImportLogDate = table.Column(type: "datetime(6)", nullable: false), - ImportLogDateTime = table.Column(type: "datetime(6)", nullable: false), - ImportLogTime = table.Column(type: "time(6)", nullable: false), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") - }, - constraints: table => - { - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "uvwFileView", - columns: table => new - { - EmailAddress = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - FailedCount = table.Column(type: "int", nullable: false), - FileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - FileReceivedDate = table.Column(type: "datetime(6)", nullable: false), - FileReceivedDateTime = table.Column(type: "datetime(6)", nullable: false), - FileReceivedTime = table.Column(type: "time(6)", nullable: false), - IsCompleted = table.Column(type: "tinyint(1)", nullable: false), - LineCount = table.Column(type: "int", nullable: false), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - MerchantName = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - PendingCount = table.Column(type: "int", nullable: false), - SuccessCount = table.Column(type: "int", nullable: false), - UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") - }, - constraints: table => - { - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "uvwTransactionsView", - columns: table => new - { - Amount = table.Column(type: "decimal(65,30)", nullable: false), - DayOfWeek = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - IsAuthorised = table.Column(type: "tinyint(1)", nullable: false), - IsCompleted = table.Column(type: "tinyint(1)", nullable: false), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - Month = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - MonthNumber = table.Column(type: "int", nullable: false), - OperatorIdentifier = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ResponseCode = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - TransactionDate = table.Column(type: "datetime(6)", nullable: false), - TransactionDateTime = table.Column(type: "datetime(6)", nullable: false), - TransactionId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - TransactionType = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - WeekNumber = table.Column(type: "int", nullable: false), - YearNumber = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - }) - .Annotation("MySql:CharSet", "utf8mb4"); - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20230717130332_handleSettlementProcessingStartedEvent.Designer.cs b/TransactionProcessor.Database/Migrations/MySql/20230717130332_handleSettlementProcessingStartedEvent.Designer.cs deleted file mode 100644 index 00f672d6..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20230717130332_handleSettlementProcessingStartedEvent.Designer.cs +++ /dev/null @@ -1,963 +0,0 @@ -// - -#nullable disable - -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using TransactionProcessor.Database.Contexts; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - [DbContext(typeof(EstateManagementMySqlContext))] - [Migration("20230717130332_handleSettlementProcessingStartedEvent")] - partial class handleSettlementProcessingStartedEvent - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.7") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("EstateManagement.Database.Entities.Calendar", b => - { - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DayOfWeekNumber") - .HasColumnType("int"); - - b.Property("DayOfWeekShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameLong") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("WeekNumberString") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Year") - .HasColumnType("int"); - - b.Property("YearWeekNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Date"); - - b.ToTable("calendar"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Contract", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId", "OperatorId", "ContractId"); - - b.ToTable("contract"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProduct", b => - { - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("ContractProductReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DisplayText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductType") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.HasKey("ContractReportingId", "ProductId"); - - b.ToTable("contractproduct"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProductTransactionFee", b => - { - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("TransactionFeeReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(18,4)"); - - b.HasKey("ContractProductReportingId", "TransactionFeeId"); - - b.ToTable("contractproducttransactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Estate", b => - { - b.Property("EstateReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId"); - - b.HasIndex("EstateId") - .IsUnique(); - - b.ToTable("estate"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateOperator", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RequireCustomMerchantNumber") - .HasColumnType("tinyint(1)"); - - b.Property("RequireCustomTerminalNumber") - .HasColumnType("tinyint(1)"); - - b.HasKey("EstateReportingId", "OperatorId"); - - b.ToTable("estateoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateSecurityUser", b => - { - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("SecurityUserId", "EstateReportingId"); - - b.ToTable("estatesecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.File", b => - { - b.Property("FileReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDate") - .HasColumnType("date"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileReportingId"); - - b.HasIndex("FileId") - .IsUnique(); - - b.ToTable("file"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLog", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileImportLogReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDate") - .HasColumnType("date"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateReportingId", "FileImportLogReportingId"); - - b.HasIndex("EstateReportingId", "FileImportLogId") - .IsUnique(); - - b.ToTable("fileimportlog"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLogFile", b => - { - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileUploadedDate") - .HasColumnType("date"); - - b.Property("FileUploadedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OriginalFileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileImportLogReportingId", "FileReportingId"); - - b.ToTable("fileimportlogfile"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileLine", b => - { - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("LineNumber") - .HasColumnType("int"); - - b.Property("FileLineData") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("FileReportingId", "LineNumber") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("fileline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Merchant", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("MerchantReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastStatementGenerated") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.Property("SettlementSchedule") - .HasColumnType("int"); - - b.HasKey("EstateReportingId", "MerchantReportingId"); - - b.HasIndex("EstateReportingId", "MerchantId") - .IsUnique(); - - b.ToTable("merchant"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantAddress", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("AddressId") - .HasColumnType("char(36)"); - - b.Property("AddressLine1") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AddressLine2") - .HasColumnType("longtext"); - - b.Property("AddressLine3") - .HasColumnType("longtext"); - - b.Property("AddressLine4") - .HasColumnType("longtext"); - - b.Property("Country") - .HasColumnType("longtext"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("PostalCode") - .HasColumnType("longtext"); - - b.Property("Region") - .HasColumnType("longtext"); - - b.Property("Town") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "AddressId"); - - b.ToTable("merchantaddress"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContact", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContactId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "ContactId"); - - b.ToTable("merchantcontact"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantDevice", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("DeviceId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "DeviceId"); - - b.ToTable("merchantdevice"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantOperator", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("MerchantNumber") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TerminalNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "OperatorId"); - - b.ToTable("merchantoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSecurityUser", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "SecurityUserId"); - - b.ToTable("merchantsecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSettlementFee", b => - { - b.Property("SettlementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeReportingId") - .HasColumnType("int"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("FeeCalculatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.HasKey("SettlementReportingId", "TransactionReportingId", "TransactionFeeReportingId"); - - b.ToTable("merchantsettlementfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Reconciliation", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionCount") - .HasColumnType("int"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("reconciliation"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ResponseCodes", b => - { - b.Property("ResponseCode") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ResponseCode"); - - b.ToTable("responsecodes"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Settlement", b => - { - b.Property("SettlementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("ProcessingStarted") - .HasColumnType("tinyint(1)"); - - b.Property("ProcessingStartedDateTIme") - .HasColumnType("datetime(6)"); - - b.Property("SettlementDate") - .HasColumnType("date"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("EstateReportingId", "SettlementId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("SettlementDate", "EstateReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("settlement"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementHeader", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("StatementCreatedDate") - .HasColumnType("date"); - - b.Property("StatementCreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementGeneratedDate") - .HasColumnType("date"); - - b.Property("StatementGeneratedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.HasKey("MerchantReportingId", "StatementId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("MerchantReportingId", "StatementGeneratedDate") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("statementheader"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementLine", b => - { - b.Property("StatementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ActivityType") - .HasColumnType("int"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDescription") - .HasColumnType("longtext"); - - b.Property("InAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("OutAmount") - .HasColumnType("decimal(65,30)"); - - b.HasKey("StatementReportingId", "TransactionReportingId", "ActivityDateTime", "ActivityType"); - - b.ToTable("statementline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Transaction", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("AuthorisationCode") - .HasColumnType("longtext"); - - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .HasColumnType("longtext"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .HasColumnType("longtext"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("transaction"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalRequestData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("longtext"); - - b.Property("CustomerAccountNumber") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalrequestdata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalResponseData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalresponsedata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Voucher", b => - { - b.Property("VoucherId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ExpiryDate") - .HasColumnType("date"); - - b.Property("ExpiryDateTime") - .HasColumnType("datetime(6)"); - - b.Property("GenerateDate") - .HasColumnType("date"); - - b.Property("GenerateDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsGenerated") - .HasColumnType("tinyint(1)"); - - b.Property("IsIssued") - .HasColumnType("tinyint(1)"); - - b.Property("IsRedeemed") - .HasColumnType("tinyint(1)"); - - b.Property("IssuedDate") - .HasColumnType("date"); - - b.Property("IssuedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RecipientEmail") - .HasColumnType("longtext"); - - b.Property("RecipientMobile") - .HasColumnType("longtext"); - - b.Property("RedeemedDate") - .HasColumnType("datetime(6)"); - - b.Property("RedeemedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.Property("VoucherCode") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("VoucherId"); - - b.HasIndex("TransactionReportingId"); - - b.HasIndex("VoucherCode"); - - b.ToTable("voucher"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.SettlementView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FeeDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable((string)null); - - b.ToView("uvwSettlements", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20230717130332_handleSettlementProcessingStartedEvent.cs b/TransactionProcessor.Database/Migrations/MySql/20230717130332_handleSettlementProcessingStartedEvent.cs deleted file mode 100644 index abf9b7bf..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20230717130332_handleSettlementProcessingStartedEvent.cs +++ /dev/null @@ -1,70 +0,0 @@ -#nullable disable - -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - /// - public partial class handleSettlementProcessingStartedEvent : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "transactionfee"); - - migrationBuilder.AddColumn( - name: "ProcessingStarted", - table: "settlement", - type: "tinyint(1)", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "ProcessingStartedDateTIme", - table: "settlement", - type: "datetime(6)", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "ProcessingStarted", - table: "settlement"); - - migrationBuilder.DropColumn( - name: "ProcessingStartedDateTIme", - table: "settlement"); - - migrationBuilder.CreateTable( - name: "transactionfee", - columns: table => new - { - TransactionReportingId = table.Column(type: "int", nullable: false), - TransactionFeeReportingId = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - CalculatedValue = table.Column(type: "decimal(65,30)", nullable: false), - CalculationType = table.Column(type: "int", nullable: false), - EventId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - FeeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - FeeType = table.Column(type: "int", nullable: false), - FeeValue = table.Column(type: "decimal(65,30)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_transactionfee", x => new { x.TransactionReportingId, x.TransactionFeeReportingId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_transactionfee_FeeId", - table: "transactionfee", - column: "FeeId", - unique: true); - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20230717132952_merchantsettlementfee_missingindex.Designer.cs b/TransactionProcessor.Database/Migrations/MySql/20230717132952_merchantsettlementfee_missingindex.Designer.cs deleted file mode 100644 index 4c14dcf4..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20230717132952_merchantsettlementfee_missingindex.Designer.cs +++ /dev/null @@ -1,965 +0,0 @@ -// - -#nullable disable - -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using TransactionProcessor.Database.Contexts; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - [DbContext(typeof(EstateManagementMySqlContext))] - [Migration("20230717132952_merchantsettlementfee_missingindex")] - partial class merchantsettlementfee_missingindex - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.7") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("EstateManagement.Database.Entities.Calendar", b => - { - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DayOfWeekNumber") - .HasColumnType("int"); - - b.Property("DayOfWeekShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameLong") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("WeekNumberString") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Year") - .HasColumnType("int"); - - b.Property("YearWeekNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Date"); - - b.ToTable("calendar"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Contract", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId", "OperatorId", "ContractId"); - - b.ToTable("contract"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProduct", b => - { - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("ContractProductReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DisplayText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductType") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.HasKey("ContractReportingId", "ProductId"); - - b.ToTable("contractproduct"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProductTransactionFee", b => - { - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("TransactionFeeReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(18,4)"); - - b.HasKey("ContractProductReportingId", "TransactionFeeId"); - - b.ToTable("contractproducttransactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Estate", b => - { - b.Property("EstateReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId"); - - b.HasIndex("EstateId") - .IsUnique(); - - b.ToTable("estate"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateOperator", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RequireCustomMerchantNumber") - .HasColumnType("tinyint(1)"); - - b.Property("RequireCustomTerminalNumber") - .HasColumnType("tinyint(1)"); - - b.HasKey("EstateReportingId", "OperatorId"); - - b.ToTable("estateoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateSecurityUser", b => - { - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("SecurityUserId", "EstateReportingId"); - - b.ToTable("estatesecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.File", b => - { - b.Property("FileReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDate") - .HasColumnType("date"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileReportingId"); - - b.HasIndex("FileId") - .IsUnique(); - - b.ToTable("file"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLog", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileImportLogReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDate") - .HasColumnType("date"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateReportingId", "FileImportLogReportingId"); - - b.HasIndex("EstateReportingId", "FileImportLogId") - .IsUnique(); - - b.ToTable("fileimportlog"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLogFile", b => - { - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileUploadedDate") - .HasColumnType("date"); - - b.Property("FileUploadedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OriginalFileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileImportLogReportingId", "FileReportingId"); - - b.ToTable("fileimportlogfile"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileLine", b => - { - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("LineNumber") - .HasColumnType("int"); - - b.Property("FileLineData") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("FileReportingId", "LineNumber") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("fileline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Merchant", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("MerchantReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastStatementGenerated") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.Property("SettlementSchedule") - .HasColumnType("int"); - - b.HasKey("EstateReportingId", "MerchantReportingId"); - - b.HasIndex("EstateReportingId", "MerchantId") - .IsUnique(); - - b.ToTable("merchant"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantAddress", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("AddressId") - .HasColumnType("char(36)"); - - b.Property("AddressLine1") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AddressLine2") - .HasColumnType("longtext"); - - b.Property("AddressLine3") - .HasColumnType("longtext"); - - b.Property("AddressLine4") - .HasColumnType("longtext"); - - b.Property("Country") - .HasColumnType("longtext"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("PostalCode") - .HasColumnType("longtext"); - - b.Property("Region") - .HasColumnType("longtext"); - - b.Property("Town") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "AddressId"); - - b.ToTable("merchantaddress"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContact", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContactId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "ContactId"); - - b.ToTable("merchantcontact"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantDevice", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("DeviceId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "DeviceId"); - - b.ToTable("merchantdevice"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantOperator", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("MerchantNumber") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TerminalNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "OperatorId"); - - b.ToTable("merchantoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSecurityUser", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "SecurityUserId"); - - b.ToTable("merchantsecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSettlementFee", b => - { - b.Property("SettlementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeReportingId") - .HasColumnType("int"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("FeeCalculatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.HasKey("SettlementReportingId", "TransactionReportingId", "TransactionFeeReportingId"); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("merchantsettlementfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Reconciliation", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionCount") - .HasColumnType("int"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("reconciliation"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ResponseCodes", b => - { - b.Property("ResponseCode") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ResponseCode"); - - b.ToTable("responsecodes"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Settlement", b => - { - b.Property("SettlementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("ProcessingStarted") - .HasColumnType("tinyint(1)"); - - b.Property("ProcessingStartedDateTIme") - .HasColumnType("datetime(6)"); - - b.Property("SettlementDate") - .HasColumnType("date"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("EstateReportingId", "SettlementId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("SettlementDate", "EstateReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("settlement"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementHeader", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("StatementCreatedDate") - .HasColumnType("date"); - - b.Property("StatementCreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementGeneratedDate") - .HasColumnType("date"); - - b.Property("StatementGeneratedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.HasKey("MerchantReportingId", "StatementId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("MerchantReportingId", "StatementGeneratedDate") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("statementheader"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementLine", b => - { - b.Property("StatementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ActivityType") - .HasColumnType("int"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDescription") - .HasColumnType("longtext"); - - b.Property("InAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("OutAmount") - .HasColumnType("decimal(65,30)"); - - b.HasKey("StatementReportingId", "TransactionReportingId", "ActivityDateTime", "ActivityType"); - - b.ToTable("statementline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Transaction", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("AuthorisationCode") - .HasColumnType("longtext"); - - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .HasColumnType("longtext"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .HasColumnType("longtext"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("transaction"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalRequestData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("longtext"); - - b.Property("CustomerAccountNumber") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalrequestdata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalResponseData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalresponsedata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Voucher", b => - { - b.Property("VoucherId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ExpiryDate") - .HasColumnType("date"); - - b.Property("ExpiryDateTime") - .HasColumnType("datetime(6)"); - - b.Property("GenerateDate") - .HasColumnType("date"); - - b.Property("GenerateDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsGenerated") - .HasColumnType("tinyint(1)"); - - b.Property("IsIssued") - .HasColumnType("tinyint(1)"); - - b.Property("IsRedeemed") - .HasColumnType("tinyint(1)"); - - b.Property("IssuedDate") - .HasColumnType("date"); - - b.Property("IssuedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RecipientEmail") - .HasColumnType("longtext"); - - b.Property("RecipientMobile") - .HasColumnType("longtext"); - - b.Property("RedeemedDate") - .HasColumnType("datetime(6)"); - - b.Property("RedeemedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.Property("VoucherCode") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("VoucherId"); - - b.HasIndex("TransactionReportingId"); - - b.HasIndex("VoucherCode"); - - b.ToTable("voucher"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.SettlementView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FeeDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable((string)null); - - b.ToView("uvwSettlements", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20230717132952_merchantsettlementfee_missingindex.cs b/TransactionProcessor.Database/Migrations/MySql/20230717132952_merchantsettlementfee_missingindex.cs deleted file mode 100644 index 914d8d62..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20230717132952_merchantsettlementfee_missingindex.cs +++ /dev/null @@ -1,27 +0,0 @@ -#nullable disable - -using Microsoft.EntityFrameworkCore.Migrations; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - /// - public partial class merchantsettlementfee_missingindex : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateIndex( - name: "IX_merchantsettlementfee_TransactionReportingId", - table: "merchantsettlementfee", - column: "TransactionReportingId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_merchantsettlementfee_TransactionReportingId", - table: "merchantsettlementfee"); - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20230721142823_addmerchanttosettlementtable.Designer.cs b/TransactionProcessor.Database/Migrations/MySql/20230721142823_addmerchanttosettlementtable.Designer.cs deleted file mode 100644 index 3ad631fe..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20230721142823_addmerchanttosettlementtable.Designer.cs +++ /dev/null @@ -1,968 +0,0 @@ -// - -#nullable disable - -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using TransactionProcessor.Database.Contexts; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - [DbContext(typeof(EstateManagementMySqlContext))] - [Migration("20230721142823_addmerchanttosettlementtable")] - partial class addmerchanttosettlementtable - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.7") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("EstateManagement.Database.Entities.Calendar", b => - { - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DayOfWeekNumber") - .HasColumnType("int"); - - b.Property("DayOfWeekShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameLong") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("WeekNumberString") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Year") - .HasColumnType("int"); - - b.Property("YearWeekNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Date"); - - b.ToTable("calendar"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Contract", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId", "OperatorId", "ContractId"); - - b.ToTable("contract"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProduct", b => - { - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("ContractProductReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DisplayText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductType") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.HasKey("ContractReportingId", "ProductId"); - - b.ToTable("contractproduct"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProductTransactionFee", b => - { - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("TransactionFeeReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(18,4)"); - - b.HasKey("ContractProductReportingId", "TransactionFeeId"); - - b.ToTable("contractproducttransactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Estate", b => - { - b.Property("EstateReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId"); - - b.HasIndex("EstateId") - .IsUnique(); - - b.ToTable("estate"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateOperator", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RequireCustomMerchantNumber") - .HasColumnType("tinyint(1)"); - - b.Property("RequireCustomTerminalNumber") - .HasColumnType("tinyint(1)"); - - b.HasKey("EstateReportingId", "OperatorId"); - - b.ToTable("estateoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateSecurityUser", b => - { - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("SecurityUserId", "EstateReportingId"); - - b.ToTable("estatesecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.File", b => - { - b.Property("FileReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDate") - .HasColumnType("date"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileReportingId"); - - b.HasIndex("FileId") - .IsUnique(); - - b.ToTable("file"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLog", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileImportLogReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDate") - .HasColumnType("date"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateReportingId", "FileImportLogReportingId"); - - b.HasIndex("EstateReportingId", "FileImportLogId") - .IsUnique(); - - b.ToTable("fileimportlog"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLogFile", b => - { - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileUploadedDate") - .HasColumnType("date"); - - b.Property("FileUploadedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OriginalFileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileImportLogReportingId", "FileReportingId"); - - b.ToTable("fileimportlogfile"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileLine", b => - { - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("LineNumber") - .HasColumnType("int"); - - b.Property("FileLineData") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("FileReportingId", "LineNumber") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("fileline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Merchant", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("MerchantReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastStatementGenerated") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.Property("SettlementSchedule") - .HasColumnType("int"); - - b.HasKey("EstateReportingId", "MerchantReportingId"); - - b.HasIndex("EstateReportingId", "MerchantId") - .IsUnique(); - - b.ToTable("merchant"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantAddress", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("AddressId") - .HasColumnType("char(36)"); - - b.Property("AddressLine1") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AddressLine2") - .HasColumnType("longtext"); - - b.Property("AddressLine3") - .HasColumnType("longtext"); - - b.Property("AddressLine4") - .HasColumnType("longtext"); - - b.Property("Country") - .HasColumnType("longtext"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("PostalCode") - .HasColumnType("longtext"); - - b.Property("Region") - .HasColumnType("longtext"); - - b.Property("Town") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "AddressId"); - - b.ToTable("merchantaddress"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContact", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContactId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "ContactId"); - - b.ToTable("merchantcontact"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantDevice", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("DeviceId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "DeviceId"); - - b.ToTable("merchantdevice"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantOperator", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("MerchantNumber") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TerminalNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "OperatorId"); - - b.ToTable("merchantoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSecurityUser", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "SecurityUserId"); - - b.ToTable("merchantsecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSettlementFee", b => - { - b.Property("SettlementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeReportingId") - .HasColumnType("int"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("FeeCalculatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.HasKey("SettlementReportingId", "TransactionReportingId", "TransactionFeeReportingId"); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("merchantsettlementfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Reconciliation", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionCount") - .HasColumnType("int"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("reconciliation"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ResponseCodes", b => - { - b.Property("ResponseCode") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ResponseCode"); - - b.ToTable("responsecodes"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Settlement", b => - { - b.Property("SettlementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ProcessingStarted") - .HasColumnType("tinyint(1)"); - - b.Property("ProcessingStartedDateTIme") - .HasColumnType("datetime(6)"); - - b.Property("SettlementDate") - .HasColumnType("date"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("EstateReportingId", "SettlementId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("SettlementDate", "EstateReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("settlement"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementHeader", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("StatementCreatedDate") - .HasColumnType("date"); - - b.Property("StatementCreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementGeneratedDate") - .HasColumnType("date"); - - b.Property("StatementGeneratedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.HasKey("MerchantReportingId", "StatementId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("MerchantReportingId", "StatementGeneratedDate") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("statementheader"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementLine", b => - { - b.Property("StatementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ActivityType") - .HasColumnType("int"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDescription") - .HasColumnType("longtext"); - - b.Property("InAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("OutAmount") - .HasColumnType("decimal(65,30)"); - - b.HasKey("StatementReportingId", "TransactionReportingId", "ActivityDateTime", "ActivityType"); - - b.ToTable("statementline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Transaction", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("AuthorisationCode") - .HasColumnType("longtext"); - - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .HasColumnType("longtext"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .HasColumnType("longtext"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("transaction"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalRequestData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("longtext"); - - b.Property("CustomerAccountNumber") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalrequestdata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalResponseData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalresponsedata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Voucher", b => - { - b.Property("VoucherId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ExpiryDate") - .HasColumnType("date"); - - b.Property("ExpiryDateTime") - .HasColumnType("datetime(6)"); - - b.Property("GenerateDate") - .HasColumnType("date"); - - b.Property("GenerateDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsGenerated") - .HasColumnType("tinyint(1)"); - - b.Property("IsIssued") - .HasColumnType("tinyint(1)"); - - b.Property("IsRedeemed") - .HasColumnType("tinyint(1)"); - - b.Property("IssuedDate") - .HasColumnType("date"); - - b.Property("IssuedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RecipientEmail") - .HasColumnType("longtext"); - - b.Property("RecipientMobile") - .HasColumnType("longtext"); - - b.Property("RedeemedDate") - .HasColumnType("datetime(6)"); - - b.Property("RedeemedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.Property("VoucherCode") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("VoucherId"); - - b.HasIndex("TransactionReportingId"); - - b.HasIndex("VoucherCode"); - - b.ToTable("voucher"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.SettlementView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FeeDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable((string)null); - - b.ToView("uvwSettlements", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20230721142823_addmerchanttosettlementtable.cs b/TransactionProcessor.Database/Migrations/MySql/20230721142823_addmerchanttosettlementtable.cs deleted file mode 100644 index 1bb97bbf..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20230721142823_addmerchanttosettlementtable.cs +++ /dev/null @@ -1,29 +0,0 @@ -#nullable disable - -using Microsoft.EntityFrameworkCore.Migrations; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - /// - public partial class addmerchanttosettlementtable : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "settlement", - type: "int", - nullable: false, - defaultValue: 0); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "settlement"); - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20230801201633_storelastsaleagainstmerchant.Designer.cs b/TransactionProcessor.Database/Migrations/MySql/20230801201633_storelastsaleagainstmerchant.Designer.cs deleted file mode 100644 index a24d8ff9..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20230801201633_storelastsaleagainstmerchant.Designer.cs +++ /dev/null @@ -1,974 +0,0 @@ -// - -#nullable disable - -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using TransactionProcessor.Database.Contexts; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - [DbContext(typeof(EstateManagementMySqlContext))] - [Migration("20230801201633_storelastsaleagainstmerchant")] - partial class storelastsaleagainstmerchant - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.7") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("EstateManagement.Database.Entities.Calendar", b => - { - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DayOfWeekNumber") - .HasColumnType("int"); - - b.Property("DayOfWeekShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameLong") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("WeekNumberString") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Year") - .HasColumnType("int"); - - b.Property("YearWeekNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Date"); - - b.ToTable("calendar"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Contract", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId", "OperatorId", "ContractId"); - - b.ToTable("contract"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProduct", b => - { - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("ContractProductReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DisplayText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductType") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.HasKey("ContractReportingId", "ProductId"); - - b.ToTable("contractproduct"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProductTransactionFee", b => - { - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("TransactionFeeReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(18,4)"); - - b.HasKey("ContractProductReportingId", "TransactionFeeId"); - - b.ToTable("contractproducttransactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Estate", b => - { - b.Property("EstateReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId"); - - b.HasIndex("EstateId") - .IsUnique(); - - b.ToTable("estate"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateOperator", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RequireCustomMerchantNumber") - .HasColumnType("tinyint(1)"); - - b.Property("RequireCustomTerminalNumber") - .HasColumnType("tinyint(1)"); - - b.HasKey("EstateReportingId", "OperatorId"); - - b.ToTable("estateoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateSecurityUser", b => - { - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("SecurityUserId", "EstateReportingId"); - - b.ToTable("estatesecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.File", b => - { - b.Property("FileReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDate") - .HasColumnType("date"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileReportingId"); - - b.HasIndex("FileId") - .IsUnique(); - - b.ToTable("file"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLog", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileImportLogReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDate") - .HasColumnType("date"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateReportingId", "FileImportLogReportingId"); - - b.HasIndex("EstateReportingId", "FileImportLogId") - .IsUnique(); - - b.ToTable("fileimportlog"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLogFile", b => - { - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileUploadedDate") - .HasColumnType("date"); - - b.Property("FileUploadedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OriginalFileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileImportLogReportingId", "FileReportingId"); - - b.ToTable("fileimportlogfile"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileLine", b => - { - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("LineNumber") - .HasColumnType("int"); - - b.Property("FileLineData") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("FileReportingId", "LineNumber") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("fileline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Merchant", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("MerchantReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastSaleDate") - .HasColumnType("date"); - - b.Property("LastSaleDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastStatementGenerated") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.Property("SettlementSchedule") - .HasColumnType("int"); - - b.HasKey("EstateReportingId", "MerchantReportingId"); - - b.HasIndex("EstateReportingId", "MerchantId") - .IsUnique(); - - b.ToTable("merchant"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantAddress", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("AddressId") - .HasColumnType("char(36)"); - - b.Property("AddressLine1") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AddressLine2") - .HasColumnType("longtext"); - - b.Property("AddressLine3") - .HasColumnType("longtext"); - - b.Property("AddressLine4") - .HasColumnType("longtext"); - - b.Property("Country") - .HasColumnType("longtext"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("PostalCode") - .HasColumnType("longtext"); - - b.Property("Region") - .HasColumnType("longtext"); - - b.Property("Town") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "AddressId"); - - b.ToTable("merchantaddress"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContact", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContactId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "ContactId"); - - b.ToTable("merchantcontact"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantDevice", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("DeviceId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "DeviceId"); - - b.ToTable("merchantdevice"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantOperator", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("MerchantNumber") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TerminalNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "OperatorId"); - - b.ToTable("merchantoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSecurityUser", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "SecurityUserId"); - - b.ToTable("merchantsecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSettlementFee", b => - { - b.Property("SettlementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeReportingId") - .HasColumnType("int"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("FeeCalculatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.HasKey("SettlementReportingId", "TransactionReportingId", "TransactionFeeReportingId"); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("merchantsettlementfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Reconciliation", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionCount") - .HasColumnType("int"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("reconciliation"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ResponseCodes", b => - { - b.Property("ResponseCode") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ResponseCode"); - - b.ToTable("responsecodes"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Settlement", b => - { - b.Property("SettlementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ProcessingStarted") - .HasColumnType("tinyint(1)"); - - b.Property("ProcessingStartedDateTIme") - .HasColumnType("datetime(6)"); - - b.Property("SettlementDate") - .HasColumnType("date"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("EstateReportingId", "SettlementId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("SettlementDate", "EstateReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("settlement"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementHeader", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("StatementCreatedDate") - .HasColumnType("date"); - - b.Property("StatementCreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementGeneratedDate") - .HasColumnType("date"); - - b.Property("StatementGeneratedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.HasKey("MerchantReportingId", "StatementId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("MerchantReportingId", "StatementGeneratedDate") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("statementheader"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementLine", b => - { - b.Property("StatementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ActivityType") - .HasColumnType("int"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDescription") - .HasColumnType("longtext"); - - b.Property("InAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("OutAmount") - .HasColumnType("decimal(65,30)"); - - b.HasKey("StatementReportingId", "TransactionReportingId", "ActivityDateTime", "ActivityType"); - - b.ToTable("statementline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Transaction", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("AuthorisationCode") - .HasColumnType("longtext"); - - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .HasColumnType("longtext"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .HasColumnType("longtext"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("transaction"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalRequestData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("longtext"); - - b.Property("CustomerAccountNumber") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalrequestdata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalResponseData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalresponsedata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Voucher", b => - { - b.Property("VoucherId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ExpiryDate") - .HasColumnType("date"); - - b.Property("ExpiryDateTime") - .HasColumnType("datetime(6)"); - - b.Property("GenerateDate") - .HasColumnType("date"); - - b.Property("GenerateDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsGenerated") - .HasColumnType("tinyint(1)"); - - b.Property("IsIssued") - .HasColumnType("tinyint(1)"); - - b.Property("IsRedeemed") - .HasColumnType("tinyint(1)"); - - b.Property("IssuedDate") - .HasColumnType("date"); - - b.Property("IssuedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RecipientEmail") - .HasColumnType("longtext"); - - b.Property("RecipientMobile") - .HasColumnType("longtext"); - - b.Property("RedeemedDate") - .HasColumnType("datetime(6)"); - - b.Property("RedeemedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.Property("VoucherCode") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("VoucherId"); - - b.HasIndex("TransactionReportingId"); - - b.HasIndex("VoucherCode"); - - b.ToTable("voucher"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.SettlementView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FeeDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable((string)null); - - b.ToView("uvwSettlements", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20230801201633_storelastsaleagainstmerchant.cs b/TransactionProcessor.Database/Migrations/MySql/20230801201633_storelastsaleagainstmerchant.cs deleted file mode 100644 index 718a1769..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20230801201633_storelastsaleagainstmerchant.cs +++ /dev/null @@ -1,40 +0,0 @@ -#nullable disable - -using Microsoft.EntityFrameworkCore.Migrations; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - /// - public partial class storelastsaleagainstmerchant : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "LastSaleDate", - table: "merchant", - type: "date", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn( - name: "LastSaleDateTime", - table: "merchant", - type: "datetime(6)", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "LastSaleDate", - table: "merchant"); - - migrationBuilder.DropColumn( - name: "LastSaleDateTime", - table: "merchant"); - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20230905184421_amountintransaction.Designer.cs b/TransactionProcessor.Database/Migrations/MySql/20230905184421_amountintransaction.Designer.cs deleted file mode 100644 index 4eb7cb5d..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20230905184421_amountintransaction.Designer.cs +++ /dev/null @@ -1,981 +0,0 @@ -// - -#nullable disable - -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using TransactionProcessor.Database.Contexts; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - [DbContext(typeof(EstateManagementMySqlContext))] - [Migration("20230905184421_amountintransaction")] - partial class amountintransaction - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.7") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("EstateManagement.Database.Entities.Calendar", b => - { - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DayOfWeekNumber") - .HasColumnType("int"); - - b.Property("DayOfWeekShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameLong") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("WeekNumberString") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Year") - .HasColumnType("int"); - - b.Property("YearWeekNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Date"); - - b.ToTable("calendar"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Contract", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId", "OperatorId", "ContractId"); - - b.ToTable("contract"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProduct", b => - { - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("ContractProductReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DisplayText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductType") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.HasKey("ContractReportingId", "ProductId"); - - b.ToTable("contractproduct"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProductTransactionFee", b => - { - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("TransactionFeeReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(18,4)"); - - b.HasKey("ContractProductReportingId", "TransactionFeeId"); - - b.ToTable("contractproducttransactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Estate", b => - { - b.Property("EstateReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId"); - - b.HasIndex("EstateId") - .IsUnique(); - - b.ToTable("estate"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateOperator", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RequireCustomMerchantNumber") - .HasColumnType("tinyint(1)"); - - b.Property("RequireCustomTerminalNumber") - .HasColumnType("tinyint(1)"); - - b.HasKey("EstateReportingId", "OperatorId"); - - b.ToTable("estateoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateSecurityUser", b => - { - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("SecurityUserId", "EstateReportingId"); - - b.ToTable("estatesecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.File", b => - { - b.Property("FileReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDate") - .HasColumnType("date"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileReportingId"); - - b.HasIndex("FileId") - .IsUnique(); - - b.ToTable("file"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLog", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileImportLogReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDate") - .HasColumnType("date"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateReportingId", "FileImportLogReportingId"); - - b.HasIndex("EstateReportingId", "FileImportLogId") - .IsUnique(); - - b.ToTable("fileimportlog"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLogFile", b => - { - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileUploadedDate") - .HasColumnType("date"); - - b.Property("FileUploadedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OriginalFileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileImportLogReportingId", "FileReportingId"); - - b.ToTable("fileimportlogfile"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileLine", b => - { - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("LineNumber") - .HasColumnType("int"); - - b.Property("FileLineData") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("FileReportingId", "LineNumber") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("fileline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Merchant", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("MerchantReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastSaleDate") - .HasColumnType("date"); - - b.Property("LastSaleDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastStatementGenerated") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.Property("SettlementSchedule") - .HasColumnType("int"); - - b.HasKey("EstateReportingId", "MerchantReportingId"); - - b.HasIndex("EstateReportingId", "MerchantId") - .IsUnique(); - - b.ToTable("merchant"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantAddress", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("AddressId") - .HasColumnType("char(36)"); - - b.Property("AddressLine1") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AddressLine2") - .HasColumnType("longtext"); - - b.Property("AddressLine3") - .HasColumnType("longtext"); - - b.Property("AddressLine4") - .HasColumnType("longtext"); - - b.Property("Country") - .HasColumnType("longtext"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("PostalCode") - .HasColumnType("longtext"); - - b.Property("Region") - .HasColumnType("longtext"); - - b.Property("Town") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "AddressId"); - - b.ToTable("merchantaddress"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContact", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContactId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "ContactId"); - - b.ToTable("merchantcontact"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantDevice", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("DeviceId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "DeviceId"); - - b.ToTable("merchantdevice"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantOperator", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("MerchantNumber") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TerminalNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "OperatorId"); - - b.ToTable("merchantoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSecurityUser", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "SecurityUserId"); - - b.ToTable("merchantsecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSettlementFee", b => - { - b.Property("SettlementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeReportingId") - .HasColumnType("int"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("FeeCalculatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.HasKey("SettlementReportingId", "TransactionReportingId", "TransactionFeeReportingId"); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("merchantsettlementfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Reconciliation", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionCount") - .HasColumnType("int"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("reconciliation"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ResponseCodes", b => - { - b.Property("ResponseCode") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ResponseCode"); - - b.ToTable("responsecodes"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Settlement", b => - { - b.Property("SettlementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ProcessingStarted") - .HasColumnType("tinyint(1)"); - - b.Property("ProcessingStartedDateTIme") - .HasColumnType("datetime(6)"); - - b.Property("SettlementDate") - .HasColumnType("date"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("EstateReportingId", "SettlementId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("SettlementDate", "EstateReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("settlement"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementHeader", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("StatementCreatedDate") - .HasColumnType("date"); - - b.Property("StatementCreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementGeneratedDate") - .HasColumnType("date"); - - b.Property("StatementGeneratedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.HasKey("MerchantReportingId", "StatementId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("MerchantReportingId", "StatementGeneratedDate") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("statementheader"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementLine", b => - { - b.Property("StatementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ActivityType") - .HasColumnType("int"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDescription") - .HasColumnType("longtext"); - - b.Property("InAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("OutAmount") - .HasColumnType("decimal(65,30)"); - - b.HasKey("StatementReportingId", "TransactionReportingId", "ActivityDateTime", "ActivityType"); - - b.ToTable("statementline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Transaction", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("AuthorisationCode") - .HasColumnType("longtext"); - - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .HasColumnType("longtext"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .HasColumnType("longtext"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("transaction"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalRequestData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("longtext"); - - b.Property("CustomerAccountNumber") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalrequestdata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalResponseData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalresponsedata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Voucher", b => - { - b.Property("VoucherId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ExpiryDate") - .HasColumnType("date"); - - b.Property("ExpiryDateTime") - .HasColumnType("datetime(6)"); - - b.Property("GenerateDate") - .HasColumnType("date"); - - b.Property("GenerateDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsGenerated") - .HasColumnType("tinyint(1)"); - - b.Property("IsIssued") - .HasColumnType("tinyint(1)"); - - b.Property("IsRedeemed") - .HasColumnType("tinyint(1)"); - - b.Property("IssuedDate") - .HasColumnType("date"); - - b.Property("IssuedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RecipientEmail") - .HasColumnType("longtext"); - - b.Property("RecipientMobile") - .HasColumnType("longtext"); - - b.Property("RedeemedDate") - .HasColumnType("datetime(6)"); - - b.Property("RedeemedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.Property("VoucherCode") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("VoucherId"); - - b.HasIndex("TransactionReportingId"); - - b.HasIndex("VoucherCode"); - - b.ToTable("voucher"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.SettlementView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FeeDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable((string)null); - - b.ToView("uvwSettlements", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20230905184421_amountintransaction.cs b/TransactionProcessor.Database/Migrations/MySql/20230905184421_amountintransaction.cs deleted file mode 100644 index 8e6667ab..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20230905184421_amountintransaction.cs +++ /dev/null @@ -1,39 +0,0 @@ -#nullable disable - -using Microsoft.EntityFrameworkCore.Migrations; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - /// - public partial class amountintransaction : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TransactionAmount", - table: "transaction", - type: "decimal(65,30)", - nullable: false, - defaultValue: 0m); - - migrationBuilder.CreateIndex( - name: "IX_transaction_TransactionId", - table: "transaction", - column: "TransactionId", - unique: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_transaction_TransactionId", - table: "transaction"); - - migrationBuilder.DropColumn( - name: "TransactionAmount", - table: "transaction"); - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20231115193921_recordestateoperatorreportingidwithtxn.Designer.cs b/TransactionProcessor.Database/Migrations/MySql/20231115193921_recordestateoperatorreportingidwithtxn.Designer.cs deleted file mode 100644 index bece80be..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20231115193921_recordestateoperatorreportingidwithtxn.Designer.cs +++ /dev/null @@ -1,985 +0,0 @@ -// - -#nullable disable - -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using TransactionProcessor.Database.Contexts; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - [DbContext(typeof(EstateManagementMySqlContext))] - [Migration("20231115193921_recordestateoperatorreportingidwithtxn")] - partial class recordestateoperatorreportingidwithtxn - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.7") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("EstateManagement.Database.Entities.Calendar", b => - { - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DayOfWeekNumber") - .HasColumnType("int"); - - b.Property("DayOfWeekShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameLong") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("WeekNumberString") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Year") - .HasColumnType("int"); - - b.Property("YearWeekNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Date"); - - b.ToTable("calendar"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Contract", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId", "OperatorId", "ContractId"); - - b.ToTable("contract"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProduct", b => - { - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("ContractProductReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DisplayText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductType") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.HasKey("ContractReportingId", "ProductId"); - - b.ToTable("contractproduct"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProductTransactionFee", b => - { - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("TransactionFeeReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(18,4)"); - - b.HasKey("ContractProductReportingId", "TransactionFeeId"); - - b.ToTable("contractproducttransactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Estate", b => - { - b.Property("EstateReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId"); - - b.HasIndex("EstateId") - .IsUnique(); - - b.ToTable("estate"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateOperator", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("EstateOperatorReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RequireCustomMerchantNumber") - .HasColumnType("tinyint(1)"); - - b.Property("RequireCustomTerminalNumber") - .HasColumnType("tinyint(1)"); - - b.HasKey("EstateReportingId", "OperatorId"); - - b.ToTable("estateoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateSecurityUser", b => - { - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("SecurityUserId", "EstateReportingId"); - - b.ToTable("estatesecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.File", b => - { - b.Property("FileReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDate") - .HasColumnType("date"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileReportingId"); - - b.HasIndex("FileId") - .IsUnique(); - - b.ToTable("file"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLog", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileImportLogReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDate") - .HasColumnType("date"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateReportingId", "FileImportLogReportingId"); - - b.HasIndex("EstateReportingId", "FileImportLogId") - .IsUnique(); - - b.ToTable("fileimportlog"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLogFile", b => - { - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileUploadedDate") - .HasColumnType("date"); - - b.Property("FileUploadedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OriginalFileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileImportLogReportingId", "FileReportingId"); - - b.ToTable("fileimportlogfile"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileLine", b => - { - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("LineNumber") - .HasColumnType("int"); - - b.Property("FileLineData") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("FileReportingId", "LineNumber") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("fileline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Merchant", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("MerchantReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastSaleDate") - .HasColumnType("date"); - - b.Property("LastSaleDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastStatementGenerated") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.Property("SettlementSchedule") - .HasColumnType("int"); - - b.HasKey("EstateReportingId", "MerchantReportingId"); - - b.HasIndex("EstateReportingId", "MerchantId") - .IsUnique(); - - b.ToTable("merchant"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantAddress", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("AddressId") - .HasColumnType("char(36)"); - - b.Property("AddressLine1") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AddressLine2") - .HasColumnType("longtext"); - - b.Property("AddressLine3") - .HasColumnType("longtext"); - - b.Property("AddressLine4") - .HasColumnType("longtext"); - - b.Property("Country") - .HasColumnType("longtext"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("PostalCode") - .HasColumnType("longtext"); - - b.Property("Region") - .HasColumnType("longtext"); - - b.Property("Town") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "AddressId"); - - b.ToTable("merchantaddress"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContact", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContactId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "ContactId"); - - b.ToTable("merchantcontact"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantDevice", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("DeviceId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "DeviceId"); - - b.ToTable("merchantdevice"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantOperator", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("MerchantNumber") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TerminalNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "OperatorId"); - - b.ToTable("merchantoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSecurityUser", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "SecurityUserId"); - - b.ToTable("merchantsecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSettlementFee", b => - { - b.Property("SettlementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeReportingId") - .HasColumnType("int"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("FeeCalculatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.HasKey("SettlementReportingId", "TransactionReportingId", "TransactionFeeReportingId"); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("merchantsettlementfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Reconciliation", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionCount") - .HasColumnType("int"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("reconciliation"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ResponseCodes", b => - { - b.Property("ResponseCode") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ResponseCode"); - - b.ToTable("responsecodes"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Settlement", b => - { - b.Property("SettlementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ProcessingStarted") - .HasColumnType("tinyint(1)"); - - b.Property("ProcessingStartedDateTIme") - .HasColumnType("datetime(6)"); - - b.Property("SettlementDate") - .HasColumnType("date"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("EstateReportingId", "SettlementId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("SettlementDate", "EstateReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("settlement"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementHeader", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("StatementCreatedDate") - .HasColumnType("date"); - - b.Property("StatementCreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementGeneratedDate") - .HasColumnType("date"); - - b.Property("StatementGeneratedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.HasKey("MerchantReportingId", "StatementId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("MerchantReportingId", "StatementGeneratedDate") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("statementheader"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementLine", b => - { - b.Property("StatementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ActivityType") - .HasColumnType("int"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDescription") - .HasColumnType("longtext"); - - b.Property("InAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("OutAmount") - .HasColumnType("decimal(65,30)"); - - b.HasKey("StatementReportingId", "TransactionReportingId", "ActivityDateTime", "ActivityType"); - - b.ToTable("statementline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Transaction", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("AuthorisationCode") - .HasColumnType("longtext"); - - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("EstateOperatorReportingId") - .HasColumnType("int"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .HasColumnType("longtext"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("transaction"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalRequestData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("longtext"); - - b.Property("CustomerAccountNumber") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalrequestdata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalResponseData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalresponsedata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Voucher", b => - { - b.Property("VoucherId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ExpiryDate") - .HasColumnType("date"); - - b.Property("ExpiryDateTime") - .HasColumnType("datetime(6)"); - - b.Property("GenerateDate") - .HasColumnType("date"); - - b.Property("GenerateDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsGenerated") - .HasColumnType("tinyint(1)"); - - b.Property("IsIssued") - .HasColumnType("tinyint(1)"); - - b.Property("IsRedeemed") - .HasColumnType("tinyint(1)"); - - b.Property("IssuedDate") - .HasColumnType("date"); - - b.Property("IssuedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RecipientEmail") - .HasColumnType("longtext"); - - b.Property("RecipientMobile") - .HasColumnType("longtext"); - - b.Property("RedeemedDate") - .HasColumnType("datetime(6)"); - - b.Property("RedeemedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.Property("VoucherCode") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("VoucherId"); - - b.HasIndex("TransactionReportingId"); - - b.HasIndex("VoucherCode"); - - b.ToTable("voucher"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.SettlementView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FeeDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable((string)null); - - b.ToView("uvwSettlements", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20231115193921_recordestateoperatorreportingidwithtxn.cs b/TransactionProcessor.Database/Migrations/MySql/20231115193921_recordestateoperatorreportingidwithtxn.cs deleted file mode 100644 index 898e1c73..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20231115193921_recordestateoperatorreportingidwithtxn.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable disable - -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - /// - public partial class recordestateoperatorreportingidwithtxn : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "OperatorIdentifier", - table: "transaction"); - - migrationBuilder.AddColumn( - name: "EstateOperatorReportingId", - table: "transaction", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "EstateOperatorReportingId", - table: "estateoperator", - type: "int", - nullable: false, - defaultValue: 0) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "EstateOperatorReportingId", - table: "transaction"); - - migrationBuilder.DropColumn( - name: "EstateOperatorReportingId", - table: "estateoperator"); - - migrationBuilder.AddColumn( - name: "OperatorIdentifier", - table: "transaction", - type: "longtext", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20231228135806_addmerchantcontracttable.Designer.cs b/TransactionProcessor.Database/Migrations/MySql/20231228135806_addmerchantcontracttable.Designer.cs deleted file mode 100644 index d638f866..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20231228135806_addmerchantcontracttable.Designer.cs +++ /dev/null @@ -1,998 +0,0 @@ -// - -#nullable disable - -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using TransactionProcessor.Database.Contexts; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - [DbContext(typeof(EstateManagementMySqlContext))] - [Migration("20231228135806_addmerchantcontracttable")] - partial class addmerchantcontracttable - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.7") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("EstateManagement.Database.Entities.Calendar", b => - { - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DayOfWeekNumber") - .HasColumnType("int"); - - b.Property("DayOfWeekShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameLong") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("WeekNumberString") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Year") - .HasColumnType("int"); - - b.Property("YearWeekNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Date"); - - b.ToTable("calendar"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Contract", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId", "OperatorId", "ContractId"); - - b.ToTable("contract"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProduct", b => - { - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("ContractProductReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DisplayText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductType") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.HasKey("ContractReportingId", "ProductId"); - - b.ToTable("contractproduct"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProductTransactionFee", b => - { - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("TransactionFeeReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(18,4)"); - - b.HasKey("ContractProductReportingId", "TransactionFeeId"); - - b.ToTable("contractproducttransactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Estate", b => - { - b.Property("EstateReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId"); - - b.HasIndex("EstateId") - .IsUnique(); - - b.ToTable("estate"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateOperator", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("EstateOperatorReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RequireCustomMerchantNumber") - .HasColumnType("tinyint(1)"); - - b.Property("RequireCustomTerminalNumber") - .HasColumnType("tinyint(1)"); - - b.HasKey("EstateReportingId", "OperatorId"); - - b.ToTable("estateoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateSecurityUser", b => - { - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("SecurityUserId", "EstateReportingId"); - - b.ToTable("estatesecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.File", b => - { - b.Property("FileReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDate") - .HasColumnType("date"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileReportingId"); - - b.HasIndex("FileId") - .IsUnique(); - - b.ToTable("file"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLog", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileImportLogReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDate") - .HasColumnType("date"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateReportingId", "FileImportLogReportingId"); - - b.HasIndex("EstateReportingId", "FileImportLogId") - .IsUnique(); - - b.ToTable("fileimportlog"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLogFile", b => - { - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileUploadedDate") - .HasColumnType("date"); - - b.Property("FileUploadedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OriginalFileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileImportLogReportingId", "FileReportingId"); - - b.ToTable("fileimportlogfile"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileLine", b => - { - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("LineNumber") - .HasColumnType("int"); - - b.Property("FileLineData") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("FileReportingId", "LineNumber") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("fileline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Merchant", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("MerchantReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastSaleDate") - .HasColumnType("date"); - - b.Property("LastSaleDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastStatementGenerated") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.Property("SettlementSchedule") - .HasColumnType("int"); - - b.HasKey("EstateReportingId", "MerchantReportingId"); - - b.HasIndex("EstateReportingId", "MerchantId") - .IsUnique(); - - b.ToTable("merchant"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantAddress", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("AddressId") - .HasColumnType("char(36)"); - - b.Property("AddressLine1") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AddressLine2") - .HasColumnType("longtext"); - - b.Property("AddressLine3") - .HasColumnType("longtext"); - - b.Property("AddressLine4") - .HasColumnType("longtext"); - - b.Property("Country") - .HasColumnType("longtext"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("PostalCode") - .HasColumnType("longtext"); - - b.Property("Region") - .HasColumnType("longtext"); - - b.Property("Town") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "AddressId"); - - b.ToTable("merchantaddress"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContact", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContactId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "ContactId"); - - b.ToTable("merchantcontact"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContract", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.HasKey("MerchantReportingId", "ContractReportingId"); - - b.ToTable("MerchantContracts"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantDevice", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("DeviceId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "DeviceId"); - - b.ToTable("merchantdevice"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantOperator", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("MerchantNumber") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TerminalNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "OperatorId"); - - b.ToTable("merchantoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSecurityUser", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "SecurityUserId"); - - b.ToTable("merchantsecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSettlementFee", b => - { - b.Property("SettlementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeReportingId") - .HasColumnType("int"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("FeeCalculatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.HasKey("SettlementReportingId", "TransactionReportingId", "TransactionFeeReportingId"); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("merchantsettlementfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Reconciliation", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionCount") - .HasColumnType("int"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("reconciliation"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ResponseCodes", b => - { - b.Property("ResponseCode") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ResponseCode"); - - b.ToTable("responsecodes"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Settlement", b => - { - b.Property("SettlementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ProcessingStarted") - .HasColumnType("tinyint(1)"); - - b.Property("ProcessingStartedDateTIme") - .HasColumnType("datetime(6)"); - - b.Property("SettlementDate") - .HasColumnType("date"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("EstateReportingId", "SettlementId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("SettlementDate", "EstateReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("settlement"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementHeader", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("StatementCreatedDate") - .HasColumnType("date"); - - b.Property("StatementCreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementGeneratedDate") - .HasColumnType("date"); - - b.Property("StatementGeneratedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.HasKey("MerchantReportingId", "StatementId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("MerchantReportingId", "StatementGeneratedDate") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("statementheader"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementLine", b => - { - b.Property("StatementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ActivityType") - .HasColumnType("int"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDescription") - .HasColumnType("longtext"); - - b.Property("InAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("OutAmount") - .HasColumnType("decimal(65,30)"); - - b.HasKey("StatementReportingId", "TransactionReportingId", "ActivityDateTime", "ActivityType"); - - b.ToTable("statementline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Transaction", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("AuthorisationCode") - .HasColumnType("longtext"); - - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("EstateOperatorReportingId") - .HasColumnType("int"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .HasColumnType("longtext"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("transaction"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalRequestData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("longtext"); - - b.Property("CustomerAccountNumber") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalrequestdata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalResponseData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalresponsedata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Voucher", b => - { - b.Property("VoucherId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ExpiryDate") - .HasColumnType("date"); - - b.Property("ExpiryDateTime") - .HasColumnType("datetime(6)"); - - b.Property("GenerateDate") - .HasColumnType("date"); - - b.Property("GenerateDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsGenerated") - .HasColumnType("tinyint(1)"); - - b.Property("IsIssued") - .HasColumnType("tinyint(1)"); - - b.Property("IsRedeemed") - .HasColumnType("tinyint(1)"); - - b.Property("IssuedDate") - .HasColumnType("date"); - - b.Property("IssuedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RecipientEmail") - .HasColumnType("longtext"); - - b.Property("RecipientMobile") - .HasColumnType("longtext"); - - b.Property("RedeemedDate") - .HasColumnType("datetime(6)"); - - b.Property("RedeemedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.Property("VoucherCode") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("VoucherId"); - - b.HasIndex("TransactionReportingId"); - - b.HasIndex("VoucherCode"); - - b.ToTable("voucher"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.SettlementView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FeeDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable((string)null); - - b.ToView("uvwSettlements", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20231228135806_addmerchantcontracttable.cs b/TransactionProcessor.Database/Migrations/MySql/20231228135806_addmerchantcontracttable.cs deleted file mode 100644 index 892668e5..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20231228135806_addmerchantcontracttable.cs +++ /dev/null @@ -1,34 +0,0 @@ -#nullable disable - -using Microsoft.EntityFrameworkCore.Migrations; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - /// - public partial class addmerchantcontracttable : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "MerchantContracts", - columns: table => new - { - MerchantReportingId = table.Column(type: "int", nullable: false), - ContractReportingId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_MerchantContracts", x => new { x.MerchantReportingId, x.ContractReportingId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "MerchantContracts"); - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20240210074240_floattables.Designer.cs b/TransactionProcessor.Database/Migrations/MySql/20240210074240_floattables.Designer.cs deleted file mode 100644 index d7a5d3c8..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20240210074240_floattables.Designer.cs +++ /dev/null @@ -1,1062 +0,0 @@ -// - -#nullable disable - -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using TransactionProcessor.Database.Contexts; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - [DbContext(typeof(EstateManagementMySqlContext))] - [Migration("20240210074240_floattables")] - partial class floattables - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.7") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("EstateManagement.Database.Entities.Calendar", b => - { - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DayOfWeekNumber") - .HasColumnType("int"); - - b.Property("DayOfWeekShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameLong") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("WeekNumberString") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Year") - .HasColumnType("int"); - - b.Property("YearWeekNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Date"); - - b.ToTable("calendar"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Contract", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId", "OperatorId", "ContractId"); - - b.ToTable("contract"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProduct", b => - { - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("ContractProductReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DisplayText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductType") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.HasKey("ContractReportingId", "ProductId"); - - b.ToTable("contractproduct"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProductTransactionFee", b => - { - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("TransactionFeeReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(18,4)"); - - b.HasKey("ContractProductReportingId", "TransactionFeeId"); - - b.ToTable("contractproducttransactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Estate", b => - { - b.Property("EstateReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId"); - - b.HasIndex("EstateId") - .IsUnique(); - - b.ToTable("estate"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateOperator", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("EstateOperatorReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RequireCustomMerchantNumber") - .HasColumnType("tinyint(1)"); - - b.Property("RequireCustomTerminalNumber") - .HasColumnType("tinyint(1)"); - - b.HasKey("EstateReportingId", "OperatorId"); - - b.ToTable("estateoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateSecurityUser", b => - { - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("SecurityUserId", "EstateReportingId"); - - b.ToTable("estatesecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.File", b => - { - b.Property("FileReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDate") - .HasColumnType("date"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileReportingId"); - - b.HasIndex("FileId") - .IsUnique(); - - b.ToTable("file"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLog", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileImportLogReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDate") - .HasColumnType("date"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateReportingId", "FileImportLogReportingId"); - - b.HasIndex("EstateReportingId", "FileImportLogId") - .IsUnique(); - - b.ToTable("fileimportlog"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLogFile", b => - { - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileUploadedDate") - .HasColumnType("date"); - - b.Property("FileUploadedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OriginalFileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileImportLogReportingId", "FileReportingId"); - - b.ToTable("fileimportlogfile"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileLine", b => - { - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("LineNumber") - .HasColumnType("int"); - - b.Property("FileLineData") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("FileReportingId", "LineNumber") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("fileline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Float", b => - { - b.Property("FloatId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("CreatedDate") - .HasColumnType("date"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.HasKey("FloatId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("CreatedDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("Floats"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FloatActivity", b => - { - b.Property("EventId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CostPrice") - .HasColumnType("decimal(65,30)"); - - b.Property("CreditOrDebit") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloatId") - .HasColumnType("char(36)"); - - b.HasKey("EventId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("ActivityDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("FloatActivity"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Merchant", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("MerchantReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastSaleDate") - .HasColumnType("date"); - - b.Property("LastSaleDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastStatementGenerated") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.Property("SettlementSchedule") - .HasColumnType("int"); - - b.HasKey("EstateReportingId", "MerchantReportingId"); - - b.HasIndex("EstateReportingId", "MerchantId") - .IsUnique(); - - b.ToTable("merchant"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantAddress", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("AddressId") - .HasColumnType("char(36)"); - - b.Property("AddressLine1") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AddressLine2") - .HasColumnType("longtext"); - - b.Property("AddressLine3") - .HasColumnType("longtext"); - - b.Property("AddressLine4") - .HasColumnType("longtext"); - - b.Property("Country") - .HasColumnType("longtext"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("PostalCode") - .HasColumnType("longtext"); - - b.Property("Region") - .HasColumnType("longtext"); - - b.Property("Town") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "AddressId"); - - b.ToTable("merchantaddress"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContact", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContactId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "ContactId"); - - b.ToTable("merchantcontact"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContract", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.HasKey("MerchantReportingId", "ContractReportingId"); - - b.ToTable("MerchantContracts"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantDevice", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("DeviceId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "DeviceId"); - - b.ToTable("merchantdevice"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantOperator", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("MerchantNumber") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TerminalNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "OperatorId"); - - b.ToTable("merchantoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSecurityUser", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "SecurityUserId"); - - b.ToTable("merchantsecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSettlementFee", b => - { - b.Property("SettlementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeReportingId") - .HasColumnType("int"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("FeeCalculatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.HasKey("SettlementReportingId", "TransactionReportingId", "TransactionFeeReportingId"); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("merchantsettlementfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Reconciliation", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionCount") - .HasColumnType("int"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("reconciliation"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ResponseCodes", b => - { - b.Property("ResponseCode") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ResponseCode"); - - b.ToTable("responsecodes"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Settlement", b => - { - b.Property("SettlementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ProcessingStarted") - .HasColumnType("tinyint(1)"); - - b.Property("ProcessingStartedDateTIme") - .HasColumnType("datetime(6)"); - - b.Property("SettlementDate") - .HasColumnType("date"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("EstateReportingId", "SettlementId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("SettlementDate", "EstateReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("settlement"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementHeader", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("StatementCreatedDate") - .HasColumnType("date"); - - b.Property("StatementCreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementGeneratedDate") - .HasColumnType("date"); - - b.Property("StatementGeneratedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.HasKey("MerchantReportingId", "StatementId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("MerchantReportingId", "StatementGeneratedDate") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("statementheader"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementLine", b => - { - b.Property("StatementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ActivityType") - .HasColumnType("int"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDescription") - .HasColumnType("longtext"); - - b.Property("InAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("OutAmount") - .HasColumnType("decimal(65,30)"); - - b.HasKey("StatementReportingId", "TransactionReportingId", "ActivityDateTime", "ActivityType"); - - b.ToTable("statementline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Transaction", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("AuthorisationCode") - .HasColumnType("longtext"); - - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("EstateOperatorReportingId") - .HasColumnType("int"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .HasColumnType("longtext"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("transaction"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalRequestData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("longtext"); - - b.Property("CustomerAccountNumber") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalrequestdata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalResponseData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalresponsedata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Voucher", b => - { - b.Property("VoucherId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ExpiryDate") - .HasColumnType("date"); - - b.Property("ExpiryDateTime") - .HasColumnType("datetime(6)"); - - b.Property("GenerateDate") - .HasColumnType("date"); - - b.Property("GenerateDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsGenerated") - .HasColumnType("tinyint(1)"); - - b.Property("IsIssued") - .HasColumnType("tinyint(1)"); - - b.Property("IsRedeemed") - .HasColumnType("tinyint(1)"); - - b.Property("IssuedDate") - .HasColumnType("date"); - - b.Property("IssuedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RecipientEmail") - .HasColumnType("longtext"); - - b.Property("RecipientMobile") - .HasColumnType("longtext"); - - b.Property("RedeemedDate") - .HasColumnType("datetime(6)"); - - b.Property("RedeemedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.Property("VoucherCode") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("VoucherId"); - - b.HasIndex("TransactionReportingId"); - - b.HasIndex("VoucherCode"); - - b.ToTable("voucher"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.SettlementView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FeeDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable((string)null); - - b.ToView("uvwSettlements", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20240210074240_floattables.cs b/TransactionProcessor.Database/Migrations/MySql/20240210074240_floattables.cs deleted file mode 100644 index 8c90b6a8..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20240210074240_floattables.cs +++ /dev/null @@ -1,70 +0,0 @@ -#nullable disable - -using Microsoft.EntityFrameworkCore.Migrations; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - /// - public partial class floattables : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "FloatActivity", - columns: table => new - { - EventId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - FloatId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - ActivityDate = table.Column(type: "date", nullable: false), - ActivityDateTime = table.Column(type: "datetime(6)", nullable: false), - CreditOrDebit = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Amount = table.Column(type: "decimal(65,30)", nullable: false), - CostPrice = table.Column(type: "decimal(65,30)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_FloatActivity", x => x.EventId); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "Floats", - columns: table => new - { - FloatId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - ContractId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - ProductId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - CreatedDateTime = table.Column(type: "datetime(6)", nullable: false), - CreatedDate = table.Column(type: "date", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Floats", x => x.FloatId); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_FloatActivity_ActivityDate", - table: "FloatActivity", - column: "ActivityDate"); - - migrationBuilder.CreateIndex( - name: "IX_Floats_CreatedDate", - table: "Floats", - column: "CreatedDate"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "FloatActivity"); - - migrationBuilder.DropTable( - name: "Floats"); - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20240313172001_fixstatementheaderindex.Designer.cs b/TransactionProcessor.Database/Migrations/MySql/20240313172001_fixstatementheaderindex.Designer.cs deleted file mode 100644 index 7d232ffb..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20240313172001_fixstatementheaderindex.Designer.cs +++ /dev/null @@ -1,1061 +0,0 @@ -// - -#nullable disable - -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using TransactionProcessor.Database.Contexts; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - [DbContext(typeof(EstateManagementMySqlContext))] - [Migration("20240313172001_fixstatementheaderindex")] - partial class fixstatementheaderindex - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.7") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("EstateManagement.Database.Entities.Calendar", b => - { - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DayOfWeekNumber") - .HasColumnType("int"); - - b.Property("DayOfWeekShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameLong") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("WeekNumberString") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Year") - .HasColumnType("int"); - - b.Property("YearWeekNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Date"); - - b.ToTable("calendar"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Contract", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId", "OperatorId", "ContractId"); - - b.ToTable("contract"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProduct", b => - { - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("ContractProductReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DisplayText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductType") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.HasKey("ContractReportingId", "ProductId"); - - b.ToTable("contractproduct"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProductTransactionFee", b => - { - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("TransactionFeeReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(18,4)"); - - b.HasKey("ContractProductReportingId", "TransactionFeeId"); - - b.ToTable("contractproducttransactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Estate", b => - { - b.Property("EstateReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId"); - - b.HasIndex("EstateId") - .IsUnique(); - - b.ToTable("estate"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateOperator", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("EstateOperatorReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RequireCustomMerchantNumber") - .HasColumnType("tinyint(1)"); - - b.Property("RequireCustomTerminalNumber") - .HasColumnType("tinyint(1)"); - - b.HasKey("EstateReportingId", "OperatorId"); - - b.ToTable("estateoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateSecurityUser", b => - { - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("SecurityUserId", "EstateReportingId"); - - b.ToTable("estatesecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.File", b => - { - b.Property("FileReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDate") - .HasColumnType("date"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileReportingId"); - - b.HasIndex("FileId") - .IsUnique(); - - b.ToTable("file"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLog", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileImportLogReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDate") - .HasColumnType("date"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateReportingId", "FileImportLogReportingId"); - - b.HasIndex("EstateReportingId", "FileImportLogId") - .IsUnique(); - - b.ToTable("fileimportlog"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLogFile", b => - { - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileUploadedDate") - .HasColumnType("date"); - - b.Property("FileUploadedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OriginalFileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileImportLogReportingId", "FileReportingId"); - - b.ToTable("fileimportlogfile"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileLine", b => - { - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("LineNumber") - .HasColumnType("int"); - - b.Property("FileLineData") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("FileReportingId", "LineNumber") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("fileline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Float", b => - { - b.Property("FloatId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("CreatedDate") - .HasColumnType("date"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.HasKey("FloatId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("CreatedDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("Floats"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FloatActivity", b => - { - b.Property("EventId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CostPrice") - .HasColumnType("decimal(65,30)"); - - b.Property("CreditOrDebit") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloatId") - .HasColumnType("char(36)"); - - b.HasKey("EventId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("ActivityDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("FloatActivity"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Merchant", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("MerchantReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastSaleDate") - .HasColumnType("date"); - - b.Property("LastSaleDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastStatementGenerated") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.Property("SettlementSchedule") - .HasColumnType("int"); - - b.HasKey("EstateReportingId", "MerchantReportingId"); - - b.HasIndex("EstateReportingId", "MerchantId") - .IsUnique(); - - b.ToTable("merchant"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantAddress", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("AddressId") - .HasColumnType("char(36)"); - - b.Property("AddressLine1") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AddressLine2") - .HasColumnType("longtext"); - - b.Property("AddressLine3") - .HasColumnType("longtext"); - - b.Property("AddressLine4") - .HasColumnType("longtext"); - - b.Property("Country") - .HasColumnType("longtext"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("PostalCode") - .HasColumnType("longtext"); - - b.Property("Region") - .HasColumnType("longtext"); - - b.Property("Town") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "AddressId"); - - b.ToTable("merchantaddress"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContact", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContactId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "ContactId"); - - b.ToTable("merchantcontact"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContract", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.HasKey("MerchantReportingId", "ContractReportingId"); - - b.ToTable("MerchantContracts"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantDevice", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("DeviceId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "DeviceId"); - - b.ToTable("merchantdevice"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantOperator", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("MerchantNumber") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TerminalNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "OperatorId"); - - b.ToTable("merchantoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSecurityUser", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "SecurityUserId"); - - b.ToTable("merchantsecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSettlementFee", b => - { - b.Property("SettlementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeReportingId") - .HasColumnType("int"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("FeeCalculatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.HasKey("SettlementReportingId", "TransactionReportingId", "TransactionFeeReportingId"); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("merchantsettlementfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Reconciliation", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionCount") - .HasColumnType("int"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("reconciliation"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ResponseCodes", b => - { - b.Property("ResponseCode") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ResponseCode"); - - b.ToTable("responsecodes"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Settlement", b => - { - b.Property("SettlementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ProcessingStarted") - .HasColumnType("tinyint(1)"); - - b.Property("ProcessingStartedDateTIme") - .HasColumnType("datetime(6)"); - - b.Property("SettlementDate") - .HasColumnType("date"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("EstateReportingId", "SettlementId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("SettlementDate", "EstateReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("settlement"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementHeader", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("StatementCreatedDate") - .HasColumnType("date"); - - b.Property("StatementCreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementGeneratedDate") - .HasColumnType("date"); - - b.Property("StatementGeneratedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.HasKey("MerchantReportingId", "StatementId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("MerchantReportingId", "StatementGeneratedDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("statementheader"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementLine", b => - { - b.Property("StatementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ActivityType") - .HasColumnType("int"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDescription") - .HasColumnType("longtext"); - - b.Property("InAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("OutAmount") - .HasColumnType("decimal(65,30)"); - - b.HasKey("StatementReportingId", "TransactionReportingId", "ActivityDateTime", "ActivityType"); - - b.ToTable("statementline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Transaction", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("AuthorisationCode") - .HasColumnType("longtext"); - - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("EstateOperatorReportingId") - .HasColumnType("int"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .HasColumnType("longtext"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("transaction"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalRequestData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("longtext"); - - b.Property("CustomerAccountNumber") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalrequestdata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalResponseData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalresponsedata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Voucher", b => - { - b.Property("VoucherId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ExpiryDate") - .HasColumnType("date"); - - b.Property("ExpiryDateTime") - .HasColumnType("datetime(6)"); - - b.Property("GenerateDate") - .HasColumnType("date"); - - b.Property("GenerateDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsGenerated") - .HasColumnType("tinyint(1)"); - - b.Property("IsIssued") - .HasColumnType("tinyint(1)"); - - b.Property("IsRedeemed") - .HasColumnType("tinyint(1)"); - - b.Property("IssuedDate") - .HasColumnType("date"); - - b.Property("IssuedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RecipientEmail") - .HasColumnType("longtext"); - - b.Property("RecipientMobile") - .HasColumnType("longtext"); - - b.Property("RedeemedDate") - .HasColumnType("datetime(6)"); - - b.Property("RedeemedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.Property("VoucherCode") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("VoucherId"); - - b.HasIndex("TransactionReportingId"); - - b.HasIndex("VoucherCode"); - - b.ToTable("voucher"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.SettlementView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FeeDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable((string)null); - - b.ToView("uvwSettlements", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20240313172001_fixstatementheaderindex.cs b/TransactionProcessor.Database/Migrations/MySql/20240313172001_fixstatementheaderindex.cs deleted file mode 100644 index 9a5fe84a..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20240313172001_fixstatementheaderindex.cs +++ /dev/null @@ -1,37 +0,0 @@ -#nullable disable - -using Microsoft.EntityFrameworkCore.Migrations; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - /// - public partial class fixstatementheaderindex : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_statementheader_MerchantReportingId_StatementGeneratedDate", - table: "statementheader"); - - migrationBuilder.CreateIndex( - name: "IX_statementheader_MerchantReportingId_StatementGeneratedDate", - table: "statementheader", - columns: new[] { "MerchantReportingId", "StatementGeneratedDate" }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_statementheader_MerchantReportingId_StatementGeneratedDate", - table: "statementheader"); - - migrationBuilder.CreateIndex( - name: "IX_statementheader_MerchantReportingId_StatementGeneratedDate", - table: "statementheader", - columns: new[] { "MerchantReportingId", "StatementGeneratedDate" }, - unique: true); - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20240420163033_merchantupdates.Designer.cs b/TransactionProcessor.Database/Migrations/MySql/20240420163033_merchantupdates.Designer.cs deleted file mode 100644 index bdc07839..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20240420163033_merchantupdates.Designer.cs +++ /dev/null @@ -1,1095 +0,0 @@ -// - -#nullable disable - -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using TransactionProcessor.Database.Contexts; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - [DbContext(typeof(EstateManagementMySqlContext))] - [Migration("20240420163033_merchantupdates")] - partial class merchantupdates - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("EstateManagement.Database.Entities.Calendar", b => - { - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DayOfWeekNumber") - .HasColumnType("int"); - - b.Property("DayOfWeekShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameLong") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("WeekNumberString") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Year") - .HasColumnType("int"); - - b.Property("YearWeekNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Date"); - - b.ToTable("calendar"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Contract", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ContractReportingId")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId", "OperatorId", "ContractId"); - - b.ToTable("contract"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProduct", b => - { - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("ContractProductReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ContractProductReportingId")); - - b.Property("DisplayText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductType") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.HasKey("ContractReportingId", "ProductId"); - - b.ToTable("contractproduct"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProductTransactionFee", b => - { - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("TransactionFeeReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionFeeReportingId")); - - b.Property("Value") - .HasColumnType("decimal(18,4)"); - - b.HasKey("ContractProductReportingId", "TransactionFeeId"); - - b.ToTable("contractproducttransactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Estate", b => - { - b.Property("EstateReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("EstateReportingId")); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId"); - - b.HasIndex("EstateId") - .IsUnique(); - - b.ToTable("estate"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateOperator", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("EstateOperatorReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("EstateOperatorReportingId")); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RequireCustomMerchantNumber") - .HasColumnType("tinyint(1)"); - - b.Property("RequireCustomTerminalNumber") - .HasColumnType("tinyint(1)"); - - b.HasKey("EstateReportingId", "OperatorId"); - - b.ToTable("estateoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateSecurityUser", b => - { - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("SecurityUserId", "EstateReportingId"); - - b.ToTable("estatesecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.File", b => - { - b.Property("FileReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("FileReportingId")); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDate") - .HasColumnType("date"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileReportingId"); - - b.HasIndex("FileId") - .IsUnique(); - - b.ToTable("file"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLog", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileImportLogReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("FileImportLogReportingId")); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDate") - .HasColumnType("date"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateReportingId", "FileImportLogReportingId"); - - b.HasIndex("EstateReportingId", "FileImportLogId") - .IsUnique(); - - b.ToTable("fileimportlog"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLogFile", b => - { - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileUploadedDate") - .HasColumnType("date"); - - b.Property("FileUploadedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OriginalFileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileImportLogReportingId", "FileReportingId"); - - b.ToTable("fileimportlogfile"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileLine", b => - { - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("LineNumber") - .HasColumnType("int"); - - b.Property("FileLineData") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("FileReportingId", "LineNumber") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("fileline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Float", b => - { - b.Property("FloatId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("CreatedDate") - .HasColumnType("date"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.HasKey("FloatId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("CreatedDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("Floats"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FloatActivity", b => - { - b.Property("EventId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CostPrice") - .HasColumnType("decimal(65,30)"); - - b.Property("CreditOrDebit") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloatId") - .HasColumnType("char(36)"); - - b.HasKey("EventId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("ActivityDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("FloatActivity"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Merchant", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("MerchantReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("MerchantReportingId")); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastSaleDate") - .HasColumnType("date"); - - b.Property("LastSaleDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastStatementGenerated") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.Property("SettlementSchedule") - .HasColumnType("int"); - - b.HasKey("EstateReportingId", "MerchantReportingId"); - - b.HasIndex("EstateReportingId", "MerchantId") - .IsUnique(); - - b.ToTable("merchant"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantAddress", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("AddressId") - .HasColumnType("char(36)"); - - b.Property("AddressLine1") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AddressLine2") - .HasColumnType("longtext"); - - b.Property("AddressLine3") - .HasColumnType("longtext"); - - b.Property("AddressLine4") - .HasColumnType("longtext"); - - b.Property("Country") - .HasColumnType("longtext"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("PostalCode") - .HasColumnType("longtext"); - - b.Property("Region") - .HasColumnType("longtext"); - - b.Property("Town") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "AddressId"); - - b.ToTable("merchantaddress"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContact", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContactId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "ContactId"); - - b.ToTable("merchantcontact"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContract", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("tinyint(1)"); - - b.HasKey("MerchantReportingId", "ContractReportingId"); - - b.ToTable("MerchantContracts"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantDevice", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("DeviceId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "DeviceId"); - - b.ToTable("merchantdevice"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantOperator", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("IsDeleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantNumber") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TerminalNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "OperatorId"); - - b.ToTable("merchantoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSecurityUser", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "SecurityUserId"); - - b.ToTable("merchantsecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSettlementFee", b => - { - b.Property("SettlementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeReportingId") - .HasColumnType("int"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("FeeCalculatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.HasKey("SettlementReportingId", "TransactionReportingId", "TransactionFeeReportingId"); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("merchantsettlementfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Reconciliation", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionReportingId")); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionCount") - .HasColumnType("int"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("reconciliation"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ResponseCodes", b => - { - b.Property("ResponseCode") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ResponseCode")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ResponseCode"); - - b.ToTable("responsecodes"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Settlement", b => - { - b.Property("SettlementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("SettlementReportingId")); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ProcessingStarted") - .HasColumnType("tinyint(1)"); - - b.Property("ProcessingStartedDateTIme") - .HasColumnType("datetime(6)"); - - b.Property("SettlementDate") - .HasColumnType("date"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("EstateReportingId", "SettlementId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("SettlementDate", "EstateReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("settlement"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementHeader", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("StatementCreatedDate") - .HasColumnType("date"); - - b.Property("StatementCreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementGeneratedDate") - .HasColumnType("date"); - - b.Property("StatementGeneratedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("StatementReportingId")); - - b.HasKey("MerchantReportingId", "StatementId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("MerchantReportingId", "StatementGeneratedDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("statementheader"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementLine", b => - { - b.Property("StatementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ActivityType") - .HasColumnType("int"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDescription") - .HasColumnType("longtext"); - - b.Property("InAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("OutAmount") - .HasColumnType("decimal(65,30)"); - - b.HasKey("StatementReportingId", "TransactionReportingId", "ActivityDateTime", "ActivityType"); - - b.ToTable("statementline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Transaction", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionReportingId")); - - b.Property("AuthorisationCode") - .HasColumnType("longtext"); - - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("EstateOperatorReportingId") - .HasColumnType("int"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .HasColumnType("longtext"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("transaction"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalRequestData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("longtext"); - - b.Property("CustomerAccountNumber") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalrequestdata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalResponseData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalresponsedata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Voucher", b => - { - b.Property("VoucherId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ExpiryDate") - .HasColumnType("date"); - - b.Property("ExpiryDateTime") - .HasColumnType("datetime(6)"); - - b.Property("GenerateDate") - .HasColumnType("date"); - - b.Property("GenerateDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsGenerated") - .HasColumnType("tinyint(1)"); - - b.Property("IsIssued") - .HasColumnType("tinyint(1)"); - - b.Property("IsRedeemed") - .HasColumnType("tinyint(1)"); - - b.Property("IssuedDate") - .HasColumnType("date"); - - b.Property("IssuedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RecipientEmail") - .HasColumnType("longtext"); - - b.Property("RecipientMobile") - .HasColumnType("longtext"); - - b.Property("RedeemedDate") - .HasColumnType("datetime(6)"); - - b.Property("RedeemedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.Property("VoucherCode") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("VoucherId"); - - b.HasIndex("TransactionReportingId"); - - b.HasIndex("VoucherCode"); - - b.ToTable("voucher"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.SettlementView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FeeDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable((string)null); - - b.ToView("uvwSettlements", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20240420163033_merchantupdates.cs b/TransactionProcessor.Database/Migrations/MySql/20240420163033_merchantupdates.cs deleted file mode 100644 index eff72764..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20240420163033_merchantupdates.cs +++ /dev/null @@ -1,275 +0,0 @@ -#nullable disable - -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - /// - public partial class merchantupdates : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "TransactionReportingId", - table: "transaction", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "StatementReportingId", - table: "statementheader", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "SettlementReportingId", - table: "settlement", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "ResponseCode", - table: "responsecodes", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "TransactionReportingId", - table: "reconciliation", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AddColumn( - name: "IsDeleted", - table: "merchantoperator", - type: "tinyint(1)", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "IsDeleted", - table: "MerchantContracts", - type: "tinyint(1)", - nullable: false, - defaultValue: false); - - migrationBuilder.AlterColumn( - name: "MerchantReportingId", - table: "merchant", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "FileImportLogReportingId", - table: "fileimportlog", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "FileReportingId", - table: "file", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "EstateOperatorReportingId", - table: "estateoperator", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "EstateReportingId", - table: "estate", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "TransactionFeeReportingId", - table: "contractproducttransactionfee", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "ContractProductReportingId", - table: "contractproduct", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "ContractReportingId", - table: "contract", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "IsDeleted", - table: "merchantoperator"); - - migrationBuilder.DropColumn( - name: "IsDeleted", - table: "MerchantContracts"); - - migrationBuilder.AlterColumn( - name: "TransactionReportingId", - table: "transaction", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "StatementReportingId", - table: "statementheader", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "SettlementReportingId", - table: "settlement", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "ResponseCode", - table: "responsecodes", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "TransactionReportingId", - table: "reconciliation", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "MerchantReportingId", - table: "merchant", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "FileImportLogReportingId", - table: "fileimportlog", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "FileReportingId", - table: "file", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "EstateOperatorReportingId", - table: "estateoperator", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "EstateReportingId", - table: "estate", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "TransactionFeeReportingId", - table: "contractproducttransactionfee", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "ContractProductReportingId", - table: "contractproduct", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AlterColumn( - name: "ContractReportingId", - table: "contract", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20240425094256_record_operatators_at_readmodel.Designer.cs b/TransactionProcessor.Database/Migrations/MySql/20240425094256_record_operatators_at_readmodel.Designer.cs deleted file mode 100644 index 0c591c6f..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20240425094256_record_operatators_at_readmodel.Designer.cs +++ /dev/null @@ -1,1112 +0,0 @@ -// - -#nullable disable - -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using TransactionProcessor.Database.Contexts; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - [DbContext(typeof(EstateManagementMySqlContext))] - [Migration("20240425094256_record_operatators_at_readmodel")] - partial class record_operatators_at_readmodel - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("EstateManagement.Database.Entities.Calendar", b => - { - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DayOfWeekNumber") - .HasColumnType("int"); - - b.Property("DayOfWeekShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameLong") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("WeekNumberString") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Year") - .HasColumnType("int"); - - b.Property("YearWeekNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Date"); - - b.ToTable("calendar"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Contract", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ContractReportingId")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId", "OperatorId", "ContractId"); - - b.ToTable("contract"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProduct", b => - { - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("ContractProductReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ContractProductReportingId")); - - b.Property("DisplayText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductType") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.HasKey("ContractReportingId", "ProductId"); - - b.ToTable("contractproduct"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProductTransactionFee", b => - { - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("TransactionFeeReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionFeeReportingId")); - - b.Property("Value") - .HasColumnType("decimal(18,4)"); - - b.HasKey("ContractProductReportingId", "TransactionFeeId"); - - b.ToTable("contractproducttransactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Estate", b => - { - b.Property("EstateReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("EstateReportingId")); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId"); - - b.HasIndex("EstateId") - .IsUnique(); - - b.ToTable("estate"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateOperator", b => - { - b.Property("OperatorReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("OperatorReportingId")); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.HasKey("OperatorReportingId"); - - b.ToTable("estateoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateSecurityUser", b => - { - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("SecurityUserId", "EstateReportingId"); - - b.ToTable("estatesecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.File", b => - { - b.Property("FileReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("FileReportingId")); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDate") - .HasColumnType("date"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileReportingId"); - - b.HasIndex("FileId") - .IsUnique(); - - b.ToTable("file"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLog", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileImportLogReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("FileImportLogReportingId")); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDate") - .HasColumnType("date"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateReportingId", "FileImportLogReportingId"); - - b.HasIndex("EstateReportingId", "FileImportLogId") - .IsUnique(); - - b.ToTable("fileimportlog"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLogFile", b => - { - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileUploadedDate") - .HasColumnType("date"); - - b.Property("FileUploadedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OriginalFileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileImportLogReportingId", "FileReportingId"); - - b.ToTable("fileimportlogfile"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileLine", b => - { - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("LineNumber") - .HasColumnType("int"); - - b.Property("FileLineData") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("FileReportingId", "LineNumber") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("fileline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Float", b => - { - b.Property("FloatId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("CreatedDate") - .HasColumnType("date"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.HasKey("FloatId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("CreatedDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("Floats"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FloatActivity", b => - { - b.Property("EventId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CostPrice") - .HasColumnType("decimal(65,30)"); - - b.Property("CreditOrDebit") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloatId") - .HasColumnType("char(36)"); - - b.HasKey("EventId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("ActivityDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("FloatActivity"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Merchant", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("MerchantReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("MerchantReportingId")); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastSaleDate") - .HasColumnType("date"); - - b.Property("LastSaleDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastStatementGenerated") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.Property("SettlementSchedule") - .HasColumnType("int"); - - b.HasKey("EstateReportingId", "MerchantReportingId"); - - b.HasIndex("EstateReportingId", "MerchantId") - .IsUnique(); - - b.ToTable("merchant"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantAddress", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("AddressId") - .HasColumnType("char(36)"); - - b.Property("AddressLine1") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AddressLine2") - .HasColumnType("longtext"); - - b.Property("AddressLine3") - .HasColumnType("longtext"); - - b.Property("AddressLine4") - .HasColumnType("longtext"); - - b.Property("Country") - .HasColumnType("longtext"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("PostalCode") - .HasColumnType("longtext"); - - b.Property("Region") - .HasColumnType("longtext"); - - b.Property("Town") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "AddressId"); - - b.ToTable("merchantaddress"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContact", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContactId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "ContactId"); - - b.ToTable("merchantcontact"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContract", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("tinyint(1)"); - - b.HasKey("MerchantReportingId", "ContractReportingId"); - - b.ToTable("MerchantContracts"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantDevice", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("DeviceId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "DeviceId"); - - b.ToTable("merchantdevice"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantOperator", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("IsDeleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantNumber") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TerminalNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "OperatorId"); - - b.ToTable("merchantoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSecurityUser", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "SecurityUserId"); - - b.ToTable("merchantsecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSettlementFee", b => - { - b.Property("SettlementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeReportingId") - .HasColumnType("int"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("FeeCalculatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.HasKey("SettlementReportingId", "TransactionReportingId", "TransactionFeeReportingId"); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("merchantsettlementfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Operator", b => - { - b.Property("OperatorId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OperatorReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("OperatorReportingId")); - - b.Property("RequireCustomMerchantNumber") - .HasColumnType("tinyint(1)"); - - b.Property("RequireCustomTerminalNumber") - .HasColumnType("tinyint(1)"); - - b.HasKey("OperatorId"); - - b.ToTable("operator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Reconciliation", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionReportingId")); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionCount") - .HasColumnType("int"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("reconciliation"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ResponseCodes", b => - { - b.Property("ResponseCode") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ResponseCode")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ResponseCode"); - - b.ToTable("responsecodes"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Settlement", b => - { - b.Property("SettlementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("SettlementReportingId")); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ProcessingStarted") - .HasColumnType("tinyint(1)"); - - b.Property("ProcessingStartedDateTIme") - .HasColumnType("datetime(6)"); - - b.Property("SettlementDate") - .HasColumnType("date"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("EstateReportingId", "SettlementId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("SettlementDate", "EstateReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("settlement"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementHeader", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("StatementCreatedDate") - .HasColumnType("date"); - - b.Property("StatementCreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementGeneratedDate") - .HasColumnType("date"); - - b.Property("StatementGeneratedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("StatementReportingId")); - - b.HasKey("MerchantReportingId", "StatementId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("MerchantReportingId", "StatementGeneratedDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("statementheader"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementLine", b => - { - b.Property("StatementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ActivityType") - .HasColumnType("int"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDescription") - .HasColumnType("longtext"); - - b.Property("InAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("OutAmount") - .HasColumnType("decimal(65,30)"); - - b.HasKey("StatementReportingId", "TransactionReportingId", "ActivityDateTime", "ActivityType"); - - b.ToTable("statementline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Transaction", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionReportingId")); - - b.Property("AuthorisationCode") - .HasColumnType("longtext"); - - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("EstateOperatorReportingId") - .HasColumnType("int"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .HasColumnType("longtext"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("transaction"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalRequestData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("longtext"); - - b.Property("CustomerAccountNumber") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalrequestdata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalResponseData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalresponsedata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Voucher", b => - { - b.Property("VoucherId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ExpiryDate") - .HasColumnType("date"); - - b.Property("ExpiryDateTime") - .HasColumnType("datetime(6)"); - - b.Property("GenerateDate") - .HasColumnType("date"); - - b.Property("GenerateDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsGenerated") - .HasColumnType("tinyint(1)"); - - b.Property("IsIssued") - .HasColumnType("tinyint(1)"); - - b.Property("IsRedeemed") - .HasColumnType("tinyint(1)"); - - b.Property("IssuedDate") - .HasColumnType("date"); - - b.Property("IssuedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RecipientEmail") - .HasColumnType("longtext"); - - b.Property("RecipientMobile") - .HasColumnType("longtext"); - - b.Property("RedeemedDate") - .HasColumnType("datetime(6)"); - - b.Property("RedeemedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.Property("VoucherCode") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("VoucherId"); - - b.HasIndex("TransactionReportingId"); - - b.HasIndex("VoucherCode"); - - b.ToTable("voucher"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.SettlementView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FeeDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable((string)null); - - b.ToView("uvwSettlements", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20240425094256_record_operatators_at_readmodel.cs b/TransactionProcessor.Database/Migrations/MySql/20240425094256_record_operatators_at_readmodel.cs deleted file mode 100644 index 627a0f3d..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20240425094256_record_operatators_at_readmodel.cs +++ /dev/null @@ -1,114 +0,0 @@ -#nullable disable - -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - /// - public partial class record_operatators_at_readmodel : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropPrimaryKey( - name: "PK_estateoperator", - table: "estateoperator"); - - migrationBuilder.DropColumn( - name: "OperatorId", - table: "estateoperator"); - - migrationBuilder.DropColumn( - name: "Name", - table: "estateoperator"); - - migrationBuilder.DropColumn( - name: "RequireCustomMerchantNumber", - table: "estateoperator"); - - migrationBuilder.DropColumn( - name: "RequireCustomTerminalNumber", - table: "estateoperator"); - - migrationBuilder.RenameColumn( - name: "EstateOperatorReportingId", - table: "estateoperator", - newName: "OperatorReportingId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_estateoperator", - table: "estateoperator", - column: "OperatorReportingId"); - - migrationBuilder.CreateTable( - name: "operator", - columns: table => new - { - OperatorId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - OperatorReportingId = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - EstateReportingId = table.Column(type: "int", nullable: false), - Name = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - RequireCustomMerchantNumber = table.Column(type: "tinyint(1)", nullable: false), - RequireCustomTerminalNumber = table.Column(type: "tinyint(1)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_operator", x => x.OperatorId); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "operator"); - - migrationBuilder.DropPrimaryKey( - name: "PK_estateoperator", - table: "estateoperator"); - - migrationBuilder.RenameColumn( - name: "OperatorReportingId", - table: "estateoperator", - newName: "EstateOperatorReportingId"); - - migrationBuilder.AddColumn( - name: "OperatorId", - table: "estateoperator", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "Name", - table: "estateoperator", - type: "longtext", - nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "RequireCustomMerchantNumber", - table: "estateoperator", - type: "tinyint(1)", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "RequireCustomTerminalNumber", - table: "estateoperator", - type: "tinyint(1)", - nullable: false, - defaultValue: false); - - migrationBuilder.AddPrimaryKey( - name: "PK_estateoperator", - table: "estateoperator", - columns: new[] { "EstateReportingId", "OperatorId" }); - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20240425132550_record_operatators_at_readmodel_1.Designer.cs b/TransactionProcessor.Database/Migrations/MySql/20240425132550_record_operatators_at_readmodel_1.Designer.cs deleted file mode 100644 index 4fef017c..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20240425132550_record_operatators_at_readmodel_1.Designer.cs +++ /dev/null @@ -1,1114 +0,0 @@ -// - -#nullable disable - -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using TransactionProcessor.Database.Contexts; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - [DbContext(typeof(EstateManagementMySqlContext))] - [Migration("20240425132550_record_operatators_at_readmodel_1")] - partial class record_operatators_at_readmodel_1 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("EstateManagement.Database.Entities.Calendar", b => - { - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DayOfWeekNumber") - .HasColumnType("int"); - - b.Property("DayOfWeekShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameLong") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("WeekNumberString") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Year") - .HasColumnType("int"); - - b.Property("YearWeekNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Date"); - - b.ToTable("calendar"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Contract", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ContractReportingId")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId", "OperatorId", "ContractId"); - - b.ToTable("contract"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProduct", b => - { - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("ContractProductReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ContractProductReportingId")); - - b.Property("DisplayText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductType") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.HasKey("ContractReportingId", "ProductId"); - - b.ToTable("contractproduct"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProductTransactionFee", b => - { - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("TransactionFeeReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionFeeReportingId")); - - b.Property("Value") - .HasColumnType("decimal(18,4)"); - - b.HasKey("ContractProductReportingId", "TransactionFeeId"); - - b.ToTable("contractproducttransactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Estate", b => - { - b.Property("EstateReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("EstateReportingId")); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId"); - - b.HasIndex("EstateId") - .IsUnique(); - - b.ToTable("estate"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateOperator", b => - { - b.Property("OperatorReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("OperatorReportingId")); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.HasKey("OperatorReportingId"); - - b.ToTable("estateoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateSecurityUser", b => - { - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("SecurityUserId", "EstateReportingId"); - - b.ToTable("estatesecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.File", b => - { - b.Property("FileReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("FileReportingId")); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDate") - .HasColumnType("date"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileReportingId"); - - b.HasIndex("FileId") - .IsUnique(); - - b.ToTable("file"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLog", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileImportLogReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("FileImportLogReportingId")); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDate") - .HasColumnType("date"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateReportingId", "FileImportLogReportingId"); - - b.HasIndex("EstateReportingId", "FileImportLogId") - .IsUnique(); - - b.ToTable("fileimportlog"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLogFile", b => - { - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileUploadedDate") - .HasColumnType("date"); - - b.Property("FileUploadedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OriginalFileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileImportLogReportingId", "FileReportingId"); - - b.ToTable("fileimportlogfile"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileLine", b => - { - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("LineNumber") - .HasColumnType("int"); - - b.Property("FileLineData") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("FileReportingId", "LineNumber") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("fileline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Float", b => - { - b.Property("FloatId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("CreatedDate") - .HasColumnType("date"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.HasKey("FloatId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("CreatedDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("Floats"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FloatActivity", b => - { - b.Property("EventId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CostPrice") - .HasColumnType("decimal(65,30)"); - - b.Property("CreditOrDebit") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloatId") - .HasColumnType("char(36)"); - - b.HasKey("EventId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("ActivityDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("FloatActivity"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Merchant", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("MerchantReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("MerchantReportingId")); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastSaleDate") - .HasColumnType("date"); - - b.Property("LastSaleDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastStatementGenerated") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.Property("SettlementSchedule") - .HasColumnType("int"); - - b.HasKey("EstateReportingId", "MerchantReportingId"); - - b.HasIndex("EstateReportingId", "MerchantId") - .IsUnique(); - - b.ToTable("merchant"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantAddress", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("AddressId") - .HasColumnType("char(36)"); - - b.Property("AddressLine1") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AddressLine2") - .HasColumnType("longtext"); - - b.Property("AddressLine3") - .HasColumnType("longtext"); - - b.Property("AddressLine4") - .HasColumnType("longtext"); - - b.Property("Country") - .HasColumnType("longtext"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("PostalCode") - .HasColumnType("longtext"); - - b.Property("Region") - .HasColumnType("longtext"); - - b.Property("Town") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "AddressId"); - - b.ToTable("merchantaddress"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContact", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContactId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "ContactId"); - - b.ToTable("merchantcontact"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContract", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("tinyint(1)"); - - b.HasKey("MerchantReportingId", "ContractReportingId"); - - b.ToTable("MerchantContracts"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantDevice", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("DeviceId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "DeviceId"); - - b.ToTable("merchantdevice"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantOperator", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("IsDeleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantNumber") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TerminalNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "OperatorId"); - - b.ToTable("merchantoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSecurityUser", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "SecurityUserId"); - - b.ToTable("merchantsecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSettlementFee", b => - { - b.Property("SettlementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeReportingId") - .HasColumnType("int"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("FeeCalculatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.HasKey("SettlementReportingId", "TransactionReportingId", "TransactionFeeReportingId"); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("merchantsettlementfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Operator", b => - { - b.Property("OperatorReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("OperatorReportingId")); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("RequireCustomMerchantNumber") - .HasColumnType("tinyint(1)"); - - b.Property("RequireCustomTerminalNumber") - .HasColumnType("tinyint(1)"); - - b.HasKey("OperatorReportingId"); - - b.HasIndex("OperatorId") - .IsUnique(); - - b.ToTable("operator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Reconciliation", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionReportingId")); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionCount") - .HasColumnType("int"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("reconciliation"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ResponseCodes", b => - { - b.Property("ResponseCode") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ResponseCode")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ResponseCode"); - - b.ToTable("responsecodes"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Settlement", b => - { - b.Property("SettlementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("SettlementReportingId")); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ProcessingStarted") - .HasColumnType("tinyint(1)"); - - b.Property("ProcessingStartedDateTIme") - .HasColumnType("datetime(6)"); - - b.Property("SettlementDate") - .HasColumnType("date"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("EstateReportingId", "SettlementId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("SettlementDate", "EstateReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("settlement"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementHeader", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("StatementCreatedDate") - .HasColumnType("date"); - - b.Property("StatementCreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementGeneratedDate") - .HasColumnType("date"); - - b.Property("StatementGeneratedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("StatementReportingId")); - - b.HasKey("MerchantReportingId", "StatementId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("MerchantReportingId", "StatementGeneratedDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("statementheader"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementLine", b => - { - b.Property("StatementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ActivityType") - .HasColumnType("int"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDescription") - .HasColumnType("longtext"); - - b.Property("InAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("OutAmount") - .HasColumnType("decimal(65,30)"); - - b.HasKey("StatementReportingId", "TransactionReportingId", "ActivityDateTime", "ActivityType"); - - b.ToTable("statementline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Transaction", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionReportingId")); - - b.Property("AuthorisationCode") - .HasColumnType("longtext"); - - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("EstateOperatorReportingId") - .HasColumnType("int"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .HasColumnType("longtext"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("transaction"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalRequestData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("longtext"); - - b.Property("CustomerAccountNumber") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalrequestdata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalResponseData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalresponsedata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Voucher", b => - { - b.Property("VoucherId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ExpiryDate") - .HasColumnType("date"); - - b.Property("ExpiryDateTime") - .HasColumnType("datetime(6)"); - - b.Property("GenerateDate") - .HasColumnType("date"); - - b.Property("GenerateDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsGenerated") - .HasColumnType("tinyint(1)"); - - b.Property("IsIssued") - .HasColumnType("tinyint(1)"); - - b.Property("IsRedeemed") - .HasColumnType("tinyint(1)"); - - b.Property("IssuedDate") - .HasColumnType("date"); - - b.Property("IssuedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RecipientEmail") - .HasColumnType("longtext"); - - b.Property("RecipientMobile") - .HasColumnType("longtext"); - - b.Property("RedeemedDate") - .HasColumnType("datetime(6)"); - - b.Property("RedeemedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.Property("VoucherCode") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("VoucherId"); - - b.HasIndex("TransactionReportingId"); - - b.HasIndex("VoucherCode"); - - b.ToTable("voucher"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.SettlementView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FeeDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable((string)null); - - b.ToView("uvwSettlements", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20240425132550_record_operatators_at_readmodel_1.cs b/TransactionProcessor.Database/Migrations/MySql/20240425132550_record_operatators_at_readmodel_1.cs deleted file mode 100644 index a84113a0..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20240425132550_record_operatators_at_readmodel_1.cs +++ /dev/null @@ -1,46 +0,0 @@ -#nullable disable - -using Microsoft.EntityFrameworkCore.Migrations; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - /// - public partial class record_operatators_at_readmodel_1 : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropPrimaryKey( - name: "PK_operator", - table: "operator"); - - migrationBuilder.AddPrimaryKey( - name: "PK_operator", - table: "operator", - column: "OperatorReportingId"); - - migrationBuilder.CreateIndex( - name: "IX_operator_OperatorId", - table: "operator", - column: "OperatorId", - unique: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropPrimaryKey( - name: "PK_operator", - table: "operator"); - - migrationBuilder.DropIndex( - name: "IX_operator_OperatorId", - table: "operator"); - - migrationBuilder.AddPrimaryKey( - name: "PK_operator", - table: "operator", - column: "OperatorId"); - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20240425164125_record_operatators_at_readmodel_2.Designer.cs b/TransactionProcessor.Database/Migrations/MySql/20240425164125_record_operatators_at_readmodel_2.Designer.cs deleted file mode 100644 index 6cae8421..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20240425164125_record_operatators_at_readmodel_2.Designer.cs +++ /dev/null @@ -1,1111 +0,0 @@ -// - -#nullable disable - -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using TransactionProcessor.Database.Contexts; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - [DbContext(typeof(EstateManagementMySqlContext))] - [Migration("20240425164125_record_operatators_at_readmodel_2")] - partial class record_operatators_at_readmodel_2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("EstateManagement.Database.Entities.Calendar", b => - { - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DayOfWeekNumber") - .HasColumnType("int"); - - b.Property("DayOfWeekShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameLong") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("WeekNumberString") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Year") - .HasColumnType("int"); - - b.Property("YearWeekNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Date"); - - b.ToTable("calendar"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Contract", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ContractReportingId")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId", "OperatorId", "ContractId"); - - b.ToTable("contract"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProduct", b => - { - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("ContractProductReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ContractProductReportingId")); - - b.Property("DisplayText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductType") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.HasKey("ContractReportingId", "ProductId"); - - b.ToTable("contractproduct"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProductTransactionFee", b => - { - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("TransactionFeeReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionFeeReportingId")); - - b.Property("Value") - .HasColumnType("decimal(18,4)"); - - b.HasKey("ContractProductReportingId", "TransactionFeeId"); - - b.ToTable("contractproducttransactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Estate", b => - { - b.Property("EstateReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("EstateReportingId")); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId"); - - b.HasIndex("EstateId") - .IsUnique(); - - b.ToTable("estate"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateOperator", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorReportingId") - .HasColumnType("int"); - - b.HasKey("EstateReportingId", "OperatorReportingId"); - - b.ToTable("estateoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateSecurityUser", b => - { - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("SecurityUserId", "EstateReportingId"); - - b.ToTable("estatesecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.File", b => - { - b.Property("FileReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("FileReportingId")); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDate") - .HasColumnType("date"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileReportingId"); - - b.HasIndex("FileId") - .IsUnique(); - - b.ToTable("file"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLog", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileImportLogReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("FileImportLogReportingId")); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDate") - .HasColumnType("date"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateReportingId", "FileImportLogReportingId"); - - b.HasIndex("EstateReportingId", "FileImportLogId") - .IsUnique(); - - b.ToTable("fileimportlog"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLogFile", b => - { - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileUploadedDate") - .HasColumnType("date"); - - b.Property("FileUploadedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OriginalFileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileImportLogReportingId", "FileReportingId"); - - b.ToTable("fileimportlogfile"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileLine", b => - { - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("LineNumber") - .HasColumnType("int"); - - b.Property("FileLineData") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("FileReportingId", "LineNumber") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("fileline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Float", b => - { - b.Property("FloatId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("CreatedDate") - .HasColumnType("date"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.HasKey("FloatId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("CreatedDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("Floats"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FloatActivity", b => - { - b.Property("EventId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CostPrice") - .HasColumnType("decimal(65,30)"); - - b.Property("CreditOrDebit") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloatId") - .HasColumnType("char(36)"); - - b.HasKey("EventId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("ActivityDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("FloatActivity"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Merchant", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("MerchantReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("MerchantReportingId")); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastSaleDate") - .HasColumnType("date"); - - b.Property("LastSaleDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastStatementGenerated") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.Property("SettlementSchedule") - .HasColumnType("int"); - - b.HasKey("EstateReportingId", "MerchantReportingId"); - - b.HasIndex("EstateReportingId", "MerchantId") - .IsUnique(); - - b.ToTable("merchant"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantAddress", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("AddressId") - .HasColumnType("char(36)"); - - b.Property("AddressLine1") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AddressLine2") - .HasColumnType("longtext"); - - b.Property("AddressLine3") - .HasColumnType("longtext"); - - b.Property("AddressLine4") - .HasColumnType("longtext"); - - b.Property("Country") - .HasColumnType("longtext"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("PostalCode") - .HasColumnType("longtext"); - - b.Property("Region") - .HasColumnType("longtext"); - - b.Property("Town") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "AddressId"); - - b.ToTable("merchantaddress"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContact", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContactId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "ContactId"); - - b.ToTable("merchantcontact"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContract", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("tinyint(1)"); - - b.HasKey("MerchantReportingId", "ContractReportingId"); - - b.ToTable("MerchantContracts"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantDevice", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("DeviceId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "DeviceId"); - - b.ToTable("merchantdevice"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantOperator", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("IsDeleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantNumber") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TerminalNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "OperatorId"); - - b.ToTable("merchantoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSecurityUser", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "SecurityUserId"); - - b.ToTable("merchantsecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSettlementFee", b => - { - b.Property("SettlementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeReportingId") - .HasColumnType("int"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("FeeCalculatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.HasKey("SettlementReportingId", "TransactionReportingId", "TransactionFeeReportingId"); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("merchantsettlementfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Operator", b => - { - b.Property("OperatorReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("OperatorReportingId")); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("RequireCustomMerchantNumber") - .HasColumnType("tinyint(1)"); - - b.Property("RequireCustomTerminalNumber") - .HasColumnType("tinyint(1)"); - - b.HasKey("OperatorReportingId"); - - b.HasIndex("OperatorId") - .IsUnique(); - - b.ToTable("operator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Reconciliation", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionReportingId")); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionCount") - .HasColumnType("int"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("reconciliation"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ResponseCodes", b => - { - b.Property("ResponseCode") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ResponseCode")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ResponseCode"); - - b.ToTable("responsecodes"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Settlement", b => - { - b.Property("SettlementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("SettlementReportingId")); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ProcessingStarted") - .HasColumnType("tinyint(1)"); - - b.Property("ProcessingStartedDateTIme") - .HasColumnType("datetime(6)"); - - b.Property("SettlementDate") - .HasColumnType("date"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("EstateReportingId", "SettlementId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("SettlementDate", "EstateReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("settlement"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementHeader", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("StatementCreatedDate") - .HasColumnType("date"); - - b.Property("StatementCreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementGeneratedDate") - .HasColumnType("date"); - - b.Property("StatementGeneratedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("StatementReportingId")); - - b.HasKey("MerchantReportingId", "StatementId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("MerchantReportingId", "StatementGeneratedDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("statementheader"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementLine", b => - { - b.Property("StatementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ActivityType") - .HasColumnType("int"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDescription") - .HasColumnType("longtext"); - - b.Property("InAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("OutAmount") - .HasColumnType("decimal(65,30)"); - - b.HasKey("StatementReportingId", "TransactionReportingId", "ActivityDateTime", "ActivityType"); - - b.ToTable("statementline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Transaction", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionReportingId")); - - b.Property("AuthorisationCode") - .HasColumnType("longtext"); - - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("EstateOperatorReportingId") - .HasColumnType("int"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .HasColumnType("longtext"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("transaction"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalRequestData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("longtext"); - - b.Property("CustomerAccountNumber") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalrequestdata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalResponseData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalresponsedata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Voucher", b => - { - b.Property("VoucherId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ExpiryDate") - .HasColumnType("date"); - - b.Property("ExpiryDateTime") - .HasColumnType("datetime(6)"); - - b.Property("GenerateDate") - .HasColumnType("date"); - - b.Property("GenerateDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsGenerated") - .HasColumnType("tinyint(1)"); - - b.Property("IsIssued") - .HasColumnType("tinyint(1)"); - - b.Property("IsRedeemed") - .HasColumnType("tinyint(1)"); - - b.Property("IssuedDate") - .HasColumnType("date"); - - b.Property("IssuedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("RecipientEmail") - .HasColumnType("longtext"); - - b.Property("RecipientMobile") - .HasColumnType("longtext"); - - b.Property("RedeemedDate") - .HasColumnType("datetime(6)"); - - b.Property("RedeemedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.Property("VoucherCode") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("VoucherId"); - - b.HasIndex("TransactionReportingId"); - - b.HasIndex("VoucherCode"); - - b.ToTable("voucher"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.SettlementView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FeeDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable((string)null); - - b.ToView("uvwSettlements", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20240425164125_record_operatators_at_readmodel_2.cs b/TransactionProcessor.Database/Migrations/MySql/20240425164125_record_operatators_at_readmodel_2.cs deleted file mode 100644 index a10b252e..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20240425164125_record_operatators_at_readmodel_2.cs +++ /dev/null @@ -1,55 +0,0 @@ -#nullable disable - -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - /// - public partial class record_operatators_at_readmodel_2 : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropPrimaryKey( - name: "PK_estateoperator", - table: "estateoperator"); - - migrationBuilder.AlterColumn( - name: "OperatorReportingId", - table: "estateoperator", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AddPrimaryKey( - name: "PK_estateoperator", - table: "estateoperator", - columns: new[] { "EstateReportingId", "OperatorReportingId" }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropPrimaryKey( - name: "PK_estateoperator", - table: "estateoperator"); - - migrationBuilder.AlterColumn( - name: "OperatorReportingId", - table: "estateoperator", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AddPrimaryKey( - name: "PK_estateoperator", - table: "estateoperator", - column: "OperatorReportingId"); - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20240501155336_make_voucher_operatoridentifier_nullable.Designer.cs b/TransactionProcessor.Database/Migrations/MySql/20240501155336_make_voucher_operatoridentifier_nullable.Designer.cs deleted file mode 100644 index 320cd60c..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20240501155336_make_voucher_operatoridentifier_nullable.Designer.cs +++ /dev/null @@ -1,1110 +0,0 @@ -// - -#nullable disable - -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using TransactionProcessor.Database.Contexts; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - [DbContext(typeof(EstateManagementMySqlContext))] - [Migration("20240501155336_make_voucher_operatoridentifier_nullable")] - partial class make_voucher_operatoridentifier_nullable - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("EstateManagement.Database.Entities.Calendar", b => - { - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DayOfWeekNumber") - .HasColumnType("int"); - - b.Property("DayOfWeekShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameLong") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("WeekNumberString") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Year") - .HasColumnType("int"); - - b.Property("YearWeekNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Date"); - - b.ToTable("calendar"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Contract", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ContractReportingId")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId", "OperatorId", "ContractId"); - - b.ToTable("contract"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProduct", b => - { - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.Property("ContractProductReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ContractProductReportingId")); - - b.Property("DisplayText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductType") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.HasKey("ContractReportingId", "ProductId"); - - b.ToTable("contractproduct"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProductTransactionFee", b => - { - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("TransactionFeeReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionFeeReportingId")); - - b.Property("Value") - .HasColumnType("decimal(18,4)"); - - b.HasKey("ContractProductReportingId", "TransactionFeeId"); - - b.ToTable("contractproducttransactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Estate", b => - { - b.Property("EstateReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("EstateReportingId")); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId"); - - b.HasIndex("EstateId") - .IsUnique(); - - b.ToTable("estate"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateOperator", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("OperatorReportingId") - .HasColumnType("int"); - - b.HasKey("EstateReportingId", "OperatorReportingId"); - - b.ToTable("estateoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateSecurityUser", b => - { - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("SecurityUserId", "EstateReportingId"); - - b.ToTable("estatesecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.File", b => - { - b.Property("FileReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("FileReportingId")); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDate") - .HasColumnType("date"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileReportingId"); - - b.HasIndex("FileId") - .IsUnique(); - - b.ToTable("file"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLog", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("FileImportLogReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("FileImportLogReportingId")); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDate") - .HasColumnType("date"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateReportingId", "FileImportLogReportingId"); - - b.HasIndex("EstateReportingId", "FileImportLogId") - .IsUnique(); - - b.ToTable("fileimportlog"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLogFile", b => - { - b.Property("FileImportLogReportingId") - .HasColumnType("int"); - - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileUploadedDate") - .HasColumnType("date"); - - b.Property("FileUploadedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OriginalFileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileImportLogReportingId", "FileReportingId"); - - b.ToTable("fileimportlogfile"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileLine", b => - { - b.Property("FileReportingId") - .HasColumnType("int"); - - b.Property("LineNumber") - .HasColumnType("int"); - - b.Property("FileLineData") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("FileReportingId", "LineNumber") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("fileline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Float", b => - { - b.Property("FloatId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("CreatedDate") - .HasColumnType("date"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.HasKey("FloatId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("CreatedDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("Floats"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FloatActivity", b => - { - b.Property("EventId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CostPrice") - .HasColumnType("decimal(65,30)"); - - b.Property("CreditOrDebit") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloatId") - .HasColumnType("char(36)"); - - b.HasKey("EventId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("ActivityDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("FloatActivity"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Merchant", b => - { - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("MerchantReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("MerchantReportingId")); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastSaleDate") - .HasColumnType("date"); - - b.Property("LastSaleDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastStatementGenerated") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.Property("SettlementSchedule") - .HasColumnType("int"); - - b.HasKey("EstateReportingId", "MerchantReportingId"); - - b.HasIndex("EstateReportingId", "MerchantId") - .IsUnique(); - - b.ToTable("merchant"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantAddress", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("AddressId") - .HasColumnType("char(36)"); - - b.Property("AddressLine1") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AddressLine2") - .HasColumnType("longtext"); - - b.Property("AddressLine3") - .HasColumnType("longtext"); - - b.Property("AddressLine4") - .HasColumnType("longtext"); - - b.Property("Country") - .HasColumnType("longtext"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("PostalCode") - .HasColumnType("longtext"); - - b.Property("Region") - .HasColumnType("longtext"); - - b.Property("Town") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "AddressId"); - - b.ToTable("merchantaddress"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContact", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContactId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "ContactId"); - - b.ToTable("merchantcontact"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContract", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("tinyint(1)"); - - b.HasKey("MerchantReportingId", "ContractReportingId"); - - b.ToTable("MerchantContracts"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantDevice", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("DeviceId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "DeviceId"); - - b.ToTable("merchantdevice"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantOperator", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("IsDeleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantNumber") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TerminalNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "OperatorId"); - - b.ToTable("merchantoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSecurityUser", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantReportingId", "SecurityUserId"); - - b.ToTable("merchantsecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSettlementFee", b => - { - b.Property("SettlementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("TransactionFeeReportingId") - .HasColumnType("int"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("FeeCalculatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.HasKey("SettlementReportingId", "TransactionReportingId", "TransactionFeeReportingId"); - - b.HasIndex("TransactionReportingId"); - - b.ToTable("merchantsettlementfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Operator", b => - { - b.Property("OperatorReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("OperatorReportingId")); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("RequireCustomMerchantNumber") - .HasColumnType("tinyint(1)"); - - b.Property("RequireCustomTerminalNumber") - .HasColumnType("tinyint(1)"); - - b.HasKey("OperatorReportingId"); - - b.HasIndex("OperatorId") - .IsUnique(); - - b.ToTable("operator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Reconciliation", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionReportingId")); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionCount") - .HasColumnType("int"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("reconciliation"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ResponseCodes", b => - { - b.Property("ResponseCode") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ResponseCode")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ResponseCode"); - - b.ToTable("responsecodes"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Settlement", b => - { - b.Property("SettlementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("SettlementReportingId")); - - b.Property("EstateReportingId") - .HasColumnType("int"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ProcessingStarted") - .HasColumnType("tinyint(1)"); - - b.Property("ProcessingStartedDateTIme") - .HasColumnType("datetime(6)"); - - b.Property("SettlementDate") - .HasColumnType("date"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("EstateReportingId", "SettlementId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("SettlementDate", "EstateReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("settlement"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementHeader", b => - { - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("StatementCreatedDate") - .HasColumnType("date"); - - b.Property("StatementCreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementGeneratedDate") - .HasColumnType("date"); - - b.Property("StatementGeneratedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("StatementReportingId")); - - b.HasKey("MerchantReportingId", "StatementId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("MerchantReportingId", "StatementGeneratedDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("statementheader"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementLine", b => - { - b.Property("StatementReportingId") - .HasColumnType("int"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ActivityType") - .HasColumnType("int"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDescription") - .HasColumnType("longtext"); - - b.Property("InAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("OutAmount") - .HasColumnType("decimal(65,30)"); - - b.HasKey("StatementReportingId", "TransactionReportingId", "ActivityDateTime", "ActivityType"); - - b.ToTable("statementline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Transaction", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionReportingId")); - - b.Property("AuthorisationCode") - .HasColumnType("longtext"); - - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("EstateOperatorReportingId") - .HasColumnType("int"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .HasColumnType("longtext"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate", "MerchantReportingId") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantReportingId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("transaction"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalRequestData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("longtext"); - - b.Property("CustomerAccountNumber") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalrequestdata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalResponseData", b => - { - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("TransactionReportingId"); - - b.ToTable("transactionadditionalresponsedata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Voucher", b => - { - b.Property("VoucherId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ExpiryDate") - .HasColumnType("date"); - - b.Property("ExpiryDateTime") - .HasColumnType("datetime(6)"); - - b.Property("GenerateDate") - .HasColumnType("date"); - - b.Property("GenerateDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsGenerated") - .HasColumnType("tinyint(1)"); - - b.Property("IsIssued") - .HasColumnType("tinyint(1)"); - - b.Property("IsRedeemed") - .HasColumnType("tinyint(1)"); - - b.Property("IssuedDate") - .HasColumnType("date"); - - b.Property("IssuedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorIdentifier") - .HasColumnType("longtext"); - - b.Property("RecipientEmail") - .HasColumnType("longtext"); - - b.Property("RecipientMobile") - .HasColumnType("longtext"); - - b.Property("RedeemedDate") - .HasColumnType("datetime(6)"); - - b.Property("RedeemedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.Property("VoucherCode") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("VoucherId"); - - b.HasIndex("TransactionReportingId"); - - b.HasIndex("VoucherCode"); - - b.ToTable("voucher"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.SettlementView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FeeDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable((string)null); - - b.ToView("uvwSettlements", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20240501155336_make_voucher_operatoridentifier_nullable.cs b/TransactionProcessor.Database/Migrations/MySql/20240501155336_make_voucher_operatoridentifier_nullable.cs deleted file mode 100644 index 74129edf..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20240501155336_make_voucher_operatoridentifier_nullable.cs +++ /dev/null @@ -1,46 +0,0 @@ -#nullable disable - -using Microsoft.EntityFrameworkCore.Migrations; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - /// - public partial class make_voucher_operatoridentifier_nullable : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "OperatorIdentifier", - table: "voucher", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "voucher", - keyColumn: "OperatorIdentifier", - keyValue: null, - column: "OperatorIdentifier", - value: ""); - - migrationBuilder.AlterColumn( - name: "OperatorIdentifier", - table: "voucher", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20240606143402_20240605061637_remove_reportingids_from_transaction.Designer.cs b/TransactionProcessor.Database/Migrations/MySql/20240606143402_20240605061637_remove_reportingids_from_transaction.Designer.cs deleted file mode 100644 index 97194d1d..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20240606143402_20240605061637_remove_reportingids_from_transaction.Designer.cs +++ /dev/null @@ -1,1098 +0,0 @@ -// - -#nullable disable - -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using TransactionProcessor.Database.Contexts; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - [DbContext(typeof(EstateManagementMySqlContext))] - [Migration("20240606143402_20240605061637_remove_reportingids_from_transaction")] - partial class _20240605061637_remove_reportingids_from_transaction - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("EstateManagement.Database.Entities.Calendar", b => - { - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DayOfWeekNumber") - .HasColumnType("int"); - - b.Property("DayOfWeekShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameLong") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("WeekNumberString") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Year") - .HasColumnType("int"); - - b.Property("YearWeekNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Date"); - - b.ToTable("calendar"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Contract", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ContractReportingId")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateId", "OperatorId", "ContractId"); - - b.ToTable("contract"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProduct", b => - { - b.Property("ContractProductReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ContractProductReportingId")); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractProductId") - .HasColumnType("char(36)"); - - b.Property("DisplayText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductType") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.HasKey("ContractProductReportingId"); - - b.HasIndex("ContractProductId", "ContractId") - .IsUnique(); - - b.ToTable("contractproduct"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ContractProductTransactionFee", b => - { - b.Property("ContractProductTransactionFeeReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ContractProductTransactionFeeReportingId")); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("ContractProductId") - .HasColumnType("char(36)"); - - b.Property("ContractProductTransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Value") - .HasColumnType("decimal(18,4)"); - - b.HasKey("ContractProductTransactionFeeReportingId"); - - b.HasIndex("ContractProductTransactionFeeId", "ContractProductId") - .IsUnique(); - - b.ToTable("contractproducttransactionfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Estate", b => - { - b.Property("EstateReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("EstateReportingId")); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId"); - - b.HasIndex("EstateId") - .IsUnique(); - - b.ToTable("estate"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.EstateSecurityUser", b => - { - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("SecurityUserId", "EstateId"); - - b.ToTable("estatesecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.File", b => - { - b.Property("FileReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("FileReportingId")); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDate") - .HasColumnType("date"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileReportingId"); - - b.HasIndex("FileId") - .IsUnique(); - - b.ToTable("file"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLog", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("FileImportLogReportingId")); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDate") - .HasColumnType("date"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateId", "FileImportLogReportingId"); - - b.HasIndex("EstateId", "FileImportLogId") - .IsUnique(); - - b.ToTable("fileimportlog"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileImportLogFile", b => - { - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileUploadedDate") - .HasColumnType("date"); - - b.Property("FileUploadedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OriginalFileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileImportLogId", "FileId"); - - b.ToTable("fileimportlogfile"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FileLine", b => - { - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("LineNumber") - .HasColumnType("int"); - - b.Property("FileLineData") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.HasKey("FileId", "LineNumber") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("fileline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Float", b => - { - b.Property("FloatId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("CreatedDate") - .HasColumnType("date"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.HasKey("FloatId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("CreatedDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("Floats"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.FloatActivity", b => - { - b.Property("EventId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CostPrice") - .HasColumnType("decimal(65,30)"); - - b.Property("CreditOrDebit") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloatId") - .HasColumnType("char(36)"); - - b.HasKey("EventId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("ActivityDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("FloatActivity"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Merchant", b => - { - b.Property("MerchantReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("MerchantReportingId")); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("LastSaleDate") - .HasColumnType("date"); - - b.Property("LastSaleDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastStatementGenerated") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.Property("SettlementSchedule") - .HasColumnType("int"); - - b.HasKey("MerchantReportingId"); - - b.HasIndex("EstateId", "MerchantId") - .IsUnique(); - - b.ToTable("merchant"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantAddress", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("AddressId") - .HasColumnType("char(36)"); - - b.Property("AddressLine1") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AddressLine2") - .HasColumnType("longtext"); - - b.Property("AddressLine3") - .HasColumnType("longtext"); - - b.Property("AddressLine4") - .HasColumnType("longtext"); - - b.Property("Country") - .HasColumnType("longtext"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("PostalCode") - .HasColumnType("longtext"); - - b.Property("Region") - .HasColumnType("longtext"); - - b.Property("Town") - .HasColumnType("longtext"); - - b.HasKey("MerchantId", "AddressId"); - - b.ToTable("merchantaddress"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContact", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("ContactId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantId", "ContactId"); - - b.ToTable("merchantcontact"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantContract", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("IsDeleted") - .HasColumnType("tinyint(1)"); - - b.HasKey("MerchantId", "ContractId"); - - b.ToTable("MerchantContracts"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantDevice", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("DeviceId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantId", "DeviceId"); - - b.ToTable("merchantdevice"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantOperator", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("IsDeleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantNumber") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TerminalNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantId", "OperatorId"); - - b.ToTable("merchantoperator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSecurityUser", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantId", "SecurityUserId"); - - b.ToTable("merchantsecurityuser"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.MerchantSettlementFee", b => - { - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("ContractProductTransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("FeeCalculatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementId", "TransactionId", "ContractProductTransactionFeeId"); - - b.ToTable("merchantsettlementfee"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Operator", b => - { - b.Property("OperatorReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("OperatorReportingId")); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("RequireCustomMerchantNumber") - .HasColumnType("tinyint(1)"); - - b.Property("RequireCustomTerminalNumber") - .HasColumnType("tinyint(1)"); - - b.HasKey("OperatorReportingId"); - - b.HasIndex("OperatorId") - .IsUnique(); - - b.ToTable("operator"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Reconciliation", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionReportingId")); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionCount") - .HasColumnType("int"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("reconciliation"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.ResponseCodes", b => - { - b.Property("ResponseCode") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ResponseCode")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ResponseCode"); - - b.ToTable("responsecodes"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Settlement", b => - { - b.Property("SettlementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("SettlementReportingId")); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("ProcessingStarted") - .HasColumnType("tinyint(1)"); - - b.Property("ProcessingStartedDateTIme") - .HasColumnType("datetime(6)"); - - b.Property("SettlementDate") - .HasColumnType("date"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("SettlementDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("EstateId", "SettlementId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("settlement"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementHeader", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("StatementCreatedDate") - .HasColumnType("date"); - - b.Property("StatementCreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementGeneratedDate") - .HasColumnType("date"); - - b.Property("StatementGeneratedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("StatementReportingId")); - - b.HasKey("MerchantId", "StatementId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("StatementGeneratedDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("statementheader"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.StatementLine", b => - { - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ActivityType") - .HasColumnType("int"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDescription") - .HasColumnType("longtext"); - - b.Property("InAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("OutAmount") - .HasColumnType("decimal(65,30)"); - - b.HasKey("StatementId", "TransactionId", "ActivityDateTime", "ActivityType"); - - b.ToTable("statementline"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Transaction", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionReportingId")); - - b.Property("AuthorisationCode") - .HasColumnType("longtext"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractProductId") - .HasColumnType("char(36)"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .HasColumnType("longtext"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("transaction"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalRequestData", b => - { - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("Amount") - .HasColumnType("longtext"); - - b.Property("CustomerAccountNumber") - .HasColumnType("longtext"); - - b.HasKey("TransactionId"); - - b.ToTable("transactionadditionalrequestdata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.TransactionAdditionalResponseData", b => - { - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("TransactionId"); - - b.ToTable("transactionadditionalresponsedata"); - }); - - modelBuilder.Entity("EstateManagement.Database.Entities.Voucher", b => - { - b.Property("VoucherId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ExpiryDate") - .HasColumnType("date"); - - b.Property("ExpiryDateTime") - .HasColumnType("datetime(6)"); - - b.Property("GenerateDate") - .HasColumnType("date"); - - b.Property("GenerateDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsGenerated") - .HasColumnType("tinyint(1)"); - - b.Property("IsIssued") - .HasColumnType("tinyint(1)"); - - b.Property("IsRedeemed") - .HasColumnType("tinyint(1)"); - - b.Property("IssuedDate") - .HasColumnType("date"); - - b.Property("IssuedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorIdentifier") - .HasColumnType("longtext"); - - b.Property("RecipientEmail") - .HasColumnType("longtext"); - - b.Property("RecipientMobile") - .HasColumnType("longtext"); - - b.Property("RedeemedDate") - .HasColumnType("datetime(6)"); - - b.Property("RedeemedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.Property("VoucherCode") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("VoucherId"); - - b.HasIndex("TransactionId"); - - b.HasIndex("VoucherCode"); - - b.ToTable("voucher"); - }); - - modelBuilder.Entity("EstateManagement.Database.ViewEntities.SettlementView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FeeDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable((string)null); - - b.ToView("uvwSettlements", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20240606143402_20240605061637_remove_reportingids_from_transaction.cs b/TransactionProcessor.Database/Migrations/MySql/20240606143402_20240605061637_remove_reportingids_from_transaction.cs deleted file mode 100644 index 2844f5ef..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20240606143402_20240605061637_remove_reportingids_from_transaction.cs +++ /dev/null @@ -1,1510 +0,0 @@ -#nullable disable - -using Microsoft.EntityFrameworkCore.Migrations; - -namespace TransactionProcessor.Database.Migrations.MySql -{ - /// - public partial class _20240605061637_remove_reportingids_from_transaction : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "estateoperator"); - - migrationBuilder.DropIndex( - name: "IX_voucher_TransactionReportingId", - table: "voucher"); - - migrationBuilder.DropPrimaryKey( - name: "PK_transactionadditionalresponsedata", - table: "transactionadditionalresponsedata"); - - migrationBuilder.DropPrimaryKey( - name: "PK_transactionadditionalrequestdata", - table: "transactionadditionalrequestdata"); - - migrationBuilder.DropIndex( - name: "IX_transaction_TransactionDate_MerchantReportingId", - table: "transaction"); - - migrationBuilder.DropIndex( - name: "IX_transaction_TransactionId_MerchantReportingId", - table: "transaction"); - - migrationBuilder.DropPrimaryKey( - name: "PK_statementline", - table: "statementline"); - - migrationBuilder.DropPrimaryKey( - name: "PK_statementheader", - table: "statementheader"); - - migrationBuilder.DropIndex( - name: "IX_statementheader_MerchantReportingId_StatementGeneratedDate", - table: "statementheader"); - - migrationBuilder.DropIndex( - name: "IX_settlement_EstateReportingId_SettlementId", - table: "settlement"); - - migrationBuilder.DropIndex( - name: "IX_settlement_SettlementDate_EstateReportingId", - table: "settlement"); - - migrationBuilder.DropIndex( - name: "IX_reconciliation_TransactionDate_MerchantReportingId", - table: "reconciliation"); - - migrationBuilder.DropIndex( - name: "IX_reconciliation_TransactionId_MerchantReportingId", - table: "reconciliation"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantsettlementfee", - table: "merchantsettlementfee"); - - migrationBuilder.DropIndex( - name: "IX_merchantsettlementfee_TransactionReportingId", - table: "merchantsettlementfee"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantsecurityuser", - table: "merchantsecurityuser"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantoperator", - table: "merchantoperator"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantdevice", - table: "merchantdevice"); - - migrationBuilder.DropPrimaryKey( - name: "PK_MerchantContracts", - table: "MerchantContracts"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantcontact", - table: "merchantcontact"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantaddress", - table: "merchantaddress"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchant", - table: "merchant"); - - migrationBuilder.DropIndex( - name: "IX_merchant_EstateReportingId_MerchantId", - table: "merchant"); - - migrationBuilder.DropPrimaryKey( - name: "PK_fileline", - table: "fileline"); - - migrationBuilder.DropIndex( - name: "IX_fileline_TransactionReportingId", - table: "fileline"); - - migrationBuilder.DropPrimaryKey( - name: "PK_fileimportlogfile", - table: "fileimportlogfile"); - - migrationBuilder.DropPrimaryKey( - name: "PK_fileimportlog", - table: "fileimportlog"); - - migrationBuilder.DropIndex( - name: "IX_fileimportlog_EstateReportingId_FileImportLogId", - table: "fileimportlog"); - - migrationBuilder.DropPrimaryKey( - name: "PK_estatesecurityuser", - table: "estatesecurityuser"); - - migrationBuilder.DropPrimaryKey( - name: "PK_contractproducttransactionfee", - table: "contractproducttransactionfee"); - - migrationBuilder.DropPrimaryKey( - name: "PK_contractproduct", - table: "contractproduct"); - - migrationBuilder.DropPrimaryKey( - name: "PK_contract", - table: "contract"); - - migrationBuilder.DropColumn( - name: "TransactionReportingId", - table: "voucher"); - - migrationBuilder.DropColumn( - name: "TransactionReportingId", - table: "transactionadditionalrequestdata"); - - migrationBuilder.DropColumn( - name: "ContractProductReportingId", - table: "transaction"); - - migrationBuilder.DropColumn( - name: "ContractReportingId", - table: "transaction"); - - migrationBuilder.DropColumn( - name: "EstateOperatorReportingId", - table: "transaction"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "transaction"); - - migrationBuilder.DropColumn( - name: "StatementReportingId", - table: "statementline"); - - migrationBuilder.DropColumn( - name: "TransactionReportingId", - table: "statementline"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "statementheader"); - - migrationBuilder.DropColumn( - name: "EstateReportingId", - table: "settlement"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "settlement"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "reconciliation"); - - migrationBuilder.DropColumn( - name: "EstateReportingId", - table: "operator"); - - migrationBuilder.DropColumn( - name: "SettlementReportingId", - table: "merchantsettlementfee"); - - migrationBuilder.DropColumn( - name: "TransactionReportingId", - table: "merchantsettlementfee"); - - migrationBuilder.DropColumn( - name: "TransactionFeeReportingId", - table: "merchantsettlementfee"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "merchantsettlementfee"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "merchantsecurityuser"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "merchantoperator"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "merchantdevice"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "MerchantContracts"); - - migrationBuilder.DropColumn( - name: "ContractReportingId", - table: "MerchantContracts"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "merchantcontact"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "merchantaddress"); - - migrationBuilder.DropColumn( - name: "EstateReportingId", - table: "merchant"); - - migrationBuilder.DropColumn( - name: "FileReportingId", - table: "fileline"); - - migrationBuilder.DropColumn( - name: "TransactionReportingId", - table: "fileline"); - - migrationBuilder.DropColumn( - name: "FileImportLogReportingId", - table: "fileimportlogfile"); - - migrationBuilder.DropColumn( - name: "FileReportingId", - table: "fileimportlogfile"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "fileimportlogfile"); - - migrationBuilder.DropColumn( - name: "EstateReportingId", - table: "fileimportlog"); - - migrationBuilder.DropColumn( - name: "EstateReportingId", - table: "file"); - - migrationBuilder.DropColumn( - name: "FileImportLogReportingId", - table: "file"); - - migrationBuilder.DropColumn( - name: "MerchantReportingId", - table: "file"); - - migrationBuilder.DropColumn( - name: "EstateReportingId", - table: "estatesecurityuser"); - - migrationBuilder.DropColumn( - name: "ContractProductReportingId", - table: "contractproducttransactionfee"); - - migrationBuilder.DropColumn( - name: "ContractReportingId", - table: "contractproduct"); - - migrationBuilder.DropColumn( - name: "EstateReportingId", - table: "contract"); - - migrationBuilder.RenameColumn( - name: "TransactionFeeReportingId", - table: "contractproducttransactionfee", - newName: "ContractProductTransactionFeeReportingId"); - - migrationBuilder.RenameColumn( - name: "TransactionFeeId", - table: "contractproducttransactionfee", - newName: "ContractProductTransactionFeeId"); - - migrationBuilder.RenameColumn( - name: "ProductId", - table: "contractproduct", - newName: "ContractProductId"); - - migrationBuilder.AddColumn( - name: "TransactionId", - table: "voucher", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TransactionId", - table: "transactionadditionalresponsedata", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TransactionId", - table: "transactionadditionalrequestdata", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "ContractId", - table: "transaction", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "ContractProductId", - table: "transaction", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "transaction", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "OperatorId", - table: "transaction", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "StatementId", - table: "statementline", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TransactionId", - table: "statementline", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "statementheader", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "settlement", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "settlement", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "reconciliation", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "operator", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "SettlementId", - table: "merchantsettlementfee", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TransactionId", - table: "merchantsettlementfee", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "ContractProductTransactionFeeId", - table: "merchantsettlementfee", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "merchantsettlementfee", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "merchantsecurityuser", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "merchantoperator", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "merchantdevice", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "MerchantContracts", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "ContractId", - table: "MerchantContracts", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "merchantcontact", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "merchantaddress", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "merchant", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "FileId", - table: "fileline", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TransactionId", - table: "fileline", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "FileImportLogId", - table: "fileimportlogfile", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "FileId", - table: "fileimportlogfile", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "fileimportlogfile", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "fileimportlog", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "file", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "FileImportLogId", - table: "file", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "MerchantId", - table: "file", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "estatesecurityuser", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "ContractProductId", - table: "contractproducttransactionfee", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "ContractId", - table: "contractproduct", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "EstateId", - table: "contract", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddPrimaryKey( - name: "PK_transactionadditionalresponsedata", - table: "transactionadditionalresponsedata", - column: "TransactionId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_transactionadditionalrequestdata", - table: "transactionadditionalrequestdata", - column: "TransactionId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_statementline", - table: "statementline", - columns: new[] { "StatementId", "TransactionId", "ActivityDateTime", "ActivityType" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_statementheader", - table: "statementheader", - columns: new[] { "MerchantId", "StatementId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantsettlementfee", - table: "merchantsettlementfee", - columns: new[] { "SettlementId", "TransactionId", "ContractProductTransactionFeeId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantsecurityuser", - table: "merchantsecurityuser", - columns: new[] { "MerchantId", "SecurityUserId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantoperator", - table: "merchantoperator", - columns: new[] { "MerchantId", "OperatorId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantdevice", - table: "merchantdevice", - columns: new[] { "MerchantId", "DeviceId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_MerchantContracts", - table: "MerchantContracts", - columns: new[] { "MerchantId", "ContractId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantcontact", - table: "merchantcontact", - columns: new[] { "MerchantId", "ContactId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantaddress", - table: "merchantaddress", - columns: new[] { "MerchantId", "AddressId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchant", - table: "merchant", - column: "MerchantReportingId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_fileline", - table: "fileline", - columns: new[] { "FileId", "LineNumber" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_fileimportlogfile", - table: "fileimportlogfile", - columns: new[] { "FileImportLogId", "FileId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_fileimportlog", - table: "fileimportlog", - columns: new[] { "EstateId", "FileImportLogReportingId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_estatesecurityuser", - table: "estatesecurityuser", - columns: new[] { "SecurityUserId", "EstateId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_contractproducttransactionfee", - table: "contractproducttransactionfee", - column: "ContractProductTransactionFeeReportingId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_contractproduct", - table: "contractproduct", - column: "ContractProductReportingId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_contract", - table: "contract", - columns: new[] { "EstateId", "OperatorId", "ContractId" }); - - migrationBuilder.CreateIndex( - name: "IX_voucher_TransactionId", - table: "voucher", - column: "TransactionId"); - - migrationBuilder.CreateIndex( - name: "IX_transaction_TransactionDate", - table: "transaction", - column: "TransactionDate"); - - migrationBuilder.CreateIndex( - name: "IX_statementheader_StatementGeneratedDate", - table: "statementheader", - column: "StatementGeneratedDate"); - - migrationBuilder.CreateIndex( - name: "IX_settlement_EstateId_SettlementId", - table: "settlement", - columns: new[] { "EstateId", "SettlementId" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_settlement_SettlementDate", - table: "settlement", - column: "SettlementDate"); - - migrationBuilder.CreateIndex( - name: "IX_reconciliation_TransactionDate", - table: "reconciliation", - column: "TransactionDate"); - - migrationBuilder.CreateIndex( - name: "IX_reconciliation_TransactionId_MerchantId", - table: "reconciliation", - columns: new[] { "TransactionId", "MerchantId" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_merchant_EstateId_MerchantId", - table: "merchant", - columns: new[] { "EstateId", "MerchantId" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_fileimportlog_EstateId_FileImportLogId", - table: "fileimportlog", - columns: new[] { "EstateId", "FileImportLogId" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_contractproducttransactionfee_ContractProductTransactionFeeI~", - table: "contractproducttransactionfee", - columns: new[] { "ContractProductTransactionFeeId", "ContractProductId" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_contractproduct_ContractProductId_ContractId", - table: "contractproduct", - columns: new[] { "ContractProductId", "ContractId" }, - unique: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_voucher_TransactionId", - table: "voucher"); - - migrationBuilder.DropPrimaryKey( - name: "PK_transactionadditionalresponsedata", - table: "transactionadditionalresponsedata"); - - migrationBuilder.DropPrimaryKey( - name: "PK_transactionadditionalrequestdata", - table: "transactionadditionalrequestdata"); - - migrationBuilder.DropIndex( - name: "IX_transaction_TransactionDate", - table: "transaction"); - - migrationBuilder.DropPrimaryKey( - name: "PK_statementline", - table: "statementline"); - - migrationBuilder.DropPrimaryKey( - name: "PK_statementheader", - table: "statementheader"); - - migrationBuilder.DropIndex( - name: "IX_statementheader_StatementGeneratedDate", - table: "statementheader"); - - migrationBuilder.DropIndex( - name: "IX_settlement_EstateId_SettlementId", - table: "settlement"); - - migrationBuilder.DropIndex( - name: "IX_settlement_SettlementDate", - table: "settlement"); - - migrationBuilder.DropIndex( - name: "IX_reconciliation_TransactionDate", - table: "reconciliation"); - - migrationBuilder.DropIndex( - name: "IX_reconciliation_TransactionId_MerchantId", - table: "reconciliation"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantsettlementfee", - table: "merchantsettlementfee"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantsecurityuser", - table: "merchantsecurityuser"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantoperator", - table: "merchantoperator"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantdevice", - table: "merchantdevice"); - - migrationBuilder.DropPrimaryKey( - name: "PK_MerchantContracts", - table: "MerchantContracts"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantcontact", - table: "merchantcontact"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchantaddress", - table: "merchantaddress"); - - migrationBuilder.DropPrimaryKey( - name: "PK_merchant", - table: "merchant"); - - migrationBuilder.DropIndex( - name: "IX_merchant_EstateId_MerchantId", - table: "merchant"); - - migrationBuilder.DropPrimaryKey( - name: "PK_fileline", - table: "fileline"); - - migrationBuilder.DropPrimaryKey( - name: "PK_fileimportlogfile", - table: "fileimportlogfile"); - - migrationBuilder.DropPrimaryKey( - name: "PK_fileimportlog", - table: "fileimportlog"); - - migrationBuilder.DropIndex( - name: "IX_fileimportlog_EstateId_FileImportLogId", - table: "fileimportlog"); - - migrationBuilder.DropPrimaryKey( - name: "PK_estatesecurityuser", - table: "estatesecurityuser"); - - migrationBuilder.DropPrimaryKey( - name: "PK_contractproducttransactionfee", - table: "contractproducttransactionfee"); - - migrationBuilder.DropIndex( - name: "IX_contractproducttransactionfee_ContractProductTransactionFeeI~", - table: "contractproducttransactionfee"); - - migrationBuilder.DropPrimaryKey( - name: "PK_contractproduct", - table: "contractproduct"); - - migrationBuilder.DropIndex( - name: "IX_contractproduct_ContractProductId_ContractId", - table: "contractproduct"); - - migrationBuilder.DropPrimaryKey( - name: "PK_contract", - table: "contract"); - - migrationBuilder.DropColumn( - name: "TransactionId", - table: "voucher"); - - migrationBuilder.DropColumn( - name: "TransactionId", - table: "transactionadditionalresponsedata"); - - migrationBuilder.DropColumn( - name: "TransactionId", - table: "transactionadditionalrequestdata"); - - migrationBuilder.DropColumn( - name: "ContractId", - table: "transaction"); - - migrationBuilder.DropColumn( - name: "ContractProductId", - table: "transaction"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "transaction"); - - migrationBuilder.DropColumn( - name: "OperatorId", - table: "transaction"); - - migrationBuilder.DropColumn( - name: "StatementId", - table: "statementline"); - - migrationBuilder.DropColumn( - name: "TransactionId", - table: "statementline"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "statementheader"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "settlement"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "settlement"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "reconciliation"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "operator"); - - migrationBuilder.DropColumn( - name: "SettlementId", - table: "merchantsettlementfee"); - - migrationBuilder.DropColumn( - name: "TransactionId", - table: "merchantsettlementfee"); - - migrationBuilder.DropColumn( - name: "ContractProductTransactionFeeId", - table: "merchantsettlementfee"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "merchantsettlementfee"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "merchantsecurityuser"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "merchantoperator"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "merchantdevice"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "MerchantContracts"); - - migrationBuilder.DropColumn( - name: "ContractId", - table: "MerchantContracts"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "merchantcontact"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "merchantaddress"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "merchant"); - - migrationBuilder.DropColumn( - name: "FileId", - table: "fileline"); - - migrationBuilder.DropColumn( - name: "TransactionId", - table: "fileline"); - - migrationBuilder.DropColumn( - name: "FileImportLogId", - table: "fileimportlogfile"); - - migrationBuilder.DropColumn( - name: "FileId", - table: "fileimportlogfile"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "fileimportlogfile"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "fileimportlog"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "file"); - - migrationBuilder.DropColumn( - name: "FileImportLogId", - table: "file"); - - migrationBuilder.DropColumn( - name: "MerchantId", - table: "file"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "estatesecurityuser"); - - migrationBuilder.DropColumn( - name: "ContractProductId", - table: "contractproducttransactionfee"); - - migrationBuilder.DropColumn( - name: "ContractId", - table: "contractproduct"); - - migrationBuilder.DropColumn( - name: "EstateId", - table: "contract"); - - migrationBuilder.RenameColumn( - name: "ContractProductTransactionFeeId", - table: "contractproducttransactionfee", - newName: "TransactionFeeId"); - - migrationBuilder.RenameColumn( - name: "ContractProductTransactionFeeReportingId", - table: "contractproducttransactionfee", - newName: "TransactionFeeReportingId"); - - migrationBuilder.RenameColumn( - name: "ContractProductId", - table: "contractproduct", - newName: "ProductId"); - - migrationBuilder.AddColumn( - name: "TransactionReportingId", - table: "voucher", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "TransactionReportingId", - table: "transactionadditionalrequestdata", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "ContractProductReportingId", - table: "transaction", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "ContractReportingId", - table: "transaction", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "EstateOperatorReportingId", - table: "transaction", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "transaction", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "StatementReportingId", - table: "statementline", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "TransactionReportingId", - table: "statementline", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "statementheader", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "EstateReportingId", - table: "settlement", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "settlement", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "reconciliation", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "EstateReportingId", - table: "operator", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "SettlementReportingId", - table: "merchantsettlementfee", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "TransactionReportingId", - table: "merchantsettlementfee", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "TransactionFeeReportingId", - table: "merchantsettlementfee", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "merchantsettlementfee", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "merchantsecurityuser", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "merchantoperator", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "merchantdevice", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "MerchantContracts", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "ContractReportingId", - table: "MerchantContracts", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "merchantcontact", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "merchantaddress", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "EstateReportingId", - table: "merchant", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "FileReportingId", - table: "fileline", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "TransactionReportingId", - table: "fileline", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "FileImportLogReportingId", - table: "fileimportlogfile", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "FileReportingId", - table: "fileimportlogfile", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "fileimportlogfile", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "EstateReportingId", - table: "fileimportlog", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "EstateReportingId", - table: "file", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "FileImportLogReportingId", - table: "file", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "MerchantReportingId", - table: "file", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "EstateReportingId", - table: "estatesecurityuser", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "ContractProductReportingId", - table: "contractproducttransactionfee", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "ContractReportingId", - table: "contractproduct", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "EstateReportingId", - table: "contract", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddPrimaryKey( - name: "PK_transactionadditionalresponsedata", - table: "transactionadditionalresponsedata", - column: "TransactionReportingId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_transactionadditionalrequestdata", - table: "transactionadditionalrequestdata", - column: "TransactionReportingId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_statementline", - table: "statementline", - columns: new[] { "StatementReportingId", "TransactionReportingId", "ActivityDateTime", "ActivityType" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_statementheader", - table: "statementheader", - columns: new[] { "MerchantReportingId", "StatementId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantsettlementfee", - table: "merchantsettlementfee", - columns: new[] { "SettlementReportingId", "TransactionReportingId", "TransactionFeeReportingId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantsecurityuser", - table: "merchantsecurityuser", - columns: new[] { "MerchantReportingId", "SecurityUserId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantoperator", - table: "merchantoperator", - columns: new[] { "MerchantReportingId", "OperatorId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantdevice", - table: "merchantdevice", - columns: new[] { "MerchantReportingId", "DeviceId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_MerchantContracts", - table: "MerchantContracts", - columns: new[] { "MerchantReportingId", "ContractReportingId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantcontact", - table: "merchantcontact", - columns: new[] { "MerchantReportingId", "ContactId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchantaddress", - table: "merchantaddress", - columns: new[] { "MerchantReportingId", "AddressId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_merchant", - table: "merchant", - columns: new[] { "EstateReportingId", "MerchantReportingId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_fileline", - table: "fileline", - columns: new[] { "FileReportingId", "LineNumber" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_fileimportlogfile", - table: "fileimportlogfile", - columns: new[] { "FileImportLogReportingId", "FileReportingId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_fileimportlog", - table: "fileimportlog", - columns: new[] { "EstateReportingId", "FileImportLogReportingId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_estatesecurityuser", - table: "estatesecurityuser", - columns: new[] { "SecurityUserId", "EstateReportingId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_contractproducttransactionfee", - table: "contractproducttransactionfee", - columns: new[] { "ContractProductReportingId", "TransactionFeeId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_contractproduct", - table: "contractproduct", - columns: new[] { "ContractReportingId", "ProductId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_contract", - table: "contract", - columns: new[] { "EstateReportingId", "OperatorId", "ContractId" }); - - migrationBuilder.CreateTable( - name: "estateoperator", - columns: table => new - { - EstateReportingId = table.Column(type: "int", nullable: false), - OperatorReportingId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_estateoperator", x => new { x.EstateReportingId, x.OperatorReportingId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_voucher_TransactionReportingId", - table: "voucher", - column: "TransactionReportingId"); - - migrationBuilder.CreateIndex( - name: "IX_transaction_TransactionDate_MerchantReportingId", - table: "transaction", - columns: new[] { "TransactionDate", "MerchantReportingId" }); - - migrationBuilder.CreateIndex( - name: "IX_transaction_TransactionId_MerchantReportingId", - table: "transaction", - columns: new[] { "TransactionId", "MerchantReportingId" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_statementheader_MerchantReportingId_StatementGeneratedDate", - table: "statementheader", - columns: new[] { "MerchantReportingId", "StatementGeneratedDate" }); - - migrationBuilder.CreateIndex( - name: "IX_settlement_EstateReportingId_SettlementId", - table: "settlement", - columns: new[] { "EstateReportingId", "SettlementId" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_settlement_SettlementDate_EstateReportingId", - table: "settlement", - columns: new[] { "SettlementDate", "EstateReportingId" }); - - migrationBuilder.CreateIndex( - name: "IX_reconciliation_TransactionDate_MerchantReportingId", - table: "reconciliation", - columns: new[] { "TransactionDate", "MerchantReportingId" }); - - migrationBuilder.CreateIndex( - name: "IX_reconciliation_TransactionId_MerchantReportingId", - table: "reconciliation", - columns: new[] { "TransactionId", "MerchantReportingId" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_merchantsettlementfee_TransactionReportingId", - table: "merchantsettlementfee", - column: "TransactionReportingId"); - - migrationBuilder.CreateIndex( - name: "IX_merchant_EstateReportingId_MerchantId", - table: "merchant", - columns: new[] { "EstateReportingId", "MerchantId" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_fileline_TransactionReportingId", - table: "fileline", - column: "TransactionReportingId"); - - migrationBuilder.CreateIndex( - name: "IX_fileimportlog_EstateReportingId_FileImportLogId", - table: "fileimportlog", - columns: new[] { "EstateReportingId", "FileImportLogId" }, - unique: true); - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20250221134619_move_over_projection_states.Designer.cs b/TransactionProcessor.Database/Migrations/MySql/20250221134619_move_over_projection_states.Designer.cs deleted file mode 100644 index c2d4ad68..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20250221134619_move_over_projection_states.Designer.cs +++ /dev/null @@ -1,1471 +0,0 @@ -// -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.MySql -{ - [DbContext(typeof(EstateManagementMySqlContext))] - [Migration("20250221134619_move_over_projection_states")] - partial class move_over_projection_states - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Calendar", b => - { - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DayOfWeekNumber") - .HasColumnType("int"); - - b.Property("DayOfWeekShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameLong") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("WeekNumberString") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Year") - .HasColumnType("int"); - - b.Property("YearWeekNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Date"); - - b.ToTable("calendar"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Contract", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ContractReportingId")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateId", "OperatorId", "ContractId"); - - b.ToTable("contract"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.ContractProduct", b => - { - b.Property("ContractProductReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ContractProductReportingId")); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractProductId") - .HasColumnType("char(36)"); - - b.Property("DisplayText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductType") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.HasKey("ContractProductReportingId"); - - b.HasIndex("ContractProductId", "ContractId") - .IsUnique(); - - b.ToTable("contractproduct"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.ContractProductTransactionFee", b => - { - b.Property("ContractProductTransactionFeeReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ContractProductTransactionFeeReportingId")); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("ContractProductId") - .HasColumnType("char(36)"); - - b.Property("ContractProductTransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - 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"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("EstateReportingId")); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId"); - - b.HasIndex("EstateId") - .IsUnique(); - - b.ToTable("estate"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.EstateSecurityUser", b => - { - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("SecurityUserId", "EstateId"); - - b.ToTable("estatesecurityuser"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.File", b => - { - b.Property("FileReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("FileReportingId")); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDate") - .HasColumnType("date"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileReportingId"); - - b.HasIndex("FileId") - .IsUnique(); - - b.ToTable("file"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.FileImportLog", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("FileImportLogReportingId")); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDate") - .HasColumnType("date"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateId", "FileImportLogReportingId"); - - b.HasIndex("EstateId", "FileImportLogId") - .IsUnique(); - - b.ToTable("fileimportlog"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.FileImportLogFile", b => - { - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileUploadedDate") - .HasColumnType("date"); - - b.Property("FileUploadedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OriginalFileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileImportLogId", "FileId"); - - b.ToTable("fileimportlogfile"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.FileLine", b => - { - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("LineNumber") - .HasColumnType("int"); - - b.Property("FileLineData") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.HasKey("FileId", "LineNumber") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("fileline"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Float", b => - { - b.Property("FloatId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("CreatedDate") - .HasColumnType("date"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.HasKey("FloatId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("CreatedDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("Floats"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.FloatActivity", b => - { - b.Property("EventId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CostPrice") - .HasColumnType("decimal(65,30)"); - - b.Property("CreditOrDebit") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloatId") - .HasColumnType("char(36)"); - - b.HasKey("EventId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("ActivityDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("FloatActivity"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Merchant", b => - { - b.Property("MerchantReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("MerchantReportingId")); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("LastSaleDate") - .HasColumnType("date"); - - b.Property("LastSaleDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastStatementGenerated") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - 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("char(36)"); - - b.Property("AddressId") - .HasColumnType("char(36)"); - - b.Property("AddressLine1") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AddressLine2") - .HasColumnType("longtext"); - - b.Property("AddressLine3") - .HasColumnType("longtext"); - - b.Property("AddressLine4") - .HasColumnType("longtext"); - - b.Property("Country") - .HasColumnType("longtext"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("PostalCode") - .HasColumnType("longtext"); - - b.Property("Region") - .HasColumnType("longtext"); - - b.Property("Town") - .HasColumnType("longtext"); - - b.HasKey("MerchantId", "AddressId"); - - b.ToTable("merchantaddress"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantContact", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("ContactId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantId", "ContactId"); - - b.ToTable("merchantcontact"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantContract", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("IsDeleted") - .HasColumnType("tinyint(1)"); - - b.HasKey("MerchantId", "ContractId"); - - b.ToTable("MerchantContracts"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantDevice", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("DeviceId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantId", "DeviceId"); - - b.ToTable("merchantdevice"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantOperator", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("IsDeleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantNumber") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TerminalNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantId", "OperatorId"); - - b.ToTable("merchantoperator"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantSecurityUser", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantId", "SecurityUserId"); - - b.ToTable("merchantsecurityuser"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantSettlementFee", b => - { - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("ContractProductTransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("FeeCalculatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementId", "TransactionId", "ContractProductTransactionFeeId"); - - b.ToTable("merchantsettlementfee"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Operator", b => - { - b.Property("OperatorReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("OperatorReportingId")); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("RequireCustomMerchantNumber") - .HasColumnType("tinyint(1)"); - - b.Property("RequireCustomTerminalNumber") - .HasColumnType("tinyint(1)"); - - b.HasKey("OperatorReportingId"); - - b.HasIndex("OperatorId") - .IsUnique(); - - b.ToTable("operator"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Reconciliation", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionReportingId")); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionCount") - .HasColumnType("int"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("reconciliation"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.ResponseCodes", b => - { - b.Property("ResponseCode") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ResponseCode")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ResponseCode"); - - b.ToTable("responsecodes"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Settlement", b => - { - b.Property("SettlementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("SettlementReportingId")); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("ProcessingStarted") - .HasColumnType("tinyint(1)"); - - b.Property("ProcessingStartedDateTIme") - .HasColumnType("datetime(6)"); - - b.Property("SettlementDate") - .HasColumnType("date"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("SettlementDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("EstateId", "SettlementId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("settlement"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.StatementHeader", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("StatementCreatedDate") - .HasColumnType("date"); - - b.Property("StatementCreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementGeneratedDate") - .HasColumnType("date"); - - b.Property("StatementGeneratedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("StatementReportingId")); - - b.HasKey("MerchantId", "StatementId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("StatementGeneratedDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("statementheader"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.StatementLine", b => - { - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ActivityType") - .HasColumnType("int"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDescription") - .HasColumnType("longtext"); - - b.Property("InAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("OutAmount") - .HasColumnType("decimal(65,30)"); - - 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(65,30)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorReportingId") - .HasColumnType("int"); - - b.Property("SalesCount") - .HasColumnType("int"); - - b.Property("SalesValue") - .HasColumnType("decimal(65,30)"); - - b.Property("SettlementDate") - .HasColumnType("date"); - - b.HasIndex("SettlementDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("SettlementDate", "MerchantReportingId", "OperatorReportingId", "ContractProductReportingId", "IsCompleted", "IsSettled") - .IsUnique(); - - b.ToTable("SettlementSummary"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Summary.TodayTransaction", b => - { - b.Property("AuthorisationCode") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Hour") - .HasColumnType("int"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .IsRequired() - .HasColumnType("longtext"); - - b.HasIndex("TransactionDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId") - .IsUnique(); - - b.ToTable("TodayTransactions"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Summary.TransactionHistory", b => - { - b.Property("AuthorisationCode") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Hour") - .HasColumnType("int"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .IsRequired() - .HasColumnType("longtext"); - - b.HasIndex("TransactionDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId") - .IsUnique(); - - b.ToTable("TransactionHistory"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Transaction", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionReportingId")); - - b.Property("AuthorisationCode") - .HasColumnType("longtext"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractProductId") - .HasColumnType("char(36)"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .HasColumnType("longtext"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("transaction"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.TransactionAdditionalRequestData", b => - { - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("Amount") - .HasColumnType("longtext"); - - b.Property("CustomerAccountNumber") - .HasColumnType("longtext"); - - b.HasKey("TransactionId"); - - b.ToTable("transactionadditionalrequestdata"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.TransactionAdditionalResponseData", b => - { - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("TransactionId"); - - b.ToTable("transactionadditionalresponsedata"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.VoucherProjectionState", b => - { - b.Property("VoucherId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Barcode") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ExpiryDate") - .HasColumnType("date"); - - b.Property("ExpiryDateTime") - .HasColumnType("datetime(6)"); - - b.Property("GenerateDate") - .HasColumnType("date"); - - b.Property("GenerateDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsGenerated") - .HasColumnType("tinyint(1)"); - - b.Property("IsIssued") - .HasColumnType("tinyint(1)"); - - b.Property("IsRedeemed") - .HasColumnType("tinyint(1)"); - - b.Property("IssuedDate") - .HasColumnType("date"); - - b.Property("IssuedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorIdentifier") - .HasColumnType("longtext"); - - b.Property("RecipientEmail") - .HasColumnType("longtext"); - - b.Property("RecipientMobile") - .HasColumnType("longtext"); - - b.Property("RedeemedDate") - .HasColumnType("datetime(6)"); - - b.Property("RedeemedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("Timestamp") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("timestamp(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.Property("VoucherCode") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("VoucherId"); - - b.HasIndex("TransactionId"); - - b.HasIndex("VoucherCode"); - - b.ToTable("voucherprojectionstate"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.ViewEntities.SettlementView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FeeDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable((string)null); - - b.ToView("uvwSettlements", (string)null); - }); - - modelBuilder.Entity("TransactionProcessor.ProjectionEngine.Database.Database.Entities.Event", b => - { - b.Property("EventId") - .HasColumnType("char(36)"); - - b.Property("Type") - .HasColumnType("varchar(255)"); - - b.Property("Date") - .HasColumnType("date"); - - b.HasKey("EventId", "Type") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("Events"); - }); - - modelBuilder.Entity("TransactionProcessor.ProjectionEngine.Database.Database.Entities.MerchantBalanceChangedEntry", b => - { - b.Property("AggregateId") - .HasColumnType("char(36)"); - - b.Property("OriginalEventId") - .HasColumnType("char(36)"); - - b.Property("CauseOfChangeId") - .HasColumnType("char(36)"); - - b.Property("ChangeAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("DateTime") - .HasColumnType("datetime(6)"); - - b.Property("DebitOrCredit") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Reference") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("AggregateId", "OriginalEventId"); - - b.ToTable("MerchantBalanceChangedEntry"); - }); - - modelBuilder.Entity("TransactionProcessor.ProjectionEngine.Database.Database.Entities.MerchantBalanceProjectionState", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("AuthorisedSales") - .HasColumnType("decimal(65,30)"); - - b.Property("AvailableBalance") - .HasColumnType("decimal(65,30)"); - - b.Property("Balance") - .HasColumnType("decimal(65,30)"); - - b.Property("CompletedTransactionCount") - .HasColumnType("int"); - - b.Property("DeclinedSales") - .HasColumnType("decimal(65,30)"); - - b.Property("DepositCount") - .HasColumnType("int"); - - b.Property("FeeCount") - .HasColumnType("int"); - - b.Property("LastDeposit") - .HasColumnType("datetime(6)"); - - b.Property("LastFee") - .HasColumnType("datetime(6)"); - - b.Property("LastSale") - .HasColumnType("datetime(6)"); - - b.Property("LastWithdrawal") - .HasColumnType("datetime(6)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SaleCount") - .HasColumnType("int"); - - b.Property("StartedTransactionCount") - .HasColumnType("int"); - - b.Property("Timestamp") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("timestamp(6)"); - - b.Property("TotalDeposited") - .HasColumnType("decimal(65,30)"); - - b.Property("TotalWithdrawn") - .HasColumnType("decimal(65,30)"); - - b.Property("ValueOfFees") - .HasColumnType("decimal(65,30)"); - - b.Property("WithdrawalCount") - .HasColumnType("int"); - - b.HasKey("EstateId", "MerchantId"); - - b.ToTable("MerchantBalanceProjectionState"); - }); - - modelBuilder.Entity("TransactionProcessor.ProjectionEngine.Database.Database.ViewEntities.MerchantBalanceHistoryViewEntry", b => - { - b.Property("Balance") - .HasColumnType("decimal(65,30)"); - - b.Property("ChangeAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("DebitOrCredit") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EntryDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OriginalEventId") - .HasColumnType("char(36)"); - - b.Property("Reference") - .IsRequired() - .HasColumnType("longtext"); - - b.ToTable((string)null); - - b.ToView("uvwMerchantBalanceHistory", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20250221134619_move_over_projection_states.cs b/TransactionProcessor.Database/Migrations/MySql/20250221134619_move_over_projection_states.cs deleted file mode 100644 index 86a2aad6..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20250221134619_move_over_projection_states.cs +++ /dev/null @@ -1,332 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace TransactionProcessor.Database.Migrations.MySql -{ - /// - public partial class move_over_projection_states : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "voucher"); - - migrationBuilder.CreateTable( - name: "Events", - columns: table => new - { - EventId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - Type = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Date = table.Column(type: "date", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Events", x => new { x.EventId, x.Type }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "MerchantBalanceChangedEntry", - columns: table => new - { - AggregateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - OriginalEventId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - CauseOfChangeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - ChangeAmount = table.Column(type: "decimal(65,30)", nullable: false), - DateTime = table.Column(type: "datetime(6)", nullable: false), - DebitOrCredit = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - Reference = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_MerchantBalanceChangedEntry", x => new { x.AggregateId, x.OriginalEventId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "MerchantBalanceProjectionState", - columns: table => new - { - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - MerchantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - Timestamp = table.Column(type: "timestamp(6)", rowVersion: true, nullable: false), - MerchantName = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - AvailableBalance = table.Column(type: "decimal(65,30)", nullable: false), - Balance = table.Column(type: "decimal(65,30)", nullable: false), - DepositCount = table.Column(type: "int", nullable: false), - WithdrawalCount = table.Column(type: "int", nullable: false), - TotalDeposited = table.Column(type: "decimal(65,30)", nullable: false), - TotalWithdrawn = table.Column(type: "decimal(65,30)", nullable: false), - SaleCount = table.Column(type: "int", nullable: false), - AuthorisedSales = table.Column(type: "decimal(65,30)", nullable: false), - DeclinedSales = table.Column(type: "decimal(65,30)", nullable: false), - FeeCount = table.Column(type: "int", nullable: false), - ValueOfFees = table.Column(type: "decimal(65,30)", nullable: false), - LastDeposit = table.Column(type: "datetime(6)", nullable: false), - LastWithdrawal = table.Column(type: "datetime(6)", nullable: false), - LastSale = table.Column(type: "datetime(6)", nullable: false), - LastFee = table.Column(type: "datetime(6)", nullable: false), - StartedTransactionCount = table.Column(type: "int", nullable: false), - CompletedTransactionCount = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_MerchantBalanceProjectionState", x => new { x.EstateId, x.MerchantId }); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "SettlementSummary", - columns: table => new - { - IsCompleted = table.Column(type: "tinyint(1)", nullable: false), - IsSettled = table.Column(type: "tinyint(1)", nullable: false), - SettlementDate = table.Column(type: "date", nullable: false), - MerchantReportingId = table.Column(type: "int", nullable: false), - OperatorReportingId = table.Column(type: "int", nullable: false), - ContractProductReportingId = table.Column(type: "int", nullable: false), - SalesValue = table.Column(type: "decimal(65,30)", nullable: true), - FeeValue = table.Column(type: "decimal(65,30)", nullable: true), - SalesCount = table.Column(type: "int", nullable: true), - FeeCount = table.Column(type: "int", nullable: true) - }, - constraints: table => - { - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "TodayTransactions", - columns: table => new - { - MerchantReportingId = table.Column(type: "int", nullable: false), - ContractProductReportingId = table.Column(type: "int", nullable: false), - ContractReportingId = table.Column(type: "int", nullable: false), - OperatorReportingId = table.Column(type: "int", nullable: false), - TransactionId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - AuthorisationCode = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - DeviceIdentifier = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - IsAuthorised = table.Column(type: "tinyint(1)", nullable: false), - IsCompleted = table.Column(type: "tinyint(1)", nullable: false), - ResponseCode = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ResponseMessage = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - TransactionDate = table.Column(type: "date", nullable: false), - TransactionDateTime = table.Column(type: "datetime(6)", nullable: false), - TransactionNumber = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - TransactionReference = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - TransactionTime = table.Column(type: "time(6)", nullable: false), - TransactionSource = table.Column(type: "int", nullable: false), - TransactionType = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - TransactionReportingId = table.Column(type: "int", nullable: false), - TransactionAmount = table.Column(type: "decimal(65,30)", nullable: false), - Hour = table.Column(type: "int", nullable: true) - }, - constraints: table => - { - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "TransactionHistory", - columns: table => new - { - MerchantReportingId = table.Column(type: "int", nullable: false), - ContractProductReportingId = table.Column(type: "int", nullable: false), - ContractReportingId = table.Column(type: "int", nullable: false), - OperatorReportingId = table.Column(type: "int", nullable: false), - TransactionId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - AuthorisationCode = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - DeviceIdentifier = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - IsAuthorised = table.Column(type: "tinyint(1)", nullable: false), - IsCompleted = table.Column(type: "tinyint(1)", nullable: false), - ResponseCode = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ResponseMessage = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - TransactionDate = table.Column(type: "date", nullable: false), - TransactionDateTime = table.Column(type: "datetime(6)", nullable: false), - TransactionNumber = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - TransactionReference = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - TransactionTime = table.Column(type: "time(6)", nullable: false), - TransactionSource = table.Column(type: "int", nullable: false), - TransactionType = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - TransactionReportingId = table.Column(type: "int", nullable: false), - TransactionAmount = table.Column(type: "decimal(65,30)", nullable: false), - Hour = table.Column(type: "int", nullable: true) - }, - constraints: table => - { - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "voucherprojectionstate", - columns: table => new - { - VoucherId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - ExpiryDate = table.Column(type: "date", nullable: false), - ExpiryDateTime = table.Column(type: "datetime(6)", nullable: false), - IsGenerated = table.Column(type: "tinyint(1)", nullable: false), - IsIssued = table.Column(type: "tinyint(1)", nullable: false), - IsRedeemed = table.Column(type: "tinyint(1)", nullable: false), - OperatorIdentifier = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - RecipientEmail = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - RecipientMobile = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Value = table.Column(type: "decimal(65,30)", nullable: false), - VoucherCode = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - EstateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - TransactionId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - GenerateDateTime = table.Column(type: "datetime(6)", nullable: false), - IssuedDateTime = table.Column(type: "datetime(6)", nullable: false), - RedeemedDateTime = table.Column(type: "datetime(6)", nullable: false), - GenerateDate = table.Column(type: "date", nullable: false), - IssuedDate = table.Column(type: "date", nullable: false), - RedeemedDate = table.Column(type: "datetime(6)", nullable: false), - Timestamp = table.Column(type: "timestamp(6)", rowVersion: true, nullable: false), - Barcode = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_voucherprojectionstate", x => x.VoucherId); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_SettlementSummary_SettlementDate", - table: "SettlementSummary", - column: "SettlementDate"); - - migrationBuilder.CreateIndex( - name: "IX_SettlementSummary_SettlementDate_MerchantReportingId_Operato~", - table: "SettlementSummary", - columns: new[] { "SettlementDate", "MerchantReportingId", "OperatorReportingId", "ContractProductReportingId", "IsCompleted", "IsSettled" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_TodayTransactions_TransactionDate", - table: "TodayTransactions", - column: "TransactionDate"); - - migrationBuilder.CreateIndex( - name: "IX_TodayTransactions_TransactionId", - table: "TodayTransactions", - column: "TransactionId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_TransactionHistory_TransactionDate", - table: "TransactionHistory", - column: "TransactionDate"); - - migrationBuilder.CreateIndex( - name: "IX_TransactionHistory_TransactionId", - table: "TransactionHistory", - column: "TransactionId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_voucherprojectionstate_TransactionId", - table: "voucherprojectionstate", - column: "TransactionId"); - - migrationBuilder.CreateIndex( - name: "IX_voucherprojectionstate_VoucherCode", - table: "voucherprojectionstate", - column: "VoucherCode"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Events"); - - migrationBuilder.DropTable( - name: "MerchantBalanceChangedEntry"); - - migrationBuilder.DropTable( - name: "MerchantBalanceProjectionState"); - - migrationBuilder.DropTable( - name: "SettlementSummary"); - - migrationBuilder.DropTable( - name: "TodayTransactions"); - - migrationBuilder.DropTable( - name: "TransactionHistory"); - - migrationBuilder.DropTable( - name: "voucherprojectionstate"); - - migrationBuilder.CreateTable( - name: "voucher", - columns: table => new - { - VoucherId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - ExpiryDate = table.Column(type: "date", nullable: false), - ExpiryDateTime = table.Column(type: "datetime(6)", nullable: false), - GenerateDate = table.Column(type: "date", nullable: false), - GenerateDateTime = table.Column(type: "datetime(6)", nullable: false), - IsGenerated = table.Column(type: "tinyint(1)", nullable: false), - IsIssued = table.Column(type: "tinyint(1)", nullable: false), - IsRedeemed = table.Column(type: "tinyint(1)", nullable: false), - IssuedDate = table.Column(type: "date", nullable: false), - IssuedDateTime = table.Column(type: "datetime(6)", nullable: false), - OperatorIdentifier = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - RecipientEmail = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - RecipientMobile = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - RedeemedDate = table.Column(type: "datetime(6)", nullable: false), - RedeemedDateTime = table.Column(type: "datetime(6)", nullable: false), - TransactionId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - Value = table.Column(type: "decimal(65,30)", nullable: false), - VoucherCode = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_voucher", x => x.VoucherId); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_voucher_TransactionId", - table: "voucher", - column: "TransactionId"); - - migrationBuilder.CreateIndex( - name: "IX_voucher_VoucherCode", - table: "voucher", - column: "VoucherCode"); - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20250505085317_LoadTransactionTimings.Designer.cs b/TransactionProcessor.Database/Migrations/MySql/20250505085317_LoadTransactionTimings.Designer.cs deleted file mode 100644 index 4fb0b21d..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20250505085317_LoadTransactionTimings.Designer.cs +++ /dev/null @@ -1,1504 +0,0 @@ -// -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.MySql -{ - [DbContext(typeof(EstateManagementMySqlContext))] - [Migration("20250505085317_LoadTransactionTimings")] - partial class LoadTransactionTimings - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.14") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Calendar", b => - { - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DayOfWeekNumber") - .HasColumnType("int"); - - b.Property("DayOfWeekShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameLong") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("WeekNumberString") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Year") - .HasColumnType("int"); - - b.Property("YearWeekNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Date"); - - b.ToTable("calendar"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Contract", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ContractReportingId")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateId", "OperatorId", "ContractId"); - - b.ToTable("contract"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.ContractProduct", b => - { - b.Property("ContractProductReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ContractProductReportingId")); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractProductId") - .HasColumnType("char(36)"); - - b.Property("DisplayText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductType") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.HasKey("ContractProductReportingId"); - - b.HasIndex("ContractProductId", "ContractId") - .IsUnique(); - - b.ToTable("contractproduct"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.ContractProductTransactionFee", b => - { - b.Property("ContractProductTransactionFeeReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ContractProductTransactionFeeReportingId")); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("ContractProductId") - .HasColumnType("char(36)"); - - b.Property("ContractProductTransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - 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"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("EstateReportingId")); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId"); - - b.HasIndex("EstateId") - .IsUnique(); - - b.ToTable("estate"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.EstateSecurityUser", b => - { - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("SecurityUserId", "EstateId"); - - b.ToTable("estatesecurityuser"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.File", b => - { - b.Property("FileReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("FileReportingId")); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDate") - .HasColumnType("date"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileReportingId"); - - b.HasIndex("FileId") - .IsUnique(); - - b.ToTable("file"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.FileImportLog", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("FileImportLogReportingId")); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDate") - .HasColumnType("date"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateId", "FileImportLogReportingId"); - - b.HasIndex("EstateId", "FileImportLogId") - .IsUnique(); - - b.ToTable("fileimportlog"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.FileImportLogFile", b => - { - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileUploadedDate") - .HasColumnType("date"); - - b.Property("FileUploadedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OriginalFileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileImportLogId", "FileId"); - - b.ToTable("fileimportlogfile"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.FileLine", b => - { - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("LineNumber") - .HasColumnType("int"); - - b.Property("FileLineData") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.HasKey("FileId", "LineNumber") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("fileline"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Float", b => - { - b.Property("FloatId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("CreatedDate") - .HasColumnType("date"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.HasKey("FloatId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("CreatedDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("Floats"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.FloatActivity", b => - { - b.Property("EventId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CostPrice") - .HasColumnType("decimal(65,30)"); - - b.Property("CreditOrDebit") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloatId") - .HasColumnType("char(36)"); - - b.HasKey("EventId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("ActivityDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("FloatActivity"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Merchant", b => - { - b.Property("MerchantReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("MerchantReportingId")); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("LastSaleDate") - .HasColumnType("date"); - - b.Property("LastSaleDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastStatementGenerated") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - 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("char(36)"); - - b.Property("AddressId") - .HasColumnType("char(36)"); - - b.Property("AddressLine1") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AddressLine2") - .HasColumnType("longtext"); - - b.Property("AddressLine3") - .HasColumnType("longtext"); - - b.Property("AddressLine4") - .HasColumnType("longtext"); - - b.Property("Country") - .HasColumnType("longtext"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("PostalCode") - .HasColumnType("longtext"); - - b.Property("Region") - .HasColumnType("longtext"); - - b.Property("Town") - .HasColumnType("longtext"); - - b.HasKey("MerchantId", "AddressId"); - - b.ToTable("merchantaddress"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantContact", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("ContactId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantId", "ContactId"); - - b.ToTable("merchantcontact"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantContract", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("IsDeleted") - .HasColumnType("tinyint(1)"); - - b.HasKey("MerchantId", "ContractId"); - - b.ToTable("MerchantContracts"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantDevice", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("DeviceId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantId", "DeviceId"); - - b.ToTable("merchantdevice"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantOperator", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("IsDeleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantNumber") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TerminalNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantId", "OperatorId"); - - b.ToTable("merchantoperator"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantSecurityUser", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantId", "SecurityUserId"); - - b.ToTable("merchantsecurityuser"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantSettlementFee", b => - { - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("ContractProductTransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("FeeCalculatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementId", "TransactionId", "ContractProductTransactionFeeId"); - - b.ToTable("merchantsettlementfee"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Operator", b => - { - b.Property("OperatorReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("OperatorReportingId")); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("RequireCustomMerchantNumber") - .HasColumnType("tinyint(1)"); - - b.Property("RequireCustomTerminalNumber") - .HasColumnType("tinyint(1)"); - - b.HasKey("OperatorReportingId"); - - b.HasIndex("OperatorId") - .IsUnique(); - - b.ToTable("operator"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Reconciliation", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionReportingId")); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionCount") - .HasColumnType("int"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("reconciliation"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.ResponseCodes", b => - { - b.Property("ResponseCode") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ResponseCode")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ResponseCode"); - - b.ToTable("responsecodes"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Settlement", b => - { - b.Property("SettlementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("SettlementReportingId")); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("ProcessingStarted") - .HasColumnType("tinyint(1)"); - - b.Property("ProcessingStartedDateTIme") - .HasColumnType("datetime(6)"); - - b.Property("SettlementDate") - .HasColumnType("date"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("SettlementDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("EstateId", "SettlementId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("settlement"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.StatementHeader", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("StatementCreatedDate") - .HasColumnType("date"); - - b.Property("StatementCreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementGeneratedDate") - .HasColumnType("date"); - - b.Property("StatementGeneratedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("StatementReportingId")); - - b.HasKey("MerchantId", "StatementId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("StatementGeneratedDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("statementheader"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.StatementLine", b => - { - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ActivityType") - .HasColumnType("int"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDescription") - .HasColumnType("longtext"); - - b.Property("InAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("OutAmount") - .HasColumnType("decimal(65,30)"); - - 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(65,30)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorReportingId") - .HasColumnType("int"); - - b.Property("SalesCount") - .HasColumnType("int"); - - b.Property("SalesValue") - .HasColumnType("decimal(65,30)"); - - b.Property("SettlementDate") - .HasColumnType("date"); - - b.HasIndex("SettlementDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("SettlementDate", "MerchantReportingId", "OperatorReportingId", "ContractProductReportingId", "IsCompleted", "IsSettled") - .IsUnique(); - - b.ToTable("SettlementSummary"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Summary.TodayTransaction", b => - { - b.Property("AuthorisationCode") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Hour") - .HasColumnType("int"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .IsRequired() - .HasColumnType("longtext"); - - b.HasIndex("TransactionDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId") - .IsUnique(); - - b.ToTable("TodayTransactions"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Summary.TransactionHistory", b => - { - b.Property("AuthorisationCode") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Hour") - .HasColumnType("int"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .IsRequired() - .HasColumnType("longtext"); - - b.HasIndex("TransactionDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId") - .IsUnique(); - - b.ToTable("TransactionHistory"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Transaction", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionReportingId")); - - b.Property("AuthorisationCode") - .HasColumnType("longtext"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractProductId") - .HasColumnType("char(36)"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .HasColumnType("longtext"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("transaction"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.TransactionAdditionalRequestData", b => - { - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("Amount") - .HasColumnType("longtext"); - - b.Property("CustomerAccountNumber") - .HasColumnType("longtext"); - - b.HasKey("TransactionId"); - - b.ToTable("transactionadditionalrequestdata"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.TransactionAdditionalResponseData", b => - { - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("TransactionId"); - - b.ToTable("transactionadditionalresponsedata"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.TransactionTimings", b => - { - b.Property("TransactionId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("OperatorCommunicationsCompletedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorCommunicationsDurationInMilliseconds") - .HasColumnType("double"); - - b.Property("OperatorCommunicationsStartedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TotalTransactionInMilliseconds") - .HasColumnType("double"); - - b.Property("TransactionCompletedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionProcessingDurationInMilliseconds") - .HasColumnType("double"); - - b.Property("TransactionStartedDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("TransactionId") - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("transactiontimings"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.VoucherProjectionState", b => - { - b.Property("VoucherId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Barcode") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ExpiryDate") - .HasColumnType("date"); - - b.Property("ExpiryDateTime") - .HasColumnType("datetime(6)"); - - b.Property("GenerateDate") - .HasColumnType("date"); - - b.Property("GenerateDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsGenerated") - .HasColumnType("tinyint(1)"); - - b.Property("IsIssued") - .HasColumnType("tinyint(1)"); - - b.Property("IsRedeemed") - .HasColumnType("tinyint(1)"); - - b.Property("IssuedDate") - .HasColumnType("date"); - - b.Property("IssuedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorIdentifier") - .HasColumnType("longtext"); - - b.Property("RecipientEmail") - .HasColumnType("longtext"); - - b.Property("RecipientMobile") - .HasColumnType("longtext"); - - b.Property("RedeemedDate") - .HasColumnType("datetime(6)"); - - b.Property("RedeemedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("Timestamp") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("timestamp(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.Property("VoucherCode") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("VoucherId"); - - b.HasIndex("TransactionId"); - - b.HasIndex("VoucherCode"); - - b.ToTable("voucherprojectionstate"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.ViewEntities.SettlementView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FeeDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable((string)null); - - b.ToView("uvwSettlements", (string)null); - }); - - modelBuilder.Entity("TransactionProcessor.ProjectionEngine.Database.Database.Entities.Event", b => - { - b.Property("EventId") - .HasColumnType("char(36)"); - - b.Property("Type") - .HasColumnType("varchar(255)"); - - b.Property("Date") - .HasColumnType("date"); - - b.HasKey("EventId", "Type") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("Events"); - }); - - modelBuilder.Entity("TransactionProcessor.ProjectionEngine.Database.Database.Entities.MerchantBalanceChangedEntry", b => - { - b.Property("AggregateId") - .HasColumnType("char(36)"); - - b.Property("OriginalEventId") - .HasColumnType("char(36)"); - - b.Property("CauseOfChangeId") - .HasColumnType("char(36)"); - - b.Property("ChangeAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("DateTime") - .HasColumnType("datetime(6)"); - - b.Property("DebitOrCredit") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Reference") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("AggregateId", "OriginalEventId"); - - b.ToTable("MerchantBalanceChangedEntry"); - }); - - modelBuilder.Entity("TransactionProcessor.ProjectionEngine.Database.Database.Entities.MerchantBalanceProjectionState", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("AuthorisedSales") - .HasColumnType("decimal(65,30)"); - - b.Property("AvailableBalance") - .HasColumnType("decimal(65,30)"); - - b.Property("Balance") - .HasColumnType("decimal(65,30)"); - - b.Property("CompletedTransactionCount") - .HasColumnType("int"); - - b.Property("DeclinedSales") - .HasColumnType("decimal(65,30)"); - - b.Property("DepositCount") - .HasColumnType("int"); - - b.Property("FeeCount") - .HasColumnType("int"); - - b.Property("LastDeposit") - .HasColumnType("datetime(6)"); - - b.Property("LastFee") - .HasColumnType("datetime(6)"); - - b.Property("LastSale") - .HasColumnType("datetime(6)"); - - b.Property("LastWithdrawal") - .HasColumnType("datetime(6)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SaleCount") - .HasColumnType("int"); - - b.Property("StartedTransactionCount") - .HasColumnType("int"); - - b.Property("Timestamp") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("timestamp(6)"); - - b.Property("TotalDeposited") - .HasColumnType("decimal(65,30)"); - - b.Property("TotalWithdrawn") - .HasColumnType("decimal(65,30)"); - - b.Property("ValueOfFees") - .HasColumnType("decimal(65,30)"); - - b.Property("WithdrawalCount") - .HasColumnType("int"); - - b.HasKey("EstateId", "MerchantId"); - - b.ToTable("MerchantBalanceProjectionState"); - }); - - modelBuilder.Entity("TransactionProcessor.ProjectionEngine.Database.Database.ViewEntities.MerchantBalanceHistoryViewEntry", b => - { - b.Property("Balance") - .HasColumnType("decimal(65,30)"); - - b.Property("ChangeAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("DebitOrCredit") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EntryDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OriginalEventId") - .HasColumnType("char(36)"); - - b.Property("Reference") - .IsRequired() - .HasColumnType("longtext"); - - b.ToTable((string)null); - - b.ToView("uvwMerchantBalanceHistory", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/20250505085317_LoadTransactionTimings.cs b/TransactionProcessor.Database/Migrations/MySql/20250505085317_LoadTransactionTimings.cs deleted file mode 100644 index 4dfc839c..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/20250505085317_LoadTransactionTimings.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace TransactionProcessor.Database.Migrations.MySql -{ - /// - public partial class LoadTransactionTimings : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "transactiontimings", - columns: table => new - { - TransactionId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - TransactionStartedDateTime = table.Column(type: "datetime(6)", nullable: false), - OperatorCommunicationsStartedDateTime = table.Column(type: "datetime(6)", nullable: true), - OperatorCommunicationsCompletedDateTime = table.Column(type: "datetime(6)", nullable: true), - TransactionCompletedDateTime = table.Column(type: "datetime(6)", nullable: false), - TotalTransactionInMilliseconds = table.Column(type: "double", nullable: false), - OperatorCommunicationsDurationInMilliseconds = table.Column(type: "double", nullable: false), - TransactionProcessingDurationInMilliseconds = table.Column(type: "double", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_transactiontimings", x => x.TransactionId); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "transactiontimings"); - } - } -} diff --git a/TransactionProcessor.Database/Migrations/MySql/EstateManagementMySqlContextModelSnapshot.cs b/TransactionProcessor.Database/Migrations/MySql/EstateManagementMySqlContextModelSnapshot.cs deleted file mode 100644 index f97e671c..00000000 --- a/TransactionProcessor.Database/Migrations/MySql/EstateManagementMySqlContextModelSnapshot.cs +++ /dev/null @@ -1,1501 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using TransactionProcessor.Database.Contexts; - -#nullable disable - -namespace EstateManagement.Database.Migrations.MySql -{ - [DbContext(typeof(EstateManagementMySqlContext))] - partial class EstateManagementMySqlContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.14") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Calendar", b => - { - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DayOfWeekNumber") - .HasColumnType("int"); - - b.Property("DayOfWeekShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameLong") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNameShort") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("WeekNumberString") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Year") - .HasColumnType("int"); - - b.Property("YearWeekNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Date"); - - b.ToTable("calendar"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Contract", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ContractReportingId")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("EstateId", "OperatorId", "ContractId"); - - b.ToTable("contract"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.ContractProduct", b => - { - b.Property("ContractProductReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ContractProductReportingId")); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractProductId") - .HasColumnType("char(36)"); - - b.Property("DisplayText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProductType") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.HasKey("ContractProductReportingId"); - - b.HasIndex("ContractProductId", "ContractId") - .IsUnique(); - - b.ToTable("contractproduct"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.ContractProductTransactionFee", b => - { - b.Property("ContractProductTransactionFeeReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ContractProductTransactionFeeReportingId")); - - b.Property("CalculationType") - .HasColumnType("int"); - - b.Property("ContractProductId") - .HasColumnType("char(36)"); - - b.Property("ContractProductTransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeeType") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - 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"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("EstateReportingId")); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - b.HasKey("EstateReportingId"); - - b.HasIndex("EstateId") - .IsUnique(); - - b.ToTable("estate"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.EstateSecurityUser", b => - { - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("SecurityUserId", "EstateId"); - - b.ToTable("estatesecurityuser"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.File", b => - { - b.Property("FileReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("FileReportingId")); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileReceivedDate") - .HasColumnType("date"); - - b.Property("FileReceivedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileReportingId"); - - b.HasIndex("FileId") - .IsUnique(); - - b.ToTable("file"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.FileImportLog", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FileImportLogReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("FileImportLogReportingId")); - - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("ImportLogDate") - .HasColumnType("date"); - - b.Property("ImportLogDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("EstateId", "FileImportLogReportingId"); - - b.HasIndex("EstateId", "FileImportLogId") - .IsUnique(); - - b.ToTable("fileimportlog"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.FileImportLogFile", b => - { - b.Property("FileImportLogId") - .HasColumnType("char(36)"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileProfileId") - .HasColumnType("char(36)"); - - b.Property("FileUploadedDate") - .HasColumnType("date"); - - b.Property("FileUploadedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OriginalFileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("char(36)"); - - b.HasKey("FileImportLogId", "FileId"); - - b.ToTable("fileimportlogfile"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.FileLine", b => - { - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("LineNumber") - .HasColumnType("int"); - - b.Property("FileLineData") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.HasKey("FileId", "LineNumber") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("fileline"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Float", b => - { - b.Property("FloatId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("CreatedDate") - .HasColumnType("date"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ProductId") - .HasColumnType("char(36)"); - - b.HasKey("FloatId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("CreatedDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("Floats"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.FloatActivity", b => - { - b.Property("EventId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CostPrice") - .HasColumnType("decimal(65,30)"); - - b.Property("CreditOrDebit") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloatId") - .HasColumnType("char(36)"); - - b.HasKey("EventId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("ActivityDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("FloatActivity"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Merchant", b => - { - b.Property("MerchantReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("MerchantReportingId")); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("LastSaleDate") - .HasColumnType("date"); - - b.Property("LastSaleDateTime") - .HasColumnType("datetime(6)"); - - b.Property("LastStatementGenerated") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Reference") - .HasColumnType("longtext"); - - 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("char(36)"); - - b.Property("AddressId") - .HasColumnType("char(36)"); - - b.Property("AddressLine1") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AddressLine2") - .HasColumnType("longtext"); - - b.Property("AddressLine3") - .HasColumnType("longtext"); - - b.Property("AddressLine4") - .HasColumnType("longtext"); - - b.Property("Country") - .HasColumnType("longtext"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("PostalCode") - .HasColumnType("longtext"); - - b.Property("Region") - .HasColumnType("longtext"); - - b.Property("Town") - .HasColumnType("longtext"); - - b.HasKey("MerchantId", "AddressId"); - - b.ToTable("merchantaddress"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantContact", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("ContactId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantId", "ContactId"); - - b.ToTable("merchantcontact"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantContract", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("IsDeleted") - .HasColumnType("tinyint(1)"); - - b.HasKey("MerchantId", "ContractId"); - - b.ToTable("MerchantContracts"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantDevice", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("DeviceId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantId", "DeviceId"); - - b.ToTable("merchantdevice"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantOperator", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("IsDeleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantNumber") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TerminalNumber") - .HasColumnType("longtext"); - - b.HasKey("MerchantId", "OperatorId"); - - b.ToTable("merchantoperator"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantSecurityUser", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("SecurityUserId") - .HasColumnType("char(36)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("EmailAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("MerchantId", "SecurityUserId"); - - b.ToTable("merchantsecurityuser"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.MerchantSettlementFee", b => - { - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("ContractProductTransactionFeeId") - .HasColumnType("char(36)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("FeeCalculatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("FeeValue") - .HasColumnType("decimal(65,30)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementId", "TransactionId", "ContractProductTransactionFeeId"); - - b.ToTable("merchantsettlementfee"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Operator", b => - { - b.Property("OperatorReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("OperatorReportingId")); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("RequireCustomMerchantNumber") - .HasColumnType("tinyint(1)"); - - b.Property("RequireCustomTerminalNumber") - .HasColumnType("tinyint(1)"); - - b.HasKey("OperatorReportingId"); - - b.HasIndex("OperatorId") - .IsUnique(); - - b.ToTable("operator"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Reconciliation", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionReportingId")); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionCount") - .HasColumnType("int"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionValue") - .HasColumnType("decimal(65,30)"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId", "MerchantId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("reconciliation"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.ResponseCodes", b => - { - b.Property("ResponseCode") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ResponseCode")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ResponseCode"); - - b.ToTable("responsecodes"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Settlement", b => - { - b.Property("SettlementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("SettlementReportingId")); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("ProcessingStarted") - .HasColumnType("tinyint(1)"); - - b.Property("ProcessingStartedDateTIme") - .HasColumnType("datetime(6)"); - - b.Property("SettlementDate") - .HasColumnType("date"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.HasKey("SettlementReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("SettlementDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("EstateId", "SettlementId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("settlement"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.StatementHeader", b => - { - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("StatementCreatedDate") - .HasColumnType("date"); - - b.Property("StatementCreatedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementGeneratedDate") - .HasColumnType("date"); - - b.Property("StatementGeneratedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("StatementReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("StatementReportingId")); - - b.HasKey("MerchantId", "StatementId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("StatementGeneratedDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("statementheader"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.StatementLine", b => - { - b.Property("StatementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("ActivityDateTime") - .HasColumnType("datetime(6)"); - - b.Property("ActivityType") - .HasColumnType("int"); - - b.Property("ActivityDate") - .HasColumnType("date"); - - b.Property("ActivityDescription") - .HasColumnType("longtext"); - - b.Property("InAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("OutAmount") - .HasColumnType("decimal(65,30)"); - - 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(65,30)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorReportingId") - .HasColumnType("int"); - - b.Property("SalesCount") - .HasColumnType("int"); - - b.Property("SalesValue") - .HasColumnType("decimal(65,30)"); - - b.Property("SettlementDate") - .HasColumnType("date"); - - b.HasIndex("SettlementDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("SettlementDate", "MerchantReportingId", "OperatorReportingId", "ContractProductReportingId", "IsCompleted", "IsSettled") - .IsUnique(); - - b.ToTable("SettlementSummary"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Summary.TodayTransaction", b => - { - b.Property("AuthorisationCode") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Hour") - .HasColumnType("int"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .IsRequired() - .HasColumnType("longtext"); - - b.HasIndex("TransactionDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId") - .IsUnique(); - - b.ToTable("TodayTransactions"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Summary.TransactionHistory", b => - { - b.Property("AuthorisationCode") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContractProductReportingId") - .HasColumnType("int"); - - b.Property("ContractReportingId") - .HasColumnType("int"); - - b.Property("DeviceIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Hour") - .HasColumnType("int"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantReportingId") - .HasColumnType("int"); - - b.Property("OperatorReportingId") - .HasColumnType("int"); - - b.Property("ResponseCode") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .IsRequired() - .HasColumnType("longtext"); - - b.HasIndex("TransactionDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId") - .IsUnique(); - - b.ToTable("TransactionHistory"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.Transaction", b => - { - b.Property("TransactionReportingId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("TransactionReportingId")); - - b.Property("AuthorisationCode") - .HasColumnType("longtext"); - - b.Property("ContractId") - .HasColumnType("char(36)"); - - b.Property("ContractProductId") - .HasColumnType("char(36)"); - - b.Property("DeviceIdentifier") - .HasColumnType("longtext"); - - b.Property("IsAuthorised") - .HasColumnType("tinyint(1)"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OperatorId") - .HasColumnType("char(36)"); - - b.Property("ResponseCode") - .HasColumnType("longtext"); - - b.Property("ResponseMessage") - .HasColumnType("longtext"); - - b.Property("TransactionAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("TransactionDate") - .HasColumnType("date"); - - b.Property("TransactionDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionNumber") - .HasColumnType("longtext"); - - b.Property("TransactionReference") - .HasColumnType("longtext"); - - b.Property("TransactionSource") - .HasColumnType("int"); - - b.Property("TransactionTime") - .HasColumnType("time(6)"); - - b.Property("TransactionType") - .HasColumnType("longtext"); - - b.HasKey("TransactionReportingId") - .HasAnnotation("SqlServer:Clustered", false); - - b.HasIndex("TransactionDate") - .HasAnnotation("SqlServer:Clustered", true); - - b.HasIndex("TransactionId") - .IsUnique() - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("transaction"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.TransactionAdditionalRequestData", b => - { - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("Amount") - .HasColumnType("longtext"); - - b.Property("CustomerAccountNumber") - .HasColumnType("longtext"); - - b.HasKey("TransactionId"); - - b.ToTable("transactionadditionalrequestdata"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.TransactionAdditionalResponseData", b => - { - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("TransactionReportingId") - .HasColumnType("int"); - - b.HasKey("TransactionId"); - - b.ToTable("transactionadditionalresponsedata"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.TransactionTimings", b => - { - b.Property("TransactionId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("OperatorCommunicationsCompletedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorCommunicationsDurationInMilliseconds") - .HasColumnType("double"); - - b.Property("OperatorCommunicationsStartedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TotalTransactionInMilliseconds") - .HasColumnType("double"); - - b.Property("TransactionCompletedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("TransactionProcessingDurationInMilliseconds") - .HasColumnType("double"); - - b.Property("TransactionStartedDateTime") - .HasColumnType("datetime(6)"); - - b.HasKey("TransactionId") - .HasAnnotation("SqlServer:Clustered", false); - - b.ToTable("transactiontimings"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.Entities.VoucherProjectionState", b => - { - b.Property("VoucherId") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Barcode") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("ExpiryDate") - .HasColumnType("date"); - - b.Property("ExpiryDateTime") - .HasColumnType("datetime(6)"); - - b.Property("GenerateDate") - .HasColumnType("date"); - - b.Property("GenerateDateTime") - .HasColumnType("datetime(6)"); - - b.Property("IsGenerated") - .HasColumnType("tinyint(1)"); - - b.Property("IsIssued") - .HasColumnType("tinyint(1)"); - - b.Property("IsRedeemed") - .HasColumnType("tinyint(1)"); - - b.Property("IssuedDate") - .HasColumnType("date"); - - b.Property("IssuedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("OperatorIdentifier") - .HasColumnType("longtext"); - - b.Property("RecipientEmail") - .HasColumnType("longtext"); - - b.Property("RecipientMobile") - .HasColumnType("longtext"); - - b.Property("RedeemedDate") - .HasColumnType("datetime(6)"); - - b.Property("RedeemedDateTime") - .HasColumnType("datetime(6)"); - - b.Property("Timestamp") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("timestamp(6)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("Value") - .HasColumnType("decimal(65,30)"); - - b.Property("VoucherCode") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("VoucherId"); - - b.HasIndex("TransactionId"); - - b.HasIndex("VoucherCode"); - - b.ToTable("voucherprojectionstate"); - }); - - modelBuilder.Entity("TransactionProcessor.Database.ViewEntities.SettlementView", b => - { - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("CalculatedValue") - .HasColumnType("decimal(65,30)"); - - b.Property("DayOfWeek") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("FeeDescription") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsCompleted") - .HasColumnType("tinyint(1)"); - - b.Property("IsSettled") - .HasColumnType("tinyint(1)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Month") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MonthNumber") - .HasColumnType("int"); - - b.Property("OperatorIdentifier") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SettlementDate") - .HasColumnType("datetime(6)"); - - b.Property("SettlementId") - .HasColumnType("char(36)"); - - b.Property("TransactionId") - .HasColumnType("char(36)"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("YearNumber") - .HasColumnType("int"); - - b.ToTable((string)null); - - b.ToView("uvwSettlements", (string)null); - }); - - modelBuilder.Entity("TransactionProcessor.ProjectionEngine.Database.Database.Entities.Event", b => - { - b.Property("EventId") - .HasColumnType("char(36)"); - - b.Property("Type") - .HasColumnType("varchar(255)"); - - b.Property("Date") - .HasColumnType("date"); - - b.HasKey("EventId", "Type") - .HasAnnotation("SqlServer:Clustered", true); - - b.ToTable("Events"); - }); - - modelBuilder.Entity("TransactionProcessor.ProjectionEngine.Database.Database.Entities.MerchantBalanceChangedEntry", b => - { - b.Property("AggregateId") - .HasColumnType("char(36)"); - - b.Property("OriginalEventId") - .HasColumnType("char(36)"); - - b.Property("CauseOfChangeId") - .HasColumnType("char(36)"); - - b.Property("ChangeAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("DateTime") - .HasColumnType("datetime(6)"); - - b.Property("DebitOrCredit") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("Reference") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("AggregateId", "OriginalEventId"); - - b.ToTable("MerchantBalanceChangedEntry"); - }); - - modelBuilder.Entity("TransactionProcessor.ProjectionEngine.Database.Database.Entities.MerchantBalanceProjectionState", b => - { - b.Property("EstateId") - .HasColumnType("char(36)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("AuthorisedSales") - .HasColumnType("decimal(65,30)"); - - b.Property("AvailableBalance") - .HasColumnType("decimal(65,30)"); - - b.Property("Balance") - .HasColumnType("decimal(65,30)"); - - b.Property("CompletedTransactionCount") - .HasColumnType("int"); - - b.Property("DeclinedSales") - .HasColumnType("decimal(65,30)"); - - b.Property("DepositCount") - .HasColumnType("int"); - - b.Property("FeeCount") - .HasColumnType("int"); - - b.Property("LastDeposit") - .HasColumnType("datetime(6)"); - - b.Property("LastFee") - .HasColumnType("datetime(6)"); - - b.Property("LastSale") - .HasColumnType("datetime(6)"); - - b.Property("LastWithdrawal") - .HasColumnType("datetime(6)"); - - b.Property("MerchantName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("SaleCount") - .HasColumnType("int"); - - b.Property("StartedTransactionCount") - .HasColumnType("int"); - - b.Property("Timestamp") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("timestamp(6)"); - - b.Property("TotalDeposited") - .HasColumnType("decimal(65,30)"); - - b.Property("TotalWithdrawn") - .HasColumnType("decimal(65,30)"); - - b.Property("ValueOfFees") - .HasColumnType("decimal(65,30)"); - - b.Property("WithdrawalCount") - .HasColumnType("int"); - - b.HasKey("EstateId", "MerchantId"); - - b.ToTable("MerchantBalanceProjectionState"); - }); - - modelBuilder.Entity("TransactionProcessor.ProjectionEngine.Database.Database.ViewEntities.MerchantBalanceHistoryViewEntry", b => - { - b.Property("Balance") - .HasColumnType("decimal(65,30)"); - - b.Property("ChangeAmount") - .HasColumnType("decimal(65,30)"); - - b.Property("DebitOrCredit") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EntryDateTime") - .HasColumnType("datetime(6)"); - - b.Property("MerchantId") - .HasColumnType("char(36)"); - - b.Property("OriginalEventId") - .HasColumnType("char(36)"); - - b.Property("Reference") - .IsRequired() - .HasColumnType("longtext"); - - b.ToTable((string)null); - - b.ToView("uvwMerchantBalanceHistory", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20221115191516_InitialDatabase.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20221115191516_InitialDatabase.Designer.cs index 31402949..9b89fc3c 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20221115191516_InitialDatabase.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20221115191516_InitialDatabase.Designer.cs @@ -9,7 +9,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20221115191516_InitialDatabase")] partial class InitialDatabase { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20221116081939_somenullfixes.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20221116081939_somenullfixes.Designer.cs index 4872005f..bcea60e6 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20221116081939_somenullfixes.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20221116081939_somenullfixes.Designer.cs @@ -9,7 +9,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20221116081939_somenullfixes")] partial class somenullfixes { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20230116113030_recordproducttype.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20230116113030_recordproducttype.Designer.cs index b29e717f..55e5e0b6 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20230116113030_recordproducttype.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20230116113030_recordproducttype.Designer.cs @@ -9,7 +9,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20230116113030_recordproducttype")] partial class recordproducttype { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20230630113913_task384_datamodelrefactoring.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20230630113913_task384_datamodelrefactoring.Designer.cs index 35c66326..b46a32a7 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20230630113913_task384_datamodelrefactoring.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20230630113913_task384_datamodelrefactoring.Designer.cs @@ -9,7 +9,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20230630113913_task384_datamodelrefactoring")] partial class task384_datamodelrefactoring { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20230717125919_handleSettlementProcessingStartedEvent.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20230717125919_handleSettlementProcessingStartedEvent.Designer.cs index 5b4cd2a5..0b0df4a5 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20230717125919_handleSettlementProcessingStartedEvent.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20230717125919_handleSettlementProcessingStartedEvent.Designer.cs @@ -9,7 +9,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20230717125919_handleSettlementProcessingStartedEvent")] partial class handleSettlementProcessingStartedEvent { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20230717133118_merchantsettlementfee_missingindex.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20230717133118_merchantsettlementfee_missingindex.Designer.cs index 3635e1a2..7f41b077 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20230717133118_merchantsettlementfee_missingindex.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20230717133118_merchantsettlementfee_missingindex.Designer.cs @@ -9,7 +9,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20230717133118_merchantsettlementfee_missingindex")] partial class merchantsettlementfee_missingindex { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20230721142728_addmerchanttosettlementtable.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20230721142728_addmerchanttosettlementtable.Designer.cs index 9f0464d6..b7dac46b 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20230721142728_addmerchanttosettlementtable.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20230721142728_addmerchanttosettlementtable.Designer.cs @@ -9,7 +9,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20230721142728_addmerchanttosettlementtable")] partial class addmerchanttosettlementtable { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20230801201426_storelastsaleagainstmerchant.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20230801201426_storelastsaleagainstmerchant.Designer.cs index 5c9abbaf..d5f4ac1b 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20230801201426_storelastsaleagainstmerchant.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20230801201426_storelastsaleagainstmerchant.Designer.cs @@ -9,7 +9,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20230801201426_storelastsaleagainstmerchant")] partial class storelastsaleagainstmerchant { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20230905183930_amountintransaction.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20230905183930_amountintransaction.Designer.cs index 4adea019..e1ddc1ba 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20230905183930_amountintransaction.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20230905183930_amountintransaction.Designer.cs @@ -9,7 +9,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20230905183930_amountintransaction")] partial class amountintransaction { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20231115193804_recordestateoperatorreportingidwithtxn.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20231115193804_recordestateoperatorreportingidwithtxn.Designer.cs index 29f5f10a..fd98efc2 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20231115193804_recordestateoperatorreportingidwithtxn.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20231115193804_recordestateoperatorreportingidwithtxn.Designer.cs @@ -9,7 +9,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20231115193804_recordestateoperatorreportingidwithtxn")] partial class recordestateoperatorreportingidwithtxn { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20231228135707_addmerchantcontracttable.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20231228135707_addmerchantcontracttable.Designer.cs index 0e4db4e9..494c5703 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20231228135707_addmerchantcontracttable.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20231228135707_addmerchantcontracttable.Designer.cs @@ -9,7 +9,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20231228135707_addmerchantcontracttable")] partial class addmerchantcontracttable { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20240210074115_floattables.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20240210074115_floattables.Designer.cs index c5dbf308..7bfba943 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20240210074115_floattables.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20240210074115_floattables.Designer.cs @@ -9,7 +9,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20240210074115_floattables")] partial class floattables { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20240313170318_fixstatementheaderindex.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20240313170318_fixstatementheaderindex.Designer.cs index 1ec0a54e..14856e6c 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20240313170318_fixstatementheaderindex.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20240313170318_fixstatementheaderindex.Designer.cs @@ -9,7 +9,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20240313170318_fixstatementheaderindex")] partial class fixstatementheaderindex { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20240420162900_merchantupdates.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20240420162900_merchantupdates.Designer.cs index c6322cc2..589514ac 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20240420162900_merchantupdates.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20240420162900_merchantupdates.Designer.cs @@ -9,7 +9,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20240420162900_merchantupdates")] partial class merchantupdates { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20240425094035_record_operatators_at_readmodel.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20240425094035_record_operatators_at_readmodel.Designer.cs index 7a42d3a3..e7ea7185 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20240425094035_record_operatators_at_readmodel.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20240425094035_record_operatators_at_readmodel.Designer.cs @@ -9,7 +9,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20240425094035_record_operatators_at_readmodel")] partial class record_operatators_at_readmodel { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20240425132448_record_operatators_at_readmodel_1.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20240425132448_record_operatators_at_readmodel_1.Designer.cs index d95662cd..54b73f24 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20240425132448_record_operatators_at_readmodel_1.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20240425132448_record_operatators_at_readmodel_1.Designer.cs @@ -9,7 +9,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20240425132448_record_operatators_at_readmodel_1")] partial class record_operatators_at_readmodel_1 { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20240425163935_record_operatators_at_readmodel_2.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20240425163935_record_operatators_at_readmodel_2.Designer.cs index 379f69fa..c7d4e9d7 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20240425163935_record_operatators_at_readmodel_2.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20240425163935_record_operatators_at_readmodel_2.Designer.cs @@ -9,7 +9,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20240425163935_record_operatators_at_readmodel_2")] partial class record_operatators_at_readmodel_2 { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20240501154042_make_voucher_operatoridentifier_nullable.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20240501154042_make_voucher_operatoridentifier_nullable.Designer.cs index b00d7a7c..f59c3d3a 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20240501154042_make_voucher_operatoridentifier_nullable.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20240501154042_make_voucher_operatoridentifier_nullable.Designer.cs @@ -9,7 +9,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20240501154042_make_voucher_operatoridentifier_nullable")] partial class make_voucher_operatoridentifier_nullable { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20240605061637_remove_reportingids_from_transaction.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20240605061637_remove_reportingids_from_transaction.Designer.cs index 45caf2a8..c3bede21 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20240605061637_remove_reportingids_from_transaction.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20240605061637_remove_reportingids_from_transaction.Designer.cs @@ -9,7 +9,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20240605061637_remove_reportingids_from_transaction")] partial class remove_reportingids_from_transaction { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20240605133603_remove_reportingids_from_transaction_sp1.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20240605133603_remove_reportingids_from_transaction_sp1.Designer.cs index cb4c0e71..9fd018e5 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20240605133603_remove_reportingids_from_transaction_sp1.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20240605133603_remove_reportingids_from_transaction_sp1.Designer.cs @@ -9,7 +9,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20240605133603_remove_reportingids_from_transaction_sp1")] partial class remove_reportingids_from_transaction_sp1 { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20240607093059_summary_first_cut.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20240607093059_summary_first_cut.Designer.cs index 307386ae..2e72ebab 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20240607093059_summary_first_cut.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20240607093059_summary_first_cut.Designer.cs @@ -9,7 +9,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20240607093059_summary_first_cut")] partial class summary_first_cut { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20250221134206_move_over_projection_states.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20250221134206_move_over_projection_states.Designer.cs index 926526c7..8ed87791 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20250221134206_move_over_projection_states.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20250221134206_move_over_projection_states.Designer.cs @@ -11,7 +11,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20250221134206_move_over_projection_states")] partial class move_over_projection_states { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/20250505085213_LoadTransactionTimings.Designer.cs b/TransactionProcessor.Database/Migrations/SqlServer/20250505085213_LoadTransactionTimings.Designer.cs index c6e9d995..42492c6d 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/20250505085213_LoadTransactionTimings.Designer.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/20250505085213_LoadTransactionTimings.Designer.cs @@ -11,7 +11,7 @@ namespace TransactionProcessor.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] [Migration("20250505085213_LoadTransactionTimings")] partial class LoadTransactionTimings { diff --git a/TransactionProcessor.Database/Migrations/SqlServer/EstateManagementSqlServerContextModelSnapshot.cs b/TransactionProcessor.Database/Migrations/SqlServer/EstateManagementSqlServerContextModelSnapshot.cs index 53c6ae78..57287141 100644 --- a/TransactionProcessor.Database/Migrations/SqlServer/EstateManagementSqlServerContextModelSnapshot.cs +++ b/TransactionProcessor.Database/Migrations/SqlServer/EstateManagementSqlServerContextModelSnapshot.cs @@ -10,7 +10,7 @@ namespace EstateManagement.Database.Migrations.SqlServer { - [DbContext(typeof(EstateManagementSqlServerContext))] + [DbContext(typeof(EstateManagementContext))] partial class EstateManagementSqlServerContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) diff --git a/TransactionProcessor.Database/TransactionProcessor.Database.csproj b/TransactionProcessor.Database/TransactionProcessor.Database.csproj index 7506b3a9..8176a300 100644 --- a/TransactionProcessor.Database/TransactionProcessor.Database.csproj +++ b/TransactionProcessor.Database/TransactionProcessor.Database.csproj @@ -1,28 +1,28 @@  - net8.0 + net9.0 enable enable - None + Full - - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - + + + + + + + + @@ -41,12 +41,6 @@ Always - - Always - - - Always - Always @@ -56,7 +50,6 @@ - diff --git a/TransactionProcessor.Database/Views/MySql/Priority1/uvwMerchantBalanceHistory.View.sql b/TransactionProcessor.Database/Views/MySql/Priority1/uvwMerchantBalanceHistory.View.sql deleted file mode 100644 index 5b0525a3..00000000 --- a/TransactionProcessor.Database/Views/MySql/Priority1/uvwMerchantBalanceHistory.View.sql +++ /dev/null @@ -1,14 +0,0 @@ -CREATE OR REPLACE VIEW uvwMerchantBalanceHistory -AS -SELECT - OriginalEventId, - ChangeAmount, - DateTime as EntryDateTime, - Reference, - DebitOrCredit, - MerchantId, - SUM(CASE DebitOrCredit - WHEN 'D' THEN ChangeAmount * -1 - ELSE ChangeAmount - END) over (PARTITION BY MerchantId order by datetime,OriginalEventId) as Balance -FROM [MerchantBalanceChangedEntry] \ No newline at end of file diff --git a/TransactionProcessor.Database/Views/MySql/Priority1/uvwSettlements.View.sql b/TransactionProcessor.Database/Views/MySql/Priority1/uvwSettlements.View.sql deleted file mode 100644 index 06e36d51..00000000 --- a/TransactionProcessor.Database/Views/MySql/Priority1/uvwSettlements.View.sql +++ /dev/null @@ -1,29 +0,0 @@ -CREATE OR REPLACE VIEW uvwSettlements -AS -SELECT - s.SettlementId, - s.SettlementDate, - s.IsCompleted, - FORMAT(s.SettlementDate, 'dddd') as DayOfWeek, - DATEPART(wk, s.SettlementDate) as WeekNumber, - FORMAT(s.SettlementDate, 'MMMM') as Month, - DATEPART(MM, s.SettlementDate) as MonthNumber, - YEAR(s.SettlementDate) as YearNumber, - f.CalculatedValue, - t.TransactionId, - e.EstateId, - m.MerchantId, - m.Name as MerchantName, - cptf.Description as FeeDescription, - o.Name as OperatorIdentifier, - CAST(ISNULL(tar.Amount,0) as decimal) as Amount, - f.IsSettled -from settlement s -inner join merchantsettlementfee f on s.SettlementReportingId = f.SettlementReportingId -inner join [transaction] t on t.TransactionReportingId = f.TransactionReportingId -inner join [merchant] m on t.MerchantReportingId = m.MerchantReportingId -inner join [estate] e on e.EstateReportingId = m.EstateReportingId -left outer join contractproducttransactionfee cptf on f.TransactionFeeReportingId = cptf.TransactionFeeReportingId -left outer join transactionadditionalrequestdata tar on tar.TransactionReportingId = t.TransactionReportingId -inner join contract c on c.ContractReportingId = t.ContractReportingId -inner join operator o on o.OperatorId = c.operatorid diff --git a/TransactionProcessor.DomainEvents/TransactionProcessor.DomainEvents.csproj b/TransactionProcessor.DomainEvents/TransactionProcessor.DomainEvents.csproj index 14c19a38..7b98eba4 100644 --- a/TransactionProcessor.DomainEvents/TransactionProcessor.DomainEvents.csproj +++ b/TransactionProcessor.DomainEvents/TransactionProcessor.DomainEvents.csproj @@ -1,11 +1,11 @@  - net8.0 + net9.0 enable enable - + diff --git a/TransactionProcessor.Estate.DomainEvents/EstateDomainEvents.cs b/TransactionProcessor.Estate.DomainEvents/EstateDomainEvents.cs deleted file mode 100644 index d0ba830e..00000000 --- a/TransactionProcessor.Estate.DomainEvents/EstateDomainEvents.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Shared.DomainDrivenDesign.EventSourcing; -using System.Diagnostics.CodeAnalysis; - -namespace TransactionProcessor.Estate.DomainEvents{ - [ExcludeFromCodeCoverage] - public record EstateCreatedEvent(Guid EstateId, - String EstateName) : DomainEvent(EstateId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record EstateReferenceAllocatedEvent(Guid EstateId, String EstateReference) : DomainEvent(EstateId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record OperatorAddedToEstateEvent(Guid EstateId, - Guid OperatorId) : DomainEvent(EstateId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record OperatorRemovedFromEstateEvent(Guid EstateId, - Guid OperatorId) : DomainEvent(EstateId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record SecurityUserAddedToEstateEvent(Guid EstateId, - Guid SecurityUserId, - String EmailAddress) : DomainEvent(EstateId, Guid.NewGuid()); -} \ No newline at end of file diff --git a/TransactionProcessor.Estate.DomainEvents/TransactionProcessor.Estate.DomainEvents.csproj b/TransactionProcessor.Estate.DomainEvents/TransactionProcessor.Estate.DomainEvents.csproj deleted file mode 100644 index dab92493..00000000 --- a/TransactionProcessor.Estate.DomainEvents/TransactionProcessor.Estate.DomainEvents.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net8.0 - enable - enable - - - - - - - diff --git a/TransactionProcessor.Float.DomainEvents/FloatActivityAggregateDomainEvents.cs b/TransactionProcessor.Float.DomainEvents/FloatActivityAggregateDomainEvents.cs deleted file mode 100644 index fae17edc..00000000 --- a/TransactionProcessor.Float.DomainEvents/FloatActivityAggregateDomainEvents.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Shared.DomainDrivenDesign.EventSourcing; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace TransactionProcessor.Float.DomainEvents -{ - [ExcludeFromCodeCoverage] - public record FloatAggregateCreditedEvent(Guid FloatId, - Guid EstateId, - DateTime ActivityDateTime, - Decimal Amount, Guid CreditId) : DomainEvent(FloatId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record FloatAggregateDebitedEvent(Guid FloatId, - Guid EstateId, - DateTime ActivityDateTime, - Decimal Amount, Guid DebitId) : DomainEvent(FloatId, Guid.NewGuid()); -} diff --git a/TransactionProcessor.Float.DomainEvents/FloatAggregateDomainEvents.cs b/TransactionProcessor.Float.DomainEvents/FloatAggregateDomainEvents.cs deleted file mode 100644 index cbfb07de..00000000 --- a/TransactionProcessor.Float.DomainEvents/FloatAggregateDomainEvents.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace TransactionProcessor.Float.DomainEvents; - -using System.Diagnostics.CodeAnalysis; -using Shared.DomainDrivenDesign.EventSourcing; - -[ExcludeFromCodeCoverage] -public record FloatCreatedForContractProductEvent(Guid FloatId, - Guid EstateId, - Guid ContractId, - Guid ProductId, - DateTime CreatedDateTime) - : DomainEvent(FloatId, Guid.NewGuid()); - -[ExcludeFromCodeCoverage] -public record FloatCreditPurchasedEvent(Guid FloatId, - Guid EstateId, - DateTime CreditPurchasedDateTime, - Decimal Amount, - Decimal CostPrice) : DomainEvent(FloatId, Guid.NewGuid()); - -[ExcludeFromCodeCoverage] -public record FloatDecreasedByTransactionEvent(Guid FloatId, Guid EstateId, Guid TransactionId, Decimal Amount) : DomainEvent(FloatId, Guid.NewGuid()); \ No newline at end of file diff --git a/TransactionProcessor.Float.DomainEvents/TransactionProcessor.Float.DomainEvents.csproj b/TransactionProcessor.Float.DomainEvents/TransactionProcessor.Float.DomainEvents.csproj deleted file mode 100644 index 62d094f6..00000000 --- a/TransactionProcessor.Float.DomainEvents/TransactionProcessor.Float.DomainEvents.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net8.0 - enable - enable - - - - - - - diff --git a/TransactionProcessor.IntegrationTesting.Helpers/TransactionProcessor.IntegrationTesting.Helpers.csproj b/TransactionProcessor.IntegrationTesting.Helpers/TransactionProcessor.IntegrationTesting.Helpers.csproj index bd55f83e..f3d38a1d 100644 --- a/TransactionProcessor.IntegrationTesting.Helpers/TransactionProcessor.IntegrationTesting.Helpers.csproj +++ b/TransactionProcessor.IntegrationTesting.Helpers/TransactionProcessor.IntegrationTesting.Helpers.csproj @@ -1,16 +1,18 @@  - net8.0 + net9.0 enable enable - - - - + + + + + + diff --git a/TransactionProcessor.IntegrationTests/Common/DockerHelper.cs b/TransactionProcessor.IntegrationTests/Common/DockerHelper.cs index b44a0e2a..06b4f15c 100644 --- a/TransactionProcessor.IntegrationTests/Common/DockerHelper.cs +++ b/TransactionProcessor.IntegrationTests/Common/DockerHelper.cs @@ -109,6 +109,53 @@ public override async Task CreateSubscriptions(){ } } + public override ContainerBuilder SetupSecurityServiceContainer() + { + this.Trace("About to Start Security Container"); + + List environmentVariables = this.GetCommonEnvironmentVariables(); + environmentVariables.Add($"ServiceOptions:PublicOrigin=https://{this.SecurityServiceContainerName}:{DockerPorts.SecurityServiceDockerPort}"); + environmentVariables.Add($"ServiceOptions:IssuerUrl=https://{this.SecurityServiceContainerName}:{DockerPorts.SecurityServiceDockerPort}"); + //environmentVariables.Add("ASPNETCORE_ENVIRONMENT=IntegrationTest"); + environmentVariables.Add($"urls=https://*:{DockerPorts.SecurityServiceDockerPort}"); + + environmentVariables.Add("ServiceOptions:PasswordOptions:RequiredLength=6"); + environmentVariables.Add("ServiceOptions:PasswordOptions:RequireDigit=false"); + environmentVariables.Add("ServiceOptions:PasswordOptions:RequireUpperCase=false"); + environmentVariables.Add("ServiceOptions:UserOptions:RequireUniqueEmail=false"); + environmentVariables.Add("ServiceOptions:SignInOptions:RequireConfirmedEmail=false"); + + environmentVariables.Add(this.SetConnectionString("ConnectionStrings:PersistedGrantDbContext", $"PersistedGrantStore-{this.TestId}", this.UseSecureSqlServerDatabase)); + environmentVariables.Add(this.SetConnectionString("ConnectionStrings:ConfigurationDbContext", $"Configuration-{this.TestId}", this.UseSecureSqlServerDatabase)); + environmentVariables.Add(this.SetConnectionString("ConnectionStrings:AuthenticationDbContext", $"Authentication-{this.TestId}", this.UseSecureSqlServerDatabase)); + + List additionalEnvironmentVariables = this.GetAdditionalVariables(ContainerType.SecurityService); + + if (additionalEnvironmentVariables != null) + { + environmentVariables.AddRange(additionalEnvironmentVariables); + } + + ContainerBuilder securityServiceContainer = new Builder().UseContainer().WithName(this.SecurityServiceContainerName) + .WithEnvironment(environmentVariables.ToArray()) + .UseImageDetails(this.GetImageDetails(ContainerType.SecurityService)) + .MountHostFolder(this.DockerPlatform, this.HostTraceFolder) + .SetDockerCredentials(this.DockerCredentials); + + Int32? hostPort = this.GetHostPort(ContainerType.SecurityService); + if (hostPort == null) + { + securityServiceContainer = securityServiceContainer.ExposePort(DockerPorts.SecurityServiceDockerPort); + } + else + { + securityServiceContainer = securityServiceContainer.ExposePort(hostPort.Value, DockerPorts.SecurityServiceDockerPort); + } + + // Now build and return the container + return securityServiceContainer; + } + /// /// Starts the containers for scenario run. /// @@ -167,7 +214,7 @@ await Retry.For(async () => { // Build the connection string (to master) String connectionString = Setup.GetLocalConnectionString(databaseName); - EstateManagementSqlServerContext context = new EstateManagementSqlServerContext(connectionString); + EstateManagementContext context = new EstateManagementContext(connectionString); await context.Database.EnsureDeletedAsync(CancellationToken.None); }); } diff --git a/TransactionProcessor.IntegrationTests/Features/Contract.feature.cs b/TransactionProcessor.IntegrationTests/Features/Contract.feature.cs index 11eb0107..0275dd59 100644 --- a/TransactionProcessor.IntegrationTests/Features/Contract.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/Contract.feature.cs @@ -10,15 +10,13 @@ // ------------------------------------------------------------------------------ #region Designer generated code #pragma warning disable +using Reqnroll; namespace TransactionProcessor.IntegrationTests.Features { - using Reqnroll; - using System; - using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "2.0.0.0")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "2.0.0.0")] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("Contract")] [NUnit.Framework.FixtureLifeCycleAttribute(NUnit.Framework.LifeCycle.InstancePerTestCase)] @@ -33,41 +31,63 @@ public partial class ContractFeature "base", "shared"}; - private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "Contract", null, global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); + private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new global::System.Globalization.CultureInfo("en-US"), "Features", "Contract", null, global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); #line 1 "Contract.feature" #line hidden [NUnit.Framework.OneTimeSetUpAttribute()] - public static async System.Threading.Tasks.Task FeatureSetupAsync() + public static async global::System.Threading.Tasks.Task FeatureSetupAsync() { } [NUnit.Framework.OneTimeTearDownAttribute()] - public static async System.Threading.Tasks.Task FeatureTearDownAsync() + public static async global::System.Threading.Tasks.Task FeatureTearDownAsync() { } [NUnit.Framework.SetUpAttribute()] - public async System.Threading.Tasks.Task TestInitializeAsync() + public async global::System.Threading.Tasks.Task TestInitializeAsync() { testRunner = global::Reqnroll.TestRunnerManager.GetTestRunnerForAssembly(featureHint: featureInfo); - if (((testRunner.FeatureContext != null) - && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) + try { - await testRunner.OnFeatureEndAsync(); + if (((testRunner.FeatureContext != null) + && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) + { + await testRunner.OnFeatureEndAsync(); + } } - if ((testRunner.FeatureContext == null)) + finally { - await testRunner.OnFeatureStartAsync(featureInfo); + if (((testRunner.FeatureContext != null) + && testRunner.FeatureContext.BeforeFeatureHookFailed)) + { + throw new global::Reqnroll.ReqnrollException("Scenario skipped because of previous before feature hook error"); + } + if ((testRunner.FeatureContext == null)) + { + await testRunner.OnFeatureStartAsync(featureInfo); + } } } [NUnit.Framework.TearDownAttribute()] - public async System.Threading.Tasks.Task TestTearDownAsync() + public async global::System.Threading.Tasks.Task TestTearDownAsync() { - await testRunner.OnScenarioEndAsync(); - global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); + if ((testRunner == null)) + { + return; + } + try + { + await testRunner.OnScenarioEndAsync(); + } + finally + { + global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); + testRunner = null; + } } public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) @@ -76,17 +96,17 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public async System.Threading.Tasks.Task ScenarioStartAsync() + public async global::System.Threading.Tasks.Task ScenarioStartAsync() { await testRunner.OnScenarioStartAsync(); } - public async System.Threading.Tasks.Task ScenarioCleanupAsync() + public async global::System.Threading.Tasks.Task ScenarioCleanupAsync() { await testRunner.CollectScenarioErrorsAsync(); } - public virtual async System.Threading.Tasks.Task FeatureBackgroundAsync() + public virtual async global::System.Threading.Tasks.Task FeatureBackgroundAsync() { #line 4 #line hidden @@ -215,10 +235,10 @@ public virtual async System.Threading.Tasks.Task FeatureBackgroundAsync() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Get Merchant Contracts")] - public async System.Threading.Tasks.Task GetMerchantContracts() + public async global::System.Threading.Tasks.Task GetMerchantContracts() { string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + global::System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new global::System.Collections.Specialized.OrderedDictionary(); global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Get Merchant Contracts", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 46 this.ScenarioInitialize(scenarioInfo); @@ -512,10 +532,10 @@ public async System.Threading.Tasks.Task GetMerchantContracts() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Prevent Duplicate Contracts")] - public async System.Threading.Tasks.Task PreventDuplicateContracts() + public async global::System.Threading.Tasks.Task PreventDuplicateContracts() { string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + global::System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new global::System.Collections.Specialized.OrderedDictionary(); global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Prevent Duplicate Contracts", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 116 this.ScenarioInitialize(scenarioInfo); diff --git a/TransactionProcessor.IntegrationTests/Features/Estate.feature b/TransactionProcessor.IntegrationTests/Features/Estate.feature index 826b035c..f7459b16 100644 --- a/TransactionProcessor.IntegrationTests/Features/Estate.feature +++ b/TransactionProcessor.IntegrationTests/Features/Estate.feature @@ -8,16 +8,16 @@ Background: Given I create the following api scopes | Name | DisplayName | Description | - | estateManagement | Estate Managememt REST Scope | A scope for Estate Managememt REST | + | transactionProcessor | Estate Managememt REST Scope | A scope for Estate Managememt REST | Given the following api resources exist | Name | DisplayName | Secret | Scopes | UserClaims | - | estateManagement | Estate Managememt REST | Secret1 | estateManagement | merchantId, estateId, role | + | transactionProcessor | Estate Managememt REST | Secret1 | transactionProcessor | merchantId, estateId, role | Given the following clients exist | ClientId | ClientName | Secret | Scopes | GrantTypes | - | serviceClient | Service Client | Secret1 | estateManagement | client_credentials | - | estateClient | Estate Client | Secret1 | estateManagement | password | + | serviceClient | Service Client | Secret1 | transactionProcessor | client_credentials | + | estateClient | Estate Client | Secret1 | transactionProcessor | password | Given I have a token to access the estate management resource | ClientId | diff --git a/TransactionProcessor.IntegrationTests/Features/Estate.feature.cs b/TransactionProcessor.IntegrationTests/Features/Estate.feature.cs index 22389b9e..b3d5894e 100644 --- a/TransactionProcessor.IntegrationTests/Features/Estate.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/Estate.feature.cs @@ -10,15 +10,13 @@ // ------------------------------------------------------------------------------ #region Designer generated code #pragma warning disable +using Reqnroll; namespace TransactionProcessor.IntegrationTests.Features { - using Reqnroll; - using System; - using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "2.0.0.0")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "2.0.0.0")] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("Estate")] [NUnit.Framework.FixtureLifeCycleAttribute(NUnit.Framework.LifeCycle.InstancePerTestCase)] @@ -33,41 +31,63 @@ public partial class EstateFeature "base", "shared"}; - private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "Estate", null, global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); + private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new global::System.Globalization.CultureInfo("en-US"), "Features", "Estate", null, global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); #line 1 "Estate.feature" #line hidden [NUnit.Framework.OneTimeSetUpAttribute()] - public static async System.Threading.Tasks.Task FeatureSetupAsync() + public static async global::System.Threading.Tasks.Task FeatureSetupAsync() { } [NUnit.Framework.OneTimeTearDownAttribute()] - public static async System.Threading.Tasks.Task FeatureTearDownAsync() + public static async global::System.Threading.Tasks.Task FeatureTearDownAsync() { } [NUnit.Framework.SetUpAttribute()] - public async System.Threading.Tasks.Task TestInitializeAsync() + public async global::System.Threading.Tasks.Task TestInitializeAsync() { testRunner = global::Reqnroll.TestRunnerManager.GetTestRunnerForAssembly(featureHint: featureInfo); - if (((testRunner.FeatureContext != null) - && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) + try { - await testRunner.OnFeatureEndAsync(); + if (((testRunner.FeatureContext != null) + && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) + { + await testRunner.OnFeatureEndAsync(); + } } - if ((testRunner.FeatureContext == null)) + finally { - await testRunner.OnFeatureStartAsync(featureInfo); + if (((testRunner.FeatureContext != null) + && testRunner.FeatureContext.BeforeFeatureHookFailed)) + { + throw new global::Reqnroll.ReqnrollException("Scenario skipped because of previous before feature hook error"); + } + if ((testRunner.FeatureContext == null)) + { + await testRunner.OnFeatureStartAsync(featureInfo); + } } } [NUnit.Framework.TearDownAttribute()] - public async System.Threading.Tasks.Task TestTearDownAsync() + public async global::System.Threading.Tasks.Task TestTearDownAsync() { - await testRunner.OnScenarioEndAsync(); - global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); + if ((testRunner == null)) + { + return; + } + try + { + await testRunner.OnScenarioEndAsync(); + } + finally + { + global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); + testRunner = null; + } } public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) @@ -76,17 +96,17 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public async System.Threading.Tasks.Task ScenarioStartAsync() + public async global::System.Threading.Tasks.Task ScenarioStartAsync() { await testRunner.OnScenarioStartAsync(); } - public async System.Threading.Tasks.Task ScenarioCleanupAsync() + public async global::System.Threading.Tasks.Task ScenarioCleanupAsync() { await testRunner.CollectScenarioErrorsAsync(); } - public virtual async System.Threading.Tasks.Task FeatureBackgroundAsync() + public virtual async global::System.Threading.Tasks.Task FeatureBackgroundAsync() { #line 4 #line hidden @@ -102,7 +122,7 @@ public virtual async System.Threading.Tasks.Task FeatureBackgroundAsync() "DisplayName", "Description"}); table26.AddRow(new string[] { - "estateManagement", + "transactionProcessor", "Estate Managememt REST Scope", "A scope for Estate Managememt REST"}); #line 9 @@ -115,10 +135,10 @@ public virtual async System.Threading.Tasks.Task FeatureBackgroundAsync() "Scopes", "UserClaims"}); table27.AddRow(new string[] { - "estateManagement", + "transactionProcessor", "Estate Managememt REST", "Secret1", - "estateManagement", + "transactionProcessor", "merchantId, estateId, role"}); #line 13 await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table27, "Given "); @@ -133,13 +153,13 @@ public virtual async System.Threading.Tasks.Task FeatureBackgroundAsync() "serviceClient", "Service Client", "Secret1", - "estateManagement", + "transactionProcessor", "client_credentials"}); table28.AddRow(new string[] { "estateClient", "Estate Client", "Secret1", - "estateManagement", + "transactionProcessor", "password"}); #line 17 await testRunner.GivenAsync("the following clients exist", ((string)(null)), table28, "Given "); @@ -155,10 +175,10 @@ public virtual async System.Threading.Tasks.Task FeatureBackgroundAsync() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Get Estate")] - public async System.Threading.Tasks.Task GetEstate() + public async global::System.Threading.Tasks.Task GetEstate() { string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + global::System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new global::System.Collections.Specialized.OrderedDictionary(); global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Get Estate", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 26 this.ScenarioInitialize(scenarioInfo); @@ -301,10 +321,10 @@ await testRunner.WhenAsync("I get the estate \"Test Estate 1\" the estate securi [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Update Estate")] - public async System.Threading.Tasks.Task UpdateEstate() + public async global::System.Threading.Tasks.Task UpdateEstate() { string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + global::System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new global::System.Collections.Specialized.OrderedDictionary(); global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Update Estate", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 68 this.ScenarioInitialize(scenarioInfo); diff --git a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs index 2048e445..1bf3de97 100644 --- a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs @@ -10,15 +10,13 @@ // ------------------------------------------------------------------------------ #region Designer generated code #pragma warning disable +using Reqnroll; namespace TransactionProcessor.IntegrationTests.Features { - using Reqnroll; - using System; - using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "2.0.0.0")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "2.0.0.0")] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("LogonTransaction")] [NUnit.Framework.FixtureLifeCycleAttribute(NUnit.Framework.LifeCycle.InstancePerTestCase)] @@ -33,41 +31,63 @@ public partial class LogonTransactionFeature "base", "shared"}; - private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "LogonTransaction", null, global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); + private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new global::System.Globalization.CultureInfo("en-US"), "Features", "LogonTransaction", null, global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); #line 1 "LogonTransaction.feature" #line hidden [NUnit.Framework.OneTimeSetUpAttribute()] - public static async System.Threading.Tasks.Task FeatureSetupAsync() + public static async global::System.Threading.Tasks.Task FeatureSetupAsync() { } [NUnit.Framework.OneTimeTearDownAttribute()] - public static async System.Threading.Tasks.Task FeatureTearDownAsync() + public static async global::System.Threading.Tasks.Task FeatureTearDownAsync() { } [NUnit.Framework.SetUpAttribute()] - public async System.Threading.Tasks.Task TestInitializeAsync() + public async global::System.Threading.Tasks.Task TestInitializeAsync() { testRunner = global::Reqnroll.TestRunnerManager.GetTestRunnerForAssembly(featureHint: featureInfo); - if (((testRunner.FeatureContext != null) - && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) + try { - await testRunner.OnFeatureEndAsync(); + if (((testRunner.FeatureContext != null) + && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) + { + await testRunner.OnFeatureEndAsync(); + } } - if ((testRunner.FeatureContext == null)) + finally { - await testRunner.OnFeatureStartAsync(featureInfo); + if (((testRunner.FeatureContext != null) + && testRunner.FeatureContext.BeforeFeatureHookFailed)) + { + throw new global::Reqnroll.ReqnrollException("Scenario skipped because of previous before feature hook error"); + } + if ((testRunner.FeatureContext == null)) + { + await testRunner.OnFeatureStartAsync(featureInfo); + } } } [NUnit.Framework.TearDownAttribute()] - public async System.Threading.Tasks.Task TestTearDownAsync() + public async global::System.Threading.Tasks.Task TestTearDownAsync() { - await testRunner.OnScenarioEndAsync(); - global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); + if ((testRunner == null)) + { + return; + } + try + { + await testRunner.OnScenarioEndAsync(); + } + finally + { + global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); + testRunner = null; + } } public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) @@ -76,17 +96,17 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public async System.Threading.Tasks.Task ScenarioStartAsync() + public async global::System.Threading.Tasks.Task ScenarioStartAsync() { await testRunner.OnScenarioStartAsync(); } - public async System.Threading.Tasks.Task ScenarioCleanupAsync() + public async global::System.Threading.Tasks.Task ScenarioCleanupAsync() { await testRunner.CollectScenarioErrorsAsync(); } - public virtual async System.Threading.Tasks.Task FeatureBackgroundAsync() + public virtual async global::System.Threading.Tasks.Task FeatureBackgroundAsync() { #line 4 #line hidden @@ -309,11 +329,11 @@ await testRunner.GivenAsync("I have a token to access the estate management and [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Logon Transactions")] [NUnit.Framework.CategoryAttribute("PRTest")] - public async System.Threading.Tasks.Task LogonTransactions() + public async global::System.Threading.Tasks.Task LogonTransactions() { string[] tagsOfScenario = new string[] { "PRTest"}; - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + global::System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new global::System.Collections.Specialized.OrderedDictionary(); global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Logon Transactions", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 57 this.ScenarioInitialize(scenarioInfo); diff --git a/TransactionProcessor.IntegrationTests/Features/Merchant.feature.cs b/TransactionProcessor.IntegrationTests/Features/Merchant.feature.cs index 89ac2554..4c8fe6d9 100644 --- a/TransactionProcessor.IntegrationTests/Features/Merchant.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/Merchant.feature.cs @@ -10,15 +10,13 @@ // ------------------------------------------------------------------------------ #region Designer generated code #pragma warning disable +using Reqnroll; namespace TransactionProcessor.IntegrationTests.Features { - using Reqnroll; - using System; - using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "2.0.0.0")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "2.0.0.0")] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("Merchant")] [NUnit.Framework.FixtureLifeCycleAttribute(NUnit.Framework.LifeCycle.InstancePerTestCase)] @@ -33,41 +31,63 @@ public partial class MerchantFeature "base", "shared"}; - private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "Merchant", null, global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); + private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new global::System.Globalization.CultureInfo("en-US"), "Features", "Merchant", null, global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); #line 1 "Merchant.feature" #line hidden [NUnit.Framework.OneTimeSetUpAttribute()] - public static async System.Threading.Tasks.Task FeatureSetupAsync() + public static async global::System.Threading.Tasks.Task FeatureSetupAsync() { } [NUnit.Framework.OneTimeTearDownAttribute()] - public static async System.Threading.Tasks.Task FeatureTearDownAsync() + public static async global::System.Threading.Tasks.Task FeatureTearDownAsync() { } [NUnit.Framework.SetUpAttribute()] - public async System.Threading.Tasks.Task TestInitializeAsync() + public async global::System.Threading.Tasks.Task TestInitializeAsync() { testRunner = global::Reqnroll.TestRunnerManager.GetTestRunnerForAssembly(featureHint: featureInfo); - if (((testRunner.FeatureContext != null) - && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) + try { - await testRunner.OnFeatureEndAsync(); + if (((testRunner.FeatureContext != null) + && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) + { + await testRunner.OnFeatureEndAsync(); + } } - if ((testRunner.FeatureContext == null)) + finally { - await testRunner.OnFeatureStartAsync(featureInfo); + if (((testRunner.FeatureContext != null) + && testRunner.FeatureContext.BeforeFeatureHookFailed)) + { + throw new global::Reqnroll.ReqnrollException("Scenario skipped because of previous before feature hook error"); + } + if ((testRunner.FeatureContext == null)) + { + await testRunner.OnFeatureStartAsync(featureInfo); + } } } [NUnit.Framework.TearDownAttribute()] - public async System.Threading.Tasks.Task TestTearDownAsync() + public async global::System.Threading.Tasks.Task TestTearDownAsync() { - await testRunner.OnScenarioEndAsync(); - global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); + if ((testRunner == null)) + { + return; + } + try + { + await testRunner.OnScenarioEndAsync(); + } + finally + { + global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); + testRunner = null; + } } public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) @@ -76,17 +96,17 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public async System.Threading.Tasks.Task ScenarioStartAsync() + public async global::System.Threading.Tasks.Task ScenarioStartAsync() { await testRunner.OnScenarioStartAsync(); } - public async System.Threading.Tasks.Task ScenarioCleanupAsync() + public async global::System.Threading.Tasks.Task ScenarioCleanupAsync() { await testRunner.CollectScenarioErrorsAsync(); } - public virtual async System.Threading.Tasks.Task FeatureBackgroundAsync() + public virtual async global::System.Threading.Tasks.Task FeatureBackgroundAsync() { #line 4 #line hidden @@ -228,10 +248,10 @@ public virtual async System.Threading.Tasks.Task FeatureBackgroundAsync() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Get Invalid Merchant - System Login")] - public async System.Threading.Tasks.Task GetInvalidMerchant_SystemLogin() + public async global::System.Threading.Tasks.Task GetInvalidMerchant_SystemLogin() { string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + global::System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new global::System.Collections.Specialized.OrderedDictionary(); global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Get Invalid Merchant - System Login", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 52 this.ScenarioInitialize(scenarioInfo); @@ -256,10 +276,10 @@ public async System.Threading.Tasks.Task GetInvalidMerchant_SystemLogin() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Get Invalid Merchant - Estate User")] - public async System.Threading.Tasks.Task GetInvalidMerchant_EstateUser() + public async global::System.Threading.Tasks.Task GetInvalidMerchant_EstateUser() { string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + global::System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new global::System.Collections.Specialized.OrderedDictionary(); global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Get Invalid Merchant - Estate User", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 55 this.ScenarioInitialize(scenarioInfo); @@ -288,10 +308,10 @@ public async System.Threading.Tasks.Task GetInvalidMerchant_EstateUser() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Create Merchant - System Login")] - public async System.Threading.Tasks.Task CreateMerchant_SystemLogin() + public async global::System.Threading.Tasks.Task CreateMerchant_SystemLogin() { string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + global::System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new global::System.Collections.Specialized.OrderedDictionary(); global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Create Merchant - System Login", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 59 this.ScenarioInitialize(scenarioInfo); @@ -391,10 +411,10 @@ public async System.Threading.Tasks.Task CreateMerchant_SystemLogin() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Create Merchant - Estate User")] - public async System.Threading.Tasks.Task CreateMerchant_EstateUser() + public async global::System.Threading.Tasks.Task CreateMerchant_EstateUser() { string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + global::System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new global::System.Collections.Specialized.OrderedDictionary(); global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Create Merchant - Estate User", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 76 this.ScenarioInitialize(scenarioInfo); @@ -683,11 +703,11 @@ public async System.Threading.Tasks.Task CreateMerchant_EstateUser() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Get Merchants for Estate")] [NUnit.Framework.CategoryAttribute("PRTest")] - public async System.Threading.Tasks.Task GetMerchantsForEstate() + public async global::System.Threading.Tasks.Task GetMerchantsForEstate() { string[] tagsOfScenario = new string[] { "PRTest"}; - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + global::System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new global::System.Collections.Specialized.OrderedDictionary(); global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Get Merchants for Estate", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 140 this.ScenarioInitialize(scenarioInfo); @@ -897,11 +917,11 @@ public async System.Threading.Tasks.Task GetMerchantsForEstate() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Update Merchant")] [NUnit.Framework.CategoryAttribute("PRTest")] - public async System.Threading.Tasks.Task UpdateMerchant() + public async global::System.Threading.Tasks.Task UpdateMerchant() { string[] tagsOfScenario = new string[] { "PRTest"}; - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + global::System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new global::System.Collections.Specialized.OrderedDictionary(); global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Update Merchant", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 186 this.ScenarioInitialize(scenarioInfo); diff --git a/TransactionProcessor.IntegrationTests/Features/Operator.feature.cs b/TransactionProcessor.IntegrationTests/Features/Operator.feature.cs index 57e04074..baf283d7 100644 --- a/TransactionProcessor.IntegrationTests/Features/Operator.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/Operator.feature.cs @@ -10,15 +10,13 @@ // ------------------------------------------------------------------------------ #region Designer generated code #pragma warning disable +using Reqnroll; namespace TransactionProcessor.IntegrationTests.Features { - using Reqnroll; - using System; - using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "2.0.0.0")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "2.0.0.0")] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("Operator")] [NUnit.Framework.FixtureLifeCycleAttribute(NUnit.Framework.LifeCycle.InstancePerTestCase)] @@ -33,41 +31,63 @@ public partial class OperatorFeature "base", "shared"}; - private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "Operator", null, global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); + private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new global::System.Globalization.CultureInfo("en-US"), "Features", "Operator", null, global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); #line 1 "Operator.feature" #line hidden [NUnit.Framework.OneTimeSetUpAttribute()] - public static async System.Threading.Tasks.Task FeatureSetupAsync() + public static async global::System.Threading.Tasks.Task FeatureSetupAsync() { } [NUnit.Framework.OneTimeTearDownAttribute()] - public static async System.Threading.Tasks.Task FeatureTearDownAsync() + public static async global::System.Threading.Tasks.Task FeatureTearDownAsync() { } [NUnit.Framework.SetUpAttribute()] - public async System.Threading.Tasks.Task TestInitializeAsync() + public async global::System.Threading.Tasks.Task TestInitializeAsync() { testRunner = global::Reqnroll.TestRunnerManager.GetTestRunnerForAssembly(featureHint: featureInfo); - if (((testRunner.FeatureContext != null) - && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) + try { - await testRunner.OnFeatureEndAsync(); + if (((testRunner.FeatureContext != null) + && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) + { + await testRunner.OnFeatureEndAsync(); + } } - if ((testRunner.FeatureContext == null)) + finally { - await testRunner.OnFeatureStartAsync(featureInfo); + if (((testRunner.FeatureContext != null) + && testRunner.FeatureContext.BeforeFeatureHookFailed)) + { + throw new global::Reqnroll.ReqnrollException("Scenario skipped because of previous before feature hook error"); + } + if ((testRunner.FeatureContext == null)) + { + await testRunner.OnFeatureStartAsync(featureInfo); + } } } [NUnit.Framework.TearDownAttribute()] - public async System.Threading.Tasks.Task TestTearDownAsync() + public async global::System.Threading.Tasks.Task TestTearDownAsync() { - await testRunner.OnScenarioEndAsync(); - global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); + if ((testRunner == null)) + { + return; + } + try + { + await testRunner.OnScenarioEndAsync(); + } + finally + { + global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); + testRunner = null; + } } public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) @@ -76,17 +96,17 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public async System.Threading.Tasks.Task ScenarioStartAsync() + public async global::System.Threading.Tasks.Task ScenarioStartAsync() { await testRunner.OnScenarioStartAsync(); } - public async System.Threading.Tasks.Task ScenarioCleanupAsync() + public async global::System.Threading.Tasks.Task ScenarioCleanupAsync() { await testRunner.CollectScenarioErrorsAsync(); } - public virtual async System.Threading.Tasks.Task FeatureBackgroundAsync() + public virtual async global::System.Threading.Tasks.Task FeatureBackgroundAsync() { #line 4 #line hidden @@ -163,11 +183,11 @@ public virtual async System.Threading.Tasks.Task FeatureBackgroundAsync() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Update Operator")] [NUnit.Framework.CategoryAttribute("PRTest")] - public async System.Threading.Tasks.Task UpdateOperator() + public async global::System.Threading.Tasks.Task UpdateOperator() { string[] tagsOfScenario = new string[] { "PRTest"}; - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + global::System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new global::System.Collections.Specialized.OrderedDictionary(); global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Update Operator", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 31 this.ScenarioInitialize(scenarioInfo); diff --git a/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs b/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs index e32f7c39..5e22de03 100644 --- a/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs @@ -10,15 +10,13 @@ // ------------------------------------------------------------------------------ #region Designer generated code #pragma warning disable +using Reqnroll; namespace TransactionProcessor.IntegrationTests.Features { - using Reqnroll; - using System; - using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "2.0.0.0")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "2.0.0.0")] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("Reconciliation")] [NUnit.Framework.FixtureLifeCycleAttribute(NUnit.Framework.LifeCycle.InstancePerTestCase)] @@ -33,41 +31,63 @@ public partial class ReconciliationFeature "base", "shared"}; - private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "Reconciliation", null, global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); + private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new global::System.Globalization.CultureInfo("en-US"), "Features", "Reconciliation", null, global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); #line 1 "ReconciliationFeature.feature" #line hidden [NUnit.Framework.OneTimeSetUpAttribute()] - public static async System.Threading.Tasks.Task FeatureSetupAsync() + public static async global::System.Threading.Tasks.Task FeatureSetupAsync() { } [NUnit.Framework.OneTimeTearDownAttribute()] - public static async System.Threading.Tasks.Task FeatureTearDownAsync() + public static async global::System.Threading.Tasks.Task FeatureTearDownAsync() { } [NUnit.Framework.SetUpAttribute()] - public async System.Threading.Tasks.Task TestInitializeAsync() + public async global::System.Threading.Tasks.Task TestInitializeAsync() { testRunner = global::Reqnroll.TestRunnerManager.GetTestRunnerForAssembly(featureHint: featureInfo); - if (((testRunner.FeatureContext != null) - && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) + try { - await testRunner.OnFeatureEndAsync(); + if (((testRunner.FeatureContext != null) + && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) + { + await testRunner.OnFeatureEndAsync(); + } } - if ((testRunner.FeatureContext == null)) + finally { - await testRunner.OnFeatureStartAsync(featureInfo); + if (((testRunner.FeatureContext != null) + && testRunner.FeatureContext.BeforeFeatureHookFailed)) + { + throw new global::Reqnroll.ReqnrollException("Scenario skipped because of previous before feature hook error"); + } + if ((testRunner.FeatureContext == null)) + { + await testRunner.OnFeatureStartAsync(featureInfo); + } } } [NUnit.Framework.TearDownAttribute()] - public async System.Threading.Tasks.Task TestTearDownAsync() + public async global::System.Threading.Tasks.Task TestTearDownAsync() { - await testRunner.OnScenarioEndAsync(); - global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); + if ((testRunner == null)) + { + return; + } + try + { + await testRunner.OnScenarioEndAsync(); + } + finally + { + global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); + testRunner = null; + } } public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) @@ -76,17 +96,17 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public async System.Threading.Tasks.Task ScenarioStartAsync() + public async global::System.Threading.Tasks.Task ScenarioStartAsync() { await testRunner.OnScenarioStartAsync(); } - public async System.Threading.Tasks.Task ScenarioCleanupAsync() + public async global::System.Threading.Tasks.Task ScenarioCleanupAsync() { await testRunner.CollectScenarioErrorsAsync(); } - public virtual async System.Threading.Tasks.Task FeatureBackgroundAsync() + public virtual async global::System.Threading.Tasks.Task FeatureBackgroundAsync() { #line 4 #line hidden @@ -374,11 +394,11 @@ await testRunner.GivenAsync("I have a token to access the estate management and [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Reconciliation Transactions")] [NUnit.Framework.CategoryAttribute("PRTest")] - public async System.Threading.Tasks.Task ReconciliationTransactions() + public async global::System.Threading.Tasks.Task ReconciliationTransactions() { string[] tagsOfScenario = new string[] { "PRTest"}; - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + global::System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new global::System.Collections.Specialized.OrderedDictionary(); global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Reconciliation Transactions", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 79 this.ScenarioInitialize(scenarioInfo); diff --git a/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature.cs b/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature.cs index 564268bf..462558c9 100644 --- a/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature.cs @@ -10,15 +10,13 @@ // ------------------------------------------------------------------------------ #region Designer generated code #pragma warning disable +using Reqnroll; namespace TransactionProcessor.IntegrationTests.Features { - using Reqnroll; - using System; - using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "2.0.0.0")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "2.0.0.0")] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("RedeemVoucher")] [NUnit.Framework.FixtureLifeCycleAttribute(NUnit.Framework.LifeCycle.InstancePerTestCase)] @@ -33,41 +31,63 @@ public partial class RedeemVoucherFeature "base", "shared"}; - private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "RedeemVoucher", "\tSimple calculator for adding two numbers", global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); + private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new global::System.Globalization.CultureInfo("en-US"), "Features", "RedeemVoucher", "\tSimple calculator for adding two numbers", global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); #line 1 "RedeemVoucher.feature" #line hidden [NUnit.Framework.OneTimeSetUpAttribute()] - public static async System.Threading.Tasks.Task FeatureSetupAsync() + public static async global::System.Threading.Tasks.Task FeatureSetupAsync() { } [NUnit.Framework.OneTimeTearDownAttribute()] - public static async System.Threading.Tasks.Task FeatureTearDownAsync() + public static async global::System.Threading.Tasks.Task FeatureTearDownAsync() { } [NUnit.Framework.SetUpAttribute()] - public async System.Threading.Tasks.Task TestInitializeAsync() + public async global::System.Threading.Tasks.Task TestInitializeAsync() { testRunner = global::Reqnroll.TestRunnerManager.GetTestRunnerForAssembly(featureHint: featureInfo); - if (((testRunner.FeatureContext != null) - && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) + try { - await testRunner.OnFeatureEndAsync(); + if (((testRunner.FeatureContext != null) + && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) + { + await testRunner.OnFeatureEndAsync(); + } } - if ((testRunner.FeatureContext == null)) + finally { - await testRunner.OnFeatureStartAsync(featureInfo); + if (((testRunner.FeatureContext != null) + && testRunner.FeatureContext.BeforeFeatureHookFailed)) + { + throw new global::Reqnroll.ReqnrollException("Scenario skipped because of previous before feature hook error"); + } + if ((testRunner.FeatureContext == null)) + { + await testRunner.OnFeatureStartAsync(featureInfo); + } } } [NUnit.Framework.TearDownAttribute()] - public async System.Threading.Tasks.Task TestTearDownAsync() + public async global::System.Threading.Tasks.Task TestTearDownAsync() { - await testRunner.OnScenarioEndAsync(); - global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); + if ((testRunner == null)) + { + return; + } + try + { + await testRunner.OnScenarioEndAsync(); + } + finally + { + global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); + testRunner = null; + } } public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) @@ -76,17 +96,17 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public async System.Threading.Tasks.Task ScenarioStartAsync() + public async global::System.Threading.Tasks.Task ScenarioStartAsync() { await testRunner.OnScenarioStartAsync(); } - public async System.Threading.Tasks.Task ScenarioCleanupAsync() + public async global::System.Threading.Tasks.Task ScenarioCleanupAsync() { await testRunner.CollectScenarioErrorsAsync(); } - public virtual async System.Threading.Tasks.Task FeatureBackgroundAsync() + public virtual async global::System.Threading.Tasks.Task FeatureBackgroundAsync() { #line 5 #line hidden @@ -329,11 +349,11 @@ await testRunner.GivenAsync("I have a token to access the estate management and [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Redeem Vouchers")] [NUnit.Framework.CategoryAttribute("PRTest")] - public async System.Threading.Tasks.Task RedeemVouchers() + public async global::System.Threading.Tasks.Task RedeemVouchers() { string[] tagsOfScenario = new string[] { "PRTest"}; - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + global::System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new global::System.Collections.Specialized.OrderedDictionary(); global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Redeem Vouchers", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 72 this.ScenarioInitialize(scenarioInfo); diff --git a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs index cfbfc96b..974f51fa 100644 --- a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs @@ -10,15 +10,13 @@ // ------------------------------------------------------------------------------ #region Designer generated code #pragma warning disable +using Reqnroll; namespace TransactionProcessor.IntegrationTests.Features { - using Reqnroll; - using System; - using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "2.0.0.0")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "2.0.0.0")] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("SaleTransaction")] [NUnit.Framework.FixtureLifeCycleAttribute(NUnit.Framework.LifeCycle.InstancePerTestCase)] @@ -33,41 +31,63 @@ public partial class SaleTransactionFeature "base", "shared"}; - private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "SaleTransaction", null, global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); + private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new global::System.Globalization.CultureInfo("en-US"), "Features", "SaleTransaction", null, global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); #line 1 "SaleTransactionFeature.feature" #line hidden [NUnit.Framework.OneTimeSetUpAttribute()] - public static async System.Threading.Tasks.Task FeatureSetupAsync() + public static async global::System.Threading.Tasks.Task FeatureSetupAsync() { } [NUnit.Framework.OneTimeTearDownAttribute()] - public static async System.Threading.Tasks.Task FeatureTearDownAsync() + public static async global::System.Threading.Tasks.Task FeatureTearDownAsync() { } [NUnit.Framework.SetUpAttribute()] - public async System.Threading.Tasks.Task TestInitializeAsync() + public async global::System.Threading.Tasks.Task TestInitializeAsync() { testRunner = global::Reqnroll.TestRunnerManager.GetTestRunnerForAssembly(featureHint: featureInfo); - if (((testRunner.FeatureContext != null) - && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) + try { - await testRunner.OnFeatureEndAsync(); + if (((testRunner.FeatureContext != null) + && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) + { + await testRunner.OnFeatureEndAsync(); + } } - if ((testRunner.FeatureContext == null)) + finally { - await testRunner.OnFeatureStartAsync(featureInfo); + if (((testRunner.FeatureContext != null) + && testRunner.FeatureContext.BeforeFeatureHookFailed)) + { + throw new global::Reqnroll.ReqnrollException("Scenario skipped because of previous before feature hook error"); + } + if ((testRunner.FeatureContext == null)) + { + await testRunner.OnFeatureStartAsync(featureInfo); + } } } [NUnit.Framework.TearDownAttribute()] - public async System.Threading.Tasks.Task TestTearDownAsync() + public async global::System.Threading.Tasks.Task TestTearDownAsync() { - await testRunner.OnScenarioEndAsync(); - global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); + if ((testRunner == null)) + { + return; + } + try + { + await testRunner.OnScenarioEndAsync(); + } + finally + { + global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); + testRunner = null; + } } public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) @@ -76,17 +96,17 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public async System.Threading.Tasks.Task ScenarioStartAsync() + public async global::System.Threading.Tasks.Task ScenarioStartAsync() { await testRunner.OnScenarioStartAsync(); } - public async System.Threading.Tasks.Task ScenarioCleanupAsync() + public async global::System.Threading.Tasks.Task ScenarioCleanupAsync() { await testRunner.CollectScenarioErrorsAsync(); } - public virtual async System.Threading.Tasks.Task FeatureBackgroundAsync() + public virtual async global::System.Threading.Tasks.Task FeatureBackgroundAsync() { #line 4 #line hidden @@ -645,11 +665,11 @@ await testRunner.GivenAsync("I have a token to access the estate management and [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Sale Transactions")] [NUnit.Framework.CategoryAttribute("PRTest")] - public async System.Threading.Tasks.Task SaleTransactions() + public async global::System.Threading.Tasks.Task SaleTransactions() { string[] tagsOfScenario = new string[] { "PRTest"}; - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + global::System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new global::System.Collections.Specialized.OrderedDictionary(); global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Sale Transactions", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 140 this.ScenarioInitialize(scenarioInfo); diff --git a/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs b/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs index 9c0e4233..5b3bc8c9 100644 --- a/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs @@ -10,15 +10,13 @@ // ------------------------------------------------------------------------------ #region Designer generated code #pragma warning disable +using Reqnroll; namespace TransactionProcessor.IntegrationTests.Features { - using Reqnroll; - using System; - using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "2.0.0.0")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "2.0.0.0")] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("Settlement")] [NUnit.Framework.FixtureLifeCycleAttribute(NUnit.Framework.LifeCycle.InstancePerTestCase)] @@ -33,41 +31,63 @@ public partial class SettlementFeature "base", "shared"}; - private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "Settlement", null, global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); + private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new global::System.Globalization.CultureInfo("en-US"), "Features", "Settlement", null, global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); #line 1 "Settlement.feature" #line hidden [NUnit.Framework.OneTimeSetUpAttribute()] - public static async System.Threading.Tasks.Task FeatureSetupAsync() + public static async global::System.Threading.Tasks.Task FeatureSetupAsync() { } [NUnit.Framework.OneTimeTearDownAttribute()] - public static async System.Threading.Tasks.Task FeatureTearDownAsync() + public static async global::System.Threading.Tasks.Task FeatureTearDownAsync() { } [NUnit.Framework.SetUpAttribute()] - public async System.Threading.Tasks.Task TestInitializeAsync() + public async global::System.Threading.Tasks.Task TestInitializeAsync() { testRunner = global::Reqnroll.TestRunnerManager.GetTestRunnerForAssembly(featureHint: featureInfo); - if (((testRunner.FeatureContext != null) - && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) + try { - await testRunner.OnFeatureEndAsync(); + if (((testRunner.FeatureContext != null) + && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) + { + await testRunner.OnFeatureEndAsync(); + } } - if ((testRunner.FeatureContext == null)) + finally { - await testRunner.OnFeatureStartAsync(featureInfo); + if (((testRunner.FeatureContext != null) + && testRunner.FeatureContext.BeforeFeatureHookFailed)) + { + throw new global::Reqnroll.ReqnrollException("Scenario skipped because of previous before feature hook error"); + } + if ((testRunner.FeatureContext == null)) + { + await testRunner.OnFeatureStartAsync(featureInfo); + } } } [NUnit.Framework.TearDownAttribute()] - public async System.Threading.Tasks.Task TestTearDownAsync() + public async global::System.Threading.Tasks.Task TestTearDownAsync() { - await testRunner.OnScenarioEndAsync(); - global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); + if ((testRunner == null)) + { + return; + } + try + { + await testRunner.OnScenarioEndAsync(); + } + finally + { + global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); + testRunner = null; + } } public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) @@ -76,17 +96,17 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public async System.Threading.Tasks.Task ScenarioStartAsync() + public async global::System.Threading.Tasks.Task ScenarioStartAsync() { await testRunner.OnScenarioStartAsync(); } - public async System.Threading.Tasks.Task ScenarioCleanupAsync() + public async global::System.Threading.Tasks.Task ScenarioCleanupAsync() { await testRunner.CollectScenarioErrorsAsync(); } - public virtual async System.Threading.Tasks.Task FeatureBackgroundAsync() + public virtual async global::System.Threading.Tasks.Task FeatureBackgroundAsync() { #line 4 #line hidden @@ -261,10 +281,10 @@ await testRunner.GivenAsync("I have a token to access the estate management and [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Get Pending Settlement")] - public async System.Threading.Tasks.Task GetPendingSettlement() + public async global::System.Threading.Tasks.Task GetPendingSettlement() { string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + global::System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new global::System.Collections.Specialized.OrderedDictionary(); global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Get Pending Settlement", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 54 this.ScenarioInitialize(scenarioInfo); @@ -686,11 +706,11 @@ public async System.Threading.Tasks.Task GetPendingSettlement() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Process Settlement")] [NUnit.Framework.CategoryAttribute("PRTest")] - public async System.Threading.Tasks.Task ProcessSettlement() + public async global::System.Threading.Tasks.Task ProcessSettlement() { string[] tagsOfScenario = new string[] { "PRTest"}; - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + global::System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new global::System.Collections.Specialized.OrderedDictionary(); global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Process Settlement", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 123 this.ScenarioInitialize(scenarioInfo); diff --git a/TransactionProcessor.IntegrationTests/Features/SettlementReporting.feature.cs b/TransactionProcessor.IntegrationTests/Features/SettlementReporting.feature.cs index 5c658af4..d4c89e71 100644 --- a/TransactionProcessor.IntegrationTests/Features/SettlementReporting.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/SettlementReporting.feature.cs @@ -10,15 +10,13 @@ // ------------------------------------------------------------------------------ #region Designer generated code #pragma warning disable +using Reqnroll; namespace TransactionProcessor.IntegrationTests.Features { - using Reqnroll; - using System; - using System.Linq; - [System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "2.0.0.0")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Reqnroll", "2.0.0.0")] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("SettlementReporting")] [NUnit.Framework.FixtureLifeCycleAttribute(NUnit.Framework.LifeCycle.InstancePerTestCase)] @@ -33,41 +31,63 @@ public partial class SettlementReportingFeature "base", "shared"}; - private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "SettlementReporting", null, global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); + private static global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new global::System.Globalization.CultureInfo("en-US"), "Features", "SettlementReporting", null, global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); #line 1 "SettlementReporting.feature" #line hidden [NUnit.Framework.OneTimeSetUpAttribute()] - public static async System.Threading.Tasks.Task FeatureSetupAsync() + public static async global::System.Threading.Tasks.Task FeatureSetupAsync() { } [NUnit.Framework.OneTimeTearDownAttribute()] - public static async System.Threading.Tasks.Task FeatureTearDownAsync() + public static async global::System.Threading.Tasks.Task FeatureTearDownAsync() { } [NUnit.Framework.SetUpAttribute()] - public async System.Threading.Tasks.Task TestInitializeAsync() + public async global::System.Threading.Tasks.Task TestInitializeAsync() { testRunner = global::Reqnroll.TestRunnerManager.GetTestRunnerForAssembly(featureHint: featureInfo); - if (((testRunner.FeatureContext != null) - && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) + try { - await testRunner.OnFeatureEndAsync(); + if (((testRunner.FeatureContext != null) + && (testRunner.FeatureContext.FeatureInfo.Equals(featureInfo) == false))) + { + await testRunner.OnFeatureEndAsync(); + } } - if ((testRunner.FeatureContext == null)) + finally { - await testRunner.OnFeatureStartAsync(featureInfo); + if (((testRunner.FeatureContext != null) + && testRunner.FeatureContext.BeforeFeatureHookFailed)) + { + throw new global::Reqnroll.ReqnrollException("Scenario skipped because of previous before feature hook error"); + } + if ((testRunner.FeatureContext == null)) + { + await testRunner.OnFeatureStartAsync(featureInfo); + } } } [NUnit.Framework.TearDownAttribute()] - public async System.Threading.Tasks.Task TestTearDownAsync() + public async global::System.Threading.Tasks.Task TestTearDownAsync() { - await testRunner.OnScenarioEndAsync(); - global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); + if ((testRunner == null)) + { + return; + } + try + { + await testRunner.OnScenarioEndAsync(); + } + finally + { + global::Reqnroll.TestRunnerManager.ReleaseTestRunner(testRunner); + testRunner = null; + } } public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) @@ -76,17 +96,17 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public async System.Threading.Tasks.Task ScenarioStartAsync() + public async global::System.Threading.Tasks.Task ScenarioStartAsync() { await testRunner.OnScenarioStartAsync(); } - public async System.Threading.Tasks.Task ScenarioCleanupAsync() + public async global::System.Threading.Tasks.Task ScenarioCleanupAsync() { await testRunner.CollectScenarioErrorsAsync(); } - public virtual async System.Threading.Tasks.Task FeatureBackgroundAsync() + public virtual async global::System.Threading.Tasks.Task FeatureBackgroundAsync() { #line 4 #line hidden @@ -733,12 +753,12 @@ await testRunner.GivenAsync("I have a token to access the estate management and [NUnit.Framework.DescriptionAttribute("Get Settlements - Merchant Filter")] [NUnit.Framework.CategoryAttribute("settlement")] [NUnit.Framework.CategoryAttribute("PRTest")] - public async System.Threading.Tasks.Task GetSettlements_MerchantFilter() + public async global::System.Threading.Tasks.Task GetSettlements_MerchantFilter() { string[] tagsOfScenario = new string[] { "settlement", "PRTest"}; - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + global::System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new global::System.Collections.Specialized.OrderedDictionary(); global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Get Settlements - Merchant Filter", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 137 this.ScenarioInitialize(scenarioInfo); diff --git a/TransactionProcessor.IntegrationTests/TransactionProcessor.IntegrationTests.csproj b/TransactionProcessor.IntegrationTests/TransactionProcessor.IntegrationTests.csproj index c5c36410..e96c0049 100644 --- a/TransactionProcessor.IntegrationTests/TransactionProcessor.IntegrationTests.csproj +++ b/TransactionProcessor.IntegrationTests/TransactionProcessor.IntegrationTests.csproj @@ -1,37 +1,38 @@  - net8.0 + net9.0 Full false - + - - - - - - - - + + + + + + + - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + + + diff --git a/TransactionProcessor.Models/TransactionProcessor.Models.csproj b/TransactionProcessor.Models/TransactionProcessor.Models.csproj index 2c10ecbc..b1f3a275 100644 --- a/TransactionProcessor.Models/TransactionProcessor.Models.csproj +++ b/TransactionProcessor.Models/TransactionProcessor.Models.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 None diff --git a/TransactionProcessor.Operator.DomainEvents/OperatorDomainEvents.cs b/TransactionProcessor.Operator.DomainEvents/OperatorDomainEvents.cs deleted file mode 100644 index 8bf367d8..00000000 --- a/TransactionProcessor.Operator.DomainEvents/OperatorDomainEvents.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using Shared.DomainDrivenDesign.EventSourcing; - -namespace TransactionProcessor.Operator.DomainEvents -{ - [ExcludeFromCodeCoverage] - public record OperatorCreatedEvent(Guid OperatorId, - Guid EstateId, - String Name, - Boolean RequireCustomMerchantNumber, - Boolean RequireCustomTerminalNumber) : DomainEvent(OperatorId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record OperatorNameUpdatedEvent(Guid OperatorId, - Guid EstateId, - String Name) : DomainEvent(OperatorId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record OperatorRequireCustomMerchantNumberChangedEvent(Guid OperatorId, - Guid EstateId, - Boolean RequireCustomMerchantNumber) : DomainEvent(OperatorId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record OperatorRequireCustomTerminalNumberChangedEvent(Guid OperatorId, - Guid EstateId, - Boolean RequireCustomTerminalNumber) : DomainEvent(OperatorId, Guid.NewGuid()); -} diff --git a/TransactionProcessor.Operator.DomainEvents/TransactionProcessor.Operator.DomainEvents.csproj b/TransactionProcessor.Operator.DomainEvents/TransactionProcessor.Operator.DomainEvents.csproj deleted file mode 100644 index ab0e3f83..00000000 --- a/TransactionProcessor.Operator.DomainEvents/TransactionProcessor.Operator.DomainEvents.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net8.0 - enable - enable - - - - - - - diff --git a/TransactionProcessor.ProjectionEngine.Tests/TransactionProcessor.ProjectionEngine.Tests.csproj b/TransactionProcessor.ProjectionEngine.Tests/TransactionProcessor.ProjectionEngine.Tests.csproj index 91f625bb..317535ae 100644 --- a/TransactionProcessor.ProjectionEngine.Tests/TransactionProcessor.ProjectionEngine.Tests.csproj +++ b/TransactionProcessor.ProjectionEngine.Tests/TransactionProcessor.ProjectionEngine.Tests.csproj @@ -1,7 +1,7 @@ - + - net8.0 + net9.0 enable enable None @@ -9,15 +9,16 @@ - - - + + + + + - - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/TransactionProcessor.ProjectionEngine/EventHandling/StateProjectionEventHandlers.cs b/TransactionProcessor.ProjectionEngine/EventHandling/StateProjectionEventHandlers.cs index 6a69de42..e9dc7d45 100644 --- a/TransactionProcessor.ProjectionEngine/EventHandling/StateProjectionEventHandlers.cs +++ b/TransactionProcessor.ProjectionEngine/EventHandling/StateProjectionEventHandlers.cs @@ -21,14 +21,14 @@ public class StateProjectionEventHandler : IDomainEventHandler where TSt private readonly IProjectionHandler ProjectionHandler; - private readonly IDbContextFactory ContextFactory; + private readonly IDbContextFactory ContextFactory; #endregion #region Constructors public StateProjectionEventHandler(ProjectionHandler projectionHandler, - IDbContextFactory contextFactory) { + IDbContextFactory contextFactory) { this.ProjectionHandler = projectionHandler; this.ContextFactory = contextFactory; } @@ -54,7 +54,7 @@ public async Task Handle(IDomainEvent domainEvent, private async Task MigrateDatabase(EstateDomainEvents.EstateCreatedEvent domainEvent, CancellationToken cancellationToken) { try { - EstateManagementGenericContext? context = await this.ContextFactory.GetContext(domainEvent.EstateId, + EstateManagementContext? context = await this.ContextFactory.GetContext(domainEvent.EstateId, "TransactionProcessorReadModel", cancellationToken); await context.MigrateAsync(cancellationToken); return Result.Success(); diff --git a/TransactionProcessor.ProjectionEngine/Repository/MerchantBalanceStateRepository.cs b/TransactionProcessor.ProjectionEngine/Repository/MerchantBalanceStateRepository.cs index de48313c..0396ff4d 100644 --- a/TransactionProcessor.ProjectionEngine/Repository/MerchantBalanceStateRepository.cs +++ b/TransactionProcessor.ProjectionEngine/Repository/MerchantBalanceStateRepository.cs @@ -17,13 +17,13 @@ public class MerchantBalanceStateRepository : IProjectionStateRepository ContextFactory; + private readonly Shared.EntityFramework.IDbContextFactory ContextFactory; #endregion #region Constructors - public MerchantBalanceStateRepository(Shared.EntityFramework.IDbContextFactory contextFactory) { + public MerchantBalanceStateRepository(Shared.EntityFramework.IDbContextFactory contextFactory) { this.ContextFactory = contextFactory; } @@ -63,7 +63,7 @@ public async Task> Save(MerchantBalanceState state, CancellationToken cancellationToken) { var estateId = GetEstateId(domainEvent); - await using EstateManagementGenericContext context = + await using EstateManagementContext context = await this.ContextFactory.GetContext(estateId, MerchantBalanceStateRepository.ConnectionStringIdentifier, cancellationToken); // Note: we don't want to select the state again here.... MerchantBalanceProjectionState entity = MerchantBalanceStateRepository.CreateMerchantBalanceProjectionState(state); @@ -124,7 +124,7 @@ private static MerchantBalanceProjectionState CreateMerchantBalanceProjectionSta private async Task> LoadHelper(Guid estateId, Guid merchantId, CancellationToken cancellationToken) { - await using EstateManagementGenericContext context = + await using EstateManagementContext context = await this.ContextFactory.GetContext(estateId, MerchantBalanceStateRepository.ConnectionStringIdentifier, cancellationToken); MerchantBalanceProjectionState? entity = await context.MerchantBalanceProjectionState.Where(m => m.MerchantId == merchantId).SingleOrDefaultAsync(cancellationToken: cancellationToken); diff --git a/TransactionProcessor.ProjectionEngine/Repository/TransactionProcessorReadRepository.cs b/TransactionProcessor.ProjectionEngine/Repository/TransactionProcessorReadRepository.cs index 2eb09f03..dad1c2bd 100644 --- a/TransactionProcessor.ProjectionEngine/Repository/TransactionProcessorReadRepository.cs +++ b/TransactionProcessor.ProjectionEngine/Repository/TransactionProcessorReadRepository.cs @@ -14,17 +14,17 @@ namespace TransactionProcessor.ProjectionEngine.Repository; [ExcludeFromCodeCoverage] public class TransactionProcessorReadRepository : ITransactionProcessorReadRepository { - private readonly Shared.EntityFramework.IDbContextFactory ContextFactory; + private readonly Shared.EntityFramework.IDbContextFactory ContextFactory; private const String ConnectionStringIdentifier = "EstateReportingReadModel"; - public TransactionProcessorReadRepository(Shared.EntityFramework.IDbContextFactory contextFactory) { + public TransactionProcessorReadRepository(Shared.EntityFramework.IDbContextFactory contextFactory) { this.ContextFactory = contextFactory; } public async Task AddMerchantBalanceChangedEntry(MerchantBalanceChangedEntry entry, CancellationToken cancellationToken) { Logger.LogInformation($"About to add entry {entry.Reference}"); - await using EstateManagementGenericContext context = await this.ContextFactory.GetContext(entry.EstateId, TransactionProcessorReadRepository.ConnectionStringIdentifier, cancellationToken); + await using EstateManagementContext context = await this.ContextFactory.GetContext(entry.EstateId, TransactionProcessorReadRepository.ConnectionStringIdentifier, cancellationToken); ProjectionEngine.Database.Database.Entities.MerchantBalanceChangedEntry entity = new() { ChangeAmount = entry.ChangeAmount, @@ -65,7 +65,7 @@ public async Task>> GetMerchantBalanceH DateTime startDate, DateTime endDate, CancellationToken cancellationToken) { - await using EstateManagementGenericContext context = await this.ContextFactory.GetContext(estateId, TransactionProcessorReadRepository.ConnectionStringIdentifier, cancellationToken); + await using EstateManagementContext context = await this.ContextFactory.GetContext(estateId, TransactionProcessorReadRepository.ConnectionStringIdentifier, cancellationToken); List entries = await context.MerchantBalanceHistoryViewEntry .Where(v => v.MerchantId == merchantId && v.EntryDateTime >= startDate && v.EntryDateTime <= endDate) diff --git a/TransactionProcessor.ProjectionEngine/Repository/VoucherStateRepository.cs b/TransactionProcessor.ProjectionEngine/Repository/VoucherStateRepository.cs index 47592fff..11aed4d8 100644 --- a/TransactionProcessor.ProjectionEngine/Repository/VoucherStateRepository.cs +++ b/TransactionProcessor.ProjectionEngine/Repository/VoucherStateRepository.cs @@ -17,13 +17,13 @@ public class VoucherStateRepository : IProjectionStateRepository { #region Fields - private readonly Shared.EntityFramework.IDbContextFactory ContextFactory; + private readonly Shared.EntityFramework.IDbContextFactory ContextFactory; #endregion #region Constructors - public VoucherStateRepository(Shared.EntityFramework.IDbContextFactory contextFactory) + public VoucherStateRepository(Shared.EntityFramework.IDbContextFactory contextFactory) { this.ContextFactory = contextFactory; } @@ -68,7 +68,7 @@ public async Task> Save(VoucherState state, CancellationToken cancellationToken) { - await using EstateManagementGenericContext context = + await using EstateManagementContext context = await this.ContextFactory.GetContext(state.EstateId, VoucherStateRepository.ConnectionStringIdentifier, cancellationToken); // Note: we don't want to select the state again here.... VoucherProjectionState entity = VoucherStateRepository.CreateVoucherProjectionState(state); @@ -134,7 +134,7 @@ private async Task LoadHelper(Guid estateId, Guid voucherId, CancellationToken cancellationToken) { - await using EstateManagementGenericContext? context = + await using EstateManagementContext? context = await this.ContextFactory.GetContext(estateId, VoucherStateRepository.ConnectionStringIdentifier, cancellationToken); VoucherProjectionState? entity = await context.VoucherProjectionStates.Where(m => m.VoucherId == voucherId).SingleOrDefaultAsync(cancellationToken: cancellationToken); diff --git a/TransactionProcessor.ProjectionEngine/TransactionProcessor.ProjectionEngine.csproj b/TransactionProcessor.ProjectionEngine/TransactionProcessor.ProjectionEngine.csproj index 09a43a71..c96c41dc 100644 --- a/TransactionProcessor.ProjectionEngine/TransactionProcessor.ProjectionEngine.csproj +++ b/TransactionProcessor.ProjectionEngine/TransactionProcessor.ProjectionEngine.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 enable enable @@ -9,11 +9,11 @@ - - - - - + + + + + diff --git a/TransactionProcessor.Repository/ITransactionProcessorReadModelRepository.cs b/TransactionProcessor.Repository/ITransactionProcessorReadModelRepository.cs index 8dd961e4..208d2971 100644 --- a/TransactionProcessor.Repository/ITransactionProcessorReadModelRepository.cs +++ b/TransactionProcessor.Repository/ITransactionProcessorReadModelRepository.cs @@ -302,11 +302,11 @@ Task RecordTransactionTimings(TransactionDomainEvents.TransactionTimings [ExcludeFromCodeCoverage] public class TransactionProcessorReadModelRepository : ITransactionProcessorReadModelRepository { - private readonly Shared.EntityFramework.IDbContextFactory DbContextFactory; + private readonly Shared.EntityFramework.IDbContextFactory DbContextFactory; private const String ConnectionStringIdentifier = "EstateReportingReadModel"; - public TransactionProcessorReadModelRepository(Shared.EntityFramework.IDbContextFactory dbContextFactory) { + public TransactionProcessorReadModelRepository(Shared.EntityFramework.IDbContextFactory dbContextFactory) { this.DbContextFactory = dbContextFactory; } @@ -314,7 +314,7 @@ public TransactionProcessorReadModelRepository(Shared.EntityFramework.IDbContext public async Task UpdateMerchant(StatementGeneratedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); Result merchantResult = await context.LoadMerchant(domainEvent, cancellationToken); if (merchantResult.IsFailed) @@ -332,7 +332,7 @@ public async Task> GetMerchantFromReference(Guid estateId, String reference, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.DbContextFactory.GetContext(estateId, ConnectionStringIdentifier, cancellationToken); + EstateManagementContext context = await this.DbContextFactory.GetContext(estateId, ConnectionStringIdentifier, cancellationToken); Merchant merchant = await (from m in context.Merchants where m.Reference == reference select m).SingleOrDefaultAsync(cancellationToken); @@ -345,7 +345,7 @@ public async Task> GetMerchantFromReference(Guid estateId, public async Task AddMerchant(MerchantDomainEvents.MerchantCreatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); Merchant merchant = new Merchant { @@ -364,7 +364,7 @@ public async Task AddMerchant(MerchantDomainEvents.MerchantCreatedEvent public async Task UpdateMerchant(MerchantNameUpdatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); Result merchantResult = await context.LoadMerchant(domainEvent, cancellationToken); if (merchantResult.IsFailed) @@ -378,7 +378,7 @@ public async Task UpdateMerchant(MerchantNameUpdatedEvent domainEvent, C public async Task AddMerchantAddress(AddressAddedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); MerchantAddress merchantAddress = new MerchantAddress { @@ -402,7 +402,7 @@ public async Task AddMerchantAddress(AddressAddedEvent domainEvent, public async Task AddMerchantContact(ContactAddedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); MerchantContact merchantContact = new MerchantContact { @@ -421,7 +421,7 @@ public async Task AddMerchantContact(ContactAddedEvent domainEvent, public async Task AddMerchantDevice(DeviceAddedToMerchantEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); MerchantDevice merchantDevice = new MerchantDevice { @@ -437,7 +437,7 @@ public async Task AddMerchantDevice(DeviceAddedToMerchantEvent domainEve public async Task SwapMerchantDevice(DeviceSwappedForMerchantEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getDeviceResult = await context.LoadMerchantDevice(domainEvent, cancellationToken); if (getDeviceResult.IsFailed) @@ -452,7 +452,7 @@ public async Task SwapMerchantDevice(DeviceSwappedForMerchantEvent domai public async Task AddMerchantOperator(OperatorAssignedToMerchantEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); String operatorName = domainEvent.Name; if (String.IsNullOrEmpty(operatorName)) { @@ -483,7 +483,7 @@ public async Task AddMerchantOperator(OperatorAssignedToMerchantEvent do public async Task AddMerchantSecurityUser(SecurityUserAddedToMerchantEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); MerchantSecurityUser merchantSecurityUser = new MerchantSecurityUser { @@ -499,7 +499,7 @@ public async Task AddMerchantSecurityUser(SecurityUserAddedToMerchantEve public async Task UpdateMerchant(SettlementScheduleChangedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); Result merchantResult = await context.LoadMerchant(domainEvent, cancellationToken); if (merchantResult.IsFailed) @@ -512,7 +512,7 @@ public async Task UpdateMerchant(SettlementScheduleChangedEvent domainEv public async Task RemoveOperatorFromMerchant(OperatorRemovedFromMerchantEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); MerchantOperator merchantOperator = await context.MerchantOperators.SingleOrDefaultAsync(o => o.OperatorId == domainEvent.OperatorId && o.MerchantId == domainEvent.MerchantId, @@ -529,7 +529,7 @@ public async Task RemoveOperatorFromMerchant(OperatorRemovedFromMerchant public async Task RemoveContractFromMerchant(ContractRemovedFromMerchantEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); MerchantContract merchantContract = await context.MerchantContracts.SingleOrDefaultAsync(o => o.ContractId == domainEvent.ContractId && o.MerchantId == domainEvent.MerchantId, @@ -547,7 +547,7 @@ public async Task RemoveContractFromMerchant(ContractRemovedFromMerchant public async Task UpdateMerchantAddress(MerchantAddressLine1UpdatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getMerchantAddressResult = await context.LoadMerchantAddress(domainEvent, cancellationToken); if (getMerchantAddressResult.IsFailed) @@ -561,7 +561,7 @@ public async Task UpdateMerchantAddress(MerchantAddressLine1UpdatedEvent public async Task UpdateMerchantAddress(MerchantAddressLine2UpdatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getMerchantAddressResult = await context.LoadMerchantAddress(domainEvent, cancellationToken); if (getMerchantAddressResult.IsFailed) @@ -575,7 +575,7 @@ public async Task UpdateMerchantAddress(MerchantAddressLine2UpdatedEvent public async Task UpdateMerchantAddress(MerchantAddressLine3UpdatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getMerchantAddressResult = await context.LoadMerchantAddress(domainEvent, cancellationToken); if (getMerchantAddressResult.IsFailed) @@ -589,7 +589,7 @@ public async Task UpdateMerchantAddress(MerchantAddressLine3UpdatedEvent public async Task UpdateMerchantAddress(MerchantAddressLine4UpdatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getMerchantAddressResult = await context.LoadMerchantAddress(domainEvent, cancellationToken); if (getMerchantAddressResult.IsFailed) @@ -603,7 +603,7 @@ public async Task UpdateMerchantAddress(MerchantAddressLine4UpdatedEvent public async Task UpdateMerchantAddress(MerchantCountyUpdatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getMerchantAddressResult = await context.LoadMerchantAddress(domainEvent, cancellationToken); if (getMerchantAddressResult.IsFailed) @@ -617,7 +617,7 @@ public async Task UpdateMerchantAddress(MerchantCountyUpdatedEvent domai public async Task UpdateMerchantAddress(MerchantRegionUpdatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getMerchantAddressResult = await context.LoadMerchantAddress(domainEvent, cancellationToken); if (getMerchantAddressResult.IsFailed) @@ -631,7 +631,7 @@ public async Task UpdateMerchantAddress(MerchantRegionUpdatedEvent domai public async Task UpdateMerchantAddress(MerchantTownUpdatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getMerchantAddressResult = await context.LoadMerchantAddress(domainEvent, cancellationToken); if (getMerchantAddressResult.IsFailed) @@ -645,7 +645,7 @@ public async Task UpdateMerchantAddress(MerchantTownUpdatedEvent domainE public async Task UpdateMerchantAddress(MerchantPostalCodeUpdatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getMerchantAddressResult = await context.LoadMerchantAddress(domainEvent, cancellationToken); if (getMerchantAddressResult.IsFailed) @@ -684,7 +684,7 @@ public async Task UpdateMerchantAddress(MerchantPostalCodeUpdatedEvent d public async Task UpdateMerchantContact(MerchantContactNameUpdatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getMerchantContactResult = await context.LoadMerchantContact(domainEvent, cancellationToken); if (getMerchantContactResult.IsFailed) @@ -698,7 +698,7 @@ public async Task UpdateMerchantContact(MerchantContactNameUpdatedEvent public async Task UpdateMerchantContact(MerchantContactEmailAddressUpdatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getMerchantContactResult = await context.LoadMerchantContact(domainEvent, cancellationToken); if (getMerchantContactResult.IsFailed) @@ -712,7 +712,7 @@ public async Task UpdateMerchantContact(MerchantContactEmailAddressUpdat public async Task UpdateMerchantContact(MerchantContactPhoneNumberUpdatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getMerchantContactResult = await context.LoadMerchantContact(domainEvent, cancellationToken); if (getMerchantContactResult.IsFailed) @@ -726,7 +726,7 @@ public async Task UpdateMerchantContact(MerchantContactPhoneNumberUpdate public async Task AddContractToMerchant(ContractAddedToMerchantEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); MerchantContract merchantContract = new MerchantContract { @@ -740,7 +740,7 @@ public async Task AddContractToMerchant(ContractAddedToMerchantEvent dom public async Task UpdateMerchant(MerchantReferenceAllocatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); Result merchantResult = await context.LoadMerchant(domainEvent, cancellationToken); if (merchantResult.IsFailed) @@ -754,7 +754,7 @@ public async Task UpdateMerchant(MerchantReferenceAllocatedEvent domainE public async Task>> GetMerchants(Guid estateId, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.DbContextFactory.GetContext(estateId, ConnectionStringIdentifier, cancellationToken); + EstateManagementContext context = await this.DbContextFactory.GetContext(estateId, ConnectionStringIdentifier, cancellationToken); Estate estate = await context.Estates.SingleOrDefaultAsync(e => e.EstateId == estateId, cancellationToken: cancellationToken); List merchants = await (from m in context.Merchants where m.EstateId == estateId select m).ToListAsync(cancellationToken); @@ -789,7 +789,7 @@ public async Task>> GetMerchantContracts(Guid estateI Guid merchantId, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.DbContextFactory.GetContext(estateId, ConnectionStringIdentifier, cancellationToken); + EstateManagementContext context = await this.DbContextFactory.GetContext(estateId, ConnectionStringIdentifier, cancellationToken); var x = await (from c in context.Contracts join cp in context.ContractProducts on c.ContractId equals cp.ContractId @@ -854,7 +854,7 @@ join e in context.Estates on c.EstateId equals e.EstateId public async Task>> GetContracts(Guid estateId, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.DbContextFactory.GetContext(estateId, ConnectionStringIdentifier, cancellationToken); + EstateManagementContext context = await this.DbContextFactory.GetContext(estateId, ConnectionStringIdentifier, cancellationToken); var query = await (from c in context.Contracts join cp in context.ContractProducts on c.ContractId equals cp.ContractId into cps @@ -922,7 +922,7 @@ join e in context.Estates on eo.EstateId equals e.EstateId public async Task> GetEstate(Guid estateId, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.DbContextFactory.GetContext(estateId, ConnectionStringIdentifier, cancellationToken); + EstateManagementContext context = await this.DbContextFactory.GetContext(estateId, ConnectionStringIdentifier, cancellationToken); Database.Entities.Estate? estate = await context.Estates.SingleOrDefaultAsync(e => e.EstateId == estateId, cancellationToken); @@ -937,7 +937,7 @@ join e in context.Estates on eo.EstateId equals e.EstateId return Result.Success(ModelFactory.ConvertFrom(estate, estateSecurityUsers, operators)); } - private async Task GetContextFromDomainEvent(IDomainEvent domainEvent, CancellationToken cancellationToken) + private async Task GetContextFromDomainEvent(IDomainEvent domainEvent, CancellationToken cancellationToken) { Guid estateId = Database.Contexts.DomainEventHelper.GetEstateId(domainEvent); if (estateId == Guid.Empty) @@ -950,7 +950,7 @@ private async Task GetContextFromDomainEvent(IDo public async Task AddContractProductTransactionFee(ContractDomainEvents.TransactionFeeForProductAddedToContractEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); ContractProductTransactionFee contractProductTransactionFee = new ContractProductTransactionFee { @@ -970,7 +970,7 @@ public async Task AddContractProductTransactionFee(ContractDomainEvents. public async Task AddEstate(EstateDomainEvents.EstateCreatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); // Add the estate to the read model Database.Entities.Estate estate = new Database.Entities.Estate @@ -986,7 +986,7 @@ public async Task AddEstate(EstateDomainEvents.EstateCreatedEvent domain public async Task AddEstateSecurityUser(EstateDomainEvents.SecurityUserAddedToEstateEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); EstateSecurityUser estateSecurityUser = new EstateSecurityUser { @@ -1003,7 +1003,7 @@ public async Task AddEstateSecurityUser(EstateDomainEvents.SecurityUserA public async Task AddProductDetailsToTransaction(TransactionDomainEvents.ProductDetailsAddedToTransactionEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getTransactionResult = await context.LoadTransaction(domainEvent, cancellationToken); if (getTransactionResult.IsFailed) @@ -1024,7 +1024,7 @@ public async Task AddProductDetailsToTransaction(TransactionDomainEvents public async Task AddSettledMerchantFeeToSettlement(TransactionDomainEvents.SettledMerchantFeeAddedToTransactionEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); MerchantSettlementFee merchantSettlementFee = new MerchantSettlementFee { @@ -1044,7 +1044,7 @@ public async Task AddSettledMerchantFeeToSettlement(TransactionDomainEve public async Task AddSourceDetailsToTransaction(TransactionDomainEvents.TransactionSourceAddedToTransactionEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getTransactionResult = await context.LoadTransaction(domainEvent, cancellationToken); if (getTransactionResult.IsFailed) @@ -1058,7 +1058,7 @@ public async Task AddSourceDetailsToTransaction(TransactionDomainEvents. public async Task CompleteReconciliation(ReconciliationDomainEvents.ReconciliationHasCompletedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getReconcilationResult = await context.LoadReconcilation(domainEvent, cancellationToken); if (getReconcilationResult.IsFailed) @@ -1072,7 +1072,7 @@ public async Task CompleteReconciliation(ReconciliationDomainEvents.Reco public async Task CompleteTransaction(TransactionDomainEvents.TransactionHasBeenCompletedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getTransactionResult = await context.LoadTransaction(domainEvent, cancellationToken); if (getTransactionResult.IsFailed) @@ -1086,7 +1086,7 @@ public async Task CompleteTransaction(TransactionDomainEvents.Transactio public async Task CreateFloat(FloatDomainEvents.FloatCreatedForContractProductEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); Database.Entities.Float floatRecord = new Database.Entities.Float { @@ -1103,7 +1103,7 @@ public async Task CreateFloat(FloatDomainEvents.FloatCreatedForContractP public async Task CreateFloatActivity(FloatDomainEvents.FloatCreditPurchasedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); FloatActivity floatActivity = new FloatActivity { @@ -1121,7 +1121,7 @@ public async Task CreateFloatActivity(FloatDomainEvents.FloatCreditPurch public async Task CreateFloatActivity(FloatDomainEvents.FloatDecreasedByTransactionEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getTransactionResult = await context.LoadTransaction(domainEvent, cancellationToken); if (getTransactionResult.IsFailed) @@ -1144,7 +1144,7 @@ public async Task CreateFloatActivity(FloatDomainEvents.FloatDecreasedBy public async Task CreateReadModel(EstateDomainEvents.EstateCreatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); Logger.LogInformation($"About to run migrations on Read Model database for estate [{domainEvent.EstateId}]"); @@ -1157,7 +1157,7 @@ public async Task CreateReadModel(EstateDomainEvents.EstateCreatedEvent public async Task CreateSettlement(SettlementDomainEvents.SettlementCreatedForDateEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); Database.Entities.Settlement settlement = new Database.Entities.Settlement { @@ -1175,7 +1175,7 @@ public async Task CreateSettlement(SettlementDomainEvents.SettlementCrea public async Task DisableContractProductTransactionFee(ContractDomainEvents.TransactionFeeForProductDisabledEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); Result loadContractProductTransactionFeeResult = await context.LoadContractProductTransactionFee(domainEvent, cancellationToken); // TODO: Check the result value @@ -1189,7 +1189,7 @@ public async Task DisableContractProductTransactionFee(ContractDomainEve public async Task MarkMerchantFeeAsSettled(SettlementDomainEvents.MerchantFeeSettledEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); // TODO: LoadMerchantSettlementFee MerchantSettlementFee merchantFee = await context.MerchantSettlementFees.Where(m => @@ -1210,7 +1210,7 @@ public async Task MarkMerchantFeeAsSettled(SettlementDomainEvents.Mercha public async Task MarkSettlementAsCompleted(SettlementDomainEvents.SettlementCompletedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getSettlementResult = await context.LoadSettlement(domainEvent, cancellationToken); if (getSettlementResult.IsFailed) @@ -1223,7 +1223,7 @@ public async Task MarkSettlementAsCompleted(SettlementDomainEvents.Settl public async Task MarkSettlementAsProcessingStarted(SettlementDomainEvents.SettlementProcessingStartedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getSettlementResult = await context.LoadSettlement(domainEvent, cancellationToken); if (getSettlementResult.IsFailed) @@ -1245,7 +1245,7 @@ public async Task MarkSettlementAsProcessingStarted(SettlementDomainEven public async Task RecordTransactionAdditionalRequestData(TransactionDomainEvents.AdditionalRequestDataRecordedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); TransactionAdditionalRequestData additionalRequestData = new TransactionAdditionalRequestData { @@ -1288,7 +1288,7 @@ public async Task RecordTransactionAdditionalRequestData(TransactionDoma public async Task RecordTransactionAdditionalResponseData(TransactionDomainEvents.AdditionalResponseDataRecordedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); TransactionAdditionalResponseData additionalResponseData = new TransactionAdditionalResponseData { @@ -1317,7 +1317,7 @@ public async Task RecordTransactionAdditionalResponseData(TransactionDom public async Task SetTransactionAmount(TransactionDomainEvents.AdditionalRequestDataRecordedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getTransactionResult = await context.LoadTransaction(domainEvent, cancellationToken); if (getTransactionResult.IsFailed) @@ -1344,7 +1344,7 @@ public async Task SetTransactionAmount(TransactionDomainEvents.Additiona public async Task StartReconciliation(ReconciliationDomainEvents.ReconciliationHasStartedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); Database.Entities.Reconciliation reconciliation = new Database.Entities.Reconciliation { @@ -1362,7 +1362,7 @@ public async Task StartReconciliation(ReconciliationDomainEvents.Reconci public async Task StartTransaction(TransactionDomainEvents.TransactionHasStartedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); Database.Entities.Transaction t = new Database.Entities.Transaction { @@ -1390,7 +1390,7 @@ public async Task StartTransaction(TransactionDomainEvents.TransactionHa public async Task UpdateEstate(EstateDomainEvents.EstateReferenceAllocatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getEstateResult = await context.LoadEstate(domainEvent, cancellationToken); if (getEstateResult.IsFailed) @@ -1404,7 +1404,7 @@ public async Task UpdateEstate(EstateDomainEvents.EstateReferenceAllocat public async Task UpdateMerchant(TransactionDomainEvents.TransactionHasBeenCompletedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); Result merchantResult = await context.LoadMerchant(domainEvent, cancellationToken); if (merchantResult.IsFailed) @@ -1424,7 +1424,7 @@ public async Task UpdateReconciliationOverallTotals(ReconciliationDomain CancellationToken cancellationToken) { Guid estateId = domainEvent.EstateId; - EstateManagementGenericContext context = await this.DbContextFactory.GetContext(estateId, ConnectionStringIdentifier, cancellationToken); + EstateManagementContext context = await this.DbContextFactory.GetContext(estateId, ConnectionStringIdentifier, cancellationToken); var getReconcilationResult = await context.LoadReconcilation(domainEvent, cancellationToken); if (getReconcilationResult.IsFailed) @@ -1439,7 +1439,7 @@ public async Task UpdateReconciliationOverallTotals(ReconciliationDomain public async Task UpdateReconciliationStatus(ReconciliationDomainEvents.ReconciliationHasBeenLocallyAuthorisedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getReconcilationResult = await context.LoadReconcilation(domainEvent, cancellationToken); if (getReconcilationResult.IsFailed) @@ -1455,7 +1455,7 @@ public async Task UpdateReconciliationStatus(ReconciliationDomainEvents. public async Task UpdateReconciliationStatus(ReconciliationDomainEvents.ReconciliationHasBeenLocallyDeclinedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getReconcilationResult = await context.LoadReconcilation(domainEvent, cancellationToken); if (getReconcilationResult.IsFailed) @@ -1471,7 +1471,7 @@ public async Task UpdateReconciliationStatus(ReconciliationDomainEvents. public async Task UpdateTransactionAuthorisation(TransactionDomainEvents.TransactionHasBeenLocallyAuthorisedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getTransactionResult = await context.LoadTransaction(domainEvent, cancellationToken); if (getTransactionResult.IsFailed) @@ -1488,7 +1488,7 @@ public async Task UpdateTransactionAuthorisation(TransactionDomainEvents public async Task UpdateTransactionAuthorisation(TransactionDomainEvents.TransactionHasBeenLocallyDeclinedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getTransactionResult = await context.LoadTransaction(domainEvent, cancellationToken); if (getTransactionResult.IsFailed) @@ -1504,7 +1504,7 @@ public async Task UpdateTransactionAuthorisation(TransactionDomainEvents public async Task UpdateTransactionAuthorisation(TransactionDomainEvents.TransactionAuthorisedByOperatorEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getTransactionResult = await context.LoadTransaction(domainEvent, cancellationToken); if (getTransactionResult.IsFailed) @@ -1521,7 +1521,7 @@ public async Task UpdateTransactionAuthorisation(TransactionDomainEvents public async Task UpdateTransactionAuthorisation(TransactionDomainEvents.TransactionDeclinedByOperatorEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getTransactionResult = await context.LoadTransaction(domainEvent, cancellationToken); if (getTransactionResult.IsFailed) @@ -1570,7 +1570,7 @@ public async Task UpdateTransactionAuthorisation(TransactionDomainEvents public async Task>> GetOperators(Guid estateId, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.DbContextFactory.GetContext(estateId, ConnectionStringIdentifier, cancellationToken); + EstateManagementContext context = await this.DbContextFactory.GetContext(estateId, ConnectionStringIdentifier, cancellationToken); Database.Entities.Estate estate = await context.Estates.SingleOrDefaultAsync(e => e.EstateId == estateId, cancellationToken: cancellationToken); List operators = await (from o in context.Operators where o.EstateId == estate.EstateId select o).ToListAsync(cancellationToken); @@ -1593,7 +1593,7 @@ public async Task UpdateTransactionAuthorisation(TransactionDomainEvents public async Task UpdateOperator(OperatorDomainEvents.OperatorNameUpdatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); Result operatorResult = await context.LoadOperator(domainEvent, cancellationToken); if (operatorResult.IsFailed) @@ -1606,7 +1606,7 @@ public async Task UpdateOperator(OperatorDomainEvents.OperatorNameUpdate public async Task UpdateOperator(OperatorDomainEvents.OperatorRequireCustomMerchantNumberChangedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); Result operatorResult = await context.LoadOperator(domainEvent, cancellationToken); if (operatorResult.IsFailed) @@ -1620,7 +1620,7 @@ public async Task UpdateOperator(OperatorDomainEvents.OperatorRequireCus public async Task UpdateOperator(OperatorDomainEvents.OperatorRequireCustomTerminalNumberChangedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); Result operatorResult = await context.LoadOperator(domainEvent, cancellationToken); if (operatorResult.IsFailed) @@ -1634,7 +1634,7 @@ public async Task UpdateOperator(OperatorDomainEvents.OperatorRequireCus public async Task AddOperator(OperatorDomainEvents.OperatorCreatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); Database.Entities.Operator @operator = new Database.Entities.Operator { @@ -1652,7 +1652,7 @@ public async Task AddOperator(OperatorDomainEvents.OperatorCreatedEvent public async Task AddContract(ContractDomainEvents.ContractCreatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); Contract contract = new Contract { @@ -1669,7 +1669,7 @@ public async Task AddContract(ContractDomainEvents.ContractCreatedEvent public async Task AddContractProduct(ContractDomainEvents.VariableValueProductAddedToContractEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); ContractProduct contractProduct = new ContractProduct { @@ -1688,7 +1688,7 @@ public async Task AddContractProduct(ContractDomainEvents.VariableValueP public async Task AddContractProduct(ContractDomainEvents.FixedValueProductAddedToContractEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); ContractProduct contractProduct = new ContractProduct { @@ -1708,7 +1708,7 @@ public async Task AddContractProduct(ContractDomainEvents.FixedValueProd public async Task MarkStatementAsGenerated(StatementGeneratedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getLoadStatementHeaderResult = await context.LoadStatementHeader(domainEvent, cancellationToken); if (getLoadStatementHeaderResult.IsFailed) @@ -1755,7 +1755,7 @@ public async Task MarkStatementAsGenerated(StatementGeneratedEvent domai public async Task CreateStatement(StatementCreatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); StatementHeader header = new StatementHeader { @@ -1807,7 +1807,7 @@ public async Task CreateStatement(StatementCreatedEvent domainEvent, public async Task AddFile(FileCreatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); File file = new File { @@ -1830,7 +1830,7 @@ public async Task AddFile(FileCreatedEvent domainEvent, public async Task AddFileImportLog(ImportLogCreatedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); FileImportLog fileImportLog = new FileImportLog { @@ -1848,7 +1848,7 @@ public async Task AddFileImportLog(ImportLogCreatedEvent domainEvent, public async Task AddFileLineToFile(FileLineAddedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); FileLine fileLine = new FileLine { @@ -1866,7 +1866,7 @@ public async Task AddFileLineToFile(FileLineAddedEvent domainEvent, public async Task AddFileToImportLog(FileAddedToImportLogEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); FileImportLogFile fileImportLogFile = new FileImportLogFile { @@ -1889,7 +1889,7 @@ public async Task AddFileToImportLog(FileAddedToImportLogEvent domainEve public async Task UpdateFileAsComplete(FileProcessingCompletedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); var getFileResult = await context.LoadFile(domainEvent, cancellationToken); if (getFileResult.IsFailed) @@ -1904,7 +1904,7 @@ public async Task UpdateFileAsComplete(FileProcessingCompletedEvent doma public async Task UpdateFileLine(FileLineProcessingSuccessfulEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); return await this.UpdateFileLineStatus(context, domainEvent.FileId, @@ -1914,7 +1914,7 @@ public async Task UpdateFileLine(FileLineProcessingSuccessfulEvent domai cancellationToken); } - private async Task UpdateFileLineStatus(EstateManagementGenericContext context, + private async Task UpdateFileLineStatus(EstateManagementContext context, Guid fileId, Int32 lineNumber, Guid transactionId, @@ -1937,7 +1937,7 @@ private async Task UpdateFileLineStatus(EstateManagementGenericContext c public async Task UpdateFileLine(FileLineProcessingFailedEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); return await this.UpdateFileLineStatus(context, domainEvent.FileId, @@ -1950,7 +1950,7 @@ public async Task UpdateFileLine(FileLineProcessingFailedEvent domainEve public async Task UpdateFileLine(FileLineProcessingIgnoredEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); return await this.UpdateFileLineStatus(context, domainEvent.FileId, @@ -1963,7 +1963,7 @@ public async Task UpdateFileLine(FileLineProcessingIgnoredEvent domainEv public async Task AddPendingMerchantFeeToSettlement(SettlementDomainEvents.MerchantFeeAddedPendingSettlementEvent domainEvent, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); + EstateManagementContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken); MerchantSettlementFee merchantSettlementFee = new MerchantSettlementFee { @@ -1987,7 +1987,7 @@ public async Task> GetSettlement(Guid estateId, Guid settlementId, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.DbContextFactory.GetContext(estateId, ConnectionStringIdentifier, cancellationToken); + EstateManagementContext context = await this.DbContextFactory.GetContext(estateId, ConnectionStringIdentifier, cancellationToken); IQueryable query = context.SettlementsView.Where(t => t.EstateId == estateId && t.SettlementId == settlementId && t.MerchantId == merchantId).AsQueryable(); @@ -2032,7 +2032,7 @@ public async Task>> GetSettlements(Guid estateId, String endDate, CancellationToken cancellationToken) { - EstateManagementGenericContext context = await this.DbContextFactory.GetContext(estateId, ConnectionStringIdentifier, cancellationToken); + EstateManagementContext context = await this.DbContextFactory.GetContext(estateId, ConnectionStringIdentifier, cancellationToken); DateTime queryStartDate = DateTime.ParseExact(startDate, "yyyyMMdd", null); DateTime queryEndDate = DateTime.ParseExact(endDate, "yyyyMMdd", null); @@ -2074,7 +2074,7 @@ public async Task RecordTransactionTimings(TransactionDomainEvents.Trans TimeSpan transactionTime = totalTime.Subtract(operatorCommunicationsTime); // Load this information to the database - EstateManagementGenericContext context = await this.DbContextFactory.GetContext(domainEvent.EstateId, ConnectionStringIdentifier, cancellationToken); + EstateManagementContext context = await this.DbContextFactory.GetContext(domainEvent.EstateId, ConnectionStringIdentifier, cancellationToken); TransactionTimings timings = new() { TransactionStartedDateTime = domainEvent.TransactionStartedDateTime, diff --git a/TransactionProcessor.Repository/TransactionProcessor.Repository.csproj b/TransactionProcessor.Repository/TransactionProcessor.Repository.csproj index 75e6e1e8..de771d24 100644 --- a/TransactionProcessor.Repository/TransactionProcessor.Repository.csproj +++ b/TransactionProcessor.Repository/TransactionProcessor.Repository.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 enable enable None @@ -10,13 +10,14 @@ - - - - - - - + + + + + + + + diff --git a/TransactionProcessor.Settlement.DomainEvents/SettlementAggregateDomainEvents.cs b/TransactionProcessor.Settlement.DomainEvents/SettlementAggregateDomainEvents.cs deleted file mode 100644 index 2ecc4b20..00000000 --- a/TransactionProcessor.Settlement.DomainEvents/SettlementAggregateDomainEvents.cs +++ /dev/null @@ -1,45 +0,0 @@ -namespace TransactionProcessor.Settlement.DomainEvents{ - using System; - using System.Diagnostics.CodeAnalysis; - using Shared.DomainDrivenDesign.EventSourcing; - - [ExcludeFromCodeCoverage] - public record MerchantFeeAddedPendingSettlementEvent(Guid SettlementId, - Guid EstateId, - Guid MerchantId, - Guid TransactionId, - Decimal CalculatedValue, - Int32 FeeCalculationType, - Guid FeeId, - Decimal FeeValue, - DateTime FeeCalculatedDateTime) : DomainEvent(SettlementId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record MerchantFeeSettledEvent(Guid SettlementId, - Guid EstateId, - Guid MerchantId, - Guid TransactionId, - Decimal CalculatedValue, - Int32 FeeCalculationType, - Guid FeeId, - Decimal FeeValue, - DateTime FeeCalculatedDateTime, - DateTime SettledDateTime) : DomainEvent(SettlementId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record SettlementCompletedEvent(Guid SettlementId, - Guid EstateId, - Guid MerchantId) : DomainEvent(SettlementId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record SettlementCreatedForDateEvent(Guid SettlementId, - Guid EstateId, - Guid MerchantId, - DateTime SettlementDate) : DomainEvent(SettlementId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record SettlementProcessingStartedEvent(Guid SettlementId, - Guid EstateId, - Guid MerchantId, - DateTime ProcessingStartedDateTime) : DomainEvent(SettlementId, Guid.NewGuid()); -} \ No newline at end of file diff --git a/TransactionProcessor.Settlement.DomainEvents/TransactionProcessor.Settlement.DomainEvents.csproj b/TransactionProcessor.Settlement.DomainEvents/TransactionProcessor.Settlement.DomainEvents.csproj deleted file mode 100644 index 877a9c1e..00000000 --- a/TransactionProcessor.Settlement.DomainEvents/TransactionProcessor.Settlement.DomainEvents.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - net8.0 - - - - - - - diff --git a/TransactionProcessor.Testing/TestData.cs b/TransactionProcessor.Testing/TestData.cs index 69a2f45a..f9e03913 100644 --- a/TransactionProcessor.Testing/TestData.cs +++ b/TransactionProcessor.Testing/TestData.cs @@ -687,7 +687,6 @@ public static Dictionary AdditionalTransactionMetaDataForPataPaw ["AppSettings:SecurityService"] = "http://127.0.0.1", ["AppSettings:ContractProductFeeCacheExpiryInHours"] = "", ["AppSettings:ContractProductFeeCacheEnabled"] = "", - ["AppSettings:DatabaseEngine"] = "SqlServer", ["ConnectionStrings:HealthCheck"] = "HealthCheck", ["ConnectionStrings:EstateReportingReadModel"] = "", ["ConnectionStrings:TransactionProcessorReadModel"] = "" diff --git a/TransactionProcessor.Testing/TransactionProcessor.Testing.csproj b/TransactionProcessor.Testing/TransactionProcessor.Testing.csproj index f6b44102..21b5da46 100644 --- a/TransactionProcessor.Testing/TransactionProcessor.Testing.csproj +++ b/TransactionProcessor.Testing/TransactionProcessor.Testing.csproj @@ -1,18 +1,19 @@  - net8.0 + net9.0 None - - - - - - - + + + + + + + + diff --git a/TransactionProcessor.Tests/General/BootstrapperTests.cs b/TransactionProcessor.Tests/General/BootstrapperTests.cs index abe8ef81..4ef336cb 100644 --- a/TransactionProcessor.Tests/General/BootstrapperTests.cs +++ b/TransactionProcessor.Tests/General/BootstrapperTests.cs @@ -53,6 +53,7 @@ private IConfigurationRoot SetupMemoryConfiguration() configuration.Add("AppSettings:VoucherManagementApi", "http://localhost"); configuration.Add("AppSettings:SecurityService", "http://localhost"); configuration.Add("SecurityConfiguration:Authority", "http://localhost"); + configuration.Add("ConnectionStrings:TransactionProcessorReadModel", "dbconnstring"); builder.AddInMemoryCollection(configuration); diff --git a/TransactionProcessor.Tests/TransactionProcessor.Tests.csproj b/TransactionProcessor.Tests/TransactionProcessor.Tests.csproj index 7924a85a..8aa9953d 100644 --- a/TransactionProcessor.Tests/TransactionProcessor.Tests.csproj +++ b/TransactionProcessor.Tests/TransactionProcessor.Tests.csproj @@ -1,28 +1,29 @@  - net8.0 + net9.0 None false - - - - - - - + + + + + + + - - + - - - + + + + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/TransactionProcessor.Transaction.DomainEvents/TransactionAggregateDomainEvents.cs b/TransactionProcessor.Transaction.DomainEvents/TransactionAggregateDomainEvents.cs deleted file mode 100644 index b8840606..00000000 --- a/TransactionProcessor.Transaction.DomainEvents/TransactionAggregateDomainEvents.cs +++ /dev/null @@ -1,157 +0,0 @@ -namespace TransactionProcessor.Transaction.DomainEvents{ - using System; - using System.Collections.Generic; - using System.Diagnostics.CodeAnalysis; - using Shared.DomainDrivenDesign.EventSourcing; - - [ExcludeFromCodeCoverage] - public record CustomerEmailReceiptResendRequestedEvent(Guid TransactionId, - Guid EstateId, - Guid MerchantId, - DateTime TransactionDateTime) : DomainEvent(TransactionId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record CustomerEmailReceiptRequestedEvent(Guid TransactionId, - Guid EstateId, - Guid MerchantId, - String CustomerEmailAddress, - DateTime TransactionDateTime) : DomainEvent(TransactionId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record AdditionalRequestDataRecordedEvent(Guid TransactionId, - Guid EstateId, - Guid MerchantId, - Guid OperatorId, - Dictionary AdditionalTransactionRequestMetadata, - DateTime TransactionDateTime) : DomainEvent(TransactionId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record AdditionalResponseDataRecordedEvent(Guid TransactionId, - Guid EstateId, - Guid MerchantId, - Guid OperatorId, - Dictionary AdditionalTransactionResponseMetadata, - DateTime TransactionDateTime) : DomainEvent(TransactionId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record SettledMerchantFeeAddedToTransactionEvent(Guid TransactionId, - Guid EstateId, - Guid MerchantId, - Decimal CalculatedValue, - Int32 FeeCalculationType, - Guid FeeId, - Decimal FeeValue, - DateTime FeeCalculatedDateTime, - DateTime SettledDateTime, - Guid SettlementId, - DateTime TransactionDateTime) : DomainEvent(TransactionId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record MerchantFeePendingSettlementAddedToTransactionEvent(Guid TransactionId, - Guid EstateId, - Guid MerchantId, - Decimal CalculatedValue, - Int32 FeeCalculationType, - Guid FeeId, - Decimal FeeValue, - DateTime FeeCalculatedDateTime, - DateTime SettlementDueDate, - DateTime TransactionDateTime) : DomainEvent(TransactionId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record ProductDetailsAddedToTransactionEvent(Guid TransactionId, - Guid EstateId, - Guid MerchantId, - Guid ContractId, - Guid ProductId, - DateTime TransactionDateTime) : DomainEvent(TransactionId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record ServiceProviderFeeAddedToTransactionEvent(Guid TransactionId, - Guid EstateId, - Guid MerchantId, - Decimal CalculatedValue, - Int32 FeeCalculationType, - Guid FeeId, - Decimal FeeValue, - DateTime FeeCalculatedDateTime, - DateTime TransactionDateTime) : DomainEvent(TransactionId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record TransactionAuthorisedByOperatorEvent(Guid TransactionId, - Guid EstateId, - Guid MerchantId, - Guid OperatorId, - String AuthorisationCode, - String OperatorResponseCode, - String OperatorResponseMessage, - String OperatorTransactionId, - String ResponseCode, - String ResponseMessage, - DateTime TransactionDateTime) : DomainEvent(TransactionId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record TransactionCostInformationRecordedEvent(Guid TransactionId, - Guid EstateId, - Guid MerchantId, - Decimal? UnitCostValue, - Decimal? TotalCostValue, - DateTime TransactionDateTime) : DomainEvent(TransactionId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record TransactionDeclinedByOperatorEvent(Guid TransactionId, - Guid EstateId, - Guid MerchantId, - Guid OperatorId, - String OperatorResponseCode, - String OperatorResponseMessage, - String ResponseCode, - String ResponseMessage, - DateTime TransactionDateTime) : DomainEvent(TransactionId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record TransactionHasBeenCompletedEvent(Guid TransactionId, - Guid EstateId, - Guid MerchantId, - String ResponseCode, - String ResponseMessage, - Boolean IsAuthorised, - DateTime CompletedDateTime, - Decimal? TransactionAmount, - DateTime TransactionDateTime) : DomainEvent(TransactionId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record TransactionHasBeenLocallyAuthorisedEvent(Guid TransactionId, - Guid EstateId, - Guid MerchantId, - String AuthorisationCode, - String ResponseCode, - String ResponseMessage, - DateTime TransactionDateTime) : DomainEvent(TransactionId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record TransactionHasBeenLocallyDeclinedEvent(Guid TransactionId, - Guid EstateId, - Guid MerchantId, - String ResponseCode, - String ResponseMessage, - DateTime TransactionDateTime) : DomainEvent(TransactionId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record TransactionHasStartedEvent(Guid TransactionId, - Guid EstateId, - Guid MerchantId, - DateTime TransactionDateTime, - String TransactionNumber, - String TransactionType, - String TransactionReference, - String DeviceIdentifier, - Decimal? TransactionAmount) : DomainEvent(TransactionId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record TransactionSourceAddedToTransactionEvent(Guid TransactionId, - Guid EstateId, - Guid MerchantId, - Int32 TransactionSource, - DateTime TransactionDateTime) : DomainEvent(TransactionId, Guid.NewGuid()); -} \ No newline at end of file diff --git a/TransactionProcessor.Transaction.DomainEvents/TransactionProcessor.Transaction.DomainEvents.csproj b/TransactionProcessor.Transaction.DomainEvents/TransactionProcessor.Transaction.DomainEvents.csproj deleted file mode 100644 index 24b82e11..00000000 --- a/TransactionProcessor.Transaction.DomainEvents/TransactionProcessor.Transaction.DomainEvents.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - net8.0 - - - - - - - diff --git a/TransactionProcessor.Voucher.DomainEvents/TransactionProcessor.Voucher.DomainEvents.csproj b/TransactionProcessor.Voucher.DomainEvents/TransactionProcessor.Voucher.DomainEvents.csproj deleted file mode 100644 index e515a667..00000000 --- a/TransactionProcessor.Voucher.DomainEvents/TransactionProcessor.Voucher.DomainEvents.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - net8.0 - enable - enable - - - - - - diff --git a/TransactionProcessor.Voucher.DomainEvents/VoucherAggregateDomainEvents.cs b/TransactionProcessor.Voucher.DomainEvents/VoucherAggregateDomainEvents.cs deleted file mode 100644 index ecb50b66..00000000 --- a/TransactionProcessor.Voucher.DomainEvents/VoucherAggregateDomainEvents.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace TransactionProcessor.Voucher.DomainEvents{ - using System.Diagnostics.CodeAnalysis; - using Shared.DomainDrivenDesign.EventSourcing; - - [ExcludeFromCodeCoverage] - public record BarcodeAddedEvent(Guid VoucherId, - Guid EstateId, - String Barcode) : DomainEvent(VoucherId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record VoucherFullyRedeemedEvent(Guid VoucherId, - Guid EstateId, - DateTime RedeemedDateTime) : DomainEvent(VoucherId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record VoucherGeneratedEvent(Guid VoucherId, - Guid EstateId, - Guid TransactionId, - DateTime GeneratedDateTime, - Guid OperatorId, - Decimal Value, - String VoucherCode, - DateTime ExpiryDateTime, - String Message) : DomainEvent(VoucherId, Guid.NewGuid()); - - [ExcludeFromCodeCoverage] - public record VoucherIssuedEvent(Guid VoucherId, - Guid EstateId, - DateTime IssuedDateTime, - String RecipientEmail, - String RecipientMobile) : DomainEvent(VoucherId, Guid.NewGuid()); -} \ No newline at end of file diff --git a/TransactionProcessor/Bootstrapper/MiddlewareRegistry.cs b/TransactionProcessor/Bootstrapper/MiddlewareRegistry.cs index d08df820..35240ae5 100644 --- a/TransactionProcessor/Bootstrapper/MiddlewareRegistry.cs +++ b/TransactionProcessor/Bootstrapper/MiddlewareRegistry.cs @@ -1,4 +1,7 @@ -namespace TransactionProcessor.Bootstrapper +using Microsoft.IdentityModel.Logging; +using Microsoft.IdentityModel.Tokens; + +namespace TransactionProcessor.Bootstrapper { using System; using System.Diagnostics.CodeAnalysis; @@ -12,8 +15,6 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Diagnostics.HealthChecks; - using Microsoft.IdentityModel.Logging; - using Microsoft.IdentityModel.Tokens; using Microsoft.OpenApi.Models; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; @@ -98,13 +99,13 @@ public MiddlewareRegistry() options.Audience = ConfigurationReader.GetValue("SecurityConfiguration", "ApiName"); options.TokenValidationParameters = new TokenValidationParameters - { - ValidateAudience = false, - ValidAudience = + { + ValidateAudience = false, + ValidAudience = ConfigurationReader.GetValue("SecurityConfiguration", "ApiName"), - ValidIssuer = + ValidIssuer = ConfigurationReader.GetValue("SecurityConfiguration", "Authority"), - }; + }; options.IncludeErrorDetails = true; }); diff --git a/TransactionProcessor/Bootstrapper/RepositoryRegistry.cs b/TransactionProcessor/Bootstrapper/RepositoryRegistry.cs index 4df789f3..d5aa9f22 100644 --- a/TransactionProcessor/Bootstrapper/RepositoryRegistry.cs +++ b/TransactionProcessor/Bootstrapper/RepositoryRegistry.cs @@ -5,16 +5,12 @@ namespace TransactionProcessor.Bootstrapper { - using System; - using System.Data.Common; - using System.Diagnostics.CodeAnalysis; - using System.Threading; - using System.Threading.Tasks; using Lamar; using Microsoft.Data.SqlClient; + using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; - using MySqlConnector; + using Microsoft.Extensions.Hosting; using ProjectionEngine.Database.Database; using ProjectionEngine.Projections; using ProjectionEngine.Repository; @@ -27,6 +23,11 @@ namespace TransactionProcessor.Bootstrapper using Shared.EventStore.SubscriptionWorker; using Shared.General; using Shared.Repositories; + using System; + using System.Data.Common; + using System.Diagnostics.CodeAnalysis; + using System.Threading; + using System.Threading.Tasks; /// /// @@ -91,21 +92,21 @@ public RepositoryRegistry() this.AddSingleton(); this.AddSingleton, MerchantBalanceProjection>(); - this.AddSingleton, DbContextFactory>(); - - this.AddSingleton>(cont => connectionString => - { - String databaseEngine = - ConfigurationReader.GetValue("AppSettings", "DatabaseEngine"); - - return databaseEngine switch - { - "MySql" => new EstateManagementMySqlContext(connectionString), - "SqlServer" => new EstateManagementSqlServerContext(connectionString), - _ => throw new - NotSupportedException($"Unsupported Database Engine {databaseEngine}") - }; - }); + this.AddSingleton, DbContextFactory>(); + + if (Startup.WebHostEnvironment.IsEnvironment("IntegrationTest") || Startup.Configuration.GetValue("ServiceOptions:UseInMemoryDatabase") == true) + { + this.AddDbContext(builder => builder.UseInMemoryDatabase("EstateManagementReadModel")); + DbContextOptionsBuilder contextBuilder = new DbContextOptionsBuilder(); + contextBuilder = contextBuilder.UseInMemoryDatabase("EstateManagementReadModel"); + this.AddSingleton>(cont => (connectionString) => { return new EstateManagementContext(contextBuilder.Options); }); + } + else + { + String connectionString = ConfigurationReader.GetConnectionString("TransactionProcessorReadModel"); + this.AddDbContext(builder => builder.UseSqlServer(connectionString)); + this.AddSingleton>(cont => (connectionString) => { return new EstateManagementContext(connectionString); }); + } this.AddSingleton>(cont => (esConnString, cacheDuration) => { return SubscriptionRepository.Create(esConnString, cacheDuration); @@ -148,22 +149,12 @@ public async Task GetConnectionString(String externalIdentifier, connectionString = ConfigurationReader.GetConnectionString(connectionStringIdentifier); DbConnectionStringBuilder builder = null; - - if (databaseEngine == "MySql") - { - builder = new MySqlConnectionStringBuilder(connectionString) - { - Database = databaseName - }; - } - else + + // Default to SQL Server + builder = new SqlConnectionStringBuilder(connectionString) { - // Default to SQL Server - builder = new SqlConnectionStringBuilder(connectionString) - { - InitialCatalog = databaseName - }; - } + InitialCatalog = databaseName + }; return builder.ToString(); } diff --git a/TransactionProcessor/Dockerfile b/TransactionProcessor/Dockerfile index 74c8b738..d56448a3 100644 --- a/TransactionProcessor/Dockerfile +++ b/TransactionProcessor/Dockerfile @@ -1,7 +1,7 @@ FROM stuartferguson/txnprocbase:latest AS base WORKDIR /app -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build WORKDIR /src COPY ["TransactionProcessor/NuGet.Config", "."] COPY ["TransactionProcessor/TransactionProcessor.csproj", "TransactionProcessor/"] diff --git a/TransactionProcessor/Dockerfilewindows b/TransactionProcessor/Dockerfilewindows index 99510a9c..40a8464f 100644 --- a/TransactionProcessor/Dockerfilewindows +++ b/TransactionProcessor/Dockerfilewindows @@ -2,7 +2,7 @@ FROM stuartferguson/txnprocbasewindows AS base USER ContainerAdministrator WORKDIR /app -FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build +FROM mcr.microsoft.com/dotnet/sdk:9.0-windowsservercore-ltsc2022 AS build WORKDIR /src COPY ["TransactionProcessor/NuGet.Config", "."] COPY ["TransactionProcessor/TransactionProcessor.csproj", "TransactionProcessor/"] diff --git a/TransactionProcessor/Startup.cs b/TransactionProcessor/Startup.cs index b59697d6..47f738ab 100644 --- a/TransactionProcessor/Startup.cs +++ b/TransactionProcessor/Startup.cs @@ -1,3 +1,4 @@ +using System.Linq; using System.Threading; using Prometheus; using TransactionProcessor.BusinessLogic.Services; @@ -159,6 +160,17 @@ public void Configure(IApplicationBuilder app, app.UseSwaggerUI(); app.PreWarm(); + + var _ = typeof(Microsoft.IdentityModel.Tokens.TokenValidationResult); // Force load + var loadedTokensAssemblies = AppDomain.CurrentDomain + .GetAssemblies() + .Where(a => a.GetName().Name == "Microsoft.IdentityModel.Tokens") + .ToList(); + + foreach (var asm in loadedTokensAssemblies) + { + Console.WriteLine($"[Trace] Tokens Assembly: {asm.Location} — Version: {asm.GetName().Version}"); + } } public void ConfigureContainer(ServiceRegistry services) { diff --git a/TransactionProcessor/TransactionProcessor.csproj b/TransactionProcessor/TransactionProcessor.csproj index 3388fb40..270321a6 100644 --- a/TransactionProcessor/TransactionProcessor.csproj +++ b/TransactionProcessor/TransactionProcessor.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 Linux @@ -10,45 +10,46 @@ - - - + + + - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + - - - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/TransactionProcessor/appsettings.json b/TransactionProcessor/appsettings.json index 856332fa..49f2424d 100644 --- a/TransactionProcessor/appsettings.json +++ b/TransactionProcessor/appsettings.json @@ -186,10 +186,7 @@ } }, "ConnectionStrings": { - // SQL Server "TransactionProcessorReadModel": "server=192.168.1.167;user id=sa;password=Sc0tland;database=TransactionProcessorReadModel;Encrypt=false" - // MySql - //"TransactionProcessorReadModel": "server=127.0.0.1;userid=root;password=sp1ttal;database=TransactionProcessorReadModel" }, "SecurityConfiguration": { "ApiName": "transactionProcessor" diff --git a/TransactionProcessor/appsettings.preproduction.json b/TransactionProcessor/appsettings.preproduction.json index a110c14f..0ca1a86c 100644 --- a/TransactionProcessor/appsettings.preproduction.json +++ b/TransactionProcessor/appsettings.preproduction.json @@ -1,9 +1,6 @@ { "ConnectionStrings": { - // SQL Server "TransactionProcessorReadModel": "server=192.168.1.168;user id=sa;password=Sc0tland;database=TransactionProcessorReadModel;Encrypt=false" - // MySql - //"TransactionProcessorReadModel": "server=192.168.0.134;userid=root;password=sp1ttal;database=TransactionProcessorReadModel;" }, "OperatorConfiguration": { "Safaricom": { diff --git a/TransactionProcessor/appsettings.staging.json b/TransactionProcessor/appsettings.staging.json index cb454ba3..cc37e3c5 100644 --- a/TransactionProcessor/appsettings.staging.json +++ b/TransactionProcessor/appsettings.staging.json @@ -1,9 +1,6 @@ { "ConnectionStrings": { - // SQL Server "TransactionProcessorReadModel": "server=192.168.1.167;user id=sa;password=Sc0tland;database=TransactionProcessorReadModel;Encrypt=false" - // MySql - //"TransactionProcessorReadModel": "server=192.168.0.133;userid=root;password=sp1ttal;database=TransactionProcessorReadModel;" }, "OperatorConfiguration": { "Safaricom": {