complete profile and authurize
parent
378e4c19c0
commit
867b7be19d
|
@ -0,0 +1,81 @@
|
|||
using Microsoft.IdentityModel.Tokens;
|
||||
|
||||
namespace DocuMed.Api.Controllers;
|
||||
public class SectionController : ICarterModule
|
||||
{
|
||||
public virtual void AddRoutes(IEndpointRouteBuilder app)
|
||||
{
|
||||
var group = app.NewVersionedApi("Section").MapGroup($"api/section")
|
||||
.RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser());
|
||||
|
||||
group.MapGet("", GetAllAsync)
|
||||
.WithDisplayName("GetAll")
|
||||
.HasApiVersion(1.0);
|
||||
|
||||
group.MapGet("University/{universityId}", GetAllByUniversityAsync)
|
||||
.WithDisplayName("GetAllByUniversityId")
|
||||
.HasApiVersion(1.0);
|
||||
|
||||
group.MapGet("{id}", GetAsync)
|
||||
.WithDisplayName("GetOne")
|
||||
.HasApiVersion(1.0);
|
||||
|
||||
group.MapPost("", Post)
|
||||
.HasApiVersion(1.0);
|
||||
|
||||
group.MapPut("", Put)
|
||||
.HasApiVersion(1.0);
|
||||
|
||||
group.MapDelete("", Delete)
|
||||
.HasApiVersion(1.0);
|
||||
}
|
||||
|
||||
|
||||
// GET:Get All Entity
|
||||
public virtual async Task<IResult> GetAllAsync([FromQuery] int page, IRepositoryWrapper repositoryWrapper, ICurrentUserService currentUserService, CancellationToken cancellationToken)
|
||||
{
|
||||
return TypedResults.Ok(await repositoryWrapper.SetRepository<Section>().TableNoTracking
|
||||
.Select(SectionMapper.ProjectToSDto).ToListAsync(cancellationToken));
|
||||
}
|
||||
|
||||
// GET:Get All Entity
|
||||
public virtual async Task<IResult> GetAllByUniversityAsync(Guid universityId, IRepositoryWrapper repositoryWrapper, ICurrentUserService currentUserService, CancellationToken cancellationToken)
|
||||
{
|
||||
return TypedResults.Ok(await repositoryWrapper.SetRepository<Section>().TableNoTracking
|
||||
.Where(s => s.UniversityId == universityId)
|
||||
.Select(SectionMapper.ProjectToSDto).ToListAsync(cancellationToken));
|
||||
}
|
||||
|
||||
// GET:Get An Entity By Id
|
||||
public async Task<IResult> GetAsync(Guid id, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
|
||||
=> TypedResults.Ok(await repositoryWrapper.SetRepository<Section>().GetByIdAsync(cancellationToken, id));
|
||||
|
||||
|
||||
// POST:Add New Entity
|
||||
public virtual async Task<IResult> Post([FromBody] SectionSDto dto, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
|
||||
{
|
||||
var ent = Section.Create(dto.Name,dto.Detail,dto.UniversityId);
|
||||
repositoryWrapper.SetRepository<Section>().Add(ent);
|
||||
await repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||
return TypedResults.Ok(ent);
|
||||
}
|
||||
|
||||
// PUT:Update Entity
|
||||
public virtual async Task<IResult> Put([FromBody] SectionSDto dto, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
|
||||
{
|
||||
var ent = Section.Create(dto.Name,dto.Detail, dto.UniversityId);
|
||||
ent.Id = dto.Id;
|
||||
repositoryWrapper.SetRepository<Section>().Update(ent);
|
||||
await repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||
return TypedResults.Ok();
|
||||
}
|
||||
|
||||
// DELETE:Delete Entity
|
||||
public virtual async Task<IResult> Delete(int id, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
|
||||
{
|
||||
var ent = await repositoryWrapper.SetRepository<Section>().GetByIdAsync(cancellationToken, id);
|
||||
repositoryWrapper.SetRepository<Section>().Delete(ent);
|
||||
await repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||
return TypedResults.Ok();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
namespace DocuMed.Api.Controllers;
|
||||
|
||||
public class UserController : ICarterModule
|
||||
{
|
||||
public void AddRoutes(IEndpointRouteBuilder app)
|
||||
{
|
||||
|
||||
var group = app.NewVersionedApi("User")
|
||||
.MapGroup($"api/user")
|
||||
.RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser());
|
||||
|
||||
|
||||
group.MapPut("", EditUserAsync)
|
||||
.WithDisplayName("EditUser")
|
||||
.HasApiVersion(1.0);
|
||||
}
|
||||
|
||||
public virtual async Task<IResult> EditUserAsync([FromBody]UserActionRequestDto request,IUserService userService,CancellationToken cancellationToken)
|
||||
{
|
||||
await userService.EditUserAsync(request, cancellationToken);
|
||||
return TypedResults.Ok();
|
||||
}
|
||||
}
|
|
@ -68,6 +68,7 @@
|
|||
<Using Include="DocuMed.Common.Models.Mapper" />
|
||||
<Using Include="DocuMed.Core" />
|
||||
<Using Include="DocuMed.Core.CoreServices.Abstracts" />
|
||||
<Using Include="DocuMed.Core.EntityServices.Abstracts" />
|
||||
<Using Include="DocuMed.Core.Models.Api" />
|
||||
<Using Include="DocuMed.Domain" />
|
||||
<Using Include="DocuMed.Domain.Dtos.RequestDtos" />
|
||||
|
|
|
@ -1,16 +1,10 @@
|
|||
using DocuMed.Core.BaseServices.Abstracts;
|
||||
using DocuMed.Domain.Models.Settings;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using DocuMed.Domain.Models.Settings;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Security.Claims;
|
||||
using System.Text;
|
||||
|
||||
namespace DocuMed.Core.BaseServices;
|
||||
|
||||
|
||||
public class JwtService : IJwtService
|
||||
{
|
||||
private readonly SignInManager<ApplicationUser> _signInManager;
|
||||
|
@ -95,6 +89,8 @@ public class JwtService : IJwtService
|
|||
claims.Add(new Claim(ClaimTypes.NameIdentifier, baseUser.Id.ToString()));
|
||||
if (baseUser.Email != null)
|
||||
claims.Add(new Claim(ClaimTypes.Email, baseUser.Email));
|
||||
if(baseUser.UniversityId != null)
|
||||
claims.Add(new Claim("UniversityId",baseUser.UniversityId.ToString() ?? string.Empty ));
|
||||
claims.Add(new Claim(ClaimTypes.Gender, baseUser.Gender == 0 ? "Female" : "Mail"));
|
||||
return claims;
|
||||
|
||||
|
@ -110,6 +106,8 @@ public class JwtService : IJwtService
|
|||
claims.Add(new Claim(ClaimTypes.Role, applicationRole.EnglishName));
|
||||
if (baseUser.Email != null)
|
||||
claims.Add(new Claim(ClaimTypes.Email, baseUser.Email));
|
||||
if (baseUser.UniversityId != null)
|
||||
claims.Add(new Claim("UniversityId", baseUser.UniversityId.ToString() ?? string.Empty));
|
||||
claims.AddRange(roleClaims);
|
||||
claims.Add(new Claim("JwtID", jwtId));
|
||||
claims.Add(new Claim(ClaimTypes.Gender, baseUser.Gender == 0 ? "Female" : "Mail"));
|
||||
|
|
|
@ -73,7 +73,7 @@ public class UserService : IUserService
|
|||
var roleResult = await _userManager.AddToRoleAsync(user, RoleNames.Student);
|
||||
if (!roleResult.Succeeded)
|
||||
throw new AppException(string.Join('|', roleResult.Errors));
|
||||
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
|
@ -89,12 +89,16 @@ public class UserService : IUserService
|
|||
user.FirstName = request.FirstName;
|
||||
user.UserName = request.PhoneNumber;
|
||||
user.PhoneNumber = request.PhoneNumber;
|
||||
user.StudentId = request.StudentId;
|
||||
user.FirstName = request.FirstName;
|
||||
user.LastName = request.LastName;
|
||||
user.NationalId = request.NationalId;
|
||||
user.BirthDate = request.BirthDate;
|
||||
user.Gender = request.Gender;
|
||||
user.UniversityId = request.UniversityId;
|
||||
if (request.UniversityId != Guid.Empty)
|
||||
user.UniversityId = request.UniversityId;
|
||||
if (request.SectionId != Guid.Empty)
|
||||
user.SectionId = request.SectionId;
|
||||
|
||||
var result = await _userManager.UpdateAsync(user);
|
||||
if (!result.Succeeded)
|
||||
|
|
|
@ -4,5 +4,6 @@ public class MedicalHistoryTemplateLDto : BaseDto<MedicalHistoryTemplateLDto,Med
|
|||
{
|
||||
|
||||
public string ChiefComplaint { get; set; } = string.Empty;
|
||||
public Guid SectionId { get; set; }
|
||||
public List<MedicalHistoryQuestionSDto> Questions { get; set; } = new();
|
||||
}
|
|
@ -7,8 +7,10 @@ public class UserActionRequestDto
|
|||
public DateTime BirthDate { get; set; }
|
||||
public Gender Gender { get; set; }
|
||||
public string NationalId { get; set; } = string.Empty;
|
||||
public string StudentId { get; set; } = string.Empty;
|
||||
public string Password { get; set; } = string.Empty;
|
||||
public Guid RoleId { get; set; } = new();
|
||||
public string RoleName { get; set; } = string.Empty;
|
||||
public Guid UniversityId { get; set; }
|
||||
public Guid SectionId { get; set; }
|
||||
}
|
|
@ -9,9 +9,14 @@ public class ApplicationUserSDto : BaseDto<ApplicationUserSDto,ApplicationUser>
|
|||
public string PhoneNumber { get; set; } = string.Empty;
|
||||
public bool PhoneNumberConfirmed { get; set; }
|
||||
public string NationalId { get; set; } = string.Empty;
|
||||
public string Section { get; set; } = string.Empty;
|
||||
public string StudentId { get; set; } = string.Empty;
|
||||
public DateTime BirthDate { get; set; }
|
||||
public Gender Gender { get; set; }
|
||||
public SignUpStatus SignUpStatus { get; set; }
|
||||
public Guid UniversityId { get; set; }
|
||||
public Guid SectionId { get; set; }
|
||||
|
||||
public string FullName => FirstName + " " + LastName;
|
||||
|
||||
|
||||
}
|
|
@ -3,4 +3,5 @@
|
|||
public class MedicalHistoryTemplateSDto : BaseDto<MedicalHistoryTemplateSDto,MedicalHistoryTemplate>
|
||||
{
|
||||
public string ChiefComplaint { get; set; } = string.Empty;
|
||||
public Guid SectionId { get; set; }
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
namespace DocuMed.Domain.Dtos.SmallDtos;
|
||||
|
||||
public class SectionSDto : BaseDto<SectionSDto,Section>
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Detail { get; set; } = string.Empty;
|
||||
public Guid UniversityId { get; set; }
|
||||
}
|
|
@ -22,4 +22,12 @@ public partial class University
|
|||
{
|
||||
return new University(name, address, cityId);
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Section
|
||||
{
|
||||
public static Section Create(string name, string detail, Guid universityId)
|
||||
{
|
||||
return new Section(name, detail, universityId);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
namespace DocuMed.Domain.Entities.City;
|
||||
|
||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||
[GenerateMapper]
|
||||
public partial class Section : ApiEntity
|
||||
{
|
||||
|
||||
public Section()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Section(string name, string detail, Guid universityId)
|
||||
{
|
||||
Name = name;
|
||||
Detail = detail;
|
||||
UniversityId = universityId;
|
||||
}
|
||||
|
||||
public string Name { get; internal set; } = string.Empty;
|
||||
public string Detail { get; internal set; } = string.Empty;
|
||||
|
||||
public Guid UniversityId { get; internal set; }
|
||||
public University? University { get; internal set; }
|
||||
}
|
|
@ -21,4 +21,6 @@ public partial class University : ApiEntity
|
|||
|
||||
public Guid CityId { get; internal set; }
|
||||
public City? City { get; internal set; }
|
||||
|
||||
public List<Section> Sections { get; internal set; } = new();
|
||||
}
|
|
@ -18,6 +18,6 @@ public partial class MedicalHistoryTemplate : ApiEntity
|
|||
}
|
||||
|
||||
public string ChiefComplaint { get; internal set; } = string.Empty;
|
||||
|
||||
public Guid SectionId { get; set; }
|
||||
public List<MedicalHistoryQuestion> Questions { get; internal set; } = new();
|
||||
}
|
|
@ -7,11 +7,14 @@ public class ApplicationUser : IdentityUser<Guid>
|
|||
public string FirstName { get; set; } = string.Empty;
|
||||
public string LastName { get; set; } = string.Empty;
|
||||
public string NationalId { get; set; } = string.Empty;
|
||||
public string Section { get; set; } = string.Empty;
|
||||
public string StudentId { get; set; } = string.Empty;
|
||||
public DateTime BirthDate { get; set; }
|
||||
public Gender Gender { get; set; }
|
||||
public SignUpStatus SignUpStatus { get; set; }
|
||||
|
||||
public Guid? UniversityId { get; set; }
|
||||
public University? University { get; set; }
|
||||
|
||||
public Guid? SectionId { get; set; }
|
||||
public Section? Section { get; set; }
|
||||
}
|
||||
|
|
|
@ -14,11 +14,12 @@ namespace DocuMed.Domain.Mappers
|
|||
FirstName = p1.FirstName,
|
||||
LastName = p1.LastName,
|
||||
NationalId = p1.NationalId,
|
||||
Section = p1.Section,
|
||||
StudentId = p1.StudentId,
|
||||
BirthDate = p1.BirthDate,
|
||||
Gender = p1.Gender,
|
||||
SignUpStatus = p1.SignUpStatus,
|
||||
UniversityId = (Guid?)p1.UniversityId,
|
||||
SectionId = (Guid?)p1.SectionId,
|
||||
Id = p1.Id,
|
||||
UserName = p1.UserName,
|
||||
Email = p1.Email,
|
||||
|
@ -37,11 +38,12 @@ namespace DocuMed.Domain.Mappers
|
|||
result.FirstName = p2.FirstName;
|
||||
result.LastName = p2.LastName;
|
||||
result.NationalId = p2.NationalId;
|
||||
result.Section = p2.Section;
|
||||
result.StudentId = p2.StudentId;
|
||||
result.BirthDate = p2.BirthDate;
|
||||
result.Gender = p2.Gender;
|
||||
result.SignUpStatus = p2.SignUpStatus;
|
||||
result.UniversityId = (Guid?)p2.UniversityId;
|
||||
result.SectionId = (Guid?)p2.SectionId;
|
||||
result.Id = p2.Id;
|
||||
result.UserName = p2.UserName;
|
||||
result.Email = p2.Email;
|
||||
|
@ -55,11 +57,12 @@ namespace DocuMed.Domain.Mappers
|
|||
FirstName = p4.FirstName,
|
||||
LastName = p4.LastName,
|
||||
NationalId = p4.NationalId,
|
||||
Section = p4.Section,
|
||||
StudentId = p4.StudentId,
|
||||
BirthDate = p4.BirthDate,
|
||||
Gender = p4.Gender,
|
||||
SignUpStatus = p4.SignUpStatus,
|
||||
UniversityId = (Guid?)p4.UniversityId,
|
||||
SectionId = (Guid?)p4.SectionId,
|
||||
Id = p4.Id,
|
||||
UserName = p4.UserName,
|
||||
Email = p4.Email,
|
||||
|
@ -77,11 +80,12 @@ namespace DocuMed.Domain.Mappers
|
|||
PhoneNumber = p5.PhoneNumber,
|
||||
PhoneNumberConfirmed = p5.PhoneNumberConfirmed,
|
||||
NationalId = p5.NationalId,
|
||||
Section = p5.Section,
|
||||
StudentId = p5.StudentId,
|
||||
BirthDate = p5.BirthDate,
|
||||
Gender = p5.Gender,
|
||||
SignUpStatus = p5.SignUpStatus,
|
||||
UniversityId = p5.UniversityId == null ? default(Guid) : (Guid)p5.UniversityId,
|
||||
SectionId = p5.SectionId == null ? default(Guid) : (Guid)p5.SectionId,
|
||||
Id = p5.Id
|
||||
};
|
||||
}
|
||||
|
@ -100,11 +104,12 @@ namespace DocuMed.Domain.Mappers
|
|||
result.PhoneNumber = p6.PhoneNumber;
|
||||
result.PhoneNumberConfirmed = p6.PhoneNumberConfirmed;
|
||||
result.NationalId = p6.NationalId;
|
||||
result.Section = p6.Section;
|
||||
result.StudentId = p6.StudentId;
|
||||
result.BirthDate = p6.BirthDate;
|
||||
result.Gender = p6.Gender;
|
||||
result.SignUpStatus = p6.SignUpStatus;
|
||||
result.UniversityId = p6.UniversityId == null ? default(Guid) : (Guid)p6.UniversityId;
|
||||
result.SectionId = p6.SectionId == null ? default(Guid) : (Guid)p6.SectionId;
|
||||
result.Id = p6.Id;
|
||||
return result;
|
||||
|
||||
|
@ -118,11 +123,12 @@ namespace DocuMed.Domain.Mappers
|
|||
PhoneNumber = p8.PhoneNumber,
|
||||
PhoneNumberConfirmed = p8.PhoneNumberConfirmed,
|
||||
NationalId = p8.NationalId,
|
||||
Section = p8.Section,
|
||||
StudentId = p8.StudentId,
|
||||
BirthDate = p8.BirthDate,
|
||||
Gender = p8.Gender,
|
||||
SignUpStatus = p8.SignUpStatus,
|
||||
UniversityId = p8.UniversityId == null ? default(Guid) : (Guid)p8.UniversityId,
|
||||
SectionId = p8.SectionId == null ? default(Guid) : (Guid)p8.SectionId,
|
||||
Id = p8.Id
|
||||
};
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ namespace DocuMed.Domain.Mappers
|
|||
return p1 == null ? null : new MedicalHistoryTemplate()
|
||||
{
|
||||
ChiefComplaint = p1.ChiefComplaint,
|
||||
SectionId = p1.SectionId,
|
||||
Id = p1.Id
|
||||
};
|
||||
}
|
||||
|
@ -27,6 +28,7 @@ namespace DocuMed.Domain.Mappers
|
|||
MedicalHistoryTemplate result = p3 ?? new MedicalHistoryTemplate();
|
||||
|
||||
result.ChiefComplaint = p2.ChiefComplaint;
|
||||
result.SectionId = p2.SectionId;
|
||||
result.Id = p2.Id;
|
||||
return result;
|
||||
|
||||
|
@ -34,6 +36,7 @@ namespace DocuMed.Domain.Mappers
|
|||
public static Expression<Func<MedicalHistoryTemplateSDto, MedicalHistoryTemplate>> ProjectToMedicalHistoryTemplate => p4 => new MedicalHistoryTemplate()
|
||||
{
|
||||
ChiefComplaint = p4.ChiefComplaint,
|
||||
SectionId = p4.SectionId,
|
||||
Id = p4.Id
|
||||
};
|
||||
public static MedicalHistoryTemplateSDto AdaptToSDto(this MedicalHistoryTemplate p5)
|
||||
|
@ -41,6 +44,7 @@ namespace DocuMed.Domain.Mappers
|
|||
return p5 == null ? null : new MedicalHistoryTemplateSDto()
|
||||
{
|
||||
ChiefComplaint = p5.ChiefComplaint,
|
||||
SectionId = p5.SectionId,
|
||||
Id = p5.Id
|
||||
};
|
||||
}
|
||||
|
@ -53,6 +57,7 @@ namespace DocuMed.Domain.Mappers
|
|||
MedicalHistoryTemplateSDto result = p7 ?? new MedicalHistoryTemplateSDto();
|
||||
|
||||
result.ChiefComplaint = p6.ChiefComplaint;
|
||||
result.SectionId = p6.SectionId;
|
||||
result.Id = p6.Id;
|
||||
return result;
|
||||
|
||||
|
@ -60,6 +65,7 @@ namespace DocuMed.Domain.Mappers
|
|||
public static Expression<Func<MedicalHistoryTemplate, MedicalHistoryTemplateSDto>> ProjectToSDto => p8 => new MedicalHistoryTemplateSDto()
|
||||
{
|
||||
ChiefComplaint = p8.ChiefComplaint,
|
||||
SectionId = p8.SectionId,
|
||||
Id = p8.Id
|
||||
};
|
||||
public static MedicalHistoryTemplate AdaptToMedicalHistoryTemplate(this MedicalHistoryTemplateLDto p9)
|
||||
|
@ -67,6 +73,7 @@ namespace DocuMed.Domain.Mappers
|
|||
return p9 == null ? null : new MedicalHistoryTemplate()
|
||||
{
|
||||
ChiefComplaint = p9.ChiefComplaint,
|
||||
SectionId = p9.SectionId,
|
||||
Questions = funcMain1(p9.Questions),
|
||||
Id = p9.Id
|
||||
};
|
||||
|
@ -80,6 +87,7 @@ namespace DocuMed.Domain.Mappers
|
|||
MedicalHistoryTemplate result = p12 ?? new MedicalHistoryTemplate();
|
||||
|
||||
result.ChiefComplaint = p11.ChiefComplaint;
|
||||
result.SectionId = p11.SectionId;
|
||||
result.Questions = funcMain2(p11.Questions, result.Questions);
|
||||
result.Id = p11.Id;
|
||||
return result;
|
||||
|
@ -88,6 +96,7 @@ namespace DocuMed.Domain.Mappers
|
|||
public static Expression<Func<MedicalHistoryTemplateLDto, MedicalHistoryTemplate>> ProjectLDtoToMedicalHistoryTemplate => p15 => new MedicalHistoryTemplate()
|
||||
{
|
||||
ChiefComplaint = p15.ChiefComplaint,
|
||||
SectionId = p15.SectionId,
|
||||
Questions = p15.Questions.Select<MedicalHistoryQuestionSDto, MedicalHistoryQuestion>(p16 => new MedicalHistoryQuestion()
|
||||
{
|
||||
Question = p16.Question,
|
||||
|
@ -103,6 +112,7 @@ namespace DocuMed.Domain.Mappers
|
|||
return p17 == null ? null : new MedicalHistoryTemplateLDto()
|
||||
{
|
||||
ChiefComplaint = p17.ChiefComplaint,
|
||||
SectionId = p17.SectionId,
|
||||
Questions = funcMain3(p17.Questions),
|
||||
Id = p17.Id
|
||||
};
|
||||
|
@ -116,6 +126,7 @@ namespace DocuMed.Domain.Mappers
|
|||
MedicalHistoryTemplateLDto result = p20 ?? new MedicalHistoryTemplateLDto();
|
||||
|
||||
result.ChiefComplaint = p19.ChiefComplaint;
|
||||
result.SectionId = p19.SectionId;
|
||||
result.Questions = funcMain4(p19.Questions, result.Questions);
|
||||
result.Id = p19.Id;
|
||||
return result;
|
||||
|
@ -124,6 +135,7 @@ namespace DocuMed.Domain.Mappers
|
|||
public static Expression<Func<MedicalHistoryTemplate, MedicalHistoryTemplateLDto>> ProjectToLDto => p23 => new MedicalHistoryTemplateLDto()
|
||||
{
|
||||
ChiefComplaint = p23.ChiefComplaint,
|
||||
SectionId = p23.SectionId,
|
||||
Questions = p23.Questions.Select<MedicalHistoryQuestion, MedicalHistoryQuestionSDto>(p24 => new MedicalHistoryQuestionSDto()
|
||||
{
|
||||
Question = p24.Question,
|
||||
|
|
|
@ -0,0 +1,75 @@
|
|||
using System;
|
||||
using System.Linq.Expressions;
|
||||
using DocuMed.Domain.Dtos.SmallDtos;
|
||||
using DocuMed.Domain.Entities.City;
|
||||
|
||||
namespace DocuMed.Domain.Mappers
|
||||
{
|
||||
public static partial class SectionMapper
|
||||
{
|
||||
public static Section AdaptToSection(this SectionSDto p1)
|
||||
{
|
||||
return p1 == null ? null : new Section()
|
||||
{
|
||||
Name = p1.Name,
|
||||
Detail = p1.Detail,
|
||||
UniversityId = p1.UniversityId,
|
||||
Id = p1.Id
|
||||
};
|
||||
}
|
||||
public static Section AdaptTo(this SectionSDto p2, Section p3)
|
||||
{
|
||||
if (p2 == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
Section result = p3 ?? new Section();
|
||||
|
||||
result.Name = p2.Name;
|
||||
result.Detail = p2.Detail;
|
||||
result.UniversityId = p2.UniversityId;
|
||||
result.Id = p2.Id;
|
||||
return result;
|
||||
|
||||
}
|
||||
public static Expression<Func<SectionSDto, Section>> ProjectToSection => p4 => new Section()
|
||||
{
|
||||
Name = p4.Name,
|
||||
Detail = p4.Detail,
|
||||
UniversityId = p4.UniversityId,
|
||||
Id = p4.Id
|
||||
};
|
||||
public static SectionSDto AdaptToSDto(this Section p5)
|
||||
{
|
||||
return p5 == null ? null : new SectionSDto()
|
||||
{
|
||||
Name = p5.Name,
|
||||
Detail = p5.Detail,
|
||||
UniversityId = p5.UniversityId,
|
||||
Id = p5.Id
|
||||
};
|
||||
}
|
||||
public static SectionSDto AdaptTo(this Section p6, SectionSDto p7)
|
||||
{
|
||||
if (p6 == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
SectionSDto result = p7 ?? new SectionSDto();
|
||||
|
||||
result.Name = p6.Name;
|
||||
result.Detail = p6.Detail;
|
||||
result.UniversityId = p6.UniversityId;
|
||||
result.Id = p6.Id;
|
||||
return result;
|
||||
|
||||
}
|
||||
public static Expression<Func<Section, SectionSDto>> ProjectToSDto => p8 => new SectionSDto()
|
||||
{
|
||||
Name = p8.Name,
|
||||
Detail = p8.Detail,
|
||||
UniversityId = p8.UniversityId,
|
||||
Id = p8.Id
|
||||
};
|
||||
}
|
||||
}
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<Folder Include="Models\ItemModels\" />
|
||||
<Folder Include="Helpers\" />
|
||||
<Folder Include="wwwroot\assets\lotties\" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -59,6 +60,7 @@
|
|||
<Using Include="MudBlazor" />
|
||||
<Using Include="MudBlazor.Services" />
|
||||
<Using Include="Refit" />
|
||||
<Using Include="System.Reflection" />
|
||||
<Using Include="Toolbelt.Blazor.Extensions.DependencyInjection" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -6,4 +6,6 @@ public static class Address
|
|||
public const string AuthController = $"{BaseAddress}/auth";
|
||||
public const string CityController = $"{BaseAddress}/city";
|
||||
public const string UniversityController = $"{BaseAddress}/university";
|
||||
public const string SectionController = $"{BaseAddress}/section";
|
||||
public const string UserController = $"{BaseAddress}/user";
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
namespace DocuMed.PWA.Models;
|
||||
|
||||
public class BaseViewModel
|
||||
{
|
||||
public bool IsProcessing { get; set; } = false;
|
||||
|
||||
public virtual void Initialize()
|
||||
{
|
||||
|
||||
}
|
||||
public virtual Task InitializeAsync()
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
|
@ -3,4 +3,5 @@
|
|||
public static class LocalStorageKeys
|
||||
{
|
||||
public const string Token = nameof(Token);
|
||||
public const string UserInfo = nameof(UserInfo);
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
@page "/HomePage"
|
||||
@using DocuMed.Domain.Dtos.SmallDtos
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IUserUtility UserUtility
|
||||
|
||||
|
||||
<MudStack class="w-screen h-screen bg-[#356859]">
|
||||
|
@ -12,8 +12,8 @@
|
|||
</MudImage>
|
||||
</MudAvatar>
|
||||
<MudStack class="justify-center ">
|
||||
<p class="font-bold text-lg text-white font-iranyekan">امیرحسین خادمی</p>
|
||||
<p class="-mt-3 text-white font-light font-iranyekan">09214802813</p>
|
||||
<p class="font-bold text-lg text-white font-iranyekan">@ViewModel?.User.FullName</p>
|
||||
<p class="-mt-3 text-white font-light font-iranyekan">@ViewModel?.User.PhoneNumber</p>
|
||||
</MudStack>
|
||||
</MudStack>
|
||||
<MudButton class="my-auto ml-5 mr-auto font-extrabold bg-white rounded-lg">اطفال</MudButton>
|
||||
|
@ -29,7 +29,7 @@
|
|||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-2 ">
|
||||
@foreach(var item in _medicalHistories)
|
||||
@foreach (var item in @ViewModel.MedicalHistories)
|
||||
{
|
||||
<MedicalHistoryItemTemplate MedicalHistory="@item" />
|
||||
}
|
||||
|
@ -75,57 +75,22 @@
|
|||
</MudStack>
|
||||
|
||||
@code {
|
||||
|
||||
private HomePageViewModel? ViewModel { get; set; }
|
||||
|
||||
public void ProfileClicked() => NavigationManager.NavigateTo("ProfilePage");
|
||||
|
||||
public void CreateMedicalHistoryClicked() => NavigationManager.NavigateTo("MedicalHistoryActionPage");
|
||||
|
||||
public void MedicalHistoryTemplatesClicked() => NavigationManager.NavigateTo("MedicalHistoryTemplatesPage");
|
||||
|
||||
public void MedicalOrdersClicked() => NavigationManager.NavigateTo("MedicalOrdersPage");
|
||||
|
||||
private List<MedicalHistorySDto> _medicalHistories = new List<MedicalHistorySDto>();
|
||||
protected override void OnInitialized()
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
_medicalHistories.Add(new MedicalHistorySDto
|
||||
{
|
||||
FirstName = "امیرحسین ",
|
||||
LastName = "معتمدی",
|
||||
Age = 35,
|
||||
ChiefComplaint = "سردرد",
|
||||
Section = "داخلی",
|
||||
});
|
||||
_medicalHistories.Add(new MedicalHistorySDto
|
||||
{
|
||||
FirstName = "امیرحسین ",
|
||||
LastName = "معتمدی",
|
||||
Age = 35,
|
||||
ChiefComplaint = "سردرد",
|
||||
Section = "داخلی",
|
||||
});
|
||||
_medicalHistories.Add(new MedicalHistorySDto
|
||||
{
|
||||
FirstName = "امیرحسین ",
|
||||
LastName = "معتمدی",
|
||||
Age = 35,
|
||||
ChiefComplaint = "سردرد",
|
||||
Section = "داخلی",
|
||||
});
|
||||
_medicalHistories.Add(new MedicalHistorySDto
|
||||
{
|
||||
FirstName = "امیرحسین ",
|
||||
LastName = "معتمدی",
|
||||
Age = 35,
|
||||
ChiefComplaint = "سردرد",
|
||||
Section = "داخلی",
|
||||
});
|
||||
_medicalHistories.Add(new MedicalHistorySDto
|
||||
{
|
||||
FirstName = "امیرحسین ",
|
||||
LastName = "معتمدی",
|
||||
Age = 35,
|
||||
ChiefComplaint = "سردرد",
|
||||
Section = "داخلی",
|
||||
});
|
||||
base.OnInitialized();
|
||||
ViewModel = new HomePageViewModel(UserUtility);
|
||||
await ViewModel.InitializeAsync();
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
namespace DocuMed.PWA.Pages;
|
||||
|
||||
public class HomePageViewModel : BaseViewModel
|
||||
{
|
||||
private readonly IUserUtility _userUtility;
|
||||
|
||||
public HomePageViewModel(IUserUtility userUtility)
|
||||
{
|
||||
_userUtility = userUtility;
|
||||
}
|
||||
|
||||
public List<MedicalHistorySDto> MedicalHistories { get; private set; } = new List<MedicalHistorySDto>();
|
||||
public ApplicationUserSDto User { get; private set; } = new ApplicationUserSDto();
|
||||
|
||||
public override async Task InitializeAsync()
|
||||
{
|
||||
User = await _userUtility.GetUserAsync();
|
||||
MedicalHistories.Add(new MedicalHistorySDto
|
||||
{
|
||||
FirstName = "امیرحسین ",
|
||||
LastName = "معتمدی",
|
||||
Age = 35,
|
||||
ChiefComplaint = "سردرد",
|
||||
Section = "داخلی",
|
||||
});
|
||||
MedicalHistories.Add(new MedicalHistorySDto
|
||||
{
|
||||
FirstName = "امیرحسین ",
|
||||
LastName = "معتمدی",
|
||||
Age = 35,
|
||||
ChiefComplaint = "سردرد",
|
||||
Section = "داخلی",
|
||||
});
|
||||
MedicalHistories.Add(new MedicalHistorySDto
|
||||
{
|
||||
FirstName = "امیرحسین ",
|
||||
LastName = "معتمدی",
|
||||
Age = 35,
|
||||
ChiefComplaint = "سردرد",
|
||||
Section = "داخلی",
|
||||
});
|
||||
MedicalHistories.Add(new MedicalHistorySDto
|
||||
{
|
||||
FirstName = "امیرحسین ",
|
||||
LastName = "معتمدی",
|
||||
Age = 35,
|
||||
ChiefComplaint = "سردرد",
|
||||
Section = "داخلی",
|
||||
});
|
||||
MedicalHistories.Add(new MedicalHistorySDto
|
||||
{
|
||||
FirstName = "امیرحسین ",
|
||||
LastName = "معتمدی",
|
||||
Age = 35,
|
||||
ChiefComplaint = "سردرد",
|
||||
Section = "داخلی",
|
||||
});
|
||||
|
||||
await base.InitializeAsync();
|
||||
|
||||
}
|
||||
}
|
|
@ -118,7 +118,7 @@
|
|||
وارد کنید
|
||||
</p>
|
||||
|
||||
<MudTextField class="text-sm" T="string" InputType="InputType.Number" @bind-Value="@_verifyCode" Label="کد ارسال شده را وارد کنید"
|
||||
<MudTextField class="text-sm" T="string" InputType="InputType.Telephone" @bind-Value="@_verifyCode" Label="کد ارسال شده را وارد کنید"
|
||||
Variant="Variant.Outlined" />
|
||||
|
||||
<BaseButtonUi IsProcessing="_isProcessing" OnClickCallback="ConfirmVerifyCode" Content="تایید کد"
|
||||
|
@ -154,7 +154,12 @@
|
|||
<MudTextField Required="true" RequiredError="نام خانوادگی خود را وارد کنید" @bind-Value="@_signUpRequest.LastName" class="text-sm" T="string" Label="نام خانوادگی" Variant="Variant.Outlined" />
|
||||
<MudTextField class="text-sm" T="string" @bind-Value="@_phoneNumber" Label="شماره تلفن همراه"
|
||||
Variant="Variant.Outlined" />
|
||||
<MudAutocomplete @bind-Value="@_selectedCity" SearchFunc="SearchCity" T="CitySDto" Label="شهر شما" Variant="Variant.Outlined">
|
||||
|
||||
<MudAutocomplete @bind-Value="@_selectedCity"
|
||||
SearchFunc="SearchCity"
|
||||
T="CitySDto"
|
||||
Label="شهر شما"
|
||||
Variant="Variant.Outlined">
|
||||
<ProgressIndicatorInPopoverTemplate>
|
||||
<MudList Clickable="false">
|
||||
<MudListItem>
|
||||
|
@ -242,13 +247,14 @@
|
|||
_isProcessing = false;
|
||||
}
|
||||
}
|
||||
private async Task ConfirmVerifyCode()
|
||||
private async Task ConfirmVerifyCode()
|
||||
{
|
||||
try
|
||||
{
|
||||
_isProcessing = true;
|
||||
var rest = await RestWrapper.AuthRestApi.LoginWithVerifyCodeAsync(new LoginRequestDto { UserName = _phoneNumber, VerifyCode = _verifyCode });
|
||||
await UserUtility.SetBearerTokenAsync(rest.BearerToken);
|
||||
await UserUtility.SetUserAsync(rest.User);
|
||||
if (_signUpStatus == SignUpStatus.SignUpCompleted)
|
||||
NavigationManager.NavigateTo("HomePage");
|
||||
else
|
||||
|
@ -291,6 +297,7 @@
|
|||
var token = await UserUtility.GetBearerTokenAsync();
|
||||
var rest = await RestWrapper.AuthRestApi.CompleteSignUpAsync(_signUpRequest, token);
|
||||
await UserUtility.SetBearerTokenAsync(rest.BearerToken);
|
||||
await UserUtility.SetUserAsync(rest.User);
|
||||
NavigationManager.NavigateTo("HomePage");
|
||||
}
|
||||
}
|
||||
|
@ -339,7 +346,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private async Task<IEnumerable<UniversitySDto>> SearchUniversity(string uni)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
namespace DocuMed.PWA.Pages;
|
||||
|
||||
public class IndexViewModel
|
||||
{
|
||||
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
namespace DocuMed.PWA.Pages;
|
||||
|
||||
public class MedicalHistoryTemplateActionPageViewModel : BaseViewModel
|
||||
{
|
||||
|
||||
}
|
|
@ -6,21 +6,22 @@
|
|||
|
||||
@foreach (var item in Questions)
|
||||
{
|
||||
<MedicalHistoryQuestionTemplateItemTemplate QuestionRemoved="RemoveQuestion" />
|
||||
<MedicalHistoryQuestionTemplateItemTemplate Question="@item" QuestionRemoved="RemoveQuestion" />
|
||||
}
|
||||
|
||||
<MudSelect @bind-Value="@_questionType" T="MedicalHistoryQuestionType" Label="نوع سوال" Variant="Variant.Outlined">
|
||||
<MudSelect @bind-Value="@_questionType" T="MedicalHistoryQuestionType" ToStringFunc="(e=>e.ToDisplay())" Label="نوع سوال" Variant="Variant.Outlined">
|
||||
|
||||
<MudSelectItem Value="@MedicalHistoryQuestionType.Hourly" />
|
||||
<MudSelectItem Value="@MedicalHistoryQuestionType.Interrogatively" />
|
||||
<MudSelectItem Value="@MedicalHistoryQuestionType.YesOrNo" />
|
||||
</MudSelect>
|
||||
<MudTextField @bind-Value="@_questionTitle" Margin="Margin.None" T="string" Label="عنوان سوال" Lines="1"
|
||||
Variant="Variant.Outlined" />
|
||||
<MudAutocomplete T="string" Label="وابستگی به سوال قبلی" Variant="Variant.Outlined" />
|
||||
Variant="Variant.Outlined" />
|
||||
|
||||
<MudButton @onclick="AddQuestion" Variant="Variant.Filled" IconSize="Size.Large" DisableElevation="true"
|
||||
class="font-extrabold text-lg rounded-md py-4 bg-[--color-medicalhistory] text-gray-800">
|
||||
@* <MudAutocomplete T="string" Label="وابستگی به سوال قبلی" Variant="Variant.Outlined" /> *@
|
||||
|
||||
<MudButton @onclick="AddQuestion" Variant="Variant.Filled" DisableElevation="true"
|
||||
class="font-extrabold text-lg right-0 rounded-md py-3 bg-[--color-medicalhistory] text-gray-800">
|
||||
+ افزودن
|
||||
</MudButton>
|
||||
|
||||
|
@ -30,8 +31,8 @@
|
|||
@code
|
||||
{
|
||||
private MedicalHistoryQuestionType _questionType;
|
||||
private string EnumConvertFunc() => string.Empty;
|
||||
private string _questionTitle = string.Empty;
|
||||
private MedicalHistoryPart _questionPart = MedicalHistoryPart.PresentIllness;
|
||||
|
||||
|
||||
public List<MedicalHistoryQuestion> Questions { get; set; } = new();
|
||||
|
@ -42,5 +43,6 @@
|
|||
}
|
||||
private void AddQuestion()
|
||||
{
|
||||
Questions.Add(MedicalHistoryQuestion.Create(_questionTitle,_questionPart,_questionType,Guid.Empty));
|
||||
}
|
||||
}
|
|
@ -1,30 +1,102 @@
|
|||
@page "/ProfilePage"
|
||||
@using System.Reflection
|
||||
@inject IRestWrapper RestWrapper
|
||||
@inject ISnackbar Snackbar
|
||||
@inject IUserUtility UserUtility
|
||||
|
||||
|
||||
<BasePageUi Title="پروفایل شما" Description="اطلاعات پروفایل شما باید دقیق و کامل باشد">
|
||||
<MudStack class="pb-10">
|
||||
<MudTextField T="string" Label="نـــــــام" Variant="Variant.Outlined" />
|
||||
<MudTextField T="string" Label="نام خانوادگی" Variant="Variant.Outlined" />
|
||||
<MudTextField T="string" Label="شماره تماس" Variant="Variant.Outlined" />
|
||||
<MudTextField T="string" Label="شماره دانشجویی" Variant="Variant.Outlined" />
|
||||
<MudAutocomplete T="string" Label="شهر شما" Variant="Variant.Outlined" />
|
||||
<MudAutocomplete T="string" Label="دانشگاه" Variant="Variant.Outlined" />
|
||||
<MudAutocomplete T="string" Label="بخش فعلی" Variant="Variant.Outlined" />
|
||||
<MudTextField @bind-Value="@ViewModel.User.FirstName" T="string" Label="نـــــــام" Variant="Variant.Outlined" />
|
||||
<MudTextField @bind-Value="@ViewModel.User.LastName" T="string" Label="نام خانوادگی" Variant="Variant.Outlined" />
|
||||
<MudTextField @bind-Value="@ViewModel.User.PhoneNumber" T="string" Label="شماره تماس" Variant="Variant.Outlined" />
|
||||
<MudTextField @bind-Value="@ViewModel.User.StudentId" T="string" Label="شماره دانشجویی" Variant="Variant.Outlined" />
|
||||
|
||||
<BaseButtonUi Icon="@Icons.Material.TwoTone.Check" Content="ویرایش پروفایل" Variant="Variant.Filled" Color="Color.Primary"/>
|
||||
<MudAutocomplete @bind-Value="@ViewModel.SelectedCity"
|
||||
SearchFunc="@ViewModel.SearchCity"
|
||||
T="CitySDto"
|
||||
ToStringFunc="dto => dto.Name"
|
||||
Label="شهر شما"
|
||||
Variant="Variant.Outlined">
|
||||
<ProgressIndicatorInPopoverTemplate>
|
||||
<MudList Clickable="false">
|
||||
<MudListItem>
|
||||
<div class="flex flex-row w-full mx-auto">
|
||||
<MudProgressCircular class="my-auto mr-1 -ml-4" Size="Size.Small" Indeterminate="true" />
|
||||
<p class="font-bold my-1 mx-auto text-md">منتظر بمانید</p>
|
||||
</div>
|
||||
</MudListItem>
|
||||
</MudList>
|
||||
</ProgressIndicatorInPopoverTemplate>
|
||||
<ItemTemplate Context="e">
|
||||
<p>@e.Name</p>
|
||||
</ItemTemplate>
|
||||
</MudAutocomplete>
|
||||
|
||||
<MudAutocomplete @bind-Value="@ViewModel.SelectedUni"
|
||||
ToStringFunc="dto => dto.Name"
|
||||
SearchFunc="@ViewModel.SearchUniversity"
|
||||
T="UniversitySDto" Label="دانشگاه" Variant="Variant.Outlined">
|
||||
<ProgressIndicatorInPopoverTemplate>
|
||||
<MudList Clickable="false">
|
||||
<MudListItem>
|
||||
<div class="flex flex-row w-full mx-auto">
|
||||
<MudProgressCircular class="my-auto mr-1 -ml-4" Size="Size.Small" Indeterminate="true" />
|
||||
<p class="font-bold my-1 mx-auto text-md">منتظر بمانید</p>
|
||||
</div>
|
||||
</MudListItem>
|
||||
</MudList>
|
||||
</ProgressIndicatorInPopoverTemplate>
|
||||
<ItemTemplate Context="e">
|
||||
<p>@e.Name</p>
|
||||
</ItemTemplate>
|
||||
</MudAutocomplete>
|
||||
|
||||
<MudAutocomplete T="SectionSDto" Label="بخش فعلی" Variant="Variant.Outlined"
|
||||
ToStringFunc="dto => dto.Name"
|
||||
SearchFunc="@ViewModel.SearchSection"
|
||||
@bind-Value="@ViewModel.SelectedSection">
|
||||
|
||||
<ProgressIndicatorInPopoverTemplate>
|
||||
<MudList Clickable="false">
|
||||
<MudListItem>
|
||||
<div class="flex flex-row w-full mx-auto">
|
||||
<MudProgressCircular class="my-auto mr-1 -ml-4" Size="Size.Small" Indeterminate="true" />
|
||||
<p class="font-bold my-1 mx-auto text-md">منتظر بمانید</p>
|
||||
</div>
|
||||
</MudListItem>
|
||||
</MudList>
|
||||
</ProgressIndicatorInPopoverTemplate>
|
||||
<ItemTemplate Context="e">
|
||||
<p>@e.Name</p>
|
||||
</ItemTemplate>
|
||||
</MudAutocomplete>
|
||||
|
||||
<BaseButtonUi IsProcessing="@ViewModel.IsProcessing"
|
||||
Icon="@Icons.Material.TwoTone.Check"
|
||||
@onclick="@ViewModel.SubmitEditAsync"
|
||||
Content="ویرایش پروفایل"
|
||||
Variant="Variant.Filled"
|
||||
Color="Color.Primary" />
|
||||
|
||||
<BaseButtonUi Icon="@Icons.Material.TwoTone.Close" Content="خروج از حساب کاربری" Variant="Variant.Outlined" Color="Color.Error" />
|
||||
|
||||
</MudStack>
|
||||
<div class="bg-gray-300 rounded-md mt-auto py-4 px-6 flex flex-row">
|
||||
<p class="my-auto">نسخه برنامه </p>
|
||||
<p class="font-extrabold text-lg mr-auto">@_version</p>
|
||||
<p class="font-extrabold text-lg mr-auto">@ViewModel.Version</p>
|
||||
</div>
|
||||
</BasePageUi>
|
||||
|
||||
|
||||
@code {
|
||||
private readonly string _version = Assembly.GetAssembly(typeof(Program))?.GetName()?.Version?.ToString() ?? string.Empty;
|
||||
|
||||
private ProfilePageViewModel ViewModel { get; set; }
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
ViewModel = new ProfilePageViewModel(UserUtility, RestWrapper, Snackbar);
|
||||
await ViewModel.InitializeAsync();
|
||||
await base.OnInitializedAsync();
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,167 @@
|
|||
using DocuMed.Domain.Entities.City;
|
||||
using Mapster;
|
||||
|
||||
namespace DocuMed.PWA.Pages;
|
||||
|
||||
public class ProfilePageViewModel : BaseViewModel
|
||||
{
|
||||
public IUserUtility UserUtility { get; }
|
||||
public IRestWrapper RestWrapper { get; }
|
||||
public ISnackbar Snackbar { get; }
|
||||
public ApplicationUserSDto User { get; set; } = new();
|
||||
|
||||
|
||||
public List<CitySDto> Cities { get; private set; } = new List<CitySDto>();
|
||||
public List<UniversitySDto> Universities { get; private set; } = new List<UniversitySDto>();
|
||||
public List<SectionSDto> Sections { get; private set; } = new List<SectionSDto>();
|
||||
public CitySDto? SelectedCity { get; set; }
|
||||
public UniversitySDto? SelectedUni { get; set; }
|
||||
public SectionSDto? SelectedSection { get; set; }
|
||||
|
||||
public readonly string Version = Assembly.GetAssembly(typeof(Program))?.GetName()?.Version?.ToString() ?? string.Empty;
|
||||
|
||||
public ProfilePageViewModel(IUserUtility userUtility, IRestWrapper restWrapper, ISnackbar snackbar)
|
||||
{
|
||||
UserUtility = userUtility;
|
||||
RestWrapper = restWrapper;
|
||||
Snackbar = snackbar;
|
||||
}
|
||||
|
||||
public override async Task InitializeAsync()
|
||||
{
|
||||
User = await UserUtility.GetUserAsync();
|
||||
|
||||
var token = await UserUtility.GetBearerTokenAsync();
|
||||
Cities = await RestWrapper.CrudDtoApiRest<City, CitySDto, Guid>(Address.CityController).ReadAll(0, token);
|
||||
Universities = await RestWrapper.CrudDtoApiRest<University, UniversitySDto, Guid>(Address.UniversityController).ReadAll(0, token);
|
||||
|
||||
if (User.UniversityId != Guid.Empty)
|
||||
{
|
||||
SelectedUni = Universities.FirstOrDefault(u => u.Id == User.UniversityId);
|
||||
SelectedCity = Cities.FirstOrDefault(c => c.Id == SelectedUni?.CityId);
|
||||
if (SelectedUni != null)
|
||||
if (User.SectionId != Guid.Empty)
|
||||
{
|
||||
Sections = await RestWrapper.SectionRestApi.GetByUniversityAsync(SelectedUni.Id, token);
|
||||
SelectedSection = Sections.FirstOrDefault(s => s.Id == User.SectionId);
|
||||
}
|
||||
}
|
||||
|
||||
await base.InitializeAsync();
|
||||
}
|
||||
|
||||
public async Task SubmitEditAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
IsProcessing = true;
|
||||
var token = await UserUtility.GetBearerTokenAsync();
|
||||
var request = User.Adapt<UserActionRequestDto>();
|
||||
if (SelectedUni != null)
|
||||
{
|
||||
request.UniversityId = SelectedUni.Id;
|
||||
User.UniversityId = SelectedUni.Id;
|
||||
}
|
||||
if (SelectedSection != null)
|
||||
{
|
||||
request.SectionId = SelectedSection.Id;
|
||||
User.SectionId = SelectedSection.Id;
|
||||
}
|
||||
await RestWrapper.UserRestApi.UpdateUserAsync(request, token);
|
||||
await UserUtility.SetUserAsync(User);
|
||||
Snackbar.Add("ویرایش حساب کاربری با موفقیت انجام شد", Severity.Success);
|
||||
}
|
||||
catch (ApiException ex)
|
||||
{
|
||||
var exe = await ex.GetContentAsAsync<ApiResult>();
|
||||
Snackbar.Add(exe != null ? exe.Message : ex.Content, Severity.Error);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Snackbar.Add(e.Message, Severity.Error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
IsProcessing = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public async Task<IEnumerable<CitySDto>> SearchCity(string city)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Cities.Count == 0)
|
||||
{
|
||||
var token = await UserUtility.GetBearerTokenAsync();
|
||||
Cities = await RestWrapper.CrudDtoApiRest<City, CitySDto, Guid>(Address.CityController).ReadAll(0, token);
|
||||
}
|
||||
if (city.IsNullOrEmpty())
|
||||
return Cities;
|
||||
return Cities.Where(c => c.Name.Contains(city));
|
||||
}
|
||||
catch (ApiException ex)
|
||||
{
|
||||
var exe = await ex.GetContentAsAsync<ApiResult>();
|
||||
Snackbar.Add(exe != null ? exe.Message : ex.Content, Severity.Error);
|
||||
return Cities;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Snackbar.Add(e.Message, Severity.Error);
|
||||
return Cities;
|
||||
}
|
||||
}
|
||||
public async Task<IEnumerable<SectionSDto>> SearchSection(string section)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (SelectedUni != null)
|
||||
{
|
||||
var token = await UserUtility.GetBearerTokenAsync();
|
||||
Sections = await RestWrapper.SectionRestApi.GetByUniversityAsync(SelectedUni.Id, token);
|
||||
}
|
||||
if (section.IsNullOrEmpty())
|
||||
return Sections;
|
||||
return Sections.Where(c => c.Name.Contains(section));
|
||||
}
|
||||
catch (ApiException ex)
|
||||
{
|
||||
var exe = await ex.GetContentAsAsync<ApiResult>();
|
||||
Snackbar.Add(exe != null ? exe.Message : ex.Content, Severity.Error);
|
||||
return Sections;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Snackbar.Add(e.Message, Severity.Error);
|
||||
return Sections;
|
||||
}
|
||||
}
|
||||
public async Task<IEnumerable<UniversitySDto>> SearchUniversity(string uni)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Universities.Count == 0)
|
||||
{
|
||||
var token = await UserUtility.GetBearerTokenAsync();
|
||||
Universities = await RestWrapper.CrudDtoApiRest<University, UniversitySDto, Guid>(Address.UniversityController).ReadAll(0, token);
|
||||
}
|
||||
if (uni.IsNullOrEmpty())
|
||||
return Universities;
|
||||
return Universities.Where(c => c.Name.Contains(uni));
|
||||
}
|
||||
catch (ApiException ex)
|
||||
{
|
||||
var exe = await ex.GetContentAsAsync<ApiResult>();
|
||||
Snackbar.Add(exe != null ? exe.Message : ex.Content, Severity.Error);
|
||||
return Universities;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Snackbar.Add(e.Message, Severity.Error);
|
||||
return Universities;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,4 +7,6 @@ public interface IRestWrapper
|
|||
|
||||
|
||||
public IAuthRestApi AuthRestApi { get; }
|
||||
public ISectionRestApi SectionRestApi { get; }
|
||||
public IUserRestApi UserRestApi { get; }
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
namespace DocuMed.PWA.Services.RestServices;
|
||||
|
||||
public interface ISectionRestApi : ICrudDtoApiRest<Section,SectionSDto,Guid>
|
||||
{
|
||||
[Get("/university/{universityId}")]
|
||||
Task<List<SectionSDto>> GetByUniversityAsync(Guid universityId, [Header("Authorization")] string authorization);
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
namespace DocuMed.PWA.Services.RestServices;
|
||||
|
||||
public interface IUserRestApi
|
||||
{
|
||||
|
||||
|
||||
[Put("")]
|
||||
Task UpdateUserAsync([Body]UserActionRequestDto request, [Header("Authorization")] string authorization);
|
||||
}
|
|
@ -21,4 +21,6 @@ public class RestWrapper : IRestWrapper
|
|||
return RestService.For<ICrudDtoApiRest<T, TDto, TKey>>(address, setting);
|
||||
}
|
||||
public IAuthRestApi AuthRestApi => RestService.For<IAuthRestApi>(Address.AuthController, setting);
|
||||
public ISectionRestApi SectionRestApi => RestService.For<ISectionRestApi>(Address.SectionController, setting);
|
||||
public IUserRestApi UserRestApi => RestService.For<IUserRestApi>(Address.UserController, setting);
|
||||
}
|
|
@ -4,4 +4,7 @@ public interface IUserUtility
|
|||
{
|
||||
public Task<string> GetBearerTokenAsync();
|
||||
public Task SetBearerTokenAsync(string token);
|
||||
public Task<ApplicationUserSDto> GetUserAsync();
|
||||
public Task SetUserAsync(ApplicationUserSDto user);
|
||||
|
||||
}
|
|
@ -14,6 +14,9 @@ public class UserUtility : IUserUtility
|
|||
public async Task<string> GetBearerTokenAsync() => await _localStorageService.GetItemAsStringAsync(LocalStorageKeys.Token);
|
||||
public async Task SetBearerTokenAsync(string token) => await _localStorageService.SetItemAsStringAsync(LocalStorageKeys.Token,token);
|
||||
|
||||
public async Task<ApplicationUserSDto> GetUserAsync() => await _localStorageService.GetItemAsync<ApplicationUserSDto>(LocalStorageKeys.UserInfo);
|
||||
public async Task SetUserAsync(ApplicationUserSDto user) => await _localStorageService.SetItemAsync<ApplicationUserSDto>(LocalStorageKeys.UserInfo,user);
|
||||
|
||||
//public AccessToken<ApplicationUserSDto>? AccessToken { get; set; }
|
||||
//public List<string> UserClaims => AccessToken == null ? new List<string>() : AccessToken.Permissions;
|
||||
//public bool HasPermissionTo(string permission) => UserClaims.Any(c => c == permission);
|
||||
|
|
|
@ -504,6 +504,9 @@ video {
|
|||
.left-0 {
|
||||
left: 0px;
|
||||
}
|
||||
.right-0 {
|
||||
right: 0px;
|
||||
}
|
||||
.z-50 {
|
||||
z-index: 50;
|
||||
}
|
||||
|
@ -905,6 +908,10 @@ video {
|
|||
padding-top: 0.5rem;
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
.py-3 {
|
||||
padding-top: 0.75rem;
|
||||
padding-bottom: 0.75rem;
|
||||
}
|
||||
.py-4 {
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
|
|
|
@ -557,6 +557,10 @@ video {
|
|||
left: 0px;
|
||||
}
|
||||
|
||||
.right-0 {
|
||||
right: 0px;
|
||||
}
|
||||
|
||||
.z-50 {
|
||||
z-index: 50;
|
||||
}
|
||||
|
@ -1086,6 +1090,11 @@ video {
|
|||
padding-bottom: 1rem;
|
||||
}
|
||||
|
||||
.py-3 {
|
||||
padding-top: 0.75rem;
|
||||
padding-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.pb-10 {
|
||||
padding-bottom: 2.5rem;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,786 @@
|
|||
// <auto-generated />
|
||||
using System;
|
||||
using DocuMed.Repository.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DocuMed.Repository.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationContext))]
|
||||
[Migration("20231021121504_addSections")]
|
||||
partial class addSections
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasDefaultSchema("public")
|
||||
.HasAnnotation("ProductVersion", "7.0.11")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.City", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Cities", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.Section", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Detail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("UniversityId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UniversityId");
|
||||
|
||||
b.ToTable("Sections", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("CityId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CityId");
|
||||
|
||||
b.ToTable("Universities", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("AddictionHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Age")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("AllergyDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("BirthDate")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ChiefComplaint")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("DiastolicBloodPressure")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("DrugHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FamilyHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FatherName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("NationalId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PastDiseasesHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PastSurgeryHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PresentIllnessDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("PulseRate")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("SPO2")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Section")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("SystemReviewDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("SystolicBloodPressure")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Temperature")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("VitalSignDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("MedicalHistories", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistoryAnswer", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Answer")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid>("MedicalHistoryId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Part")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Question")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("QuestionType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MedicalHistoryId");
|
||||
|
||||
b.ToTable("MedicalHistoryAnswers", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryQuestion", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid>("MedicalHistoryTemplateId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Part")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Question")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("QuestionType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MedicalHistoryTemplateId");
|
||||
|
||||
b.ToTable("MedicalHistoryQuestions", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ChiefComplaint")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("MedicalHistoryTemplates", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationRole", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("EnglishName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("PersianName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("RoleNameIndex");
|
||||
|
||||
b.ToTable("Roles", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationUser", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("AccessFailedCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("BirthDate")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Gender")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("LockoutEnabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("NationalId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("Section")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("SecurityStamp")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("SignUpStatus")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid?>("UniversityId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasDatabaseName("EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("UserNameIndex");
|
||||
|
||||
b.HasIndex("UniversityId");
|
||||
|
||||
b.ToTable("Users", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("RoleId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("RoleClaims", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("Claims", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ProviderKey")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ProviderDisplayName")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("Logins", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||
{
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("RoleId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("UserRoles", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||
{
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("UserId", "LoginProvider", "Name");
|
||||
|
||||
b.ToTable("Tokens", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.Section", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.City.University", "University")
|
||||
.WithMany("Sections")
|
||||
.HasForeignKey("UniversityId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("University");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.City.City", "City")
|
||||
.WithMany("Universities")
|
||||
.HasForeignKey("CityId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("City");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistoryAnswer", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", "MedicalHistory")
|
||||
.WithMany("Answers")
|
||||
.HasForeignKey("MedicalHistoryId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("MedicalHistory");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryQuestion", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", "MedicalHistoryTemplate")
|
||||
.WithMany("Questions")
|
||||
.HasForeignKey("MedicalHistoryTemplateId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("MedicalHistoryTemplate");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationUser", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.City.University", "University")
|
||||
.WithMany()
|
||||
.HasForeignKey("UniversityId");
|
||||
|
||||
b.Navigation("University");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.City", b =>
|
||||
{
|
||||
b.Navigation("Universities");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||
{
|
||||
b.Navigation("Sections");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", b =>
|
||||
{
|
||||
b.Navigation("Answers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", b =>
|
||||
{
|
||||
b.Navigation("Questions");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DocuMed.Repository.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addSections : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
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),
|
||||
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: false),
|
||||
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
|
||||
RemovedBy = table.Column<string>(type: "text", nullable: false),
|
||||
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
ModifiedBy = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Sections", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Sections_Universities_UniversityId",
|
||||
column: x => x.UniversityId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Universities",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Sections_UniversityId",
|
||||
schema: "public",
|
||||
table: "Sections",
|
||||
column: "UniversityId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Sections",
|
||||
schema: "public");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,797 @@
|
|||
// <auto-generated />
|
||||
using System;
|
||||
using DocuMed.Repository.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DocuMed.Repository.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationContext))]
|
||||
[Migration("20231021122606_editUser")]
|
||||
partial class editUser
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasDefaultSchema("public")
|
||||
.HasAnnotation("ProductVersion", "7.0.11")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.City", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Cities", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.Section", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Detail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("UniversityId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UniversityId");
|
||||
|
||||
b.ToTable("Sections", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("CityId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CityId");
|
||||
|
||||
b.ToTable("Universities", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("AddictionHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Age")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("AllergyDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("BirthDate")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ChiefComplaint")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("DiastolicBloodPressure")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("DrugHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FamilyHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FatherName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("NationalId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PastDiseasesHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PastSurgeryHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PresentIllnessDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("PulseRate")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("SPO2")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Section")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("SystemReviewDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("SystolicBloodPressure")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Temperature")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("VitalSignDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("MedicalHistories", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistoryAnswer", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Answer")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid>("MedicalHistoryId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Part")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Question")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("QuestionType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MedicalHistoryId");
|
||||
|
||||
b.ToTable("MedicalHistoryAnswers", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryQuestion", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid>("MedicalHistoryTemplateId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Part")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Question")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("QuestionType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MedicalHistoryTemplateId");
|
||||
|
||||
b.ToTable("MedicalHistoryQuestions", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ChiefComplaint")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("MedicalHistoryTemplates", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationRole", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("EnglishName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("PersianName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("RoleNameIndex");
|
||||
|
||||
b.ToTable("Roles", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationUser", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("AccessFailedCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("BirthDate")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Gender")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("LockoutEnabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("NationalId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid?>("SectionId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("SecurityStamp")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("SignUpStatus")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("StudentId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid?>("UniversityId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasDatabaseName("EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("UserNameIndex");
|
||||
|
||||
b.HasIndex("SectionId");
|
||||
|
||||
b.HasIndex("UniversityId");
|
||||
|
||||
b.ToTable("Users", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("RoleId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("RoleClaims", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("Claims", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ProviderKey")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ProviderDisplayName")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("Logins", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||
{
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("RoleId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("UserRoles", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||
{
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("UserId", "LoginProvider", "Name");
|
||||
|
||||
b.ToTable("Tokens", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.Section", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.City.University", "University")
|
||||
.WithMany("Sections")
|
||||
.HasForeignKey("UniversityId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("University");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.City.City", "City")
|
||||
.WithMany("Universities")
|
||||
.HasForeignKey("CityId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("City");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistoryAnswer", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", "MedicalHistory")
|
||||
.WithMany("Answers")
|
||||
.HasForeignKey("MedicalHistoryId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("MedicalHistory");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryQuestion", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", "MedicalHistoryTemplate")
|
||||
.WithMany("Questions")
|
||||
.HasForeignKey("MedicalHistoryTemplateId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("MedicalHistoryTemplate");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationUser", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.City.Section", "Section")
|
||||
.WithMany()
|
||||
.HasForeignKey("SectionId");
|
||||
|
||||
b.HasOne("DocuMed.Domain.Entities.City.University", "University")
|
||||
.WithMany()
|
||||
.HasForeignKey("UniversityId");
|
||||
|
||||
b.Navigation("Section");
|
||||
|
||||
b.Navigation("University");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.City", b =>
|
||||
{
|
||||
b.Navigation("Universities");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||
{
|
||||
b.Navigation("Sections");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", b =>
|
||||
{
|
||||
b.Navigation("Answers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", b =>
|
||||
{
|
||||
b.Navigation("Questions");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DocuMed.Repository.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class editUser : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Section",
|
||||
schema: "public",
|
||||
table: "Users",
|
||||
newName: "StudentId");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "SectionId",
|
||||
schema: "public",
|
||||
table: "Users",
|
||||
type: "uuid",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Users_SectionId",
|
||||
schema: "public",
|
||||
table: "Users",
|
||||
column: "SectionId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Users_Sections_SectionId",
|
||||
schema: "public",
|
||||
table: "Users",
|
||||
column: "SectionId",
|
||||
principalSchema: "public",
|
||||
principalTable: "Sections",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Users_Sections_SectionId",
|
||||
schema: "public",
|
||||
table: "Users");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Users_SectionId",
|
||||
schema: "public",
|
||||
table: "Users");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SectionId",
|
||||
schema: "public",
|
||||
table: "Users");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "StudentId",
|
||||
schema: "public",
|
||||
table: "Users",
|
||||
newName: "Section");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,800 @@
|
|||
// <auto-generated />
|
||||
using System;
|
||||
using DocuMed.Repository.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DocuMed.Repository.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationContext))]
|
||||
[Migration("20231022121751_editTemplate")]
|
||||
partial class editTemplate
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasDefaultSchema("public")
|
||||
.HasAnnotation("ProductVersion", "7.0.11")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.City", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Cities", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.Section", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Detail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("UniversityId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UniversityId");
|
||||
|
||||
b.ToTable("Sections", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("CityId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CityId");
|
||||
|
||||
b.ToTable("Universities", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("AddictionHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Age")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("AllergyDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("BirthDate")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ChiefComplaint")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("DiastolicBloodPressure")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("DrugHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FamilyHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FatherName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("NationalId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PastDiseasesHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PastSurgeryHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PresentIllnessDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("PulseRate")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("SPO2")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Section")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("SystemReviewDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("SystolicBloodPressure")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Temperature")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("VitalSignDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("MedicalHistories", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistoryAnswer", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Answer")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid>("MedicalHistoryId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Part")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Question")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("QuestionType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MedicalHistoryId");
|
||||
|
||||
b.ToTable("MedicalHistoryAnswers", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryQuestion", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid>("MedicalHistoryTemplateId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Part")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Question")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("QuestionType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MedicalHistoryTemplateId");
|
||||
|
||||
b.ToTable("MedicalHistoryQuestions", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ChiefComplaint")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("SectionId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("MedicalHistoryTemplates", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationRole", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("EnglishName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("PersianName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("RoleNameIndex");
|
||||
|
||||
b.ToTable("Roles", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationUser", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("AccessFailedCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("BirthDate")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Gender")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("LockoutEnabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("NationalId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid?>("SectionId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("SecurityStamp")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("SignUpStatus")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("StudentId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid?>("UniversityId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasDatabaseName("EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("UserNameIndex");
|
||||
|
||||
b.HasIndex("SectionId");
|
||||
|
||||
b.HasIndex("UniversityId");
|
||||
|
||||
b.ToTable("Users", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("RoleId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("RoleClaims", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("Claims", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ProviderKey")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ProviderDisplayName")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("Logins", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||
{
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("RoleId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("UserRoles", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||
{
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("UserId", "LoginProvider", "Name");
|
||||
|
||||
b.ToTable("Tokens", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.Section", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.City.University", "University")
|
||||
.WithMany("Sections")
|
||||
.HasForeignKey("UniversityId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("University");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.City.City", "City")
|
||||
.WithMany("Universities")
|
||||
.HasForeignKey("CityId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("City");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistoryAnswer", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", "MedicalHistory")
|
||||
.WithMany("Answers")
|
||||
.HasForeignKey("MedicalHistoryId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("MedicalHistory");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryQuestion", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", "MedicalHistoryTemplate")
|
||||
.WithMany("Questions")
|
||||
.HasForeignKey("MedicalHistoryTemplateId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("MedicalHistoryTemplate");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationUser", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.City.Section", "Section")
|
||||
.WithMany()
|
||||
.HasForeignKey("SectionId");
|
||||
|
||||
b.HasOne("DocuMed.Domain.Entities.City.University", "University")
|
||||
.WithMany()
|
||||
.HasForeignKey("UniversityId");
|
||||
|
||||
b.Navigation("Section");
|
||||
|
||||
b.Navigation("University");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.City", b =>
|
||||
{
|
||||
b.Navigation("Universities");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||
{
|
||||
b.Navigation("Sections");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", b =>
|
||||
{
|
||||
b.Navigation("Answers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", b =>
|
||||
{
|
||||
b.Navigation("Questions");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DocuMed.Repository.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class editTemplate : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "SectionId",
|
||||
schema: "public",
|
||||
table: "MedicalHistoryTemplates",
|
||||
type: "uuid",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SectionId",
|
||||
schema: "public",
|
||||
table: "MedicalHistoryTemplates");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -62,6 +62,54 @@ namespace DocuMed.Repository.Migrations
|
|||
b.ToTable("Cities", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.Section", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Detail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("UniversityId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UniversityId");
|
||||
|
||||
b.ToTable("Sections", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
@ -364,6 +412,9 @@ namespace DocuMed.Repository.Migrations
|
|||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("SectionId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("MedicalHistoryTemplates", "public");
|
||||
|
@ -469,9 +520,8 @@ namespace DocuMed.Repository.Migrations
|
|||
b.Property<bool>("PhoneNumberConfirmed")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("Section")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
b.Property<Guid?>("SectionId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("SecurityStamp")
|
||||
.HasColumnType("text");
|
||||
|
@ -479,6 +529,10 @@ namespace DocuMed.Repository.Migrations
|
|||
b.Property<int>("SignUpStatus")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("StudentId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
|
@ -498,6 +552,8 @@ namespace DocuMed.Repository.Migrations
|
|||
.IsUnique()
|
||||
.HasDatabaseName("UserNameIndex");
|
||||
|
||||
b.HasIndex("SectionId");
|
||||
|
||||
b.HasIndex("UniversityId");
|
||||
|
||||
b.ToTable("Users", "public");
|
||||
|
@ -606,6 +662,17 @@ namespace DocuMed.Repository.Migrations
|
|||
b.ToTable("Tokens", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.Section", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.City.University", "University")
|
||||
.WithMany("Sections")
|
||||
.HasForeignKey("UniversityId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("University");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.City.City", "City")
|
||||
|
@ -641,10 +708,16 @@ namespace DocuMed.Repository.Migrations
|
|||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationUser", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.City.Section", "Section")
|
||||
.WithMany()
|
||||
.HasForeignKey("SectionId");
|
||||
|
||||
b.HasOne("DocuMed.Domain.Entities.City.University", "University")
|
||||
.WithMany()
|
||||
.HasForeignKey("UniversityId");
|
||||
|
||||
b.Navigation("Section");
|
||||
|
||||
b.Navigation("University");
|
||||
});
|
||||
|
||||
|
@ -704,6 +777,11 @@ namespace DocuMed.Repository.Migrations
|
|||
b.Navigation("Universities");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||
{
|
||||
b.Navigation("Sections");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", b =>
|
||||
{
|
||||
b.Navigation("Answers");
|
||||
|
|
Loading…
Reference in New Issue