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

Aperta
#2,005 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
react, typescript
Ambito
full-stack

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
HTML
Stelle
33
Fork
107
Merge medio
14h 6m
PR unite (30g)
19

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di USRSE/usrse.github.io

Tutte le issue di USRSE/usrse.github.io

Issue simili

Altre issue su Web Dev

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.