refactor(events): expand eventType taxonomy with central config
Replaces the four-value enum (community/workshop/social/showcase) with seven values: talk, workshop, community-meetup, coworking, peer-session, skills-share, info-session. Default is now community-meetup. Adds app/config/eventTypes.js as the single source of truth for value→label mapping. Updates the model enum, seed scripts, and admin event list/filter + admin dashboard to read from it via EVENT_TYPES and eventTypeLabel().
This commit is contained in:
parent
31144617d7
commit
2ffaf0ef09
6 changed files with 54 additions and 24 deletions
21
app/config/eventTypes.js
Normal file
21
app/config/eventTypes.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// Central configuration for Ghost Guild event types.
|
||||
// Keep values in sync with the `eventType` enum in server/models/event.js.
|
||||
export const EVENT_TYPES = [
|
||||
{ value: "talk", label: "Talk / Presentation" },
|
||||
{ value: "workshop", label: "Workshop" },
|
||||
{ value: "community-meetup", label: "Community Meetup" },
|
||||
{ value: "coworking", label: "Co-working Session" },
|
||||
{ value: "peer-session", label: "Peer Session" },
|
||||
{ value: "skills-share", label: "Skills Share" },
|
||||
{ value: "info-session", label: "Info Session" },
|
||||
];
|
||||
|
||||
export const EVENT_TYPE_VALUES = EVENT_TYPES.map((t) => t.value);
|
||||
|
||||
const labelLookup = Object.fromEntries(
|
||||
EVENT_TYPES.map((t) => [t.value, t.label]),
|
||||
);
|
||||
|
||||
export function eventTypeLabel(value) {
|
||||
return labelLookup[value] || value || "";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue