Skip to content

Commit

Permalink
feat(api): updated certification activation / deactivation batches to…
Browse files Browse the repository at this point in the history
… handle certification visible column
  • Loading branch information
agarbe committed Dec 6, 2024
1 parent b3963f0 commit eacf024
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { prismaClient } from "../../../prisma/client";
export const deactivateCertificationsIfExpiresAtDateIsPast = () =>
prismaClient.certification.updateMany({
where: {
status: "AVAILABLE",
visible: true,
expiresAt: { lte: startOfToday() },
},
data: { status: "INACTIVE" },
data: { status: "INACTIVE", visible: false },
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import { prismaClient } from "../../../prisma/client";
export const makeCertificationsAvailableIfAvailableAtDateIsPast = () =>
prismaClient.certification.updateMany({
where: {
status: { not: "AVAILABLE" },
visible: false,
statusV2: "VALIDE_PAR_CERTIFICATEUR",
availableAt: { lte: startOfToday() },
expiresAt: { gt: startOfToday() },
},
data: { status: "AVAILABLE" },
data: { status: "AVAILABLE", visible: true },
});

0 comments on commit eacf024

Please sign in to comment.