Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions src/collections/Concerts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import type { CollectionConfig } from 'payload'

export const Concerts: CollectionConfig = {
slug: 'concerts',
fields: [
{
name: 'title',
type: 'text',
required: true
},
{
name: 'description',
type: 'richText',
required: true
},
{
name: 'photo',
type: 'upload',
relationTo: 'media',
required: true
},
{
name: 'pdf',
type: 'text'
},
{
name: 'repertoire',
type: 'array',
fields: [
{name: 'composer', type: 'text', required: true},
{name: 'workTitle', type: 'text', required: true},
{name: 'soloist', type: 'text'},
{name: 'movements', type: 'text'}
],
// minimum of one array item
required: true
},
{
name: 'performances',
type: 'array',
fields: [
{name: 'dateTime', type: 'date', required: true},
{name: 'venue', type: 'text'},
{name: 'venueAddress', type: 'text', required: true},
{name: 'bookingUrl', type: 'text', required: true},
{name: 'price', type: 'text', required: true}
],
// minimum of one array item
required: true
},
{
name: 'photo_links',
type: 'array',
fields: [{name: 'link', type: 'text'}]
},
{
name: 'video_links',
type: 'array',
fields: [{name: 'link', type: 'text'}]
}
]
}
105 changes: 104 additions & 1 deletion src/payload-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export interface Config {
users: User;
media: Media;
partners: Partner;
concerts: Concert;
pages: Page;
passwords: Password;
links: Link;
Expand All @@ -83,6 +84,7 @@ export interface Config {
users: UsersSelect<false> | UsersSelect<true>;
media: MediaSelect<false> | MediaSelect<true>;
partners: PartnersSelect<false> | PartnersSelect<true>;
concerts: ConcertsSelect<false> | ConcertsSelect<true>;
pages: PagesSelect<false> | PagesSelect<true>;
passwords: PasswordsSelect<false> | PasswordsSelect<true>;
links: LinksSelect<false> | LinksSelect<true>;
Expand Down Expand Up @@ -183,6 +185,60 @@ export interface Partner {
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "concerts".
*/
export interface Concert {
id: string;
title: string;
description: {
root: {
type: string;
children: {
type: any;
version: number;
[k: string]: unknown;
}[];
direction: ('ltr' | 'rtl') | null;
format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
indent: number;
version: number;
};
[k: string]: unknown;
};
photo: string | Media;
pdf?: string | null;
repertoire: {
composer: string;
workTitle: string;
soloist?: string | null;
movements?: string | null;
id?: string | null;
}[];
performances: {
dateTime: string;
venue?: string | null;
venueAddress: string;
bookingUrl: string;
price: string;
id?: string | null;
}[];
photo_links?:
| {
link?: string | null;
id?: string | null;
}[]
| null;
video_links?:
| {
link?: string | null;
id?: string | null;
}[]
| null;
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "pages".
Expand Down Expand Up @@ -312,7 +368,7 @@ export interface PayloadKv {
export interface PayloadLockedDocument {
id: string;
document?:
| ({
| ({
relationTo: 'users';
value: string | User;
} | null)
Expand All @@ -324,6 +380,10 @@ export interface PayloadLockedDocument {
relationTo: 'partners';
value: string | Partner;
} | null)
| ({
relationTo: 'concerts';
value: string | Concert;
} | null)
| ({
relationTo: 'pages';
value: string | Page;
Expand Down Expand Up @@ -431,6 +491,49 @@ export interface PartnersSelect<T extends boolean = true> {
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "concerts_select".
*/
export interface ConcertsSelect<T extends boolean = true> {
title?: T;
description?: T;
photo?: T;
pdf?: T;
repertoire?:
| T
| {
composer?: T;
workTitle?: T;
soloist?: T;
movements?: T;
id?: T;
};
performances?:
| T
| {
dateTime?: T;
venue?: T;
venueAddress?: T;
bookingUrl?: T;
price?: T;
id?: T;
};
photo_links?:
| T
| {
link?: T;
id?: T;
};
video_links?:
| T
| {
link?: T;
id?: T;
};
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "pages_select".
Expand Down
3 changes: 2 additions & 1 deletion src/payload.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import sharp from 'sharp'
import { Users } from './collections/Users'
import { Media } from './collections/Media'
import { Partners } from './collections/Partners'
import { Concerts } from './collections/Concerts'
import { Pages } from './collections/Pages'
import { Passwords } from './collections/Passwords'
import { CalendarLink } from './collections/CalendarLink'
Expand All @@ -22,7 +23,7 @@ export default buildConfig({
baseDir: path.resolve(dirname),
},
},
collections: [Users, Media, Partners, Pages, Passwords, CalendarLink],
collections: [Users, Media, Partners, Pages, Passwords, CalendarLink, Concerts],
editor: lexicalEditor(),
secret: process.env.PAYLOAD_SECRET || '',
typescript: {
Expand Down
Loading