import { Factory } from "fishery"; import { ObjectId } from "mongodb"; import { faker } from "@faker-js/faker"; import type { City } from "../../../municipal"; export const cityFactory = Factory.define(() => ({ _id: new ObjectId(), name: faker.location.city().toLowerCase().replace(/\s/g, "_"), displayName: faker.location.city(), createdAt: new Date(), updatedAt: new Date(), })); export function createCity(overrides?: Partial): City { return cityFactory.build(overrides); }