mirror of
https://github.com/complexcaresolutions/cms.c2sgmbh.git
synced 2026-03-17 18:34:13 +00:00
Tests: - Update frontend.e2e.spec.ts with locale testing - Add search.e2e.spec.ts for search functionality - Add i18n.int.spec.ts for localization tests - Add search.int.spec.ts for search integration - Update playwright.config.ts Documentation: - Add CLAUDE.md with project instructions - Add docs/ directory with detailed documentation - Add scripts/ for utility scripts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
455 lines
17 KiB
TypeScript
455 lines
17 KiB
TypeScript
import { getPayload } from 'payload'
|
|
import config from '../src/payload.config'
|
|
|
|
async function seed() {
|
|
console.log('Starting pages migration...')
|
|
|
|
const payload = await getPayload({ config })
|
|
|
|
// Get tenant for porwoll
|
|
const tenants = await payload.find({
|
|
collection: 'tenants',
|
|
where: { slug: { equals: 'porwoll' } }
|
|
})
|
|
|
|
const tenantId = tenants.docs[0]?.id
|
|
if (!tenantId) {
|
|
console.error('Tenant "porwoll" not found!')
|
|
process.exit(1)
|
|
}
|
|
|
|
console.log(`Using tenant ID: ${tenantId}`)
|
|
|
|
// Get existing media IDs
|
|
const mediaResult = await payload.find({ collection: 'media', limit: 100 })
|
|
const mediaMap: Record<string, number> = {}
|
|
|
|
for (const m of mediaResult.docs) {
|
|
if (m.alt === 'Martin Porwoll - Portrait') mediaMap['portrait'] = m.id as number
|
|
if (m.alt === 'gunshin Holding UG Logo') mediaMap['gunshin'] = m.id as number
|
|
if (m.alt === 'Abstrakte Darstellung von Vision und Innovation') mediaMap['vision'] = m.id as number
|
|
if (m.alt === 'Team-Erfolg und Zusammenarbeit') mediaMap['erfolg'] = m.id as number
|
|
}
|
|
|
|
console.log('Media IDs:', mediaMap)
|
|
|
|
// Helper function to create Lexical content
|
|
const createContent = (elements: any[]) => ({
|
|
root: {
|
|
type: 'root',
|
|
children: elements,
|
|
direction: 'ltr',
|
|
format: '',
|
|
indent: 0,
|
|
version: 1,
|
|
},
|
|
})
|
|
|
|
const text = (t: string, format?: number) => ({ type: 'text', text: t, ...(format ? { format } : {}) })
|
|
const paragraph = (children: any[]) => ({ type: 'paragraph', children })
|
|
const heading = (tag: string, children: any[]) => ({ type: 'heading', tag, children })
|
|
|
|
// ============================================
|
|
// PAGES
|
|
// ============================================
|
|
console.log('\n--- Creating Pages ---')
|
|
|
|
const pages = [
|
|
// Page 2: Mensch
|
|
{
|
|
title: 'Mensch',
|
|
slug: 'mensch',
|
|
status: 'published',
|
|
hero: {},
|
|
layout: [
|
|
{
|
|
blockType: 'hero-block',
|
|
backgroundImage: mediaMap['portrait'],
|
|
headline: 'Martin Porwoll',
|
|
subline: 'Mensch',
|
|
alignment: 'center',
|
|
overlay: true,
|
|
},
|
|
{
|
|
blockType: 'text-block',
|
|
width: 'medium',
|
|
content: createContent([
|
|
paragraph([text('Martin Porwoll ist ein engagierter Unternehmer im Gesundheitswesen und der entscheidende Whistleblower im Zytoskandal Bottrop. Seine Erfahrungen und sein unermüdlicher Einsatz für das Patientenwohl haben ihn zu einem inspirierenden Vorbild und einem wichtigen Akteur in der Branche gemacht.')]),
|
|
]),
|
|
},
|
|
{
|
|
blockType: 'image-text-block',
|
|
image: mediaMap['portrait'],
|
|
imagePosition: 'left',
|
|
headline: 'Persönlicher Hintergrund',
|
|
content: createContent([
|
|
paragraph([text('Martin Porwoll wurde in Bottrop, Deutschland, geboren und wuchs in einer Familie auf, die Wert auf soziale Verantwortung und Integrität legte. Diese Werte prägten seine Entscheidung, im Gesundheitswesen tätig zu werden und sich dafür einzusetzen, dass das Wohl der Patienten im Mittelpunkt steht.')]),
|
|
]),
|
|
cta: { text: 'Mehr zum Leben', link: '/leben' },
|
|
},
|
|
{
|
|
blockType: 'image-text-block',
|
|
image: mediaMap['portrait'],
|
|
imagePosition: 'right',
|
|
headline: 'Whistleblower im Zytoskandal Bottrop',
|
|
content: createContent([
|
|
paragraph([text('Im Jahr 2016 machte Martin Porwoll als Whistleblower im Zytoskandal Bottrop Schlagzeilen. Er war maßgeblich daran beteiligt, einen groß angelegten Betrug in der Krebsmedikamentenversorgung aufzudecken, bei dem tausende Patienten betroffen waren.')]),
|
|
]),
|
|
cta: { text: 'Zum Zytoskandal', link: '/zytoskandal' },
|
|
},
|
|
{
|
|
blockType: 'card-grid-block',
|
|
headline: 'Unternehmerische Tätigkeiten',
|
|
columns: '2',
|
|
cards: [
|
|
{ title: 'complex care solutions GmbH', description: 'Nach dem Zytoskandal gründete Martin Porwoll die complex care solutions GmbH.', link: '/complex-care-solutions', linkText: 'mehr' },
|
|
{ title: 'gunshin Holding UG', description: 'Zusätzlich gründete Martin Porwoll die gunshin Holding, die Start-ups im Gesundheitswesen unterstützt.', link: '/gunshin-holding', linkText: 'mehr' },
|
|
],
|
|
},
|
|
],
|
|
seo: { metaTitle: 'Martin Porwoll - Mensch | porwoll.de', metaDescription: 'Erfahren Sie mehr über Martin Porwoll.' },
|
|
},
|
|
// Page 3: Kontakt
|
|
{
|
|
title: 'Kontakt',
|
|
slug: 'kontakt',
|
|
status: 'published',
|
|
hero: {},
|
|
layout: [
|
|
{
|
|
blockType: 'text-block',
|
|
width: 'medium',
|
|
content: createContent([
|
|
heading('h2', [text('Lassen Sie uns reden!')]),
|
|
paragraph([text('Haben Sie Fragen, Anregungen oder möchten Sie mehr über die Arbeit von Martin Porwoll erfahren?')]),
|
|
paragraph([text('Wir freuen uns von Ihnen zu hören!')]),
|
|
]),
|
|
},
|
|
{
|
|
blockType: 'contact-form-block',
|
|
headline: 'Kontakt',
|
|
description: 'Schreiben Sie uns eine Nachricht',
|
|
recipientEmail: 'info@porwoll.de',
|
|
showPhone: true,
|
|
showAddress: true,
|
|
showSocials: true,
|
|
},
|
|
],
|
|
seo: { metaTitle: 'Kontakt | porwoll.de', metaDescription: 'Kontaktieren Sie Martin Porwoll.' },
|
|
},
|
|
// Page 4: Whistleblowing
|
|
{
|
|
title: 'Whistleblowing',
|
|
slug: 'whistleblowing',
|
|
status: 'published',
|
|
hero: {},
|
|
layout: [
|
|
{
|
|
blockType: 'hero-block',
|
|
headline: 'Whistleblowing',
|
|
subline: 'Mut zur Wahrheit',
|
|
alignment: 'center',
|
|
overlay: true,
|
|
},
|
|
{
|
|
blockType: 'text-block',
|
|
width: 'medium',
|
|
content: createContent([
|
|
heading('h2', [text('Was ist Whistleblowing?')]),
|
|
paragraph([text('Whistleblowing bezeichnet das Aufdecken von Missständen, illegalen Praktiken oder Gefahren für die Öffentlichkeit durch Insider.')]),
|
|
paragraph([text('Martin Porwoll wurde 2016 zum Whistleblower, als er den größten Pharma-Skandal der deutschen Nachkriegsgeschichte aufdeckte.')]),
|
|
]),
|
|
},
|
|
{
|
|
blockType: 'cta-block',
|
|
headline: 'Der Zytoskandal Bottrop',
|
|
description: 'Erfahren Sie mehr über den Fall, der das deutsche Gesundheitswesen erschütterte.',
|
|
backgroundColor: 'dark',
|
|
buttons: [{ text: 'Zum Zytoskandal', link: '/zytoskandal', style: 'primary' }],
|
|
},
|
|
],
|
|
seo: { metaTitle: 'Whistleblowing | porwoll.de', metaDescription: 'Whistleblowing - Mut zur Wahrheit.' },
|
|
},
|
|
// Page 5: Zytoskandal
|
|
{
|
|
title: 'Zytoskandal Bottrop',
|
|
slug: 'zytoskandal',
|
|
status: 'published',
|
|
hero: {},
|
|
layout: [
|
|
{
|
|
blockType: 'hero-block',
|
|
headline: 'Der Zytoskandal Bottrop',
|
|
subline: 'Der größte Pharma-Skandal der deutschen Nachkriegsgeschichte',
|
|
alignment: 'center',
|
|
overlay: true,
|
|
},
|
|
{
|
|
blockType: 'text-block',
|
|
width: 'medium',
|
|
content: createContent([
|
|
heading('h2', [text('Was geschah?')]),
|
|
paragraph([text('Im Jahr 2016 wurde aufgedeckt, dass ein Apotheker in Bottrop über Jahre hinweg Krebsmedikamente gestreckt oder durch Kochsalzlösung ersetzt hatte.')]),
|
|
paragraph([text('Martin Porwoll, damals kaufmännischer Leiter der Apotheke, war maßgeblich an der Aufdeckung dieses Skandals beteiligt.')]),
|
|
]),
|
|
},
|
|
{
|
|
blockType: 'timeline-block',
|
|
headline: 'Chronologie der Ereignisse',
|
|
events: [
|
|
{ year: '2016', title: 'Aufdeckung', description: 'Martin Porwoll bemerkt Unregelmäßigkeiten und beginnt zu recherchieren' },
|
|
{ year: '2016', title: 'Anzeige', description: 'Der Fall wird den Behörden gemeldet' },
|
|
{ year: '2017', title: 'Verhaftung', description: 'Der verantwortliche Apotheker wird verhaftet' },
|
|
{ year: '2018', title: 'Verurteilung', description: 'Verurteilung zu 12 Jahren Haft' },
|
|
],
|
|
},
|
|
{
|
|
blockType: 'text-block',
|
|
width: 'medium',
|
|
content: createContent([
|
|
heading('h2', [text('Die Folgen')]),
|
|
paragraph([text('Der Zytoskandal führte zu weitreichenden Änderungen im deutschen Gesundheitswesen.')]),
|
|
]),
|
|
},
|
|
],
|
|
seo: { metaTitle: 'Zytoskandal Bottrop | porwoll.de', metaDescription: 'Der Zytoskandal Bottrop.' },
|
|
},
|
|
// Page 6: gunshin Holding
|
|
{
|
|
title: 'gunshin Holding UG',
|
|
slug: 'gunshin-holding',
|
|
status: 'published',
|
|
hero: {},
|
|
layout: [
|
|
{
|
|
blockType: 'hero-block',
|
|
backgroundImage: mediaMap['gunshin'],
|
|
headline: 'gunshin Holding UG',
|
|
alignment: 'center',
|
|
overlay: true,
|
|
},
|
|
{
|
|
blockType: 'text-block',
|
|
width: 'medium',
|
|
content: createContent([
|
|
paragraph([text('Die gunshin Holding UG, gegründet von Martin Porwoll, ist eine Beteiligungsgesellschaft, die sich auf die Unterstützung und Förderung von Start-ups im Gesundheitswesen konzentriert.')]),
|
|
]),
|
|
},
|
|
{
|
|
blockType: 'image-text-block',
|
|
image: mediaMap['vision'],
|
|
imagePosition: 'right',
|
|
headline: 'Vision und Mission',
|
|
content: createContent([
|
|
paragraph([text('Die Vision der gunshin Holding UG ist es, durch die Förderung von Start-ups den Gesundheitssektor nachhaltig zu verändern.')]),
|
|
]),
|
|
},
|
|
{
|
|
blockType: 'card-grid-block',
|
|
headline: 'Unsere Leistungen',
|
|
columns: '3',
|
|
cards: [
|
|
{ title: 'Strategische Beratung', description: 'Wertvolle strategische Beratung für Start-Ups.' },
|
|
{ title: 'Netzwerk und Partnerschaften', description: 'Zugang zu einem breiten Netzwerk von Experten.' },
|
|
{ title: 'Ressourcen und Infrastruktur', description: 'Büroräume, technische Infrastruktur und administrative Unterstützung.' },
|
|
],
|
|
},
|
|
{
|
|
blockType: 'image-text-block',
|
|
image: mediaMap['erfolg'],
|
|
imagePosition: 'left',
|
|
headline: 'Erfolge und Referenzen',
|
|
content: createContent([
|
|
paragraph([text('Die gunshin Holding UG hat bereits mehrere Start-ups erfolgreich unterstützt.')]),
|
|
]),
|
|
cta: { text: 'Zur gunshin.de', link: 'https://gunshin.de' },
|
|
},
|
|
],
|
|
seo: { metaTitle: 'gunshin Holding UG | porwoll.de', metaDescription: 'Die gunshin Holding UG.' },
|
|
},
|
|
// Page 7: complex care solutions
|
|
{
|
|
title: 'complex care solutions GmbH',
|
|
slug: 'complex-care-solutions',
|
|
status: 'published',
|
|
hero: {},
|
|
layout: [
|
|
{
|
|
blockType: 'hero-block',
|
|
headline: 'complex care solutions GmbH',
|
|
subline: 'Patientenwohl im Mittelpunkt',
|
|
alignment: 'center',
|
|
overlay: true,
|
|
},
|
|
{
|
|
blockType: 'text-block',
|
|
width: 'medium',
|
|
content: createContent([
|
|
paragraph([text('Die complex care solutions GmbH wurde von Martin Porwoll gegründet, um das Wohl der Patienten in den Mittelpunkt zu stellen.')]),
|
|
]),
|
|
},
|
|
{
|
|
blockType: 'cta-block',
|
|
headline: 'Mehr erfahren',
|
|
description: 'Besuchen Sie die Webseite der complex care solutions GmbH',
|
|
backgroundColor: 'dark',
|
|
buttons: [{ text: 'Zur complexcaresolutions.de', link: 'https://complexcaresolutions.de', style: 'primary' }],
|
|
},
|
|
],
|
|
seo: { metaTitle: 'complex care solutions GmbH | porwoll.de', metaDescription: 'Die complex care solutions GmbH.' },
|
|
},
|
|
// Page 8: Leben
|
|
{
|
|
title: 'Leben',
|
|
slug: 'leben',
|
|
status: 'published',
|
|
hero: {},
|
|
layout: [
|
|
{
|
|
blockType: 'hero-block',
|
|
headline: 'Leben',
|
|
subline: '„Angst ist eine Reaktion, Mut eine Entscheidung"',
|
|
alignment: 'center',
|
|
overlay: true,
|
|
},
|
|
{
|
|
blockType: 'text-block',
|
|
width: 'medium',
|
|
content: createContent([
|
|
paragraph([text('Diese Seite wird noch mit Inhalten gefüllt.')]),
|
|
paragraph([text('Hier wird Martin Porwolls persönlicher Werdegang und seine Lebensgeschichte präsentiert.')]),
|
|
]),
|
|
},
|
|
],
|
|
seo: { metaTitle: 'Leben | porwoll.de', metaDescription: 'Das Leben von Martin Porwoll.' },
|
|
},
|
|
// Page 9: Impressum
|
|
{
|
|
title: 'Impressum',
|
|
slug: 'impressum',
|
|
status: 'published',
|
|
hero: {},
|
|
layout: [
|
|
{
|
|
blockType: 'text-block',
|
|
width: 'narrow',
|
|
content: createContent([
|
|
heading('h2', [text('Impressum')]),
|
|
paragraph([text('Angaben gemäß § 5 TMG', 1)]),
|
|
paragraph([text('Martin Porwoll')]),
|
|
paragraph([text('Hans-Böckler-Str. 19')]),
|
|
paragraph([text('46236 Bottrop')]),
|
|
paragraph([text('Kontakt', 1)]),
|
|
paragraph([text('Telefon: 0800 80 44 100')]),
|
|
paragraph([text('E-Mail: info@porwoll.de')]),
|
|
paragraph([text('Verantwortlich für den Inhalt nach § 55 Abs. 2 RStV', 1)]),
|
|
paragraph([text('Martin Porwoll')]),
|
|
]),
|
|
},
|
|
],
|
|
seo: { metaTitle: 'Impressum | porwoll.de', metaDescription: 'Impressum der Webseite porwoll.de' },
|
|
},
|
|
// Page 10: Datenschutz
|
|
{
|
|
title: 'Datenschutzerklärung',
|
|
slug: 'datenschutz',
|
|
status: 'published',
|
|
hero: {},
|
|
layout: [
|
|
{
|
|
blockType: 'text-block',
|
|
width: 'narrow',
|
|
content: createContent([
|
|
heading('h2', [text('Datenschutzerklärung')]),
|
|
heading('h3', [text('1. Datenschutz auf einen Blick')]),
|
|
paragraph([text('Die folgenden Hinweise geben einen einfachen Überblick darüber, was mit Ihren personenbezogenen Daten passiert, wenn Sie diese Website besuchen.')]),
|
|
heading('h3', [text('2. Hosting')]),
|
|
paragraph([text('Diese Website wird auf eigenen Servern in Deutschland gehostet.')]),
|
|
heading('h3', [text('3. Kontaktformular')]),
|
|
paragraph([text('Wenn Sie uns per Kontaktformular Anfragen zukommen lassen, werden Ihre Angaben zwecks Bearbeitung der Anfrage bei uns gespeichert.')]),
|
|
paragraph([text('(Diese Datenschutzerklärung ist ein Platzhalter.)', 2)]),
|
|
]),
|
|
},
|
|
],
|
|
seo: { metaTitle: 'Datenschutzerklärung | porwoll.de', metaDescription: 'Datenschutzerklärung der Webseite porwoll.de' },
|
|
},
|
|
]
|
|
|
|
for (const page of pages) {
|
|
const existing = await payload.find({
|
|
collection: 'pages',
|
|
where: { slug: { equals: page.slug } }
|
|
})
|
|
|
|
if (existing.docs.length > 0) {
|
|
console.log(`- Page "${page.title}" already exists, updating...`)
|
|
await payload.update({
|
|
collection: 'pages',
|
|
id: existing.docs[0].id,
|
|
data: { ...page, tenant: tenantId } as any,
|
|
})
|
|
console.log(`✓ Updated page: ${page.title}`)
|
|
} else {
|
|
await payload.create({
|
|
collection: 'pages',
|
|
data: { ...page, tenant: tenantId } as any,
|
|
})
|
|
console.log(`✓ Created page: ${page.title}`)
|
|
}
|
|
}
|
|
|
|
// ============================================
|
|
// NAVIGATION
|
|
// ============================================
|
|
console.log('\n--- Configuring Navigation ---')
|
|
|
|
const pageIds: Record<string, number> = {}
|
|
const allPages = await payload.find({ collection: 'pages', limit: 100 })
|
|
for (const p of allPages.docs) {
|
|
pageIds[p.slug] = p.id as number
|
|
}
|
|
|
|
console.log('Page IDs:', pageIds)
|
|
|
|
await payload.updateGlobal({
|
|
slug: 'navigation',
|
|
data: {
|
|
mainMenu: [
|
|
{
|
|
label: 'Whistleblowing',
|
|
type: 'submenu',
|
|
submenu: [
|
|
{ label: 'Zytoskandal', linkType: 'page', page: pageIds['zytoskandal'] },
|
|
{ label: 'Whistleblowing', linkType: 'page', page: pageIds['whistleblowing'] },
|
|
],
|
|
},
|
|
{
|
|
label: 'Unternehmer',
|
|
type: 'submenu',
|
|
submenu: [
|
|
{ label: 'gunshin Holding UG', linkType: 'page', page: pageIds['gunshin-holding'] },
|
|
{ label: 'complex care solutions GmbH', linkType: 'page', page: pageIds['complex-care-solutions'] },
|
|
],
|
|
},
|
|
{ label: 'Mensch', type: 'page', page: pageIds['mensch'] },
|
|
{ label: 'Kontakt', type: 'page', page: pageIds['kontakt'] },
|
|
],
|
|
footerMenu: [
|
|
{ label: 'Impressum', linkType: 'page', page: pageIds['impressum'] },
|
|
{ label: 'Datenschutzerklärung', linkType: 'page', page: pageIds['datenschutz'] },
|
|
],
|
|
},
|
|
})
|
|
console.log('✓ Navigation configured')
|
|
|
|
console.log('\n========================================')
|
|
console.log('Pages migration completed successfully!')
|
|
console.log('========================================')
|
|
|
|
process.exit(0)
|
|
}
|
|
|
|
seed().catch((error) => {
|
|
console.error('Migration failed:', error)
|
|
process.exit(1)
|
|
})
|