Vertreter: Portal-Pflicht raus, Warn-Badge stattdessen
Suche und Add haben bisher nur Kunden mit portalEnabled=true zugelassen – das machte das Feature quasi unnutzbar, weil die meisten Kunden kein Portal aktiviert haben. Der Zugriff ist ohnehin erst dann effektiv, wenn der Vertreter ein Portal-Konto bekommt. - searchCustomersForRepresentative: portalEnabled-Filter raus, dafür Feld im select mitgeliefert. - addRepresentative: Portal-Pflicht-Check raus. - getRepresentedByList: portalEnabled im rep-Include, damit die UI auch für schon hinterlegte Vertreter das Badge zeigen kann. - CustomerDetail: gelbes "Portal inaktiv"-Badge in Suchergebnissen und in der Vertreter-Liste. Hinweistext geändert. - CustomerSummary-Type: portalEnabled? ergänzt. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -2327,7 +2327,8 @@ function PortalTab({
|
||||
</Button>
|
||||
</div>
|
||||
<p className="text-xs text-gray-500 mt-1">
|
||||
Nur Kunden mit aktiviertem Portal können als Vertreter hinzugefügt werden.
|
||||
Vertreter ohne Portal-Zugang können bereits hinterlegt werden – der Zugriff
|
||||
wird erst wirksam, sobald das Portal aktiviert ist.
|
||||
</p>
|
||||
|
||||
{/* Suchergebnisse */}
|
||||
@@ -2336,8 +2337,13 @@ function PortalTab({
|
||||
{searchResults.map((customer) => (
|
||||
<div key={customer.id} className="flex items-center justify-between p-3 hover:bg-gray-50">
|
||||
<div>
|
||||
<p className="font-medium">
|
||||
<p className="font-medium flex items-center gap-2">
|
||||
{customer.companyName || `${customer.firstName} ${customer.lastName}`}
|
||||
{!customer.portalEnabled && (
|
||||
<Badge variant="warning" className="text-xs">
|
||||
Portal inaktiv
|
||||
</Badge>
|
||||
)}
|
||||
</p>
|
||||
<p className="text-sm text-gray-500">{customer.customerNumber}</p>
|
||||
</div>
|
||||
@@ -2362,9 +2368,14 @@ function PortalTab({
|
||||
{representatives.map((rep: CustomerRepresentative) => (
|
||||
<div key={rep.id} className="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
|
||||
<div>
|
||||
<p className="font-medium">
|
||||
<p className="font-medium flex items-center gap-2">
|
||||
{rep.representative?.companyName ||
|
||||
`${rep.representative?.firstName} ${rep.representative?.lastName}`}
|
||||
{rep.representative && rep.representative.portalEnabled === false && (
|
||||
<Badge variant="warning" className="text-xs">
|
||||
Portal inaktiv
|
||||
</Badge>
|
||||
)}
|
||||
</p>
|
||||
<p className="text-sm text-gray-500">{rep.representative?.customerNumber}</p>
|
||||
</div>
|
||||
|
||||
@@ -22,6 +22,7 @@ export interface CustomerSummary {
|
||||
lastName: string;
|
||||
companyName?: string;
|
||||
type: 'PRIVATE' | 'BUSINESS';
|
||||
portalEnabled?: boolean;
|
||||
}
|
||||
|
||||
export interface RepresentativeAuthorization {
|
||||
|
||||
Reference in New Issue
Block a user