= ({ sub, plan, usage, label, onCance
{plan ? plan.title : sub.planKey}
+ {_isEnterpriseSub(sub) && (
+ Enterprise
+ )}
{isActive && !sub.recurring && (
= ({ sub, plan, usage, label, onCance
)}
- {/* Plan details */}
- {plan && !isPending && !isScheduled && (
+ {/* Plan details — enterprise vs. standard */}
+ {!isPending && !isScheduled && _isEnterpriseSub(sub) && (
+
+ {t('Pauschalpreis:')} {_formatCurrency(sub.enterpriseFlatPriceCHF ?? 0)}
+ {t('Max. Benutzer:')} {sub.enterpriseMaxUsers != null ? sub.enterpriseMaxUsers : t('unbegrenzt')}
+ {t('Max. Module:')} {sub.enterpriseMaxFeatureInstances != null ? sub.enterpriseMaxFeatureInstances : t('unbegrenzt')}
+
+ {t('Speicher:')}{' '}
+ {sub.enterpriseMaxDataVolumeMB != null
+ ? formatBinaryDataSizeFromMebibytes(sub.enterpriseMaxDataVolumeMB)
+ : t('unbegrenzt')}
+
+ {sub.enterpriseBudgetAiCHF != null && (
+ {t('AI-Budget:')} {_formatCurrency(sub.enterpriseBudgetAiCHF)}
+ )}
+ {sub.enterpriseNote && (
+ {sub.enterpriseNote}
+ )}
+
+ )}
+ {!isPending && !isScheduled && !_isEnterpriseSub(sub) && plan && (
= ({ sub, plan, usage, label, onCance
display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(140px, 1fr))',
gap: '0.5rem',
}}>
- <_UsageMetric label={t('User')} value={usage.activeUsers} max={plan?.maxUsers ?? undefined} />
- <_UsageMetric label={t('Module')} value={usage.activeInstances} max={plan?.includedModules ?? undefined} />
+ <_UsageMetric
+ label={t('User')}
+ value={usage.activeUsers}
+ max={_isEnterpriseSub(sub) ? (sub.enterpriseMaxUsers ?? undefined) : (plan?.maxUsers ?? undefined)}
+ />
+ <_UsageMetric
+ label={t('Module')}
+ value={usage.activeInstances}
+ max={_isEnterpriseSub(sub) ? (sub.enterpriseMaxFeatureInstances ?? undefined) : (plan?.includedModules ?? undefined)}
+ />
<_UsageMetric label={t('Speicher')} value={usage.usedStorageMB} max={usage.maxStorageMB ?? undefined} formatValue={(v) => formatBinaryDataSizeFromMebibytes(v)} />
)}
- {/* Actions */}
-
- {isActive && !sub.recurring && onReactivate && (
-
- )}
- {isActive && sub.recurring && onCancel && (
-
- )}
- {(isPending || isScheduled) && onCancel && (
-
- )}
-
+ {/* Actions — enterprise subscriptions are sysadmin-managed, no self-service */}
+ {_isEnterpriseSub(sub) ? (
+
+ {t('Dieses Abonnement wird vom Plattform-Administrator verwaltet.')}
+
+ ) : (
+
+ {isActive && !sub.recurring && onReactivate && (
+
+ )}
+ {isActive && sub.recurring && onCancel && (
+
+ )}
+ {(isPending || isScheduled) && onCancel && (
+
+ )}
+
+ )}
);
};
@@ -593,29 +642,31 @@ export const SubscriptionTab: React.FC = ({ mandateId }) =
)}
- {/* Available plans */}
-
- {t('Verfügbare Pläne')}
- {plans.length === 0 ? (
- {t('Keine Pläne verfügbar')}
- ) : (
-
- {plans.map((p) => (
- <_PlanCard
- key={p.planKey}
- plan={p}
- isCurrent={subscription?.planKey === p.planKey && subscription?.status === 'ACTIVE'}
- onActivate={_handleActivate}
- activatingPlanKey={activatingPlanKey}
- />
- ))}
-
- )}
-
+ {/* Available plans — hidden for enterprise subscriptions */}
+ {!_isEnterpriseSub(subscription) && (
+
+ {t('Verfügbare Pläne')}
+ {plans.length === 0 ? (
+ {t('Keine Pläne verfügbar')}
+ ) : (
+
+ {plans.map((p) => (
+ <_PlanCard
+ key={p.planKey}
+ plan={p}
+ isCurrent={subscription?.planKey === p.planKey && subscription?.status === 'ACTIVE'}
+ onActivate={_handleActivate}
+ activatingPlanKey={activatingPlanKey}
+ />
+ ))}
+
+ )}
+
+ )}
diff --git a/src/pages/views/commcoach/CommcoachDashboardView.tsx b/src/pages/views/commcoach/CommcoachDashboardView.tsx
index de05f87..b60fee7 100644
--- a/src/pages/views/commcoach/CommcoachDashboardView.tsx
+++ b/src/pages/views/commcoach/CommcoachDashboardView.tsx
@@ -31,12 +31,6 @@ export const CommcoachDashboardView: React.FC = () => {
}
}, [mandateId, instanceId, navigate]);
- const _handleOpenDossier = useCallback(() => {
- if (mandateId && instanceId) {
- navigate(`/mandates/${mandateId}/commcoach/${instanceId}/dossier`);
- }
- }, [mandateId, instanceId, navigate]);
-
const _categoryLabel = useCallback(
(category: string) => {
const labels: Record = {
@@ -102,14 +96,9 @@ export const CommcoachDashboardView: React.FC = () => {
{t('Aktive Coaching-Themen')}
-
-
-
-
+
{(dashboard.modules || dashboard.contexts || []).length === 0 ? (
diff --git a/src/pages/views/commcoach/CommcoachModulesView.tsx b/src/pages/views/commcoach/CommcoachModulesView.tsx
index 4378eaf..e48342e 100644
--- a/src/pages/views/commcoach/CommcoachModulesView.tsx
+++ b/src/pages/views/commcoach/CommcoachModulesView.tsx
@@ -9,6 +9,7 @@ import React, { useState, useEffect, useCallback } from 'react';
import { useNavigate, useSearchParams } from 'react-router-dom';
import { useCurrentInstance } from '../../../hooks/useCurrentInstance';
import * as commcoachApi from '../../../api/commcoachApi';
+import { getSessionExportUrl } from '../../../api/commcoachApi';
import type { CoachingPersona } from '../../../api/commcoachApi';
import { useLanguage } from '../../../providers/language/LanguageContext';
import styles from './Commcoach.module.css';
@@ -202,11 +203,21 @@ export const CommcoachModulesView: React.FC = () => {
{(sessions[mod.id] || []).map((sess: any) => (
-
{sess.summary || t('Session')}
-
{sess.status}
-
- {sess.startedAt ? new Date(sess.startedAt * 1000).toLocaleDateString() : '-'}
-
+
+
+
{sess.status === 'completed' ? t('Abgeschlossen') : sess.status === 'active' ? t('Aktiv') : sess.status}
+
+ {sess.startedAt ? new Date(sess.startedAt * 1000).toLocaleDateString('de-CH') : '-'}
+
+ {sess.competenceScore != null &&
Score: {Math.round(sess.competenceScore)}}
+ {sess.durationSeconds != null &&
{Math.round(sess.durationSeconds / 60)} Min.}
+ {sess.messageCount != null &&
{sess.messageCount} {t('Nachrichten')}}
+ {instanceId && sess.status === 'completed' && (
+
e.stopPropagation()}>{t('Export')}
+ )}
+
+ {sess.summary &&
{sess.summary}
}
+
))}
diff --git a/src/pages/views/commcoach/index.ts b/src/pages/views/commcoach/index.ts
index 71876b3..ce12d74 100644
--- a/src/pages/views/commcoach/index.ts
+++ b/src/pages/views/commcoach/index.ts
@@ -2,5 +2,4 @@ export { CommcoachDashboardView } from './CommcoachDashboardView';
export { CommcoachAssistantView } from './CommcoachAssistantView';
export { CommcoachModulesView } from './CommcoachModulesView';
export { CommcoachSessionView } from './CommcoachSessionView';
-export { CommcoachDossierView } from './CommcoachDossierView';
export { CommcoachSettingsView } from './CommcoachSettingsView';