Skip to content

[BACKEND] Create events collection #9

@aleckshen

Description

@aleckshen

Is your feature request related to a problem? Please describe

There is currently no way to store or manage events (socials, tournaments, etc.) in the system.

Describe the solution you'd like

Create a new Events collection in src/payload/collections/Events.ts and register it in src/payload.config.ts.

Fields:

Field Type Required Notes
title text yes
description richText yes Uses the existing Lexical editor
eventType select yes Options: social-session, event
date date yes
startTime text yes e.g. 18:00
endTime text no
location text yes
image upload no relationTo: 'media'
maxCapacity number yes
waitlistCapacity number no Default: 0
memberPrice number no In cents, e.g. 500 = $5.00
nonMemberPrice number no In cents
registrationOpenAt date no When sign-ups open
registrationCloseAt date no When sign-ups close
status select yes Options: upcoming, ongoing, completed, cancelled. Default: upcoming

Access control:

Operation Rule
read Public (no login required)
create / update / delete Admins only

Describe alternatives you've considered

No alternatives considered — a dedicated collection is the standard Payload approach for structured content like events.

Additional context

After creating the collection, run pnpm payload generate:types to regenerate payload-types.ts.

Ref: https://payloadcms.com/docs/configuration/collections

BEFORE MERGING

  • Code generation run (hint: pnpm typegen)
  • PR Reviewed (For non-trivial changes)
  • All required PR checks passing

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions