Skip to content

Commit

Permalink
refactor(api): rename isObsolete field to isCaduque and implement cor…
Browse files Browse the repository at this point in the history
…responding resolver for Candidacy type
  • Loading branch information
ThomasDos committed Dec 11, 2024
1 parent 7424550 commit b9763e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/reva-api/modules/candidacy/candidacy.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ type Candidacy {
status: CandidacyStatusStep!
typeAccompagnement: TypeAccompagnement!
lastActivityDate: Timestamp
isObsolete: Boolean!
isCaduque: Boolean!
}
enum TypeAccompagnement {
ACCOMPAGNE
Expand Down
6 changes: 3 additions & 3 deletions packages/reva-api/modules/candidacy/candidacy.resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { getCandidacyCountByStatus } from "./features/getCandidacyCountByStatus"
import { getCandidacyDropOutByCandidacyId } from "./features/getCandidacyDropOutByCandidacyId";
import { getCandidacyFinancingMethodById } from "./features/getCandidacyFinancingMethodById";
import { getCandidacyGoals } from "./features/getCandidacyGoals";
import { getCandidacyIsCaduque } from "./features/getCandidacyIsCaduque";
import { getCandidacyOnCandidacyFinancingMethodsByCandidacyId } from "./features/getCandidacyOnCandidacyFinancingMethodsByCandidacyId";
import { getCandidacyStatusesByCandidacyId } from "./features/getCandidacyStatusesByCandidacyId";
import { getDropOutReasonById } from "./features/getDropOutReasonById";
Expand All @@ -57,7 +58,6 @@ import {
sendCandidacyDropOutEmailToCertificateur,
} from "./mails";
import { resolversSecurityMap } from "./security/security";
import { getCandidacyIsObsolete } from "./features/getCandidacyIsObsolete";

const unsafeResolvers = {
Candidacy: {
Expand All @@ -84,8 +84,8 @@ const unsafeResolvers = {
getCandidacyDropOutByCandidacyId({ candidacyId }),
candidacyOnCandidacyFinancingMethods: ({ id: candidacyId }: Candidacy) =>
getCandidacyOnCandidacyFinancingMethodsByCandidacyId({ candidacyId }),
isObsolete: ({ id: candidacyId }: Candidacy) =>
getCandidacyIsObsolete({ candidacyId }),
isCaduque: ({ id: candidacyId }: Candidacy) =>
getCandidacyIsCaduque({ candidacyId }),
},
CandidacyOnCandidacyFinancingMethod: {
candidacyFinancingMethod: ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { addMonths, isBefore } from "date-fns";
import { getCandidacyById } from "./getCandidacyById";

export const getCandidacyIsObsolete = async ({
export const getCandidacyIsCaduque = async ({
candidacyId,
}: {
candidacyId: string;
Expand Down

0 comments on commit b9763e2

Please sign in to comment.