feature: a minimal implementation of the appointment feature done.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsDateString, IsIn, IsUUID } from 'class-validator';
|
||||
|
||||
const APPOINTMENT_PURPOSES = ['consultation', 'filling', 'endo', 'visit', 'hygiene'] as const;
|
||||
|
||||
export type AppointmentPurpose = (typeof APPOINTMENT_PURPOSES)[number];
|
||||
|
||||
export class CreateAppointmentDto {
|
||||
@ApiProperty()
|
||||
@IsUUID()
|
||||
patientId: string;
|
||||
|
||||
@ApiProperty({ description: 'Staff user id (column provider)' })
|
||||
@IsUUID()
|
||||
providerUserId: string;
|
||||
|
||||
@ApiProperty({ example: '2026-05-06T09:15:00.000Z' })
|
||||
@IsDateString()
|
||||
startAt: string;
|
||||
|
||||
@ApiProperty({ example: '2026-05-06T09:45:00.000Z' })
|
||||
@IsDateString()
|
||||
endAt: string;
|
||||
|
||||
@ApiProperty({ enum: APPOINTMENT_PURPOSES })
|
||||
@IsIn([...APPOINTMENT_PURPOSES])
|
||||
purpose: AppointmentPurpose;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsDateString } from 'class-validator';
|
||||
|
||||
export class ListAppointmentsDto {
|
||||
@ApiProperty({ description: 'Range start (ISO 8601), e.g. local midnight as instant' })
|
||||
@IsDateString()
|
||||
from: string;
|
||||
|
||||
@ApiProperty({ description: 'Range end (ISO 8601), e.g. next local midnight' })
|
||||
@IsDateString()
|
||||
to: string;
|
||||
}
|
||||
Reference in New Issue
Block a user