/opt/mawid/apps/api/src/clinic
NameSizeModeActions
clinic.controller.ts7310644editdlrm
clinic.module.ts2830644editdlrm
clinic.service.ts7980644editdlrm
Edit: /opt/mawid/apps/api/src/clinic/clinic.service.ts (798B)
import { Injectable, NotFoundException } from '@nestjs/common'; import type { UpdateClinicInput } from '@mawid/shared'; import { PrismaService } from '../prisma/prisma.service'; @Injectable() export class ClinicService { constructor(private readonly prisma: PrismaService) {} async get(clinicId: string) { const clinic = await this.prisma.clinic.findUnique({ where: { id: clinicId } }); if (!clinic) throw new NotFoundException('Clinic not found'); return clinic; } async update(clinicId: string, input: UpdateClinicInput) { await this.get(clinicId); // workingHours and settings are replaced wholesale, not deep-merged — // the dashboard always submits the complete object. return this.prisma.clinic.update({ where: { id: clinicId }, data: input }); } }