This commit is contained in:
andrei-mihnea-cerbu
2024-04-08 00:03:24 +03:00
parent 2ccec617a5
commit b48d5ee19e
168 changed files with 2877 additions and 1146 deletions
+1
View File
@@ -4,6 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>API</RootNamespace>
</PropertyGroup>
<ItemGroup>
@@ -10,5 +10,4 @@ public class ChatController : BaseApiController
{
_mongoDbService = mongoDbService;
}
}
+44 -81
View File
@@ -1,117 +1,80 @@
using Microsoft.AspNetCore.Mvc;
using Core.Entities;
using Application.Endpoints;
using Application.Endpoints.Doctors.Login;
using Application.Services.Database;
using Application.Endpoints.Doctors.Profile;
using Application.Endpoints.Doctors.Registration;
using Application.Endpoints.Doctors.ResetPassword;
using Application.Endpoints.Doctors.Profile;
using Application.Services.Database;
using Application.Services.HashingAlgorithms;
using Microsoft.AspNetCore.Mvc;
namespace HealthcareManager.API.Controllers;
namespace API.Controllers;
[ApiController]
[Route("api/[controller]")]
public class DoctorsController : ControllerBase
{
private readonly IDoctorRepository _database;
private readonly IHashingAlgorithms _hashingAlgorithms;
public DoctorsController(IDoctorRepository database)
public DoctorsController(IDoctorRepository database, IHashingAlgorithms hashingAlgorithms)
{
_database = database ?? throw new ArgumentNullException(nameof(database));
}
[HttpGet]
public async Task<ActionResult<Doctor>> GetAllDoctors()
{
var handler = new DoctorProfileHandler(_database);
var response = await handler.HandleGetAll();
if (!response.Success)
{
return BadRequest(response);
}
return Ok(response.Data);
}
[HttpGet("{id}")]
public async Task<ActionResult<Doctor>> GetDoctor(Guid id)
{
var handler = new DoctorProfileHandler(_database);
var response = await handler.HandleGet(id);
if (!response.Success)
{
return BadRequest(response);
}
return Ok(response.Data);
}
[HttpPost("login")]
public async Task<ActionResult<Doctor>> Login(DoctorLoginDTO doctor)
{
var handler = new DoctorLoginHandler(_database);
var response = await handler.Handle(doctor).ConfigureAwait(false);
if(!response.Success)
{
return Unauthorized(response);
}
return Ok(response);
_database = database;
_hashingAlgorithms = hashingAlgorithms;
}
[HttpPost("register")]
public async Task<ActionResult<Doctor>> Register(DoctorRegistrationDto doctor)
public async Task<ActionResult<BaseResponse>> Register(DoctorRegistrationDto doctor)
{
var handler = new DoctorRegistrationHandler(_database);
var handler = new DoctorRegistrationHandler(_database, _hashingAlgorithms);
var response = await handler.Handle(doctor).ConfigureAwait(false);
if (!response.Success)
{
return Unauthorized(response);
return StatusCode(response.StatusCode, response);
}
return Ok(response);
[HttpPost("login")]
public async Task<ActionResult<BaseResponse>> Login(DoctorLoginDto doctor)
{
var handler = new DoctorLoginHandler(_database, _hashingAlgorithms);
var response = await handler.Handle(doctor).ConfigureAwait(false);
return StatusCode(response.StatusCode, response);
}
[HttpPost("resetPassword")]
public async Task<IActionResult> ResetPassword(DoctorLoginDTO resetDoctorDto)
[HttpPost("reset_password")]
public async Task<ActionResult<BaseResponse>> ResetPassword(DoctorResetPasswordDto resetDoctorDto)
{
var handler = new DoctorResetPasswordHandler(_database);
var handler = new DoctorResetPasswordHandler(_database, _hashingAlgorithms);
var response = await handler.Handle(resetDoctorDto).ConfigureAwait(false);
if (response.Success)
{
return Ok(response);
return StatusCode(response.StatusCode, response);
}
return BadRequest(response);
[HttpGet]
public async Task<ActionResult<BaseResponse>> GetAllDoctors()
{
var handler = new DoctorProfileHandler(_database, _hashingAlgorithms);
var response = await handler.HandleGetAll();
return StatusCode(response.StatusCode, response);
}
[HttpPut("{id}/profile")]
public async Task<IActionResult> UpdateDoctorProfile(Guid id, [FromBody]DoctorProfileDTO doctorDto)
[HttpGet("{id}")]
public async Task<ActionResult<BaseResponse>> GetDoctor(Guid id)
{
var handler = new DoctorProfileHandler(_database);
var response = await handler.HandleUpdate(id, doctorDto).ConfigureAwait(false);
if (response.Success)
{
return Ok(response);
var handler = new DoctorProfileHandler(_database, _hashingAlgorithms);
var response = await handler.HandleGet(id);
return StatusCode(response.StatusCode, response);
}
return BadRequest(response);
[HttpPut]
public async Task<ActionResult<BaseResponse>> UpdateDoctorProfile(DoctorProfileUpdateDto doctorUpdateDto)
{
var handler = new DoctorProfileHandler(_database, _hashingAlgorithms);
var response = await handler.HandleUpdate(doctorUpdateDto).ConfigureAwait(false);
return StatusCode(response.StatusCode, response);
}
[HttpDelete("{id}/profile")]
public async Task<IActionResult> DeleteDoctorProfile(Guid id)
[HttpDelete("{id}")]
public async Task<ActionResult<BaseResponse>> DeleteDoctorProfile(Guid id)
{
var handler = new DoctorProfileHandler(_database);
var handler = new DoctorProfileHandler(_database, _hashingAlgorithms);
var response = await handler.HandleDelete(id).ConfigureAwait(false);
if (response.Success)
{
return NoContent();
}
return BadRequest(response);
return StatusCode(response.StatusCode, response);
}
}
@@ -1,67 +1,71 @@
using Application.Endpoints.MedicalHistories;
using Application.Endpoints;
using Application.Endpoints.MedicalHistories;
using Application.Services.Database;
using Core.Entities;
using Microsoft.AspNetCore.Mvc;
namespace HealthcareManager.API.Controllers;
namespace API.Controllers;
[ApiController]
[Route("api/[controller]")]
public class MedicalHistoryController : ControllerBase
{
private readonly IMedicalHistoryRepository _medicalHistoryRepository;
private readonly IPacientRepository _pacientRepository;
private readonly IMongoDbService _mongoDbService;
private readonly IPatientRepository _patientRepository;
public MedicalHistoryController(IMedicalHistoryRepository medicalHistoryRepository, IPacientRepository pacientRepository)
public MedicalHistoryController(IMedicalHistoryRepository medicalHistoryRepository,
IPatientRepository patientRepository, IMongoDbService mongoDbService)
{
_medicalHistoryRepository = medicalHistoryRepository ?? throw new ArgumentNullException(nameof(medicalHistoryRepository));
_pacientRepository = pacientRepository ?? throw new ArgumentNullException(nameof(pacientRepository));
_medicalHistoryRepository = medicalHistoryRepository;
_patientRepository = patientRepository;
_mongoDbService = mongoDbService;
}
[HttpGet("{id}")]
public async Task<ActionResult<MedicalHistory>> GetAsync(Guid id)
public async Task<ActionResult<BaseResponse>> GetAsync(Guid id)
{
var handler = new MedicalHistoryHandler(_medicalHistoryRepository, _pacientRepository);
var handler = new MedicalHistoryHandler(_medicalHistoryRepository, _patientRepository, _mongoDbService);
var response = await handler.HandleGet(id);
if (!response.Success)
return StatusCode(response.StatusCode, response);
}
[HttpGet]
public async Task<ActionResult<BaseResponse>> GetAllDoctors()
{
return BadRequest(response);
var handler = new MedicalHistoryHandler(_medicalHistoryRepository, _patientRepository, _mongoDbService);
var response = await handler.HandleGetAll();
return StatusCode(response.StatusCode, response);
}
return Ok(response.Data);
}
[HttpPost("{id}")]
public async Task<ActionResult<MedicalHistory>> PostAsync(Guid id, [FromBody] byte[] description)
[HttpPost]
public async Task<ActionResult<BaseResponse>> PostAsync(MedicalHistoryCreateDto medicalHistoryCreateDto)
{
var handler = new MedicalHistoryHandler(_medicalHistoryRepository, _pacientRepository);
var response = await handler.HandleCreate(id, description).ConfigureAwait(false);
var handler = new MedicalHistoryHandler(_medicalHistoryRepository, _patientRepository, _mongoDbService);
var response = await handler.HandleCreate(medicalHistoryCreateDto);
return StatusCode(response.StatusCode, response);
}
if (!response.Success)
[HttpPut]
public async Task<ActionResult<BaseResponse>> UpdateAsync(MedicalHistoryUpdateDto medicalHistoryUpdateDto)
{
return Unauthorized(response);
var handler = new MedicalHistoryHandler(_medicalHistoryRepository, _patientRepository, _mongoDbService);
var response = await handler.HandleUpdate(medicalHistoryUpdateDto).ConfigureAwait(false);
return StatusCode(response.StatusCode, response);
}
return Ok(response);
}
[HttpPut("{id}")]
public async Task<IActionResult> UpdateAsync(Guid id, [FromBody] MedicalHistoryDTO medicalHistoryDTO)
[HttpDelete("{id}")]
public async Task<ActionResult<BaseResponse>> DeleteAsync(Guid id)
{
var handler = new MedicalHistoryHandler(_medicalHistoryRepository, _pacientRepository);
var response = await handler.HandleUpdate(id, medicalHistoryDTO).ConfigureAwait(false);
if (response.Success)
{
return Ok(response);
}
return BadRequest(response);
var handler = new MedicalHistoryHandler(_medicalHistoryRepository, _patientRepository, _mongoDbService);
var response = await handler.HandleDelete(id);
return StatusCode(response.StatusCode, response);
}
/*
[HttpPut("grant_access")]
public async Task<IActionResult> GrantAccessToMedicalHistory(Guid id)
public async Task<ActionResult<BaseResponse>> GrantAccessToMedicalHistory(GrantAccessMedicalHistoryDto)
{
return NotFound();
}
*/
}
@@ -1,117 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using Core.Entities;
using Application.Endpoints.Pacients.Login;
using Application.Services.Database;
using Application.Endpoints.Pacients.Registration;
using Application.Endpoints.Pacients.ResetPassword;
using Application.Endpoints.Pacients.Profile;
namespace HealthcareManager.API.Controllers;
[ApiController]
[Route("api/[controller]")]
public class PacientsController : ControllerBase
{
private readonly IPacientRepository _database;
public PacientsController(IPacientRepository database)
{
_database = database ?? throw new ArgumentNullException(nameof(database));
}
[HttpGet]
public async Task<ActionResult<Pacient>> GetAllPacients()
{
var handler = new PacientProfileHandler(_database);
var response = await handler.HandleGetAll();
if (!response.Success)
{
return BadRequest(response);
}
return Ok(response.Data);
}
[HttpGet("{id}")]
public async Task<ActionResult<Pacient>> GetPacient(Guid id)
{
var handler = new PacientProfileHandler(_database);
var response = await handler.HandleGet(id);
if (!response.Success)
{
return BadRequest(response);
}
return Ok(response.Data);
}
[HttpPost("login")]
public async Task<ActionResult<Pacient>> Login(PacientLoginDTO pacient)
{
var handler = new PacientLoginHandler(_database);
var response = await handler.Handle(pacient).ConfigureAwait(false);
if (!response.Success)
{
return Unauthorized(response);
}
return Ok(response);
}
[HttpPost("register")]
public async Task<ActionResult<Pacient>> Register(PacientRegistrationDto pacient)
{
var handler = new PacientRegistrationHandler(_database);
var response = await handler.Handle(pacient).ConfigureAwait(false);
if (!response.Success)
{
return Unauthorized(response);
}
return Ok(response);
}
[HttpPost("resetPassword")]
public async Task<IActionResult> ResetPassword(PacientLoginDTO resetPacientDto)
{
var handler = new PacientResetPasswordHandler(_database);
var response = await handler.Handle(resetPacientDto).ConfigureAwait(false);
if (response.Success)
{
return Ok(response);
}
return BadRequest(response);
}
[HttpPut("{id}/profile")]
public async Task<IActionResult> UpdatePacientProfile(Guid id, [FromBody] PacientProfileDTO pacientDto)
{
var handler = new PacientProfileHandler(_database);
var response = await handler.HandleUpdate(id, pacientDto).ConfigureAwait(false);
if (response.Success)
{
return Ok(response);
}
return BadRequest(response);
}
[HttpDelete("{id}/profile")]
public async Task<IActionResult> DeletePacientProfile(Guid id)
{
var handler = new PacientProfileHandler(_database);
var response = await handler.HandleDelete(id).ConfigureAwait(false);
if (response.Success)
{
return NoContent();
}
return BadRequest(response);
}
}
@@ -0,0 +1,80 @@
using Application.Endpoints;
using Application.Endpoints.Patients.Login;
using Application.Endpoints.Patients.Profile;
using Application.Endpoints.Patients.Registration;
using Application.Endpoints.Patients.ResetPassword;
using Application.Services.Database;
using Application.Services.HashingAlgorithms;
using Microsoft.AspNetCore.Mvc;
namespace API.Controllers;
[ApiController]
[Route("api/[controller]")]
public class PatientsController : ControllerBase
{
private readonly IHashingAlgorithms _hashingAlgorithms;
private readonly IPatientRepository _patientRepository;
public PatientsController(IPatientRepository patientRepository, IHashingAlgorithms hashingAlgorithms)
{
_patientRepository = patientRepository;
_hashingAlgorithms = hashingAlgorithms;
}
[HttpGet]
public async Task<ActionResult<BaseResponse>> GetAllPatients()
{
var handler = new PatientProfileHandler(_patientRepository, _hashingAlgorithms);
var response = await handler.HandleGetAll();
return StatusCode(response.StatusCode, response);
}
[HttpGet("{id}")]
public async Task<ActionResult<BaseResponse>> GetPatient(Guid id)
{
var handler = new PatientProfileHandler(_patientRepository, _hashingAlgorithms);
var response = await handler.HandleGet(id);
return StatusCode(response.StatusCode, response);
}
[HttpPost("login")]
public async Task<ActionResult<BaseResponse>> Login(PatientLoginDto patientLoginDto)
{
var handler = new PatientLoginHandler(_patientRepository);
var response = await handler.Handle(patientLoginDto).ConfigureAwait(false);
return StatusCode(response.StatusCode, response);
}
[HttpPost("register")]
public async Task<ActionResult<BaseResponse>> Register(PatientRegistrationDto patientRegistrationDto)
{
var handler = new PatientRegistrationHandler(_patientRepository, _hashingAlgorithms);
var response = await handler.Handle(patientRegistrationDto).ConfigureAwait(false);
return StatusCode(response.StatusCode, response);
}
[HttpPost("reset_password")]
public async Task<ActionResult<BaseResponse>> ResetPassword(PatientResetPasswordDto patientResetPasswordDto)
{
var handler = new PatientResetPasswordHandler(_patientRepository, _hashingAlgorithms);
var response = await handler.Handle(patientResetPasswordDto).ConfigureAwait(false);
return StatusCode(response.StatusCode, response);
}
[HttpPut]
public async Task<ActionResult<BaseResponse>> UpdatePatientProfile(PatientProfileDto patientDto)
{
var handler = new PatientProfileHandler(_patientRepository, _hashingAlgorithms);
var response = await handler.HandleUpdate(patientDto).ConfigureAwait(false);
return StatusCode(response.StatusCode, response);
}
[HttpDelete("{id}")]
public async Task<ActionResult<BaseResponse>> DeletePatientProfile(Guid id)
{
var handler = new PatientProfileHandler(_patientRepository, _hashingAlgorithms);
var response = await handler.HandleDelete(id).ConfigureAwait(false);
return StatusCode(response.StatusCode, response);
}
}
@@ -2,8 +2,8 @@
public class ApiKeyValidationMiddleware
{
private readonly RequestDelegate _next;
private const string APIKEYNAME = "ApiKey";
private readonly RequestDelegate _next;
public ApiKeyValidationMiddleware(RequestDelegate next)
{
@@ -17,7 +17,7 @@ public class BodyCheckMiddleware(RequestDelegate next)
var buffer = new byte[Convert.ToInt32(context.Request.ContentLength)];
await context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
string requestBody = Encoding.UTF8.GetString(buffer);
var requestBody = Encoding.UTF8.GetString(buffer);
context.Request.Body.Seek(0, SeekOrigin.Begin); // Reset the stream for next middleware
// Check if the body is empty
@@ -32,4 +32,3 @@ public class BodyCheckMiddleware(RequestDelegate next)
await _next(context);
}
}
+2 -5
View File
@@ -20,7 +20,7 @@ builder.Services.AddSwaggerGen(c =>
In = ParameterLocation.Header,
Scheme = "ApiKeyScheme"
});
var key = new OpenApiSecurityScheme()
var key = new OpenApiSecurityScheme
{
Reference = new OpenApiReference
{
@@ -66,8 +66,5 @@ app.Run();
static void EnsureDatabaseCreated(HealthcareManagerDatabase dbContext)
{
// Checking for pending migrations is more efficient than applying migrations unconditionally
if (dbContext.Database.GetPendingMigrations().Any())
{
dbContext.Database.Migrate();
}
if (dbContext.Database.GetPendingMigrations().Any()) dbContext.Database.Migrate();
}
-1
View File
@@ -9,7 +9,6 @@
"HealthcareManagerDatabase": "Host=surus.db.elephantsql.com;Database=newbwuyu;Username=newbwuyu;Password=0end9Ixqo9PeTE4HVslX7_FVwruEhFf-;",
"MongoDBDatabase": "mongodb+srv://andrei_cerbu:andrei_cerbu@cluster0.v80skg6.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0"
},
"AllowedHosts": "*",
"ApiKey": "testapikey"
}
+12 -9
View File
@@ -77,15 +77,15 @@
}
},
"Microsoft.EntityFrameworkCore.Analyzers/8.0.3": {},
"Microsoft.EntityFrameworkCore.Relational/8.0.2": {
"Microsoft.EntityFrameworkCore.Relational/8.0.3": {
"dependencies": {
"Microsoft.EntityFrameworkCore": "8.0.3",
"Microsoft.Extensions.Configuration.Abstractions": "8.0.0"
},
"runtime": {
"lib/net8.0/Microsoft.EntityFrameworkCore.Relational.dll": {
"assemblyVersion": "8.0.2.0",
"fileVersion": "8.0.224.6803"
"assemblyVersion": "8.0.3.0",
"fileVersion": "8.0.324.11510"
}
}
},
@@ -285,7 +285,7 @@
"dependencies": {
"Microsoft.EntityFrameworkCore": "8.0.3",
"Microsoft.EntityFrameworkCore.Abstractions": "8.0.3",
"Microsoft.EntityFrameworkCore.Relational": "8.0.2",
"Microsoft.EntityFrameworkCore.Relational": "8.0.3",
"Npgsql": "8.0.2"
},
"runtime": {
@@ -375,7 +375,9 @@
},
"Application/1.0.0": {
"dependencies": {
"FluentValidation": "11.9.0"
"Core": "1.0.0",
"FluentValidation": "11.9.0",
"MongoDB.Driver": "2.24.0"
},
"runtime": {
"Application.dll": {}
@@ -394,6 +396,7 @@
"Application": "1.0.0",
"Core": "1.0.0",
"Microsoft.EntityFrameworkCore": "8.0.3",
"Microsoft.EntityFrameworkCore.Relational": "8.0.3",
"Microsoft.Extensions.Configuration": "8.0.0",
"Microsoft.Extensions.Configuration.Json": "8.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "8.0.0",
@@ -461,12 +464,12 @@
"path": "microsoft.entityframeworkcore.analyzers/8.0.3",
"hashPath": "microsoft.entityframeworkcore.analyzers.8.0.3.nupkg.sha512"
},
"Microsoft.EntityFrameworkCore.Relational/8.0.2": {
"Microsoft.EntityFrameworkCore.Relational/8.0.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-NoGfcq2OPw0z8XAPf74YFwGlTKjedWdsIEJqq4SvKcPjcu+B+/XDDNrDRxTvILfz4Ug8POSF49s1jz1JvUqTAg==",
"path": "microsoft.entityframeworkcore.relational/8.0.2",
"hashPath": "microsoft.entityframeworkcore.relational.8.0.2.nupkg.sha512"
"sha512": "sha512-8JnVZHWaNFkrrD/FC0O4jekiHIYey8y6TQ4Co3OzLz0wd5Dm1cwJfTp++1TvaVu0BBd4bVDtiktppa5epuoPrA==",
"path": "microsoft.entityframeworkcore.relational/8.0.3",
"hashPath": "microsoft.entityframeworkcore.relational.8.0.3.nupkg.sha512"
},
"Microsoft.Extensions.ApiDescription.Server/6.0.5": {
"type": "package",
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -9,6 +9,6 @@
"HealthcareManagerDatabase": "Host=surus.db.elephantsql.com;Database=newbwuyu;Username=newbwuyu;Password=0end9Ixqo9PeTE4HVslX7_FVwruEhFf-;",
"MongoDBDatabase": "mongodb+srv://andrei_cerbu:andrei_cerbu@cluster0.v80skg6.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0"
},
"AllowedHosts": "*"
"AllowedHosts": "*",
"ApiKey": "testapikey"
}
+13 -1
View File
@@ -98,7 +98,11 @@
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
"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": {
@@ -114,6 +118,10 @@
"FluentValidation": {
"target": "Package",
"version": "[11.9.0, )"
},
"MongoDB.Driver": {
"target": "Package",
"version": "[2.24.0, )"
}
},
"imports": [
@@ -250,6 +258,10 @@
"target": "Package",
"version": "[8.0.3, )"
},
"Microsoft.EntityFrameworkCore.Relational": {
"target": "Package",
"version": "[8.0.3, )"
},
"Microsoft.Extensions.Configuration": {
"target": "Package",
"version": "[8.0.0, )"
@@ -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+1206db932183801caeaefeb110af24b0147366c1")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+2ccec617a59a712428e67340dc46bebefb152aca")]
[assembly: System.Reflection.AssemblyProductAttribute("API")]
[assembly: System.Reflection.AssemblyTitleAttribute("API")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
@@ -1 +1 @@
0c139bdf077ad34598b9b50e71a3151cfc847b62ccfe6d358e4133a8470abb9c
abd09d11442616a05d74c5cf91eb2ab3a3f4e18f9d1feb34f7d619b58a9ee139
Binary file not shown.
@@ -1 +1 @@
86f413f204b6bbdb2571f35c8208d17a18ef4d7252c53266660048227508f093
3416e3272dd0e47374f982bfa273624c68a9149bad5e6bd93b7898d980bc8f46
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
{"documents":{"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\*":"https://raw.githubusercontent.com/andrei-mihnea-cerbu/CC-FinalProj/1206db932183801caeaefeb110af24b0147366c1/*"}}
{"documents":{"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\*":"https://raw.githubusercontent.com/andrei-mihnea-cerbu/CC-FinalProj/2ccec617a59a712428e67340dc46bebefb152aca/*"}}
@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("HealthcareManager.API")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+2ccec617a59a712428e67340dc46bebefb152aca")]
[assembly: System.Reflection.AssemblyProductAttribute("HealthcareManager.API")]
[assembly: System.Reflection.AssemblyTitleAttribute("HealthcareManager.API")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.
@@ -0,0 +1 @@
02a20cc73b88382df01707b6de9e61d10967067c54347b2bf3ccff89e4d0951c
@@ -0,0 +1,19 @@
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 = API
build_property.RootNamespace = API
build_property.ProjectDir = C:\Users\Andrei Cerbu\Documents\FACULTATE\CC-FinalProj\backend\HealthcareManager.API\
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\backend\HealthcareManager.API
build_property._RazorSourceGeneratorDebug =
@@ -0,0 +1,17 @@
// <auto-generated/>
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;
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,307 @@
{
"format": 1,
"restore": {
"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\HealthcareManager.API\\HealthcareManager.API.csproj": {}
},
"projects": {
"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Application\\Application.csproj": {
"version": "1.0.0",
"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",
"packagesPath": "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\",
"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"
],
"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"
}
}
},
"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\Core.csproj": {
"version": "1.0.0",
"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",
"packagesPath": "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\",
"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"
],
"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"
}
}
},
"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\HealthcareManager.API\\HealthcareManager.API.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\HealthcareManager.API\\HealthcareManager.API.csproj",
"projectName": "HealthcareManager.API",
"projectPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\HealthcareManager.API\\HealthcareManager.API.csproj",
"packagesPath": "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\",
"outputPath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\HealthcareManager.API\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\Andrei Cerbu\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"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"
}
}
},
"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Infrastructure\\Infrastructure.csproj": {
"version": "1.0.0",
"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",
"packagesPath": "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\",
"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"
],
"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"
}
}
}
}
}
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Andrei Cerbu\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.9.1</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\Andrei Cerbu\.nuget\packages\" />
</ItemGroup>
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)microsoft.extensions.apidescription.server\6.0.5\build\Microsoft.Extensions.ApiDescription.Server.props" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.apidescription.server\6.0.5\build\Microsoft.Extensions.ApiDescription.Server.props')" />
<Import Project="$(NuGetPackageRoot)swashbuckle.aspnetcore\6.5.0\build\Swashbuckle.AspNetCore.props" Condition="Exists('$(NuGetPackageRoot)swashbuckle.aspnetcore\6.5.0\build\Swashbuckle.AspNetCore.props')" />
<Import Project="$(NuGetPackageRoot)microsoft.entityframeworkcore\8.0.3\buildTransitive\net8.0\Microsoft.EntityFrameworkCore.props" Condition="Exists('$(NuGetPackageRoot)microsoft.entityframeworkcore\8.0.3\buildTransitive\net8.0\Microsoft.EntityFrameworkCore.props')" />
</ImportGroup>
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<PkgMicrosoft_Extensions_ApiDescription_Server Condition=" '$(PkgMicrosoft_Extensions_ApiDescription_Server)' == '' ">C:\Users\Andrei Cerbu\.nuget\packages\microsoft.extensions.apidescription.server\6.0.5</PkgMicrosoft_Extensions_ApiDescription_Server>
<PkgAWSSDK_Core Condition=" '$(PkgAWSSDK_Core)' == '' ">C:\Users\Andrei Cerbu\.nuget\packages\awssdk.core\3.7.100.14</PkgAWSSDK_Core>
<PkgAWSSDK_SecurityToken Condition=" '$(PkgAWSSDK_SecurityToken)' == '' ">C:\Users\Andrei Cerbu\.nuget\packages\awssdk.securitytoken\3.7.100.14</PkgAWSSDK_SecurityToken>
</PropertyGroup>
</Project>
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)system.text.json\8.0.0\buildTransitive\net6.0\System.Text.Json.targets" Condition="Exists('$(NuGetPackageRoot)system.text.json\8.0.0\buildTransitive\net6.0\System.Text.Json.targets')" />
<Import Project="$(NuGetPackageRoot)microsoft.extensions.apidescription.server\6.0.5\build\Microsoft.Extensions.ApiDescription.Server.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.apidescription.server\6.0.5\build\Microsoft.Extensions.ApiDescription.Server.targets')" />
<Import Project="$(NuGetPackageRoot)microsoft.extensions.logging.abstractions\8.0.0\buildTransitive\net6.0\Microsoft.Extensions.Logging.Abstractions.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.logging.abstractions\8.0.0\buildTransitive\net6.0\Microsoft.Extensions.Logging.Abstractions.targets')" />
<Import Project="$(NuGetPackageRoot)microsoft.extensions.options\8.0.0\buildTransitive\net6.0\Microsoft.Extensions.Options.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.options\8.0.0\buildTransitive\net6.0\Microsoft.Extensions.Options.targets')" />
<Import Project="$(NuGetPackageRoot)microsoft.extensions.configuration.binder\8.0.0\buildTransitive\netstandard2.0\Microsoft.Extensions.Configuration.Binder.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.configuration.binder\8.0.0\buildTransitive\netstandard2.0\Microsoft.Extensions.Configuration.Binder.targets')" />
</ImportGroup>
</Project>
+11 -7
View File
@@ -104,10 +104,10 @@
"lib/netstandard2.0/_._": {}
}
},
"Microsoft.EntityFrameworkCore.Relational/8.0.2": {
"Microsoft.EntityFrameworkCore.Relational/8.0.3": {
"type": "package",
"dependencies": {
"Microsoft.EntityFrameworkCore": "8.0.2",
"Microsoft.EntityFrameworkCore": "8.0.3",
"Microsoft.Extensions.Configuration.Abstractions": "8.0.0"
},
"compile": {
@@ -857,7 +857,9 @@
"type": "project",
"framework": ".NETCoreApp,Version=v8.0",
"dependencies": {
"FluentValidation": "11.9.0"
"Core": "1.0.0",
"FluentValidation": "11.9.0",
"MongoDB.Driver": "2.24.0"
},
"compile": {
"bin/placeholder/Application.dll": {}
@@ -886,6 +888,7 @@
"Application": "1.0.0",
"Core": "1.0.0",
"Microsoft.EntityFrameworkCore": "8.0.3",
"Microsoft.EntityFrameworkCore.Relational": "8.0.3",
"Microsoft.Extensions.Configuration": "8.0.0",
"Microsoft.Extensions.Configuration.Json": "8.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "8.0.0",
@@ -1049,17 +1052,18 @@
"microsoft.entityframeworkcore.analyzers.nuspec"
]
},
"Microsoft.EntityFrameworkCore.Relational/8.0.2": {
"sha512": "NoGfcq2OPw0z8XAPf74YFwGlTKjedWdsIEJqq4SvKcPjcu+B+/XDDNrDRxTvILfz4Ug8POSF49s1jz1JvUqTAg==",
"Microsoft.EntityFrameworkCore.Relational/8.0.3": {
"sha512": "8JnVZHWaNFkrrD/FC0O4jekiHIYey8y6TQ4Co3OzLz0wd5Dm1cwJfTp++1TvaVu0BBd4bVDtiktppa5epuoPrA==",
"type": "package",
"path": "microsoft.entityframeworkcore.relational/8.0.2",
"path": "microsoft.entityframeworkcore.relational/8.0.3",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"PACKAGE.md",
"lib/net8.0/Microsoft.EntityFrameworkCore.Relational.dll",
"lib/net8.0/Microsoft.EntityFrameworkCore.Relational.xml",
"microsoft.entityframeworkcore.relational.8.0.2.nupkg.sha512",
"microsoft.entityframeworkcore.relational.8.0.3.nupkg.sha512",
"microsoft.entityframeworkcore.relational.nuspec"
]
},
+2 -2
View File
@@ -1,6 +1,6 @@
{
"version": 2,
"dgSpecHash": "Llti60b3JlFFmuYNc07w0zCtvVoC0dmeVpWVzdTRLLC9SU9eQLtNx+8lt8aENRzZ+d9tQS2redPHdW7VN9jOxQ==",
"dgSpecHash": "nH+v0/ZQ0hK0w3knyskezmqQzqvqCYUEVhsdP2suOMyzmw/bxzwSVgn9E+iUU+5wOUyeCGutEG5PTTU1y/XNwA==",
"success": true,
"projectFilePath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\API\\API.csproj",
"expectedPackageFiles": [
@@ -11,7 +11,7 @@
"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",
"C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.entityframeworkcore.relational\\8.0.2\\microsoft.entityframeworkcore.relational.8.0.2.nupkg.sha512",
"C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.entityframeworkcore.relational\\8.0.3\\microsoft.entityframeworkcore.relational.8.0.3.nupkg.sha512",
"C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.extensions.apidescription.server\\6.0.5\\microsoft.extensions.apidescription.server.6.0.5.nupkg.sha512",
"C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.extensions.caching.abstractions\\8.0.0\\microsoft.extensions.caching.abstractions.8.0.0.nupkg.sha512",
"C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.extensions.caching.memory\\8.0.0\\microsoft.extensions.caching.memory.8.0.0.nupkg.sha512",
@@ -1 +1 @@
17122552827034613
17125194878710486
+1 -1
View File
@@ -1 +1 @@
17122552827034613
17125195144135930
+1
View File
@@ -8,6 +8,7 @@
<ItemGroup>
<PackageReference Include="FluentValidation" Version="11.9.0"/>
<PackageReference Include="MongoDB.Driver" Version="2.24.0"/>
</ItemGroup>
<ItemGroup>
@@ -2,7 +2,7 @@
public class BaseResponse
{
public bool Success { get; set; }
public int StatusCode { get; set; }
public string? Message { get; set; }
public object? Data { get; set; }
}
@@ -1,6 +1,6 @@
namespace Application.Endpoints.Doctors.Login;
public class DoctorLoginDTO
public class DoctorLoginDto
{
public string? Email { get; set; }
public string? Password { get; set; }
@@ -1,37 +1,42 @@
using Application.Services.Database;
using Application.Services.HashingAlgorithms;
namespace Application.Endpoints.Doctors.Login;
public class DoctorLoginHandler
{
private readonly IDoctorRepository _database;
private readonly IHashingAlgorithms _hashingAlgorithms;
public DoctorLoginHandler(IDoctorRepository database)
public DoctorLoginHandler(IDoctorRepository database, IHashingAlgorithms hashingAlgorithms)
{
_database = database;
_hashingAlgorithms = hashingAlgorithms;
}
public async Task<BaseResponse> Handle(DoctorLoginDTO loginDTO)
public async Task<BaseResponse> Handle(DoctorLoginDto loginDTO)
{
loginDTO.Password = _hashingAlgorithms.SHA256Algorithm(loginDTO.Password);
var validation = new DoctorLoginValidation(_database);
var validationResult = await validation.ValidateAsync(loginDTO);
if (!validationResult.IsValid)
{
var errorMessage = validationResult.Errors.FirstOrDefault()?.ErrorMessage;
if (validationResult.IsValid)
return new BaseResponse
{
Success = false,
StatusCode = HttpStatusCodes.OK,
Message = "Authentication successful",
Data = null
};
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
};
}
return new BaseResponse
{
Success = true,
Message = "Authentication successful",
Data = null
};
}
}
@@ -3,7 +3,7 @@ using FluentValidation;
namespace Application.Endpoints.Doctors.Login;
public class DoctorLoginValidation : AbstractValidator<DoctorLoginDTO>
public class DoctorLoginValidation : AbstractValidator<DoctorLoginDto>
{
private readonly IDoctorRepository _doctorRepository;
@@ -12,13 +12,16 @@ public class DoctorLoginValidation : AbstractValidator<DoctorLoginDTO>
_doctorRepository = doctorRepository;
RuleFor(x => x.Email)
.NotEmpty().WithMessage("Email is required.")
.EmailAddress().WithMessage("Invalid email format.")
.MustAsync(BeExistingDoctor).WithMessage("Doctor with this email does not exist.");
.NotEmpty().WithMessage("Email is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.EmailAddress().WithMessage("Invalid email format.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MustAsync(BeExistingDoctor).WithMessage("Doctor with this email does not exist.")
.WithErrorCode(HttpStatusCodes.NotFound.ToString());
RuleFor(x => x.Password)
.NotEmpty().WithMessage("Password is required.")
.MinimumLength(8).WithMessage("Password must be at least 8 characters long.");
.NotEmpty().WithMessage("Password is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MustAsync((dto, password, cancellationToken) => CredentialsMatch(dto.Email, password, cancellationToken))
.WithMessage("Incorrect email or password.")
.WithErrorCode(HttpStatusCodes.Unauthorized.ToString());
}
private async Task<bool> BeExistingDoctor(string email, CancellationToken cancellationToken)
@@ -26,4 +29,10 @@ public class DoctorLoginValidation : AbstractValidator<DoctorLoginDTO>
var doctor = await _doctorRepository.FindByEmailAsync(email);
return doctor != null;
}
private async Task<bool> CredentialsMatch(string email, string password, CancellationToken cancellationToken)
{
var code = await _doctorRepository.CredentialsMatch(email, password);
return code;
}
}
@@ -1,32 +1,33 @@
using Application.Services.Database;
using Application.Services.HashingAlgorithms;
namespace Application.Endpoints.Doctors.Profile;
public class DoctorProfileHandler
{
private readonly IDoctorRepository _doctorRepository;
private readonly IDoctorRepository _database;
private readonly IHashingAlgorithms _hashingAlgorithms;
public DoctorProfileHandler(IDoctorRepository doctorRepository)
public DoctorProfileHandler(IDoctorRepository database, IHashingAlgorithms hashingAlgorithms)
{
_doctorRepository = doctorRepository;
_database = database;
_hashingAlgorithms = hashingAlgorithms;
}
public async Task<BaseResponse> HandleGet(Guid id)
{
var doctor = await _doctorRepository.GetByIdAsync(id).ConfigureAwait(false);
var doctor = await _database.GetByIdAsync(id).ConfigureAwait(false);
if (doctor != null)
{
return new BaseResponse
{
Success = true,
StatusCode = HttpStatusCodes.OK,
Message = $"Retrieved doctor with id: {id}",
Data = doctor
};
}
return new BaseResponse
{
Success = false,
StatusCode = HttpStatusCodes.NotFound,
Message = $"Doctor with id: {id} not found",
Data = null
};
@@ -34,88 +35,76 @@ public class DoctorProfileHandler
public async Task<BaseResponse> HandleGetAll()
{
var doctors = await _doctorRepository.GetAllAsync().ConfigureAwait(false);
var doctors = await _database.GetAllAsync().ConfigureAwait(false);
if (doctors.Any())
{
return new BaseResponse
{
Success = true,
StatusCode = HttpStatusCodes.OK,
Message = "Retrieved doctors",
Data = doctors.ToList()
};
}
return new BaseResponse
{
Success = false,
StatusCode = HttpStatusCodes.NotFound,
Message = "Doctors not found",
Data = null
};
}
public async Task<BaseResponse> HandleUpdate(Guid id, DoctorProfileDTO updateDto)
public async Task<BaseResponse> HandleUpdate(DoctorProfileUpdateDto doctorProfileUpdateDto)
{
var validation = new DoctorProfileValidation(_doctorRepository);
var validationResult = await validation.ValidateAsync(updateDto);
var validation = new DoctorProfileValidation(_database);
var validationResult = await validation.ValidateAsync(doctorProfileUpdateDto);
if (!validationResult.IsValid)
{
var errorMessage = validationResult.Errors.Select(e => e.ErrorMessage).ToList();
var firstError = validationResult.Errors.FirstOrDefault();
var errorCode = int.TryParse(firstError.ErrorCode, out var code) ? code : -1;
var errorMessage = firstError.ErrorMessage;
return new BaseResponse
{
Success = false,
Message = string.Join(", ", errorMessage),
StatusCode = errorCode,
Message = errorMessage,
Data = null
};
}
var doctorToUpdate = await _doctorRepository.GetByIdAsync(id);
var doctorToUpdate = await _database.GetByIdAsync(doctorProfileUpdateDto.Id);
doctorToUpdate.SetEmail(doctorProfileUpdateDto.Email);
doctorToUpdate.SetPassword(_hashingAlgorithms.SHA256Algorithm(doctorProfileUpdateDto.Password));
doctorToUpdate.SetName(doctorProfileUpdateDto.Name);
doctorToUpdate.SetDescription(doctorProfileUpdateDto.Description);
await _database.UpdateAsync(doctorToUpdate);
if (doctorToUpdate == null)
{
return new BaseResponse
{
Success = false,
Message = "Doctor not found for given Id",
StatusCode = HttpStatusCodes.NoContent,
Message = null,
Data = null
};
}
doctorToUpdate.Email = updateDto.Email;
doctorToUpdate.Password = updateDto.Password;
doctorToUpdate.Name = updateDto.Name;
doctorToUpdate.Description = updateDto.Description;
await _doctorRepository.UpdateAsync(doctorToUpdate);
return new BaseResponse
{
Success = true,
Message = "Doctor updated successfully",
Data = doctorToUpdate
};
}
public async Task<BaseResponse> HandleDelete(Guid id)
{
var doctorToDelete = await _doctorRepository.GetByIdAsync(id);
var doctorToDelete = await _database.GetByIdAsync(id);
if (doctorToDelete == null)
{
return new BaseResponse
{
Success = false,
Message = $"Doctor with id: {id} does not exist",
StatusCode = HttpStatusCodes.NotFound,
Message = "Doctor was not found.",
Data = null
};
await _database.DeleteAsync(doctorToDelete);
return new BaseResponse
{
StatusCode = HttpStatusCodes.NoContent,
Message = null,
Data = null
};
}
await _doctorRepository.DeleteAsync(doctorToDelete);
return new BaseResponse
{
Success = true,
Message = $"Doctor with id: {id} was succesfully deleted",
Data = doctorToDelete
};
}
}
@@ -1,7 +1,8 @@
namespace Application.Endpoints.Doctors.Profile;
public class DoctorProfileDTO
public class DoctorProfileUpdateDto
{
public Guid Id { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public string Password { get; set; }
@@ -3,7 +3,7 @@ using FluentValidation;
namespace Application.Endpoints.Doctors.Profile;
public class DoctorProfileValidation : AbstractValidator<DoctorProfileDTO>
public class DoctorProfileValidation : AbstractValidator<DoctorProfileUpdateDto>
{
private readonly IDoctorRepository _doctorRepository;
@@ -11,30 +11,41 @@ public class DoctorProfileValidation : AbstractValidator<DoctorProfileDTO>
{
_doctorRepository = doctorRepository;
RuleFor(x => x.Id)
.NotEmpty().WithMessage("Id is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MustAsync(IsDoctorRegistered).WithMessage("Doctor is registered in system")
.WithErrorCode(HttpStatusCodes.NotFound.ToString());
RuleFor(x => x.Email)
.NotEmpty().WithMessage("Email is required.")
.EmailAddress().WithMessage("Invalid email format.")
.MustAsync(BeUniqueEmail).WithMessage("Email in use by another doctor.");
.NotEmpty().WithMessage("Email is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.EmailAddress().WithMessage("Invalid email format.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MustAsync(BeUniqueEmail).WithMessage("Email in use by another doctor.")
.WithErrorCode(HttpStatusCodes.Conflict.ToString());
RuleFor(x => x.Password)
.NotEmpty().WithMessage("Password is required.")
.MinimumLength(8).WithMessage("Password must be at least 8 characters long.");
.NotEmpty().WithMessage("Password is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MinimumLength(8).WithMessage("Password must be at least 8 characters long.")
.WithErrorCode(HttpStatusCodes.BadRequest.ToString());
RuleFor(x => x.Name)
.NotEmpty().WithMessage("Name is required.")
.MinimumLength(3).WithMessage("Name must be at least 3 characters long.");
.NotEmpty().WithMessage("Name is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MinimumLength(3).WithMessage("Name must be at least 3 characters long.")
.WithErrorCode(HttpStatusCodes.BadRequest.ToString());
RuleFor(x => x.Description)
.MaximumLength(3000).WithMessage("Description must not exceed 3000 characters.");
.MaximumLength(3000).WithMessage("Description must not exceed 3000 characters.")
.WithErrorCode(HttpStatusCodes.BadRequest.ToString());
}
private async Task<bool> IsDoctorRegistered(Guid id, CancellationToken cancellationToken)
{
var doctor = await _doctorRepository.GetByIdAsync(id);
return doctor == null;
}
private async Task<bool> BeUniqueEmail(string email, CancellationToken cancellationToken)
{
var doctor = await _doctorRepository.FindByEmailAsync(email);
if (doctor != null)
{
return doctor.Email.Equals(email, StringComparison.OrdinalIgnoreCase);
}
return doctor == null;
}
}
@@ -1,9 +1,9 @@
namespace Application.Endpoints.Doctors.Login;
namespace Application.Endpoints.Doctors.Registration;
public class DoctorRegistrationDto
{
public string Name { get; set; }
public string Email { get; set; }
public string Password { get; set; }
public string Description { get; set; }
public string? Name { get; set; }
public string? Email { get; set; }
public string? Password { get; set; }
public string? Description { get; set; }
}
@@ -1,5 +1,5 @@
using Application.Endpoints.Doctors.Login;
using Application.Services.Database;
using Application.Services.Database;
using Application.Services.HashingAlgorithms;
using Core.Entities;
namespace Application.Endpoints.Doctors.Registration;
@@ -7,10 +7,12 @@ namespace Application.Endpoints.Doctors.Registration;
public class DoctorRegistrationHandler
{
private readonly IDoctorRepository _doctorRepository;
private readonly IHashingAlgorithms _hashingAlgorithms;
public DoctorRegistrationHandler(IDoctorRepository doctorRepository)
public DoctorRegistrationHandler(IDoctorRepository doctorRepository, IHashingAlgorithms hashingAlgorithms)
{
_doctorRepository = doctorRepository;
_hashingAlgorithms = hashingAlgorithms;
}
public async Task<BaseResponse> Handle(DoctorRegistrationDto registrationDTO)
@@ -20,30 +22,31 @@ public class DoctorRegistrationHandler
if (!validationResult.IsValid)
{
var errorMessage = validationResult.Errors.Select(e => e.ErrorMessage).ToList();
var firstError = validationResult.Errors.FirstOrDefault();
var errorCode = int.TryParse(firstError.ErrorCode, out var code) ? code : -1;
var errorMessage = firstError.ErrorMessage;
return new BaseResponse
{
Success = false,
Message = string.Join(", ", errorMessage),
StatusCode = errorCode,
Message = errorMessage,
Data = null
};
}
var doctor = new Doctor
{
Email = registrationDTO.Email,
Password = registrationDTO.Password,
Name = registrationDTO.Name,
Description = registrationDTO.Description
};
var doctor = new Doctor();
doctor.SetEmail(registrationDTO.Email);
doctor.SetPassword(_hashingAlgorithms.SHA256Algorithm(registrationDTO.Password));
doctor.SetName(registrationDTO.Name);
doctor.SetDescription(registrationDTO.Description);
await _doctorRepository.AddAsync(doctor);
return new BaseResponse
{
Success = true,
StatusCode = HttpStatusCodes.Created,
Message = "Doctor registered successfully",
Data = doctor // Be careful with sending sensitive data like Passwords
Data = null
};
}
}
@@ -1,5 +1,4 @@
using Application.Endpoints.Doctors.Login;
using Application.Services.Database;
using Application.Services.Database;
using FluentValidation;
namespace Application.Endpoints.Doctors.Registration;
@@ -13,20 +12,24 @@ public class DoctorRegistrationValidation : AbstractValidator<DoctorRegistration
_doctorRepository = doctorRepository;
RuleFor(x => x.Email)
.NotEmpty().WithMessage("Email is required.")
.EmailAddress().WithMessage("Invalid email format.")
.MustAsync(BeUniqueEmail).WithMessage("Email already exists.");
.NotEmpty().WithMessage("Email is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.EmailAddress().WithMessage("Invalid email format.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MustAsync(BeUniqueEmail).WithMessage("Email already exists.")
.WithErrorCode(HttpStatusCodes.Conflict.ToString());
RuleFor(x => x.Password)
.NotEmpty().WithMessage("Password is required.")
.MinimumLength(8).WithMessage("Password must be at least 8 characters long.");
.NotEmpty().WithMessage("Password is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MinimumLength(8).WithMessage("Password must be at least 8 characters long.")
.WithErrorCode(HttpStatusCodes.BadRequest.ToString());
RuleFor(x => x.Name)
.NotEmpty().WithMessage("Name is required.")
.MinimumLength(3).WithMessage("Name must be at least 3 characters long.");
.NotEmpty().WithMessage("Name is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MinimumLength(3).WithMessage("Name must be at least 3 characters long.")
.WithErrorCode(HttpStatusCodes.BadRequest.ToString());
RuleFor(x => x.Description)
.MaximumLength(3000).WithMessage("Description must not exceed 3000 characters.");
.MaximumLength(3000).WithMessage("Description must not exceed 3000 characters.")
.WithErrorCode(HttpStatusCodes.BadRequest.ToString());
}
private async Task<bool> BeUniqueEmail(string email, CancellationToken cancellationToken)
@@ -0,0 +1,7 @@
namespace Application.Endpoints.Doctors.ResetPassword;
public class DoctorResetPasswordDto
{
public string? Email { get; set; }
public string? Password { get; set; }
}
@@ -1,58 +1,49 @@
using Application.Endpoints.Doctors.Login;
using Application.Services.Database;
using Application.Services.Database;
using Application.Services.HashingAlgorithms;
namespace Application.Endpoints.Doctors.ResetPassword;
public class DoctorResetPasswordHandler
{
private readonly IDoctorRepository _doctorRepository;
private readonly IHashingAlgorithms _hashingAlgorithms;
public DoctorResetPasswordHandler(IDoctorRepository doctorRepository)
public DoctorResetPasswordHandler(IDoctorRepository doctorRepository, IHashingAlgorithms hashingAlgorithms)
{
_doctorRepository = doctorRepository;
_hashingAlgorithms = hashingAlgorithms;
}
public async Task<BaseResponse> Handle(DoctorLoginDTO resetDoctorDto)
public async Task<BaseResponse> Handle(DoctorResetPasswordDto resetDoctorDto)
{
var validation = new DoctorResetPasswordValidation(_doctorRepository);
var validationResult = await validation.ValidateAsync(resetDoctorDto);
if (!validationResult.IsValid)
{
var errorMessage = validationResult.Errors.Select(e => e.ErrorMessage).ToList();
var firstError = validationResult.Errors.FirstOrDefault();
var errorCode = int.TryParse(firstError.ErrorCode, out var code) ? code : -1;
var errorMessage = firstError.ErrorMessage;
return new BaseResponse
{
Success = false,
Message = string.Join(", ", errorMessage),
StatusCode = errorCode,
Message = errorMessage,
Data = null
};
}
var currentDoctor = await _doctorRepository.FindByEmailAsync(resetDoctorDto.Email);
var updatedDoctor = currentDoctor;
updatedDoctor.Password = resetDoctorDto.Password;
updatedDoctor.SetPassword(_hashingAlgorithms.SHA256Algorithm(resetDoctorDto.Password));
await _doctorRepository.UpdateAsync(updatedDoctor);
updatedDoctor = await _doctorRepository.GetByIdAsync(currentDoctor.Id);
if (updatedDoctor.Password != resetDoctorDto.Password)
{
return new BaseResponse
{
Success = false,
Message = $"Failed to update passwor for doctor {updatedDoctor.Name}",
StatusCode = HttpStatusCodes.OK,
Message = "Password successfully changed!",
Data = null
};
}
return new BaseResponse
{
Success = true,
Message = $"Password of doctor {updatedDoctor.Name} has been reset succesfully",
Data = updatedDoctor.Email
};
}
}
@@ -1,9 +1,9 @@
using Application.Services.Database;
using FluentValidation;
namespace Application.Endpoints.Doctors.Login;
namespace Application.Endpoints.Doctors.ResetPassword;
public class DoctorResetPasswordValidation : AbstractValidator<DoctorLoginDTO>
public class DoctorResetPasswordValidation : AbstractValidator<DoctorResetPasswordDto>
{
private readonly IDoctorRepository _doctorRepository;
@@ -12,15 +12,19 @@ public class DoctorResetPasswordValidation : AbstractValidator<DoctorLoginDTO>
_doctorRepository = doctorRepository;
RuleFor(x => x.Email)
.NotEmpty().WithMessage("Email is required.")
.EmailAddress().WithMessage("Invalid email format.")
.MustAsync(BeExistingDoctor).WithMessage("Doctor with this email does not exist.");
.NotEmpty().WithMessage("Email is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.EmailAddress().WithMessage("Invalid email format.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MustAsync(BeExistingDoctor).WithMessage("Doctor with this email does not exist.")
.WithErrorCode(HttpStatusCodes.NotFound.ToString());
RuleFor(x => x.Password)
.NotEmpty().WithMessage("Password is required.")
.NotEmpty().WithMessage("Password is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MinimumLength(8).WithMessage("Password must be at least 8 characters long.")
.MustAsync((dto, password, context, cancellationToken) => BeDifferentFromOldPassword(dto.Email, password, cancellationToken))
.WithMessage("New password cannot be the same as old password.");
.WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MustAsync((dto, password, context, cancellationToken) =>
BeDifferentFromOldPassword(dto.Email, password, cancellationToken))
.WithMessage("New password cannot be the same as old password.")
.WithErrorCode(HttpStatusCodes.BadRequest.ToString());
}
private async Task<bool> BeExistingDoctor(string email, CancellationToken cancellationToken)
@@ -29,7 +33,8 @@ public class DoctorResetPasswordValidation : AbstractValidator<DoctorLoginDTO>
return doctor != null;
}
private async Task<bool> BeDifferentFromOldPassword(string email, string newPassword, CancellationToken cancellationToken)
private async Task<bool> BeDifferentFromOldPassword(string email, string newPassword,
CancellationToken cancellationToken)
{
var currentDoctor = await _doctorRepository.FindByEmailAsync(email);
return !newPassword.Equals(currentDoctor?.Password, StringComparison.Ordinal);
@@ -0,0 +1,16 @@
namespace Application.Endpoints;
public static class HttpStatusCodes
{
public const int OK = 200;
public const int Created = 201;
public const int NoContent = 204;
public const int BadRequest = 400;
public const int Unauthorized = 401;
public const int Forbidden = 403;
public const int NotFound = 404;
public const int Conflict = 409;
public const int InternalServerError = 500;
// Add more status codes as needed
}
@@ -1,7 +1,7 @@
namespace Application.Endpoints.MedicalHistories;
public class MedicalHistoryDTO
public class MedicalHistoryCreateDto
{
public Guid UserId { get; set; }
public byte[] Description { get; set; } = [];
public byte[] Content { get; set; } = [];
}
@@ -3,25 +3,26 @@ using FluentValidation;
namespace Application.Endpoints.MedicalHistories;
public class MedicalHistoryCreateValidation : AbstractValidator<MedicalHistoryDTO>
public class MedicalHistoryCreateValidation : AbstractValidator<MedicalHistoryCreateDto>
{
private readonly IPacientRepository _pacientRepository;
private readonly IPatientRepository _patientRepository;
public MedicalHistoryCreateValidation(IPacientRepository pacientRepository)
public MedicalHistoryCreateValidation(IPatientRepository patientRepository)
{
_pacientRepository = pacientRepository;
_patientRepository = patientRepository;
RuleFor(x => x.UserId)
.NotEmpty().WithMessage("Pacient is required.")
.MustAsync(BeExistingUser).WithMessage("Specified pacient id doesn't exist.");
.NotEmpty().WithMessage("Patient is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MustAsync(BeExistingUser).WithMessage("Specified patient doesn't exist.")
.WithErrorCode(HttpStatusCodes.NotFound.ToString());
RuleFor(x => x.Description)
.NotEmpty().WithMessage("Description is required.");
RuleFor(x => x.Content)
.NotEmpty().WithMessage("Description is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString());
}
private async Task<bool> BeExistingUser(Guid userId, CancellationToken cancellationToken)
{
var pacient = await _pacientRepository.GetByIdAsync(userId);
return pacient != null;
var patient = await _patientRepository.GetByIdAsync(userId);
return patient != null;
}
}
@@ -6,104 +6,142 @@ namespace Application.Endpoints.MedicalHistories;
public class MedicalHistoryHandler
{
private readonly IMedicalHistoryRepository _medicalHistoryRepository;
private readonly IPacientRepository _pacientRepository;
private readonly IMongoDbService _mongoDbService;
private readonly IPatientRepository _patientRepository;
public MedicalHistoryHandler(IMedicalHistoryRepository medicalHistoryRepository, IPacientRepository pacientRepository)
public MedicalHistoryHandler(IMedicalHistoryRepository medicalHistoryRepository,
IPatientRepository patientRepository, IMongoDbService mongoDbService)
{
_medicalHistoryRepository = medicalHistoryRepository;
_pacientRepository = pacientRepository;
_patientRepository = patientRepository;
_mongoDbService = mongoDbService;
}
public async Task<BaseResponse> HandleGet(Guid id)
{
var medicalHistory = await _medicalHistoryRepository.GetByIdAsync(id).ConfigureAwait(false);
if (medicalHistory != null)
public async Task<BaseResponse> HandleGetAll()
{
var documents = await _medicalHistoryRepository.GetAllAsync().ConfigureAwait(false);
if (documents.Any())
return new BaseResponse
{
Success = true,
Message = $"Retrieved Medical History with id: {id}",
Data = medicalHistory
StatusCode = HttpStatusCodes.OK,
Message = "Retrieved medical histories",
Data = documents.ToList()
};
}
return new BaseResponse
{
Success = false,
Message = $"Medical History with id: {id} not found",
StatusCode = HttpStatusCodes.NotFound,
Message = "Medical histories not found",
Data = null
};
}
public async Task<BaseResponse> HandleCreate(Guid userId, byte[] description)
public async Task<BaseResponse> HandleGet(Guid id)
{
var validation = new MedicalHistoryCreateValidation(_pacientRepository);
var validationResult = await validation.ValidateAsync(new MedicalHistoryDTO { UserId = userId, Description = description});
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<BaseResponse> HandleCreate(MedicalHistoryCreateDto medicalHistoryCreateDto)
{
var validation = new MedicalHistoryCreateValidation(_patientRepository);
var validationResult = await validation.ValidateAsync(medicalHistoryCreateDto);
if (!validationResult.IsValid)
{
var errorMessage = validationResult.Errors.Select(e => e.ErrorMessage).ToList();
var firstError = validationResult.Errors.FirstOrDefault();
var errorCode = int.TryParse(firstError.ErrorCode, out var code) ? code : -1;
var errorMessage = firstError.ErrorMessage;
return new BaseResponse
{
Success = false,
Message = string.Join(", ", errorMessage),
StatusCode = errorCode,
Message = errorMessage,
Data = null
};
}
var medicalHistory = new MedicalHistory
{
UserId = userId,
Description = description
UserId = medicalHistoryCreateDto.UserId,
Content = medicalHistoryCreateDto.Content
};
await _medicalHistoryRepository.AddAsync(medicalHistory);
//TODO add to MongoDB
return new BaseResponse
{
Success = true,
StatusCode = HttpStatusCodes.Created,
Message = "Medical history record registered successfully",
Data = medicalHistory
};
}
public async Task<BaseResponse> HandleUpdate(Guid id, MedicalHistoryDTO updateDto)
public async Task<BaseResponse> HandleUpdate(MedicalHistoryUpdateDto updateDto)
{
var validation = new MedicalHistoryUpdateValidation(_medicalHistoryRepository, _pacientRepository);
var validationResult = await validation.ValidateAsync(new MedicalHistoryUpdateDTO { Id = id, UserId = updateDto.UserId, Description = updateDto.Description});
var validation = new MedicalHistoryUpdateValidation(_medicalHistoryRepository, _patientRepository);
var validationResult = await validation.ValidateAsync(updateDto);
if (!validationResult.IsValid)
{
var errorMessage = validationResult.Errors.Select(e => e.ErrorMessage).ToList();
var firstError = validationResult.Errors.FirstOrDefault();
var errorCode = int.TryParse(firstError.ErrorCode, out var code) ? code : -1;
var errorMessage = firstError.ErrorMessage;
return new BaseResponse
{
Success = false,
Message = string.Join(", ", errorMessage),
StatusCode = errorCode,
Message = errorMessage,
Data = null
};
}
var medicalHistoryToUpdate = await _medicalHistoryRepository.GetByIdAsync(id);
if (medicalHistoryToUpdate == null)
{
return new BaseResponse
{
Success = false,
Message = "Medical history not found for given Id",
Data = null
};
}
medicalHistoryToUpdate.UserId = updateDto.UserId;
medicalHistoryToUpdate.Description = updateDto.Description;
var medicalHistoryToUpdate = await _medicalHistoryRepository.GetByIdAsync(updateDto.Id);
medicalHistoryToUpdate.Content = updateDto.Content;
await _medicalHistoryRepository.UpdateAsync(medicalHistoryToUpdate);
return new BaseResponse
{
Success = true,
Message = "Pacient updated successfully",
Data = medicalHistoryToUpdate
StatusCode = HttpStatusCodes.NoContent,
Message = "Medical record updated successfully",
Data = null
};
}
public async Task<BaseResponse> 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 _medicalHistoryRepository.DeleteAsync(medicalRecord);
//TODO delete from MongoDB
return new BaseResponse
{
StatusCode = HttpStatusCodes.NoContent,
Message = null,
Data = null
};
}
}
@@ -1,8 +1,7 @@
namespace Application.Endpoints.MedicalHistories;
public class MedicalHistoryUpdateDTO
public class MedicalHistoryUpdateDto
{
public Guid Id { get; set; }
public Guid UserId { get; set; }
public byte[] Description { get; set; } = [];
public byte[] Content { get; set; } = [];
}
@@ -3,25 +3,22 @@ using FluentValidation;
namespace Application.Endpoints.MedicalHistories;
public class MedicalHistoryUpdateValidation : AbstractValidator<MedicalHistoryUpdateDTO>
public class MedicalHistoryUpdateValidation : AbstractValidator<MedicalHistoryUpdateDto>
{
private readonly IMedicalHistoryRepository _medicalHistoryRepository;
private readonly IPacientRepository _pacientRepository;
private readonly IPatientRepository _patientRepository;
public MedicalHistoryUpdateValidation(IMedicalHistoryRepository medicalHistoryRepository, IPacientRepository pacientRepository)
public MedicalHistoryUpdateValidation(IMedicalHistoryRepository medicalHistoryRepository,
IPatientRepository patientRepository)
{
_medicalHistoryRepository = medicalHistoryRepository;
_pacientRepository = pacientRepository;
_patientRepository = patientRepository;
RuleFor(x => x.Id)
.NotEmpty().WithMessage("Id is required")
.MustAsync(BeExistingMedicalHistoryRecord).WithMessage("Medical hostory record does not exist");
.MustAsync(BeExistingMedicalHistoryRecord).WithMessage("Medical history record does not exist");
RuleFor(x => x.UserId)
.NotEmpty().WithMessage("Pacient is required.")
.MustAsync(BeExistingUser).WithMessage("Specified pacient id doesn't exist.");
RuleFor(x => x.Description)
RuleFor(x => x.Content)
.NotEmpty().WithMessage("Description is required.");
}
@@ -30,10 +27,4 @@ public class MedicalHistoryUpdateValidation : AbstractValidator<MedicalHistoryUp
var record = await _medicalHistoryRepository.GetByIdAsync(guid);
return record != null;
}
private async Task<bool> BeExistingUser(Guid userId, CancellationToken cancellationToken)
{
var pacient = await _pacientRepository.GetByIdAsync(userId);
return pacient != null;
}
}
@@ -1,37 +0,0 @@
using Application.Services.Database;
namespace Application.Endpoints.Pacients.Login;
public class PacientLoginHandler
{
private readonly IPacientRepository _database;
public PacientLoginHandler(IPacientRepository database)
{
_database = database;
}
public async Task<BaseResponse> Handle(PacientLoginDTO loginDTO)
{
var validation = new PacientLoginValidation(_database);
var validationResult = await validation.ValidateAsync(loginDTO);
if (!validationResult.IsValid)
{
var errorMessage = validationResult.Errors.FirstOrDefault()?.ErrorMessage;
return new BaseResponse
{
Success = false,
Message = errorMessage,
Data = null
};
}
return new BaseResponse
{
Success = true,
Message = "Authentication successful",
Data = null
};
}
}
@@ -1,29 +0,0 @@
using Application.Services.Database;
using FluentValidation;
namespace Application.Endpoints.Pacients.Login;
public class PacientLoginValidation : AbstractValidator<PacientLoginDTO>
{
private readonly IPacientRepository _pacientRepository;
public PacientLoginValidation(IPacientRepository pacientRepository)
{
_pacientRepository = pacientRepository;
RuleFor(x => x.Email)
.NotEmpty().WithMessage("Email is required.")
.EmailAddress().WithMessage("Invalid email format.")
.MustAsync(BeExistingPacient).WithMessage("Pacient with this email does not exist.");
RuleFor(x => x.Password)
.NotEmpty().WithMessage("Password is required.")
.MinimumLength(8).WithMessage("Password must be at least 8 characters long.");
}
private async Task<bool> BeExistingPacient(string email, CancellationToken cancellationToken)
{
var pacient = await _pacientRepository.FindByEmailAsync(email);
return pacient != null;
}
}
@@ -1,9 +0,0 @@
namespace Application.Endpoints.Pacients.Profile;
public class PacientProfileDTO
{
public string Name { get; set; }
public string Email { get; set; }
public string Password { get; set; }
public string Description { get; set; }
}
@@ -1,120 +0,0 @@
using Application.Services.Database;
namespace Application.Endpoints.Pacients.Profile;
public class PacientProfileHandler
{
private readonly IPacientRepository _pacientRepository;
public PacientProfileHandler(IPacientRepository pacientRepository)
{
_pacientRepository = pacientRepository;
}
public async Task<BaseResponse> HandleGet(Guid id)
{
var pacient = await _pacientRepository.GetByIdAsync(id).ConfigureAwait(false);
if (pacient != null)
{
return new BaseResponse
{
Success = true,
Message = $"Retrieved pacient with id: {id}",
Data = pacient
};
}
return new BaseResponse
{
Success = false,
Message = $"Pacient with id: {id} not found",
Data = null
};
}
public async Task<BaseResponse> HandleGetAll()
{
var pacients = await _pacientRepository.GetAllAsync().ConfigureAwait(false);
if (pacients.Any())
{
return new BaseResponse
{
Success = true,
Message = "Retrieved pacients",
Data = pacients.ToList()
};
}
return new BaseResponse
{
Success = false,
Message = "Pacients not found",
Data = null
};
}
public async Task<BaseResponse> HandleUpdate(Guid id, PacientProfileDTO updateDto)
{
var validation = new PacientProfileValidation(_pacientRepository);
var validationResult = await validation.ValidateAsync(updateDto);
if (!validationResult.IsValid)
{
var errorMessage = validationResult.Errors.Select(e => e.ErrorMessage).ToList();
return new BaseResponse
{
Success = false,
Message = string.Join(", ", errorMessage),
Data = null
};
}
var pacientToUpdate = await _pacientRepository.GetByIdAsync(id);
if (pacientToUpdate == null)
{
return new BaseResponse
{
Success = false,
Message = "Pacient not found for given Id",
Data = null
};
}
pacientToUpdate.Email = updateDto.Email;
pacientToUpdate.Password = updateDto.Password;
pacientToUpdate.Name = updateDto.Name;
await _pacientRepository.UpdateAsync(pacientToUpdate);
return new BaseResponse
{
Success = true,
Message = "Pacient updated successfully",
Data = pacientToUpdate
};
}
public async Task<BaseResponse> HandleDelete(Guid id)
{
var pacientToDelete = await _pacientRepository.GetByIdAsync(id);
if (pacientToDelete == null)
{
return new BaseResponse
{
Success = false,
Message = $"Pacient with id: {id} does not exist",
Data = null
};
}
await _pacientRepository.DeleteAsync(pacientToDelete);
return new BaseResponse
{
Success = true,
Message = $"Pacient with id: {id} was succesfully deleted",
Data = pacientToDelete
};
}
}
@@ -1,40 +0,0 @@
using Application.Services.Database;
using FluentValidation;
namespace Application.Endpoints.Pacients.Profile;
public class PacientProfileValidation : AbstractValidator<PacientProfileDTO>
{
private readonly IPacientRepository _pacientRepository;
public PacientProfileValidation(IPacientRepository pacientRepository)
{
_pacientRepository = pacientRepository;
RuleFor(x => x.Email)
.NotEmpty().WithMessage("Email is required.")
.EmailAddress().WithMessage("Invalid email format.")
.MustAsync(BeUniqueEmail).WithMessage("Email in use by another pacient.");
RuleFor(x => x.Password)
.NotEmpty().WithMessage("Password is required.")
.MinimumLength(8).WithMessage("Password must be at least 8 characters long.");
RuleFor(x => x.Name)
.NotEmpty().WithMessage("Name is required.")
.MinimumLength(3).WithMessage("Name must be at least 3 characters long.");
RuleFor(x => x.Description)
.MaximumLength(3000).WithMessage("Description must not exceed 3000 characters.");
}
private async Task<bool> BeUniqueEmail(string email, CancellationToken cancellationToken)
{
var pacient = await _pacientRepository.FindByEmailAsync(email);
if (pacient != null)
{
return pacient.Email.Equals(email, StringComparison.OrdinalIgnoreCase);
}
return pacient == null;
}
}
@@ -1,48 +0,0 @@
using Application.Endpoints.Pacients.Login;
using Application.Services.Database;
using Core.Entities;
namespace Application.Endpoints.Pacients.Registration;
public class PacientRegistrationHandler
{
private readonly IPacientRepository _pacientRepository;
public PacientRegistrationHandler(IPacientRepository pacientRepository)
{
_pacientRepository = pacientRepository;
}
public async Task<BaseResponse> Handle(PacientRegistrationDto registrationDTO)
{
var validation = new PacientRegistrationValidation(_pacientRepository);
var validationResult = await validation.ValidateAsync(registrationDTO);
if (!validationResult.IsValid)
{
var errorMessage = validationResult.Errors.Select(e => e.ErrorMessage).ToList();
return new BaseResponse
{
Success = false,
Message = string.Join(", ", errorMessage),
Data = null
};
}
var pacient = new Pacient
{
Email = registrationDTO.Email,
Password = registrationDTO.Password,
Name = registrationDTO.Name
};
await _pacientRepository.AddAsync(pacient);
return new BaseResponse
{
Success = true,
Message = "Pacient registered successfully",
Data = pacient // Be careful with sending sensitive data like Passwords
};
}
}
@@ -1,34 +0,0 @@
using Application.Endpoints.Pacients.Login;
using Application.Services.Database;
using FluentValidation;
namespace Application.Endpoints.Pacients.Registration;
public class PacientRegistrationValidation : AbstractValidator<PacientRegistrationDto>
{
private readonly IPacientRepository _pacientRepository;
public PacientRegistrationValidation(IPacientRepository pacientRepository)
{
_pacientRepository = pacientRepository;
RuleFor(x => x.Email)
.NotEmpty().WithMessage("Email is required.")
.EmailAddress().WithMessage("Invalid email format.")
.MustAsync(BeUniqueEmail).WithMessage("Email already exists.");
RuleFor(x => x.Password)
.NotEmpty().WithMessage("Password is required.")
.MinimumLength(8).WithMessage("Password must be at least 8 characters long.");
RuleFor(x => x.Name)
.NotEmpty().WithMessage("Name is required.")
.MinimumLength(3).WithMessage("Name must be at least 3 characters long.");
}
private async Task<bool> BeUniqueEmail(string email, CancellationToken cancellationToken)
{
var pacient = await _pacientRepository.FindByEmailAsync(email);
return pacient == null;
}
}
@@ -1,58 +0,0 @@
using Application.Endpoints.Pacients.Login;
using Application.Services.Database;
namespace Application.Endpoints.Pacients.ResetPassword;
public class PacientResetPasswordHandler
{
private readonly IPacientRepository _pacientRepository;
public PacientResetPasswordHandler(IPacientRepository pacientRepository)
{
_pacientRepository = pacientRepository;
}
public async Task<BaseResponse> Handle(PacientLoginDTO resetPacientDto)
{
var validation = new PacientResetPasswordValidation(_pacientRepository);
var validationResult = await validation.ValidateAsync(resetPacientDto);
if (!validationResult.IsValid)
{
var errorMessage = validationResult.Errors.Select(e => e.ErrorMessage).ToList();
return new BaseResponse
{
Success = false,
Message = string.Join(", ", errorMessage),
Data = null
};
}
var currentPacient = await _pacientRepository.FindByEmailAsync(resetPacientDto.Email);
var updatedPacient = currentPacient;
updatedPacient.Password = resetPacientDto.Password;
await _pacientRepository.UpdateAsync(updatedPacient);
updatedPacient = await _pacientRepository.GetByIdAsync(currentPacient.Id);
if (updatedPacient.Password != resetPacientDto.Password)
{
return new BaseResponse
{
Success = false,
Message = $"Failed to update passwor for pacient {updatedPacient.Name}",
Data = null
};
}
return new BaseResponse
{
Success = true,
Message = $"Password of pacient {updatedPacient.Name} has been reset succesfully",
Data = updatedPacient.Email
};
}
}
@@ -1,37 +0,0 @@
using Application.Services.Database;
using FluentValidation;
namespace Application.Endpoints.Pacients.Login;
public class PacientResetPasswordValidation : AbstractValidator<PacientLoginDTO>
{
private readonly IPacientRepository _pacientRepository;
public PacientResetPasswordValidation(IPacientRepository pacientRepository)
{
_pacientRepository = pacientRepository;
RuleFor(x => x.Email)
.NotEmpty().WithMessage("Email is required.")
.EmailAddress().WithMessage("Invalid email format.")
.MustAsync(BeExistingPacient).WithMessage("Pacient with this email does not exist.");
RuleFor(x => x.Password)
.NotEmpty().WithMessage("Password is required.")
.MinimumLength(8).WithMessage("Password must be at least 8 characters long.")
.MustAsync((dto, password, context, cancellationToken) => BeDifferentFromOldPassword(dto.Email, password, cancellationToken))
.WithMessage("New password cannot be the same as old password.");
}
private async Task<bool> BeExistingPacient(string email, CancellationToken cancellationToken)
{
var pacient = await _pacientRepository.FindByEmailAsync(email);
return pacient != null;
}
private async Task<bool> BeDifferentFromOldPassword(string email, string newPassword, CancellationToken cancellationToken)
{
var currentPacient = await _pacientRepository.FindByEmailAsync(email);
return !newPassword.Equals(currentPacient?.Password, StringComparison.Ordinal);
}
}
@@ -1,6 +1,6 @@
namespace Application.Endpoints.Pacients.Login;
namespace Application.Endpoints.Patients.Login;
public class PacientLoginDTO
public class PatientLoginDto
{
public string? Email { get; set; }
public string? Password { get; set; }
@@ -0,0 +1,37 @@
using Application.Services.Database;
namespace Application.Endpoints.Patients.Login;
public class PatientLoginHandler
{
private readonly IPatientRepository _database;
public PatientLoginHandler(IPatientRepository database)
{
_database = database;
}
public async Task<BaseResponse> Handle(PatientLoginDto loginDTO)
{
var validation = new PatientLoginValidation(_database);
var validationResult = await validation.ValidateAsync(loginDTO);
if (validationResult.IsValid)
return new BaseResponse
{
StatusCode = HttpStatusCodes.OK,
Message = "Authentication successful",
Data = null
};
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
};
}
}
@@ -0,0 +1,31 @@
using Application.Services.Database;
using FluentValidation;
namespace Application.Endpoints.Patients.Login;
public class PatientLoginValidation : AbstractValidator<PatientLoginDto>
{
private readonly IPatientRepository _patientRepository;
public PatientLoginValidation(IPatientRepository patientRepository)
{
_patientRepository = patientRepository;
RuleFor(x => x.Email)
.NotEmpty().WithMessage("Email is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.EmailAddress().WithMessage("Invalid email format.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MustAsync(BeExistingPatient).WithMessage("Patient with this email does not exist.")
.WithErrorCode(HttpStatusCodes.NotFound.ToString());
RuleFor(x => x.Password)
.NotEmpty().WithMessage("Password is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MinimumLength(8).WithMessage("Password must be at least 8 characters long.")
.WithErrorCode(HttpStatusCodes.BadRequest.ToString());
}
private async Task<bool> BeExistingPatient(string email, CancellationToken cancellationToken)
{
var patient = await _patientRepository.FindByEmailAsync(email);
return patient != null;
}
}
@@ -0,0 +1,9 @@
namespace Application.Endpoints.Patients.Profile;
public class PatientProfileDto
{
public Guid Id { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public string Password { get; set; }
}
@@ -0,0 +1,110 @@
using Application.Services.Database;
using Application.Services.HashingAlgorithms;
namespace Application.Endpoints.Patients.Profile;
public class PatientProfileHandler
{
private readonly IHashingAlgorithms _hashingAlgorithms;
private readonly IPatientRepository _patientRepository;
public PatientProfileHandler(IPatientRepository patientRepository, IHashingAlgorithms hashingAlgorithms)
{
_patientRepository = patientRepository;
_hashingAlgorithms = hashingAlgorithms;
}
public async Task<BaseResponse> HandleGet(Guid id)
{
var patient = await _patientRepository.GetByIdAsync(id).ConfigureAwait(false);
if (patient != null)
return new BaseResponse
{
StatusCode = HttpStatusCodes.OK,
Message = $"Retrieved patient with id: {id}",
Data = patient
};
return new BaseResponse
{
StatusCode = HttpStatusCodes.NotFound,
Message = $"Patient with id: {id} not found",
Data = null
};
}
public async Task<BaseResponse> HandleGetAll()
{
var patients = await _patientRepository.GetAllAsync().ConfigureAwait(false);
if (patients.Any())
return new BaseResponse
{
StatusCode = HttpStatusCodes.OK,
Message = "Retrieved patients",
Data = patients.ToList()
};
return new BaseResponse
{
StatusCode = HttpStatusCodes.NotFound,
Message = "Patients not found",
Data = null
};
}
public async Task<BaseResponse> HandleUpdate(PatientProfileDto updateDto)
{
var validation = new PatientProfileValidation(_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 patientToUpdate = await _patientRepository.GetByIdAsync(updateDto.Id);
patientToUpdate.SetEmail(updateDto.Email);
patientToUpdate.SetPassword(_hashingAlgorithms.SHA256Algorithm(updateDto.Password));
patientToUpdate.SetName(updateDto.Name);
await _patientRepository.UpdateAsync(patientToUpdate);
return new BaseResponse
{
StatusCode = HttpStatusCodes.NoContent,
Message = null,
Data = null
};
}
public async Task<BaseResponse> HandleDelete(Guid id)
{
var patientToDelete = await _patientRepository.GetByIdAsync(id);
if (patientToDelete == null)
return new BaseResponse
{
StatusCode = HttpStatusCodes.NotFound,
Message = "Patient not found.",
Data = null
};
await _patientRepository.DeleteAsync(patientToDelete);
return new BaseResponse
{
StatusCode = HttpStatusCodes.NotFound,
Message = null,
Data = null
};
}
}
@@ -0,0 +1,47 @@
using Application.Services.Database;
using FluentValidation;
namespace Application.Endpoints.Patients.Profile;
public class PatientProfileValidation : AbstractValidator<PatientProfileDto>
{
private readonly IPatientRepository _patientRepository;
public PatientProfileValidation(IPatientRepository patientRepository)
{
_patientRepository = patientRepository;
RuleFor(x => x.Id)
.NotEmpty().WithMessage("Id is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MustAsync(IsPatientRegistered).WithMessage("Patient is registered in system")
.WithErrorCode(HttpStatusCodes.NotFound.ToString());
RuleFor(x => x.Email)
.NotEmpty().WithMessage("Email is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.EmailAddress().WithMessage("Invalid email format.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MustAsync(BeUniqueEmail).WithMessage("Email in use by another patient.")
.WithErrorCode(HttpStatusCodes.Conflict.ToString());
RuleFor(x => x.Password)
.NotEmpty().WithMessage("Password is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MinimumLength(8).WithMessage("Password must be at least 8 characters long.")
.WithErrorCode(HttpStatusCodes.BadRequest.ToString());
RuleFor(x => x.Name)
.NotEmpty().WithMessage("Name is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MinimumLength(3).WithMessage("Name must be at least 3 characters long.")
.WithErrorCode(HttpStatusCodes.BadRequest.ToString());
}
private async Task<bool> IsPatientRegistered(Guid id, CancellationToken cancellationToken)
{
var doctor = await _patientRepository.GetByIdAsync(id);
return doctor == null;
}
private async Task<bool> BeUniqueEmail(string email, CancellationToken cancellationToken)
{
var patient = await _patientRepository.FindByEmailAsync(email);
return patient == null;
}
}
@@ -1,6 +1,6 @@
namespace Application.Endpoints.Pacients.Login;
namespace Application.Endpoints.Patients.Registration;
public class PacientRegistrationDto
public class PatientRegistrationDto
{
public string Name { get; set; }
public string Email { get; set; }
@@ -0,0 +1,51 @@
using Application.Services.Database;
using Application.Services.HashingAlgorithms;
using Core.Entities;
namespace Application.Endpoints.Patients.Registration;
public class PatientRegistrationHandler
{
private readonly IHashingAlgorithms _hashingAlgorithms;
private readonly IPatientRepository _patientRepository;
public PatientRegistrationHandler(IPatientRepository patientRepository, IHashingAlgorithms hashingAlgorithms)
{
_patientRepository = patientRepository;
_hashingAlgorithms = hashingAlgorithms;
}
public async Task<BaseResponse> Handle(PatientRegistrationDto registrationDTO)
{
var validation = new PatientRegistrationValidation(_patientRepository);
var validationResult = await validation.ValidateAsync(registrationDTO);
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 patient = new Patient();
patient.SetEmail(registrationDTO.Email);
patient.SetName(registrationDTO.Name);
patient.SetPassword(_hashingAlgorithms.SHA256Algorithm(registrationDTO.Password));
await _patientRepository.AddAsync(patient);
return new BaseResponse
{
StatusCode = HttpStatusCodes.Created,
Message = "Patient registered successfully",
Data = patient // Be careful with sending sensitive data like Passwords
};
}
}
@@ -0,0 +1,34 @@
using Application.Services.Database;
using FluentValidation;
namespace Application.Endpoints.Patients.Registration;
public class PatientRegistrationValidation : AbstractValidator<PatientRegistrationDto>
{
private readonly IPatientRepository _patientRepository;
public PatientRegistrationValidation(IPatientRepository patientRepository)
{
_patientRepository = patientRepository;
RuleFor(x => x.Email)
.NotEmpty().WithMessage("Email is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.EmailAddress().WithMessage("Invalid email format.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MustAsync(BeUniqueEmail).WithMessage("Email already exists.").WithErrorCode(HttpStatusCodes.Conflict.ToString());
RuleFor(x => x.Password)
.NotEmpty().WithMessage("Password is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MinimumLength(8).WithMessage("Password must be at least 8 characters long.").WithErrorCode(HttpStatusCodes.BadRequest.ToString());
RuleFor(x => x.Name)
.NotEmpty().WithMessage("Name is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MinimumLength(3).WithMessage("Name must be at least 3 characters long.").WithErrorCode(HttpStatusCodes.BadRequest.ToString());
}
private async Task<bool> BeUniqueEmail(string email, CancellationToken cancellationToken)
{
var pacient = await _patientRepository.FindByEmailAsync(email);
return pacient == null;
}
}
@@ -0,0 +1,7 @@
namespace Application.Endpoints.Patients.ResetPassword;
public class PatientResetPasswordDto
{
public string? Email { get; set; }
public string? Password { get; set; }
}
@@ -0,0 +1,50 @@
using Application.Services.Database;
using Application.Services.HashingAlgorithms;
namespace Application.Endpoints.Patients.ResetPassword;
public class PatientResetPasswordHandler
{
private readonly IHashingAlgorithms _hashingAlgorithms;
private readonly IPatientRepository _patientRepository;
public PatientResetPasswordHandler(IPatientRepository patientRepository, IHashingAlgorithms hashingAlgorithms)
{
_patientRepository = patientRepository;
_hashingAlgorithms = hashingAlgorithms;
}
public async Task<BaseResponse> Handle(PatientResetPasswordDto patientResetPasswordDto)
{
patientResetPasswordDto.Password = _hashingAlgorithms.SHA256Algorithm(patientResetPasswordDto.Password);
var validation = new PatientResetPasswordValidation(_patientRepository);
var validationResult = await validation.ValidateAsync(patientResetPasswordDto);
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 currentPatient = await _patientRepository.FindByEmailAsync(patientResetPasswordDto.Email);
var updatedPatient = currentPatient;
updatedPatient.SetPassword(_hashingAlgorithms.SHA256Algorithm(patientResetPasswordDto.Password));
await _patientRepository.UpdateAsync(updatedPatient);
return new BaseResponse
{
StatusCode = HttpStatusCodes.OK,
Message = "Password successfully changed!",
Data = null
};
}
}
@@ -0,0 +1,40 @@
using Application.Services.Database;
using FluentValidation;
namespace Application.Endpoints.Patients.ResetPassword;
public class PatientResetPasswordValidation : AbstractValidator<PatientResetPasswordDto>
{
private readonly IPatientRepository _patientRepository;
public PatientResetPasswordValidation(IPatientRepository patientRepository)
{
_patientRepository = patientRepository;
RuleFor(x => x.Email)
.NotEmpty().WithMessage("Email is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.EmailAddress().WithMessage("Invalid email format.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MustAsync(BeExistingPacient).WithMessage("Patient with this email does not exist.")
.WithErrorCode(HttpStatusCodes.NotFound.ToString());
RuleFor(x => x.Password)
.NotEmpty().WithMessage("Password is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
.MustAsync((dto, password, context, cancellationToken) =>
BeDifferentFromOldPassword(dto.Email, password, cancellationToken))
.WithMessage("New password cannot be the same as old password.")
.WithErrorCode(HttpStatusCodes.BadRequest.ToString());
}
private async Task<bool> BeExistingPacient(string email, CancellationToken cancellationToken)
{
var pacient = await _patientRepository.FindByEmailAsync(email);
return pacient != null;
}
private async Task<bool> BeDifferentFromOldPassword(string email, string newPassword,
CancellationToken cancellationToken)
{
var currentPatient = await _patientRepository.FindByEmailAsync(email);
return !newPassword.Equals(currentPatient?.Password, StringComparison.Ordinal);
}
}
@@ -6,9 +6,10 @@ public interface IDoctorRepository
{
Task AddAsync(Doctor doctor);
Task<Doctor> GetByIdAsync(Guid id);
Task<Doctor?> GetByIdAsync(Guid id);
Task<Doctor?> FindByEmailAsync(string email);
Task<bool> CredentialsMatch(string email, string password);
Task UpdateAsync(Doctor doctor);
@@ -4,12 +4,9 @@ namespace Application.Services.Database;
public interface IMedicalHistoryRepository
{
Task<MedicalHistory> GetByIdAsync(Guid id);
Task<MedicalHistory?> GetByUserIdAsync(Guid userId);
Task<MedicalHistory?> GetByIdAsync(Guid id);
Task AddAsync(MedicalHistory medicalHistory);
Task UpdateAsync(MedicalHistory medicalHistory);
Task DeleteAsync(MedicalHistory medicalHistory);
Task<IEnumerable<MedicalHistory>> GetAllAsync();
}
@@ -0,0 +1,12 @@
using MongoDB.Driver;
namespace Application.Services.Database;
public interface IMongoDbService
{
IMongoCollection<T> GetCollection<T>(string collectionName);
Task<List<T>> FindAsync<T>(string collectionName, List<(string FieldName, string Value)> criteria);
Task AddAsync<T>(string collectionName, T document);
Task ModifyAsync<T>(string collectionName, string keyField, string keyValue, T document);
Task DeleteAsync<T>(string collectionName, string keyField, string keyValue);
}
@@ -2,17 +2,17 @@
namespace Application.Services.Database;
public interface IPacientRepository
public interface IPatientRepository
{
Task AddAsync(Pacient pacient);
Task AddAsync(Patient patient);
Task<Pacient> GetByIdAsync(Guid id);
Task<Patient?> GetByIdAsync(Guid id);
Task<Pacient?> FindByEmailAsync(string email);
Task<Patient?> FindByEmailAsync(string email);
Task UpdateAsync(Pacient doctor);
Task UpdateAsync(Patient doctor);
Task DeleteAsync(Pacient doctor);
Task DeleteAsync(Patient doctor);
Task<IEnumerable<Pacient>> GetAllAsync();
Task<IEnumerable<Patient>> GetAllAsync();
}
@@ -0,0 +1,6 @@
namespace Application.Services.HashingAlgorithms;
public interface IHashingAlgorithms
{
string? SHA256Algorithm(string? password);
}
@@ -8,12 +8,44 @@
".NETCoreApp,Version=v8.0": {
"Application/1.0.0": {
"dependencies": {
"FluentValidation": "11.9.0"
"Core": "1.0.0",
"FluentValidation": "11.9.0",
"MongoDB.Driver": "2.24.0"
},
"runtime": {
"Application.dll": {}
}
},
"AWSSDK.Core/3.7.100.14": {
"runtime": {
"lib/netcoreapp3.1/AWSSDK.Core.dll": {
"assemblyVersion": "3.3.0.0",
"fileVersion": "3.7.100.14"
}
}
},
"AWSSDK.SecurityToken/3.7.100.14": {
"dependencies": {
"AWSSDK.Core": "3.7.100.14"
},
"runtime": {
"lib/netcoreapp3.1/AWSSDK.SecurityToken.dll": {
"assemblyVersion": "3.3.0.0",
"fileVersion": "3.7.100.14"
}
}
},
"DnsClient/1.6.1": {
"dependencies": {
"Microsoft.Win32.Registry": "5.0.0"
},
"runtime": {
"lib/net5.0/DnsClient.dll": {
"assemblyVersion": "1.6.1.0",
"fileVersion": "1.6.1.0"
}
}
},
"FluentValidation/11.9.0": {
"runtime": {
"lib/net8.0/FluentValidation.dll": {
@@ -21,6 +53,133 @@
"fileVersion": "11.9.0.0"
}
}
},
"Microsoft.Extensions.Logging.Abstractions/2.0.0": {
"runtime": {
"lib/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.dll": {
"assemblyVersion": "2.0.0.0",
"fileVersion": "2.0.0.17205"
}
}
},
"Microsoft.NETCore.Platforms/5.0.0": {},
"Microsoft.Win32.Registry/5.0.0": {
"dependencies": {
"System.Security.AccessControl": "5.0.0",
"System.Security.Principal.Windows": "5.0.0"
}
},
"MongoDB.Bson/2.24.0": {
"dependencies": {
"System.Memory": "4.5.5",
"System.Runtime.CompilerServices.Unsafe": "5.0.0"
},
"runtime": {
"lib/netstandard2.1/MongoDB.Bson.dll": {
"assemblyVersion": "2.24.0.0",
"fileVersion": "2.24.0.0"
}
}
},
"MongoDB.Driver/2.24.0": {
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "2.0.0",
"MongoDB.Bson": "2.24.0",
"MongoDB.Driver.Core": "2.24.0",
"MongoDB.Libmongocrypt": "1.8.2"
},
"runtime": {
"lib/netstandard2.1/MongoDB.Driver.dll": {
"assemblyVersion": "2.24.0.0",
"fileVersion": "2.24.0.0"
}
}
},
"MongoDB.Driver.Core/2.24.0": {
"dependencies": {
"AWSSDK.SecurityToken": "3.7.100.14",
"DnsClient": "1.6.1",
"Microsoft.Extensions.Logging.Abstractions": "2.0.0",
"MongoDB.Bson": "2.24.0",
"MongoDB.Libmongocrypt": "1.8.2",
"SharpCompress": "0.30.1",
"Snappier": "1.0.0",
"System.Buffers": "4.5.1",
"ZstdSharp.Port": "0.7.3"
},
"runtime": {
"lib/netstandard2.1/MongoDB.Driver.Core.dll": {
"assemblyVersion": "2.24.0.0",
"fileVersion": "2.24.0.0"
}
}
},
"MongoDB.Libmongocrypt/1.8.2": {
"runtime": {
"lib/netstandard2.1/MongoDB.Libmongocrypt.dll": {
"assemblyVersion": "1.8.2.0",
"fileVersion": "1.8.2.0"
}
},
"runtimeTargets": {
"runtimes/linux/native/libmongocrypt.so": {
"rid": "linux",
"assetType": "native",
"fileVersion": "0.0.0.0"
},
"runtimes/osx/native/libmongocrypt.dylib": {
"rid": "osx",
"assetType": "native",
"fileVersion": "0.0.0.0"
},
"runtimes/win/native/mongocrypt.dll": {
"rid": "win",
"assetType": "native",
"fileVersion": "0.0.0.0"
}
}
},
"SharpCompress/0.30.1": {
"runtime": {
"lib/net5.0/SharpCompress.dll": {
"assemblyVersion": "0.30.1.0",
"fileVersion": "0.30.1.0"
}
}
},
"Snappier/1.0.0": {
"runtime": {
"lib/net5.0/Snappier.dll": {
"assemblyVersion": "1.0.0.0",
"fileVersion": "1.0.0.0"
}
}
},
"System.Buffers/4.5.1": {},
"System.Memory/4.5.5": {},
"System.Runtime.CompilerServices.Unsafe/5.0.0": {},
"System.Security.AccessControl/5.0.0": {
"dependencies": {
"Microsoft.NETCore.Platforms": "5.0.0",
"System.Security.Principal.Windows": "5.0.0"
}
},
"System.Security.Principal.Windows/5.0.0": {},
"ZstdSharp.Port/0.7.3": {
"runtime": {
"lib/net7.0/ZstdSharp.dll": {
"assemblyVersion": "0.7.3.0",
"fileVersion": "0.7.3.0"
}
}
},
"Core/1.0.0": {
"dependencies": {
"MongoDB.Bson": "2.24.0"
},
"runtime": {
"Core.dll": {}
}
}
}
},
@@ -30,12 +189,143 @@
"serviceable": false,
"sha512": ""
},
"AWSSDK.Core/3.7.100.14": {
"type": "package",
"serviceable": true,
"sha512": "sha512-gnEgxBlk4PFEfdPE8Lkf4+D16MZFYSaW7/o6Wwe5e035QWUkTJX0Dn4LfTCdV5QSEL/fOFxu+yCAm55eIIBgog==",
"path": "awssdk.core/3.7.100.14",
"hashPath": "awssdk.core.3.7.100.14.nupkg.sha512"
},
"AWSSDK.SecurityToken/3.7.100.14": {
"type": "package",
"serviceable": true,
"sha512": "sha512-dGCVuVo0CFUKWW85W8YENO+aREf8sCBDjvGbnNvxJuNW4Ss+brEU9ltHhq2KfZze2VUNK1/wygbPG1bmbpyXEw==",
"path": "awssdk.securitytoken/3.7.100.14",
"hashPath": "awssdk.securitytoken.3.7.100.14.nupkg.sha512"
},
"DnsClient/1.6.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-4H/f2uYJOZ+YObZjpY9ABrKZI+JNw3uizp6oMzTXwDw6F+2qIPhpRl/1t68O/6e98+vqNiYGu+lswmwdYUy3gg==",
"path": "dnsclient/1.6.1",
"hashPath": "dnsclient.1.6.1.nupkg.sha512"
},
"FluentValidation/11.9.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-VneVlTvwYDkfHV5av3QrQ0amALgrLX6LV94wlYyEsh0B/klJBW7C8y2eAtj5tOZ3jH6CAVpr4s1ZGgew/QWyig==",
"path": "fluentvalidation/11.9.0",
"hashPath": "fluentvalidation.11.9.0.nupkg.sha512"
},
"Microsoft.Extensions.Logging.Abstractions/2.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-6ZCllUYGFukkymSTx3Yr0G/ajRxoNJp7/FqSxSB4fGISST54ifBhgu4Nc0ItGi3i6DqwuNd8SUyObmiC++AO2Q==",
"path": "microsoft.extensions.logging.abstractions/2.0.0",
"hashPath": "microsoft.extensions.logging.abstractions.2.0.0.nupkg.sha512"
},
"Microsoft.NETCore.Platforms/5.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==",
"path": "microsoft.netcore.platforms/5.0.0",
"hashPath": "microsoft.netcore.platforms.5.0.0.nupkg.sha512"
},
"Microsoft.Win32.Registry/5.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==",
"path": "microsoft.win32.registry/5.0.0",
"hashPath": "microsoft.win32.registry.5.0.0.nupkg.sha512"
},
"MongoDB.Bson/2.24.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-n8CWaA4iTuoEQYv0+FSKNTX/hJozFQa5EgSILVNPhTGHcrbABHhpVrT1NwRRAAS6sUb8ZyhHmLPBa88LJemptA==",
"path": "mongodb.bson/2.24.0",
"hashPath": "mongodb.bson.2.24.0.nupkg.sha512"
},
"MongoDB.Driver/2.24.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-j1q11iMk3LN38ze6jgV1ATp+WKVVQbsGrhFkuOcHwRNtIk70TpLKjOD1Z3CCkyrzxCsUyhwk745tK2ASNOI4WA==",
"path": "mongodb.driver/2.24.0",
"hashPath": "mongodb.driver.2.24.0.nupkg.sha512"
},
"MongoDB.Driver.Core/2.24.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-UW0yadpMPi9+MtLHy6onpol3D9tXMRg61P0ROnij+h35EOr0vt/nxvlPrDcUjl3SvttvpsEXQKxb2lQShBA1dA==",
"path": "mongodb.driver.core/2.24.0",
"hashPath": "mongodb.driver.core.2.24.0.nupkg.sha512"
},
"MongoDB.Libmongocrypt/1.8.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-z/8JCULSHM1+mzkau0ivIkU9kIn8JEFFSkmYTSaMaWMMHt96JjUtMKuXxeGNGSnHZ5290ZPKIlQfjoWFk2sKog==",
"path": "mongodb.libmongocrypt/1.8.2",
"hashPath": "mongodb.libmongocrypt.1.8.2.nupkg.sha512"
},
"SharpCompress/0.30.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-XqD4TpfyYGa7QTPzaGlMVbcecKnXy4YmYLDWrU+JIj7IuRNl7DH2END+Ll7ekWIY8o3dAMWLFDE1xdhfIWD1nw==",
"path": "sharpcompress/0.30.1",
"hashPath": "sharpcompress.0.30.1.nupkg.sha512"
},
"Snappier/1.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-rFtK2KEI9hIe8gtx3a0YDXdHOpedIf9wYCEYtBEmtlyiWVX3XlCNV03JrmmAi/Cdfn7dxK+k0sjjcLv4fpHnqA==",
"path": "snappier/1.0.0",
"hashPath": "snappier.1.0.0.nupkg.sha512"
},
"System.Buffers/4.5.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==",
"path": "system.buffers/4.5.1",
"hashPath": "system.buffers.4.5.1.nupkg.sha512"
},
"System.Memory/4.5.5": {
"type": "package",
"serviceable": true,
"sha512": "sha512-XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==",
"path": "system.memory/4.5.5",
"hashPath": "system.memory.4.5.5.nupkg.sha512"
},
"System.Runtime.CompilerServices.Unsafe/5.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==",
"path": "system.runtime.compilerservices.unsafe/5.0.0",
"hashPath": "system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512"
},
"System.Security.AccessControl/5.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==",
"path": "system.security.accesscontrol/5.0.0",
"hashPath": "system.security.accesscontrol.5.0.0.nupkg.sha512"
},
"System.Security.Principal.Windows/5.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==",
"path": "system.security.principal.windows/5.0.0",
"hashPath": "system.security.principal.windows.5.0.0.nupkg.sha512"
},
"ZstdSharp.Port/0.7.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-U9Ix4l4cl58Kzz1rJzj5hoVTjmbx1qGMwzAcbv1j/d3NzrFaESIurQyg+ow4mivCgkE3S413y+U9k4WdnEIkRA==",
"path": "zstdsharp.port/0.7.3",
"hashPath": "zstdsharp.port.0.7.3.nupkg.sha512"
},
"Core/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -27,7 +27,11 @@
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
"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": {
@@ -43,6 +47,71 @@
"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"
}
}
},
"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Core\\Core.csproj": {
"version": "1.0.0",
"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",
"packagesPath": "C:\\Users\\Andrei Cerbu\\.nuget\\packages\\",
"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"
],
"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": [
@@ -12,4 +12,8 @@
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\Andrei Cerbu\.nuget\packages\" />
</ItemGroup>
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<PkgAWSSDK_Core Condition=" '$(PkgAWSSDK_Core)' == '' ">C:\Users\Andrei Cerbu\.nuget\packages\awssdk.core\3.7.100.14</PkgAWSSDK_Core>
<PkgAWSSDK_SecurityToken Condition=" '$(PkgAWSSDK_SecurityToken)' == '' ">C:\Users\Andrei Cerbu\.nuget\packages\awssdk.securitytoken\3.7.100.14</PkgAWSSDK_SecurityToken>
</PropertyGroup>
</Project>

Some files were not shown because too many files have changed in this diff Show More