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
a6111736
Commit
a6111736
authored
Aug 15, 2024
by
Almouhannad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(B) Add configurations
parent
8150215a
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
546 additions
and
0 deletions
+546
-0
DiseaseConfiguration.cs
.../Configurations/Medicals/Diseases/DiseaseConfiguration.cs
+15
-0
HospitalConfiguration.cs
...onfigurations/Medicals/Hospitals/HospitalConfiguration.cs
+15
-0
MedicalImageConfiguration.cs
...tions/Medicals/MedicalImages/MedicalImageConfiguration.cs
+16
-0
MedicalTestConfiguration.cs
...rations/Medicals/MedicalTests/MedicalTestConfiguration.cs
+17
-0
MedicineConfiguration.cs
...onfigurations/Medicals/Medicines/MedicineConfiguration.cs
+19
-0
MedicineFormConfiguration.cs
...gurations/Medicals/Medicines/MedicineFormConfiguration.cs
+18
-0
DoctorConfiguration.cs
...ence/Configurations/People/Doctors/DoctorConfiguration.cs
+26
-0
DoctorPhoneConfiguration.cs
...Configurations/People/Doctors/DoctorPhoneConfiguration.cs
+19
-0
DoctorStatusConfiguration.cs
...onfigurations/People/Doctors/DoctorStatusConfiguration.cs
+18
-0
EmployeeAdditionalInfoConfiguration.cs
...s/People/Employees/EmployeeAdditionalInfoConfiguration.cs
+31
-0
EmployeeConfiguration.cs
.../Configurations/People/Employees/EmployeeConfiguration.cs
+35
-0
EmployeeFamilyMemberConfiguration.cs
...ons/People/Employees/EmployeeFamilyMemberConfiguration.cs
+27
-0
FamilyRoleConfiguration.cs
...onfigurations/People/Employees/FamilyRoleConfiguration.cs
+17
-0
FamilyMemberConfiguration.cs
...rations/People/FamilyMembers/FamilyMemberConfiguration.cs
+20
-0
PatientConfiguration.cs
...ce/Configurations/People/Patients/PatientConfiguration.cs
+26
-0
PatientDiseaseConfiguration.cs
...igurations/People/Patients/PatientDiseaseConfiguration.cs
+28
-0
PatientMedicineConfiguration.cs
...gurations/People/Patients/PatientMedicineConfiguration.cs
+27
-0
GenderConfiguration.cs
...tence/Configurations/People/Shared/GenderConfiguration.cs
+18
-0
PersonalInfoConfiguration.cs
...Configurations/People/Shared/PersonalInfoConfiguration.cs
+17
-0
VisitConfiguration.cs
...d/Persistence/Configurations/Visits/VisitConfiguration.cs
+23
-0
VisitMedicalImageConfiguration.cs
...e/Configurations/Visits/VisitMedicalImageConfiguration.cs
+30
-0
VisitMedicalTestConfiguration.cs
...ce/Configurations/Visits/VisitMedicalTestConfiguration.cs
+30
-0
VisitMedicineConfiguration.cs
...tence/Configurations/Visits/VisitMedicineConfiguration.cs
+27
-0
WaitingListRecordConfiguration.cs
...figurations/WaitingList/WaitingListRecordConfiguration.cs
+27
-0
No files found.
Clinics.Backend/Persistence/Configurations/Medicals/Diseases/DiseaseConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.Medicals.Diseases
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.Medicals.Diseases
;
internal
class
DiseaseConfiguration
:
IEntityTypeConfiguration
<
Disease
>
{
public
void
Configure
(
EntityTypeBuilder
<
Disease
>
builder
)
{
builder
.
ToTable
(
nameof
(
Disease
));
builder
.
Property
(
disease
=>
disease
.
Name
).
HasMaxLength
(
50
);
}
}
\ No newline at end of file
Clinics.Backend/Persistence/Configurations/Medicals/Hospitals/HospitalConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.Medicals.Hospitals
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.Medicals.Hospitals
;
internal
class
HospitalConfiguration
:
IEntityTypeConfiguration
<
Hospital
>
{
public
void
Configure
(
EntityTypeBuilder
<
Hospital
>
builder
)
{
builder
.
ToTable
(
nameof
(
Hospital
));
builder
.
Property
(
hospital
=>
hospital
.
Name
).
HasMaxLength
(
50
);
}
}
\ No newline at end of file
Clinics.Backend/Persistence/Configurations/Medicals/MedicalImages/MedicalImageConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.Medicals.MedicalImages
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.Medicals.MedicalImages
;
internal
class
MedicalImageConfiguration
:
IEntityTypeConfiguration
<
MedicalImage
>
{
public
void
Configure
(
EntityTypeBuilder
<
MedicalImage
>
builder
)
{
builder
.
ToTable
(
nameof
(
MedicalImage
));
builder
.
Property
(
medicalImage
=>
medicalImage
.
Description
).
HasMaxLength
(
250
);
builder
.
Property
(
medicalImage
=>
medicalImage
.
Name
).
HasMaxLength
(
50
);
}
}
\ No newline at end of file
Clinics.Backend/Persistence/Configurations/Medicals/MedicalTests/MedicalTestConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.Medicals.MedicalTests
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.Medicals.MedicalTests
;
internal
class
MedicalTestConfiguration
:
IEntityTypeConfiguration
<
MedicalTest
>
{
public
void
Configure
(
EntityTypeBuilder
<
MedicalTest
>
builder
)
{
builder
.
ToTable
(
nameof
(
MedicalTest
));
builder
.
Property
(
medicalTest
=>
medicalTest
.
Description
).
HasMaxLength
(
250
);
builder
.
Property
(
medicalTest
=>
medicalTest
.
Name
).
HasMaxLength
(
50
);
}
}
\ No newline at end of file
Clinics.Backend/Persistence/Configurations/Medicals/Medicines/MedicineConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.Medicals.Medicines
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.Medicals.Medicines
;
internal
class
MedicineConfiguration
:
IEntityTypeConfiguration
<
Medicine
>
{
public
void
Configure
(
EntityTypeBuilder
<
Medicine
>
builder
)
{
builder
.
ToTable
(
nameof
(
Medicine
));
builder
.
Property
(
e
=>
e
.
Dosage
).
HasColumnType
(
"numeric(9, 3)"
);
builder
.
HasOne
(
medicine
=>
medicine
.
MedicineForm
)
.
WithMany
()
.
OnDelete
(
DeleteBehavior
.
NoAction
);
}
}
\ No newline at end of file
Clinics.Backend/Persistence/Configurations/Medicals/Medicines/MedicineFormConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.Medicals.Medicines.MedicineFormValues
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.Medicals.Medicines
;
// TODO: Seed database with initial values from MedicineFormValues
internal
class
MedicineFormConfiguration
:
IEntityTypeConfiguration
<
MedicineForm
>
{
public
void
Configure
(
EntityTypeBuilder
<
MedicineForm
>
builder
)
{
builder
.
ToTable
(
nameof
(
MedicineForm
));
builder
.
Property
(
medicineForm
=>
medicineForm
.
Id
).
ValueGeneratedNever
();
builder
.
Property
(
medicineForm
=>
medicineForm
.
Name
).
HasMaxLength
(
50
);
}
}
\ No newline at end of file
Clinics.Backend/Persistence/Configurations/People/Doctors/DoctorConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.People.Doctors
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.People.Doctors
;
internal
class
DoctorConfiguration
:
IEntityTypeConfiguration
<
Doctor
>
{
public
void
Configure
(
EntityTypeBuilder
<
Doctor
>
builder
)
{
builder
.
ToTable
(
nameof
(
Doctor
));
builder
.
HasOne
(
doctor
=>
doctor
.
PersonalInfo
)
.
WithOne
()
.
HasForeignKey
<
Doctor
>(
"PersonalInfoId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
builder
.
HasOne
(
doctor
=>
doctor
.
Status
)
.
WithMany
()
.
OnDelete
(
DeleteBehavior
.
NoAction
);
builder
.
HasMany
(
doctor
=>
doctor
.
Phones
)
.
WithOne
()
.
OnDelete
(
DeleteBehavior
.
NoAction
);
}
}
\ No newline at end of file
Clinics.Backend/Persistence/Configurations/People/Doctors/DoctorPhoneConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.People.Doctors.Shared
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.People.Doctors
;
internal
class
DoctorPhoneConfiguration
:
IEntityTypeConfiguration
<
DoctorPhone
>
{
public
void
Configure
(
EntityTypeBuilder
<
DoctorPhone
>
builder
)
{
builder
.
ToTable
(
nameof
(
DoctorPhone
));
builder
.
Property
(
doctorPhone
=>
doctorPhone
.
Name
).
HasMaxLength
(
50
);
builder
.
Property
(
doctorPhone
=>
doctorPhone
.
Phone
).
HasMaxLength
(
20
);
builder
.
HasIndex
(
doctorPhone
=>
doctorPhone
.
Phone
).
IsUnique
();
}
}
\ No newline at end of file
Clinics.Backend/Persistence/Configurations/People/Doctors/DoctorStatusConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.People.Doctors.Shared.Constants.DoctorStatusValues
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.People.Doctors
;
// TODO: Seed database with initial values from DoctorStatusValues
internal
class
DoctorStatusConfiguration
:
IEntityTypeConfiguration
<
DoctorStatus
>
{
public
void
Configure
(
EntityTypeBuilder
<
DoctorStatus
>
builder
)
{
builder
.
ToTable
(
nameof
(
DoctorStatus
));
builder
.
Property
(
doctorStatus
=>
doctorStatus
.
Id
).
ValueGeneratedNever
();
builder
.
Property
(
doctorStatus
=>
doctorStatus
.
Name
).
HasMaxLength
(
50
);
}
}
\ No newline at end of file
Clinics.Backend/Persistence/Configurations/People/Employees/EmployeeAdditionalInfoConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.People.Employees.Shared
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.People.Employees
;
internal
class
EmployeeAdditionalInfoConfiguration
:
IEntityTypeConfiguration
<
EmployeeAdditionalInfo
>
{
public
void
Configure
(
EntityTypeBuilder
<
EmployeeAdditionalInfo
>
builder
)
{
builder
.
ToTable
(
nameof
(
EmployeeAdditionalInfo
));
builder
.
Property
(
employeeAdditionalInfo
=>
employeeAdditionalInfo
.
AcademicQualification
)
.
HasMaxLength
(
50
);
builder
.
Property
(
employeeAdditionalInfo
=>
employeeAdditionalInfo
.
WorkPhone
)
.
HasMaxLength
(
20
);
builder
.
Property
(
employeeAdditionalInfo
=>
employeeAdditionalInfo
.
Location
)
.
HasMaxLength
(
50
);
builder
.
Property
(
employeeAdditionalInfo
=>
employeeAdditionalInfo
.
Specialization
)
.
HasMaxLength
(
50
);
builder
.
Property
(
employeeAdditionalInfo
=>
employeeAdditionalInfo
.
JobStatus
)
.
HasMaxLength
(
50
);
builder
.
Property
(
e
=>
e
.
ImageUrl
)
.
HasMaxLength
(
150
);
}
}
\ No newline at end of file
Clinics.Backend/Persistence/Configurations/People/Employees/EmployeeConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.People.Employees
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.People.Employees
;
internal
class
EmployeeConfiguration
:
IEntityTypeConfiguration
<
Employee
>
{
public
void
Configure
(
EntityTypeBuilder
<
Employee
>
builder
)
{
builder
.
ToTable
(
nameof
(
Employee
));
builder
.
Property
(
employee
=>
employee
.
Id
).
ValueGeneratedOnAdd
();
builder
.
Property
(
employee
=>
employee
.
CenterStatus
).
HasMaxLength
(
50
);
builder
.
Property
(
employee
=>
employee
.
SerialNumber
).
HasMaxLength
(
20
);
builder
.
Property
(
employee
=>
employee
.
IsMarried
).
HasDefaultValue
(
false
)
.
IsRequired
();
builder
.
HasOne
(
employee
=>
employee
.
AdditionalInfo
)
.
WithOne
()
.
HasForeignKey
<
Employee
>(
"AdditionalInfoId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
builder
.
HasOne
(
employee
=>
employee
.
Patient
)
.
WithOne
()
.
HasForeignKey
<
Employee
>(
employee
=>
employee
.
Id
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
builder
.
HasMany
(
employee
=>
employee
.
RelatedEmployees
)
.
WithMany
(
employee
=>
employee
.
RelatedTo
);
}
}
\ No newline at end of file
Clinics.Backend/Persistence/Configurations/People/Employees/EmployeeFamilyMemberConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.People.Employees.Relations.EmployeeFamilyMembers
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.People.Employees
;
internal
class
EmployeeFamilyMemberConfiguration
:
IEntityTypeConfiguration
<
EmployeeFamilyMember
>
{
public
void
Configure
(
EntityTypeBuilder
<
EmployeeFamilyMember
>
builder
)
{
builder
.
ToTable
(
nameof
(
EmployeeFamilyMember
));
builder
.
HasOne
(
employeeFamilyMember
=>
employeeFamilyMember
.
Role
)
.
WithMany
()
.
OnDelete
(
DeleteBehavior
.
NoAction
);
builder
.
HasOne
(
employeeFamilyMember
=>
employeeFamilyMember
.
FamilyMember
)
.
WithMany
()
.
HasForeignKey
(
employeeFamilyMember
=>
employeeFamilyMember
.
FamilyMemberId
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
builder
.
HasOne
(
employeeFamilyMember
=>
employeeFamilyMember
.
Employee
)
.
WithMany
(
employee
=>
employee
.
FamilyMembers
)
.
HasForeignKey
(
employeeFamilyMember
=>
employeeFamilyMember
.
EmployeeId
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
}
}
\ No newline at end of file
Clinics.Backend/Persistence/Configurations/People/Employees/FamilyRoleConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.People.Employees.Relations.EmployeeFamilyMembers.FamilyRoleValues
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.People.Employees
;
// TODO: Seed database with initial values from FamilyRoleValues
internal
class
FamilyRoleConfiguration
:
IEntityTypeConfiguration
<
FamilyRole
>
{
public
void
Configure
(
EntityTypeBuilder
<
FamilyRole
>
builder
)
{
builder
.
ToTable
(
nameof
(
FamilyRole
));
builder
.
Property
(
familyRole
=>
familyRole
.
Id
).
ValueGeneratedNever
();
builder
.
Property
(
familyRole
=>
familyRole
.
Name
).
HasMaxLength
(
50
);
}
}
\ No newline at end of file
Clinics.Backend/Persistence/Configurations/People/FamilyMembers/FamilyMemberConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.People.FamilyMembers
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.People.FamilyMembers
;
internal
class
FamilyMemberConfiguration
:
IEntityTypeConfiguration
<
FamilyMember
>
{
public
void
Configure
(
EntityTypeBuilder
<
FamilyMember
>
builder
)
{
builder
.
ToTable
(
nameof
(
FamilyMember
));
builder
.
Property
(
familyMember
=>
familyMember
.
Id
).
ValueGeneratedOnAdd
();
builder
.
HasOne
(
familyMember
=>
familyMember
.
Patient
)
.
WithOne
()
.
HasForeignKey
<
FamilyMember
>(
familyMember
=>
familyMember
.
Id
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
}
}
\ No newline at end of file
Clinics.Backend/Persistence/Configurations/People/Patients/PatientConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.People.Patients
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.People.Patients
;
internal
class
PatientConfiguration
:
IEntityTypeConfiguration
<
Patient
>
{
public
void
Configure
(
EntityTypeBuilder
<
Patient
>
builder
)
{
builder
.
ToTable
(
nameof
(
Patient
));
builder
.
HasOne
(
patient
=>
patient
.
PersonalInfo
)
.
WithOne
()
.
HasForeignKey
<
Patient
>(
"PersonalInfoId"
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
builder
.
HasOne
(
patient
=>
patient
.
Gender
)
.
WithMany
()
.
OnDelete
(
DeleteBehavior
.
NoAction
);
builder
.
HasMany
(
patient
=>
patient
.
Visits
)
.
WithOne
(
visit
=>
visit
.
Patient
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
}
}
\ No newline at end of file
Clinics.Backend/Persistence/Configurations/People/Patients/PatientDiseaseConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.People.Patients.Relations.PatientDiseases
;
using
Domain.Entities.People.Patients.Relations.PatientMedicines
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.People.Patients
;
internal
class
PatientDiseaseConfiguration
:
IEntityTypeConfiguration
<
PatientDisease
>
{
public
void
Configure
(
EntityTypeBuilder
<
PatientDisease
>
builder
)
{
builder
.
ToTable
(
nameof
(
PatientDisease
));
builder
.
HasOne
(
patientDisease
=>
patientDisease
.
Patient
)
.
WithMany
(
patient
=>
patient
.
Diseases
)
.
HasForeignKey
(
patientDisease
=>
patientDisease
.
PatientId
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
builder
.
HasOne
(
patientDisease
=>
patientDisease
.
Disease
)
.
WithMany
(
medicine
=>
medicine
.
Patients
)
.
HasForeignKey
(
patientDisease
=>
patientDisease
.
DiseaseId
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
builder
.
HasIndex
(
patientDisease
=>
new
{
patientDisease
.
PatientId
,
patientDisease
.
DiseaseId
})
.
IsUnique
();
}
}
Clinics.Backend/Persistence/Configurations/People/Patients/PatientMedicineConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.People.Patients.Relations.PatientMedicines
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.People.Patients
;
internal
class
PatientMedicineConfiguration
:
IEntityTypeConfiguration
<
PatientMedicine
>
{
public
void
Configure
(
EntityTypeBuilder
<
PatientMedicine
>
builder
)
{
builder
.
ToTable
(
nameof
(
PatientMedicine
));
builder
.
HasOne
(
patientMedicine
=>
patientMedicine
.
Patient
)
.
WithMany
(
patient
=>
patient
.
Medicines
)
.
HasForeignKey
(
patientMedicine
=>
patientMedicine
.
PatientId
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
builder
.
HasOne
(
patientMedicine
=>
patientMedicine
.
Medicine
)
.
WithMany
(
medicine
=>
medicine
.
Patients
)
.
HasForeignKey
(
patientMedicine
=>
patientMedicine
.
MedicineId
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
builder
.
HasIndex
(
patientMedicine
=>
new
{
patientMedicine
.
PatientId
,
patientMedicine
.
MedicineId
})
.
IsUnique
();
}
}
\ No newline at end of file
Clinics.Backend/Persistence/Configurations/People/Shared/GenderConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.People.Shared.GenderValues
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.People.Shared
;
// TODO: Seed database with initial values from GenderValues
internal
class
GenderConfiguration
:
IEntityTypeConfiguration
<
Gender
>
{
public
void
Configure
(
EntityTypeBuilder
<
Gender
>
builder
)
{
builder
.
ToTable
(
nameof
(
Gender
));
builder
.
Property
(
gender
=>
gender
.
Id
).
ValueGeneratedNever
();
builder
.
Property
(
gender
=>
gender
.
Name
).
HasMaxLength
(
50
);
}
}
\ No newline at end of file
Clinics.Backend/Persistence/Configurations/People/Shared/PersonalInfoConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.People.Shared
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.People.Shared
;
internal
class
PersonalInfoConfiguration
:
IEntityTypeConfiguration
<
PersonalInfo
>
{
public
void
Configure
(
EntityTypeBuilder
<
PersonalInfo
>
builder
)
{
builder
.
ToTable
(
nameof
(
PersonalInfo
));
builder
.
Property
(
personalInfo
=>
personalInfo
.
FirstName
).
HasMaxLength
(
50
);
builder
.
Property
(
personalInfo
=>
personalInfo
.
LastName
).
HasMaxLength
(
50
);
builder
.
Property
(
personalInfo
=>
personalInfo
.
MiddleName
).
HasMaxLength
(
50
);
}
}
Clinics.Backend/Persistence/Configurations/Visits/VisitConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.Visits
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.Visits
;
internal
class
VisitConfiguration
:
IEntityTypeConfiguration
<
Visit
>
{
public
void
Configure
(
EntityTypeBuilder
<
Visit
>
builder
)
{
builder
.
ToTable
(
nameof
(
Visit
));
builder
.
Property
(
visit
=>
visit
.
Diagnosis
).
HasMaxLength
(
250
);
builder
.
HasOne
(
visit
=>
visit
.
Doctor
)
.
WithMany
()
.
OnDelete
(
DeleteBehavior
.
NoAction
);
builder
.
HasOne
(
visit
=>
visit
.
Hospital
)
.
WithMany
()
.
OnDelete
(
DeleteBehavior
.
NoAction
);
}
}
\ No newline at end of file
Clinics.Backend/Persistence/Configurations/Visits/VisitMedicalImageConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.Visits.Relations.VisitMedicalImages
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.Visits
;
internal
class
VisitMedicalImageConfiguration
:
IEntityTypeConfiguration
<
VisitMedicalImage
>
{
public
void
Configure
(
EntityTypeBuilder
<
VisitMedicalImage
>
builder
)
{
builder
.
ToTable
(
nameof
(
VisitMedicalImage
));
builder
.
Property
(
visitMedicalImage
=>
visitMedicalImage
.
Result
)
.
HasMaxLength
(
250
);
builder
.
HasOne
(
visitMedicalImage
=>
visitMedicalImage
.
Visit
)
.
WithMany
(
visit
=>
visit
.
MedicalImages
)
.
HasForeignKey
(
visitMedicalImage
=>
visitMedicalImage
.
VisitId
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
builder
.
HasOne
(
visitMedicalImage
=>
visitMedicalImage
.
MedicalImage
)
.
WithMany
()
.
HasForeignKey
(
visitMedicalImage
=>
visitMedicalImage
.
MedicalImageId
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
builder
.
HasIndex
(
visitMedicalImage
=>
new
{
visitMedicalImage
.
VisitId
,
visitMedicalImage
.
MedicalImageId
})
.
IsUnique
();
}
}
\ No newline at end of file
Clinics.Backend/Persistence/Configurations/Visits/VisitMedicalTestConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.Visits.Relations.VisitMedicalTests
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.Visits
;
internal
class
VisitMedicalTestConfiguration
:
IEntityTypeConfiguration
<
VisitMedicalTest
>
{
public
void
Configure
(
EntityTypeBuilder
<
VisitMedicalTest
>
builder
)
{
builder
.
ToTable
(
nameof
(
VisitMedicalTest
));
builder
.
Property
(
visitMedicalTest
=>
visitMedicalTest
.
Result
)
.
HasMaxLength
(
250
);
builder
.
HasOne
(
visitMedicalTest
=>
visitMedicalTest
.
Visit
)
.
WithMany
(
visit
=>
visit
.
MedicalTests
)
.
HasForeignKey
(
visitMedicalTest
=>
visitMedicalTest
.
VisitId
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
builder
.
HasOne
(
visitMedicalTest
=>
visitMedicalTest
.
MedicalTest
)
.
WithMany
()
.
HasForeignKey
(
visitMedicalTest
=>
visitMedicalTest
.
MedicalTestId
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
builder
.
HasIndex
(
visitMedicalTest
=>
new
{
visitMedicalTest
.
VisitId
,
visitMedicalTest
.
MedicalTestId
})
.
IsUnique
();
}
}
\ No newline at end of file
Clinics.Backend/Persistence/Configurations/Visits/VisitMedicineConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.Visits.Relations.VisitMedicines
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.Visits
;
internal
class
VisitMedicineConfiguration
:
IEntityTypeConfiguration
<
VisitMedicine
>
{
public
void
Configure
(
EntityTypeBuilder
<
VisitMedicine
>
builder
)
{
builder
.
ToTable
(
nameof
(
VisitMedicine
));
builder
.
HasOne
(
visitMedicine
=>
visitMedicine
.
Visit
)
.
WithMany
(
visitMedicine
=>
visitMedicine
.
Medicines
)
.
HasForeignKey
(
visitMedicine
=>
visitMedicine
.
VisitId
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
builder
.
HasOne
(
visitMedicine
=>
visitMedicine
.
Medicine
)
.
WithMany
()
.
HasForeignKey
(
visitMedicine
=>
visitMedicine
.
MedicineId
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
builder
.
HasIndex
(
visitMedicine
=>
new
{
visitMedicine
.
VisitId
,
visitMedicine
.
MedicineId
})
.
IsUnique
();
}
}
\ No newline at end of file
Clinics.Backend/Persistence/Configurations/WaitingList/WaitingListRecordConfiguration.cs
0 → 100644
View file @
a6111736
using
Domain.Entities.WaitingList
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
namespace
Persistence.Configurations.WaitingList
;
internal
class
WaitingListRecordConfiguration
:
IEntityTypeConfiguration
<
WaitingListRecord
>
{
public
void
Configure
(
EntityTypeBuilder
<
WaitingListRecord
>
builder
)
{
builder
.
ToTable
(
nameof
(
WaitingListRecord
));
builder
.
Property
(
waitingListRecord
=>
waitingListRecord
.
IsServed
)
.
HasDefaultValue
(
false
)
.
IsRequired
();
builder
.
HasOne
(
waitingListRecord
=>
waitingListRecord
.
Patient
)
.
WithMany
()
.
HasForeignKey
(
waitingListRecord
=>
waitingListRecord
.
PatientId
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
builder
.
HasOne
(
waitingListRecord
=>
waitingListRecord
.
Doctor
)
.
WithMany
()
.
HasForeignKey
(
waitingListRecord
=>
waitingListRecord
.
DoctorId
)
.
OnDelete
(
DeleteBehavior
.
NoAction
);
}
}
\ No newline at end of file
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