finalizare 1.0

This commit is contained in:
andrei-mihnea-cerbu
2024-05-21 12:10:53 +03:00
parent f7795f7519
commit 1cc1d34003
11268 changed files with 2102399 additions and 10909 deletions
@@ -1,23 +1,31 @@
using Application.Endpoints.Appointments;
using Domain.Entities;
using MongoDB.Driver;
using Application.Endpoints.Appointments;
namespace Application.Services.Database.MongoDB;
public interface IAppointmentsMongoDbService
{
IMongoCollection<T> GetCollection<T>();
Task<List<T>> FindAsync<T>(List<(string FieldName, string Value)> criteria);
Task AddAsync<T>(T document);
Task ModifyAsync<T>(string keyField, string keyValue, T document);
Task DeleteAsync<T>(string keyField, string keyValue);
Task DeleteByIdAsync<T>(string id);
public Task<bool> IsAppointmentUnique(AppointmentManagementDto dto);
public Task<bool> DoesAppointmentExists(AppointmentManagementDto dto);
}
Task<List<T>> FindAsync<T>(List<(string FieldName, string Value)> criteria, CancellationToken token);
Task AddAsync<T>(T document, CancellationToken token);
Task ModifyAsync<T>(string keyField, string keyValue, T document, CancellationToken token);
Task DeleteAsync<T>(string keyField, string keyValue, CancellationToken token);
Task DeleteByIdAsync<T>(string id, CancellationToken token);
Task<bool> IsAppointmentUnique(AppointmentInformation request, CancellationToken token);
Task<bool> DoesAppointmentExists(AppointmentInformation request, CancellationToken token);
Task<List<Appointment>> FindPastAppointments(DateTime currentDate, CancellationToken token);
Task UpdateAppointment(Appointment appointment, CancellationToken token);
Task DeleteAppointment(string appointmentId, CancellationToken token);
Task<List<Appointment>> GetAllAppointments(CancellationToken token);
}
@@ -6,13 +6,13 @@ public interface IChatMongoDbService
{
IMongoCollection<T> GetCollection<T>();
Task<List<T>> FindAsync<T>(List<(string FieldName, string Value)> criteria);
Task<List<T>> FindAsync<T>(List<(string FieldName, string Value)> criteria, CancellationToken token);
Task AddAsync<T>(T document);
Task AddAsync<T>(T document, CancellationToken token);
Task ModifyAsync<T>(string keyField, string keyValue, T document);
Task ModifyAsync<T>(string keyField, string keyValue, T document, CancellationToken token);
Task DeleteAsync<T>(string keyField, string keyValue);
Task DeleteAsync<T>(string keyField, string keyValue, CancellationToken token);
Task DeleteByIdAsync<T>(string id);
Task DeleteByIdAsync<T>(string id, CancellationToken token);
}
@@ -6,13 +6,13 @@ public interface IMedicalHistoryMongoDbService
{
IMongoCollection<T> GetCollection<T>();
Task<List<T>> FindAsync<T>(List<(string FieldName, string Value)> criteria);
Task<List<T>> FindAsync<T>(List<(string FieldName, string Value)> criteria, CancellationToken token);
Task AddAsync<T>(T document);
Task AddAsync<T>(T document, CancellationToken token);
Task ModifyAsync<T>(string keyField, string keyValue, T document);
Task ModifyAsync<T>(string keyField, string keyValue, T document, CancellationToken token);
Task DeleteAsync<T>(string keyField, string keyValue);
Task DeleteAsync<T>(string keyField, string keyValue, CancellationToken token);
Task DeleteByIdAsync<T>(string id);
Task DeleteByIdAsync<T>(string id, CancellationToken token);
}
@@ -0,0 +1,20 @@
using Domain.Entities;
namespace Application.Services.Database.PostgreSQL;
public interface IAdminRepository
{
Task AddAsync(Admin admin, CancellationToken token);
Task<Admin?> GetByIdAsync(Guid id, CancellationToken token);
Task<Admin?> FindByEmailAsync(string email, CancellationToken token);
Task<bool> CredentialsMatch(string email, string password, CancellationToken token);
Task UpdateAsync(Admin admin, CancellationToken token);
Task DeleteAsync(Admin admin, CancellationToken token);
Task<IEnumerable<Admin>> GetAllAsync(CancellationToken token);
}
@@ -1,18 +1,17 @@
using Core.Entities;
using Domain.Entities;
namespace Application.Services.Database.PostgreSQL;
public interface IDoctorRepository
{
Task AddAsync(Doctor doctor);
Task AddAsync(Doctor doctor, CancellationToken token);
Task<Doctor?> GetByIdAsync(Guid id, CancellationToken token);
Task<Doctor?> FindByEmailAsync(string email, CancellationToken token);
Task<bool> CredentialsMatch(string email, string password, CancellationToken token);
Task<Doctor?> GetByIdAsync(Guid id);
Task<Doctor?> FindByEmailAsync(string email);
Task<bool> CredentialsMatch(string email, string password);
Task UpdateAsync(Doctor doctor, CancellationToken token);
Task UpdateAsync(Doctor doctor);
Task DeleteAsync(Doctor doctor, CancellationToken token);
Task DeleteAsync(Doctor doctor);
Task<IEnumerable<Doctor>> GetAllAsync();
Task<IEnumerable<Doctor>> GetAllAsync(CancellationToken token);
}
@@ -1,12 +1,13 @@
using Core.Entities;
using Domain.Entities;
namespace Application.Services.Database.PostgreSQL;
public interface IMedicalHistoryRepository
{
Task<MedicalHistory?> GetByIdAsync(Guid id);
Task AddAsync(MedicalHistory medicalHistory);
Task UpdateAsync(MedicalHistory medicalHistory);
Task DeleteAsync(MedicalHistory medicalHistory);
Task<IEnumerable<MedicalHistory>> GetAllAsync();
Task<MedicalHistory?> GetByIdAsync(Guid id, CancellationToken token);
Task<MedicalHistory?> GetByPatientIdAsync(Guid patientId, CancellationToken token);
Task AddAsync(MedicalHistory medicalHistory, CancellationToken token);
Task UpdateAsync(MedicalHistory medicalHistory, CancellationToken token);
Task DeleteAsync(MedicalHistory medicalHistory, CancellationToken token);
Task<IEnumerable<MedicalHistory>> GetAllAsync(CancellationToken token);
}
@@ -1,20 +1,20 @@
using Core.Entities;
using Domain.Entities;
namespace Application.Services.Database.PostgreSQL;
public interface IPatientRepository
{
Task AddAsync(Patient patient);
Task AddAsync(Patient patient, CancellationToken token);
Task<Patient?> GetByIdAsync(Guid id);
Task<Patient?> FindByEmailAsync(string email);
Task<bool> CredentialsMatch(string email, string password);
Task<Patient?> GetByIdAsync(Guid id, CancellationToken token);
Task UpdateAsync(Patient patient);
Task<Patient?> FindByEmailAsync(string email, CancellationToken token);
Task DeleteAsync(Patient patient);
Task<bool> CredentialsMatch(string email, string password, CancellationToken token);
Task<IEnumerable<Patient>> GetAllAsync();
Task UpdateAsync(Patient patient, CancellationToken token);
Task DeleteAsync(Patient patient, CancellationToken token);
Task<IEnumerable<Patient>> GetAllAsync(CancellationToken token);
}