improvement: Nothing done is related to subscriptions!!!

This commit is contained in:
2026-09-05 20:44:16 +03:30
parent 5cd3436d0c
commit 1ca8e6178e
13 changed files with 431 additions and 57 deletions

View File

@@ -341,12 +341,16 @@ export class AppointmentsService {
}
}
private async ensurePatientInOrg(patientId: string, _organizationId: string) {
const patient = await this.prisma.patient.findUnique({
where: { id: patientId },
select: { id: true, isWalkIn: true },
private async ensurePatientInOrg(patientId: string, organizationId: string) {
const patient = await this.prisma.patient.findFirst({
where: {
id: patientId,
isWalkIn: false,
createdByOrganizationId: organizationId,
},
select: { id: true },
});
if (!patient || patient.isWalkIn) {
if (!patient) {
throw new AppException(ErrorCode.PATIENT_NOT_FOUND, HttpStatus.NOT_FOUND);
}
}