Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Reorganise `application/common/types/` contents

Aberta
#982 1 comentário 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
35/100
Tipo de issue
Refatoração
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
typescript
Domínio
backend

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
TypeScript
Estrelas
4
Forks
0
Merge médio
14h 50min
PRs com merge (30d)
5

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de Garvan-Data-Science-Platform/ctrl

Todas as issues de Garvan-Data-Science-Platform/ctrl

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.