RegModelChanged { get; set; }
//public string PhoneNumberMask { get; set; } = "\+(9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)\W*\d\W*\d\W*\d\W*\d\W*\d\W*\d\W*\d\W*\d\W*(\d{1,2})";
- public string PhoneNumberMask { get; set; } = TIAMRegularExpressions.PhoneNumberMask;
+ public string PhoneNumberMask { get; set; } = AcRegExpression.PhoneNumberMask;
char Placeholder = '_';
diff --git a/TIAMSharedUI/Pages/DbTestComponent.razor b/TIAMSharedUI/Pages/DbTestComponent.razor
index 440abd62..b2220fc0 100644
--- a/TIAMSharedUI/Pages/DbTestComponent.razor
+++ b/TIAMSharedUI/Pages/DbTestComponent.razor
@@ -1,4 +1,5 @@
-@using AyCode.Utils.Extensions
+@using AyCode.Core.Extensions
+@using AyCode.Utils.Extensions
@if (Users == null)
{
diff --git a/TIAMSharedUI/TIAMSharedUI.csproj b/TIAMSharedUI/TIAMSharedUI.csproj
index 8f0f9df9..4e27b8ef 100644
--- a/TIAMSharedUI/TIAMSharedUI.csproj
+++ b/TIAMSharedUI/TIAMSharedUI.csproj
@@ -15,8 +15,8 @@
-
-
+
+
@@ -32,6 +32,9 @@
..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Core.dll
+
+ ..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Core.Server.dll
+
..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Entities.dll
diff --git a/TIAMWebApp/Client/TIAMWebApp.Client.csproj b/TIAMWebApp/Client/TIAMWebApp.Client.csproj
index 48a53d21..2228e98d 100644
--- a/TIAMWebApp/Client/TIAMWebApp.Client.csproj
+++ b/TIAMWebApp/Client/TIAMWebApp.Client.csproj
@@ -11,10 +11,10 @@
-
-
-
-
+
+
+
+
diff --git a/TIAMWebApp/Server/Controllers/GoogleAPIController .cs b/TIAMWebApp/Server/Controllers/GoogleAPIController .cs
index 32cb0f32..40cb4c9b 100644
--- a/TIAMWebApp/Server/Controllers/GoogleAPIController .cs
+++ b/TIAMWebApp/Server/Controllers/GoogleAPIController .cs
@@ -156,7 +156,7 @@ namespace TIAMWebApp.Server.Controllers
new LocationEx(destination1),
new LocationEx(destination2)
},
- TravelMode = TravelMode.Driving,
+ TravelMode = TravelMode.DRIVING,
};
response = await GoogleApi.GoogleMaps.DistanceMatrix.QueryAsync(request);
diff --git a/TIAMWebApp/Server/Controllers/ServiceProviderAPIController.cs b/TIAMWebApp/Server/Controllers/ServiceProviderAPIController.cs
index 3fd352f8..31d68d73 100644
--- a/TIAMWebApp/Server/Controllers/ServiceProviderAPIController.cs
+++ b/TIAMWebApp/Server/Controllers/ServiceProviderAPIController.cs
@@ -176,7 +176,7 @@ namespace TIAMWebApp.Server.Controllers
}
else
{
- var result = _adminDal.AddProduct(product);
+ var result = _adminDal.AddProductAsync(product);
return Ok(result);
}
}
diff --git a/TIAMWebApp/Server/Controllers/UserAPIController.cs b/TIAMWebApp/Server/Controllers/UserAPIController.cs
index e62232b9..6ec3d219 100644
--- a/TIAMWebApp/Server/Controllers/UserAPIController.cs
+++ b/TIAMWebApp/Server/Controllers/UserAPIController.cs
@@ -39,7 +39,7 @@ namespace TIAMWebApp.Server.Controllers
private AdminDal _adminDal;
private readonly IConfiguration _configuration;
private readonly IWebHostEnvironment _webHostEnvironment;
- readonly PasswordHasher _hasher = new();
+ //readonly PasswordHasher _hasher = new();
/*private UserModel[] users = new UserModel[]
@@ -366,7 +366,7 @@ namespace TIAMWebApp.Server.Controllers
userToCreate.Profile.Address.AddressText = null;
userToCreate.Profile.Address.Latitude = Math.Round(90 + rnd.NextDouble(), 8);
userToCreate.Profile.Address.Longitude = Math.Round(180 + rnd.NextDouble(), 8);
- result = await _adminDal.AddUser(userToCreate);
+ result = await _adminDal.AddUserAsync(userToCreate);
guestUser = await _userDal.GetUserModelDtoDetailByIdAsync(userId);
}
}
@@ -415,13 +415,13 @@ namespace TIAMWebApp.Server.Controllers
private bool VerifyPassword(string password, string hashedPassword)
{
- var isPasswordValid = _hasher.VerifyPassword(password, hashedPassword);
+ var isPasswordValid = PasswordHasher.VerifyPassword(password, hashedPassword);
return isPasswordValid;
}
private string HashPassword(string password)
{
- var hashedPassword = _hasher.HashPassword(password);
+ var hashedPassword = PasswordHasher.HashPassword(password);
return hashedPassword;
}
}
diff --git a/TIAMWebApp/Server/Services/Logins/ILoginService.cs b/TIAMWebApp/Server/Services/Logins/ILoginService.cs
new file mode 100644
index 00000000..7b673e1e
--- /dev/null
+++ b/TIAMWebApp/Server/Services/Logins/ILoginService.cs
@@ -0,0 +1,17 @@
+using AyCode.Interfaces.Server.Logins;
+using AyCode.Models.Logins;
+using AyCode.Models.Server.Logins;
+using TIAM.Entities.Addresses;
+using TIAM.Entities.Profiles;
+using TIAM.Entities.ServiceProviders;
+using TIAM.Entities.Users;
+
+namespace TIAMWebApp.Server.Services.Logins;
+
+public interface ILoginModel : IAcLoggedInModelBase
+{}
+
+public interface ILoginService : IAcLoginServiceServer
+{
+
+}
\ No newline at end of file
diff --git a/TIAMWebApp/Server/Services/Logins/LoginService.cs b/TIAMWebApp/Server/Services/Logins/LoginService.cs
new file mode 100644
index 00000000..3e5bd2c5
--- /dev/null
+++ b/TIAMWebApp/Server/Services/Logins/LoginService.cs
@@ -0,0 +1,46 @@
+using System.Reflection.Metadata.Ecma335;
+using System.Security;
+using AyCode.Core.Consts;
+using AyCode.Interfaces.Server.Logins;
+using AyCode.Models.Server.Logins;
+using AyCode.Services.Server.Logins;
+using AyCode.Utils.Extensions;
+using AyCode.Utils.Helpers;
+using TIAM.Database.DataLayers.Admins;
+using TIAM.Database.DataLayers.Users;
+using TIAM.Database.DbContexts.Admins;
+using TIAM.Database.DbContexts.Users;
+using TIAM.Entities.Addresses;
+using TIAM.Entities.Profiles;
+using TIAM.Entities.ServiceProviders;
+using TIAM.Entities.Users;
+
+namespace TIAMWebApp.Server.Services.Logins;
+
+public class LoggedInModel : AcLoggedInModelServer, ILoginModel
+{}
+
+public class LoginService(UserDal userDal, IConfiguration configuration) : AcLoginServiceServer(userDal, configuration), ILoginService
+
+{
+ public override User? Login(string email, string password, out string accessToken)
+ {
+ return base.Login(email, password, out accessToken);
+ }
+
+ public override bool Logout()
+ {
+ return base.Logout();
+ }
+
+ public override Task RegistrationAsync(string email, string password, string? phoneNumber = null)
+ {
+ return base.RegistrationAsync(email, password, phoneNumber);
+ }
+
+ public override string GenerateDynamicSalt(Guid userId)
+ {
+ return base.GenerateDynamicSalt(userId);
+ }
+}
+
\ No newline at end of file
diff --git a/TIAMWebApp/Server/TIAMWebApp.Server.csproj b/TIAMWebApp/Server/TIAMWebApp.Server.csproj
index 150fbda5..021e8187 100644
--- a/TIAMWebApp/Server/TIAMWebApp.Server.csproj
+++ b/TIAMWebApp/Server/TIAMWebApp.Server.csproj
@@ -10,15 +10,15 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
+
@@ -61,6 +61,12 @@
..\..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Models.Server.dll
+
+ ..\..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Services.dll
+
+
+ ..\..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Services.Server.dll
+
..\..\..\AyCode.Core\AyCode.Utils\bin\Debug\net8.0\AyCode.Utils.dll
diff --git a/TIAMWebApp/Shared/TIAMWebApp.Shared.Application.csproj b/TIAMWebApp/Shared/TIAMWebApp.Shared.Application.csproj
index 878a85be..280b9ba4 100644
--- a/TIAMWebApp/Shared/TIAMWebApp.Shared.Application.csproj
+++ b/TIAMWebApp/Shared/TIAMWebApp.Shared.Application.csproj
@@ -17,11 +17,11 @@
-
+
-
-
-
+
+
+
diff --git a/TIAMWebApp/Shared/Utility/TIAMRegularExpressions.cs b/TIAMWebApp/Shared/Utility/TIAMRegularExpressions.cs
deleted file mode 100644
index 0fa784e9..00000000
--- a/TIAMWebApp/Shared/Utility/TIAMRegularExpressions.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace TIAMWebApp.Shared.Application.Utility
-{
- public static class TIAMRegularExpressions
- {
-
- public const string EmailMask = @"(\w|[.-])+@(\w|-)+\.(\w|-){2,4}";
- //public const string EmailMask = @"((\w|[.-])+@(\w|-)+\.(\w|-){2,4})?";
- public const string PhoneNumberMask = "\\+(9[976]\\d|8[987530]\\d|6[987]\\d|5[90]\\d|42\\d|3[875]\\d|2[98654321]\\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*(\\d{1,2})";
-
- }
-}