Firmenkunden-CRM mit B2B-Patenschaften und Firmenportal
Admin: Firmen mit Vertriebsstufe und Wiedervorlage, Ansprechpartner mit Einladung ins Portal, B2B-Patenschaften mit Lieferungen und Neuigkeiten, private Dokumente, Notizen und Anfragen. Portal unter /konto/firma: Patenschaften, Lieferungen, Neuigkeiten, Dokument-Download und Anfrageformular. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
---
|
||||
import Layout from "../../layouts/Layout.astro";
|
||||
import { getCustomerMe, getEmailVerification, listMyOrders } from "../../lib/auth";
|
||||
import { getMyCompany } from "../../lib/b2b";
|
||||
|
||||
export const prerender = false;
|
||||
|
||||
@@ -24,6 +25,10 @@ try {
|
||||
return Astro.redirect("/konto/anmelden?redirect=/konto");
|
||||
}
|
||||
|
||||
// Firmenkunden bekommen einen Weg ins Firmenportal. Fehler hier sollen das
|
||||
// normale Konto nicht blockieren.
|
||||
const firma = await getMyCompany(token).catch(() => null);
|
||||
|
||||
const STATUS_LABELS: Record<string, string> = {
|
||||
pending: "In Bearbeitung",
|
||||
completed: "Abgeschlossen",
|
||||
@@ -79,6 +84,16 @@ function statusLabel(order: { status: string; fulfillment_status?: string }): st
|
||||
</div>
|
||||
)}
|
||||
|
||||
{firma && (
|
||||
<a href="/konto/firma" class="group card-interactive mt-10 flex flex-wrap items-center justify-between gap-4 p-6 sm:p-7">
|
||||
<div>
|
||||
<p class="font-medium text-brand-ink">Firmenportal {firma.company.name}</p>
|
||||
<p class="mt-1 text-sm text-brand-text">Bienenpatenschaften, Lieferungen, Neuigkeiten und Dokumente</p>
|
||||
</div>
|
||||
<span class="text-sm font-medium text-brand-primary">Öffnen →</span>
|
||||
</a>
|
||||
)}
|
||||
|
||||
<h2 class="mt-16 text-h3">Meine Bestellungen</h2>
|
||||
|
||||
{orders.length === 0 && (
|
||||
|
||||
Reference in New Issue
Block a user