Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageReference Include="MediatR" Version="12.4.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.DynamicLinq" Version="8.3.10" />
<PackageReference Include="Shared" Version="2025.1.2" />
<PackageReference Include="EstateManagement.Database" Version="2024.8.2-build128" />
<PackageReference Include="TransactionProcessor.Database" Version="2025.1.5-build147" />
</ItemGroup>

<ItemGroup>
Expand Down
23 changes: 9 additions & 14 deletions EstateReportingAPI.BusinessLogic/ReportingManager.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
namespace EstateReportingAPI.BusinessLogic{
using System.Data.Common;
using EstateManagement.Database.Contexts;
using EstateManagement.Database.Entities;
using TransactionProcessor.Database.Contexts;
using TransactionProcessor.Database.Entities;
using TransactionProcessor.Database.Entities.Summary;

namespace EstateReportingAPI.BusinessLogic{
using Microsoft.EntityFrameworkCore;
using Models;
using Shared.Exceptions;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Linq.Expressions;
using System.Threading;
using Calendar = Models.Calendar;
using Merchant = Models.Merchant;
using System.Linq.Expressions;
using System.Reflection;
using Operator = Models.Operator;
using EstateManagement.Database.Entities.Summary;

public class ReportingManager : IReportingManager{
#region Fields
Expand Down Expand Up @@ -141,10 +136,10 @@ public async Task<List<Calendar>> GetCalendarComparisonDates(Guid estateId, Canc

DateTime startOfYear = new DateTime(DateTime.Now.Year, 1, 1);

List<EstateManagement.Database.Entities.Calendar> entities = context.Calendar.Where(c => c.Date >= startOfYear && c.Date < DateTime.Now.Date.AddDays(-1)).OrderByDescending(d => d.Date).ToList();
List<TransactionProcessor.Database.Entities.Calendar> entities = context.Calendar.Where(c => c.Date >= startOfYear && c.Date < DateTime.Now.Date.AddDays(-1)).OrderByDescending(d => d.Date).ToList();

List<Calendar> result = new List<Calendar>();
foreach (EstateManagement.Database.Entities.Calendar calendar in entities){
foreach (TransactionProcessor.Database.Entities.Calendar calendar in entities){
result.Add(new Calendar{
Date = calendar.Date,
DayOfWeek = calendar.DayOfWeek,
Expand All @@ -166,10 +161,10 @@ public async Task<List<Calendar>> GetCalendarComparisonDates(Guid estateId, Canc
public async Task<List<Calendar>> GetCalendarDates(Guid estateId, CancellationToken cancellationToken){
EstateManagementGenericContext? context = await this.ContextFactory.GetContext(estateId, ReportingManager.ConnectionStringIdentifier, cancellationToken);

List<EstateManagement.Database.Entities.Calendar> entities = context.Calendar.Where(c => c.Date <= DateTime.Now.Date).ToList();
List<TransactionProcessor.Database.Entities.Calendar> entities = context.Calendar.Where(c => c.Date <= DateTime.Now.Date).ToList();

List<Calendar> result = new List<Calendar>();
foreach (EstateManagement.Database.Entities.Calendar calendar in entities){
foreach (TransactionProcessor.Database.Entities.Calendar calendar in entities){
result.Add(new Calendar{
Date = calendar.Date,
DayOfWeek = calendar.DayOfWeek,
Expand Down
5 changes: 2 additions & 3 deletions EstateReportingAPI.IntegrationTests/ControllerTestsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using EstateManagement.Database.Entities;
using SimpleResults;
using TransactionProcessor.Database.Contexts;
using TransactionProcessor.Database.Entities;

namespace EstateReportingAPI.IntegrationTests;

Expand All @@ -15,8 +16,6 @@ namespace EstateReportingAPI.IntegrationTests;
using Common;
using Ductus.FluentDocker.Services;
using Ductus.FluentDocker.Services.Extensions;
using EstateManagement.Database.Contexts;
using Newtonsoft.Json;
using NLog;
using Shared.IntegrationTesting;
using Shared.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
using System.Threading;
using System.Threading.Tasks;
using Shared.Repositories;
using TransactionProcessor.Database.Contexts;

namespace EstateReportingAPI.IntegrationTests;

using BusinessLogic;
using EstateManagement.Database.Contexts;
using EstateReportingAPI.Common;
using k8s.KubeConfigModels;
using Microsoft.AspNetCore.Authentication;
Expand Down
10 changes: 3 additions & 7 deletions EstateReportingAPI.IntegrationTests/DatabaseHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@
using JasperFx.Core;
using Microsoft.Data.SqlClient;
using Shared.Logger;
using TransactionProcessor.Database.Contexts;
using TransactionProcessor.Database.Entities;

namespace EstateReportingAPI.IntegrationTests;

using System.Reflection;
using System.Text;
using System.Xml.Linq;
using EstateManagement.Database.Contexts;
using EstateManagement.Database.Entities;
using EstateManagement.Database.Migrations.MySql;
using k8s.KubeConfigModels;
using Microsoft.AspNetCore.Html;
using Microsoft.EntityFrameworkCore;

public class DatabaseHelper{
Expand Down Expand Up @@ -64,7 +60,7 @@ public async Task AddCalendarYear(Int32 year){

public async Task AddCalendarDates(List<DateTime> dates){
foreach (DateTime dateTime in dates){
EstateManagement.Database.Entities.Calendar c = dateTime.ToCalendar();
Calendar c = dateTime.ToCalendar();
await this.Context.Calendar.AddAsync(c);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
using System.Threading;
using System.Threading.Tasks;
using SimpleResults;
using TransactionProcessor.Database.Contexts;

namespace EstateReportingAPI.IntegrationTests;

using EstateManagement.Database.Contexts;
using EstateReportingAPI.DataTrasferObjects;
using Shouldly;
using Xunit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="EstateManagement.Database" Version="2024.8.2-build128" />
<PackageReference Include="TransactionProcessor.Database" Version="2025.1.5-build147" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.3" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
Expand Down
18 changes: 6 additions & 12 deletions EstateReportingAPI.IntegrationTests/Extensions.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Calendar = TransactionProcessor.Database.Entities.Calendar;

namespace EstateReportingAPI.IntegrationTests
{
using BusinessLogic;
using EstateManagement.Database.Entities;
using EstateReportingAPI.Common;
using Microsoft.Extensions.DependencyInjection;
using Shared.EntityFramework;
using System.Globalization;
using Calendar = System.Globalization.Calendar;

public static class Extensions{
public static EstateManagement.Database.Entities.Calendar ToCalendar(this DateTime date){
return new EstateManagement.Database.Entities.Calendar{
public static Calendar ToCalendar(this DateTime date){
return new Calendar{
Date = date,
DayOfWeek = date.DayOfWeek.ToString(),
DayOfWeekShort = date.DayOfWeek.ToString().Substring(0, 3),
Expand All @@ -33,7 +27,7 @@ public static EstateManagement.Database.Entities.Calendar ToCalendar(this DateTi

public static Int32 GetWeekNumber(this DateTime date){
// Define the calendar to use (in this case, the Gregorian calendar)
Calendar calendar = CultureInfo.InvariantCulture.Calendar;
System.Globalization.Calendar calendar = CultureInfo.InvariantCulture.Calendar;

// Get the week number for the current date
int weekNumber = calendar.GetWeekOfYear(date, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
Expand All @@ -43,7 +37,7 @@ public static Int32 GetWeekNumber(this DateTime date){
public static Int32 GetDayOfWeekNumber(this DateTime date)
{
// Define the calendar to use (in this case, the Gregorian calendar)
Calendar calendar = CultureInfo.InvariantCulture.Calendar;
System.Globalization.Calendar calendar = CultureInfo.InvariantCulture.Calendar;

// Get the week number for the current date
int dayOfWeekNumber = (Int32)calendar.GetDayOfWeek(date);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using TransactionProcessor.Database.Contexts;
using TransactionProcessor.Database.Entities;

namespace EstateReportingAPI.IntegrationTests {
using EstateManagement.Database.Contexts;
using EstateManagement.Database.Entities;
using EstateReportingAPI.DataTransferObjects;
using Microsoft.EntityFrameworkCore;
using Shouldly;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
using Ductus.FluentDocker.Common;
using EstateReportingAPI.IntegrationTests;
using Microsoft.EntityFrameworkCore;
using TransactionProcessor.Database.Contexts;
using TransactionProcessor.Database.Entities;
using Xunit.Abstractions;

namespace EstateReportingAPI.IntegrationTests;
Expand All @@ -13,8 +15,6 @@ namespace EstateReportingAPI.IntegrationTests;
using System.Diagnostics.Contracts;
using System.Linq;
using DataTrasferObjects;
using EstateManagement.Database.Contexts;
using EstateManagement.Database.Entities;
using EstateReportingAPI.DataTransferObjects;
using EstateReportingAPI.Models;
using Microsoft.OpenApi.Services;
Expand Down
5 changes: 3 additions & 2 deletions EstateReportingAPI/Bootstrapper/RepositoryRegistry.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
namespace EstateReportingAPI.Bootstrapper;
using TransactionProcessor.Database.Contexts;

namespace EstateReportingAPI.Bootstrapper;

using BusinessLogic;
using Common;
using EstateManagement.Database.Contexts;
using Lamar;
using Shared.EntityFramework;
using Shared.EntityFramework.ConnectionStringConfiguration;
Expand Down
3 changes: 2 additions & 1 deletion EstateReportingAPI/EstateReportingAPI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="EstateManagement.Database" Version="2024.8.2-build128" />

<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.3" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.20.0" />
<PackageReference Include="Shared.Results" Version="2025.1.2" />
Expand All @@ -35,6 +35,7 @@
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.5.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.3" />
<PackageReference Include="TransactionProcessor.Database" Version="2025.1.5-build147" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading