Vollstaendige Next.js/Prisma-E-Commerce-Anwendung fuer eine Imkerei: Shop, Warenkorb, Stripe-Checkout, Kundenkonto mit 2FA, Admin-Bereich (Produkte, Ernten, Chargen, Bestellungen, Gutscheine, admin-editierbare Website-Inhalte), i18n (DE/EN), Rate-Limiting/CSP/Audit-Log-Haertung, PostgreSQL- und MySQL-Unterstuetzung ueber austauschbare Prisma- Treiber-Adapter, Unit-/Komponenten-/E2E-Tests.
45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
import { siteConfig } from "@/lib/site-config";
|
|
import { getContentValues } from "@/lib/content";
|
|
|
|
const COMPANY_KEYS = [
|
|
"company.name",
|
|
"company.claim",
|
|
"company.claimAlt",
|
|
"company.description",
|
|
"company.location",
|
|
"company.email",
|
|
"company.phone",
|
|
"company.street",
|
|
"company.zip",
|
|
"company.city",
|
|
] as const;
|
|
|
|
/**
|
|
* Drop-in-Ersatz fuer siteConfig mit admin-gepflegten Overrides (siehe
|
|
* admin/inhalte) — gleiche Feldnamen/Form wie siteConfig, damit bestehende
|
|
* Konsumenten nur `siteConfig` gegen `await getCompanyInfo()` tauschen
|
|
* muessen. domain/country bleiben aus siteConfig (keine Content-Felder,
|
|
* echte Infra-Werte).
|
|
*/
|
|
export async function getCompanyInfo() {
|
|
// Firmendaten sind nicht lokalisiert (siehe content-registry.ts) — die
|
|
// uebergebene Locale wirkt sich fuer diese Schluessel nicht aus.
|
|
const v = await getContentValues([...COMPANY_KEYS], "de");
|
|
return {
|
|
...siteConfig,
|
|
name: v["company.name"],
|
|
claim: v["company.claim"],
|
|
claimAlt: v["company.claimAlt"],
|
|
description: v["company.description"],
|
|
location: v["company.location"],
|
|
email: v["company.email"],
|
|
phone: v["company.phone"],
|
|
address: {
|
|
...siteConfig.address,
|
|
street: v["company.street"],
|
|
zip: v["company.zip"],
|
|
city: v["company.city"],
|
|
},
|
|
};
|
|
}
|