diff --git a/.gitignore b/.gitignore index 713c514..ef885f5 100644 Binary files a/.gitignore and b/.gitignore differ diff --git a/backend/.vs/HealthcareManagerAPI/v17/.suo b/backend/.vs/HealthcareManagerAPI/v17/.suo index 2190b65..679781a 100644 Binary files a/backend/.vs/HealthcareManagerAPI/v17/.suo and b/backend/.vs/HealthcareManagerAPI/v17/.suo differ diff --git a/backend/.vs/HealthcareManagerAPI/v17/DocumentLayout.json b/backend/.vs/HealthcareManagerAPI/v17/DocumentLayout.json index 7b02f39..2dc0eac 100644 --- a/backend/.vs/HealthcareManagerAPI/v17/DocumentLayout.json +++ b/backend/.vs/HealthcareManagerAPI/v17/DocumentLayout.json @@ -3,8 +3,8 @@ "WorkspaceRootPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\", "Documents": [ { - "AbsoluteMoniker": "D:0:0:{726E8EFD-FC6A-4104-B8FB-2D9049C748C6}|Application\\Application.csproj|c:\\users\\andrei cerbu\\documents\\facultate\\cc-finalproj\\backend\\application\\endpoints\\doctors\\login\\doctorloginvalidation.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{726E8EFD-FC6A-4104-B8FB-2D9049C748C6}|Application\\Application.csproj|solutionrelative:application\\endpoints\\doctors\\login\\doctorloginvalidation.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\Endpoints\\Doctors\\Login\\DoctorLoginValidation.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Application\\Endpoints\\Doctors\\Login\\DoctorLoginValidation.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" } ], "DocumentGroupContainers": [ @@ -14,12 +14,8 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 1, + "SelectedChildIndex": 0, "Children": [ - { - "$type": "Bookmark", - "Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}" - }, { "$type": "Document", "DocumentIndex": 0, @@ -28,10 +24,18 @@ "RelativeDocumentMoniker": "Application\\Endpoints\\Doctors\\Login\\DoctorLoginValidation.cs", "ToolTip": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\Endpoints\\Doctors\\Login\\DoctorLoginValidation.cs", "RelativeToolTip": "Application\\Endpoints\\Doctors\\Login\\DoctorLoginValidation.cs", - "ViewState": "AQIAAAAAAAAAAAAAAAAAAAIAAAAdAAAA", + "ViewState": "AQIAAAAAAAAAAAAAAAAAAAUAAABDAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2024-04-04T16:14:25.923Z", "EditorCaption": "" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{cce594b6-0c39-4442-ba28-10c64ac7e89f}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}" } ] } diff --git a/backend/API/API.csproj b/backend/API/API.csproj index 43c6bbf..5dceddc 100644 --- a/backend/API/API.csproj +++ b/backend/API/API.csproj @@ -8,6 +8,7 @@ + diff --git a/backend/API/Controllers/BaseController.cs b/backend/API/Controllers/BaseController.cs index 2587bc2..8f75c2d 100644 --- a/backend/API/Controllers/BaseController.cs +++ b/backend/API/Controllers/BaseController.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Mvc; -namespace HealthcareManager.API.Controllers; +namespace API.Controllers; [Route("api/v1/[controller]")] [ApiController] diff --git a/backend/API/Controllers/ChatController.cs b/backend/API/Controllers/ChatController.cs index 47f585e..bd3128d 100644 --- a/backend/API/Controllers/ChatController.cs +++ b/backend/API/Controllers/ChatController.cs @@ -1,13 +1,38 @@ -using Infrastructure.Services.MongoDB; +using Application.Endpoints; +using Application.Endpoints.Chats; +using Application.Services.Database; +using Application.Services.Database.MongoDB; +using Microsoft.AspNetCore.Mvc; -namespace HealthcareManager.API.Controllers; +namespace API.Controllers; public class ChatController : BaseApiController { - private readonly MongoDbService _mongoDbService; + private readonly IChatMongoDbService _chatMongoDbService; + private readonly IPatientRepository _patientRepository; + private readonly IDoctorRepository _doctorRepository; - public ChatController(MongoDbService mongoDbService) + public ChatController(IChatMongoDbService chatMongoDbService, IPatientRepository patientRepository, + IDoctorRepository doctorRepository) { - _mongoDbService = mongoDbService; + _chatMongoDbService = chatMongoDbService; + _patientRepository = patientRepository; + _doctorRepository = doctorRepository; + } + + [HttpPost("send_message")] + public async Task> SendMessage(SendMessageDto sendMessageDto) + { + var handler = new ChatHandler(_chatMongoDbService, _patientRepository, _doctorRepository); + var response = await handler.HandleSendMessage(sendMessageDto).ConfigureAwait(false); + return StatusCode(response.StatusCode, response); + } + + [HttpPost("get_conversation")] + public async Task> GetConversation(GetConversationDto getConversationDto) + { + var handler = new ChatHandler(_chatMongoDbService, _patientRepository, _doctorRepository); + var response = await handler.HandleGetConversation(getConversationDto).ConfigureAwait(false); + return StatusCode(response.StatusCode, response); } } \ No newline at end of file diff --git a/backend/API/Controllers/DoctorsController.cs b/backend/API/Controllers/DoctorsController.cs index a589f37..cdec67d 100644 --- a/backend/API/Controllers/DoctorsController.cs +++ b/backend/API/Controllers/DoctorsController.cs @@ -5,6 +5,8 @@ using Application.Endpoints.Doctors.Registration; using Application.Endpoints.Doctors.ResetPassword; using Application.Services.Database; using Application.Services.HashingAlgorithms; +using Application.Services.Jwt; +using Core.Entities; using Microsoft.AspNetCore.Mvc; namespace API.Controllers; @@ -15,29 +17,77 @@ public class DoctorsController : ControllerBase { private readonly IDoctorRepository _database; private readonly IHashingAlgorithms _hashingAlgorithms; + private readonly IJwtService _jwtService; - public DoctorsController(IDoctorRepository database, IHashingAlgorithms hashingAlgorithms) + public DoctorsController(IDoctorRepository database, IHashingAlgorithms hashingAlgorithms, + IJwtService jwtService) { _database = database; _hashingAlgorithms = hashingAlgorithms; + _jwtService = jwtService; } [HttpPost("register")] - public async Task> Register(DoctorRegistrationDto doctor) + public async Task> Register(DoctorRegistrationDto doctorRegistrationDto) { var handler = new DoctorRegistrationHandler(_database, _hashingAlgorithms); - var response = await handler.Handle(doctor).ConfigureAwait(false); + var response = await handler.Handle(doctorRegistrationDto).ConfigureAwait(false); return StatusCode(response.StatusCode, response); } [HttpPost("login")] - public async Task> Login(DoctorLoginDto doctor) + public async Task> Login(DoctorLoginDto doctorLoginDto) { var handler = new DoctorLoginHandler(_database, _hashingAlgorithms); - var response = await handler.Handle(doctor).ConfigureAwait(false); + var response = await handler.Handle(doctorLoginDto).ConfigureAwait(false); + if (response.Data != null) + { + Doctor doctor = (Doctor)response.Data; + var authToken = _jwtService.GenerateJwtToken(doctor.Email); + + HttpContext.Response.Headers.Add("Authorization", $"Bearer {authToken}"); + } + return StatusCode(response.StatusCode, response); } + [HttpPost("refresh_token")] + public async Task> RefreshToken() + { + var authorizationHeader = Request.Headers["Authorization"].FirstOrDefault(); + if (string.IsNullOrEmpty(authorizationHeader) || !authorizationHeader.StartsWith("Bearer ")) + { + return StatusCode(HttpStatusCodes.BadRequest, new BaseResponse + { + StatusCode = HttpStatusCodes.BadRequest, + Message = "Invalid request header format.", + Data = null + }); + } + + var oldToken = authorizationHeader.Substring("Bearer ".Length).Trim(); + + if (!_jwtService.ValidateJwtToken(oldToken)) + { + return StatusCode(HttpStatusCodes.Unauthorized, new BaseResponse + { + StatusCode = HttpStatusCodes.Unauthorized, + Message = "Invalid JWT token.", + Data = null + }); + } + else + { + var newToken = _jwtService.RefreshToken(oldToken); + return StatusCode(HttpStatusCodes.OK, new BaseResponse + { + StatusCode = HttpStatusCodes.OK, + Message = "Token refreshed successfully.", + Data = new { Token = newToken } + }); + } + } + [HttpPost("reset_password")] public async Task> ResetPassword(DoctorResetPasswordDto resetDoctorDto) { diff --git a/backend/API/Controllers/MedicalHistoryController.cs b/backend/API/Controllers/MedicalHistoryController.cs index d56a1db..d303b08 100644 --- a/backend/API/Controllers/MedicalHistoryController.cs +++ b/backend/API/Controllers/MedicalHistoryController.cs @@ -1,5 +1,6 @@ using Application.Endpoints; -using Application.Endpoints.MedicalHistories; +using Application.Endpoints.MedicalHistories.FileManagement; +using Application.Endpoints.MedicalHistories.ManageAuthorization; using Application.Services.Database; using Application.Services.Database.MongoDB; using Microsoft.AspNetCore.Mvc; @@ -13,19 +14,23 @@ public class MedicalHistoryController : ControllerBase private readonly IMedicalHistoryRepository _medicalHistoryRepository; private readonly IMedicalHistoryMongoDbService _medicalHistoryMongoDbService; private readonly IPatientRepository _patientRepository; + private readonly IDoctorRepository _doctorRepository; public MedicalHistoryController(IMedicalHistoryRepository medicalHistoryRepository, - IPatientRepository patientRepository, IMedicalHistoryMongoDbService mongoDbService) + IPatientRepository patientRepository, IMedicalHistoryMongoDbService mongoDbService, + IDoctorRepository doctorRepository) { _medicalHistoryRepository = medicalHistoryRepository; _patientRepository = patientRepository; _medicalHistoryMongoDbService = mongoDbService; + _doctorRepository = doctorRepository; } [HttpGet("{id}")] public async Task> GetAsync(Guid id) { - var handler = new MedicalHistoryHandler(_medicalHistoryRepository, _patientRepository, _medicalHistoryMongoDbService); + var handler = new MedicalHistoryFileManagementHandler(_medicalHistoryRepository, _patientRepository, + _medicalHistoryMongoDbService); var response = await handler.HandleGet(id); return StatusCode(response.StatusCode, response); } @@ -33,7 +38,8 @@ public class MedicalHistoryController : ControllerBase [HttpGet] public async Task> GetAllDoctors() { - var handler = new MedicalHistoryHandler(_medicalHistoryRepository, _patientRepository, _medicalHistoryMongoDbService); + var handler = new MedicalHistoryFileManagementHandler(_medicalHistoryRepository, _patientRepository, + _medicalHistoryMongoDbService); var response = await handler.HandleGetAll(); return StatusCode(response.StatusCode, response); } @@ -41,7 +47,8 @@ public class MedicalHistoryController : ControllerBase [HttpPost] public async Task> PostAsync(MedicalHistoryCreateDto medicalHistoryCreateDto) { - var handler = new MedicalHistoryHandler(_medicalHistoryRepository, _patientRepository, _medicalHistoryMongoDbService); + var handler = new MedicalHistoryFileManagementHandler(_medicalHistoryRepository, _patientRepository, + _medicalHistoryMongoDbService); var response = await handler.HandleCreate(medicalHistoryCreateDto); return StatusCode(response.StatusCode, response); } @@ -49,7 +56,8 @@ public class MedicalHistoryController : ControllerBase [HttpPut] public async Task> UpdateAsync(MedicalHistoryUpdateDto medicalHistoryUpdateDto) { - var handler = new MedicalHistoryHandler(_medicalHistoryRepository, _patientRepository, _medicalHistoryMongoDbService); + var handler = new MedicalHistoryFileManagementHandler(_medicalHistoryRepository, _patientRepository, + _medicalHistoryMongoDbService); var response = await handler.HandleUpdate(medicalHistoryUpdateDto).ConfigureAwait(false); return StatusCode(response.StatusCode, response); } @@ -57,16 +65,30 @@ public class MedicalHistoryController : ControllerBase [HttpDelete("{id}")] public async Task> DeleteAsync(Guid id) { - var handler = new MedicalHistoryHandler(_medicalHistoryRepository, _patientRepository, _medicalHistoryMongoDbService); + var handler = new MedicalHistoryFileManagementHandler(_medicalHistoryRepository, _patientRepository, + _medicalHistoryMongoDbService); var response = await handler.HandleDelete(id); return StatusCode(response.StatusCode, response); } - /* + [HttpPut("grant_access")] - public async Task> GrantAccessToMedicalHistory(GrantAccessMedicalHistoryDto) + public async Task> GrantAccessToMedicalHistory( + MedicalHistoryManageAuthorizationDoctorDto infoDto) { - return NotFound(); + var handler = new MedicalHistoryManageAuthorizationHandler(_medicalHistoryRepository, + _medicalHistoryMongoDbService, _doctorRepository); + var response = await handler.HandleGrantDoctorAccess(infoDto); + return StatusCode(response.StatusCode, response); + } + + [HttpPut("revoke_access")] + public async Task> RevokeAccessToMedicalHistory( + MedicalHistoryManageAuthorizationDoctorDto infoDto) + { + var handler = new MedicalHistoryManageAuthorizationHandler(_medicalHistoryRepository, + _medicalHistoryMongoDbService, _doctorRepository); + var response = await handler.HandleRevokeDoctorAccess(infoDto); + return StatusCode(response.StatusCode, response); } - */ } \ No newline at end of file diff --git a/backend/API/Controllers/PatientsController.cs b/backend/API/Controllers/PatientsController.cs index 90beb2b..d719f74 100644 --- a/backend/API/Controllers/PatientsController.cs +++ b/backend/API/Controllers/PatientsController.cs @@ -5,6 +5,8 @@ using Application.Endpoints.Patients.Registration; using Application.Endpoints.Patients.ResetPassword; using Application.Services.Database; using Application.Services.HashingAlgorithms; +using Application.Services.Jwt; +using Core.Entities; using Microsoft.AspNetCore.Mvc; namespace API.Controllers; @@ -15,11 +17,14 @@ public class PatientsController : ControllerBase { private readonly IHashingAlgorithms _hashingAlgorithms; private readonly IPatientRepository _patientRepository; + private readonly IJwtService _jwtService; - public PatientsController(IPatientRepository patientRepository, IHashingAlgorithms hashingAlgorithms) + public PatientsController(IPatientRepository patientRepository, IHashingAlgorithms hashingAlgorithms, + IJwtService jwtService) { _patientRepository = patientRepository; _hashingAlgorithms = hashingAlgorithms; + _jwtService = jwtService; } [HttpGet] @@ -43,8 +48,52 @@ public class PatientsController : ControllerBase { var handler = new PatientLoginHandler(_patientRepository); var response = await handler.Handle(patientLoginDto).ConfigureAwait(false); + if (response.Data != null) + { + Patient patient = (Patient)response.Data; + var authToken = _jwtService.GenerateJwtToken(patient.Email); + + HttpContext.Response.Headers.Add("Authorization", $"Bearer {authToken}"); + } return StatusCode(response.StatusCode, response); } + + [HttpPost("refresh_token")] + public async Task> RefreshToken() + { + var authorizationHeader = Request.Headers["Authorization"].FirstOrDefault(); + if (string.IsNullOrEmpty(authorizationHeader) || !authorizationHeader.StartsWith("Bearer ")) + { + return StatusCode(HttpStatusCodes.BadRequest, new BaseResponse + { + StatusCode = HttpStatusCodes.BadRequest, + Message = "Invalid request header format.", + Data = null + }); + } + + var oldToken = authorizationHeader.Substring("Bearer ".Length).Trim(); + + if (!_jwtService.ValidateJwtToken(oldToken)) + { + return StatusCode(HttpStatusCodes.Unauthorized, new BaseResponse + { + StatusCode = HttpStatusCodes.Unauthorized, + Message = "Invalid JWT token.", + Data = null + }); + } + else + { + var newToken = _jwtService.RefreshToken(oldToken); + return StatusCode(HttpStatusCodes.OK, new BaseResponse + { + StatusCode = HttpStatusCodes.OK, + Message = "Token refreshed successfully.", + Data = new { Token = newToken } + }); + } + } [HttpPost("register")] public async Task> Register(PatientRegistrationDto patientRegistrationDto) diff --git a/backend/API/Middlewares/JwtMiddleware.cs b/backend/API/Middlewares/JwtMiddleware.cs new file mode 100644 index 0000000..ee0c2f2 --- /dev/null +++ b/backend/API/Middlewares/JwtMiddleware.cs @@ -0,0 +1,57 @@ +using System.Text.Json; +using Application.Endpoints; + +namespace API.Middlewares; + +using Microsoft.AspNetCore.Http; +using System.Threading.Tasks; +using System.Linq; +using Application.Services.Jwt; + +public class JwtMiddleware +{ + private readonly RequestDelegate _next; + private readonly IJwtService _jwtService; + + public JwtMiddleware(RequestDelegate next, IJwtService jwtService) + { + _next = next; + _jwtService = jwtService; + } + + public async Task Invoke(HttpContext context) + { + var path = context.Request.Path.ToString().ToLower(); + + // Define the paths that should bypass JWT validation + var bypassPaths = new string[] + { + "/api/doctors/login", + "/api/doctors/register", + "/api/patients/login", + "/api/patients/register" + }; + + if (!bypassPaths.Contains(path)) + { + var token = context.Request.Headers["Authorization"].FirstOrDefault()?.Split(" ").Last(); + if (token != null && _jwtService.ValidateJwtToken(token)) + { + await _next(context); + } + else + { + context.Response.StatusCode = StatusCodes.Status401Unauthorized; + context.Response.ContentType = "application/json"; + var response = new BaseResponse + { + StatusCode = StatusCodes.Status401Unauthorized, + Message = "Invalid JWT Token", + Data = null + }; + var responseJson = JsonSerializer.Serialize(response); + await context.Response.WriteAsync(responseJson); + } + } + } +} \ No newline at end of file diff --git a/backend/API/Program.cs b/backend/API/Program.cs index 613c55b..d68d8ef 100644 --- a/backend/API/Program.cs +++ b/backend/API/Program.cs @@ -1,9 +1,15 @@ +using System.Text; using API.Middlewares; using Infrastructure; using Infrastructure.Data; using Microsoft.EntityFrameworkCore; +using Microsoft.IdentityModel.Tokens; using Microsoft.OpenApi.Models; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.IdentityModel.Tokens; +using System.Text; + var builder = WebApplication.CreateBuilder(args); builder.Services.AddControllers(); @@ -46,7 +52,19 @@ if (app.Environment.IsDevelopment()) } app.UseHttpsRedirection(); -app.UseAuthorization(); + +builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) + .AddJwtBearer(options => + { + options.TokenValidationParameters = new TokenValidationParameters + { + ValidateIssuerSigningKey = true, + IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(builder.Configuration["Jwt:SecretKey"])), + ValidateIssuer = false, + ValidateAudience = false, + ClockSkew = TimeSpan.Zero + }; + }); app.MapControllers(); diff --git a/backend/API/appsettings.json b/backend/API/appsettings.json index 41a5cdc..a10feee 100644 --- a/backend/API/appsettings.json +++ b/backend/API/appsettings.json @@ -17,5 +17,11 @@ "ApiKeySettings": { "ApiKey": "testapikey" }, + "Jwt": { + "SecretKey": "HealthcareManagerJwtKey", + "Issuer": "HealthcareManager", + "Audience": "HealthCareManagerUsers", + "ExpirationMinutes": 1440 + }, "AllowedHosts": "*" } diff --git a/backend/API/bin/Debug/net8.0/API.dll b/backend/API/bin/Debug/net8.0/API.dll index 7f1157a..97022a5 100644 Binary files a/backend/API/bin/Debug/net8.0/API.dll and b/backend/API/bin/Debug/net8.0/API.dll differ diff --git a/backend/API/bin/Debug/net8.0/API.exe b/backend/API/bin/Debug/net8.0/API.exe index 8f171b5..cf6299a 100644 Binary files a/backend/API/bin/Debug/net8.0/API.exe and b/backend/API/bin/Debug/net8.0/API.exe differ diff --git a/backend/API/bin/Debug/net8.0/API.pdb b/backend/API/bin/Debug/net8.0/API.pdb index 03c9e62..fe98228 100644 Binary files a/backend/API/bin/Debug/net8.0/API.pdb and b/backend/API/bin/Debug/net8.0/API.pdb differ diff --git a/backend/API/bin/Debug/net8.0/Application.dll b/backend/API/bin/Debug/net8.0/Application.dll index 7a8b24f..ac54dcf 100644 Binary files a/backend/API/bin/Debug/net8.0/Application.dll and b/backend/API/bin/Debug/net8.0/Application.dll differ diff --git a/backend/API/bin/Debug/net8.0/Application.pdb b/backend/API/bin/Debug/net8.0/Application.pdb index 9acaaf3..582da16 100644 Binary files a/backend/API/bin/Debug/net8.0/Application.pdb and b/backend/API/bin/Debug/net8.0/Application.pdb differ diff --git a/backend/API/bin/Debug/net8.0/Core.dll b/backend/API/bin/Debug/net8.0/Core.dll index 02b0d46..62444bc 100644 Binary files a/backend/API/bin/Debug/net8.0/Core.dll and b/backend/API/bin/Debug/net8.0/Core.dll differ diff --git a/backend/API/bin/Debug/net8.0/Core.pdb b/backend/API/bin/Debug/net8.0/Core.pdb index fafb776..be53c18 100644 Binary files a/backend/API/bin/Debug/net8.0/Core.pdb and b/backend/API/bin/Debug/net8.0/Core.pdb differ diff --git a/backend/API/bin/Debug/net8.0/Infrastructure.dll b/backend/API/bin/Debug/net8.0/Infrastructure.dll index 3c7b6d1..589a16f 100644 Binary files a/backend/API/bin/Debug/net8.0/Infrastructure.dll and b/backend/API/bin/Debug/net8.0/Infrastructure.dll differ diff --git a/backend/API/bin/Debug/net8.0/Infrastructure.pdb b/backend/API/bin/Debug/net8.0/Infrastructure.pdb index 7fe98f5..b2032af 100644 Binary files a/backend/API/bin/Debug/net8.0/Infrastructure.pdb and b/backend/API/bin/Debug/net8.0/Infrastructure.pdb differ diff --git a/backend/API/bin/Debug/net8.0/appsettings.json b/backend/API/bin/Debug/net8.0/appsettings.json index 1d53258..41a5cdc 100644 --- a/backend/API/bin/Debug/net8.0/appsettings.json +++ b/backend/API/bin/Debug/net8.0/appsettings.json @@ -10,7 +10,7 @@ "MongoDBConnection": "mongodb+srv://andrei_cerbu:andrei@cluster0.v80skg6.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0" }, "HealthcareManagerDatabase": { - "Name":"HealthcareManager", + "Name": "HealthcareManager", "MedicalRecordCollectionName": "MedicalHistory", "ChatCollectionName": "Chat" }, diff --git a/backend/API/obj/API.csproj.nuget.dgspec.json b/backend/API/obj/API.csproj.nuget.dgspec.json index 7f350f9..83c6210 100644 --- a/backend/API/obj/API.csproj.nuget.dgspec.json +++ b/backend/API/obj/API.csproj.nuget.dgspec.json @@ -14,14 +14,12 @@ "outputPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\API\\obj\\", "projectStyle": "PackageReference", "configFilePaths": [ - "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config", - "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config" ], "originalTargetFrameworks": [ "net8.0" ], "sources": { - "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { @@ -47,6 +45,10 @@ "net8.0": { "targetAlias": "net8.0", "dependencies": { + "Microsoft.AspNetCore.Authentication.JwtBearer": { + "target": "Package", + "version": "[8.0.3, )" + }, "Swashbuckle.AspNetCore": { "target": "Package", "version": "[6.5.0, )" @@ -71,7 +73,7 @@ "privateAssets": "all" } }, - "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json" + "runtimeIdentifierGraphPath": "C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json" } } }, @@ -85,14 +87,12 @@ "outputPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\obj\\", "projectStyle": "PackageReference", "configFilePaths": [ - "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config", - "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config" ], "originalTargetFrameworks": [ "net8.0" ], "sources": { - "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { @@ -140,7 +140,7 @@ "privateAssets": "all" } }, - "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json" + "runtimeIdentifierGraphPath": "C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json" } } }, @@ -154,14 +154,12 @@ "outputPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\obj\\", "projectStyle": "PackageReference", "configFilePaths": [ - "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config", - "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config" ], "originalTargetFrameworks": [ "net8.0" ], "sources": { - "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { @@ -201,7 +199,7 @@ "privateAssets": "all" } }, - "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json" + "runtimeIdentifierGraphPath": "C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json" } } }, @@ -215,14 +213,12 @@ "outputPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Infrastructure\\obj\\", "projectStyle": "PackageReference", "configFilePaths": [ - "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config", - "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config" ], "originalTargetFrameworks": [ "net8.0" ], "sources": { - "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { @@ -274,6 +270,10 @@ "target": "Package", "version": "[8.0.0, )" }, + "Microsoft.IdentityModel.Tokens": { + "target": "Package", + "version": "[7.5.1, )" + }, "MongoDB.Driver": { "target": "Package", "version": "[2.24.0, )" @@ -281,6 +281,10 @@ "Npgsql.EntityFrameworkCore.PostgreSQL": { "target": "Package", "version": "[8.0.2, )" + }, + "System.IdentityModel.Tokens.Jwt": { + "target": "Package", + "version": "[7.5.1, )" } }, "imports": [ @@ -299,7 +303,7 @@ "privateAssets": "all" } }, - "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json" + "runtimeIdentifierGraphPath": "C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json" } } } diff --git a/backend/API/obj/Debug/net8.0/API.AssemblyInfo.cs b/backend/API/obj/Debug/net8.0/API.AssemblyInfo.cs index 9029da5..bb2ae49 100644 --- a/backend/API/obj/Debug/net8.0/API.AssemblyInfo.cs +++ b/backend/API/obj/Debug/net8.0/API.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("API")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+61a55fa7353346bdad2d677f0ec3c044c3aa87d5")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+90604e48ae9f78fa417a446c05f7759001447de5")] [assembly: System.Reflection.AssemblyProductAttribute("API")] [assembly: System.Reflection.AssemblyTitleAttribute("API")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/backend/API/obj/Debug/net8.0/API.AssemblyInfoInputs.cache b/backend/API/obj/Debug/net8.0/API.AssemblyInfoInputs.cache index f53a41e..7670bf0 100644 --- a/backend/API/obj/Debug/net8.0/API.AssemblyInfoInputs.cache +++ b/backend/API/obj/Debug/net8.0/API.AssemblyInfoInputs.cache @@ -1 +1 @@ -9384050dd4f92ebe3a80d1f56d1515196db26fe72de654a1ee0d4041a1b7e633 +8bbfd346519394cfd8dd09e31e613d7ac5c277d6dcd8753ee217716e41cadd15 diff --git a/backend/API/obj/Debug/net8.0/API.assets.cache b/backend/API/obj/Debug/net8.0/API.assets.cache index 7b44c83..33816ec 100644 Binary files a/backend/API/obj/Debug/net8.0/API.assets.cache and b/backend/API/obj/Debug/net8.0/API.assets.cache differ diff --git a/backend/API/obj/Debug/net8.0/API.csproj.AssemblyReference.cache b/backend/API/obj/Debug/net8.0/API.csproj.AssemblyReference.cache index 8ebbf02..1c1e8a4 100644 Binary files a/backend/API/obj/Debug/net8.0/API.csproj.AssemblyReference.cache and b/backend/API/obj/Debug/net8.0/API.csproj.AssemblyReference.cache differ diff --git a/backend/API/obj/Debug/net8.0/API.csproj.CoreCompileInputs.cache b/backend/API/obj/Debug/net8.0/API.csproj.CoreCompileInputs.cache index f499b68..3f83bc6 100644 --- a/backend/API/obj/Debug/net8.0/API.csproj.CoreCompileInputs.cache +++ b/backend/API/obj/Debug/net8.0/API.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -3416e3272dd0e47374f982bfa273624c68a9149bad5e6bd93b7898d980bc8f46 +06fc5bd1554959a9b32bbdb9ef6b3f86b090ac26bcc67914d438a39ee322e613 diff --git a/backend/API/obj/Debug/net8.0/API.dll b/backend/API/obj/Debug/net8.0/API.dll index 7f1157a..97022a5 100644 Binary files a/backend/API/obj/Debug/net8.0/API.dll and b/backend/API/obj/Debug/net8.0/API.dll differ diff --git a/backend/API/obj/Debug/net8.0/API.pdb b/backend/API/obj/Debug/net8.0/API.pdb index 03c9e62..fe98228 100644 Binary files a/backend/API/obj/Debug/net8.0/API.pdb and b/backend/API/obj/Debug/net8.0/API.pdb differ diff --git a/backend/API/obj/Debug/net8.0/API.sourcelink.json b/backend/API/obj/Debug/net8.0/API.sourcelink.json index ecec2f0..84ecd88 100644 --- a/backend/API/obj/Debug/net8.0/API.sourcelink.json +++ b/backend/API/obj/Debug/net8.0/API.sourcelink.json @@ -1 +1 @@ -{"documents":{"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\*":"https://raw.githubusercontent.com/andrei-mihnea-cerbu/CC-FinalProj/61a55fa7353346bdad2d677f0ec3c044c3aa87d5/*"}} \ No newline at end of file +{"documents":{"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\*":"https://raw.githubusercontent.com/andrei-mihnea-cerbu/CC-FinalProj/48eb2adcbd149cd66c77ba558f492179d2bf29be/*"}} \ No newline at end of file diff --git a/backend/API/obj/Debug/net8.0/apphost.exe b/backend/API/obj/Debug/net8.0/apphost.exe index 8f171b5..cf6299a 100644 Binary files a/backend/API/obj/Debug/net8.0/apphost.exe and b/backend/API/obj/Debug/net8.0/apphost.exe differ diff --git a/backend/API/obj/Debug/net8.0/ref/API.dll b/backend/API/obj/Debug/net8.0/ref/API.dll index d3bf7c3..dc0a122 100644 Binary files a/backend/API/obj/Debug/net8.0/ref/API.dll and b/backend/API/obj/Debug/net8.0/ref/API.dll differ diff --git a/backend/API/obj/Debug/net8.0/refint/API.dll b/backend/API/obj/Debug/net8.0/refint/API.dll index d3bf7c3..dc0a122 100644 Binary files a/backend/API/obj/Debug/net8.0/refint/API.dll and b/backend/API/obj/Debug/net8.0/refint/API.dll differ diff --git a/backend/API/obj/project.assets.json b/backend/API/obj/project.assets.json index ba87dfb..441667d 100644 --- a/backend/API/obj/project.assets.json +++ b/backend/API/obj/project.assets.json @@ -60,6 +60,25 @@ } } }, + "Microsoft.AspNetCore.Authentication.JwtBearer/8.0.3": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.Protocols.OpenIdConnect": "7.1.2" + }, + "compile": { + "lib/net8.0/Microsoft.AspNetCore.Authentication.JwtBearer.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.AspNetCore.Authentication.JwtBearer.dll": { + "related": ".xml" + } + }, + "frameworkReferences": [ + "Microsoft.AspNetCore.App" + ] + }, "Microsoft.EntityFrameworkCore/8.0.3": { "type": "package", "dependencies": { @@ -468,6 +487,101 @@ "buildTransitive/net6.0/_._": {} } }, + "Microsoft.IdentityModel.Abstractions/7.5.1": { + "type": "package", + "compile": { + "lib/net8.0/Microsoft.IdentityModel.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.Abstractions.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.JsonWebTokens/7.5.1": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.Tokens": "7.5.1" + }, + "compile": { + "lib/net8.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.Logging/7.5.1": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "7.5.1" + }, + "compile": { + "lib/net8.0/Microsoft.IdentityModel.Logging.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.Logging.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.Protocols/7.1.2": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.Logging": "7.1.2", + "Microsoft.IdentityModel.Tokens": "7.1.2" + }, + "compile": { + "lib/net8.0/Microsoft.IdentityModel.Protocols.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.Protocols.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.Protocols.OpenIdConnect/7.1.2": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.Protocols": "7.1.2", + "System.IdentityModel.Tokens.Jwt": "7.1.2" + }, + "compile": { + "lib/net8.0/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.Tokens/7.5.1": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.Logging": "7.5.1" + }, + "compile": { + "lib/net8.0/Microsoft.IdentityModel.Tokens.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.Tokens.dll": { + "related": ".xml" + } + } + }, "Microsoft.NETCore.Platforms/5.0.0": { "type": "package", "compile": { @@ -735,6 +849,23 @@ "lib/netcoreapp2.0/_._": {} } }, + "System.IdentityModel.Tokens.Jwt/7.5.1": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.JsonWebTokens": "7.5.1", + "Microsoft.IdentityModel.Tokens": "7.5.1" + }, + "compile": { + "lib/net8.0/System.IdentityModel.Tokens.Jwt.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/System.IdentityModel.Tokens.Jwt.dll": { + "related": ".xml" + } + } + }, "System.Memory/4.5.5": { "type": "package", "compile": { @@ -892,8 +1023,10 @@ "Microsoft.Extensions.Configuration": "8.0.0", "Microsoft.Extensions.Configuration.Json": "8.0.0", "Microsoft.Extensions.Options.ConfigurationExtensions": "8.0.0", + "Microsoft.IdentityModel.Tokens": "7.5.1", "MongoDB.Driver": "2.24.0", - "Npgsql.EntityFrameworkCore.PostgreSQL": "8.0.2" + "Npgsql.EntityFrameworkCore.PostgreSQL": "8.0.2", + "System.IdentityModel.Tokens.Jwt": "7.5.1" }, "compile": { "bin/placeholder/Infrastructure.dll": {} @@ -1006,6 +1139,21 @@ "lib/netstandard2.1/FluentValidation.xml" ] }, + "Microsoft.AspNetCore.Authentication.JwtBearer/8.0.3": { + "sha512": "VsDy8R6/0ushSpUow7m4lB82ovVBnI1e2AtPo1z22pzYzUjqY9QJvaexzqMkwmI3K1CVdT6MweXiWoqCcHrJbA==", + "type": "package", + "path": "microsoft.aspnetcore.authentication.jwtbearer/8.0.3", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "THIRD-PARTY-NOTICES.TXT", + "lib/net8.0/Microsoft.AspNetCore.Authentication.JwtBearer.dll", + "lib/net8.0/Microsoft.AspNetCore.Authentication.JwtBearer.xml", + "microsoft.aspnetcore.authentication.jwtbearer.8.0.3.nupkg.sha512", + "microsoft.aspnetcore.authentication.jwtbearer.nuspec" + ] + }, "Microsoft.EntityFrameworkCore/8.0.3": { "sha512": "QUPQbeq4yCjgIL/6PzkhfwhljXmai3CNOsErWFJ/WJ1Z41V8+At0Bi4PT8/2pX25kPgf83g0CUKIZd0QbeKT4A==", "type": "package", @@ -1885,6 +2033,144 @@ "useSharedDesignerContext.txt" ] }, + "Microsoft.IdentityModel.Abstractions/7.5.1": { + "sha512": "PT16ZFbPIiMsYv07oy3zOjqUOJ7xutGBkJTOX0+IbNyU6+O6X7aIxjq9EaSSRLWbekRgamgtmfg8Xjw6A6Ua9g==", + "type": "package", + "path": "microsoft.identitymodel.abstractions/7.5.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net461/Microsoft.IdentityModel.Abstractions.dll", + "lib/net461/Microsoft.IdentityModel.Abstractions.xml", + "lib/net462/Microsoft.IdentityModel.Abstractions.dll", + "lib/net462/Microsoft.IdentityModel.Abstractions.xml", + "lib/net472/Microsoft.IdentityModel.Abstractions.dll", + "lib/net472/Microsoft.IdentityModel.Abstractions.xml", + "lib/net6.0/Microsoft.IdentityModel.Abstractions.dll", + "lib/net6.0/Microsoft.IdentityModel.Abstractions.xml", + "lib/net8.0/Microsoft.IdentityModel.Abstractions.dll", + "lib/net8.0/Microsoft.IdentityModel.Abstractions.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.xml", + "microsoft.identitymodel.abstractions.7.5.1.nupkg.sha512", + "microsoft.identitymodel.abstractions.nuspec" + ] + }, + "Microsoft.IdentityModel.JsonWebTokens/7.5.1": { + "sha512": "93CGSa8RPdZU8zfvA3nf9NGKUqEnQrE12VzYlMqKh72ddhzusosqLNEUgH/YhFWBLRFOnY1RCgHMV7pR+sAx2w==", + "type": "package", + "path": "microsoft.identitymodel.jsonwebtokens/7.5.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net461/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net461/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/net462/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net462/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/net472/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net472/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/net6.0/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net6.0/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/net8.0/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net8.0/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.JsonWebTokens.xml", + "microsoft.identitymodel.jsonwebtokens.7.5.1.nupkg.sha512", + "microsoft.identitymodel.jsonwebtokens.nuspec" + ] + }, + "Microsoft.IdentityModel.Logging/7.5.1": { + "sha512": "PnpAQX20BAiDIPYmWUyQSlEaWD8BLXzHpiDGTCT568Cs0ReOeyzNe401LzCeiv6ilug/KefVeV1CeqtCHTo8dw==", + "type": "package", + "path": "microsoft.identitymodel.logging/7.5.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net461/Microsoft.IdentityModel.Logging.dll", + "lib/net461/Microsoft.IdentityModel.Logging.xml", + "lib/net462/Microsoft.IdentityModel.Logging.dll", + "lib/net462/Microsoft.IdentityModel.Logging.xml", + "lib/net472/Microsoft.IdentityModel.Logging.dll", + "lib/net472/Microsoft.IdentityModel.Logging.xml", + "lib/net6.0/Microsoft.IdentityModel.Logging.dll", + "lib/net6.0/Microsoft.IdentityModel.Logging.xml", + "lib/net8.0/Microsoft.IdentityModel.Logging.dll", + "lib/net8.0/Microsoft.IdentityModel.Logging.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.Logging.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.Logging.xml", + "microsoft.identitymodel.logging.7.5.1.nupkg.sha512", + "microsoft.identitymodel.logging.nuspec" + ] + }, + "Microsoft.IdentityModel.Protocols/7.1.2": { + "sha512": "SydLwMRFx6EHPWJ+N6+MVaoArN1Htt92b935O3RUWPY1yUF63zEjvd3lBu79eWdZUwedP8TN2I5V9T3nackvIQ==", + "type": "package", + "path": "microsoft.identitymodel.protocols/7.1.2", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net461/Microsoft.IdentityModel.Protocols.dll", + "lib/net461/Microsoft.IdentityModel.Protocols.xml", + "lib/net462/Microsoft.IdentityModel.Protocols.dll", + "lib/net462/Microsoft.IdentityModel.Protocols.xml", + "lib/net472/Microsoft.IdentityModel.Protocols.dll", + "lib/net472/Microsoft.IdentityModel.Protocols.xml", + "lib/net6.0/Microsoft.IdentityModel.Protocols.dll", + "lib/net6.0/Microsoft.IdentityModel.Protocols.xml", + "lib/net8.0/Microsoft.IdentityModel.Protocols.dll", + "lib/net8.0/Microsoft.IdentityModel.Protocols.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.Protocols.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.Protocols.xml", + "microsoft.identitymodel.protocols.7.1.2.nupkg.sha512", + "microsoft.identitymodel.protocols.nuspec" + ] + }, + "Microsoft.IdentityModel.Protocols.OpenIdConnect/7.1.2": { + "sha512": "6lHQoLXhnMQ42mGrfDkzbIOR3rzKM1W1tgTeMPLgLCqwwGw0d96xFi/UiX/fYsu7d6cD5MJiL3+4HuI8VU+sVQ==", + "type": "package", + "path": "microsoft.identitymodel.protocols.openidconnect/7.1.2", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net461/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll", + "lib/net461/Microsoft.IdentityModel.Protocols.OpenIdConnect.xml", + "lib/net462/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll", + "lib/net462/Microsoft.IdentityModel.Protocols.OpenIdConnect.xml", + "lib/net472/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll", + "lib/net472/Microsoft.IdentityModel.Protocols.OpenIdConnect.xml", + "lib/net6.0/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll", + "lib/net6.0/Microsoft.IdentityModel.Protocols.OpenIdConnect.xml", + "lib/net8.0/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll", + "lib/net8.0/Microsoft.IdentityModel.Protocols.OpenIdConnect.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.Protocols.OpenIdConnect.xml", + "microsoft.identitymodel.protocols.openidconnect.7.1.2.nupkg.sha512", + "microsoft.identitymodel.protocols.openidconnect.nuspec" + ] + }, + "Microsoft.IdentityModel.Tokens/7.5.1": { + "sha512": "Q3DKpyFViP84IUlTFKH/zIkswIrmSh2Vd/eFDo4wlOHy4DYxoweZEEw4kDEiKt9VCX6o7SddK3HK2xDYyFpexA==", + "type": "package", + "path": "microsoft.identitymodel.tokens/7.5.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net461/Microsoft.IdentityModel.Tokens.dll", + "lib/net461/Microsoft.IdentityModel.Tokens.xml", + "lib/net462/Microsoft.IdentityModel.Tokens.dll", + "lib/net462/Microsoft.IdentityModel.Tokens.xml", + "lib/net472/Microsoft.IdentityModel.Tokens.dll", + "lib/net472/Microsoft.IdentityModel.Tokens.xml", + "lib/net6.0/Microsoft.IdentityModel.Tokens.dll", + "lib/net6.0/Microsoft.IdentityModel.Tokens.xml", + "lib/net8.0/Microsoft.IdentityModel.Tokens.dll", + "lib/net8.0/Microsoft.IdentityModel.Tokens.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.Tokens.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.Tokens.xml", + "microsoft.identitymodel.tokens.7.5.1.nupkg.sha512", + "microsoft.identitymodel.tokens.nuspec" + ] + }, "Microsoft.NETCore.Platforms/5.0.0": { "sha512": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==", "type": "package", @@ -2244,6 +2530,29 @@ "version.txt" ] }, + "System.IdentityModel.Tokens.Jwt/7.5.1": { + "sha512": "UUw+E0R73lZLlXgneYIJQxNs1kfbcxjVzw64JQyiwjqCd4HMpAbjn+xRo86QZT84uHq8/MkqvfH82tgjgPzpuw==", + "type": "package", + "path": "system.identitymodel.tokens.jwt/7.5.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net461/System.IdentityModel.Tokens.Jwt.dll", + "lib/net461/System.IdentityModel.Tokens.Jwt.xml", + "lib/net462/System.IdentityModel.Tokens.Jwt.dll", + "lib/net462/System.IdentityModel.Tokens.Jwt.xml", + "lib/net472/System.IdentityModel.Tokens.Jwt.dll", + "lib/net472/System.IdentityModel.Tokens.Jwt.xml", + "lib/net6.0/System.IdentityModel.Tokens.Jwt.dll", + "lib/net6.0/System.IdentityModel.Tokens.Jwt.xml", + "lib/net8.0/System.IdentityModel.Tokens.Jwt.dll", + "lib/net8.0/System.IdentityModel.Tokens.Jwt.xml", + "lib/netstandard2.0/System.IdentityModel.Tokens.Jwt.dll", + "lib/netstandard2.0/System.IdentityModel.Tokens.Jwt.xml", + "system.identitymodel.tokens.jwt.7.5.1.nupkg.sha512", + "system.identitymodel.tokens.jwt.nuspec" + ] + }, "System.Memory/4.5.5": { "sha512": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", "type": "package", @@ -2547,6 +2856,7 @@ "net8.0": [ "Application >= 1.0.0", "Infrastructure >= 1.0.0", + "Microsoft.AspNetCore.Authentication.JwtBearer >= 8.0.3", "Swashbuckle.AspNetCore >= 6.5.0" ] }, @@ -2563,14 +2873,12 @@ "outputPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\API\\obj\\", "projectStyle": "PackageReference", "configFilePaths": [ - "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config", - "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config" ], "originalTargetFrameworks": [ "net8.0" ], "sources": { - "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { @@ -2596,6 +2904,10 @@ "net8.0": { "targetAlias": "net8.0", "dependencies": { + "Microsoft.AspNetCore.Authentication.JwtBearer": { + "target": "Package", + "version": "[8.0.3, )" + }, "Swashbuckle.AspNetCore": { "target": "Package", "version": "[6.5.0, )" @@ -2620,7 +2932,7 @@ "privateAssets": "all" } }, - "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json" + "runtimeIdentifierGraphPath": "C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json" } } } diff --git a/backend/API/obj/project.nuget.cache b/backend/API/obj/project.nuget.cache index e3eeb12..476d4dc 100644 --- a/backend/API/obj/project.nuget.cache +++ b/backend/API/obj/project.nuget.cache @@ -1,6 +1,6 @@ { "version": 2, - "dgSpecHash": "nH+v0/ZQ0hK0w3knyskezmqQzqvqCYUEVhsdP2suOMyzmw/bxzwSVgn9E+iUU+5wOUyeCGutEG5PTTU1y/XNwA==", + "dgSpecHash": "H5Qo0sozwr+dtjWKUvuynj4zk8X++aQJuu1j0FXoS/GLj1KwbgdyFric4d5FbEvjaO4v4r35BCqsZQZKD1Euvg==", "success": true, "projectFilePath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\API\\API.csproj", "expectedPackageFiles": [ @@ -8,6 +8,7 @@ "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\awssdk.securitytoken\\3.7.100.14\\awssdk.securitytoken.3.7.100.14.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\dnsclient\\1.6.1\\dnsclient.1.6.1.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\fluentvalidation\\11.9.0\\fluentvalidation.11.9.0.nupkg.sha512", + "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.aspnetcore.authentication.jwtbearer\\8.0.3\\microsoft.aspnetcore.authentication.jwtbearer.8.0.3.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.entityframeworkcore\\8.0.3\\microsoft.entityframeworkcore.8.0.3.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.entityframeworkcore.abstractions\\8.0.3\\microsoft.entityframeworkcore.abstractions.8.0.3.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.entityframeworkcore.analyzers\\8.0.3\\microsoft.entityframeworkcore.analyzers.8.0.3.nupkg.sha512", @@ -30,6 +31,12 @@ "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.extensions.options\\8.0.0\\microsoft.extensions.options.8.0.0.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.extensions.options.configurationextensions\\8.0.0\\microsoft.extensions.options.configurationextensions.8.0.0.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.extensions.primitives\\8.0.0\\microsoft.extensions.primitives.8.0.0.nupkg.sha512", + "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.identitymodel.abstractions\\7.5.1\\microsoft.identitymodel.abstractions.7.5.1.nupkg.sha512", + "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.identitymodel.jsonwebtokens\\7.5.1\\microsoft.identitymodel.jsonwebtokens.7.5.1.nupkg.sha512", + "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.identitymodel.logging\\7.5.1\\microsoft.identitymodel.logging.7.5.1.nupkg.sha512", + "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.identitymodel.protocols\\7.1.2\\microsoft.identitymodel.protocols.7.1.2.nupkg.sha512", + "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.identitymodel.protocols.openidconnect\\7.1.2\\microsoft.identitymodel.protocols.openidconnect.7.1.2.nupkg.sha512", + "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.identitymodel.tokens\\7.5.1\\microsoft.identitymodel.tokens.7.5.1.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.netcore.platforms\\5.0.0\\microsoft.netcore.platforms.5.0.0.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.openapi\\1.2.3\\microsoft.openapi.1.2.3.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.win32.registry\\5.0.0\\microsoft.win32.registry.5.0.0.nupkg.sha512", @@ -46,6 +53,7 @@ "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\swashbuckle.aspnetcore.swaggergen\\6.5.0\\swashbuckle.aspnetcore.swaggergen.6.5.0.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\swashbuckle.aspnetcore.swaggerui\\6.5.0\\swashbuckle.aspnetcore.swaggerui.6.5.0.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\system.buffers\\4.5.1\\system.buffers.4.5.1.nupkg.sha512", + "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\system.identitymodel.tokens.jwt\\7.5.1\\system.identitymodel.tokens.jwt.7.5.1.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\system.memory\\4.5.5\\system.memory.4.5.5.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\system.runtime.compilerservices.unsafe\\5.0.0\\system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\system.security.accesscontrol\\5.0.0\\system.security.accesscontrol.5.0.0.nupkg.sha512", diff --git a/backend/API/obj/project.packagespec.json b/backend/API/obj/project.packagespec.json index ae8a9ca..66d0374 100644 --- a/backend/API/obj/project.packagespec.json +++ b/backend/API/obj/project.packagespec.json @@ -1 +1 @@ -"restore":{"projectUniqueName":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\API\\API.csproj","projectName":"API","projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\API\\API.csproj","outputPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\API\\obj\\","projectStyle":"PackageReference","originalTargetFrameworks":["net8.0"],"sources":{"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\":{},"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net8.0":{"targetAlias":"net8.0","projectReferences":{"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\Application.csproj":{"projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\Application.csproj"},"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Infrastructure\\Infrastructure.csproj":{"projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Infrastructure\\Infrastructure.csproj"}}}},"warningProperties":{"warnAsError":["NU1605"]}}"frameworks":{"net8.0":{"targetAlias":"net8.0","dependencies":{"Swashbuckle.AspNetCore":{"target":"Package","version":"[6.5.0, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.AspNetCore.App":{"privateAssets":"none"},"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json"}} \ No newline at end of file +"restore":{"projectUniqueName":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\API\\API.csproj","projectName":"API","projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\API\\API.csproj","outputPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\API\\obj\\","projectStyle":"PackageReference","originalTargetFrameworks":["net8.0"],"sources":{"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net8.0":{"targetAlias":"net8.0","projectReferences":{"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\Application.csproj":{"projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\Application.csproj"},"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Infrastructure\\Infrastructure.csproj":{"projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Infrastructure\\Infrastructure.csproj"}}}},"warningProperties":{"warnAsError":["NU1605"]}}"frameworks":{"net8.0":{"targetAlias":"net8.0","dependencies":{"Microsoft.AspNetCore.Authentication.JwtBearer":{"target":"Package","version":"[8.0.3, )"},"Swashbuckle.AspNetCore":{"target":"Package","version":"[6.5.0, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.AspNetCore.App":{"privateAssets":"none"},"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json"}} \ No newline at end of file diff --git a/backend/API/obj/rider.project.model.nuget.info b/backend/API/obj/rider.project.model.nuget.info index 87e2209..99b6ed8 100644 --- a/backend/API/obj/rider.project.model.nuget.info +++ b/backend/API/obj/rider.project.model.nuget.info @@ -1 +1 @@ -17125194878710486 \ No newline at end of file +17125558124497896 \ No newline at end of file diff --git a/backend/API/obj/rider.project.restore.info b/backend/API/obj/rider.project.restore.info index d47398b..b11d575 100644 --- a/backend/API/obj/rider.project.restore.info +++ b/backend/API/obj/rider.project.restore.info @@ -1 +1 @@ -17125195144135930 \ No newline at end of file +17125685577964752 \ No newline at end of file diff --git a/backend/Application/Endpoints/Chats/ChatHandler.cs b/backend/Application/Endpoints/Chats/ChatHandler.cs new file mode 100644 index 0000000..5f5bdbc --- /dev/null +++ b/backend/Application/Endpoints/Chats/ChatHandler.cs @@ -0,0 +1,150 @@ +using Application.Services.Database; +using Application.Services.Database.MongoDB; +using Core.Entities; + +namespace Application.Endpoints.Chats; + +public class ChatHandler +{ + private readonly IChatMongoDbService _chatMongoDbService; + private readonly IPatientRepository _patientRepository; + private readonly IDoctorRepository _doctorRepository; + + public ChatHandler(IChatMongoDbService chatMongoDbService, IPatientRepository patientRepository, + IDoctorRepository doctorRepository) + { + _chatMongoDbService = chatMongoDbService; + _patientRepository = patientRepository; + _doctorRepository = doctorRepository; + } + + public async Task HandleSendMessage(SendMessageDto sendMessageDto) + { + var validation = new SendMessageValidator(); + var validationResult = await validation.ValidateAsync(sendMessageDto); + + if (!validationResult.IsValid) + { + var firstError = validationResult.Errors.FirstOrDefault(); + var errorCode = int.TryParse(firstError.ErrorCode, out var code) ? code : -1; + var errorMessage = firstError.ErrorMessage; + + return new BaseResponse + { + StatusCode = errorCode, + Message = errorMessage, + Data = null + }; + } + + if (!await CheckForUsersExistence(sendMessageDto.Sender, sendMessageDto.Receiver)) + { + return new BaseResponse + { + StatusCode = HttpStatusCodes.BadRequest, + Message = "Users can't be found in the system.", + Data = null + }; + } + + var chatId = ChatIdentifier.GenerateChatId(sendMessageDto.Sender, sendMessageDto.Receiver); + + var criteria = new List<(string, string)>(); + criteria.Add(("_id", chatId)); + + var documents = await _chatMongoDbService.FindAsync(criteria); + if (!documents.Any()) + { + return new BaseResponse() + { + StatusCode = HttpStatusCodes.NotFound, + Message = "Access to medical history not found.", + Data = null + }; + } + + var chat = documents[0].Messages; + chat.Add(new Message(sendMessageDto.Sender, sendMessageDto.Message)); + + var newChat = new Chat(); + newChat.SetId(chatId); + newChat.SetMessages(chat); + + await _chatMongoDbService.ModifyAsync("_id", chatId, newChat); + + return new BaseResponse + { + StatusCode = HttpStatusCodes.NoContent, + Message = null, + Data = null + }; + } + + public async Task HandleGetConversation(GetConversationDto getConversationDto) + { + var validation = new GetConversationValidator(); + var validationResult = await validation.ValidateAsync(getConversationDto); + + if (!validationResult.IsValid) + { + var firstError = validationResult.Errors.FirstOrDefault(); + var errorCode = int.TryParse(firstError.ErrorCode, out var code) ? code : -1; + var errorMessage = firstError.ErrorMessage; + + return new BaseResponse + { + StatusCode = errorCode, + Message = errorMessage, + Data = null + }; + } + + if (!await CheckForUsersExistence(getConversationDto.IdUser1, getConversationDto.IdUser2)) + { + return new BaseResponse + { + StatusCode = HttpStatusCodes.BadRequest, + Message = "Users can't be found in the system.", + Data = null + }; + } + + var chatId = ChatIdentifier.GenerateChatId(getConversationDto.IdUser1, getConversationDto.IdUser2); + + var criteria = new List<(string, string)>(); + criteria.Add(("_id", chatId)); + + Chat? chat = null; + + var documents = await _chatMongoDbService.FindAsync(criteria); + if (!documents.Any()) + { + chat = new Chat(); + chat.SetId(chatId); + + await _chatMongoDbService.AddAsync(chat); + } + else + { + chat = documents[0]; + } + + return new BaseResponse + { + StatusCode = HttpStatusCodes.OK, + Message = "Fetching messages.", + Data = chat + }; + } + + private async Task CheckForUsersExistence(Guid idUser1, Guid idUser2) + { + var firstCheck = await _patientRepository.GetByIdAsync(idUser1) != null && + await _doctorRepository.GetByIdAsync(idUser2) != null; + + var secondCheck = await _patientRepository.GetByIdAsync(idUser2) != null && + await _doctorRepository.GetByIdAsync(idUser1) != null; + + return firstCheck || secondCheck; + } +} \ No newline at end of file diff --git a/backend/Application/Endpoints/Chats/ChatIdentifier.cs b/backend/Application/Endpoints/Chats/ChatIdentifier.cs new file mode 100644 index 0000000..d391338 --- /dev/null +++ b/backend/Application/Endpoints/Chats/ChatIdentifier.cs @@ -0,0 +1,18 @@ +namespace Application.Endpoints.Chats; + +public class ChatIdentifier +{ + public static string GenerateChatId(Guid id1, Guid id2) + { + // Convert GUIDs to strings + string strId1 = id1.ToString(); + string strId2 = id2.ToString(); + + // Sort the GUID strings + string firstId = strId1.CompareTo(strId2) < 0 ? strId1 : strId2; + string secondId = strId1.CompareTo(strId2) < 0 ? strId2 : strId1; + + // Combine them to get a symmetric string + return firstId + "-" + secondId; + } +} \ No newline at end of file diff --git a/backend/Application/Endpoints/Chats/GetConversationDto.cs b/backend/Application/Endpoints/Chats/GetConversationDto.cs new file mode 100644 index 0000000..18044df --- /dev/null +++ b/backend/Application/Endpoints/Chats/GetConversationDto.cs @@ -0,0 +1,7 @@ +namespace Application.Endpoints.Chats; + +public class GetConversationDto +{ + public Guid IdUser1 { get; set; } + public Guid IdUser2 { get; set; } +} \ No newline at end of file diff --git a/backend/Application/Endpoints/Chats/GetConversationValidator.cs b/backend/Application/Endpoints/Chats/GetConversationValidator.cs new file mode 100644 index 0000000..2ba673e --- /dev/null +++ b/backend/Application/Endpoints/Chats/GetConversationValidator.cs @@ -0,0 +1,15 @@ +using FluentValidation; + +namespace Application.Endpoints.Chats; + +public class GetConversationValidator : AbstractValidator +{ + public GetConversationValidator() + { + RuleFor(x => x.IdUser1) + .NotEmpty().WithMessage("IdUser1 is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString()); + + RuleFor(x => x.IdUser2) + .NotEmpty().WithMessage("IdUser2 is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString()); + } +} \ No newline at end of file diff --git a/backend/Application/Endpoints/Chats/SendMessageDto.cs b/backend/Application/Endpoints/Chats/SendMessageDto.cs new file mode 100644 index 0000000..d644b95 --- /dev/null +++ b/backend/Application/Endpoints/Chats/SendMessageDto.cs @@ -0,0 +1,8 @@ +namespace Application.Endpoints.Chats; + +public class SendMessageDto +{ + public Guid Sender { get; set; } + public Guid Receiver { get; set; } + public string Message { get; set; } +} \ No newline at end of file diff --git a/backend/Application/Endpoints/Chats/SendMessageValidator.cs b/backend/Application/Endpoints/Chats/SendMessageValidator.cs new file mode 100644 index 0000000..fc6aa4d --- /dev/null +++ b/backend/Application/Endpoints/Chats/SendMessageValidator.cs @@ -0,0 +1,18 @@ +using FluentValidation; + +namespace Application.Endpoints.Chats; + +public class SendMessageValidator : AbstractValidator +{ + public SendMessageValidator() + { + RuleFor(x => x.Sender) + .NotEmpty().WithMessage("Sender Id is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString()); + + RuleFor(x => x.Receiver) + .NotEmpty().WithMessage("Receiver Id is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString()); + + RuleFor(x => x.Message) + .NotEmpty().WithMessage("Message is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString()); + } +} \ No newline at end of file diff --git a/backend/Application/Endpoints/MedicalHistories/FileManagement/MedicalHistoryCreateDto.cs b/backend/Application/Endpoints/MedicalHistories/FileManagement/MedicalHistoryCreateDto.cs new file mode 100644 index 0000000..5c21ba3 --- /dev/null +++ b/backend/Application/Endpoints/MedicalHistories/FileManagement/MedicalHistoryCreateDto.cs @@ -0,0 +1,7 @@ +namespace Application.Endpoints.MedicalHistories.FileManagement; + +public class MedicalHistoryCreateDto +{ + public Guid UserId { get; set; } + public byte[] Content { get; set; } = []; +} \ No newline at end of file diff --git a/backend/Application/Endpoints/MedicalHistories/FileManagement/MedicalHistoryCreateValidation.cs b/backend/Application/Endpoints/MedicalHistories/FileManagement/MedicalHistoryCreateValidation.cs new file mode 100644 index 0000000..30c7eb3 --- /dev/null +++ b/backend/Application/Endpoints/MedicalHistories/FileManagement/MedicalHistoryCreateValidation.cs @@ -0,0 +1,28 @@ +using Application.Services.Database; +using FluentValidation; + +namespace Application.Endpoints.MedicalHistories.FileManagement; + +public class MedicalHistoryCreateValidation : AbstractValidator +{ + private readonly IPatientRepository _patientRepository; + + public MedicalHistoryCreateValidation(IPatientRepository patientRepository) + { + _patientRepository = patientRepository; + + RuleFor(x => x.UserId) + .NotEmpty().WithMessage("Patient is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString()) + .MustAsync(BeExistingUser).WithMessage("Specified patient doesn't exist.") + .WithErrorCode(HttpStatusCodes.NotFound.ToString()); + + RuleFor(x => x.Content) + .NotEmpty().WithMessage("Description is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString()); + } + + private async Task BeExistingUser(Guid userId, CancellationToken cancellationToken) + { + var patient = await _patientRepository.GetByIdAsync(userId); + return patient != null; + } +} \ No newline at end of file diff --git a/backend/Application/Endpoints/MedicalHistories/FileManagement/MedicalHistoryFileManagementHandler.cs b/backend/Application/Endpoints/MedicalHistories/FileManagement/MedicalHistoryFileManagementHandler.cs new file mode 100644 index 0000000..0bd348c --- /dev/null +++ b/backend/Application/Endpoints/MedicalHistories/FileManagement/MedicalHistoryFileManagementHandler.cs @@ -0,0 +1,156 @@ +using Application.Services.Database; +using Application.Services.Database.MongoDB; +using Core.Entities; + +namespace Application.Endpoints.MedicalHistories.FileManagement; + +public class MedicalHistoryFileManagementHandler +{ + private readonly IMedicalHistoryRepository _medicalHistoryRepository; + private readonly IMedicalHistoryMongoDbService _medicalHistoryMongoDbService; + private readonly IPatientRepository _patientRepository; + + public MedicalHistoryFileManagementHandler(IMedicalHistoryRepository medicalHistoryRepository, + IPatientRepository patientRepository, IMedicalHistoryMongoDbService medicalHistoryMongoDbService) + { + _medicalHistoryRepository = medicalHistoryRepository; + _patientRepository = patientRepository; + _medicalHistoryMongoDbService = medicalHistoryMongoDbService; + } + + public async Task HandleGetAll() + { + var documents = await _medicalHistoryRepository.GetAllAsync().ConfigureAwait(false); + if (documents.Any()) + return new BaseResponse + { + StatusCode = HttpStatusCodes.OK, + Message = "Retrieved medical histories", + Data = documents.ToList() + }; + + return new BaseResponse + { + StatusCode = HttpStatusCodes.NoContent, + Message = "Medical histories not found", + Data = null + }; + } + + public async Task HandleGet(Guid id) + { + var medicalHistory = await _medicalHistoryRepository.GetByIdAsync(id).ConfigureAwait(false); + if (medicalHistory != null) + return new BaseResponse + { + StatusCode = HttpStatusCodes.OK, + Message = "Medical history successfully retrieved", + Data = medicalHistory + }; + + return new BaseResponse + { + StatusCode = HttpStatusCodes.NotFound, + Message = "Medical history not found in system.", + Data = null + }; + } + + public async Task HandleCreate(MedicalHistoryCreateDto medicalHistoryCreateDto) + { + var validation = new MedicalHistoryCreateValidation(_patientRepository); + var validationResult = await validation.ValidateAsync(medicalHistoryCreateDto); + + if (!validationResult.IsValid) + { + var firstError = validationResult.Errors.FirstOrDefault(); + var errorCode = int.TryParse(firstError.ErrorCode, out var code) ? code : -1; + var errorMessage = firstError.ErrorMessage; + + return new BaseResponse + { + StatusCode = errorCode, + Message = errorMessage, + Data = null + }; + } + + var medicalHistory = new MedicalHistory + { + UserId = medicalHistoryCreateDto.UserId, + Content = medicalHistoryCreateDto.Content + }; + + var medicalHistoryId = medicalHistory.Id; + var newMedicalHistory = new MedicalHistoryAuthorisationModel + { + Id = medicalHistoryId.ToString(), + Authorisation = new List() + }; + + await _medicalHistoryMongoDbService.AddAsync(newMedicalHistory); + await _medicalHistoryRepository.AddAsync(medicalHistory); + + return new BaseResponse + { + StatusCode = HttpStatusCodes.Created, + Message = "Medical history record registered successfully", + Data = medicalHistory + }; + } + + public async Task HandleUpdate(MedicalHistoryUpdateDto updateDto) + { + var validation = new MedicalHistoryUpdateValidation(_medicalHistoryRepository, _patientRepository); + var validationResult = await validation.ValidateAsync(updateDto); + + if (!validationResult.IsValid) + { + var firstError = validationResult.Errors.FirstOrDefault(); + var errorCode = int.TryParse(firstError.ErrorCode, out var code) ? code : -1; + var errorMessage = firstError.ErrorMessage; + + return new BaseResponse + { + StatusCode = errorCode, + Message = errorMessage, + Data = null + }; + } + + var medicalHistoryToUpdate = await _medicalHistoryRepository.GetByIdAsync(updateDto.Id); + medicalHistoryToUpdate.Content = updateDto.Content; + + await _medicalHistoryRepository.UpdateAsync(medicalHistoryToUpdate); + return new BaseResponse + { + StatusCode = HttpStatusCodes.NoContent, + Message = "Medical record updated successfully", + Data = null + }; + } + + public async Task HandleDelete(Guid id) + { + var medicalRecord = await _medicalHistoryRepository.GetByIdAsync(id); + if (medicalRecord == null) + return new BaseResponse + { + StatusCode = HttpStatusCodes.NotFound, + Message = "Medical record is not in system.", + Data = null + }; + + await _medicalHistoryMongoDbService.DeleteAsync("_id", id.ToString()); + + await _medicalHistoryRepository.DeleteAsync(medicalRecord); + + //TODO delete from MongoDB + return new BaseResponse + { + StatusCode = HttpStatusCodes.NoContent, + Message = null, + Data = null + }; + } +} \ No newline at end of file diff --git a/backend/Application/Endpoints/MedicalHistories/FileManagement/MedicalHistoryUpdateDto.cs b/backend/Application/Endpoints/MedicalHistories/FileManagement/MedicalHistoryUpdateDto.cs new file mode 100644 index 0000000..27b70da --- /dev/null +++ b/backend/Application/Endpoints/MedicalHistories/FileManagement/MedicalHistoryUpdateDto.cs @@ -0,0 +1,7 @@ +namespace Application.Endpoints.MedicalHistories.FileManagement; + +public class MedicalHistoryUpdateDto +{ + public Guid Id { get; set; } + public byte[] Content { get; set; } = []; +} \ No newline at end of file diff --git a/backend/Application/Endpoints/MedicalHistories/FileManagement/MedicalHistoryUpdateValidation.cs b/backend/Application/Endpoints/MedicalHistories/FileManagement/MedicalHistoryUpdateValidation.cs new file mode 100644 index 0000000..73a9368 --- /dev/null +++ b/backend/Application/Endpoints/MedicalHistories/FileManagement/MedicalHistoryUpdateValidation.cs @@ -0,0 +1,30 @@ +using Application.Services.Database; +using FluentValidation; + +namespace Application.Endpoints.MedicalHistories.FileManagement; + +public class MedicalHistoryUpdateValidation : AbstractValidator +{ + private readonly IMedicalHistoryRepository _medicalHistoryRepository; + private readonly IPatientRepository _patientRepository; + + public MedicalHistoryUpdateValidation(IMedicalHistoryRepository medicalHistoryRepository, + IPatientRepository patientRepository) + { + _medicalHistoryRepository = medicalHistoryRepository; + _patientRepository = patientRepository; + + RuleFor(x => x.Id) + .NotEmpty().WithMessage("Id is required") + .MustAsync(BeExistingMedicalHistoryRecord).WithMessage("Medical history record does not exist"); + + RuleFor(x => x.Content) + .NotEmpty().WithMessage("Description is required."); + } + + private async Task BeExistingMedicalHistoryRecord(Guid guid, CancellationToken token) + { + var record = await _medicalHistoryRepository.GetByIdAsync(guid); + return record != null; + } +} \ No newline at end of file diff --git a/backend/Application/Endpoints/MedicalHistories/ManageAuthorization/MedicalHistoryManageAuthorizationDoctorDto.cs b/backend/Application/Endpoints/MedicalHistories/ManageAuthorization/MedicalHistoryManageAuthorizationDoctorDto.cs new file mode 100644 index 0000000..e734997 --- /dev/null +++ b/backend/Application/Endpoints/MedicalHistories/ManageAuthorization/MedicalHistoryManageAuthorizationDoctorDto.cs @@ -0,0 +1,7 @@ +namespace Application.Endpoints.MedicalHistories.ManageAuthorization; + +public class MedicalHistoryManageAuthorizationDoctorDto +{ + public Guid MedicalRecordId { get; set; } + public Guid DoctorId { get; set; } +} \ No newline at end of file diff --git a/backend/Application/Endpoints/MedicalHistories/ManageAuthorization/MedicalHistoryManageAuthorizationHandler.cs b/backend/Application/Endpoints/MedicalHistories/ManageAuthorization/MedicalHistoryManageAuthorizationHandler.cs new file mode 100644 index 0000000..d92e786 --- /dev/null +++ b/backend/Application/Endpoints/MedicalHistories/ManageAuthorization/MedicalHistoryManageAuthorizationHandler.cs @@ -0,0 +1,141 @@ +using Application.Services.Database; +using Application.Services.Database.MongoDB; + +namespace Application.Endpoints.MedicalHistories.ManageAuthorization; + +public class MedicalHistoryManageAuthorizationHandler +{ + private readonly IMedicalHistoryRepository _medicalHistoryRepository; + private readonly IDoctorRepository _doctorRepository; + private readonly IMedicalHistoryMongoDbService _medicalHistoryMongoDbService; + + public MedicalHistoryManageAuthorizationHandler(IMedicalHistoryRepository medicalHistoryRepository, + IMedicalHistoryMongoDbService medicalHistoryMongoDbService, IDoctorRepository doctorRepository) + { + _medicalHistoryRepository = medicalHistoryRepository; + _medicalHistoryMongoDbService = medicalHistoryMongoDbService; + _doctorRepository = doctorRepository; + } + + public async Task HandleGrantDoctorAccess(MedicalHistoryManageAuthorizationDoctorDto infoDto) + { + var validation = new MedicalHistoryManageAuthorizationValidation(_medicalHistoryRepository, _doctorRepository); + var validationResult = await validation.ValidateAsync(infoDto); + + if (!validationResult.IsValid) + { + var firstError = validationResult.Errors.FirstOrDefault(); + var errorCode = int.TryParse(firstError.ErrorCode, out var code) ? code : -1; + var errorMessage = firstError.ErrorMessage; + + return new BaseResponse + { + StatusCode = errorCode, + Message = errorMessage, + Data = null + }; + } + + var criteria = new List<(string, string)>(); + criteria.Add(("_id", infoDto.MedicalRecordId.ToString())); + + var documents = await _medicalHistoryMongoDbService.FindAsync(criteria); + if (!documents.Any()) + { + return new BaseResponse() + { + StatusCode = HttpStatusCodes.NotFound, + Message = "Access to medical history not found.", + Data = null + }; + } + + var authorisations = documents[0].Authorisation; + if (authorisations.Contains(infoDto.ToString())) + { + return new BaseResponse() + { + StatusCode = HttpStatusCodes.Conflict, + Message = "Access to medical history already granted.", + Data = null + }; + } + + authorisations.Add(infoDto.DoctorId.ToString()); + var authorizationModel = new MedicalHistoryAuthorisationModel() + { + Id = infoDto.MedicalRecordId.ToString(), + Authorisation = authorisations + }; + + await _medicalHistoryMongoDbService.ModifyAsync("_id", infoDto.MedicalRecordId.ToString(), authorizationModel); + + return new BaseResponse() + { + StatusCode = HttpStatusCodes.OK, + Message = "Access to medical history granted.", + Data = null + }; + } + + public async Task HandleRevokeDoctorAccess(MedicalHistoryManageAuthorizationDoctorDto infoDto) + { + var validation = new MedicalHistoryManageAuthorizationValidation(_medicalHistoryRepository, _doctorRepository); + var validationResult = await validation.ValidateAsync(infoDto); + + if (!validationResult.IsValid) + { + var firstError = validationResult.Errors.FirstOrDefault(); + var errorCode = int.TryParse(firstError.ErrorCode, out var code) ? code : -1; + var errorMessage = firstError.ErrorMessage; + + return new BaseResponse + { + StatusCode = errorCode, + Message = errorMessage, + Data = null + }; + } + + var criteria = new List<(string, string)>(); + criteria.Add(("_id", infoDto.MedicalRecordId.ToString())); + + var documents = await _medicalHistoryMongoDbService.FindAsync(criteria); + if (!documents.Any()) + { + return new BaseResponse() + { + StatusCode = HttpStatusCodes.NotFound, + Message = "Access to medical history not found.", + Data = null + }; + } + + var authorisations = documents[0].Authorisation; + if (!authorisations.Contains(infoDto.DoctorId.ToString())) + { + return new BaseResponse() + { + StatusCode = HttpStatusCodes.Conflict, + Message = "Access to medical history already revoked.", + Data = null + }; + } + + authorisations.Remove(infoDto.DoctorId.ToString()); + var authorizationModel = new MedicalHistoryAuthorisationModel() + { + Id = infoDto.MedicalRecordId.ToString(), + Authorisation = authorisations + }; + + await _medicalHistoryMongoDbService.ModifyAsync("_id", infoDto.MedicalRecordId.ToString(), authorizationModel); + + return new BaseResponse() + { + StatusCode = HttpStatusCodes.OK, + Message = "Access to medical history granted.", + Data = null + }; + } +} \ No newline at end of file diff --git a/backend/Application/Endpoints/MedicalHistories/ManageAuthorization/MedicalHistoryManageAuthorizationValidation.cs b/backend/Application/Endpoints/MedicalHistories/ManageAuthorization/MedicalHistoryManageAuthorizationValidation.cs new file mode 100644 index 0000000..a4fa93a --- /dev/null +++ b/backend/Application/Endpoints/MedicalHistories/ManageAuthorization/MedicalHistoryManageAuthorizationValidation.cs @@ -0,0 +1,39 @@ +using Application.Services.Database; +using FluentValidation; + +namespace Application.Endpoints.MedicalHistories.ManageAuthorization; + +public class MedicalHistoryManageAuthorizationValidation : AbstractValidator +{ + private readonly IMedicalHistoryRepository _medicalHistoryRepository; + private readonly IDoctorRepository _doctorRepository; + + public MedicalHistoryManageAuthorizationValidation(IMedicalHistoryRepository medicalHistoryRepository, + IDoctorRepository doctorRepository) + { + RuleFor(x => x.MedicalRecordId) + .NotEmpty().WithMessage("Id is required").WithErrorCode(HttpStatusCodes.BadRequest.ToString()) + .MustAsync(BeExistingMedicalHistoryRecord).WithMessage("Medical history record does not exist") + .WithErrorCode(HttpStatusCodes.NotFound.ToString()); + + RuleFor(x => x.DoctorId) + .NotEmpty().WithMessage("Id is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString()) + .MustAsync(IsDoctorRegistered).WithMessage("Doctor is not registered in system") + .WithErrorCode(HttpStatusCodes.NotFound.ToString()); + + _medicalHistoryRepository = medicalHistoryRepository; + _doctorRepository = doctorRepository; + } + + private async Task BeExistingMedicalHistoryRecord(Guid guid, CancellationToken token) + { + var record = await _medicalHistoryRepository.GetByIdAsync(guid); + return record != null; + } + + private async Task IsDoctorRegistered(Guid id, CancellationToken cancellationToken) + { + var doctor = await _doctorRepository.GetByIdAsync(id); + return doctor != null; + } +} \ No newline at end of file diff --git a/backend/Application/Services/Database/MongoDB/IChatHistoryMongoDbService.cs b/backend/Application/Services/Database/MongoDB/IChatHistoryMongoDbService.cs index d308787..af6f006 100644 --- a/backend/Application/Services/Database/MongoDB/IChatHistoryMongoDbService.cs +++ b/backend/Application/Services/Database/MongoDB/IChatHistoryMongoDbService.cs @@ -1,6 +1,16 @@ -namespace Application.Services.Database.MongoDB; +using MongoDB.Driver; + +namespace Application.Services.Database.MongoDB; public interface IChatMongoDbService { - // Additional methods specific to Chat database + IMongoCollection GetCollection(); + + Task> FindAsync(List<(string FieldName, string Value)> criteria); + + Task AddAsync(T document); + + Task ModifyAsync(string keyField, string keyValue, T document); + + Task DeleteAsync(string keyField, string keyValue); } \ No newline at end of file diff --git a/backend/Application/Services/Database/MongoDB/IMedicalHistoryMongoDbService.cs b/backend/Application/Services/Database/MongoDB/IMedicalHistoryMongoDbService.cs index 6920a99..c406bbd 100644 --- a/backend/Application/Services/Database/MongoDB/IMedicalHistoryMongoDbService.cs +++ b/backend/Application/Services/Database/MongoDB/IMedicalHistoryMongoDbService.cs @@ -5,13 +5,13 @@ namespace Application.Services.Database.MongoDB; public interface IMedicalHistoryMongoDbService { - IMongoCollection GetCollection(); + IMongoCollection GetCollection(); - Task> FindAsync(List<(string FieldName, string Value)> criteria); + Task> FindAsync(List<(string FieldName, string Value)> criteria); - Task AddAsync(MedicalHistoryAuthorisationModel document); + Task AddAsync(T document); - Task ModifyAsync(string keyField, string keyValue, MedicalHistoryAuthorisationModel document); + Task ModifyAsync(string keyField, string keyValue, T document); - Task DeleteAsync(string keyField, string keyValue); + Task DeleteAsync(string keyField, string keyValue); } \ No newline at end of file diff --git a/backend/Application/Services/Jwt/IJwtService.cs b/backend/Application/Services/Jwt/IJwtService.cs new file mode 100644 index 0000000..9750de1 --- /dev/null +++ b/backend/Application/Services/Jwt/IJwtService.cs @@ -0,0 +1,10 @@ +using System.Security.Claims; + +namespace Application.Services.Jwt; + +public interface IJwtService +{ + string GenerateJwtToken(string email); + bool ValidateJwtToken(string token); + string? RefreshToken(string token); +} \ No newline at end of file diff --git a/backend/Application/bin/Debug/net8.0/Application.dll b/backend/Application/bin/Debug/net8.0/Application.dll index 7a8b24f..ac54dcf 100644 Binary files a/backend/Application/bin/Debug/net8.0/Application.dll and b/backend/Application/bin/Debug/net8.0/Application.dll differ diff --git a/backend/Application/bin/Debug/net8.0/Application.pdb b/backend/Application/bin/Debug/net8.0/Application.pdb index 9acaaf3..582da16 100644 Binary files a/backend/Application/bin/Debug/net8.0/Application.pdb and b/backend/Application/bin/Debug/net8.0/Application.pdb differ diff --git a/backend/Application/bin/Debug/net8.0/Core.dll b/backend/Application/bin/Debug/net8.0/Core.dll index 02b0d46..62444bc 100644 Binary files a/backend/Application/bin/Debug/net8.0/Core.dll and b/backend/Application/bin/Debug/net8.0/Core.dll differ diff --git a/backend/Application/bin/Debug/net8.0/Core.pdb b/backend/Application/bin/Debug/net8.0/Core.pdb index fafb776..be53c18 100644 Binary files a/backend/Application/bin/Debug/net8.0/Core.pdb and b/backend/Application/bin/Debug/net8.0/Core.pdb differ diff --git a/backend/Application/obj/Application.csproj.nuget.dgspec.json b/backend/Application/obj/Application.csproj.nuget.dgspec.json index dd8cc07..19ba6c9 100644 --- a/backend/Application/obj/Application.csproj.nuget.dgspec.json +++ b/backend/Application/obj/Application.csproj.nuget.dgspec.json @@ -14,14 +14,12 @@ "outputPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\obj\\", "projectStyle": "PackageReference", "configFilePaths": [ - "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config", - "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config" ], "originalTargetFrameworks": [ "net8.0" ], "sources": { - "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { @@ -69,7 +67,7 @@ "privateAssets": "all" } }, - "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json" + "runtimeIdentifierGraphPath": "C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json" } } }, @@ -83,14 +81,12 @@ "outputPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\obj\\", "projectStyle": "PackageReference", "configFilePaths": [ - "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config", - "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config" ], "originalTargetFrameworks": [ "net8.0" ], "sources": { - "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { @@ -130,7 +126,7 @@ "privateAssets": "all" } }, - "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json" + "runtimeIdentifierGraphPath": "C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json" } } } diff --git a/backend/Application/obj/Debug/net8.0/Application.AssemblyInfo.cs b/backend/Application/obj/Debug/net8.0/Application.AssemblyInfo.cs index 9e74a7f..67cba58 100644 --- a/backend/Application/obj/Debug/net8.0/Application.AssemblyInfo.cs +++ b/backend/Application/obj/Debug/net8.0/Application.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Application")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+61a55fa7353346bdad2d677f0ec3c044c3aa87d5")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+90604e48ae9f78fa417a446c05f7759001447de5")] [assembly: System.Reflection.AssemblyProductAttribute("Application")] [assembly: System.Reflection.AssemblyTitleAttribute("Application")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/backend/Application/obj/Debug/net8.0/Application.AssemblyInfoInputs.cache b/backend/Application/obj/Debug/net8.0/Application.AssemblyInfoInputs.cache index 9944b37..2d8e3ba 100644 --- a/backend/Application/obj/Debug/net8.0/Application.AssemblyInfoInputs.cache +++ b/backend/Application/obj/Debug/net8.0/Application.AssemblyInfoInputs.cache @@ -1 +1 @@ -ca8d9dbfc6e022b60b63524e70a3acb8ce1eaa86a2b066fce9c4864553b6125d +4068cc9959fca65509f12b041892bbe15b7b0ed4cb99494d72cf4e4d471b7ce1 diff --git a/backend/Application/obj/Debug/net8.0/Application.csproj.AssemblyReference.cache b/backend/Application/obj/Debug/net8.0/Application.csproj.AssemblyReference.cache index c92b390..070add5 100644 Binary files a/backend/Application/obj/Debug/net8.0/Application.csproj.AssemblyReference.cache and b/backend/Application/obj/Debug/net8.0/Application.csproj.AssemblyReference.cache differ diff --git a/backend/Application/obj/Debug/net8.0/Application.csproj.CoreCompileInputs.cache b/backend/Application/obj/Debug/net8.0/Application.csproj.CoreCompileInputs.cache index 2f0a718..61c98ff 100644 --- a/backend/Application/obj/Debug/net8.0/Application.csproj.CoreCompileInputs.cache +++ b/backend/Application/obj/Debug/net8.0/Application.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -e99f7362e6da84368608067cdbb0c281eef010bca303f59d33c712edf6a9964f +a14527b9f0436826149b6114fc93ca0d3615f169c5065e509d90189e6d49d7bf diff --git a/backend/Application/obj/Debug/net8.0/Application.dll b/backend/Application/obj/Debug/net8.0/Application.dll index 7a8b24f..ac54dcf 100644 Binary files a/backend/Application/obj/Debug/net8.0/Application.dll and b/backend/Application/obj/Debug/net8.0/Application.dll differ diff --git a/backend/Application/obj/Debug/net8.0/Application.pdb b/backend/Application/obj/Debug/net8.0/Application.pdb index 9acaaf3..582da16 100644 Binary files a/backend/Application/obj/Debug/net8.0/Application.pdb and b/backend/Application/obj/Debug/net8.0/Application.pdb differ diff --git a/backend/Application/obj/Debug/net8.0/Application.sourcelink.json b/backend/Application/obj/Debug/net8.0/Application.sourcelink.json index ecec2f0..84ecd88 100644 --- a/backend/Application/obj/Debug/net8.0/Application.sourcelink.json +++ b/backend/Application/obj/Debug/net8.0/Application.sourcelink.json @@ -1 +1 @@ -{"documents":{"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\*":"https://raw.githubusercontent.com/andrei-mihnea-cerbu/CC-FinalProj/61a55fa7353346bdad2d677f0ec3c044c3aa87d5/*"}} \ No newline at end of file +{"documents":{"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\*":"https://raw.githubusercontent.com/andrei-mihnea-cerbu/CC-FinalProj/48eb2adcbd149cd66c77ba558f492179d2bf29be/*"}} \ No newline at end of file diff --git a/backend/Application/obj/Debug/net8.0/ref/Application.dll b/backend/Application/obj/Debug/net8.0/ref/Application.dll index af6d07f..e1c0fb5 100644 Binary files a/backend/Application/obj/Debug/net8.0/ref/Application.dll and b/backend/Application/obj/Debug/net8.0/ref/Application.dll differ diff --git a/backend/Application/obj/Debug/net8.0/refint/Application.dll b/backend/Application/obj/Debug/net8.0/refint/Application.dll index af6d07f..e1c0fb5 100644 Binary files a/backend/Application/obj/Debug/net8.0/refint/Application.dll and b/backend/Application/obj/Debug/net8.0/refint/Application.dll differ diff --git a/backend/Application/obj/project.assets.json b/backend/Application/obj/project.assets.json index 52cd1ba..d5bdb35 100644 --- a/backend/Application/obj/project.assets.json +++ b/backend/Application/obj/project.assets.json @@ -851,14 +851,12 @@ "outputPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\obj\\", "projectStyle": "PackageReference", "configFilePaths": [ - "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config", - "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config" ], "originalTargetFrameworks": [ "net8.0" ], "sources": { - "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { @@ -906,7 +904,7 @@ "privateAssets": "all" } }, - "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json" + "runtimeIdentifierGraphPath": "C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json" } } } diff --git a/backend/Application/obj/project.nuget.cache b/backend/Application/obj/project.nuget.cache index 45a4961..eb17fef 100644 --- a/backend/Application/obj/project.nuget.cache +++ b/backend/Application/obj/project.nuget.cache @@ -1,6 +1,6 @@ { "version": 2, - "dgSpecHash": "+8cvg1kefgWQCHZNz0UFBqaMFHCU9vs6eKiSXlImrLEp7SlxQgKE4onuOThyjCArZTaU+iPlTxlBKu/wIdbkNg==", + "dgSpecHash": "6rK5hZ4j6ClAzfxuWc17Wft98VDUQupYiEeI5viBfPq8M3e7wy2vBJ/LEy/lClFvezbz4wHPGdpeQDPOA9ZtBw==", "success": true, "projectFilePath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\Application.csproj", "expectedPackageFiles": [ diff --git a/backend/Application/obj/project.packagespec.json b/backend/Application/obj/project.packagespec.json index 24c2585..23daba5 100644 --- a/backend/Application/obj/project.packagespec.json +++ b/backend/Application/obj/project.packagespec.json @@ -1 +1 @@ -"restore":{"projectUniqueName":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\Application.csproj","projectName":"Application","projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\Application.csproj","outputPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\obj\\","projectStyle":"PackageReference","originalTargetFrameworks":["net8.0"],"sources":{"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\":{},"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net8.0":{"targetAlias":"net8.0","projectReferences":{"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\Core.csproj":{"projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\Core.csproj"}}}},"warningProperties":{"warnAsError":["NU1605"]}}"frameworks":{"net8.0":{"targetAlias":"net8.0","dependencies":{"FluentValidation":{"target":"Package","version":"[11.9.0, )"},"MongoDB.Driver":{"target":"Package","version":"[2.24.0, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json"}} \ No newline at end of file +"restore":{"projectUniqueName":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\Application.csproj","projectName":"Application","projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\Application.csproj","outputPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\obj\\","projectStyle":"PackageReference","originalTargetFrameworks":["net8.0"],"sources":{"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net8.0":{"targetAlias":"net8.0","projectReferences":{"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\Core.csproj":{"projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\Core.csproj"}}}},"warningProperties":{"warnAsError":["NU1605"]}}"frameworks":{"net8.0":{"targetAlias":"net8.0","dependencies":{"FluentValidation":{"target":"Package","version":"[11.9.0, )"},"MongoDB.Driver":{"target":"Package","version":"[2.24.0, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json"}} \ No newline at end of file diff --git a/backend/Application/obj/rider.project.model.nuget.info b/backend/Application/obj/rider.project.model.nuget.info index a5fa0d5..99b6ed8 100644 --- a/backend/Application/obj/rider.project.model.nuget.info +++ b/backend/Application/obj/rider.project.model.nuget.info @@ -1 +1 @@ -17122552827049708 \ No newline at end of file +17125558124497896 \ No newline at end of file diff --git a/backend/Application/obj/rider.project.restore.info b/backend/Application/obj/rider.project.restore.info index c6138a4..588b395 100644 --- a/backend/Application/obj/rider.project.restore.info +++ b/backend/Application/obj/rider.project.restore.info @@ -1 +1 @@ -17125075151933320 \ No newline at end of file +17125685577729624 \ No newline at end of file diff --git a/backend/Backup/HealthcareManagerAPI.sln b/backend/Backup/HealthcareManagerAPI.sln new file mode 100644 index 0000000..65b1fa4 --- /dev/null +++ b/backend/Backup/HealthcareManagerAPI.sln @@ -0,0 +1,57 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34701.34 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "HealthcareManager.API", "HealthcareManager.API", "{F1846AEC-7080-447F-BC7E-4DB4CFDD0B9D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "API", "API\API.csproj", "{AE742B5B-E541-4355-AD47-F36DDFF5C42E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "HealthcareManager.Core", "HealthcareManager.Core", "{0FDD5484-B105-4B18-8C8B-A79B5D3A0228}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "HealthcareManager.Infrastructure", "HealthcareManager.Infrastructure", "{2E30D87F-DC3C-4853-A755-7E3FBA2164E0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core", "Core\Core.csproj", "{1158DC66-C8F1-4962-B294-1C4C86EE8A82}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Infrastructure", "Infrastructure\Infrastructure.csproj", "{5E75761E-5C8B-488C-9C39-5D0E663258C5}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "HealthcareManager.Application", "HealthcareManager.Application", "{7FF28CA1-48C0-4A95-8056-977F3469577C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Application", "Application\Application.csproj", "{726E8EFD-FC6A-4104-B8FB-2D9049C748C6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AE742B5B-E541-4355-AD47-F36DDFF5C42E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AE742B5B-E541-4355-AD47-F36DDFF5C42E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AE742B5B-E541-4355-AD47-F36DDFF5C42E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AE742B5B-E541-4355-AD47-F36DDFF5C42E}.Release|Any CPU.Build.0 = Release|Any CPU + {1158DC66-C8F1-4962-B294-1C4C86EE8A82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1158DC66-C8F1-4962-B294-1C4C86EE8A82}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1158DC66-C8F1-4962-B294-1C4C86EE8A82}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1158DC66-C8F1-4962-B294-1C4C86EE8A82}.Release|Any CPU.Build.0 = Release|Any CPU + {5E75761E-5C8B-488C-9C39-5D0E663258C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5E75761E-5C8B-488C-9C39-5D0E663258C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5E75761E-5C8B-488C-9C39-5D0E663258C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5E75761E-5C8B-488C-9C39-5D0E663258C5}.Release|Any CPU.Build.0 = Release|Any CPU + {726E8EFD-FC6A-4104-B8FB-2D9049C748C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {726E8EFD-FC6A-4104-B8FB-2D9049C748C6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {726E8EFD-FC6A-4104-B8FB-2D9049C748C6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {726E8EFD-FC6A-4104-B8FB-2D9049C748C6}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {AE742B5B-E541-4355-AD47-F36DDFF5C42E} = {F1846AEC-7080-447F-BC7E-4DB4CFDD0B9D} + {1158DC66-C8F1-4962-B294-1C4C86EE8A82} = {0FDD5484-B105-4B18-8C8B-A79B5D3A0228} + {5E75761E-5C8B-488C-9C39-5D0E663258C5} = {2E30D87F-DC3C-4853-A755-7E3FBA2164E0} + {726E8EFD-FC6A-4104-B8FB-2D9049C748C6} = {7FF28CA1-48C0-4A95-8056-977F3469577C} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {B4EDD4C4-C138-4A7C-9D15-283AC586050F} + EndGlobalSection +EndGlobal diff --git a/backend/Core/Entities/Chat.cs b/backend/Core/Entities/Chat.cs index f49a8b1..88989f2 100644 --- a/backend/Core/Entities/Chat.cs +++ b/backend/Core/Entities/Chat.cs @@ -5,19 +5,26 @@ namespace Core.Entities; public class Chat { - [BsonId] - [BsonRepresentation(BsonType.String)] - public Guid Id { get; set; } + public string Id { get; private set; } + public List Messages { get; private set; } = new(); - public Guid PatientId { get; set; } - public Guid DoctorId { get; set; } - - public List Messages { get; set; } = new(); + public void SetId(string id) { Id = id; } + public void SetMessages(List messages) { Messages = messages; } } public class Message { - [BsonRepresentation(BsonType.String)] public Guid UserId { get; set; } + public Message(Guid userId, string content) + { + UserId = userId; + Content = content; + } + + [BsonRepresentation(BsonType.String)] + public Guid UserId { get; private set; } - public string Content { get; set; } + public string Content { get; private set; } + + public void SetUserId(Guid userId) { UserId = userId; } + public void SetContent(string content) { Content = content; } } \ No newline at end of file diff --git a/backend/Core/bin/Debug/net8.0/Core.dll b/backend/Core/bin/Debug/net8.0/Core.dll index 02b0d46..62444bc 100644 Binary files a/backend/Core/bin/Debug/net8.0/Core.dll and b/backend/Core/bin/Debug/net8.0/Core.dll differ diff --git a/backend/Core/bin/Debug/net8.0/Core.pdb b/backend/Core/bin/Debug/net8.0/Core.pdb index fafb776..be53c18 100644 Binary files a/backend/Core/bin/Debug/net8.0/Core.pdb and b/backend/Core/bin/Debug/net8.0/Core.pdb differ diff --git a/backend/Core/obj/Core.csproj.nuget.dgspec.json b/backend/Core/obj/Core.csproj.nuget.dgspec.json index 9823e4f..55cdb2d 100644 --- a/backend/Core/obj/Core.csproj.nuget.dgspec.json +++ b/backend/Core/obj/Core.csproj.nuget.dgspec.json @@ -14,14 +14,12 @@ "outputPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\obj\\", "projectStyle": "PackageReference", "configFilePaths": [ - "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config", - "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config" ], "originalTargetFrameworks": [ "net8.0" ], "sources": { - "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { @@ -61,7 +59,7 @@ "privateAssets": "all" } }, - "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json" + "runtimeIdentifierGraphPath": "C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json" } } } diff --git a/backend/Core/obj/Debug/net8.0/Core.AssemblyInfo.cs b/backend/Core/obj/Debug/net8.0/Core.AssemblyInfo.cs index 041072b..1ccf283 100644 --- a/backend/Core/obj/Debug/net8.0/Core.AssemblyInfo.cs +++ b/backend/Core/obj/Debug/net8.0/Core.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Core")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+2ccec617a59a712428e67340dc46bebefb152aca")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+90604e48ae9f78fa417a446c05f7759001447de5")] [assembly: System.Reflection.AssemblyProductAttribute("Core")] [assembly: System.Reflection.AssemblyTitleAttribute("Core")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/backend/Core/obj/Debug/net8.0/Core.AssemblyInfoInputs.cache b/backend/Core/obj/Debug/net8.0/Core.AssemblyInfoInputs.cache index 9e003ed..d329607 100644 --- a/backend/Core/obj/Debug/net8.0/Core.AssemblyInfoInputs.cache +++ b/backend/Core/obj/Debug/net8.0/Core.AssemblyInfoInputs.cache @@ -1 +1 @@ -232a219588f79d4fe98faad4c868c44fc40b96e3f6b7bc8086f4447599f3e74e +5ede8fc56c8888c470a0873d22c6c4a215f0f44ccdf0f65ca635f6a6e2268a9e diff --git a/backend/Core/obj/Debug/net8.0/Core.csproj.CoreCompileInputs.cache b/backend/Core/obj/Debug/net8.0/Core.csproj.CoreCompileInputs.cache index d0352f9..2feed48 100644 --- a/backend/Core/obj/Debug/net8.0/Core.csproj.CoreCompileInputs.cache +++ b/backend/Core/obj/Debug/net8.0/Core.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -481a6e81c3fb29f18f770ac0db64e6d4af0d1f426e06832b919c28802ccff560 +6236e3f912b0532e598b72e522cff0eefd892ca01f330905ca686a017c34f569 diff --git a/backend/Core/obj/Debug/net8.0/Core.dll b/backend/Core/obj/Debug/net8.0/Core.dll index 02b0d46..62444bc 100644 Binary files a/backend/Core/obj/Debug/net8.0/Core.dll and b/backend/Core/obj/Debug/net8.0/Core.dll differ diff --git a/backend/Core/obj/Debug/net8.0/Core.pdb b/backend/Core/obj/Debug/net8.0/Core.pdb index fafb776..be53c18 100644 Binary files a/backend/Core/obj/Debug/net8.0/Core.pdb and b/backend/Core/obj/Debug/net8.0/Core.pdb differ diff --git a/backend/Core/obj/Debug/net8.0/Core.sourcelink.json b/backend/Core/obj/Debug/net8.0/Core.sourcelink.json index e351cc3..84ecd88 100644 --- a/backend/Core/obj/Debug/net8.0/Core.sourcelink.json +++ b/backend/Core/obj/Debug/net8.0/Core.sourcelink.json @@ -1 +1 @@ -{"documents":{"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\*":"https://raw.githubusercontent.com/andrei-mihnea-cerbu/CC-FinalProj/2ccec617a59a712428e67340dc46bebefb152aca/*"}} \ No newline at end of file +{"documents":{"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\*":"https://raw.githubusercontent.com/andrei-mihnea-cerbu/CC-FinalProj/48eb2adcbd149cd66c77ba558f492179d2bf29be/*"}} \ No newline at end of file diff --git a/backend/Core/obj/Debug/net8.0/ref/Core.dll b/backend/Core/obj/Debug/net8.0/ref/Core.dll index 57e2a13..5106d40 100644 Binary files a/backend/Core/obj/Debug/net8.0/ref/Core.dll and b/backend/Core/obj/Debug/net8.0/ref/Core.dll differ diff --git a/backend/Core/obj/Debug/net8.0/refint/Core.dll b/backend/Core/obj/Debug/net8.0/refint/Core.dll index 57e2a13..5106d40 100644 Binary files a/backend/Core/obj/Debug/net8.0/refint/Core.dll and b/backend/Core/obj/Debug/net8.0/refint/Core.dll differ diff --git a/backend/Core/obj/project.assets.json b/backend/Core/obj/project.assets.json index 67b5972..9aa5c4a 100644 --- a/backend/Core/obj/project.assets.json +++ b/backend/Core/obj/project.assets.json @@ -137,14 +137,12 @@ "outputPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\obj\\", "projectStyle": "PackageReference", "configFilePaths": [ - "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config", - "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config" ], "originalTargetFrameworks": [ "net8.0" ], "sources": { - "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { @@ -184,7 +182,7 @@ "privateAssets": "all" } }, - "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json" + "runtimeIdentifierGraphPath": "C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json" } } } diff --git a/backend/Core/obj/project.nuget.cache b/backend/Core/obj/project.nuget.cache index 2752587..3810bab 100644 --- a/backend/Core/obj/project.nuget.cache +++ b/backend/Core/obj/project.nuget.cache @@ -1,6 +1,6 @@ { "version": 2, - "dgSpecHash": "7w8jrDBwgqCxUk4JCLDDAjFhEwshlhuMIblS2oyN6q5PKozln6O0dA8f6jN7yAtN9OFFP5VyVOSdJRz2HZbDHQ==", + "dgSpecHash": "nUJYWQem8SFagSjBlwYcU+nbTi53nWZSxYTrPiHNTHcOWnBld4SMEechWWzFO+t4nThl0DYYE7H20aSoUlJA8A==", "success": true, "projectFilePath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\Core.csproj", "expectedPackageFiles": [ diff --git a/backend/Core/obj/project.packagespec.json b/backend/Core/obj/project.packagespec.json index 7f5d9cb..e493125 100644 --- a/backend/Core/obj/project.packagespec.json +++ b/backend/Core/obj/project.packagespec.json @@ -1 +1 @@ -"restore":{"projectUniqueName":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\Core.csproj","projectName":"Core","projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\Core.csproj","outputPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\obj\\","projectStyle":"PackageReference","originalTargetFrameworks":["net8.0"],"sources":{"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\":{},"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net8.0":{"targetAlias":"net8.0","projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]}}"frameworks":{"net8.0":{"targetAlias":"net8.0","dependencies":{"MongoDB.Bson":{"target":"Package","version":"[2.24.0, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json"}} \ No newline at end of file +"restore":{"projectUniqueName":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\Core.csproj","projectName":"Core","projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\Core.csproj","outputPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\obj\\","projectStyle":"PackageReference","originalTargetFrameworks":["net8.0"],"sources":{"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net8.0":{"targetAlias":"net8.0","projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]}}"frameworks":{"net8.0":{"targetAlias":"net8.0","dependencies":{"MongoDB.Bson":{"target":"Package","version":"[2.24.0, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json"}} \ No newline at end of file diff --git a/backend/Core/obj/rider.project.model.nuget.info b/backend/Core/obj/rider.project.model.nuget.info index f1b88e0..756c08a 100644 --- a/backend/Core/obj/rider.project.model.nuget.info +++ b/backend/Core/obj/rider.project.model.nuget.info @@ -1 +1 @@ -17122552827080702 \ No newline at end of file +17125558124496805 \ No newline at end of file diff --git a/backend/Core/obj/rider.project.restore.info b/backend/Core/obj/rider.project.restore.info index 3b72989..5cd0972 100644 --- a/backend/Core/obj/rider.project.restore.info +++ b/backend/Core/obj/rider.project.restore.info @@ -1 +1 @@ -17125075151943813 \ No newline at end of file +17125685577652628 \ No newline at end of file diff --git a/backend/HealthcareManagerAPI.sln.DotSettings.user b/backend/HealthcareManagerAPI.sln.DotSettings.user new file mode 100644 index 0000000..622dbc0 --- /dev/null +++ b/backend/HealthcareManagerAPI.sln.DotSettings.user @@ -0,0 +1,3 @@ + + + C:\Users\Andrei Cerbu\.dotnet\sdk\8.0.203\MSBuild.dll \ No newline at end of file diff --git a/backend/Infrastructure/Infrastructure.csproj b/backend/Infrastructure/Infrastructure.csproj index 6b60d16..9d82a19 100644 --- a/backend/Infrastructure/Infrastructure.csproj +++ b/backend/Infrastructure/Infrastructure.csproj @@ -16,8 +16,10 @@ + + diff --git a/backend/Infrastructure/InfrastructureDI.cs b/backend/Infrastructure/InfrastructureDI.cs index 15b22b8..b63491a 100644 --- a/backend/Infrastructure/InfrastructureDI.cs +++ b/backend/Infrastructure/InfrastructureDI.cs @@ -1,10 +1,13 @@ using Application.Services.Database; using Application.Services.Database.MongoDB; using Application.Services.HashingAlgorithms; +using Application.Services.Jwt; + using Infrastructure.Data; using Infrastructure.Services.HashingAlgorithms; using Infrastructure.Services.MongoDB; using Infrastructure.Services.PostgreSQL; + using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -25,29 +28,39 @@ public static class DependencyInjection services.AddScoped(); services.AddScoped(); - // MongoDB Service - var mongoDbConnectionString = configuration.GetValue("ConnectionStrings:MongoDBConnection"); - - // Extract MongoDB database names - var healthcareManagerDatabaseName = configuration.GetValue("HealthcareManagerDatabase:Name"); - var medicalHistoryCollectionName = configuration.GetValue("HealthcareManagerDatabase:MedicalRecordCollectionName"); - var chatCollectionName = configuration.GetValue("HealthcareManagerDatabase:ChatCollectionName"); - - // Register MongoDB services + // MongoDB services services.AddSingleton(serviceProvider => - new MedicalHistoryMongoDbService(mongoDbConnectionString, healthcareManagerDatabaseName, medicalHistoryCollectionName)); + { + var configuration = serviceProvider.GetRequiredService(); + var connectionString = configuration.GetConnectionString("MongoDBConnection"); + var databaseName = configuration["HealthcareManagerDatabase:Name"]; + var collectionName = configuration["HealthcareManagerDatabase:MedicalRecordCollectionName"]; + return new MedicalHistoryMongoDbService(connectionString, databaseName, collectionName); + }); + services.AddSingleton(serviceProvider => - new ChatMongoDbService(mongoDbConnectionString, healthcareManagerDatabaseName, chatCollectionName)); - + { + var configuration = serviceProvider.GetRequiredService(); + var connectionString = configuration.GetConnectionString("MongoDBConnection"); + var databaseName = configuration["HealthcareManagerDatabase:Name"]; + var collectionName = configuration["HealthcareManagerDatabase:ChatCollectionName"]; + return new ChatMongoDbService(connectionString, databaseName, collectionName); + }); + // Other Services services.AddScoped(); + services.AddSingleton(serviceProvider => + { + var configuration = serviceProvider.GetRequiredService(); + return new JwtService(configuration); + }); // services.AddScoped(); return services; } - + private static string ExtractMongoDbDatabaseName(string connectionString) { var connectionStringBuilder = new MongoUrlBuilder(connectionString); diff --git a/backend/Infrastructure/Services/Jwt/JWTService.cs b/backend/Infrastructure/Services/Jwt/JWTService.cs new file mode 100644 index 0000000..e32f613 --- /dev/null +++ b/backend/Infrastructure/Services/Jwt/JWTService.cs @@ -0,0 +1,115 @@ +using Microsoft.Extensions.Configuration; +using Microsoft.IdentityModel.Tokens; +using System; +using System.IdentityModel.Tokens.Jwt; +using System.Security.Claims; +using System.Text; +using Application.Services.Jwt; + +public class JwtService : IJwtService +{ + private readonly string _secretKey; + private readonly string _issuer; + private readonly string _audience; + private readonly double _expiryMinutes; + + public JwtService(IConfiguration configuration) + { + _secretKey = configuration["Jwt:SecretKey"]; + _issuer = configuration["Jwt:Issuer"]; + _audience = configuration["Jwt:Audience"]; + _expiryMinutes = double.Parse(configuration["Jwt:ExpiryMinutes"]); + } + + public string GenerateJwtToken(string email) + { + var tokenHandler = new JwtSecurityTokenHandler(); + var key = Encoding.ASCII.GetBytes(_secretKey); + var tokenDescriptor = new SecurityTokenDescriptor + { + Subject = new ClaimsIdentity(new[] + { + new Claim(ClaimTypes.Email, email) + }), + Expires = DateTime.UtcNow.AddMinutes(_expiryMinutes), + Issuer = _issuer, + Audience = _audience, + SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(key), SecurityAlgorithms.HmacSha256Signature) + }; + + var token = tokenHandler.CreateToken(tokenDescriptor); + return tokenHandler.WriteToken(token); + } + + public bool ValidateJwtToken(string token) + { + if (string.IsNullOrWhiteSpace(token)) + return false; + + var tokenHandler = new JwtSecurityTokenHandler(); + var key = Encoding.ASCII.GetBytes(_secretKey); + try + { + tokenHandler.ValidateToken(token, new TokenValidationParameters + { + ValidateIssuerSigningKey = true, + IssuerSigningKey = new SymmetricSecurityKey(key), + ValidateIssuer = true, + ValidateAudience = true, + ValidIssuer = _issuer, + ValidAudience = _audience, + ClockSkew = TimeSpan.Zero, + }, out SecurityToken validatedToken); + + return true; + } + catch + { + return false; + } + } + + public string RefreshToken(string token) + { + var principal = ValidateTokenAndGetPrincipal(token); + if (principal == null) + { + throw new SecurityTokenException("Invalid token."); + } + + var emailClaim = principal.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Email); + if (emailClaim == null) + { + throw new SecurityTokenException("Token does not contain an email claim."); + } + + return GenerateJwtToken(emailClaim.Value); + } + + private ClaimsPrincipal ValidateTokenAndGetPrincipal(string token) + { + var tokenHandler = new JwtSecurityTokenHandler(); + var key = Encoding.ASCII.GetBytes(_secretKey); + try + { + var principal = tokenHandler.ValidateToken(token, new TokenValidationParameters + { + ValidateIssuerSigningKey = true, + IssuerSigningKey = new SymmetricSecurityKey(key), + ValidateIssuer = true, + ValidateAudience = true, + ValidIssuer = _issuer, + ValidAudience = _audience, + ClockSkew = TimeSpan.Zero, + }, out _); + + return principal; + } + catch + { + // Log or handle validation errors if necessary + return null; + } + } + +} \ No newline at end of file diff --git a/backend/Infrastructure/Services/MongoDB/ChatMongoDbService.cs b/backend/Infrastructure/Services/MongoDB/ChatMongoDbService.cs index c9f9af9..3ed50d9 100644 --- a/backend/Infrastructure/Services/MongoDB/ChatMongoDbService.cs +++ b/backend/Infrastructure/Services/MongoDB/ChatMongoDbService.cs @@ -4,10 +4,10 @@ namespace Infrastructure.Services.MongoDB; public class ChatMongoDbService : MongoDbService, IChatMongoDbService { - public ChatMongoDbService(string connectionString, string databaseName, string collectionName) + public ChatMongoDbService(string connectionString, string databaseName, string collectionName) : base(connectionString, databaseName, collectionName) { } - + // Implement additional methods specific to Chat database if needed } \ No newline at end of file diff --git a/backend/Infrastructure/Services/MongoDB/MedicalHistoryMongoDbService.cs b/backend/Infrastructure/Services/MongoDB/MedicalHistoryMongoDbService.cs index 7560990..ff8e3d8 100644 --- a/backend/Infrastructure/Services/MongoDB/MedicalHistoryMongoDbService.cs +++ b/backend/Infrastructure/Services/MongoDB/MedicalHistoryMongoDbService.cs @@ -4,10 +4,10 @@ namespace Infrastructure.Services.MongoDB; public class MedicalHistoryMongoDbService : MongoDbService, IMedicalHistoryMongoDbService { - public MedicalHistoryMongoDbService(string connectionString, string databaseName, string collectionName) + public MedicalHistoryMongoDbService(string connectionString, string databaseName, string collectionName) : base(connectionString, databaseName, collectionName) { } - + // Implement additional methods specific to Medical History database if needed } \ No newline at end of file diff --git a/backend/Infrastructure/Services/MongoDB/MongoDBServices.cs b/backend/Infrastructure/Services/MongoDB/MongoDBServices.cs index 6af5e45..b2048e4 100644 --- a/backend/Infrastructure/Services/MongoDB/MongoDBServices.cs +++ b/backend/Infrastructure/Services/MongoDB/MongoDBServices.cs @@ -14,7 +14,7 @@ namespace Infrastructure.Services.MongoDB { _databaseName = databaseName; _collectionName = collectionName; - + Console.WriteLine($"Connection string: {connectionString}"); Console.WriteLine($"Database Name: {databaseName}"); Console.WriteLine($"Collection Name: {collectionName}"); @@ -23,12 +23,12 @@ namespace Infrastructure.Services.MongoDB settings.ServerApi = new ServerApi(ServerApiVersion.V1); _database = new MongoClient(settings); - try + try { var result = _database.GetDatabase("admin").RunCommand(new BsonDocument("ping", 1)); Console.WriteLine("Pinged your deployment. You successfully connected to MongoDB!"); - } - catch (Exception ex) + } + catch (Exception ex) { Console.WriteLine(ex); } @@ -71,4 +71,4 @@ namespace Infrastructure.Services.MongoDB await collection.DeleteOneAsync(filter); } } -} +} \ No newline at end of file diff --git a/backend/Infrastructure/bin/Debug/net8.0/Application.dll b/backend/Infrastructure/bin/Debug/net8.0/Application.dll index 7a8b24f..ac54dcf 100644 Binary files a/backend/Infrastructure/bin/Debug/net8.0/Application.dll and b/backend/Infrastructure/bin/Debug/net8.0/Application.dll differ diff --git a/backend/Infrastructure/bin/Debug/net8.0/Application.pdb b/backend/Infrastructure/bin/Debug/net8.0/Application.pdb index 9acaaf3..582da16 100644 Binary files a/backend/Infrastructure/bin/Debug/net8.0/Application.pdb and b/backend/Infrastructure/bin/Debug/net8.0/Application.pdb differ diff --git a/backend/Infrastructure/bin/Debug/net8.0/Core.dll b/backend/Infrastructure/bin/Debug/net8.0/Core.dll index 02b0d46..62444bc 100644 Binary files a/backend/Infrastructure/bin/Debug/net8.0/Core.dll and b/backend/Infrastructure/bin/Debug/net8.0/Core.dll differ diff --git a/backend/Infrastructure/bin/Debug/net8.0/Core.pdb b/backend/Infrastructure/bin/Debug/net8.0/Core.pdb index fafb776..be53c18 100644 Binary files a/backend/Infrastructure/bin/Debug/net8.0/Core.pdb and b/backend/Infrastructure/bin/Debug/net8.0/Core.pdb differ diff --git a/backend/Infrastructure/bin/Debug/net8.0/Infrastructure.dll b/backend/Infrastructure/bin/Debug/net8.0/Infrastructure.dll index 3c7b6d1..589a16f 100644 Binary files a/backend/Infrastructure/bin/Debug/net8.0/Infrastructure.dll and b/backend/Infrastructure/bin/Debug/net8.0/Infrastructure.dll differ diff --git a/backend/Infrastructure/bin/Debug/net8.0/Infrastructure.pdb b/backend/Infrastructure/bin/Debug/net8.0/Infrastructure.pdb index 7fe98f5..b2032af 100644 Binary files a/backend/Infrastructure/bin/Debug/net8.0/Infrastructure.pdb and b/backend/Infrastructure/bin/Debug/net8.0/Infrastructure.pdb differ diff --git a/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.AssemblyInfo.cs b/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.AssemblyInfo.cs index 8997d0f..6832069 100644 --- a/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.AssemblyInfo.cs +++ b/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Infrastructure")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+61a55fa7353346bdad2d677f0ec3c044c3aa87d5")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+90604e48ae9f78fa417a446c05f7759001447de5")] [assembly: System.Reflection.AssemblyProductAttribute("Infrastructure")] [assembly: System.Reflection.AssemblyTitleAttribute("Infrastructure")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.AssemblyInfoInputs.cache b/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.AssemblyInfoInputs.cache index ab571e5..989cc17 100644 --- a/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.AssemblyInfoInputs.cache +++ b/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.AssemblyInfoInputs.cache @@ -1 +1 @@ -08604fac7a3083586b55565c1ab1f39ea8637dd70dd31c4daa6a7693d2108c04 +e1c3121ace236e20e13aaf8b3d9598b128a06f6767335df394443504262808ba diff --git a/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.assets.cache b/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.assets.cache index 407305a..2e26b59 100644 Binary files a/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.assets.cache and b/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.assets.cache differ diff --git a/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.csproj.AssemblyReference.cache b/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.csproj.AssemblyReference.cache index 016f292..44504a3 100644 Binary files a/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.csproj.AssemblyReference.cache and b/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.csproj.AssemblyReference.cache differ diff --git a/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.csproj.CoreCompileInputs.cache b/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.csproj.CoreCompileInputs.cache index b8d6b84..11f6f8f 100644 --- a/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.csproj.CoreCompileInputs.cache +++ b/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -39d9df72cda14e46450bf8a8087069ed85d06562c962bd2ab07df607c60c7cf4 +0fc8c2fdc4b952d96dcf80928d47de35d2afdbcca7797ecd9fa91d54ef6cedf9 diff --git a/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.dll b/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.dll index 3c7b6d1..589a16f 100644 Binary files a/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.dll and b/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.dll differ diff --git a/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.pdb b/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.pdb index 7fe98f5..b2032af 100644 Binary files a/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.pdb and b/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.pdb differ diff --git a/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.sourcelink.json b/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.sourcelink.json index ecec2f0..84ecd88 100644 --- a/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.sourcelink.json +++ b/backend/Infrastructure/obj/Debug/net8.0/Infrastructure.sourcelink.json @@ -1 +1 @@ -{"documents":{"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\*":"https://raw.githubusercontent.com/andrei-mihnea-cerbu/CC-FinalProj/61a55fa7353346bdad2d677f0ec3c044c3aa87d5/*"}} \ No newline at end of file +{"documents":{"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\*":"https://raw.githubusercontent.com/andrei-mihnea-cerbu/CC-FinalProj/48eb2adcbd149cd66c77ba558f492179d2bf29be/*"}} \ No newline at end of file diff --git a/backend/Infrastructure/obj/Debug/net8.0/ref/Infrastructure.dll b/backend/Infrastructure/obj/Debug/net8.0/ref/Infrastructure.dll index 6ccecea..8902520 100644 Binary files a/backend/Infrastructure/obj/Debug/net8.0/ref/Infrastructure.dll and b/backend/Infrastructure/obj/Debug/net8.0/ref/Infrastructure.dll differ diff --git a/backend/Infrastructure/obj/Debug/net8.0/refint/Infrastructure.dll b/backend/Infrastructure/obj/Debug/net8.0/refint/Infrastructure.dll index 6ccecea..8902520 100644 Binary files a/backend/Infrastructure/obj/Debug/net8.0/refint/Infrastructure.dll and b/backend/Infrastructure/obj/Debug/net8.0/refint/Infrastructure.dll differ diff --git a/backend/Infrastructure/obj/Infrastructure.csproj.nuget.dgspec.json b/backend/Infrastructure/obj/Infrastructure.csproj.nuget.dgspec.json index 0cc01fe..9b29fd6 100644 --- a/backend/Infrastructure/obj/Infrastructure.csproj.nuget.dgspec.json +++ b/backend/Infrastructure/obj/Infrastructure.csproj.nuget.dgspec.json @@ -14,14 +14,12 @@ "outputPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\obj\\", "projectStyle": "PackageReference", "configFilePaths": [ - "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config", - "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config" ], "originalTargetFrameworks": [ "net8.0" ], "sources": { - "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { @@ -69,7 +67,7 @@ "privateAssets": "all" } }, - "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json" + "runtimeIdentifierGraphPath": "C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json" } } }, @@ -83,14 +81,12 @@ "outputPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\obj\\", "projectStyle": "PackageReference", "configFilePaths": [ - "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config", - "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config" ], "originalTargetFrameworks": [ "net8.0" ], "sources": { - "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { @@ -130,7 +126,7 @@ "privateAssets": "all" } }, - "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json" + "runtimeIdentifierGraphPath": "C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json" } } }, @@ -144,14 +140,12 @@ "outputPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Infrastructure\\obj\\", "projectStyle": "PackageReference", "configFilePaths": [ - "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config", - "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config" ], "originalTargetFrameworks": [ "net8.0" ], "sources": { - "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { @@ -203,6 +197,10 @@ "target": "Package", "version": "[8.0.0, )" }, + "Microsoft.IdentityModel.Tokens": { + "target": "Package", + "version": "[7.5.1, )" + }, "MongoDB.Driver": { "target": "Package", "version": "[2.24.0, )" @@ -210,6 +208,10 @@ "Npgsql.EntityFrameworkCore.PostgreSQL": { "target": "Package", "version": "[8.0.2, )" + }, + "System.IdentityModel.Tokens.Jwt": { + "target": "Package", + "version": "[7.5.1, )" } }, "imports": [ @@ -228,7 +230,7 @@ "privateAssets": "all" } }, - "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json" + "runtimeIdentifierGraphPath": "C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json" } } } diff --git a/backend/Infrastructure/obj/project.assets.json b/backend/Infrastructure/obj/project.assets.json index 11a694e..c6b363b 100644 --- a/backend/Infrastructure/obj/project.assets.json +++ b/backend/Infrastructure/obj/project.assets.json @@ -772,6 +772,67 @@ "buildTransitive/net6.0/_._": {} } }, + "Microsoft.IdentityModel.Abstractions/7.5.1": { + "type": "package", + "compile": { + "lib/net8.0/Microsoft.IdentityModel.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.Abstractions.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.JsonWebTokens/7.5.1": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.Tokens": "7.5.1" + }, + "compile": { + "lib/net8.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.JsonWebTokens.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.Logging/7.5.1": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "7.5.1" + }, + "compile": { + "lib/net8.0/Microsoft.IdentityModel.Logging.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.Logging.dll": { + "related": ".xml" + } + } + }, + "Microsoft.IdentityModel.Tokens/7.5.1": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.Logging": "7.5.1" + }, + "compile": { + "lib/net8.0/Microsoft.IdentityModel.Tokens.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/Microsoft.IdentityModel.Tokens.dll": { + "related": ".xml" + } + } + }, "Microsoft.NETCore.Platforms/5.0.0": { "type": "package", "compile": { @@ -1109,6 +1170,23 @@ "buildTransitive/netcoreapp3.1/_._": {} } }, + "System.IdentityModel.Tokens.Jwt/7.5.1": { + "type": "package", + "dependencies": { + "Microsoft.IdentityModel.JsonWebTokens": "7.5.1", + "Microsoft.IdentityModel.Tokens": "7.5.1" + }, + "compile": { + "lib/net8.0/System.IdentityModel.Tokens.Jwt.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/System.IdentityModel.Tokens.Jwt.dll": { + "related": ".xml" + } + } + }, "System.IO.Pipelines/6.0.3": { "type": "package", "compile": { @@ -2602,6 +2680,98 @@ "useSharedDesignerContext.txt" ] }, + "Microsoft.IdentityModel.Abstractions/7.5.1": { + "sha512": "PT16ZFbPIiMsYv07oy3zOjqUOJ7xutGBkJTOX0+IbNyU6+O6X7aIxjq9EaSSRLWbekRgamgtmfg8Xjw6A6Ua9g==", + "type": "package", + "path": "microsoft.identitymodel.abstractions/7.5.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net461/Microsoft.IdentityModel.Abstractions.dll", + "lib/net461/Microsoft.IdentityModel.Abstractions.xml", + "lib/net462/Microsoft.IdentityModel.Abstractions.dll", + "lib/net462/Microsoft.IdentityModel.Abstractions.xml", + "lib/net472/Microsoft.IdentityModel.Abstractions.dll", + "lib/net472/Microsoft.IdentityModel.Abstractions.xml", + "lib/net6.0/Microsoft.IdentityModel.Abstractions.dll", + "lib/net6.0/Microsoft.IdentityModel.Abstractions.xml", + "lib/net8.0/Microsoft.IdentityModel.Abstractions.dll", + "lib/net8.0/Microsoft.IdentityModel.Abstractions.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.xml", + "microsoft.identitymodel.abstractions.7.5.1.nupkg.sha512", + "microsoft.identitymodel.abstractions.nuspec" + ] + }, + "Microsoft.IdentityModel.JsonWebTokens/7.5.1": { + "sha512": "93CGSa8RPdZU8zfvA3nf9NGKUqEnQrE12VzYlMqKh72ddhzusosqLNEUgH/YhFWBLRFOnY1RCgHMV7pR+sAx2w==", + "type": "package", + "path": "microsoft.identitymodel.jsonwebtokens/7.5.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net461/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net461/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/net462/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net462/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/net472/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net472/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/net6.0/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net6.0/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/net8.0/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/net8.0/Microsoft.IdentityModel.JsonWebTokens.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.JsonWebTokens.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.JsonWebTokens.xml", + "microsoft.identitymodel.jsonwebtokens.7.5.1.nupkg.sha512", + "microsoft.identitymodel.jsonwebtokens.nuspec" + ] + }, + "Microsoft.IdentityModel.Logging/7.5.1": { + "sha512": "PnpAQX20BAiDIPYmWUyQSlEaWD8BLXzHpiDGTCT568Cs0ReOeyzNe401LzCeiv6ilug/KefVeV1CeqtCHTo8dw==", + "type": "package", + "path": "microsoft.identitymodel.logging/7.5.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net461/Microsoft.IdentityModel.Logging.dll", + "lib/net461/Microsoft.IdentityModel.Logging.xml", + "lib/net462/Microsoft.IdentityModel.Logging.dll", + "lib/net462/Microsoft.IdentityModel.Logging.xml", + "lib/net472/Microsoft.IdentityModel.Logging.dll", + "lib/net472/Microsoft.IdentityModel.Logging.xml", + "lib/net6.0/Microsoft.IdentityModel.Logging.dll", + "lib/net6.0/Microsoft.IdentityModel.Logging.xml", + "lib/net8.0/Microsoft.IdentityModel.Logging.dll", + "lib/net8.0/Microsoft.IdentityModel.Logging.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.Logging.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.Logging.xml", + "microsoft.identitymodel.logging.7.5.1.nupkg.sha512", + "microsoft.identitymodel.logging.nuspec" + ] + }, + "Microsoft.IdentityModel.Tokens/7.5.1": { + "sha512": "Q3DKpyFViP84IUlTFKH/zIkswIrmSh2Vd/eFDo4wlOHy4DYxoweZEEw4kDEiKt9VCX6o7SddK3HK2xDYyFpexA==", + "type": "package", + "path": "microsoft.identitymodel.tokens/7.5.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net461/Microsoft.IdentityModel.Tokens.dll", + "lib/net461/Microsoft.IdentityModel.Tokens.xml", + "lib/net462/Microsoft.IdentityModel.Tokens.dll", + "lib/net462/Microsoft.IdentityModel.Tokens.xml", + "lib/net472/Microsoft.IdentityModel.Tokens.dll", + "lib/net472/Microsoft.IdentityModel.Tokens.xml", + "lib/net6.0/Microsoft.IdentityModel.Tokens.dll", + "lib/net6.0/Microsoft.IdentityModel.Tokens.xml", + "lib/net8.0/Microsoft.IdentityModel.Tokens.dll", + "lib/net8.0/Microsoft.IdentityModel.Tokens.xml", + "lib/netstandard2.0/Microsoft.IdentityModel.Tokens.dll", + "lib/netstandard2.0/Microsoft.IdentityModel.Tokens.xml", + "microsoft.identitymodel.tokens.7.5.1.nupkg.sha512", + "microsoft.identitymodel.tokens.nuspec" + ] + }, "Microsoft.NETCore.Platforms/5.0.0": { "sha512": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==", "type": "package", @@ -3043,6 +3213,29 @@ "useSharedDesignerContext.txt" ] }, + "System.IdentityModel.Tokens.Jwt/7.5.1": { + "sha512": "UUw+E0R73lZLlXgneYIJQxNs1kfbcxjVzw64JQyiwjqCd4HMpAbjn+xRo86QZT84uHq8/MkqvfH82tgjgPzpuw==", + "type": "package", + "path": "system.identitymodel.tokens.jwt/7.5.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net461/System.IdentityModel.Tokens.Jwt.dll", + "lib/net461/System.IdentityModel.Tokens.Jwt.xml", + "lib/net462/System.IdentityModel.Tokens.Jwt.dll", + "lib/net462/System.IdentityModel.Tokens.Jwt.xml", + "lib/net472/System.IdentityModel.Tokens.Jwt.dll", + "lib/net472/System.IdentityModel.Tokens.Jwt.xml", + "lib/net6.0/System.IdentityModel.Tokens.Jwt.dll", + "lib/net6.0/System.IdentityModel.Tokens.Jwt.xml", + "lib/net8.0/System.IdentityModel.Tokens.Jwt.dll", + "lib/net8.0/System.IdentityModel.Tokens.Jwt.xml", + "lib/netstandard2.0/System.IdentityModel.Tokens.Jwt.dll", + "lib/netstandard2.0/System.IdentityModel.Tokens.Jwt.xml", + "system.identitymodel.tokens.jwt.7.5.1.nupkg.sha512", + "system.identitymodel.tokens.jwt.nuspec" + ] + }, "System.IO.Pipelines/6.0.3": { "sha512": "ryTgF+iFkpGZY1vRQhfCzX0xTdlV3pyaTTqRu2ETbEv+HlV7O6y7hyQURnghNIXvctl5DuZ//Dpks6HdL/Txgw==", "type": "package", @@ -3454,8 +3647,10 @@ "Microsoft.Extensions.Configuration >= 8.0.0", "Microsoft.Extensions.Configuration.Json >= 8.0.0", "Microsoft.Extensions.Options.ConfigurationExtensions >= 8.0.0", + "Microsoft.IdentityModel.Tokens >= 7.5.1", "MongoDB.Driver >= 2.24.0", - "Npgsql.EntityFrameworkCore.PostgreSQL >= 8.0.2" + "Npgsql.EntityFrameworkCore.PostgreSQL >= 8.0.2", + "System.IdentityModel.Tokens.Jwt >= 7.5.1" ] }, "packageFolders": { @@ -3471,14 +3666,12 @@ "outputPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Infrastructure\\obj\\", "projectStyle": "PackageReference", "configFilePaths": [ - "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config", - "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config" ], "originalTargetFrameworks": [ "net8.0" ], "sources": { - "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { @@ -3530,6 +3723,10 @@ "target": "Package", "version": "[8.0.0, )" }, + "Microsoft.IdentityModel.Tokens": { + "target": "Package", + "version": "[7.5.1, )" + }, "MongoDB.Driver": { "target": "Package", "version": "[2.24.0, )" @@ -3537,6 +3734,10 @@ "Npgsql.EntityFrameworkCore.PostgreSQL": { "target": "Package", "version": "[8.0.2, )" + }, + "System.IdentityModel.Tokens.Jwt": { + "target": "Package", + "version": "[7.5.1, )" } }, "imports": [ @@ -3555,7 +3756,7 @@ "privateAssets": "all" } }, - "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json" + "runtimeIdentifierGraphPath": "C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json" } } } diff --git a/backend/Infrastructure/obj/project.nuget.cache b/backend/Infrastructure/obj/project.nuget.cache index 1237d21..bc245e8 100644 --- a/backend/Infrastructure/obj/project.nuget.cache +++ b/backend/Infrastructure/obj/project.nuget.cache @@ -1,6 +1,6 @@ { "version": 2, - "dgSpecHash": "iwi/5xNtgWqhK31wqOr9WG6iDQW0uTBS41AXw9EdTi0QL3UPkJdVquF7OuGqSc48sG+mLp/gC3DLdj3TQId54g==", + "dgSpecHash": "pF3XqxVA87LZ2eqKgkY0WSdNfMkjY7iYYiKVDDpMtBbgzsStmL5AV+YB1rj394lXBXpedmSvoVfqxSY86Dd62g==", "success": true, "projectFilePath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Infrastructure\\Infrastructure.csproj", "expectedPackageFiles": [ @@ -38,6 +38,10 @@ "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.extensions.options\\8.0.0\\microsoft.extensions.options.8.0.0.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.extensions.options.configurationextensions\\8.0.0\\microsoft.extensions.options.configurationextensions.8.0.0.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.extensions.primitives\\8.0.0\\microsoft.extensions.primitives.8.0.0.nupkg.sha512", + "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.identitymodel.abstractions\\7.5.1\\microsoft.identitymodel.abstractions.7.5.1.nupkg.sha512", + "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.identitymodel.jsonwebtokens\\7.5.1\\microsoft.identitymodel.jsonwebtokens.7.5.1.nupkg.sha512", + "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.identitymodel.logging\\7.5.1\\microsoft.identitymodel.logging.7.5.1.nupkg.sha512", + "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.identitymodel.tokens\\7.5.1\\microsoft.identitymodel.tokens.7.5.1.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.netcore.platforms\\5.0.0\\microsoft.netcore.platforms.5.0.0.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.win32.registry\\5.0.0\\microsoft.win32.registry.5.0.0.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\mongodb.bson\\2.24.0\\mongodb.bson.2.24.0.nupkg.sha512", @@ -58,6 +62,7 @@ "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\system.composition.hosting\\6.0.0\\system.composition.hosting.6.0.0.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\system.composition.runtime\\6.0.0\\system.composition.runtime.6.0.0.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\system.composition.typedparts\\6.0.0\\system.composition.typedparts.6.0.0.nupkg.sha512", + "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\system.identitymodel.tokens.jwt\\7.5.1\\system.identitymodel.tokens.jwt.7.5.1.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\system.io.pipelines\\6.0.3\\system.io.pipelines.6.0.3.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\system.memory\\4.5.5\\system.memory.4.5.5.nupkg.sha512", "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\system.reflection.metadata\\6.0.1\\system.reflection.metadata.6.0.1.nupkg.sha512", diff --git a/backend/Infrastructure/obj/project.packagespec.json b/backend/Infrastructure/obj/project.packagespec.json index b07bb8e..2184a76 100644 --- a/backend/Infrastructure/obj/project.packagespec.json +++ b/backend/Infrastructure/obj/project.packagespec.json @@ -1 +1 @@ -"restore":{"projectUniqueName":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Infrastructure\\Infrastructure.csproj","projectName":"Infrastructure","projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Infrastructure\\Infrastructure.csproj","outputPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Infrastructure\\obj\\","projectStyle":"PackageReference","originalTargetFrameworks":["net8.0"],"sources":{"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\":{},"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net8.0":{"targetAlias":"net8.0","projectReferences":{"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\Application.csproj":{"projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\Application.csproj"},"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\Core.csproj":{"projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\Core.csproj"}}}},"warningProperties":{"warnAsError":["NU1605"]}}"frameworks":{"net8.0":{"targetAlias":"net8.0","dependencies":{"Microsoft.EntityFrameworkCore":{"target":"Package","version":"[8.0.3, )"},"Microsoft.EntityFrameworkCore.Design":{"include":"Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive","suppressParent":"All","target":"Package","version":"[8.0.3, )"},"Microsoft.EntityFrameworkCore.Relational":{"target":"Package","version":"[8.0.3, )"},"Microsoft.Extensions.Configuration":{"target":"Package","version":"[8.0.0, )"},"Microsoft.Extensions.Configuration.Json":{"target":"Package","version":"[8.0.0, )"},"Microsoft.Extensions.Options.ConfigurationExtensions":{"target":"Package","version":"[8.0.0, )"},"MongoDB.Driver":{"target":"Package","version":"[2.24.0, )"},"Npgsql.EntityFrameworkCore.PostgreSQL":{"target":"Package","version":"[8.0.2, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Program Files\\dotnet\\sdk\\8.0.202/PortableRuntimeIdentifierGraph.json"}} \ No newline at end of file +"restore":{"projectUniqueName":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Infrastructure\\Infrastructure.csproj","projectName":"Infrastructure","projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Infrastructure\\Infrastructure.csproj","outputPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Infrastructure\\obj\\","projectStyle":"PackageReference","originalTargetFrameworks":["net8.0"],"sources":{"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net8.0":{"targetAlias":"net8.0","projectReferences":{"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\Application.csproj":{"projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\Application.csproj"},"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\Core.csproj":{"projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\Core.csproj"}}}},"warningProperties":{"warnAsError":["NU1605"]}}"frameworks":{"net8.0":{"targetAlias":"net8.0","dependencies":{"Microsoft.EntityFrameworkCore":{"target":"Package","version":"[8.0.3, )"},"Microsoft.EntityFrameworkCore.Design":{"include":"Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive","suppressParent":"All","target":"Package","version":"[8.0.3, )"},"Microsoft.EntityFrameworkCore.Relational":{"target":"Package","version":"[8.0.3, )"},"Microsoft.Extensions.Configuration":{"target":"Package","version":"[8.0.0, )"},"Microsoft.Extensions.Configuration.Json":{"target":"Package","version":"[8.0.0, )"},"Microsoft.Extensions.Options.ConfigurationExtensions":{"target":"Package","version":"[8.0.0, )"},"Microsoft.IdentityModel.Tokens":{"target":"Package","version":"[7.5.1, )"},"MongoDB.Driver":{"target":"Package","version":"[2.24.0, )"},"Npgsql.EntityFrameworkCore.PostgreSQL":{"target":"Package","version":"[8.0.2, )"},"System.IdentityModel.Tokens.Jwt":{"target":"Package","version":"[7.5.1, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json"}} \ No newline at end of file diff --git a/backend/Infrastructure/obj/rider.project.model.nuget.info b/backend/Infrastructure/obj/rider.project.model.nuget.info index ea3c7ff..26222e8 100644 --- a/backend/Infrastructure/obj/rider.project.model.nuget.info +++ b/backend/Infrastructure/obj/rider.project.model.nuget.info @@ -1 +1 @@ -17122552827017860 \ No newline at end of file +17125672278122993 \ No newline at end of file diff --git a/backend/Infrastructure/obj/rider.project.restore.info b/backend/Infrastructure/obj/rider.project.restore.info index d0283bc..d20ddb9 100644 --- a/backend/Infrastructure/obj/rider.project.restore.info +++ b/backend/Infrastructure/obj/rider.project.restore.info @@ -1 +1 @@ -17125075152023106 \ No newline at end of file +17125685577988485 \ No newline at end of file diff --git a/backend/UpgradeLog.htm b/backend/UpgradeLog.htm new file mode 100644 index 0000000..d18ddf6 --- /dev/null +++ b/backend/UpgradeLog.htm @@ -0,0 +1,282 @@ + + + + Migration Report +

+ Migration Report - HealthcareManagerAPI

Overview

ProjectPathErrorsWarningsMessages
APIAPI\API.csproj100
CoreCore\Core.csproj100
InfrastructureInfrastructure\Infrastructure.csproj100
SolutionHealthcareManagerAPI.sln012
ApplicationApplication\Application.csproj000
HealthcareManager.APIHealthcareManager.API000
HealthcareManager.ApplicationHealthcareManager.Application000
HealthcareManager.CoreHealthcareManager.Core000
HealthcareManager.InfrastructureHealthcareManager.Infrastructure000

Solution and projects

\ No newline at end of file diff --git a/backend/UpgradeLog2.htm b/backend/UpgradeLog2.htm new file mode 100644 index 0000000..f8f2619 --- /dev/null +++ b/backend/UpgradeLog2.htm @@ -0,0 +1,268 @@ + + + + Migration Report +

+ Migration Report -

\ No newline at end of file diff --git a/backend/UpgradeLog3.htm b/backend/UpgradeLog3.htm new file mode 100644 index 0000000..2d5d6ef --- /dev/null +++ b/backend/UpgradeLog3.htm @@ -0,0 +1,268 @@ + + + + Migration Report +

+ Migration Report -

\ No newline at end of file diff --git a/backend/UpgradeLog4.htm b/backend/UpgradeLog4.htm new file mode 100644 index 0000000..2d5d6ef --- /dev/null +++ b/backend/UpgradeLog4.htm @@ -0,0 +1,268 @@ + + + + Migration Report +

+ Migration Report -

\ No newline at end of file diff --git a/frontend/.idea/.idea.HealthcareManagerUI/.idea/.gitignore b/frontend/.idea/.idea.HealthcareManagerUI/.idea/.gitignore new file mode 100644 index 0000000..b68b1d2 --- /dev/null +++ b/frontend/.idea/.idea.HealthcareManagerUI/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/projectSettingsUpdater.xml +/modules.xml +/contentModel.xml +/.idea.HealthcareManagerUI.iml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/frontend/.idea/.idea.HealthcareManagerUI/.idea/.name b/frontend/.idea/.idea.HealthcareManagerUI/.idea/.name new file mode 100644 index 0000000..6c9ffb2 --- /dev/null +++ b/frontend/.idea/.idea.HealthcareManagerUI/.idea/.name @@ -0,0 +1 @@ +HealthcareManagerUI \ No newline at end of file diff --git a/frontend/.idea/.idea.HealthcareManagerUI/.idea/encodings.xml b/frontend/.idea/.idea.HealthcareManagerUI/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/frontend/.idea/.idea.HealthcareManagerUI/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/.idea/.idea.HealthcareManagerUI/.idea/indexLayout.xml b/frontend/.idea/.idea.HealthcareManagerUI/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/frontend/.idea/.idea.HealthcareManagerUI/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/frontend/.idea/.idea.HealthcareManagerUI/.idea/vcs.xml b/frontend/.idea/.idea.HealthcareManagerUI/.idea/vcs.xml new file mode 100644 index 0000000..64713b8 --- /dev/null +++ b/frontend/.idea/.idea.HealthcareManagerUI/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/frontend/HealthcareManagerUI.sln b/frontend/HealthcareManagerUI.sln new file mode 100644 index 0000000..335ce5c --- /dev/null +++ b/frontend/HealthcareManagerUI.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34616.47 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HealthcareManagerUI", "HealthcareManagerUI\HealthcareManagerUI.csproj", "{641DCB44-0CC9-43D0-AE58-5A722261F1E1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {641DCB44-0CC9-43D0-AE58-5A722261F1E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {641DCB44-0CC9-43D0-AE58-5A722261F1E1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {641DCB44-0CC9-43D0-AE58-5A722261F1E1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {641DCB44-0CC9-43D0-AE58-5A722261F1E1}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {55598450-70ED-4D22-913B-0C99AB8F3F7D} + EndGlobalSection +EndGlobal diff --git a/frontend/HealthcareManagerUI/Components/Layout/AuthLayout.razor b/frontend/HealthcareManagerUI/Components/Layout/AuthLayout.razor new file mode 100644 index 0000000..0e02478 --- /dev/null +++ b/frontend/HealthcareManagerUI/Components/Layout/AuthLayout.razor @@ -0,0 +1,16 @@ +@inherits LayoutComponentBase + + + + + + + + + +
+
+ @Body +
+ + \ No newline at end of file diff --git a/frontend/HealthcareManagerUI/Components/Pages/AlertMessage.razor b/frontend/HealthcareManagerUI/Components/Pages/AlertMessage.razor new file mode 100644 index 0000000..32bdaeb --- /dev/null +++ b/frontend/HealthcareManagerUI/Components/Pages/AlertMessage.razor @@ -0,0 +1,12 @@ +@if (!string.IsNullOrEmpty(ErrorMessage)) +{ + +} + +@code { + [Parameter] + public string ErrorMessage { get; set; } +} diff --git a/frontend/HealthcareManagerUI/Components/Pages/ChooseRolePage.razor b/frontend/HealthcareManagerUI/Components/Pages/ChooseRolePage.razor new file mode 100644 index 0000000..7a1af3f --- /dev/null +++ b/frontend/HealthcareManagerUI/Components/Pages/ChooseRolePage.razor @@ -0,0 +1,15 @@ +@page "/" +@using HealthcareManagerUI.Components.Layout +@layout AuthLayout + + Choose Role + + +
+

Welcome to Healthcare Manager

+

Please select your role:

+
+ I'm a Doctor + I'm a Patient +
+
diff --git a/frontend/HealthcareManagerUI/Components/Pages/DashboardPage.razor b/frontend/HealthcareManagerUI/Components/Pages/DashboardPage.razor new file mode 100644 index 0000000..5dee81c --- /dev/null +++ b/frontend/HealthcareManagerUI/Components/Pages/DashboardPage.razor @@ -0,0 +1,9 @@ +@page "/dashboard" + + Dashboard + +

Dashboard

+

login success

+@code { + +} diff --git a/frontend/HealthcareManagerUI/Components/Pages/LoginPage.razor b/frontend/HealthcareManagerUI/Components/Pages/LoginPage.razor new file mode 100644 index 0000000..6897c05 --- /dev/null +++ b/frontend/HealthcareManagerUI/Components/Pages/LoginPage.razor @@ -0,0 +1,77 @@ +@page "/login/{role}" +@using HealthcareManagerUI.Models +@using HealthcareManagerUI.Services.Authentication +@using HealthcareManagerUI.Components.Layout + +@layout AuthLayout + +@inject IAuthenticationService AuthenticationService +@inject NavigationManager NavigationManager + + + Login + + + + + + + + + +@code { + [SupplyParameterFromForm] + public UserLoginModel? userLoginModel { get; set; } + + protected override void OnInitialized() + { + userLoginModel ??= new(); + } + + [Parameter] public string Role { get; set; } + private string errorMessage { get; set; } + + private void ClearErrorMessage() + { + errorMessage = string.Empty; + } + + private async Task HandleLogin() + { + var response = Role switch + { + "doctor" => await AuthenticationService.LoginDoctor(userLoginModel), + "patient" => await AuthenticationService.LoginPatient(userLoginModel), + _ => null + }; + + if (response.StatusCode >= 200 && response.StatusCode <= 399) + { + NavigationManager.NavigateTo("/dashboard"); + } + else + { + errorMessage = response.Message; + } + } +} \ No newline at end of file diff --git a/frontend/HealthcareManagerUI/Components/Pages/RegisterPage.razor b/frontend/HealthcareManagerUI/Components/Pages/RegisterPage.razor new file mode 100644 index 0000000..526a43f --- /dev/null +++ b/frontend/HealthcareManagerUI/Components/Pages/RegisterPage.razor @@ -0,0 +1,84 @@ +@page "/register/{role}" +@using HealthcareManagerUI.Models +@using HealthcareManagerUI.Services.Authentication +@using HealthcareManagerUI.Components.Layout + +@layout AuthLayout + +@inject IAuthenticationService AuthenticationService +@inject NavigationManager NavigationManager + + + Register + + + + + + + + + +@code { + [SupplyParameterFromForm] + public UserRegisterModel? userRegisterModel { get; set; } + + protected override void OnInitialized() + { + userRegisterModel ??= new(); + } + + [Parameter] public string Role { get; set; } + private string errorMessage { get; set; } + + private void ClearErrorMessage() + { + errorMessage = string.Empty; + } + + private async Task HandleRegister() + { + var response = Role switch + { + "doctor" => await AuthenticationService.RegisterDoctor(userRegisterModel), + "patient" => await AuthenticationService.RegisterPatient(userRegisterModel), + _ => null + }; + + if (response.StatusCode >=200 && response.StatusCode <= 399) + { + NavigationManager.NavigateTo($"/login/{Role}"); + } + else + { + errorMessage = response.Message; + } + } +} \ No newline at end of file diff --git a/frontend/HealthcareManagerUI/Components/Pages/ResetPasswordPage.razor b/frontend/HealthcareManagerUI/Components/Pages/ResetPasswordPage.razor new file mode 100644 index 0000000..2da382d --- /dev/null +++ b/frontend/HealthcareManagerUI/Components/Pages/ResetPasswordPage.razor @@ -0,0 +1,75 @@ +@page "/reset-password/{role}" +@using HealthcareManagerUI.Models +@using HealthcareManagerUI.Services.Authentication +@using HealthcareManagerUI.Components.Layout + +@layout AuthLayout + +@inject IAuthenticationService AuthenticationService +@inject NavigationManager NavigationManager + + + Reset your password + + + + + + + + + +@code { + [SupplyParameterFromForm] + public UserRegisterModel? userResetPasswordModel { get; set; } + + protected override void OnInitialized() + { + userResetPasswordModel ??= new(); + } + + [Parameter] public string Role { get; set; } + private string errorMessage { get; set; } + + private void ClearErrorMessage() + { + errorMessage = string.Empty; + } + + private async Task HandleResetPassword() + { + var response = Role switch + { + "doctor" => await AuthenticationService.ResetDoctorPassword(userResetPasswordModel), + "patient" => await AuthenticationService.ResetPatientPassword(userResetPasswordModel), + _ => null + }; + + if (response.StatusCode >= 200 && response.StatusCode <= 399) + { + NavigationManager.NavigateTo($"/login/{Role}"); + } + else + { + errorMessage = response.Message; + } + } +} \ No newline at end of file diff --git a/frontend/HealthcareManagerUI/HealthcareManagerUI.csproj b/frontend/HealthcareManagerUI/HealthcareManagerUI.csproj new file mode 100644 index 0000000..c487b18 --- /dev/null +++ b/frontend/HealthcareManagerUI/HealthcareManagerUI.csproj @@ -0,0 +1,14 @@ + + + + net8.0 + enable + enable + + + + <_ContentIncludedByDefault Remove="wwwroot\bootstrap\bootstrap.min.css" /> + <_ContentIncludedByDefault Remove="wwwroot\bootstrap\bootstrap.min.css.map" /> + + + diff --git a/frontend/HealthcareManagerUI/Models/BaseResponse.cs b/frontend/HealthcareManagerUI/Models/BaseResponse.cs new file mode 100644 index 0000000..079adf2 --- /dev/null +++ b/frontend/HealthcareManagerUI/Models/BaseResponse.cs @@ -0,0 +1,10 @@ +namespace HealthcareManagerUI.Models +{ + public class BaseResponse + { + public int StatusCode { get; set; } + public string? Message { get; set; } + public object? Data { get; set; } + } + +} diff --git a/frontend/HealthcareManagerUI/Models/PacientRegisterModel.cs b/frontend/HealthcareManagerUI/Models/PacientRegisterModel.cs new file mode 100644 index 0000000..2cb4110 --- /dev/null +++ b/frontend/HealthcareManagerUI/Models/PacientRegisterModel.cs @@ -0,0 +1,8 @@ +namespace HealthcareManagerUI.Models; + +public class PatientRegisterModel +{ + public string Name { get; set; } + public string Email { get; set; } + public string Password { get; set; } +} \ No newline at end of file diff --git a/frontend/HealthcareManagerUI/Models/UserRegisterModel.cs b/frontend/HealthcareManagerUI/Models/UserRegisterModel.cs new file mode 100644 index 0000000..92dde3b --- /dev/null +++ b/frontend/HealthcareManagerUI/Models/UserRegisterModel.cs @@ -0,0 +1,9 @@ +namespace HealthcareManagerUI.Models; + +public class UserRegisterModel +{ + public string Name { get; set; } + public string Email { get; set; } + public string Password { get; set; } + public string Description { get; set; } +} \ No newline at end of file diff --git a/frontend/HealthcareManagerUI/Program.cs b/frontend/HealthcareManagerUI/Program.cs new file mode 100644 index 0000000..cff7cba --- /dev/null +++ b/frontend/HealthcareManagerUI/Program.cs @@ -0,0 +1,34 @@ +using HealthcareManagerUI.Components; +using HealthcareManagerUI.Services.Authentication; +using HealthcareManagerUI.Services.Http; + +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. +builder.Services.AddRazorComponents() + .AddInteractiveServerComponents(); + +builder.Services.AddScoped(provider => +{ + var configuration = provider.GetRequiredService(); + return new HttpService(configuration); +}); +builder.Services.AddScoped(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (!app.Environment.IsDevelopment()) +{ + app.UseExceptionHandler("/Error", true); + app.UseHsts(); +} + +app.UseHttpsRedirection(); + +app.UseStaticFiles(); +app.UseAntiforgery(); +app.MapRazorComponents() + .AddInteractiveServerRenderMode(); + +app.Run(); \ No newline at end of file diff --git a/frontend/HealthcareManagerUI/Services/Authentication/AuthenticationService.cs b/frontend/HealthcareManagerUI/Services/Authentication/AuthenticationService.cs new file mode 100644 index 0000000..47fb2e1 --- /dev/null +++ b/frontend/HealthcareManagerUI/Services/Authentication/AuthenticationService.cs @@ -0,0 +1,129 @@ +using HealthcareManagerUI.Models; +using HealthcareManagerUI.Services.Http; +namespace HealthcareManagerUI.Services.Authentication; + +// In AuthenticationService.cs +public class AuthenticationService : IAuthenticationService +{ + private readonly IHttpService _httpService; + private readonly string _apiUrl = "http://localhost:5151/api"; + + public AuthenticationService(IHttpService httpService) + { + _httpService = httpService; + } + + public async Task LoginDoctor(UserLoginModel userLoginModel) + { + try + { + var response = await _httpService.PostAsync($"{_apiUrl}/Doctors/login", userLoginModel); + return response; + } + catch (Exception ex) + { + return new BaseResponse + { + StatusCode = 400, + Data = null, + Message = ex.Message + }; + } + } + + public async Task LoginPatient(UserLoginModel userLoginModel) + { + try + { + var response = await _httpService.PostAsync($"{_apiUrl}/Patients/login", userLoginModel); + return response; + } + catch (Exception ex) + { + return new BaseResponse { + StatusCode = 400, + Data = null, + Message = ex.Message + }; + } + } + + public async Task RegisterDoctor(UserRegisterModel userRegistrationModel) + { + try + { + var response = await _httpService.PostAsync($"{_apiUrl}/Doctors/register", userRegistrationModel); + return response; + } + catch (Exception ex) + { + return new BaseResponse + { + StatusCode = 400, + Data = null, + Message = ex.Message + }; + } + } + + public async Task RegisterPatient(UserRegisterModel userRegisterModel) + { + var patientRegisterDto = new PatientRegisterModel + { + Name = userRegisterModel.Name, + Email = userRegisterModel.Email, + Password = userRegisterModel.Password + }; + + try + { + var response = await _httpService.PostAsync($"{_apiUrl}/Patients/register", userRegisterModel); + return response; + } + catch (Exception ex) + { + return new BaseResponse + { + StatusCode = 400, + Data = null, + Message = ex.Message + }; + } + } + + public async Task ResetDoctorPassword(UserRegisterModel userResetPasswordModel) + { + try + { + var response = await _httpService.PostAsync($"{_apiUrl}/Doctors/reset_password", userResetPasswordModel); + return response; + } + catch (Exception ex) + { + return new BaseResponse + { + StatusCode = 400, + Data = null, + Message = ex.Message + }; + } + } + + public async Task ResetPatientPassword(UserRegisterModel userResetPasswordModel) + { + try + { + var response = await _httpService.PostAsync($"{_apiUrl}/Patients/reset_password", userResetPasswordModel); + return response; + } + catch (Exception ex) + { + return new BaseResponse + { + StatusCode = 400, + Data = null, + Message = ex.Message + }; + } + } +} diff --git a/frontend/HealthcareManagerUI/Services/Authentication/IAuthenticationService.cs b/frontend/HealthcareManagerUI/Services/Authentication/IAuthenticationService.cs new file mode 100644 index 0000000..00eb339 --- /dev/null +++ b/frontend/HealthcareManagerUI/Services/Authentication/IAuthenticationService.cs @@ -0,0 +1,18 @@ +using HealthcareManagerUI.Models; + +namespace HealthcareManagerUI.Services.Authentication; + +public interface IAuthenticationService +{ + Task LoginDoctor(UserLoginModel userLoginModel); + + Task LoginPatient(UserLoginModel userLoginModel); + + Task RegisterDoctor(UserRegisterModel userRegistrationModel); + + Task RegisterPatient(UserRegisterModel userRegistrationModel); + + Task ResetDoctorPassword(UserRegisterModel userResetPasswordModel); + + Task ResetPatientPassword(UserRegisterModel userResetPasswordModel); +} \ No newline at end of file diff --git a/frontend/HealthcareManagerUI/Services/Http/HttpService.cs b/frontend/HealthcareManagerUI/Services/Http/HttpService.cs new file mode 100644 index 0000000..5ba0f68 --- /dev/null +++ b/frontend/HealthcareManagerUI/Services/Http/HttpService.cs @@ -0,0 +1,83 @@ +using System.Text; +using System.Text.Json; + +namespace HealthcareManagerUI.Services.Http; + +public class HttpService : IHttpService +{ + private readonly string _apiKey; + + public HttpService(IConfiguration configuration) + { + _apiKey = configuration.GetValue("ApiKey") ?? "NoKey"; + } + + public async Task GetAsync(string uri, IDictionary headers = null) + { + using var httpClient = new HttpClient(); + var request = new HttpRequestMessage(HttpMethod.Get, uri); + AddHeaders(request, headers); + + var response = await httpClient.SendAsync(request); + + var responseContent = await response.Content.ReadAsStringAsync(); + return JsonSerializer.Deserialize( + responseContent, new JsonSerializerOptions { PropertyNameCaseInsensitive = true }); + } + + public async Task GetByIdAsync(string uri, int id, IDictionary headers = null) + { + return await GetAsync($"{uri}/{id}", headers); + } + + public async Task PostAsync(string uri, object data, IDictionary headers = null) + { + using var httpClient = new HttpClient(); + var request = new HttpRequestMessage(HttpMethod.Post, uri); + AddHeaders(request, headers); + request.Content = new StringContent(JsonSerializer.Serialize(data), Encoding.UTF8, "application/json"); + + var response = await httpClient.SendAsync(request); + + var responseContent = await response.Content.ReadAsStringAsync(); + return JsonSerializer.Deserialize( + responseContent, new JsonSerializerOptions { PropertyNameCaseInsensitive = true }); + } + + public async Task PutAsync(string uri, int id, object data, IDictionary headers = null) + { + using var httpClient = new HttpClient(); + var request = new HttpRequestMessage(HttpMethod.Put, $"{uri}/{id}"); + AddHeaders(request, headers); + request.Content = new StringContent(JsonSerializer.Serialize(data), Encoding.UTF8, "application/json"); + + var response = await httpClient.SendAsync(request); + + var responseContent = await response.Content.ReadAsStringAsync(); + return JsonSerializer.Deserialize( + responseContent, new JsonSerializerOptions { PropertyNameCaseInsensitive = true }); + } + + public async Task DeleteAsync(string uri, int id, IDictionary headers = null) + { + using var httpClient = new HttpClient(); + var request = new HttpRequestMessage(HttpMethod.Delete, $"{uri}/{id}"); + AddHeaders(request, headers); + + var response = await httpClient.SendAsync(request); + } + + private void AddHeaders(HttpRequestMessage request, IDictionary headers) + { + // Add the API key header to every request + request.Headers.Add("ApiKey", _apiKey); + + if (headers != null) + { + foreach (var header in headers) + { + request.Headers.Add(header.Key, header.Value); + } + } + } +} \ No newline at end of file diff --git a/frontend/HealthcareManagerUI/appsettings.json b/frontend/HealthcareManagerUI/appsettings.json new file mode 100644 index 0000000..bb3dc9e --- /dev/null +++ b/frontend/HealthcareManagerUI/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*", + "ApiKey": "testapikey" +} diff --git a/frontend/HealthcareManagerUI/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs b/frontend/HealthcareManagerUI/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs new file mode 100644 index 0000000..2217181 --- /dev/null +++ b/frontend/HealthcareManagerUI/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")] diff --git a/frontend/HealthcareManagerUI/obj/Debug/net8.0/HealthcareManagerUI.AssemblyInfo.cs b/frontend/HealthcareManagerUI/obj/Debug/net8.0/HealthcareManagerUI.AssemblyInfo.cs new file mode 100644 index 0000000..0a99099 --- /dev/null +++ b/frontend/HealthcareManagerUI/obj/Debug/net8.0/HealthcareManagerUI.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("HealthcareManagerUI")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+90604e48ae9f78fa417a446c05f7759001447de5")] +[assembly: System.Reflection.AssemblyProductAttribute("HealthcareManagerUI")] +[assembly: System.Reflection.AssemblyTitleAttribute("HealthcareManagerUI")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/frontend/HealthcareManagerUI/obj/Debug/net8.0/HealthcareManagerUI.AssemblyInfoInputs.cache b/frontend/HealthcareManagerUI/obj/Debug/net8.0/HealthcareManagerUI.AssemblyInfoInputs.cache new file mode 100644 index 0000000..efb4335 --- /dev/null +++ b/frontend/HealthcareManagerUI/obj/Debug/net8.0/HealthcareManagerUI.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +ab066e9096346068223b71b3fe69040bd32f1c1da8d97eddb6a2399e719e2e24 diff --git a/frontend/HealthcareManagerUI/obj/Debug/net8.0/HealthcareManagerUI.GeneratedMSBuildEditorConfig.editorconfig b/frontend/HealthcareManagerUI/obj/Debug/net8.0/HealthcareManagerUI.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..1be4fa8 --- /dev/null +++ b/frontend/HealthcareManagerUI/obj/Debug/net8.0/HealthcareManagerUI.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,47 @@ +is_global = true +build_property.TargetFramework = net8.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = true +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = HealthcareManagerUI +build_property.RootNamespace = HealthcareManagerUI +build_property.ProjectDir = C:\Users\Andrei Cerbu\Documents\FACULTATE\CC-FinalProj\frontend\HealthcareManagerUI\ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.RazorLangVersion = 8.0 +build_property.SupportLocalizedComponentNames = +build_property.GenerateRazorMetadataSourceChecksumAttributes = +build_property.MSBuildProjectDirectory = C:\Users\Andrei Cerbu\Documents\FACULTATE\CC-FinalProj\frontend\HealthcareManagerUI +build_property._RazorSourceGeneratorDebug = + +[C:/Users/Andrei Cerbu/Documents/FACULTATE/CC-FinalProj/frontend/HealthcareManagerUI/Components/Layout/AuthLayout.razor] +build_metadata.AdditionalFiles.TargetPath = Q29tcG9uZW50c1xMYXlvdXRcQXV0aExheW91dC5yYXpvcg== +build_metadata.AdditionalFiles.CssScope = + +[C:/Users/Andrei Cerbu/Documents/FACULTATE/CC-FinalProj/frontend/HealthcareManagerUI/Components/Pages/AlertMessage.razor] +build_metadata.AdditionalFiles.TargetPath = Q29tcG9uZW50c1xQYWdlc1xBbGVydE1lc3NhZ2UucmF6b3I= +build_metadata.AdditionalFiles.CssScope = + +[C:/Users/Andrei Cerbu/Documents/FACULTATE/CC-FinalProj/frontend/HealthcareManagerUI/Components/Pages/ChooseRolePage.razor] +build_metadata.AdditionalFiles.TargetPath = Q29tcG9uZW50c1xQYWdlc1xDaG9vc2VSb2xlUGFnZS5yYXpvcg== +build_metadata.AdditionalFiles.CssScope = + +[C:/Users/Andrei Cerbu/Documents/FACULTATE/CC-FinalProj/frontend/HealthcareManagerUI/Components/Pages/DashboardPage.razor] +build_metadata.AdditionalFiles.TargetPath = Q29tcG9uZW50c1xQYWdlc1xEYXNoYm9hcmRQYWdlLnJhem9y +build_metadata.AdditionalFiles.CssScope = + +[C:/Users/Andrei Cerbu/Documents/FACULTATE/CC-FinalProj/frontend/HealthcareManagerUI/Components/Pages/LoginPage.razor] +build_metadata.AdditionalFiles.TargetPath = Q29tcG9uZW50c1xQYWdlc1xMb2dpblBhZ2UucmF6b3I= +build_metadata.AdditionalFiles.CssScope = + +[C:/Users/Andrei Cerbu/Documents/FACULTATE/CC-FinalProj/frontend/HealthcareManagerUI/Components/Pages/RegisterPage.razor] +build_metadata.AdditionalFiles.TargetPath = Q29tcG9uZW50c1xQYWdlc1xSZWdpc3RlclBhZ2UucmF6b3I= +build_metadata.AdditionalFiles.CssScope = + +[C:/Users/Andrei Cerbu/Documents/FACULTATE/CC-FinalProj/frontend/HealthcareManagerUI/Components/Pages/ResetPasswordPage.razor] +build_metadata.AdditionalFiles.TargetPath = Q29tcG9uZW50c1xQYWdlc1xSZXNldFBhc3N3b3JkUGFnZS5yYXpvcg== +build_metadata.AdditionalFiles.CssScope = diff --git a/frontend/HealthcareManagerUI/obj/Debug/net8.0/HealthcareManagerUI.GlobalUsings.g.cs b/frontend/HealthcareManagerUI/obj/Debug/net8.0/HealthcareManagerUI.GlobalUsings.g.cs new file mode 100644 index 0000000..025530a --- /dev/null +++ b/frontend/HealthcareManagerUI/obj/Debug/net8.0/HealthcareManagerUI.GlobalUsings.g.cs @@ -0,0 +1,17 @@ +// +global using global::Microsoft.AspNetCore.Builder; +global using global::Microsoft.AspNetCore.Hosting; +global using global::Microsoft.AspNetCore.Http; +global using global::Microsoft.AspNetCore.Routing; +global using global::Microsoft.Extensions.Configuration; +global using global::Microsoft.Extensions.DependencyInjection; +global using global::Microsoft.Extensions.Hosting; +global using global::Microsoft.Extensions.Logging; +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Net.Http.Json; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/frontend/HealthcareManagerUI/obj/Debug/net8.0/HealthcareManagerUI.assets.cache b/frontend/HealthcareManagerUI/obj/Debug/net8.0/HealthcareManagerUI.assets.cache new file mode 100644 index 0000000..b0a496c Binary files /dev/null and b/frontend/HealthcareManagerUI/obj/Debug/net8.0/HealthcareManagerUI.assets.cache differ diff --git a/frontend/HealthcareManagerUI/obj/HealthcareManagerUI.csproj.nuget.dgspec.json b/frontend/HealthcareManagerUI/obj/HealthcareManagerUI.csproj.nuget.dgspec.json new file mode 100644 index 0000000..7d16c51 --- /dev/null +++ b/frontend/HealthcareManagerUI/obj/HealthcareManagerUI.csproj.nuget.dgspec.json @@ -0,0 +1,64 @@ +{ + "format": 1, + "restore": { + "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\frontend\\HealthcareManagerUI\\HealthcareManagerUI.csproj": {} + }, + "projects": { + "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\frontend\\HealthcareManagerUI\\HealthcareManagerUI.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\frontend\\HealthcareManagerUI\\HealthcareManagerUI.csproj", + "projectName": "HealthcareManagerUI", + "projectPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\frontend\\HealthcareManagerUI\\HealthcareManagerUI.csproj", + "packagesPath": "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\", + "outputPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\frontend\\HealthcareManagerUI\\obj\\", + "projectStyle": "PackageReference", + "configFilePaths": [ + "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config" + ], + "originalTargetFrameworks": [ + "net8.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.AspNetCore.App": { + "privateAssets": "none" + }, + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/frontend/HealthcareManagerUI/obj/HealthcareManagerUI.csproj.nuget.g.props b/frontend/HealthcareManagerUI/obj/HealthcareManagerUI.csproj.nuget.g.props new file mode 100644 index 0000000..53ed97d --- /dev/null +++ b/frontend/HealthcareManagerUI/obj/HealthcareManagerUI.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\Andrei Cerbu\.nuget\packages\ + PackageReference + 6.9.1 + + + + + \ No newline at end of file diff --git a/frontend/HealthcareManagerUI/obj/HealthcareManagerUI.csproj.nuget.g.targets b/frontend/HealthcareManagerUI/obj/HealthcareManagerUI.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/frontend/HealthcareManagerUI/obj/HealthcareManagerUI.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/frontend/HealthcareManagerUI/obj/project.assets.json b/frontend/HealthcareManagerUI/obj/project.assets.json new file mode 100644 index 0000000..8ed0171 --- /dev/null +++ b/frontend/HealthcareManagerUI/obj/project.assets.json @@ -0,0 +1,69 @@ +{ + "version": 3, + "targets": { + "net8.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net8.0": [] + }, + "packageFolders": { + "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\frontend\\HealthcareManagerUI\\HealthcareManagerUI.csproj", + "projectName": "HealthcareManagerUI", + "projectPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\frontend\\HealthcareManagerUI\\HealthcareManagerUI.csproj", + "packagesPath": "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\", + "outputPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\frontend\\HealthcareManagerUI\\obj\\", + "projectStyle": "PackageReference", + "configFilePaths": [ + "C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config" + ], + "originalTargetFrameworks": [ + "net8.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.AspNetCore.App": { + "privateAssets": "none" + }, + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/frontend/HealthcareManagerUI/obj/project.nuget.cache b/frontend/HealthcareManagerUI/obj/project.nuget.cache new file mode 100644 index 0000000..91fd7be --- /dev/null +++ b/frontend/HealthcareManagerUI/obj/project.nuget.cache @@ -0,0 +1,8 @@ +{ + "version": 2, + "dgSpecHash": "yH4Q+LkO2CE3MznIcrlPS+taSI2XBcgBj6avLnffpxmFkD9ND0vvFtGynswKrmhXXjk04hrPG4LlIo3zuh86UA==", + "success": true, + "projectFilePath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\frontend\\HealthcareManagerUI\\HealthcareManagerUI.csproj", + "expectedPackageFiles": [], + "logs": [] +} \ No newline at end of file diff --git a/frontend/HealthcareManagerUI/obj/project.packagespec.json b/frontend/HealthcareManagerUI/obj/project.packagespec.json new file mode 100644 index 0000000..027640e --- /dev/null +++ b/frontend/HealthcareManagerUI/obj/project.packagespec.json @@ -0,0 +1 @@ +"restore":{"projectUniqueName":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\frontend\\HealthcareManagerUI\\HealthcareManagerUI.csproj","projectName":"HealthcareManagerUI","projectPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\frontend\\HealthcareManagerUI\\HealthcareManagerUI.csproj","outputPath":"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\frontend\\HealthcareManagerUI\\obj\\","projectStyle":"PackageReference","originalTargetFrameworks":["net8.0"],"sources":{"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net8.0":{"targetAlias":"net8.0","projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]}}"frameworks":{"net8.0":{"targetAlias":"net8.0","imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.AspNetCore.App":{"privateAssets":"none"},"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Users\\Andrei Cerbu\\.dotnet\\sdk\\8.0.203/PortableRuntimeIdentifierGraph.json"}} \ No newline at end of file diff --git a/frontend/HealthcareManagerUI/obj/rider.project.model.nuget.info b/frontend/HealthcareManagerUI/obj/rider.project.model.nuget.info new file mode 100644 index 0000000..a303ec1 --- /dev/null +++ b/frontend/HealthcareManagerUI/obj/rider.project.model.nuget.info @@ -0,0 +1 @@ +17125382441830168 \ No newline at end of file diff --git a/frontend/HealthcareManagerUI/obj/rider.project.restore.info b/frontend/HealthcareManagerUI/obj/rider.project.restore.info new file mode 100644 index 0000000..15cb1a1 --- /dev/null +++ b/frontend/HealthcareManagerUI/obj/rider.project.restore.info @@ -0,0 +1 @@ +17125721198365815 \ No newline at end of file diff --git a/frontend/HealthcareManagerUI/wwwroot/AuthLayout.css b/frontend/HealthcareManagerUI/wwwroot/AuthLayout.css new file mode 100644 index 0000000..d90a803 --- /dev/null +++ b/frontend/HealthcareManagerUI/wwwroot/AuthLayout.css @@ -0,0 +1,71 @@ +body, html { + height: 100%; + width: 100%; + margin: 0; + padding: 0; + overflow: hidden; /* Prevents scrolling caused by the absolute positioning */ +} + +body { + font-family: "Roboto", sans-serif; + font-weight: 500; + font-style: normal; + position: relative; + z-index: 0; /* Ensures the background is under the content */ + +} + +.background { + position: absolute; + top: -5%; + left: -5%; + width: 110%; + height: 110%; + background-image: url(background_image.jpg); + background-size: cover; + background-repeat: no-repeat; + filter: brightness(50%) blur(5px); + z-index: -1; /* Keeps it below the content */ +} + +.container { + z-index: 1; +} + +/* New styles for title and subtitle */ +.landingTitle { + color: #ffffff; + text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7); + font-size: 3.5rem; + font-weight: bold; + background: rgba(255, 255, 255, 0.2); + padding: 0.5rem; + border-radius: 0.5rem; + display: inline-block; /* Wrap the background to the text */ + margin-top: 2rem; /* Give some space from the top */ +} + +.landingSubtitle { + color: #dcdcdc; + text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5); + font-size: 2rem; + padding: 0.25rem; + border-radius: 0.5rem; + display: block; /* Wrap the background to the text */ + margin-bottom: 2rem; /* Give some space before the buttons */ +} + +.centered-menu { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 100vh; + text-align: center; +} + +.button-container { + display: flex; + flex-direction: row; /* This will align the buttons side by side */ + justify-content: center; /* Center the buttons within the container */ +} diff --git a/frontend/HealthcareManagerUI/wwwroot/LoginPage.css b/frontend/HealthcareManagerUI/wwwroot/LoginPage.css new file mode 100644 index 0000000..a4410da --- /dev/null +++ b/frontend/HealthcareManagerUI/wwwroot/LoginPage.css @@ -0,0 +1,82 @@ +.form { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + width: 20%; + height: auto; + + color: white; + background: #095d7e; + border-radius: 10px; + + padding: 2rem; +} + +h1, h2, h3 { + margin: 0; + padding: 0; +} + +.header hr { + width: 15vw; +} + +.header { + display: flex; + flex-direction: column; + align-content: center; + justify-content: center; + + font-size: 1.5rem; + + text-align: center; + margin: 0 0 1rem 0; +} + +.content { + display: flex; + flex-wrap: wrap; + flex-direction: column; + justify-content: center; + align-content: center; +} + +.footer { + display: flex; + flex-wrap: wrap; + justify-content: center; + align-content: center; + align-items: center; + + margin: 1rem 0 0 0; +} + +input { + text-align: center; + color: white; + font-weight: bold; + font-size: 1.2rem; + width: 70%; + padding: 1rem; + margin: 0.7rem; + border-radius: 10px; +} + +button { + font-weight: bold; + + padding: 0.5rem 3rem 0.5rem 3rem; + + font-size: 1rem; + border: none; + border-radius: 5px; + cursor: pointer; +} + +button[name="submit"] { + background-color: #F44336; + color: white; +} +