Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Reorganise `application/common/types/` contents

Ouverte
#982 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
35/100
Type d'issue
Refactorisation
Clarté
Plutôt claire
Activité
Active
Stack technique
typescript
Domaine
backend

Piste de recherche

Start with the imports and type files named in the review: application/common/types/api/users/ParticipantProfile.ts, participants/participant.ts, participants/invite.ts, and the root survey.ts and invite.ts. Trace their imports and usages, including the four types identified as unused, before deciding which moves belong in this follow-up. Done means shared types are organized at folder level, imports use the folder exports, and the generated spec remains unchanged.

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

Description

From @iamtanuj18 's review of #937:

application/commont/types/invite.ts includes this line: import { AlternativeContact, ContactMethod, StateTerritory } from './api/users/ParticipantProfile'

Suggestion: This line reaches into api/users/ParticipantProfile.ts, which holds shared domain types (ContactMethod, StateTerritory, AlternativeContact and so on) rather than one endpoint's request and response. No index.ts exports it, so 16 imports in the backend, both clients and integrations reach into it the same way, and participants/participant.ts and participants/invite.ts (InviteStatus) sit in endpoint folders too. Since you mentioned types/api has no clear pattern, ParticipantProfile.ts and participant.ts could move up to types/, next to survey.ts, and InviteStatus could join the root invite.ts. ParticipantWithProfile (participants/participant.ts:16) could move into getParticipantById.ts, its only user, since it builds on GetParticipantProfileResponse. The moves leave the generated spec unchanged, because TSOA names schemas by type name, not by file.

The wider tidy-up could follow the same idea. ProfilesController and InvitesController get their own folders, each index.ts exports its whole folder (export type for types, plain export for enums and consts), and a no-restricted-imports rule keeps imports at folder level. Four types are never used and could go at the same time: RevokeInviteRequest, GetSurveyVersionByIdResponse, GetUserSurveyStepRequest and GetUserSurveyStepsRequest. All of this could be a follow-up issue if this PR is big enough already.

Langage dominant
TypeScript
Étoiles
4
Forks
0
Merge moyen
14 h 50 min
PR mergées (30 j)
5

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 Garvan-Data-Science-Platform/ctrl

Toutes les issues de Garvan-Data-Science-Platform/ctrl

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

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