Downgrade target frameworks and update dependencies
- Downgraded target frameworks from net9.0 to net8.0 in multiple projects. - Updated package references to older versions across various projects. - Added and updated using directives in several files for better dependency management. - Modified `Student` entity to make `SectionId` nullable and updated related methods. - Introduced new migration files to reflect schema changes in the database. - Added new `ValidationException` and `ValidationBehavior` classes for improved validation handling. - Updated `launchUrl` in `launchSettings.json` to include `/swagger/v1`. - Reformatted constructor parameters in `Patient.cs` for better readability. - Removed `Sections` property from `University.cs`. - Changed `PatientId` and `Patient` properties in `MedicalHistory.cs` to internal.master
parent
1a813edf6a
commit
ab56bf3c20
|
@ -13,7 +13,7 @@
|
|||
},
|
||||
"SiteSettings": {
|
||||
"KaveNegarApiKey": "3735494B4143727A794346457461576A2B4B6668414973424E333561505A694B",
|
||||
"BaseUrl": "http://localhost:32769",
|
||||
"BaseUrl": "http://localhost:32780",
|
||||
"UserSetting": {
|
||||
"Username": "Root",
|
||||
"Email": "info@brizco.io",
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
namespace DocuMed.Api.Controllers;
|
||||
using DocuMed.Domain.CommandQueries.Queries;
|
||||
using DocuMed.Domain.Models;
|
||||
using MediatR;
|
||||
|
||||
namespace DocuMed.Api.Controllers;
|
||||
|
||||
public class PatientController : ICarterModule
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
|
@ -13,42 +13,43 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="Asp.Versioning.Http" Version="8.1.0" />
|
||||
<PackageReference Include="Ben.BlockingDetector" Version="0.0.4" />
|
||||
<PackageReference Include="Carter" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.0">
|
||||
<PackageReference Include="Carter" Version="8.2.1" />
|
||||
<PackageReference Include="MediatR.Extensions.Autofac.DependencyInjection" Version="12.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.8" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.8" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.8">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.8">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Autofac" Version="8.2.0" />
|
||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="10.0.0" />
|
||||
<PackageReference Include="Elmah.Io.AspNetCore.Serilog" Version="5.1.23" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.8" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="9.0.0" />
|
||||
<PackageReference Include="Sentry.Serilog" Version="5.0.0" />
|
||||
<PackageReference Include="Serilog" Version="4.2.0" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.8" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.5" />
|
||||
<PackageReference Include="Sentry.Serilog" Version="4.11.0" />
|
||||
<PackageReference Include="Serilog" Version="4.0.1" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="8.0.2" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.PostgreSQL" Version="2.3.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Seq" Version="9.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.ElmahIo" Version="5.2.50" />
|
||||
<PackageReference Include="Serilog.Sinks.Seq" Version="8.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.ElmahIo" Version="5.1.43" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
|
||||
<PackageReference Include="StackExchange.Redis.Extensions.AspNetCore" Version="10.2.0" />
|
||||
<PackageReference Include="StackExchange.Redis.Extensions.Core" Version="10.2.0" />
|
||||
<PackageReference Include="StackExchange.Redis.Extensions.Newtonsoft" Version="10.2.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.2.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="7.2.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.8.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="8.0.2" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.9.0" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="9.0.0" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="8.0.8" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -73,7 +74,6 @@
|
|||
<Using Include="DocuMed.Core.EntityServices.Abstracts" />
|
||||
<Using Include="DocuMed.Core.Models.Api" />
|
||||
<Using Include="DocuMed.Domain" />
|
||||
<Using Include="DocuMed.Domain.CommandQueries.Queries" />
|
||||
<Using Include="DocuMed.Domain.Dtos.LargDtos" />
|
||||
<Using Include="DocuMed.Domain.Dtos.RequestDtos" />
|
||||
<Using Include="DocuMed.Domain.Dtos.SmallDtos" />
|
||||
|
@ -82,7 +82,6 @@
|
|||
<Using Include="DocuMed.Domain.Entities.User" />
|
||||
<Using Include="DocuMed.Domain.Enums.QueryFilters" />
|
||||
<Using Include="DocuMed.Domain.Mappers" />
|
||||
<Using Include="DocuMed.Domain.Models" />
|
||||
<Using Include="DocuMed.Domain.Models.Settings" />
|
||||
<Using Include="DocuMed.Infrastructure" />
|
||||
<Using Include="DocuMed.Infrastructure.Models" />
|
||||
|
@ -92,7 +91,7 @@
|
|||
<Using Include="DocuMed.Repository.Models" />
|
||||
<Using Include="DocuMed.Repository.Repositories.Base.Contracts" />
|
||||
<Using Include="DocuMed.Repository.Repositories.Entities.Abstracts" />
|
||||
<Using Include="MediatR" />
|
||||
<Using Include="MediatR.Extensions.Autofac.DependencyInjection" />
|
||||
<Using Include="Microsoft.AspNetCore.Authentication.JwtBearer" />
|
||||
<Using Include="Microsoft.AspNetCore.Identity" />
|
||||
<Using Include="Microsoft.AspNetCore.Mvc" />
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
using DocuMed.Api.WebFramework.MiddleWares;
|
||||
using DocuMed.Repository.Behaviors;
|
||||
using MediatR.Extensions.Autofac.DependencyInjection.Builder;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.Host.UseServiceProviderFactory(new AutofacServiceProviderFactory());
|
||||
|
@ -65,6 +67,24 @@ builder.Host.ConfigureContainer<ContainerBuilder>(builder =>
|
|||
.AssignableTo<IScopedDependency>()
|
||||
.AsImplementedInterfaces()
|
||||
.InstancePerLifetimeScope();
|
||||
|
||||
builder.RegisterMediatR(MediatRConfigurationBuilder
|
||||
.Create(typeof(RepositoryConfig).Assembly)
|
||||
.WithCustomPipelineBehavior(typeof(ValidationBehavior<,>))
|
||||
.WithAllOpenGenericHandlerTypesRegistered()
|
||||
.Build());
|
||||
|
||||
builder.RegisterMediatR(MediatRConfigurationBuilder
|
||||
.Create(typeof(CoreConfig).Assembly)
|
||||
.WithCustomPipelineBehavior(typeof(ValidationBehavior<,>))
|
||||
.WithAllOpenGenericHandlerTypesRegistered()
|
||||
.Build());
|
||||
|
||||
builder.RegisterMediatR(MediatRConfigurationBuilder
|
||||
.Create(typeof(DomainConfig).Assembly)
|
||||
.WithCustomPipelineBehavior(typeof(ValidationBehavior<,>))
|
||||
.WithAllOpenGenericHandlerTypesRegistered()
|
||||
.Build());
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
|
||||
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger/v1",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_URLS": "http://+:80"
|
||||
},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<!--<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<LangVersion>10</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
|||
</ItemGroup>-->
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<LangVersion>10</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
@ -24,7 +24,7 @@
|
|||
<PackageReference Include="MD.PersianDateTime.Standard" Version="2.5.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.3.0" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
namespace DocuMed.Common.Models.Exception;
|
||||
|
||||
public class ValidationException : System.Exception
|
||||
{
|
||||
public ValidationException() : base("Validation has been failed")
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ValidationException(params ValidationError[] validationErrors) : base($"{string.Join(",", validationErrors.Select(v => v.ErrorMessage))}")
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ValidationException(List<ValidationError> validationErrors) : base($"{string.Join(",", validationErrors.Select(v => v.ErrorMessage))}")
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
public sealed record ValidationError(string PropertyName, string ErrorMessage);
|
|
@ -114,7 +114,9 @@ public class AccountService(
|
|||
.FirstOrDefaultAsync(f => f.UserId == user.Id, cancellationToken);
|
||||
if (student == null)
|
||||
{
|
||||
student = Student.Create(requestDto.UniversityId,requestDto.SectionId,user.Id);
|
||||
student = Student.Create(requestDto.UniversityId, user.Id);
|
||||
if (requestDto.SectionId != default)
|
||||
student.SetSection(requestDto.SectionId);
|
||||
repositoryWrapper.SetRepository<Student>().Add(student);
|
||||
await repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<PackageReference Include="AspNetCoreRateLimit.Redis" Version="2.0.0" />
|
||||
<PackageReference Include="Autofac.Extras.Quartz" Version="10.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
|
||||
<PackageReference Include="Quartz" Version="3.13.1" />
|
||||
<PackageReference Include="Quartz" Version="3.13.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
@ -9,14 +9,14 @@
|
|||
<PackageReference Include="Mapster" Version="7.4.0" />
|
||||
<PackageReference Include="Mapster.Core" Version="1.2.1" />
|
||||
<PackageReference Include="MediatR" Version="12.4.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="8.0.8" />
|
||||
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<!--<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<LangVersion>10</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
@ -45,6 +45,7 @@
|
|||
<Folder Include="Dtos\ResponseDtos\" />
|
||||
<Folder Include="Dtos\RequestDtos\" />
|
||||
<Folder Include="Entities\City\" />
|
||||
<Folder Include="Entities\Patients\" />
|
||||
<Folder Include="Entities\User\" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace DocuMed.Domain.Dtos.SmallDtos;
|
||||
using DocuMed.Domain.Entities.Patients;
|
||||
|
||||
namespace DocuMed.Domain.Dtos.SmallDtos;
|
||||
|
||||
public class PatientSDto : BaseDto<PatientSDto,Patient>
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@ public class StudentSDto : BaseDto<StudentSDto,Student>
|
|||
public Guid UniversityId { get; set; }
|
||||
public string UniversityName { get; set; } = string.Empty;
|
||||
|
||||
public Guid SectionId { get; set; }
|
||||
public Guid? SectionId { get; set; }
|
||||
public string SectionName { get; set; } = string.Empty;
|
||||
|
||||
public Guid UserId { get; set; }
|
||||
|
|
|
@ -21,6 +21,4 @@ public partial class University : ApiEntity
|
|||
|
||||
public Guid CityId { get; internal set; }
|
||||
public City? City { get; internal set; }
|
||||
|
||||
public List<Hospitals.Section> Sections { get; internal set; } = new();
|
||||
}
|
|
@ -84,8 +84,8 @@ public partial class MedicalHistory : ApiEntity
|
|||
public Guid StudentId { get; internal set; }
|
||||
public Student? Student { get; internal set; }
|
||||
|
||||
public Guid PatientId { get; set; }
|
||||
public Patient? Patient { get; set; }
|
||||
public Guid PatientId { get; internal set; }
|
||||
public Patient? Patient { get; internal set; }
|
||||
|
||||
public List<MedicalHistoryAnswer> Answers { get; internal set; } = new();
|
||||
}
|
|
@ -11,7 +11,11 @@ public partial class Patient : ApiEntity
|
|||
|
||||
}
|
||||
|
||||
public Patient(string unitNumber, string room, string bed, DateTime admissionAt,Guid sectionId,Guid hospitalId, Guid userId)
|
||||
public Patient(string unitNumber, string room, string bed,
|
||||
DateTime admissionAt,
|
||||
Guid sectionId,
|
||||
Guid hospitalId,
|
||||
Guid userId)
|
||||
{
|
||||
UnitNumber = unitNumber;
|
||||
Room = room;
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
public partial class Student
|
||||
{
|
||||
public static Student Create(Guid universityId, Guid sectionId, Guid userId)
|
||||
=> new Student(universityId, sectionId, userId);
|
||||
public static Student Create(Guid universityId, Guid userId)
|
||||
=> new Student(universityId, userId);
|
||||
|
||||
public void SetSection(Guid sectionId)
|
||||
=> SectionId = sectionId;
|
||||
}
|
|
@ -11,10 +11,9 @@ public partial class Student : ApiEntity
|
|||
|
||||
}
|
||||
|
||||
public Student(Guid universityId, Guid sectionId, Guid userId)
|
||||
public Student(Guid universityId, Guid userId)
|
||||
{
|
||||
UniversityId = universityId;
|
||||
SectionId = sectionId;
|
||||
UserId = userId;
|
||||
}
|
||||
|
||||
|
@ -23,7 +22,7 @@ public partial class Student : ApiEntity
|
|||
public Guid UniversityId { get; internal set; }
|
||||
public University? University { get; internal set; }
|
||||
|
||||
public Guid SectionId { get; internal set; }
|
||||
public Guid? SectionId { get; internal set; }
|
||||
public Section? Section { get; internal set; }
|
||||
|
||||
public Guid UserId { get; internal set; }
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace DocuMed.Domain.Mappers
|
|||
Section = new Section()
|
||||
{
|
||||
Name = p1.SectionName,
|
||||
Id = p1.SectionId
|
||||
Id = p1.SectionId.Value
|
||||
},
|
||||
UserId = p1.UserId,
|
||||
User = new ApplicationUser() {Id = p1.UserId},
|
||||
|
@ -65,7 +65,7 @@ namespace DocuMed.Domain.Mappers
|
|||
Section = new Section()
|
||||
{
|
||||
Name = p10.SectionName,
|
||||
Id = p10.SectionId
|
||||
Id = p10.SectionId.Value
|
||||
},
|
||||
UserId = p10.UserId,
|
||||
User = new ApplicationUser() {Id = p10.UserId},
|
||||
|
@ -140,7 +140,7 @@ namespace DocuMed.Domain.Mappers
|
|||
Section result = p7 ?? new Section();
|
||||
|
||||
result.Name = p2.SectionName;
|
||||
result.Id = p2.SectionId;
|
||||
result.Id = p2.SectionId.Value;
|
||||
return result;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Refit" Version="8.0.0" />
|
||||
<PackageReference Include="Refit" Version="7.2.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<Exec Command="npm run buildcss" />
|
||||
</Target>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
|
||||
|
@ -13,15 +13,15 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
|
||||
<PackageReference Include="Blazorise.LottieAnimation" Version="1.7.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.0" PrivateAssets="all" />
|
||||
<PackageReference Include="Blazorise.LottieAnimation" Version="1.6.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.8" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.8" PrivateAssets="all" />
|
||||
<PackageReference Include="MudBlazor" Version="6.13.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="Refit" Version="8.0.0" />
|
||||
<PackageReference Include="Refit.HttpClientFactory" Version="8.0.0" />
|
||||
<PackageReference Include="Refit.Newtonsoft.Json" Version="8.0.0" />
|
||||
<PackageReference Include="Toolbelt.Blazor.PWA.Updater" Version="3.0.1" />
|
||||
<PackageReference Include="Refit" Version="7.2.1" />
|
||||
<PackageReference Include="Refit.HttpClientFactory" Version="7.2.1" />
|
||||
<PackageReference Include="Refit.Newtonsoft.Json" Version="7.2.1" />
|
||||
<PackageReference Include="Toolbelt.Blazor.PWA.Updater" Version="2.1.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
using FluentValidation;
|
||||
using ValidationError = DocuMed.Common.Models.Exception.ValidationError;
|
||||
|
||||
namespace DocuMed.Repository.Behaviors;
|
||||
|
||||
public class ValidationBehavior<TRequest, TResponse>(IEnumerable<IValidator<TRequest>> validators)
|
||||
: IPipelineBehavior<TRequest, TResponse>
|
||||
where TRequest : notnull
|
||||
{
|
||||
public async Task<TResponse> Handle(TRequest request, RequestHandlerDelegate<TResponse> next, CancellationToken cancellationToken)
|
||||
{
|
||||
var context = new ValidationContext<TRequest>(request);
|
||||
List<ValidationError> errors = new List<ValidationError>();
|
||||
foreach (IValidator<TRequest> validator in validators)
|
||||
{
|
||||
var result = await validator.ValidateAsync(context, cancellationToken);
|
||||
if (!result.IsValid)
|
||||
errors.AddRange(result.Errors.Select(v => new ValidationError(v.PropertyName, v.ErrorMessage)).Distinct());
|
||||
}
|
||||
|
||||
if (errors.Any())
|
||||
{
|
||||
throw new Common.Models.Exception.ValidationException(errors);
|
||||
}
|
||||
|
||||
|
||||
var response = await next();
|
||||
return response;
|
||||
}
|
||||
}
|
|
@ -1,26 +1,27 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FluentValidation" Version="11.11.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.0">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.8" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.8">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.8">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Pluralize.NET" Version="1.0.2" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.0" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.8.24" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.8" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.8" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.8.16" />
|
||||
<PackageReference Include="StackExchange.Redis.Extensions.Core" Version="10.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using MediatR;
|
||||
using DocuMed.Domain.Entities.Staffs;
|
||||
using MediatR;
|
||||
|
||||
namespace DocuMed.Repository.Handlers.MedicalHistories;
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,758 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DocuMed.Repository.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Init : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.EnsureSchema(
|
||||
name: "public");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Cities",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedBy = table.Column<string>(type: "text", nullable: true),
|
||||
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
|
||||
RemovedBy = table.Column<string>(type: "text", nullable: true),
|
||||
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
ModifiedBy = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Cities", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Roles",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Description = table.Column<string>(type: "text", nullable: false),
|
||||
EnglishName = table.Column<string>(type: "text", nullable: false),
|
||||
PersianName = table.Column<string>(type: "text", nullable: false),
|
||||
Name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||
NormalizedName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||
ConcurrencyStamp = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Roles", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Users",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
FirstName = table.Column<string>(type: "text", nullable: false),
|
||||
LastName = table.Column<string>(type: "text", nullable: false),
|
||||
NationalId = table.Column<string>(type: "text", nullable: false),
|
||||
BirthDate = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
Gender = table.Column<int>(type: "integer", nullable: false),
|
||||
SignUpStatus = table.Column<int>(type: "integer", nullable: false),
|
||||
UserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||
NormalizedUserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||
Email = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||
NormalizedEmail = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||
EmailConfirmed = table.Column<bool>(type: "boolean", nullable: false),
|
||||
PasswordHash = table.Column<string>(type: "text", nullable: true),
|
||||
SecurityStamp = table.Column<string>(type: "text", nullable: true),
|
||||
ConcurrencyStamp = table.Column<string>(type: "text", nullable: true),
|
||||
PhoneNumber = table.Column<string>(type: "text", nullable: true),
|
||||
PhoneNumberConfirmed = table.Column<bool>(type: "boolean", nullable: false),
|
||||
TwoFactorEnabled = table.Column<bool>(type: "boolean", nullable: false),
|
||||
LockoutEnd = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
|
||||
LockoutEnabled = table.Column<bool>(type: "boolean", nullable: false),
|
||||
AccessFailedCount = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Users", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Universities",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
Address = table.Column<string>(type: "text", nullable: false),
|
||||
CityId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedBy = table.Column<string>(type: "text", nullable: true),
|
||||
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
|
||||
RemovedBy = table.Column<string>(type: "text", nullable: true),
|
||||
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
ModifiedBy = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Universities", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Universities_Cities_CityId",
|
||||
column: x => x.CityId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Cities",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "RoleClaims",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
RoleId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ClaimType = table.Column<string>(type: "text", nullable: true),
|
||||
ClaimValue = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_RoleClaims", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_RoleClaims_Roles_RoleId",
|
||||
column: x => x.RoleId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Roles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Claims",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ClaimType = table.Column<string>(type: "text", nullable: true),
|
||||
ClaimValue = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Claims", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Claims_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Logins",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
LoginProvider = table.Column<string>(type: "text", nullable: false),
|
||||
ProviderKey = table.Column<string>(type: "text", nullable: false),
|
||||
ProviderDisplayName = table.Column<string>(type: "text", nullable: true),
|
||||
UserId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Logins", x => new { x.LoginProvider, x.ProviderKey });
|
||||
table.ForeignKey(
|
||||
name: "FK_Logins_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Tokens",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
LoginProvider = table.Column<string>(type: "text", nullable: false),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
Value = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Tokens", x => new { x.UserId, x.LoginProvider, x.Name });
|
||||
table.ForeignKey(
|
||||
name: "FK_Tokens_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "UserRoles",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
RoleId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_UserRoles", x => new { x.UserId, x.RoleId });
|
||||
table.ForeignKey(
|
||||
name: "FK_UserRoles_Roles_RoleId",
|
||||
column: x => x.RoleId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Roles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_UserRoles_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Hospitals",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
Detail = table.Column<string>(type: "text", nullable: false),
|
||||
Address = table.Column<string>(type: "text", nullable: false),
|
||||
UniversityId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedBy = table.Column<string>(type: "text", nullable: true),
|
||||
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
|
||||
RemovedBy = table.Column<string>(type: "text", nullable: true),
|
||||
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
ModifiedBy = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Hospitals", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Hospitals_Universities_UniversityId",
|
||||
column: x => x.UniversityId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Universities",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Sections",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
Detail = table.Column<string>(type: "text", nullable: false),
|
||||
HospitalId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
UniversityId = table.Column<Guid>(type: "uuid", nullable: true),
|
||||
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedBy = table.Column<string>(type: "text", nullable: true),
|
||||
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
|
||||
RemovedBy = table.Column<string>(type: "text", nullable: true),
|
||||
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
ModifiedBy = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Sections", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Sections_Hospitals_HospitalId",
|
||||
column: x => x.HospitalId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Hospitals",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_Sections_Universities_UniversityId",
|
||||
column: x => x.UniversityId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Universities",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Patients",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
UnitNumber = table.Column<string>(type: "text", nullable: false),
|
||||
Room = table.Column<string>(type: "text", nullable: false),
|
||||
Bed = table.Column<string>(type: "text", nullable: false),
|
||||
AdmissionAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
SectionId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
HospitalId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedBy = table.Column<string>(type: "text", nullable: true),
|
||||
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
|
||||
RemovedBy = table.Column<string>(type: "text", nullable: true),
|
||||
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
ModifiedBy = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Patients", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Patients_Sections_SectionId",
|
||||
column: x => x.SectionId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Sections",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_Patients_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Students",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
StudentId = table.Column<string>(type: "text", nullable: false),
|
||||
UniversityId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
SectionId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedBy = table.Column<string>(type: "text", nullable: true),
|
||||
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
|
||||
RemovedBy = table.Column<string>(type: "text", nullable: true),
|
||||
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
ModifiedBy = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Students", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Students_Sections_SectionId",
|
||||
column: x => x.SectionId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Sections",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_Students_Universities_UniversityId",
|
||||
column: x => x.UniversityId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Universities",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_Students_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "MedicalHistories",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ChiefComplaint = table.Column<string>(type: "text", nullable: false),
|
||||
SectionId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
PresentIllnessDetail = table.Column<string>(type: "text", nullable: false),
|
||||
PastDiseasesHistoryDetail = table.Column<string>(type: "text", nullable: false),
|
||||
PastSurgeryHistoryDetail = table.Column<string>(type: "text", nullable: false),
|
||||
FamilyHistoryDetail = table.Column<string>(type: "text", nullable: false),
|
||||
AllergyDetail = table.Column<string>(type: "text", nullable: false),
|
||||
DrugHistoryDetail = table.Column<string>(type: "text", nullable: false),
|
||||
AddictionHistoryDetail = table.Column<string>(type: "text", nullable: false),
|
||||
SystemReviewDetail = table.Column<string>(type: "text", nullable: false),
|
||||
VitalSignDetail = table.Column<string>(type: "text", nullable: false),
|
||||
GeneralAppearanceDetail = table.Column<string>(type: "text", nullable: false),
|
||||
Code = table.Column<string>(type: "text", nullable: false),
|
||||
SystolicBloodPressure = table.Column<double>(type: "double precision", nullable: false),
|
||||
DiastolicBloodPressure = table.Column<double>(type: "double precision", nullable: false),
|
||||
PulseRate = table.Column<double>(type: "double precision", nullable: false),
|
||||
SPO2 = table.Column<double>(type: "double precision", nullable: false),
|
||||
Temperature = table.Column<double>(type: "double precision", nullable: false),
|
||||
MedicalHistoryTemplateId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
StudentId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
PatientId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedBy = table.Column<string>(type: "text", nullable: true),
|
||||
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
|
||||
RemovedBy = table.Column<string>(type: "text", nullable: true),
|
||||
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
ModifiedBy = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_MedicalHistories", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_MedicalHistories_Patients_PatientId",
|
||||
column: x => x.PatientId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Patients",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_MedicalHistories_Sections_SectionId",
|
||||
column: x => x.SectionId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Sections",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_MedicalHistories_Students_StudentId",
|
||||
column: x => x.StudentId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Students",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "MedicalHistoryTemplates",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ChiefComplaint = table.Column<string>(type: "text", nullable: false),
|
||||
SectionId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
StudentId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedBy = table.Column<string>(type: "text", nullable: true),
|
||||
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
|
||||
RemovedBy = table.Column<string>(type: "text", nullable: true),
|
||||
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
ModifiedBy = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_MedicalHistoryTemplates", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_MedicalHistoryTemplates_Sections_SectionId",
|
||||
column: x => x.SectionId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Sections",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_MedicalHistoryTemplates_Students_StudentId",
|
||||
column: x => x.StudentId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Students",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "MedicalHistoryAnswers",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Answer = table.Column<string>(type: "text", nullable: false),
|
||||
Question = table.Column<string>(type: "text", nullable: false),
|
||||
Part = table.Column<int>(type: "integer", nullable: false),
|
||||
QuestionType = table.Column<int>(type: "integer", nullable: false),
|
||||
MedicalHistoryId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedBy = table.Column<string>(type: "text", nullable: true),
|
||||
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
|
||||
RemovedBy = table.Column<string>(type: "text", nullable: true),
|
||||
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
ModifiedBy = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_MedicalHistoryAnswers", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_MedicalHistoryAnswers_MedicalHistories_MedicalHistoryId",
|
||||
column: x => x.MedicalHistoryId,
|
||||
principalSchema: "public",
|
||||
principalTable: "MedicalHistories",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "MedicalHistoryQuestions",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Question = table.Column<string>(type: "text", nullable: false),
|
||||
Part = table.Column<int>(type: "integer", nullable: false),
|
||||
QuestionType = table.Column<int>(type: "integer", nullable: false),
|
||||
BodySystem = table.Column<int>(type: "integer", nullable: false),
|
||||
IsSign = table.Column<bool>(type: "boolean", nullable: false),
|
||||
IsSymptom = table.Column<bool>(type: "boolean", nullable: false),
|
||||
MedicalHistoryTemplateId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedBy = table.Column<string>(type: "text", nullable: true),
|
||||
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
|
||||
RemovedBy = table.Column<string>(type: "text", nullable: true),
|
||||
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
ModifiedBy = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_MedicalHistoryQuestions", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_MedicalHistoryQuestions_MedicalHistoryTemplates_MedicalHist~",
|
||||
column: x => x.MedicalHistoryTemplateId,
|
||||
principalSchema: "public",
|
||||
principalTable: "MedicalHistoryTemplates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Claims_UserId",
|
||||
schema: "public",
|
||||
table: "Claims",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Hospitals_UniversityId",
|
||||
schema: "public",
|
||||
table: "Hospitals",
|
||||
column: "UniversityId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Logins_UserId",
|
||||
schema: "public",
|
||||
table: "Logins",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MedicalHistories_PatientId",
|
||||
schema: "public",
|
||||
table: "MedicalHistories",
|
||||
column: "PatientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MedicalHistories_SectionId",
|
||||
schema: "public",
|
||||
table: "MedicalHistories",
|
||||
column: "SectionId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MedicalHistories_StudentId",
|
||||
schema: "public",
|
||||
table: "MedicalHistories",
|
||||
column: "StudentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MedicalHistoryAnswers_MedicalHistoryId",
|
||||
schema: "public",
|
||||
table: "MedicalHistoryAnswers",
|
||||
column: "MedicalHistoryId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MedicalHistoryQuestions_MedicalHistoryTemplateId",
|
||||
schema: "public",
|
||||
table: "MedicalHistoryQuestions",
|
||||
column: "MedicalHistoryTemplateId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MedicalHistoryTemplates_SectionId",
|
||||
schema: "public",
|
||||
table: "MedicalHistoryTemplates",
|
||||
column: "SectionId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MedicalHistoryTemplates_StudentId",
|
||||
schema: "public",
|
||||
table: "MedicalHistoryTemplates",
|
||||
column: "StudentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Patients_SectionId",
|
||||
schema: "public",
|
||||
table: "Patients",
|
||||
column: "SectionId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Patients_UserId",
|
||||
schema: "public",
|
||||
table: "Patients",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RoleClaims_RoleId",
|
||||
schema: "public",
|
||||
table: "RoleClaims",
|
||||
column: "RoleId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "RoleNameIndex",
|
||||
schema: "public",
|
||||
table: "Roles",
|
||||
column: "NormalizedName",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Sections_HospitalId",
|
||||
schema: "public",
|
||||
table: "Sections",
|
||||
column: "HospitalId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Sections_UniversityId",
|
||||
schema: "public",
|
||||
table: "Sections",
|
||||
column: "UniversityId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Students_SectionId",
|
||||
schema: "public",
|
||||
table: "Students",
|
||||
column: "SectionId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Students_UniversityId",
|
||||
schema: "public",
|
||||
table: "Students",
|
||||
column: "UniversityId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Students_UserId",
|
||||
schema: "public",
|
||||
table: "Students",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Universities_CityId",
|
||||
schema: "public",
|
||||
table: "Universities",
|
||||
column: "CityId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_UserRoles_RoleId",
|
||||
schema: "public",
|
||||
table: "UserRoles",
|
||||
column: "RoleId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "EmailIndex",
|
||||
schema: "public",
|
||||
table: "Users",
|
||||
column: "NormalizedEmail");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "UserNameIndex",
|
||||
schema: "public",
|
||||
table: "Users",
|
||||
column: "NormalizedUserName",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Claims",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Logins",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "MedicalHistoryAnswers",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "MedicalHistoryQuestions",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "RoleClaims",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Tokens",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "UserRoles",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "MedicalHistories",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "MedicalHistoryTemplates",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Roles",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Patients",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Students",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Sections",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Users",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Hospitals",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Universities",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Cities",
|
||||
schema: "public");
|
||||
}
|
||||
}
|
||||
}
|
1048
DocuMed.Repository/Migrations/20250112083704_UpdateStudentSetSectionIdNull.Designer.cs
generated
100644
1048
DocuMed.Repository/Migrations/20250112083704_UpdateStudentSetSectionIdNull.Designer.cs
generated
100644
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,68 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DocuMed.Repository.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class UpdateStudentSetSectionIdNull : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Students_Sections_SectionId",
|
||||
schema: "public",
|
||||
table: "Students");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "SectionId",
|
||||
schema: "public",
|
||||
table: "Students",
|
||||
type: "uuid",
|
||||
nullable: true,
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "uuid");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Students_Sections_SectionId",
|
||||
schema: "public",
|
||||
table: "Students",
|
||||
column: "SectionId",
|
||||
principalSchema: "public",
|
||||
principalTable: "Sections",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Students_Sections_SectionId",
|
||||
schema: "public",
|
||||
table: "Students");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "SectionId",
|
||||
schema: "public",
|
||||
table: "Students",
|
||||
type: "uuid",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "uuid",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Students_Sections_SectionId",
|
||||
schema: "public",
|
||||
table: "Students",
|
||||
column: "SectionId",
|
||||
principalSchema: "public",
|
||||
principalTable: "Sections",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,56 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DocuMed.Repository.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class EditUniAndSection : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Sections_Universities_UniversityId",
|
||||
schema: "public",
|
||||
table: "Sections");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Sections_UniversityId",
|
||||
schema: "public",
|
||||
table: "Sections");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "UniversityId",
|
||||
schema: "public",
|
||||
table: "Sections");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "UniversityId",
|
||||
schema: "public",
|
||||
table: "Sections",
|
||||
type: "uuid",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Sections_UniversityId",
|
||||
schema: "public",
|
||||
table: "Sections",
|
||||
column: "UniversityId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Sections_Universities_UniversityId",
|
||||
schema: "public",
|
||||
table: "Sections",
|
||||
column: "UniversityId",
|
||||
principalSchema: "public",
|
||||
principalTable: "Universities",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue