import type { GlobalConfig } from 'payload' import { globalVersions } from '../lib/payload-versions' import { DEFAULT_VAT_RATE_PERCENT } from '../lib/products' import { translationStatusField } from './fields/translationStatus' const LABEL_FIELDS = [ 'storage', 'mailStorage', 'domains', 'domainAliases', 'databases', 'mailboxes', 'backup', 'ssl', 'spamFilter', 'perYear', 'perMonth', 'oneTime', 'plusVat', 'grossPrice', 'recommended', 'included', 'priceNote', ] as const export type HostingPlansLabel = (typeof LABEL_FIELDS)[number] /** * MITHOME-130: copy of the hosting plans page (/hu/tarhely-csomagok, * /en/hosting-plans). The plans themselves live in the Products collection. */ export const HostingPlans: GlobalConfig = { slug: 'hosting-plans', label: 'Tárhelycsomagok oldal', admin: { group: 'Oldalak' }, versions: globalVersions, fields: [ { name: 'meta', type: 'group', fields: [ { name: 'title', type: 'text', required: true, localized: true }, { name: 'description', type: 'textarea', required: true, localized: true }, ], }, { name: 'hero', type: 'group', fields: [ { name: 'title', type: 'text', required: true, localized: true }, { name: 'subtitle', type: 'textarea', required: true, localized: true }, ], }, { name: 'labels', label: 'Feliratok', type: 'group', fields: LABEL_FIELDS.map((name) => ({ name, type: 'text' as const, required: true, localized: true })), }, { name: 'largerNeeds', label: 'Nagyobb igény blokk', type: 'group', fields: [ { name: 'title', type: 'text', required: true, localized: true }, { name: 'text', type: 'textarea', required: true, localized: true }, { name: 'button', type: 'text', required: true, localized: true }, ], }, { name: 'vatRatePercent', label: 'ÁFA-kulcs (%)', type: 'number', required: true, min: 0, max: 100, defaultValue: DEFAULT_VAT_RATE_PERCENT, admin: { position: 'sidebar', description: 'A bruttó árak ebből számolódnak.' }, }, translationStatusField(), ], }