feature: Phase 2- splitting the treatment schema into TreatmentDetail and LabCase.

This commit is contained in:
2026-06-28 15:34:56 +03:30
parent dc965b2528
commit 8b4ef6195d
12 changed files with 749 additions and 232 deletions

View File

@@ -94,18 +94,20 @@ export function TreatmentPreviewDialog({
{t('statusLabel')} {treatment.status}
</p>
{treatment.cases.length === 0 ? (
{treatment.details.length === 0 ? (
<p className="text-sm text-text-muted">{t('noCases')}</p>
) : (
<div className="space-y-2">
{treatment.cases.map((c, idx) => {
{treatment.details.map((c, idx) => {
const key = caseKey(c);
const attachments = c.attachmentMetas ?? [];
const latestAttachment =
attachments.length > 0 ? attachments[attachments.length - 1] : null;
const sent = Boolean(c.sentAt);
const actionsEnabled = editable && !sent;
const selectedOrgIds = getCaseOrgIds?.(key) ?? c.sendToOrganizationIds ?? [];
const selectedOrgIds =
getCaseOrgIds?.(key) ??
(c.destinationOrganizationId ? [c.destinationOrganizationId] : []);
const sendExpanded = expandedSendCaseId === key;
const comment = c.notes?.trim() ?? '';
const attachBusy = uploadBusyCaseId === key;