mirror of
https://github.com/complexcaresolutions/dak.c2s.git
synced 2026-03-17 16:03:41 +00:00
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:
parent
28e4dc4333
commit
d900d7864b
2 changed files with 15 additions and 11 deletions
|
|
@ -354,10 +354,12 @@ function CaseDetail({ caseData }: { caseData: Case }) {
|
|||
<p className="text-sm text-green-600">Änderungen gespeichert.</p>
|
||||
)}
|
||||
|
||||
{/* Status badges */}
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<StatusBadges c={caseData} />
|
||||
</div>
|
||||
{/* Status badges (admin only) */}
|
||||
{isAdmin && (
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<StatusBadges c={caseData} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Disclosure status / request */}
|
||||
{!isAdmin && caseData.disclosure_granted && caseData.disclosure_expires_at && (
|
||||
|
|
@ -381,6 +383,7 @@ function CaseDetail({ caseData }: { caseData: Case }) {
|
|||
|
||||
{/* Editable sections from config */}
|
||||
{CASE_SECTIONS.map((section) => {
|
||||
if (section.visibleTo === 'admin' && !isAdmin) return null
|
||||
const visibleFields = section.fields.filter((field) => {
|
||||
if (field.visibleTo === 'admin' && !isAdmin && !caseData.disclosure_granted) return false
|
||||
return true
|
||||
|
|
@ -434,8 +437,8 @@ function CaseDetail({ caseData }: { caseData: Case }) {
|
|||
)}
|
||||
</div>
|
||||
|
||||
{/* Coding info (read-only, managed via coding endpoint) */}
|
||||
{(caseData.gutachten_typ || caseData.therapieaenderung) && (
|
||||
{/* Coding info (read-only, admin only) */}
|
||||
{isAdmin && (caseData.gutachten_typ || caseData.therapieaenderung) && (
|
||||
<div className="border-t pt-3 space-y-2">
|
||||
<h3 className="text-sm font-semibold">Coding</h3>
|
||||
<div className="grid grid-cols-2 gap-3 text-sm">
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ export interface FieldConfig {
|
|||
export interface SectionConfig {
|
||||
title: string
|
||||
fields: FieldConfig[]
|
||||
visibleTo?: 'admin' | 'all'
|
||||
}
|
||||
|
||||
const ANREDE_OPTIONS = [
|
||||
|
|
@ -50,7 +51,7 @@ export const CASE_SECTIONS: SectionConfig[] = [
|
|||
],
|
||||
},
|
||||
{
|
||||
title: 'Falldetails',
|
||||
title: 'Falldetails', visibleTo: 'admin',
|
||||
fields: [
|
||||
{ key: 'kurzbeschreibung', label: 'Kurzbeschreibung', 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: [
|
||||
{ key: 'unterlagen', label: 'Unterlagen vorhanden', 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: [
|
||||
{ key: 'gutachten', label: 'Gutachten vorhanden', type: 'boolean', editableBy: 'admin' },
|
||||
{ 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: [
|
||||
{ key: 'ablehnung', label: 'Ablehnung', 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: [
|
||||
{ key: 'abgerechnet', label: 'Abgerechnet', type: 'boolean', editableBy: 'admin' },
|
||||
{ key: 'abrechnung_datum', label: 'Abrechnungsdatum', type: 'date', editableBy: 'admin' },
|
||||
|
|
|
|||
Loading…
Reference in a new issue