Compare commits

..

No commits in common. "b871cf51df53b42d8dafbc93609f1c93a83cd18e" and "a5266f3d7931c7a1842ef0ee87d4f5c081c6561a" have entirely different histories.

13 changed files with 46 additions and 1149 deletions

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,6 @@ using TIAM.Entities.Products;
using TIAM.Entities.Users; using TIAM.Entities.Users;
using TIAM.Models.Dtos.Users; using TIAM.Models.Dtos.Users;
using TIAM.Entities.Transfers; using TIAM.Entities.Transfers;
using TIAM.Entities.Profiles;
namespace TIAM.Database.Test namespace TIAM.Database.Test
{ {
@ -33,7 +32,7 @@ namespace TIAM.Database.Test
[DataRow("42968456-6EF3-4D9C-8BC4-0569A129AC05")] [DataRow("42968456-6EF3-4D9C-8BC4-0569A129AC05")]
public void GetPermissionViewBySubjectId_ReturnsPermissionContextMapping_WhenPermissionContextMappingExists(string subjectIdString) public void GetPermissionViewBySubjectId_ReturnsPermissionContextMapping_WhenPermissionContextMappingExists(string subjectIdString)
{ {
var subjectId = Guid.Parse(subjectIdString); var subjectId= Guid.Parse(subjectIdString);
var permMapping = Dal.GetPermissionContextsViewBySubjectId(subjectId).ToList(); var permMapping = Dal.GetPermissionContextsViewBySubjectId(subjectId).ToList();
Assert.IsNotNull(permMapping, "PermissionContextsView is null"); Assert.IsNotNull(permMapping, "PermissionContextsView is null");
@ -293,7 +292,7 @@ namespace TIAM.Database.Test
var users = JsonConvert.DeserializeObject<List<User>>(userJson); var users = JsonConvert.DeserializeObject<List<User>>(userJson);
Assert.IsNotNull(users); Assert.IsNotNull(users);
Assert.IsTrue(users.Count > 0); Assert.IsTrue(users.Count>0);
} }
#region Transfer #region Transfer
@ -567,51 +566,6 @@ namespace TIAM.Database.Test
} }
#endregion EmailMessage #endregion EmailMessage
#region User
[DataTestMethod]
[DataRow(["e31044d7-1771-4a32-8dd9-6f9853ed53c6", "0a831191-70a3-4504-9ec4-c5902affaba7", "8eed080c-d2ce-4cc3-bcfe-2268c220bba7", "addUser_test9432@tiam.hu"])]
public async Task AddUserTest(string[] userIdProfileIdAddressIdEmailStrings)
{
var userId = Guid.Parse(userIdProfileIdAddressIdEmailStrings[0]);
var profileId = Guid.Parse(userIdProfileIdAddressIdEmailStrings[1]);
var addressId = Guid.Parse(userIdProfileIdAddressIdEmailStrings[2]);
var email = userIdProfileIdAddressIdEmailStrings[3];
var fromAddress = "Budapest, Liszt Ferenc tér";
var toAddress = "1211 Budapest, Kossuth Lajos utca 145";
//var userProductToCarId = Guid.Parse("97179a87-d99f-4f12-b7b2-75e21aaec6ab");
await Dal.RemoveUserAsync(userId); //kitöröljük a szemetet, ha korábbról bentmaradt - J.
var user = new User(userId, email, "235664", "dsfglfjg45r34903t3kggvq");
//user.ProfileId = profileId;
var profile = new Profile();
profile.Id = profileId;;
profile.Name = "Add user test name";
var address = new Address();
address.Id = addressId;
address.Latitude = 5362.2341652256;
address.Longitude = 5362.2341333317;
address.AddressText = "1214 Kossuth Lajos utca 124.";
user.Profile = profile;
user.Profile.Address = address;
Assert.IsTrue(await Dal.AddUser(user));
user = Dal.GetUserById(userId);
Assert.IsNotNull(user);
Assert.IsNotNull(user.Profile);
Assert.IsNotNull(user.Profile.Address);
Assert.IsTrue(await Dal.RemoveUserAsync(userId)); //mielőbb kitöröljük, h ne maradjon szemét a db-ben - J.
user = Dal.GetUserById(userId);
Assert.IsNull(user); //a korábbi törlés miatt NULL kell legyen - J.
}
#endregion
} }
} }

View File

@ -10,15 +10,15 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.3" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.3" /> <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.3" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.3" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Moq" Version="4.20.70" /> <PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="MSTest.TestAdapter" Version="3.2.2" /> <PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.2.2" /> <PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
<PackageReference Include="coverlet.collector" Version="6.0.2"> <PackageReference Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>

View File

@ -9,12 +9,10 @@ using TIAM.Database.DbSets.Permissions;
using TIAM.Database.DbSets.Products; using TIAM.Database.DbSets.Products;
using TIAM.Database.DbSets.Transfers; using TIAM.Database.DbSets.Transfers;
using TIAM.Database.DbSets.Users; using TIAM.Database.DbSets.Users;
using TIAM.Entities.Addresses;
using TIAM.Entities.Drivers; using TIAM.Entities.Drivers;
using TIAM.Entities.Emails; using TIAM.Entities.Emails;
using TIAM.Entities.Permissions; using TIAM.Entities.Permissions;
using TIAM.Entities.Products; using TIAM.Entities.Products;
using TIAM.Entities.Profiles;
using TIAM.Entities.ServiceProviders; using TIAM.Entities.ServiceProviders;
using TIAM.Entities.Transfers; using TIAM.Entities.Transfers;
using TIAM.Entities.Users; using TIAM.Entities.Users;
@ -94,27 +92,6 @@ namespace TIAM.Database.DataLayers.Admins
public string? GetUserJsonById(Guid userId) => Session(ctx => ctx.GetUserById(userId)?.ToJson()); public string? GetUserJsonById(Guid userId) => Session(ctx => ctx.GetUserById(userId)?.ToJson());
public string GetUsersJson() => Session(ctx => ctx.Users.ToJson()); public string GetUsersJson() => Session(ctx => ctx.Users.ToJson());
public Task<bool> AddUser(User user) => TransactionAsync(ctx => ctx.AddUser(user));
public Task<bool> AddUser(User user, string profileName, Address address)
{
return TransactionAsync(ctx =>
{
var profile = Activator.CreateInstance<Profile>();
profile.Id = Guid.NewGuid();
profile.Name = profileName;
profile.Address = address;
user.Profile= profile;
return ctx.AddUser(user);
});
}
public Task<bool> RemoveUserAsync(User user) => TransactionAsync(ctx => ctx.RemoveUserAsync(user));
public Task<bool> RemoveUserAsync(Guid userId) => TransactionAsync(ctx => ctx.RemoveUserAsync(userId));
public Product? GetProductById(Guid contextId, bool includeUsers = true) => Session(ctx => ctx.GetProductById(contextId, includeUsers)); public Product? GetProductById(Guid contextId, bool includeUsers = true) => Session(ctx => ctx.GetProductById(contextId, includeUsers));
public string GetProductsJson(bool includeUsers = true) => Session(ctx => ctx.ProductsWithUserRelations(includeUsers).ToJson()); public string GetProductsJson(bool includeUsers = true) => Session(ctx => ctx.ProductsWithUserRelations(includeUsers).ToJson());

View File

@ -7,9 +7,9 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.3" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.3" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.3" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup> </ItemGroup>

View File

@ -32,7 +32,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="8.0.3" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="8.0.1" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -64,7 +64,7 @@
<ProjectReference Include="..\TIAM.Entities\TIAM.Entities.csproj" /> <ProjectReference Include="..\TIAM.Entities\TIAM.Entities.csproj" />
<ProjectReference Include="..\TIAMSharedUI\TIAMSharedUI.csproj" /> <ProjectReference Include="..\TIAMSharedUI\TIAMSharedUI.csproj" />
<ProjectReference Include="..\TIAMWebApp\Shared\TIAMWebApp.Shared.Application.csproj" /> <ProjectReference Include="..\TIAMWebApp\Shared\TIAMWebApp.Shared.Application.csproj" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" VersionOverride="7.0.1" Version="8.0.1" /> <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" VersionOverride="7.0.1" Version="8.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -83,15 +83,15 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Update="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.14" /> <PackageReference Update="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.6" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Update="Microsoft.Maui.Controls" Version="8.0.14" /> <PackageReference Update="Microsoft.Maui.Controls" Version="8.0.6" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Update="Microsoft.Maui.Controls.Compatibility" Version="8.0.14" /> <PackageReference Update="Microsoft.Maui.Controls.Compatibility" Version="8.0.6" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -15,8 +15,8 @@
<PackageReference Include="Blazor.AnimateOnScroll" Version="1.1.0" /> <PackageReference Include="Blazor.AnimateOnScroll" Version="1.1.0" />
<PackageReference Include="BlazorAnimation" Version="2.2.0" /> <PackageReference Include="BlazorAnimation" Version="2.2.0" />
<PackageReference Include="DevExpress.Blazor" Version="23.2.3" /> <PackageReference Include="DevExpress.Blazor" Version="23.2.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.3" /> <PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.3" /> <PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -10,9 +10,9 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" /> <PackageReference Include="Blazored.LocalStorage" Version="4.4.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.3" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.3" PrivateAssets="all" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.1" PrivateAssets="all" />
<PackageReference Include="SkiaSharp" Version="2.88.7" /> <PackageReference Include="SkiaSharp" Version="2.88.7" />
<PackageReference Include="SkiaSharp.Views.Desktop.Common" Version="2.88.7" /> <PackageReference Include="SkiaSharp.Views.Desktop.Common" Version="2.88.7" />
</ItemGroup> </ItemGroup>

View File

@ -9,7 +9,7 @@ namespace TIAMWebApp.Server.Services
public class TransferBackendService public class TransferBackendService
{ {
private readonly IConfiguration _configuration; private readonly IConfiguration _configuration;
private readonly AdminDal _adminDal; public AdminDal _adminDal;
public TransferBackendService(IConfiguration configuration, AdminDal adminDal) public TransferBackendService(IConfiguration configuration, AdminDal adminDal)
{ {
@ -42,14 +42,14 @@ namespace TIAMWebApp.Server.Services
var price = GetSeatNumberPrice(in tranferDestinationPrice, seatNumber); var price = GetSeatNumberPrice(in tranferDestinationPrice, seatNumber);
//TODO: ExtraPrice - J. //TODO: ExtraPrice - J.
//if (baseDestination.Id == fromTransferDestination.Id && )
return price; return price;
} }
public double GetSeatNumberPrice(in ITransfeDestinationPrices transfeDestinationPrices, in byte seatNumber) public double GetSeatNumberPrice(in ITransfeDestinationPrices transfeDestinationPrices, in byte seatNumber)
=> GetSeatNumberPrice(transfeDestinationPrices.Price, transfeDestinationPrices.Price2, transfeDestinationPrices.Price3, seatNumber); => GetSeatNumberPrice(transfeDestinationPrices.Price, transfeDestinationPrices.Price2, transfeDestinationPrices.Price3, seatNumber);
public double GetSeatNumberPrice(double price, in double? price2, in double? price3, in byte seatNumber) public double GetSeatNumberPrice(in double price, in double? price2, in double? price3, in byte seatNumber)
{ {
return seatNumber switch return seatNumber switch
{ {

View File

@ -11,12 +11,12 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="GoogleApi" Version="5.3.1" /> <PackageReference Include="GoogleApi" Version="5.3.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.3" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.3" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.3" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1" />
<PackageReference Include="Microsoft.OpenApi" Version="1.6.14" /> <PackageReference Include="Microsoft.OpenApi" Version="1.6.12" />
<PackageReference Include="QRCoderNetCore" Version="1.0.0" /> <PackageReference Include="QRCoderNetCore" Version="1.0.0" />
<PackageReference Include="SendGrid" Version="9.29.2" /> <PackageReference Include="SendGrid" Version="9.29.1" />
<PackageReference Include="SkiaSharp" Version="2.88.7" /> <PackageReference Include="SkiaSharp" Version="2.88.7" />
<PackageReference Include="SkiaSharp.Views.Desktop.Common" Version="2.88.7" /> <PackageReference Include="SkiaSharp.Views.Desktop.Common" Version="2.88.7" />
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.5.0" /> <PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.5.0" />

View File

@ -17,9 +17,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="8.0.3" /> <PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="5.0.17" /> <PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="5.0.17" />
<PackageReference Include="Microsoft.JSInterop" Version="8.0.3" /> <PackageReference Include="Microsoft.JSInterop" Version="8.0.1" />
<PackageReference Include="SkiaSharp" Version="2.88.7" /> <PackageReference Include="SkiaSharp" Version="2.88.7" />
<PackageReference Include="SkiaSharp.Views.Desktop.Common" Version="2.88.7" /> <PackageReference Include="SkiaSharp.Views.Desktop.Common" Version="2.88.7" />
</ItemGroup> </ItemGroup>

View File

@ -37,11 +37,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TIAM.Models", "TIAM.Models\
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TIAM.Resources", "TIAMResources\TIAM.Resources.csproj", "{2A300982-AA2E-4E62-97F2-6EF4C97939B2}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TIAM.Resources", "TIAMResources\TIAM.Resources.csproj", "{2A300982-AA2E-4E62-97F2-6EF4C97939B2}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DD32C7C2-218C-4148-8FD6-1AB3C824A7D5}"
ProjectSection(SolutionItems) = preProject
SqlSchemaCompare_Dev_to_DevRelease.scmp = SqlSchemaCompare_Dev_to_DevRelease.scmp
EndProjectSection
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU