feature: a minimal v1 backend implemented for treatments feature.

This commit is contained in:
2026-05-19 22:29:29 +03:30
parent 935bb8c214
commit f743046b38
27 changed files with 1636 additions and 656 deletions

View File

@@ -12,19 +12,6 @@ export interface Patient {
updatedAt: string;
}
export interface TreatmentHistoryItem {
id: string;
patientId: string;
title: string;
status: string;
treatmentAt: string;
tooth?: string | null;
notes?: string | null;
totalCost?: number | null;
createdAt: string;
updatedAt: string;
}
export interface CreatePatientInput {
firstName: string;
lastName: string;
@@ -34,15 +21,6 @@ export interface CreatePatientInput {
notes?: string;
}
export interface CreateTreatmentHistoryInput {
title: string;
status: string;
treatmentAt: string;
tooth?: string;
notes?: string;
totalCost?: number;
}
export interface PatientsListResponse {
success: boolean;
data: {

View File

@@ -61,20 +61,25 @@ export const TREATMENT_TYPES = [
export type TreatmentType = (typeof TREATMENT_TYPES)[number];
export interface PastTreatmentRecord {
export interface PastTreatmentCase {
id: string;
clientId: string;
treatmentType: TreatmentType;
teeth: FdiToothId[];
notes?: string | null;
attachmentMetas?: TreatmentAttachmentMeta[];
sendToOrganizationIds?: string[];
sentAt?: string | null;
}
export interface PastTreatment {
id: string;
patientId: string;
appointmentId?: string | null;
title: string;
treatmentAt: string;
status: string;
records: PastTreatmentRecord[];
cases: PastTreatmentCase[];
documents: TreatmentAttachmentMeta[];
}
@@ -84,29 +89,32 @@ export interface LinkedOrganizationOption {
active: boolean;
}
export interface TreatmentRecordDraft {
export interface TreatmentCaseDraft {
clientId: string;
id?: string;
treatmentType: TreatmentType;
teeth: FdiToothId[];
comment: string;
attachmentMetas: TreatmentAttachmentMeta[];
/** Organizations selected for sending this record (mock only until API exists) */
sendToOrganizationIds: string[];
sentAt?: string | null;
}
/** Payload for persisting a draft (mock API); omits ephemeral client-only fields */
export type SavedTreatmentRecordPayload = Omit<TreatmentRecordDraft, 'clientId' | 'sentAt'>;
export type SavedTreatmentCasePayload = {
clientId: string;
id?: string;
treatmentType: TreatmentType;
teeth: FdiToothId[];
comment: string;
attachmentIds: string[];
};
export interface SaveTreatmentPayload {
appointmentId: string;
patientId: string;
records: SavedTreatmentRecordPayload[];
cases: SavedTreatmentCasePayload[];
}
export interface SendTreatmentRecordPayload {
appointmentId: string;
patientId: string;
recordClientId: string;
export interface SendTreatmentCasePayload {
organizationIds: string[];
}