Skip to content

Commit

Permalink
chore: remove unused legacy admissibility code (but keep data)
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricss committed Nov 13, 2024
1 parent c4fe9b4 commit 0f8f86d
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 149 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export type CandidacyLogEventTypeAndDetails =
| "CANDIDACY_DROP_OUT_CANCELED"
| "CANDIDACY_DROP_OUT_VALIDATED"
| "ADMISSIBILITY_FVAE_UPDATED"
| "ADMISSIBILITY_UPDATED"
| "FEASIBILITY_SENT"
| "FEASIBILITY_VALIDATED"
| "FEASIBILITY_REJECTED"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ export const getCandidacyLogMessage = ({
return "Validation de l'abandon de la candidature.";
case "CANDIDACY_DROP_OUT_CANCELED":
return "Annulation de l'abandon de la candidature.";
case "ADMISSIBILITY_UPDATED":
return "Information de recevabilité modifiées.";
case "READY_FOR_JURY_ESTIMATED_DATE_UPDATED":
return `Date prévisionenelle de finalisation ou de dépôt du dossier de validation modifiée. Nouvelle date ${format(
details.readyForJuryEstimatedAt,
Expand Down
26 changes: 0 additions & 26 deletions packages/reva-api/modules/candidacy/candidacy.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ type Candidacy {
candidacyStatuses: [CandidacyStatus!]!
candidacyDropOut: CandidacyDropOut
createdAt: Timestamp!
admissibility: Admissibility!
reorientationReason: ReorientationReason
financeModule: FinanceModule!
feasibilityFormat: FeasibilityFormat!
Expand Down Expand Up @@ -134,19 +133,6 @@ enum OrganismTypology {
expertBrancheEtFiliere
}

type Admissibility {
isCandidateAlreadyAdmissible: Boolean!
reportSentAt: Timestamp
certifierRespondedAt: Timestamp
responseAvailableToCandidateAt: Timestamp
status: AdmissibilityStatus
}

enum AdmissibilityStatus {
ADMISSIBLE
NOT_ADMISSIBLE
}

type CandidacyCountByStatus {
ACTIVE_HORS_ABANDON: Int!
ABANDON: Int!
Expand Down Expand Up @@ -267,14 +253,6 @@ input DropOutInput {
otherReasonContent: String
}

input AdmissibilityInput {
isCandidateAlreadyAdmissible: Boolean!
reportSentAt: Timestamp
certifierRespondedAt: Timestamp
responseAvailableToCandidateAt: Timestamp
status: AdmissibilityStatus
}

type Mutation {
candidacy_submitCandidacy(candidacyId: ID!): Candidacy
candidacy_addExperience(
Expand Down Expand Up @@ -311,10 +289,6 @@ type Mutation {
candidacy_dropOut(candidacyId: UUID!, dropOut: DropOutInput!): Candidacy!
candidacy_validateDropOut(candidacyId: UUID!): Candidacy!
candidacy_cancelDropOutById(candidacyId: UUID!): Candidacy!
candidacy_updateAdmissibility(
candidacyId: UUID!
admissibility: AdmissibilityInput!
): Admissibility!
candidacy_setReadyForJuryEstimatedAt(
candidacyId: UUID!
readyForJuryEstimatedAt: Timestamp!
Expand Down
19 changes: 0 additions & 19 deletions packages/reva-api/modules/candidacy/candidacy.resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
} from "../shared/error/functionalError";
import { logger } from "../shared/logger";
import {
Admissibility,
Candidacy,
CandidacyBusinessEvent,
CandidacyStatusFilter,
Expand All @@ -23,7 +22,6 @@ import { addExperienceToCandidacy } from "./features/addExperienceToCandidacy";
import { archiveCandidacy } from "./features/archiveCandidacy";
import { cancelDropOutCandidacy } from "./features/cancelDropOutCandidacy";
import { dropOutCandidacy } from "./features/dropOutCandidacy";
import { getAdmissibilityByCandidacyId } from "./features/getAdmissibilityByCandidacyId";
import { getCandidacy } from "./features/getCandidacy";
import { getCandidacyCcns } from "./features/getCandidacyCcns";
import { getCandidacyCountByStatus } from "./features/getCandidacyCountByStatus";
Expand All @@ -35,7 +33,6 @@ import { setReadyForJuryEstimatedAt } from "./features/setReadyForJuryEstimatedA
import { submitCandidacy } from "./features/submitCandidacy";
import { takeOverCandidacy } from "./features/takeOverCandidacy";
import { unarchiveCandidacy } from "./features/unarchiveCandidacy";
import { updateAdmissibility } from "./features/updateAdmissibility";
import { updateAppointmentInformations } from "./features/updateAppointmentInformations";
import { updateCandidacyTypologyAndCcn } from "./features/updateCandidacyTypologyAndCcn";
import { updateContactOfCandidacy } from "./features/updateContactOfCandidacy";
Expand All @@ -62,8 +59,6 @@ import { getCandidacyFinancingMethodById } from "./features/getCandidacyFinancin

const unsafeResolvers = {
Candidacy: {
admissibility: ({ id: candidacyId }: Candidacy) =>
getAdmissibilityByCandidacyId({ candidacyId }),
goals: async ({ id: candidacyId }: Candidacy) =>
getCandidacyGoals({ candidacyId }),
experiences: async ({ id: candidacyId }: Candidacy) =>
Expand Down Expand Up @@ -555,20 +550,6 @@ const unsafeResolvers = {

return result;
},
candidacy_updateAdmissibility: async (
{
candidacyId,
admissibility,
}: { candidacyId: string; admissibility: Admissibility },
context: GraphqlContext,
) =>
updateAdmissibility({
candidacyId,
admissibility,
userKeycloakId: context.auth.userInfo?.sub,
userEmail: context.auth.userInfo?.email,
userRoles: context.auth.userInfo?.realm_access?.roles || [],
}),
candidacy_setReadyForJuryEstimatedAt: async (
_parent: unknown,
params: {
Expand Down
14 changes: 2 additions & 12 deletions packages/reva-api/modules/candidacy/candidacy.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export interface CandidacyDropOut {
status: CandidacyStatusStep;
otherReasonContent?: string | null;
}

export interface Candidacy {
id: string;
isCertificationPartial?: boolean | null;
Expand All @@ -29,17 +30,6 @@ type Duration =
| "moreThanFiveYears"
| "moreThanTenYears";

export interface Admissibility {
id: string;
isCandidateAlreadyAdmissible: boolean;
reportSentAt: Date | null;
certifierRespondedAt: Date | null;
responseAvailableToCandidateAt: Date | null;
status: AdmissibilityStatus | null;
}

type AdmissibilityStatus = "ADMISSIBLE" | "NOT_ADMISSIBLE";

export enum CandidacyBusinessEvent {
SUBMITTED_CANDIDACY = "Submitted Candidacy",
TOOK_OVER_CANDIDACY = "Took over candidacy",
Expand All @@ -55,13 +45,13 @@ export enum CandidacyBusinessEvent {
SELECTED_ORGANISM = "Selected organism",
SUBMITTED_TRAINING_FORM = "Submitted training form",
CONFIRMED_TRAINING_FORM = "Confirmed training form",
UPDATED_ADMISSIBILITY = "Updated admissibility",
DROPPED_OUT_CANDIDACY = "Dropped out candidacy",
CANCELED_DROPPED_OUT_CANDIDACY = "Canceled dropped out candidacy",
VALIDATED_DROPPED_OUT_CANDIDACY = "Validated dropped out candidacy",
UPDATED_EXAM_INFO = "Updated exam information",
CREATED_FUNDING_REQUEST_UNIFVAE = "Created a funding request (unifvae)",
}

export const candidacyStatusFilters = [
"ACTIVE_HORS_ABANDON",
"ABANDON",
Expand Down

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions packages/reva-api/modules/candidacy/security/security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,8 @@ export const resolversSecurityMap = {
"Mutation.candidacy_dropOut": isAdminOrCandidacyCompanion,
"Mutation.candidacy_validateDropOut": isAdmin,
"Mutation.candidacy_cancelDropOutById": isAdmin,
"Mutation.candidacy_updateAdmissibility": isAdminOrCandidacyCompanion,
"Mutation.candidacy_createOrUpdatePaymentRequest":
isAdminOrCandidacyCompanion,
"Mutation.candidacy_confirmPaymentRequest": isAdminOrCandidacyCompanion,
"Mutation.candidacy_setReadyForJuryEstimatedAt": isOwnerOrCanManageCandidacy,

"Candidacy.admissibility": isAdminOrCandidacyCompanion,
};

0 comments on commit 0f8f86d

Please sign in to comment.