import { Factory } from "fishery"; import { ObjectId } from "mongodb"; import { faker } from "@faker-js/faker"; import type { Ticket } from "../../../municipal"; import { CityName } from "../../../municipal"; const VALID_CITIES: CityName[] = [ "ashdod", "maltar", "billit", "hashkelon", "tests", ]; export const ticketFactory = Factory.define(() => ({ _id: new ObjectId(), createdAt: new Date(), updatedAt: new Date(), cityName: faker.helpers.arrayElement(VALID_CITIES), externalCallFields: { first_name: faker.person.firstName(), last_name: faker.person.lastName(), event_description: faker.lorem.sentence(), street: faker.location.street(), house_number: faker.location.buildingNumber(), event_subject_id: faker.string.numeric(4), event_sub_subject_id: faker.string.numeric(4), image1: faker.image.url(), image2: faker.image.url(), image3: faker.image.url(), file1: faker.system.filePath(), file2: faker.system.filePath(), file3: faker.system.filePath(), }, })); export function createTicket(overrides?: Partial): Ticket { return ticketFactory.build(overrides); }