feat: hide operational sections from DAK employees in case detail

DAK-Mitarbeiter now only see: Bearbeiten, Personendaten anfordern,
Fall-ID, CRM-Ticket, Datum, KW/Jahr, Persönliche Daten, Kontakt,
and ICD-Code entry. Hidden: Falldetails, Unterlagen, Gutachten,
Status, Abrechnung, status badges, and coding info.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
CCS Admin 2026-02-27 11:01:25 +00:00
parent 28e4dc4333
commit d900d7864b
2 changed files with 15 additions and 11 deletions

View file

@ -354,10 +354,12 @@ function CaseDetail({ caseData }: { caseData: Case }) {
<p className="text-sm text-green-600">Änderungen gespeichert.</p> <p className="text-sm text-green-600">Änderungen gespeichert.</p>
)} )}
{/* Status badges */} {/* Status badges (admin only) */}
<div className="flex flex-wrap gap-2"> {isAdmin && (
<StatusBadges c={caseData} /> <div className="flex flex-wrap gap-2">
</div> <StatusBadges c={caseData} />
</div>
)}
{/* Disclosure status / request */} {/* Disclosure status / request */}
{!isAdmin && caseData.disclosure_granted && caseData.disclosure_expires_at && ( {!isAdmin && caseData.disclosure_granted && caseData.disclosure_expires_at && (
@ -381,6 +383,7 @@ function CaseDetail({ caseData }: { caseData: Case }) {
{/* Editable sections from config */} {/* Editable sections from config */}
{CASE_SECTIONS.map((section) => { {CASE_SECTIONS.map((section) => {
if (section.visibleTo === 'admin' && !isAdmin) return null
const visibleFields = section.fields.filter((field) => { const visibleFields = section.fields.filter((field) => {
if (field.visibleTo === 'admin' && !isAdmin && !caseData.disclosure_granted) return false if (field.visibleTo === 'admin' && !isAdmin && !caseData.disclosure_granted) return false
return true return true
@ -434,8 +437,8 @@ function CaseDetail({ caseData }: { caseData: Case }) {
)} )}
</div> </div>
{/* Coding info (read-only, managed via coding endpoint) */} {/* Coding info (read-only, admin only) */}
{(caseData.gutachten_typ || caseData.therapieaenderung) && ( {isAdmin && (caseData.gutachten_typ || caseData.therapieaenderung) && (
<div className="border-t pt-3 space-y-2"> <div className="border-t pt-3 space-y-2">
<h3 className="text-sm font-semibold">Coding</h3> <h3 className="text-sm font-semibold">Coding</h3>
<div className="grid grid-cols-2 gap-3 text-sm"> <div className="grid grid-cols-2 gap-3 text-sm">

View file

@ -16,6 +16,7 @@ export interface FieldConfig {
export interface SectionConfig { export interface SectionConfig {
title: string title: string
fields: FieldConfig[] fields: FieldConfig[]
visibleTo?: 'admin' | 'all'
} }
const ANREDE_OPTIONS = [ const ANREDE_OPTIONS = [
@ -50,7 +51,7 @@ export const CASE_SECTIONS: SectionConfig[] = [
], ],
}, },
{ {
title: 'Falldetails', title: 'Falldetails', visibleTo: 'admin',
fields: [ fields: [
{ key: 'kurzbeschreibung', label: 'Kurzbeschreibung', type: 'textarea', editableBy: 'admin', colSpan: 2 }, { key: 'kurzbeschreibung', label: 'Kurzbeschreibung', type: 'textarea', editableBy: 'admin', colSpan: 2 },
{ key: 'fragestellung', label: 'Fragestellung', type: 'textarea', editableBy: 'admin', colSpan: 2 }, { key: 'fragestellung', label: 'Fragestellung', type: 'textarea', editableBy: 'admin', colSpan: 2 },
@ -59,7 +60,7 @@ export const CASE_SECTIONS: SectionConfig[] = [
], ],
}, },
{ {
title: 'Unterlagen', title: 'Unterlagen', visibleTo: 'admin',
fields: [ fields: [
{ key: 'unterlagen', label: 'Unterlagen vorhanden', type: 'boolean', editableBy: 'admin' }, { key: 'unterlagen', label: 'Unterlagen vorhanden', type: 'boolean', editableBy: 'admin' },
{ key: 'erhalten', label: 'Erhalten', type: 'boolean', editableBy: 'admin' }, { key: 'erhalten', label: 'Erhalten', type: 'boolean', editableBy: 'admin' },
@ -69,7 +70,7 @@ export const CASE_SECTIONS: SectionConfig[] = [
], ],
}, },
{ {
title: 'Gutachten', title: 'Gutachten', visibleTo: 'admin',
fields: [ fields: [
{ key: 'gutachten', label: 'Gutachten vorhanden', type: 'boolean', editableBy: 'admin' }, { key: 'gutachten', label: 'Gutachten vorhanden', type: 'boolean', editableBy: 'admin' },
{ key: 'gutachter', label: 'Gutachter', type: 'text', editableBy: 'admin', placeholder: 'Name des Gutachters' }, { key: 'gutachter', label: 'Gutachter', type: 'text', editableBy: 'admin', placeholder: 'Name des Gutachters' },
@ -79,7 +80,7 @@ export const CASE_SECTIONS: SectionConfig[] = [
], ],
}, },
{ {
title: 'Status', title: 'Status', visibleTo: 'admin',
fields: [ fields: [
{ key: 'ablehnung', label: 'Ablehnung', type: 'boolean', editableBy: 'admin' }, { key: 'ablehnung', label: 'Ablehnung', type: 'boolean', editableBy: 'admin' },
{ key: 'abbruch', label: 'Abbruch', type: 'boolean', editableBy: 'admin' }, { key: 'abbruch', label: 'Abbruch', type: 'boolean', editableBy: 'admin' },
@ -87,7 +88,7 @@ export const CASE_SECTIONS: SectionConfig[] = [
], ],
}, },
{ {
title: 'Abrechnung', title: 'Abrechnung', visibleTo: 'admin',
fields: [ fields: [
{ key: 'abgerechnet', label: 'Abgerechnet', type: 'boolean', editableBy: 'admin' }, { key: 'abgerechnet', label: 'Abgerechnet', type: 'boolean', editableBy: 'admin' },
{ key: 'abrechnung_datum', label: 'Abrechnungsdatum', type: 'date', editableBy: 'admin' }, { key: 'abrechnung_datum', label: 'Abrechnungsdatum', type: 'date', editableBy: 'admin' },