Author | SHA1 | Message | Date |
---|---|---|---|
team.net | 2fefbe934c | Commit Department module, Doctor module and Appointment module | 4 days ago |
@ -1 +1 @@ | |||
<p>appointment-calendar works!</p> | |||
<full-calendar [options]="calendarOptions"></full-calendar> |
@ -0,0 +1,8 @@ | |||
.fc.fc-theme-standard .fc-view-harness .fc-event.fc-daygrid-block-event { | |||
color: #ffffff; | |||
background: #2563eb; | |||
border-color: #2563eb; | |||
} | |||
.fc-daygrid-day-number { | |||
text-decoration: none !important; | |||
} |
@ -0,0 +1,17 @@ | |||
# Proxy Generation Output | |||
This directory includes the output of the latest proxy generation. | |||
The files and folders in it will be overwritten when proxy generation is run again. | |||
Therefore, please do not place your own content in this folder. | |||
In addition, `generate-proxy.json` works like a lock file. | |||
It includes information used by the proxy generator, so please do not delete or modify it. | |||
Finally, the name of the files and folders should not be changed for two reasons: | |||
- Proxy generator will keep creating them at those paths and you will have multiple copies of the same content. | |||
- ABP Suite generates files which include imports from this folder. | |||
> **Important Notice:** If you are building a module and are planning to publish to npm, | |||
> some of the generated proxies are likely to be exported from public-api.ts file. In such a case, | |||
> please make sure you export files directly and not from barrel exports. In other words, | |||
> do not include index.ts exports in your public-api.ts exports. |
@ -0,0 +1,20 @@ | |||
import { RestService, Rest } from '@abp/ng.core'; | |||
import { Injectable } from '@angular/core'; | |||
@Injectable({ | |||
providedIn: 'root', | |||
}) | |||
export class AppointmentService { | |||
apiName = 'Default'; | |||
get = (config?: Partial<Rest.Config>) => | |||
this.restService.request<any, string>({ | |||
method: 'GET', | |||
responseType: 'text', | |||
url: '/api/app/appointment', | |||
}, | |||
{ apiName: this.apiName,...config }); | |||
constructor(private restService: RestService) {} | |||
} |
@ -0,0 +1 @@ | |||
export * from './appointment.service'; |
@ -0,0 +1,29 @@ | |||
import { RestService, Rest } from '@abp/ng.core'; | |||
import { Injectable } from '@angular/core'; | |||
import type { CreateDepartmentDto, DepartmentDto } from '../dtos/models'; | |||
@Injectable({ | |||
providedIn: 'root', | |||
}) | |||
export class DepartmentService { | |||
apiName = 'Default'; | |||
create = (input: CreateDepartmentDto, config?: Partial<Rest.Config>) => | |||
this.restService.request<any, DepartmentDto>({ | |||
method: 'POST', | |||
url: '/api/app/department', | |||
body: input, | |||
}, | |||
{ apiName: this.apiName,...config }); | |||
get = (config?: Partial<Rest.Config>) => | |||
this.restService.request<any, DepartmentDto[]>({ | |||
method: 'GET', | |||
url: '/api/app/department', | |||
}, | |||
{ apiName: this.apiName,...config }); | |||
constructor(private restService: RestService) {} | |||
} |
@ -0,0 +1 @@ | |||
export * from './department.service'; |
@ -0,0 +1,20 @@ | |||
import { RestService, Rest } from '@abp/ng.core'; | |||
import { Injectable } from '@angular/core'; | |||
import type { DoctorDto } from '../dtos/models'; | |||
@Injectable({ | |||
providedIn: 'root', | |||
}) | |||
export class DoctorService { | |||
apiName = 'Default'; | |||
get = (config?: Partial<Rest.Config>) => | |||
this.restService.request<any, DoctorDto[]>({ | |||
method: 'GET', | |||
url: '/api/app/doctor', | |||
}, | |||
{ apiName: this.apiName,...config }); | |||
constructor(private restService: RestService) {} | |||
} |
@ -0,0 +1 @@ | |||
export * from './doctor.service'; |
@ -0,0 +1 @@ | |||
export * from './models'; |
@ -0,0 +1,32 @@ | |||
import type { FullAuditedEntity } from '../volo/abp/domain/entities/auditing/models'; | |||
import type { GenderEnum } from '../enums/gender-enum.enum'; | |||
export interface CreateDepartmentDto { | |||
departmentNo?: string; | |||
departmentName?: string; | |||
departmentDate?: string; | |||
departmentHead?: string; | |||
description?: string; | |||
} | |||
export interface DepartmentDto extends FullAuditedEntity<string> { | |||
departmentNo?: string; | |||
departmentName?: string; | |||
departmentDate?: string; | |||
departmentHead?: string; | |||
status?: string; | |||
description?: string; | |||
} | |||
export interface DoctorDto extends FullAuditedEntity<string> { | |||
firstName?: string; | |||
lastName?: string; | |||
gender?: GenderEnum; | |||
mobile?: string; | |||
designation?: string; | |||
departmentId?: string; | |||
address?: string; | |||
email?: string; | |||
dob?: string; | |||
education?: string; | |||
} |
@ -0,0 +1,9 @@ | |||
import { mapEnumToOptions } from '@abp/ng.core'; | |||
export enum GenderEnum { | |||
Male = 0, | |||
Female = 1, | |||
Others = 2, | |||
} | |||
export const genderEnumOptions = mapEnumToOptions(GenderEnum); |
@ -0,0 +1 @@ | |||
export * from './gender-enum.enum'; |
@ -0,0 +1,7 @@ | |||
import * as Appointments from './appointments'; | |||
import * as Departments from './departments'; | |||
import * as Doctors from './doctors'; | |||
import * as Dtos from './dtos'; | |||
import * as Enums from './enums'; | |||
import * as Volo from './volo'; | |||
export { Appointments, Departments, Doctors, Dtos, Enums, Volo }; |
@ -0,0 +1 @@ | |||
export * from './models'; |
@ -0,0 +1,17 @@ | |||
import type { Entity } from '../models'; | |||
export interface AuditedEntity<TKey> extends CreationAuditedEntity<TKey> { | |||
lastModificationTime?: string; | |||
lastModifierId?: string; | |||
} | |||
export interface CreationAuditedEntity<TKey> extends Entity<TKey> { | |||
creationTime?: string; | |||
creatorId?: string; | |||
} | |||
export interface FullAuditedEntity<TKey> extends AuditedEntity<TKey> { | |||
isDeleted: boolean; | |||
deleterId?: string; | |||
deletionTime?: string; | |||
} |
@ -0,0 +1,3 @@ | |||
import * as Auditing from './auditing'; | |||
export * from './models'; | |||
export { Auditing }; |
@ -0,0 +1,3 @@ | |||
export interface Entity { | |||
} |
@ -0,0 +1,2 @@ | |||
import * as Entities from './entities'; | |||
export { Entities }; |
@ -0,0 +1,2 @@ | |||
import * as Domain from './domain'; | |||
export { Domain }; |
@ -0,0 +1,2 @@ | |||
import * as Abp from './abp'; | |||
export { Abp }; |
@ -0,0 +1,28 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using Volo.Abp.DependencyInjection; | |||
using Volo.Abp.MultiTenancy; | |||
using Volo.Abp.Users; | |||
namespace HospitalManagementSystem.Appointments | |||
{ | |||
public class AppointmentAppService : HospitalManagementSystemAppService, IAppointmentAppService, ITransientDependency | |||
{ | |||
private readonly ICurrentUser _currentUser; | |||
private readonly ICurrentTenant _currentTenant; | |||
public AppointmentAppService(ICurrentUser currentUser, ICurrentTenant currentTenant) | |||
{ | |||
_currentUser = currentUser; | |||
_currentTenant = currentTenant; | |||
} | |||
public async Task<string> GetAsync() | |||
{ | |||
var x = _currentUser.Id; | |||
var y = _currentTenant.Id; | |||
return _currentUser.Name + " checking done."; | |||
} | |||
} | |||
} |
@ -0,0 +1,14 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using Volo.Abp.Application.Services; | |||
namespace HospitalManagementSystem.Appointments | |||
{ | |||
public interface IAppointmentAppService : IApplicationService | |||
{ | |||
Task<string> GetAsync(); | |||
} | |||
} |
@ -0,0 +1,31 @@ | |||
using HospitalManagementSystem.Dtos; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Threading.Tasks; | |||
using Volo.Abp.Domain.Repositories; | |||
namespace HospitalManagementSystem.Departments | |||
{ | |||
public class DepartmentAppService : HospitalManagementSystemAppService, IDepartmentAppService | |||
{ | |||
private readonly IRepository<Department, Guid> _departmentRepository; | |||
public DepartmentAppService(IRepository<Department, Guid> departmentRepository) | |||
{ | |||
_departmentRepository = departmentRepository; | |||
} | |||
public async Task<List<DepartmentDto>> GetAsync() | |||
{ | |||
var departmentDtos = new List<DepartmentDto>(); | |||
var data = await _departmentRepository.GetListAsync(); | |||
departmentDtos = ObjectMapper.Map<List<Department>, List<DepartmentDto>>(data); | |||
return departmentDtos; | |||
} | |||
public async Task<DepartmentDto> CreateAsync(CreateDepartmentDto input) | |||
{ | |||
var department = new Department(Guid.NewGuid(), input.DepartmentNo, input.DepartmentName, input.DepartmentDate, input.DepartmentHead, "Active", input.Description); | |||
await _departmentRepository.InsertAsync(department); | |||
return ObjectMapper.Map<Department, DepartmentDto>(department); | |||
} | |||
} | |||
} |
@ -0,0 +1,16 @@ | |||
using HospitalManagementSystem.Dtos; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using Volo.Abp.Application.Services; | |||
namespace HospitalManagementSystem.Departments | |||
{ | |||
public interface IDepartmentAppService : IApplicationService | |||
{ | |||
Task<List<DepartmentDto>> GetAsync(); | |||
Task<DepartmentDto> CreateAsync(CreateDepartmentDto input); | |||
} | |||
} |
@ -0,0 +1,31 @@ | |||
using HospitalManagementSystem.Departments; | |||
using HospitalManagementSystem.Dtos; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Threading.Tasks; | |||
using Volo.Abp.Domain.Repositories; | |||
namespace HospitalManagementSystem.Doctors | |||
{ | |||
public class DoctorAppService : HospitalManagementSystemAppService, IDoctorAppService | |||
{ | |||
private readonly IRepository<Doctor, Guid> _doctorRepository; | |||
public DoctorAppService(IRepository<Doctor, Guid> doctorRepository) | |||
{ | |||
_doctorRepository = doctorRepository; | |||
} | |||
public async Task<List<DoctorDto>> GetAsync() | |||
{ | |||
var doctorDtos = new List<DoctorDto>(); | |||
var data = await _doctorRepository.GetListAsync(); | |||
doctorDtos = ObjectMapper.Map<List<Doctor>, List<DoctorDto>>(data); | |||
return doctorDtos; | |||
} | |||
public async Task<DoctorDto> CreateAsync(CreateDoctorDto input) | |||
{ | |||
var doctor = new Doctor(Guid.NewGuid(), input.FirstName, input.LastName, input.Gender, input.Mobile, input.Password, input.Designation, input.DepartmentId, input.Address, input.Email, input.DOB, input.Education); | |||
await _doctorRepository.InsertAsync(doctor); | |||
return ObjectMapper.Map<Doctor, DoctorDto>(doctor); | |||
} | |||
} | |||
} |
@ -0,0 +1,12 @@ | |||
using HospitalManagementSystem.Dtos; | |||
using System.Collections.Generic; | |||
using System.Threading.Tasks; | |||
using Volo.Abp.Application.Services; | |||
namespace HospitalManagementSystem.Doctors | |||
{ | |||
public interface IDoctorAppService : IApplicationService | |||
{ | |||
Task<List<DoctorDto>> GetAsync(); | |||
} | |||
} |
@ -0,0 +1,17 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace HospitalManagementSystem.Dtos | |||
{ | |||
public class CreateDepartmentDto | |||
{ | |||
public string? DepartmentNo { get; set; } | |||
public string? DepartmentName { get; set; } | |||
public DateTime? DepartmentDate { get; set; } | |||
public string? DepartmentHead { get; set; } | |||
public string? Description { get; set; } | |||
} | |||
} |
@ -0,0 +1,24 @@ | |||
using HospitalManagementSystem.Enums; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace HospitalManagementSystem.Dtos | |||
{ | |||
public class CreateDoctorDto | |||
{ | |||
public string? FirstName { get; set; } | |||
public string? LastName { get; set; } | |||
public string? Gender { get; set; } | |||
public string? Mobile { get; set; } | |||
public string? Password { get; set; } | |||
public string? Designation { get; set; } | |||
public Guid? DepartmentId { get; set; } | |||
public string? Address { get; set; } | |||
public string? Email { get; set; } | |||
public string? DOB { get; set; } | |||
public string? Education { get; set; } | |||
} | |||
} |
@ -0,0 +1,15 @@ | |||
using System; | |||
using Volo.Abp.Domain.Entities.Auditing; | |||
namespace HospitalManagementSystem.Dtos | |||
{ | |||
public class DepartmentDto : FullAuditedEntity<Guid> | |||
{ | |||
public string? DepartmentNo { get; set; } | |||
public string? DepartmentName { get; set; } | |||
public DateTime? DepartmentDate { get; set; } | |||
public string? DepartmentHead { get; set; } | |||
public string? Status { get; set; } | |||
public string? Description { get; set; } | |||
} | |||
} |
@ -0,0 +1,24 @@ | |||
using HospitalManagementSystem.Enums; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using Volo.Abp.Domain.Entities.Auditing; | |||
namespace HospitalManagementSystem.Dtos | |||
{ | |||
public class DoctorDto : FullAuditedEntity<Guid> | |||
{ | |||
public string? FirstName { get; set; } | |||
public string? LastName { get; set; } | |||
public string? Gender { get; set; } | |||
public string? Mobile { get; set; } | |||
public string? Designation { get; set; } | |||
public Guid? DepartmentId { get; set; } | |||
public string? Address { get; set; } | |||
public string? Email { get; set; } | |||
public string? DOB { get; set; } | |||
public string? Education { get; set; } | |||
} | |||
} |
@ -0,0 +1,15 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace HospitalManagementSystem.Enums | |||
{ | |||
public enum GenderEnum | |||
{ | |||
Male = 0, | |||
Female = 1, | |||
Others = 2 | |||
} | |||
} |
@ -0,0 +1,26 @@ | |||
using HospitalManagementSystem.Doctors; | |||
using HospitalManagementSystem.Enums; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
using Volo.Abp.Domain.Entities.Auditing; | |||
namespace HospitalManagementSystem.Appointments | |||
{ | |||
public class Appointment : FullAuditedEntity<Guid> | |||
{ | |||
public string? FirstName { get; set; } | |||
public string? LastName { get; set; } | |||
public GenderEnum? Gender { get; set; } | |||
public string? Mobile { get; set; } | |||
public string? Address { get; set; } | |||
public string? Email { get; set; } | |||
public string? DOB { get; set; } | |||
public Guid? DoctorId { get; set; } | |||
[ForeignKey("DoctorId")] | |||
public virtual Doctor? Doctor { get; set; } | |||
public DateTime? DateOfAppointment { get; set; } | |||
public string? TimeOfAppointment { get; set; } | |||
public string? InjuryORContion { get; set; } | |||
public string? Note { get; set; } | |||
} | |||
} |
@ -0,0 +1,30 @@ | |||
using System; | |||
using Volo.Abp.Domain.Entities.Auditing; | |||
namespace HospitalManagementSystem.Departments | |||
{ | |||
public class Department : FullAuditedEntity<Guid> | |||
{ | |||
public string? DepartmentNo { get; set; } | |||
public string? DepartmentName { get; set; } | |||
public DateTime? DepartmentDate { get; set; } | |||
public string? DepartmentHead { get; set; } | |||
public string? Status { get; set; } | |||
public string? Description { get; set; } | |||
public Department() | |||
{ | |||
} | |||
public Department(Guid id, string? departmentNo, string? departmentName, DateTime? departmentDate, string? departmentHead, string? status, string? description) : base(id) | |||
{ | |||
DepartmentNo = departmentNo; | |||
DepartmentName = departmentName; | |||
DepartmentDate = departmentDate; | |||
DepartmentHead = departmentHead; | |||
Status = status; | |||
Description = description; | |||
} | |||
} | |||
} |
@ -0,0 +1,49 @@ | |||
using HospitalManagementSystem.Appointments; | |||
using HospitalManagementSystem.Departments; | |||
using HospitalManagementSystem.Enums; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
using Volo.Abp.Domain.Entities.Auditing; | |||
namespace HospitalManagementSystem.Doctors | |||
{ | |||
public class Doctor : FullAuditedEntity<Guid> | |||
{ | |||
public string? FirstName { get; set; } | |||
public string? LastName { get; set; } | |||
public string? Gender { get; set; } | |||
public string? Mobile { get; set; } | |||
public string? Password { get; set; } | |||
public string? Designation { get; set; } | |||
public Guid? DepartmentId { get; set; } | |||
[ForeignKey("DepartmentId")] | |||
public virtual Department? Department { get; set; } | |||
public string? Address { get; set; } | |||
public string? Email { get; set; } | |||
public string? DOB { get; set; } | |||
public string? Education { get; set; } | |||
public virtual ICollection<Appointment> Appointments { get; set; } = new List<Appointment>(); | |||
public Doctor() | |||
{ | |||
//Appointments = new List<Appointment>(); | |||
} | |||
public Doctor(Guid id, string? firstName, string? lastName, | |||
string? gender, string? mobile, string? password, | |||
string? designation, Guid? departmentId, string? address, | |||
string? email, string? dOB, string? education) : base(id) | |||
{ | |||
FirstName = firstName; | |||
LastName = lastName; | |||
Gender = gender; | |||
Mobile = mobile; | |||
Password = password; | |||
Designation = designation; | |||
DepartmentId = departmentId; | |||
Address = address; | |||
Email = email; | |||
DOB = dOB; | |||
Education = education; | |||
} | |||
} | |||
} |
@ -0,0 +1,131 @@ | |||
using System; | |||
using Microsoft.EntityFrameworkCore.Migrations; | |||
#nullable disable | |||
namespace HospitalManagementSystem.Migrations | |||
{ | |||
/// <inheritdoc /> | |||
public partial class addedDepartment_Doctor_Appointment_Table : Migration | |||
{ | |||
/// <inheritdoc /> | |||
protected override void Up(MigrationBuilder migrationBuilder) | |||
{ | |||
migrationBuilder.CreateTable( | |||
name: "Departments", | |||
columns: table => new | |||
{ | |||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), | |||
DepartmentNo = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
DepartmentName = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
DepartmentDate = table.Column<DateTime>(type: "datetime2", nullable: true), | |||
DepartmentHead = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
Status = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
Description = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), | |||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), | |||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), | |||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true) | |||
}, | |||
constraints: table => | |||
{ | |||
table.PrimaryKey("PK_Departments", x => x.Id); | |||
}); | |||
migrationBuilder.CreateTable( | |||
name: "Doctors", | |||
columns: table => new | |||
{ | |||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), | |||
FirstName = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
LastName = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
Gender = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
Mobile = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
Password = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
Designation = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
DepartmentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
Address = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
Email = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
DOB = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
Education = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), | |||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), | |||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), | |||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true) | |||
}, | |||
constraints: table => | |||
{ | |||
table.PrimaryKey("PK_Doctors", x => x.Id); | |||
table.ForeignKey( | |||
name: "FK_Doctors_Departments_DepartmentId", | |||
column: x => x.DepartmentId, | |||
principalTable: "Departments", | |||
principalColumn: "Id"); | |||
}); | |||
migrationBuilder.CreateTable( | |||
name: "Appointments", | |||
columns: table => new | |||
{ | |||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), | |||
FirstName = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
LastName = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
Gender = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
Mobile = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
Address = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
Email = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
DOB = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
DoctorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
DateOfAppointment = table.Column<DateTime>(type: "datetime2", nullable: true), | |||
TimeOfAppointment = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
InjuryORContion = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
Note = table.Column<string>(type: "nvarchar(max)", nullable: true), | |||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), | |||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), | |||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), | |||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), | |||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true) | |||
}, | |||
constraints: table => | |||
{ | |||
table.PrimaryKey("PK_Appointments", x => x.Id); | |||
table.ForeignKey( | |||
name: "FK_Appointments_Doctors_DoctorId", | |||
column: x => x.DoctorId, | |||
principalTable: "Doctors", | |||
principalColumn: "Id"); | |||
}); | |||
migrationBuilder.CreateIndex( | |||
name: "IX_Appointments_DoctorId", | |||
table: "Appointments", | |||
column: "DoctorId"); | |||
migrationBuilder.CreateIndex( | |||
name: "IX_Doctors_DepartmentId", | |||
table: "Doctors", | |||
column: "DepartmentId"); | |||
} | |||
/// <inheritdoc /> | |||
protected override void Down(MigrationBuilder migrationBuilder) | |||
{ | |||
migrationBuilder.DropTable( | |||
name: "Appointments"); | |||
migrationBuilder.DropTable( | |||
name: "Doctors"); | |||
migrationBuilder.DropTable( | |||
name: "Departments"); | |||
} | |||
} | |||
} |
@ -0,0 +1,36 @@ | |||
using Microsoft.EntityFrameworkCore.Migrations; | |||
#nullable disable | |||
namespace HospitalManagementSystem.Migrations | |||
{ | |||
/// <inheritdoc /> | |||
public partial class changeGenderEnumToString : Migration | |||
{ | |||
/// <inheritdoc /> | |||
protected override void Up(MigrationBuilder migrationBuilder) | |||
{ | |||
migrationBuilder.AlterColumn<int>( | |||
name: "Gender", | |||
table: "Appointments", | |||
type: "int", | |||
nullable: true, | |||
oldClrType: typeof(string), | |||
oldType: "nvarchar(max)", | |||
oldNullable: true); | |||
} | |||
/// <inheritdoc /> | |||
protected override void Down(MigrationBuilder migrationBuilder) | |||
{ | |||
migrationBuilder.AlterColumn<string>( | |||
name: "Gender", | |||
table: "Appointments", | |||
type: "nvarchar(max)", | |||
nullable: true, | |||
oldClrType: typeof(int), | |||
oldType: "int", | |||
oldNullable: true); | |||
} | |||
} | |||
} |