Files
calendar/packages/features/watchlist/lib/testUtils.ts
T
Joe Au-YeungandGitHub c0aa97178c feat: Prevent watchlisted entities from creating bookings (#19107)
* Add `searchForAllBlockedRecords` to watchlist repository

* Create `checkIfUsersAreBlocked`

* Call `checkIfUsersAreBlocked` in `loadAndValidateUsers`

* Draft test

* Add tests

* Type fix

* Type fix
2025-03-28 01:11:10 +00:00

19 lines
418 B
TypeScript

import prismock from "../../../../tests/libs/__mocks__/prisma";
import type { WatchlistSeverity, WatchlistType } from "@calcom/prisma/enums";
interface WatchlistInput {
severity: WatchlistSeverity;
type: WatchlistType;
value: string;
}
export const createWatchlistEntry = async (input: WatchlistInput) => {
await prismock.watchlist.create({
data: {
...input,
createdById: 0,
},
});
};