refactor(shared): extract artifact status/scope/type vocab into shared constants module

Abierto
#2,005 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
react, typescript
Área
full-stack

Línea de trabajo

Start with the Drizzle pgEnum definitions and inspect the existing monorepo workspace pattern, then trace the listed API and admin files for their duplicated vocabularies. Choose a shared module importable by packages/api and apps/admin, replace the redeclarations with its arrays and label maps, and verify every listed file uses the shared definitions.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Summary

Artifact lifecycle status, scope, and event-type enum values are currently re-declared in multiple files (admin route validation, admin list-page filters, public route filters). The drizzle pgEnum is the authoritative source but isn't easy to import as a const array for UI dropdowns and zod schemas.

Requirements

  • Create a shared module exporting const arrays + label maps for: artifactStatus, artifactScope, artifactReviewDecision, broadcastChannel, broadcastChannelStatus, eventType
  • The shared module must be importable from both packages/api and apps/admin (possibly apps/web too)
  • Refactor existing redeclarations to import from the shared module:
    • packages/api/src/routes/admin/events/index.ts
    • packages/api/src/routes/admin/events/byId.ts
    • packages/api/src/routes/admin/announcements/index.ts
    • packages/api/src/routes/admin/announcements/byId.ts
    • packages/api/src/routes/eventsSubmit.ts
    • apps/admin/src/pages/events/EventsListPage.tsx
    • apps/admin/src/pages/events/NewEventPage.tsx
    • apps/admin/src/pages/announcements/AnnouncementsListPage.tsx

Context

Flagged in the Plan 3 review. As Plan 4 (forms) and Plan 5 (broadcast) add more surfaces touching these enums, drift risk compounds.

Implementation Notes

The existing monorepo structure suggests a new packages/shared/ workspace or extending packages/design-system/ with a constants subpath. Pick whichever fits the existing pattern.

Lenguaje dominante
HTML
Estrellas
33
Forks
107
Merge medio
14 h 6 min
PR fusionados (30 d)
19

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de USRSE/usrse.github.io

Todos los issues de USRSE/usrse.github.io

Issues similares

Más issues de Web Dev

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.