API Traieste
This commit is contained in:
@@ -5,9 +5,9 @@ using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace Infrastructure.Data
|
||||
{
|
||||
public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory<HealthcareManagerContext>
|
||||
public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory<HealthcareManagerDatabase>
|
||||
{
|
||||
public HealthcareManagerContext CreateDbContext(string[] args)
|
||||
public HealthcareManagerDatabase CreateDbContext(string[] args)
|
||||
{
|
||||
// Adjust the path to point to the API project directory
|
||||
var basePath = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), @"..\API"));
|
||||
@@ -17,12 +17,12 @@ namespace Infrastructure.Data
|
||||
.AddJsonFile("appsettings.json")
|
||||
.Build();
|
||||
|
||||
var builder = new DbContextOptionsBuilder<HealthcareManagerContext>();
|
||||
var builder = new DbContextOptionsBuilder<HealthcareManagerDatabase>();
|
||||
var connectionString = configuration.GetConnectionString("HealthcareManagerDatabase");
|
||||
|
||||
builder.UseNpgsql(connectionString); // Make sure this matches your database provider
|
||||
|
||||
return new HealthcareManagerContext(builder.Options);
|
||||
return new HealthcareManagerDatabase(builder.Options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -3,9 +3,9 @@ using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Infrastructure.Data
|
||||
{
|
||||
public class HealthcareManagerContext : DbContext
|
||||
public class HealthcareManagerDatabase : DbContext
|
||||
{
|
||||
public HealthcareManagerContext(DbContextOptions<HealthcareManagerContext> options) : base(options) { }
|
||||
public HealthcareManagerDatabase(DbContextOptions<HealthcareManagerDatabase> options) : base(options) { }
|
||||
|
||||
public DbSet<Pacient> Pacients { get; set; }
|
||||
public DbSet<MedicalHistory> MedicalHistories { get; set; }
|
||||
@@ -3,9 +3,9 @@ using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
using Infrastructure.Data;
|
||||
using Infrastructure.Services.PostgreSQL;
|
||||
using Application.Contracts.Database;
|
||||
using Infrastructure.Services.MongoDB;
|
||||
using Application.Services.Database;
|
||||
using Infrastructure.Services.PostgreSQL;
|
||||
|
||||
namespace Infrastructure
|
||||
{
|
||||
@@ -13,7 +13,7 @@ namespace Infrastructure
|
||||
{
|
||||
public static IServiceCollection AddInfrastructureServices(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services.AddDbContext<HealthcareManagerContext>(options =>
|
||||
services.AddDbContext<HealthcareManagerDatabase>(options =>
|
||||
options.UseNpgsql(configuration.GetConnectionString("HealthcareManagerDatabase")));
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace Infrastructure.Migrations
|
||||
{
|
||||
[DbContext(typeof(HealthcareManagerContext))]
|
||||
[DbContext(typeof(HealthcareManagerDatabase))]
|
||||
[Migration("20240404131625_InitialCreate")]
|
||||
partial class InitialCreate
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace Infrastructure.Migrations
|
||||
{
|
||||
[DbContext(typeof(HealthcareManagerContext))]
|
||||
[DbContext(typeof(HealthcareManagerDatabase))]
|
||||
partial class HealthcareManagerContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
|
||||
@@ -5,9 +5,9 @@ namespace Infrastructure.Services.PostgreSQL
|
||||
{
|
||||
public class BasePostgreSQLRepository<T> where T : class
|
||||
{
|
||||
protected readonly HealthcareManagerContext _context;
|
||||
protected readonly HealthcareManagerDatabase _context;
|
||||
|
||||
public BasePostgreSQLRepository(HealthcareManagerContext context)
|
||||
public BasePostgreSQLRepository(HealthcareManagerDatabase context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
using Application.Contracts.Database;
|
||||
using Application.Services.Database;
|
||||
using Core.Entities;
|
||||
using Infrastructure.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Infrastructure.Services.PostgreSQL
|
||||
{
|
||||
public class DoctorRepository : BasePostgreSQLRepository<Doctor>, IDoctorRepository
|
||||
{
|
||||
public DoctorRepository(HealthcareManagerContext context) : base(context)
|
||||
public DoctorRepository(HealthcareManagerDatabase context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<bool> IsDoctorExisting(string email)
|
||||
{
|
||||
return await _context.Doctors.AnyAsync(d => d.Email == email);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Application.Contracts.Database;
|
||||
using Application.Services.Database;
|
||||
using Core.Entities;
|
||||
using Infrastructure.Data;
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Infrastructure.Services.PostgreSQL
|
||||
{
|
||||
public class MedicalHistoryRepository : BasePostgreSQLRepository<MedicalHistory>, IMedicalHistoryRepository
|
||||
{
|
||||
public MedicalHistoryRepository(HealthcareManagerContext context) : base(context)
|
||||
public MedicalHistoryRepository(HealthcareManagerDatabase context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Application.Contracts.Database;
|
||||
using Application.Services.Database;
|
||||
using Core.Entities;
|
||||
using Infrastructure.Data;
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Infrastructure.Services.PostgreSQL
|
||||
{
|
||||
public class PacientRepository : BasePostgreSQLRepository<Pacient>, IPacientRepository
|
||||
{
|
||||
public PacientRepository(HealthcareManagerContext context) : base(context)
|
||||
public PacientRepository(HealthcareManagerDatabase context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -52,6 +52,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"FluentValidation/11.9.0": {
|
||||
"runtime": {
|
||||
"lib/net8.0/FluentValidation.dll": {
|
||||
"assemblyVersion": "11.0.0.0",
|
||||
"fileVersion": "11.9.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Humanizer.Core/2.14.1": {
|
||||
"runtime": {
|
||||
"lib/net6.0/Humanizer.dll": {
|
||||
@@ -798,7 +806,7 @@
|
||||
},
|
||||
"Application/1.0.0": {
|
||||
"dependencies": {
|
||||
"Core": "1.0.0"
|
||||
"FluentValidation": "11.9.0"
|
||||
},
|
||||
"runtime": {
|
||||
"Application.dll": {}
|
||||
@@ -841,6 +849,13 @@
|
||||
"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"
|
||||
},
|
||||
"Humanizer.Core/2.14.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -14,7 +14,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("Infrastructure")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+041abb59007874167884872bc1a73e753930824b")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+22f171b5600c0f2fcef2f7c927f96f78a59a27a4")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("Infrastructure")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("Infrastructure")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@@ -1 +1 @@
|
||||
37739c6936214b736dcafc37ee13becfa8bde1272044e95b35ade37b523d35cc
|
||||
651445d22d5dfd399b035786f423f78d7f7aa483122ec0a10adf8c7f58d39dab
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+1
-1
@@ -1 +1 @@
|
||||
b94971108e5833d190f01f7875841746fa0330a6936eacb7b03bc117a503998d
|
||||
5afb3ed7d16a2df0400eb200d8278f7eab743b937793203fe737f90a0ba6f42f
|
||||
|
||||
@@ -2,9 +2,7 @@ C:\Users\Andrei Cerbu\Documents\FACULTATE\CC-FinalProj\backend\Infrastructure\bi
|
||||
C:\Users\Andrei Cerbu\Documents\FACULTATE\CC-FinalProj\backend\Infrastructure\bin\Debug\net8.0\Infrastructure.runtimeconfig.json
|
||||
C:\Users\Andrei Cerbu\Documents\FACULTATE\CC-FinalProj\backend\Infrastructure\bin\Debug\net8.0\Infrastructure.dll
|
||||
C:\Users\Andrei Cerbu\Documents\FACULTATE\CC-FinalProj\backend\Infrastructure\bin\Debug\net8.0\Infrastructure.pdb
|
||||
C:\Users\Andrei Cerbu\Documents\FACULTATE\CC-FinalProj\backend\Infrastructure\bin\Debug\net8.0\Application.dll
|
||||
C:\Users\Andrei Cerbu\Documents\FACULTATE\CC-FinalProj\backend\Infrastructure\bin\Debug\net8.0\Core.dll
|
||||
C:\Users\Andrei Cerbu\Documents\FACULTATE\CC-FinalProj\backend\Infrastructure\bin\Debug\net8.0\Application.pdb
|
||||
C:\Users\Andrei Cerbu\Documents\FACULTATE\CC-FinalProj\backend\Infrastructure\bin\Debug\net8.0\Core.pdb
|
||||
C:\Users\Andrei Cerbu\Documents\FACULTATE\CC-FinalProj\backend\Infrastructure\obj\Debug\net8.0\Infrastructure.csproj.AssemblyReference.cache
|
||||
C:\Users\Andrei Cerbu\Documents\FACULTATE\CC-FinalProj\backend\Infrastructure\obj\Debug\net8.0\Infrastructure.GeneratedMSBuildEditorConfig.editorconfig
|
||||
@@ -18,3 +16,5 @@ C:\Users\Andrei Cerbu\Documents\FACULTATE\CC-FinalProj\backend\Infrastructure\ob
|
||||
C:\Users\Andrei Cerbu\Documents\FACULTATE\CC-FinalProj\backend\Infrastructure\obj\Debug\net8.0\Infrastructure.pdb
|
||||
C:\Users\Andrei Cerbu\Documents\FACULTATE\CC-FinalProj\backend\Infrastructure\obj\Debug\net8.0\Infrastructure.genruntimeconfig.cache
|
||||
C:\Users\Andrei Cerbu\Documents\FACULTATE\CC-FinalProj\backend\Infrastructure\obj\Debug\net8.0\ref\Infrastructure.dll
|
||||
C:\Users\Andrei Cerbu\Documents\FACULTATE\CC-FinalProj\backend\Infrastructure\bin\Debug\net8.0\Application.dll
|
||||
C:\Users\Andrei Cerbu\Documents\FACULTATE\CC-FinalProj\backend\Infrastructure\bin\Debug\net8.0\Application.pdb
|
||||
|
||||
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/041abb59007874167884872bc1a73e753930824b/*"}}
|
||||
{"documents":{"C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\*":"https://raw.githubusercontent.com/andrei-mihnea-cerbu/CC-FinalProj/22f171b5600c0f2fcef2f7c927f96f78a59a27a4/*"}}
|
||||
Binary file not shown.
Binary file not shown.
@@ -27,11 +27,7 @@
|
||||
"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"
|
||||
}
|
||||
}
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
@@ -48,6 +44,12 @@
|
||||
"frameworks": {
|
||||
"net8.0": {
|
||||
"targetAlias": "net8.0",
|
||||
"dependencies": {
|
||||
"FluentValidation": {
|
||||
"target": "Package",
|
||||
"version": "[11.9.0, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
|
||||
@@ -47,6 +47,19 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"FluentValidation/11.9.0": {
|
||||
"type": "package",
|
||||
"compile": {
|
||||
"lib/net8.0/FluentValidation.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/FluentValidation.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Humanizer.Core/2.14.1": {
|
||||
"type": "package",
|
||||
"compile": {
|
||||
@@ -1297,7 +1310,7 @@
|
||||
"type": "project",
|
||||
"framework": ".NETCoreApp,Version=v8.0",
|
||||
"dependencies": {
|
||||
"Core": "1.0.0"
|
||||
"FluentValidation": "11.9.0"
|
||||
},
|
||||
"compile": {
|
||||
"bin/placeholder/Application.dll": {}
|
||||
@@ -1398,6 +1411,31 @@
|
||||
"lib/netstandard2.1/DnsClient.xml"
|
||||
]
|
||||
},
|
||||
"FluentValidation/11.9.0": {
|
||||
"sha512": "VneVlTvwYDkfHV5av3QrQ0amALgrLX6LV94wlYyEsh0B/klJBW7C8y2eAtj5tOZ3jH6CAVpr4s1ZGgew/QWyig==",
|
||||
"type": "package",
|
||||
"path": "fluentvalidation/11.9.0",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"README.md",
|
||||
"fluent-validation-icon.png",
|
||||
"fluentvalidation.11.9.0.nupkg.sha512",
|
||||
"fluentvalidation.nuspec",
|
||||
"lib/net5.0/FluentValidation.dll",
|
||||
"lib/net5.0/FluentValidation.xml",
|
||||
"lib/net6.0/FluentValidation.dll",
|
||||
"lib/net6.0/FluentValidation.xml",
|
||||
"lib/net7.0/FluentValidation.dll",
|
||||
"lib/net7.0/FluentValidation.xml",
|
||||
"lib/net8.0/FluentValidation.dll",
|
||||
"lib/net8.0/FluentValidation.xml",
|
||||
"lib/netstandard2.0/FluentValidation.dll",
|
||||
"lib/netstandard2.0/FluentValidation.xml",
|
||||
"lib/netstandard2.1/FluentValidation.dll",
|
||||
"lib/netstandard2.1/FluentValidation.xml"
|
||||
]
|
||||
},
|
||||
"Humanizer.Core/2.14.1": {
|
||||
"sha512": "lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw==",
|
||||
"type": "package",
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "QxcMSFdqhCge7YSJWNthupvu6Gj9ImaJiDgkN1zdgqCDv4a6v6pyKWwXHRUJwk3fYV/zyMMFm6HdLSRq7agAQg==",
|
||||
"dgSpecHash": "cIp74UZoopWKpKZUGSD2r4TkckxyBCJujlinYrCyKBuiYdsS5e55yFPuSA+UaPQHdS11DdXiDsJZw/IZ/GGz3Q==",
|
||||
"success": true,
|
||||
"projectFilePath": "C:\\Users\\Andrei Cerbu\\Documents\\FACULTATE\\CC-FinalProj\\backend\\Infrastructure\\Infrastructure.csproj",
|
||||
"expectedPackageFiles": [
|
||||
"C:\\Users\\Andrei Cerbu\\.nuget\\packages\\awssdk.core\\3.7.100.14\\awssdk.core.3.7.100.14.nupkg.sha512",
|
||||
"C:\\Users\\Andrei Cerbu\\.nuget\\packages\\awssdk.securitytoken\\3.7.100.14\\awssdk.securitytoken.3.7.100.14.nupkg.sha512",
|
||||
"C:\\Users\\Andrei Cerbu\\.nuget\\packages\\dnsclient\\1.6.1\\dnsclient.1.6.1.nupkg.sha512",
|
||||
"C:\\Users\\Andrei Cerbu\\.nuget\\packages\\fluentvalidation\\11.9.0\\fluentvalidation.11.9.0.nupkg.sha512",
|
||||
"C:\\Users\\Andrei Cerbu\\.nuget\\packages\\humanizer.core\\2.14.1\\humanizer.core.2.14.1.nupkg.sha512",
|
||||
"C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.bcl.asyncinterfaces\\6.0.0\\microsoft.bcl.asyncinterfaces.6.0.0.nupkg.sha512",
|
||||
"C:\\Users\\Andrei Cerbu\\.nuget\\packages\\microsoft.codeanalysis.analyzers\\3.3.3\\microsoft.codeanalysis.analyzers.3.3.3.nupkg.sha512",
|
||||
|
||||
Reference in New Issue
Block a user