50 lines
944 B
TypeScript
50 lines
944 B
TypeScript
import { CollectionConfig } from 'payload';
|
|
|
|
export const Agbs: CollectionConfig = {
|
|
slug: 'agbs-collection',
|
|
admin: {
|
|
useAsTitle: 'title',
|
|
defaultColumns: ['title', 'versionDate', 'updatedAt'],
|
|
group: 'Rechtliches',
|
|
},
|
|
access: {
|
|
read: () => true,
|
|
},
|
|
fields: [
|
|
{
|
|
name: 'title',
|
|
type: 'text',
|
|
required: true,
|
|
localized: true,
|
|
label: 'Titel (z.B. AGB April 2026)',
|
|
},
|
|
{
|
|
name: 'versionDate',
|
|
type: 'date',
|
|
required: true,
|
|
label: 'Gültig ab',
|
|
admin: {
|
|
date: {
|
|
pickerAppearance: 'dayOnly',
|
|
},
|
|
},
|
|
},
|
|
{
|
|
name: 'file',
|
|
type: 'upload',
|
|
relationTo: 'media',
|
|
required: true,
|
|
label: 'PDF Datei',
|
|
},
|
|
{
|
|
name: 'isCurrent',
|
|
type: 'checkbox',
|
|
label: 'Aktuelle Version',
|
|
defaultValue: false,
|
|
admin: {
|
|
position: 'sidebar',
|
|
},
|
|
},
|
|
],
|
|
};
|