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

Ouverte
#2,005 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
55/100
Type d'issue
Refactorisation
Clarté
Plutôt claire
Activité
Calme
Stack technique
react, typescript
Domaine
full-stack

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
HTML
Étoiles
33
Forks
107
Merge moyen
14 h 6 min
PR mergées (30 j)
19

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de USRSE/usrse.github.io

Toutes les issues de USRSE/usrse.github.io

Issues similaires

Plus d'issues Web Dev

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.