Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
HIAST-Clinics
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
almohanad.hafez
HIAST-Clinics
Commits
56b44861
Commit
56b44861
authored
Aug 16, 2024
by
Almouhannad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(B) Add amount value to medicines
parent
219cd6d0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
971 additions
and
0 deletions
+971
-0
Medicine.cs
...cs.Backend/Domain/Entities/Medicals/Medicines/Medicine.cs
+2
-0
20240816173549_Add_Amount_To_Medicine.Designer.cs
...rations/20240816173549_Add_Amount_To_Medicine.Designer.cs
+937
-0
20240816173549_Add_Amount_To_Medicine.cs
...tence/Migrations/20240816173549_Add_Amount_To_Medicine.cs
+29
-0
ClinicsDbContextModelSnapshot.cs
...d/Persistence/Migrations/ClinicsDbContextModelSnapshot.cs
+3
-0
No files found.
Clinics.Backend/Domain/Entities/Medicals/Medicines/Medicine.cs
View file @
56b44861
...
...
@@ -11,6 +11,8 @@ public sealed class Medicine(int id) : Entity(id)
public
MedicineForm
MedicineForm
{
get
;
set
;
}
=
null
!;
public
int
Amount
{
get
;
set
;
}
public
string
Name
{
get
;
set
;
}
=
null
!;
public
decimal
Dosage
{
get
;
set
;
}
...
...
Clinics.Backend/Persistence/Migrations/20240816173549_Add_Amount_To_Medicine.Designer.cs
0 → 100644
View file @
56b44861
// <auto-generated />
using
System
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Infrastructure
;
using
Microsoft.EntityFrameworkCore.Metadata
;
using
Microsoft.EntityFrameworkCore.Migrations
;
using
Microsoft.EntityFrameworkCore.Storage.ValueConversion
;
using
Persistence.Context
;
#
nullable
disable
namespace
Persistence.Migrations
{
[
DbContext
(
typeof
(
ClinicsDbContext
))]
[
Migration
(
"20240816173549_Add_Amount_To_Medicine"
)]
partial
class
Add_Amount_To_Medicine
{
/// <inheritdoc />
protected
override
void
BuildTargetModel
(
ModelBuilder
modelBuilder
)
{
#pragma warning disable 612, 618
modelBuilder
.
HasAnnotation
(
"ProductVersion"
,
"8.0.8"
)
.
HasAnnotation
(
"Relational:MaxIdentifierLength"
,
128
);
SqlServerModelBuilderExtensions
.
UseIdentityColumns
(
modelBuilder
);
modelBuilder
.
Entity
(
"Domain.Entities.Medicals.Diseases.Disease"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
);
SqlServerPropertyBuilderExtensions
.
UseIdentityColumn
(
b
.
Property
<
int
>(
"Id"
));
b
.
Property
<
string
>(
"Name"
)
.
IsRequired
()
.
HasMaxLength
(
50
)
.
HasColumnType
(
"nvarchar(50)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Disease"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.Medicals.Hospitals.Hospital"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
);
SqlServerPropertyBuilderExtensions
.
UseIdentityColumn
(
b
.
Property
<
int
>(
"Id"
));
b
.
Property
<
string
>(
"Name"
)
.
IsRequired
()
.
HasMaxLength
(
50
)
.
HasColumnType
(
"nvarchar(50)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Hospital"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.Medicals.MedicalImages.MedicalImage"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
);
SqlServerPropertyBuilderExtensions
.
UseIdentityColumn
(
b
.
Property
<
int
>(
"Id"
));
b
.
Property
<
string
>(
"Description"
)
.
HasMaxLength
(
250
)
.
HasColumnType
(
"nvarchar(250)"
);
b
.
Property
<
string
>(
"Name"
)
.
IsRequired
()
.
HasMaxLength
(
50
)
.
HasColumnType
(
"nvarchar(50)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"MedicalImage"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.Medicals.MedicalTests.MedicalTest"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
);
SqlServerPropertyBuilderExtensions
.
UseIdentityColumn
(
b
.
Property
<
int
>(
"Id"
));
b
.
Property
<
string
>(
"Description"
)
.
HasMaxLength
(
250
)
.
HasColumnType
(
"nvarchar(250)"
);
b
.
Property
<
string
>(
"Name"
)
.
IsRequired
()
.
HasMaxLength
(
50
)
.
HasColumnType
(
"nvarchar(50)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"MedicalTest"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.Medicals.Medicines.Medicine"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
);
SqlServerPropertyBuilderExtensions
.
UseIdentityColumn
(
b
.
Property
<
int
>(
"Id"
));
b
.
Property
<
int
>(
"Amount"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
decimal
>(
"Dosage"
)
.
HasColumnType
(
"numeric(9, 3)"
);
b
.
Property
<
int
>(
"MedicineFormId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
string
>(
"Name"
)
.
IsRequired
()
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"MedicineFormId"
);
b
.
ToTable
(
"Medicine"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.Medicals.Medicines.MedicineFormValues.MedicineForm"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
string
>(
"Name"
)
.
IsRequired
()
.
HasMaxLength
(
50
)
.
HasColumnType
(
"nvarchar(50)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"MedicineForm"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.Doctors.Doctor"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
);
SqlServerPropertyBuilderExtensions
.
UseIdentityColumn
(
b
.
Property
<
int
>(
"Id"
));
b
.
Property
<
int
>(
"PersonalInfoId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"StatusId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"PersonalInfoId"
)
.
IsUnique
();
b
.
HasIndex
(
"StatusId"
);
b
.
ToTable
(
"Doctor"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.Doctors.Shared.Constants.DoctorStatusValues.DoctorStatus"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
string
>(
"Name"
)
.
IsRequired
()
.
HasMaxLength
(
50
)
.
HasColumnType
(
"nvarchar(50)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"DoctorStatus"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.Doctors.Shared.DoctorPhone"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
);
SqlServerPropertyBuilderExtensions
.
UseIdentityColumn
(
b
.
Property
<
int
>(
"Id"
));
b
.
Property
<
int
?>(
"DoctorId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
string
>(
"Name"
)
.
HasMaxLength
(
50
)
.
HasColumnType
(
"nvarchar(50)"
);
b
.
Property
<
string
>(
"Phone"
)
.
IsRequired
()
.
HasMaxLength
(
20
)
.
HasColumnType
(
"nvarchar(20)"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"DoctorId"
);
b
.
HasIndex
(
"Phone"
)
.
IsUnique
();
b
.
ToTable
(
"DoctorPhone"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.Employees.Employee"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
);
b
.
Property
<
int
?>(
"AdditionalInfoId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
string
>(
"CenterStatus"
)
.
IsRequired
()
.
HasMaxLength
(
50
)
.
HasColumnType
(
"nvarchar(50)"
);
b
.
Property
<
bool
>(
"IsMarried"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"bit"
)
.
HasDefaultValue
(
false
);
b
.
Property
<
string
>(
"SerialNumber"
)
.
IsRequired
()
.
HasMaxLength
(
20
)
.
HasColumnType
(
"nvarchar(20)"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"AdditionalInfoId"
)
.
IsUnique
()
.
HasFilter
(
"[AdditionalInfoId] IS NOT NULL"
);
b
.
ToTable
(
"Employee"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.Employees.Relations.EmployeeFamilyMembers.EmployeeFamilyMember"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
);
SqlServerPropertyBuilderExtensions
.
UseIdentityColumn
(
b
.
Property
<
int
>(
"Id"
));
b
.
Property
<
int
>(
"EmployeeId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"FamilyMemberId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"RoleId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"EmployeeId"
);
b
.
HasIndex
(
"FamilyMemberId"
);
b
.
HasIndex
(
"RoleId"
);
b
.
ToTable
(
"EmployeeFamilyMember"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.Employees.Relations.EmployeeFamilyMembers.FamilyRoleValues.FamilyRole"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
string
>(
"Name"
)
.
IsRequired
()
.
HasMaxLength
(
50
)
.
HasColumnType
(
"nvarchar(50)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"FamilyRole"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.Employees.Shared.EmployeeAdditionalInfo"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
);
SqlServerPropertyBuilderExtensions
.
UseIdentityColumn
(
b
.
Property
<
int
>(
"Id"
));
b
.
Property
<
string
>(
"AcademicQualification"
)
.
HasMaxLength
(
50
)
.
HasColumnType
(
"nvarchar(50)"
);
b
.
Property
<
string
>(
"ImageUrl"
)
.
HasMaxLength
(
150
)
.
HasColumnType
(
"nvarchar(150)"
);
b
.
Property
<
string
>(
"JobStatus"
)
.
HasMaxLength
(
50
)
.
HasColumnType
(
"nvarchar(50)"
);
b
.
Property
<
string
>(
"Location"
)
.
HasMaxLength
(
50
)
.
HasColumnType
(
"nvarchar(50)"
);
b
.
Property
<
string
>(
"Specialization"
)
.
HasMaxLength
(
50
)
.
HasColumnType
(
"nvarchar(50)"
);
b
.
Property
<
DateOnly
?>(
"StartDate"
)
.
HasColumnType
(
"date"
);
b
.
Property
<
string
>(
"WorkPhone"
)
.
HasMaxLength
(
20
)
.
HasColumnType
(
"nvarchar(20)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"EmployeeAdditionalInfo"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.FamilyMembers.FamilyMember"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"FamilyMember"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.Patients.Patient"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
);
SqlServerPropertyBuilderExtensions
.
UseIdentityColumn
(
b
.
Property
<
int
>(
"Id"
));
b
.
Property
<
DateOnly
>(
"DateOfBirth"
)
.
HasColumnType
(
"date"
);
b
.
Property
<
int
>(
"GenderId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"PersonalInfoId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"GenderId"
);
b
.
HasIndex
(
"PersonalInfoId"
)
.
IsUnique
();
b
.
ToTable
(
"Patient"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.Patients.Relations.PatientDiseases.PatientDisease"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
);
SqlServerPropertyBuilderExtensions
.
UseIdentityColumn
(
b
.
Property
<
int
>(
"Id"
));
b
.
Property
<
int
>(
"DiseaseId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"PatientId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"DiseaseId"
);
b
.
HasIndex
(
"PatientId"
,
"DiseaseId"
)
.
IsUnique
();
b
.
ToTable
(
"PatientDisease"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.Patients.Relations.PatientMedicines.PatientMedicine"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
);
SqlServerPropertyBuilderExtensions
.
UseIdentityColumn
(
b
.
Property
<
int
>(
"Id"
));
b
.
Property
<
int
>(
"MedicineId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"Number"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"PatientId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"MedicineId"
);
b
.
HasIndex
(
"PatientId"
,
"MedicineId"
)
.
IsUnique
();
b
.
ToTable
(
"PatientMedicine"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.Shared.GenderValues.Gender"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
string
>(
"Name"
)
.
IsRequired
()
.
HasMaxLength
(
50
)
.
HasColumnType
(
"nvarchar(50)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Gender"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.Shared.PersonalInfo"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
);
SqlServerPropertyBuilderExtensions
.
UseIdentityColumn
(
b
.
Property
<
int
>(
"Id"
));
b
.
Property
<
string
>(
"FirstName"
)
.
IsRequired
()
.
HasMaxLength
(
50
)
.
HasColumnType
(
"nvarchar(50)"
);
b
.
Property
<
string
>(
"LastName"
)
.
IsRequired
()
.
HasMaxLength
(
50
)
.
HasColumnType
(
"nvarchar(50)"
);
b
.
Property
<
string
>(
"MiddleName"
)
.
IsRequired
()
.
HasMaxLength
(
50
)
.
HasColumnType
(
"nvarchar(50)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"PersonalInfo"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.Visits.Relations.VisitMedicalImages.VisitMedicalImage"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
);
SqlServerPropertyBuilderExtensions
.
UseIdentityColumn
(
b
.
Property
<
int
>(
"Id"
));
b
.
Property
<
int
>(
"MedicalImageId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
string
>(
"Result"
)
.
HasMaxLength
(
250
)
.
HasColumnType
(
"nvarchar(250)"
);
b
.
Property
<
int
>(
"VisitId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"MedicalImageId"
);
b
.
HasIndex
(
"VisitId"
,
"MedicalImageId"
)
.
IsUnique
();
b
.
ToTable
(
"VisitMedicalImage"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.Visits.Relations.VisitMedicalTests.VisitMedicalTest"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
);
SqlServerPropertyBuilderExtensions
.
UseIdentityColumn
(
b
.
Property
<
int
>(
"Id"
));
b
.
Property
<
int
>(
"MedicalTestId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
string
>(
"Result"
)
.
HasMaxLength
(
250
)
.
HasColumnType
(
"nvarchar(250)"
);
b
.
Property
<
int
>(
"VisitId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"MedicalTestId"
);
b
.
HasIndex
(
"VisitId"
,
"MedicalTestId"
)
.
IsUnique
();
b
.
ToTable
(
"VisitMedicalTest"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.Visits.Relations.VisitMedicines.VisitMedicine"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
);
SqlServerPropertyBuilderExtensions
.
UseIdentityColumn
(
b
.
Property
<
int
>(
"Id"
));
b
.
Property
<
int
>(
"MedicineId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"Number"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"VisitId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"MedicineId"
);
b
.
HasIndex
(
"VisitId"
,
"MedicineId"
)
.
IsUnique
();
b
.
ToTable
(
"VisitMedicine"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.Visits.Visit"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
);
SqlServerPropertyBuilderExtensions
.
UseIdentityColumn
(
b
.
Property
<
int
>(
"Id"
));
b
.
Property
<
DateOnly
>(
"Date"
)
.
HasColumnType
(
"date"
);
b
.
Property
<
string
>(
"Diagnosis"
)
.
IsRequired
()
.
HasMaxLength
(
250
)
.
HasColumnType
(
"nvarchar(250)"
);
b
.
Property
<
int
>(
"DoctorId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
?>(
"HospitalId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"PatientId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"DoctorId"
);
b
.
HasIndex
(
"HospitalId"
);
b
.
HasIndex
(
"PatientId"
);
b
.
ToTable
(
"Visit"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"Domain.Entities.WaitingList.WaitingListRecord"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
);
SqlServerPropertyBuilderExtensions
.
UseIdentityColumn
(
b
.
Property
<
int
>(
"Id"
));
b
.
Property
<
int
?>(
"DoctorId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
bool
>(
"IsServed"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"bit"
)
.
HasDefaultValue
(
false
);
b
.
Property
<
int
>(
"PatientId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"DoctorId"
);
b
.
HasIndex
(
"PatientId"
);
b
.
ToTable
(
"WaitingListRecord"
,
(
string
)
null
);
});
modelBuilder
.
Entity
(
"EmployeeEmployee"
,
b
=>
{
b
.
Property
<
int
>(
"RelatedEmployeesId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"RelatedToId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"RelatedEmployeesId"
,
"RelatedToId"
);
b
.
HasIndex
(
"RelatedToId"
);
b
.
ToTable
(
"EmployeeEmployee"
);
});
modelBuilder
.
Entity
(
"Domain.Entities.Medicals.Medicines.Medicine"
,
b
=>
{
b
.
HasOne
(
"Domain.Entities.Medicals.Medicines.MedicineFormValues.MedicineForm"
,
"MedicineForm"
)
.
WithMany
()
.
HasForeignKey
(
"MedicineFormId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
Navigation
(
"MedicineForm"
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.Doctors.Doctor"
,
b
=>
{
b
.
HasOne
(
"Domain.Entities.People.Shared.PersonalInfo"
,
"PersonalInfo"
)
.
WithOne
()
.
HasForeignKey
(
"Domain.Entities.People.Doctors.Doctor"
,
"PersonalInfoId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
HasOne
(
"Domain.Entities.People.Doctors.Shared.Constants.DoctorStatusValues.DoctorStatus"
,
"Status"
)
.
WithMany
()
.
HasForeignKey
(
"StatusId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
Navigation
(
"PersonalInfo"
);
b
.
Navigation
(
"Status"
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.Doctors.Shared.DoctorPhone"
,
b
=>
{
b
.
HasOne
(
"Domain.Entities.People.Doctors.Doctor"
,
null
)
.
WithMany
(
"Phones"
)
.
HasForeignKey
(
"DoctorId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.Employees.Employee"
,
b
=>
{
b
.
HasOne
(
"Domain.Entities.People.Employees.Shared.EmployeeAdditionalInfo"
,
"AdditionalInfo"
)
.
WithOne
()
.
HasForeignKey
(
"Domain.Entities.People.Employees.Employee"
,
"AdditionalInfoId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
b
.
HasOne
(
"Domain.Entities.People.Patients.Patient"
,
"Patient"
)
.
WithOne
()
.
HasForeignKey
(
"Domain.Entities.People.Employees.Employee"
,
"Id"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
Navigation
(
"AdditionalInfo"
);
b
.
Navigation
(
"Patient"
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.Employees.Relations.EmployeeFamilyMembers.EmployeeFamilyMember"
,
b
=>
{
b
.
HasOne
(
"Domain.Entities.People.Employees.Employee"
,
"Employee"
)
.
WithMany
(
"FamilyMembers"
)
.
HasForeignKey
(
"EmployeeId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
HasOne
(
"Domain.Entities.People.FamilyMembers.FamilyMember"
,
"FamilyMember"
)
.
WithMany
()
.
HasForeignKey
(
"FamilyMemberId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
HasOne
(
"Domain.Entities.People.Employees.Relations.EmployeeFamilyMembers.FamilyRoleValues.FamilyRole"
,
"Role"
)
.
WithMany
()
.
HasForeignKey
(
"RoleId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
Navigation
(
"Employee"
);
b
.
Navigation
(
"FamilyMember"
);
b
.
Navigation
(
"Role"
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.FamilyMembers.FamilyMember"
,
b
=>
{
b
.
HasOne
(
"Domain.Entities.People.Patients.Patient"
,
"Patient"
)
.
WithOne
()
.
HasForeignKey
(
"Domain.Entities.People.FamilyMembers.FamilyMember"
,
"Id"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
Navigation
(
"Patient"
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.Patients.Patient"
,
b
=>
{
b
.
HasOne
(
"Domain.Entities.People.Shared.GenderValues.Gender"
,
"Gender"
)
.
WithMany
()
.
HasForeignKey
(
"GenderId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
HasOne
(
"Domain.Entities.People.Shared.PersonalInfo"
,
"PersonalInfo"
)
.
WithOne
()
.
HasForeignKey
(
"Domain.Entities.People.Patients.Patient"
,
"PersonalInfoId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
Navigation
(
"Gender"
);
b
.
Navigation
(
"PersonalInfo"
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.Patients.Relations.PatientDiseases.PatientDisease"
,
b
=>
{
b
.
HasOne
(
"Domain.Entities.Medicals.Diseases.Disease"
,
"Disease"
)
.
WithMany
(
"Patients"
)
.
HasForeignKey
(
"DiseaseId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
HasOne
(
"Domain.Entities.People.Patients.Patient"
,
"Patient"
)
.
WithMany
(
"Diseases"
)
.
HasForeignKey
(
"PatientId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
Navigation
(
"Disease"
);
b
.
Navigation
(
"Patient"
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.Patients.Relations.PatientMedicines.PatientMedicine"
,
b
=>
{
b
.
HasOne
(
"Domain.Entities.Medicals.Medicines.Medicine"
,
"Medicine"
)
.
WithMany
(
"Patients"
)
.
HasForeignKey
(
"MedicineId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
HasOne
(
"Domain.Entities.People.Patients.Patient"
,
"Patient"
)
.
WithMany
(
"Medicines"
)
.
HasForeignKey
(
"PatientId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
Navigation
(
"Medicine"
);
b
.
Navigation
(
"Patient"
);
});
modelBuilder
.
Entity
(
"Domain.Entities.Visits.Relations.VisitMedicalImages.VisitMedicalImage"
,
b
=>
{
b
.
HasOne
(
"Domain.Entities.Medicals.MedicalImages.MedicalImage"
,
"MedicalImage"
)
.
WithMany
()
.
HasForeignKey
(
"MedicalImageId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
HasOne
(
"Domain.Entities.Visits.Visit"
,
"Visit"
)
.
WithMany
(
"MedicalImages"
)
.
HasForeignKey
(
"VisitId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
Navigation
(
"MedicalImage"
);
b
.
Navigation
(
"Visit"
);
});
modelBuilder
.
Entity
(
"Domain.Entities.Visits.Relations.VisitMedicalTests.VisitMedicalTest"
,
b
=>
{
b
.
HasOne
(
"Domain.Entities.Medicals.MedicalTests.MedicalTest"
,
"MedicalTest"
)
.
WithMany
()
.
HasForeignKey
(
"MedicalTestId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
HasOne
(
"Domain.Entities.Visits.Visit"
,
"Visit"
)
.
WithMany
(
"MedicalTests"
)
.
HasForeignKey
(
"VisitId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
Navigation
(
"MedicalTest"
);
b
.
Navigation
(
"Visit"
);
});
modelBuilder
.
Entity
(
"Domain.Entities.Visits.Relations.VisitMedicines.VisitMedicine"
,
b
=>
{
b
.
HasOne
(
"Domain.Entities.Medicals.Medicines.Medicine"
,
"Medicine"
)
.
WithMany
()
.
HasForeignKey
(
"MedicineId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
HasOne
(
"Domain.Entities.Visits.Visit"
,
"Visit"
)
.
WithMany
(
"Medicines"
)
.
HasForeignKey
(
"VisitId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
Navigation
(
"Medicine"
);
b
.
Navigation
(
"Visit"
);
});
modelBuilder
.
Entity
(
"Domain.Entities.Visits.Visit"
,
b
=>
{
b
.
HasOne
(
"Domain.Entities.People.Doctors.Doctor"
,
"Doctor"
)
.
WithMany
()
.
HasForeignKey
(
"DoctorId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
HasOne
(
"Domain.Entities.Medicals.Hospitals.Hospital"
,
"Hospital"
)
.
WithMany
()
.
HasForeignKey
(
"HospitalId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
b
.
HasOne
(
"Domain.Entities.People.Patients.Patient"
,
"Patient"
)
.
WithMany
(
"Visits"
)
.
HasForeignKey
(
"PatientId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
Navigation
(
"Doctor"
);
b
.
Navigation
(
"Hospital"
);
b
.
Navigation
(
"Patient"
);
});
modelBuilder
.
Entity
(
"Domain.Entities.WaitingList.WaitingListRecord"
,
b
=>
{
b
.
HasOne
(
"Domain.Entities.People.Doctors.Doctor"
,
"Doctor"
)
.
WithMany
()
.
HasForeignKey
(
"DoctorId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
b
.
HasOne
(
"Domain.Entities.People.Patients.Patient"
,
"Patient"
)
.
WithMany
()
.
HasForeignKey
(
"PatientId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
)
.
IsRequired
();
b
.
Navigation
(
"Doctor"
);
b
.
Navigation
(
"Patient"
);
});
modelBuilder
.
Entity
(
"EmployeeEmployee"
,
b
=>
{
b
.
HasOne
(
"Domain.Entities.People.Employees.Employee"
,
null
)
.
WithMany
()
.
HasForeignKey
(
"RelatedEmployeesId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"Domain.Entities.People.Employees.Employee"
,
null
)
.
WithMany
()
.
HasForeignKey
(
"RelatedToId"
)
.
OnDelete
(
DeleteBehavior
.
ClientCascade
)
.
IsRequired
();
});
modelBuilder
.
Entity
(
"Domain.Entities.Medicals.Diseases.Disease"
,
b
=>
{
b
.
Navigation
(
"Patients"
);
});
modelBuilder
.
Entity
(
"Domain.Entities.Medicals.Medicines.Medicine"
,
b
=>
{
b
.
Navigation
(
"Patients"
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.Doctors.Doctor"
,
b
=>
{
b
.
Navigation
(
"Phones"
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.Employees.Employee"
,
b
=>
{
b
.
Navigation
(
"FamilyMembers"
);
});
modelBuilder
.
Entity
(
"Domain.Entities.People.Patients.Patient"
,
b
=>
{
b
.
Navigation
(
"Diseases"
);
b
.
Navigation
(
"Medicines"
);
b
.
Navigation
(
"Visits"
);
});
modelBuilder
.
Entity
(
"Domain.Entities.Visits.Visit"
,
b
=>
{
b
.
Navigation
(
"MedicalImages"
);
b
.
Navigation
(
"MedicalTests"
);
b
.
Navigation
(
"Medicines"
);
});
#pragma warning restore 612, 618
}
}
}
Clinics.Backend/Persistence/Migrations/20240816173549_Add_Amount_To_Medicine.cs
0 → 100644
View file @
56b44861
using
Microsoft.EntityFrameworkCore.Migrations
;
#
nullable
disable
namespace
Persistence.Migrations
{
/// <inheritdoc />
public
partial
class
Add_Amount_To_Medicine
:
Migration
{
/// <inheritdoc />
protected
override
void
Up
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
AddColumn
<
int
>(
name
:
"Amount"
,
table
:
"Medicine"
,
type
:
"int"
,
nullable
:
false
,
defaultValue
:
0
);
}
/// <inheritdoc />
protected
override
void
Down
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
DropColumn
(
name
:
"Amount"
,
table
:
"Medicine"
);
}
}
}
Clinics.Backend/Persistence/Migrations/ClinicsDbContextModelSnapshot.cs
View file @
56b44861
...
...
@@ -110,6 +110,9 @@ namespace Persistence.Migrations
SqlServerPropertyBuilderExtensions
.
UseIdentityColumn
(
b
.
Property
<
int
>(
"Id"
));
b
.
Property
<
int
>(
"Amount"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
decimal
>(
"Dosage"
)
.
HasColumnType
(
"numeric(9, 3)"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment