import { Factory } from "fishery"; import { faker } from "@faker-js/faker"; import { ObjectId } from "mongodb"; import { URL_TASK_STATUSES, type ScanResource, } from "../../../websitalk/scanResources"; export const scanResourceFactory = Factory.define(() => ({ urlHashId: faker.string.uuid(), clientId: faker.string.uuid(), scanId: new ObjectId().toString(), websiteUrlId: new ObjectId().toString(), url: faker.internet.url(), status: URL_TASK_STATUSES.URL_PENDING, depth: 0, retryCount: 0, createdAt: new Date(), updatedAt: new Date(), })); export function createScanResourceFixture( overrides?: Partial, ): ScanResource { return scanResourceFactory.build(overrides); }