import { z } from 'zod' import type { ResolutionTemplate } from './index.js' import { baseDocument, escapeHtml, formatDateDe, formatEur, renderMembers, } from './shared.js' const schema = z.object({ currentCapital: z.coerce.number().nonnegative(), increaseAmount: z.coerce.number().positive(), newCapital: z.coerce.number().positive(), contributionType: z.enum(['cash', 'in_kind']).default('cash'), effectiveDate: z.string().min(8), notes: z.string().optional(), }) const contributionLabel = (type: 'cash' | 'in_kind'): string => type === 'cash' ? 'Bareinlage' : 'Sacheinlage' export const capitalIncrease: ResolutionTemplate = { key: 'capital_increase', titleDe: 'Beschluss zur Kapitalerhöhung', titleEn: 'Capital increase', descriptionDe: 'Gesellschafterbeschluss über die Erhöhung des Stammkapitals gemäß §§ 55 ff. GmbHG. Beurkundungspflichtig.', schema, fields: [ { key: 'currentCapital', labelDe: 'Bisheriges Stammkapital (EUR)', labelEn: 'Current share capital (EUR)', type: 'currency', required: true }, { key: 'increaseAmount', labelDe: 'Erhöhungsbetrag (EUR)', labelEn: 'Increase amount (EUR)', type: 'currency', required: true }, { key: 'newCapital', labelDe: 'Neues Stammkapital (EUR)', labelEn: 'New share capital (EUR)', type: 'currency', required: true }, { key: 'contributionType', labelDe: 'Art der Einlage (cash | in_kind)', labelEn: 'Contribution type (cash | in_kind)', type: 'text', required: true }, { key: 'effectiveDate', labelDe: 'Wirksam ab', labelEn: 'Effective date', type: 'date', required: true }, { key: 'notes', labelDe: 'Anmerkungen', labelEn: 'Notes', type: 'textarea' }, ], render: ({ values, company, members, createdBy, date }) => { const v = schema.parse(values) const body = `

Gesellschafterbeschluss

${escapeHtml(company.name)}${company.registryNo ? `, ${escapeHtml(company.registryNo)}` : ''}
${company.address ? escapeHtml(company.address) + '
' : ''} Beschlussdatum: ${escapeHtml(formatDateDe(date))}

Gegenstand des Beschlusses

Erhöhung des Stammkapitals der Gesellschaft gemäß §§ 55 ff. GmbHG. Dieser Beschluss bedarf zu seiner Wirksamkeit der notariellen Beurkundung sowie der Eintragung in das Handelsregister.

Beschluss

Die Geschäftsführung wird angewiesen, die Kapitalerhöhung unverzüglich zur Eintragung in das Handelsregister anzumelden.

${v.notes ? `

${escapeHtml(v.notes)}

` : ''}

Gesellschafter

${renderMembers(members)}
${escapeHtml(createdBy.displayName)}
${escapeHtml(createdBy.email)}
Ort, Datum
` return baseDocument('Beschluss – Kapitalerhöhung', body) }, }