import { Factory } from "fishery"; import { ObjectId } from "mongodb"; import { faker } from "@faker-js/faker"; import type { DepartmentSubject } from "../../../municipal"; import { CityName } from "../../../municipal"; const VALID_CITIES: CityName[] = [ "ashdod", "maltar", "billit", "hashkelon", "tests", ]; export const departmentSubjectFactory = Factory.define( () => ({ _id: new ObjectId(), createdAt: new Date(), updatedAt: new Date(), subjectName: faker.lorem.words(2), subject_id: faker.string.numeric(4), sub_subject_name: faker.lorem.word(), sub_subject_id: faker.string.numeric(4), descriptions: [faker.lorem.sentence()], cityName: faker.helpers.arrayElement(VALID_CITIES), guidelines: null, instructions: [], communications: [], sla: faker.number.int({ min: 24, max: 720 }), }), ); export function createDepartmentSubject( overrides?: Partial, ): DepartmentSubject { return departmentSubjectFactory.build(overrides); }