Something went wrong. Try again.
A functional toolkit for authoring resource-leveling algorithms — compose constraint and scoring blocks, enumerate feasible schedules
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435import { z } from "zod";
import { NullableDateStringSchema } from "./date.ts";import { TaskSchema } from "./task.ts";import { ResourceSchema } from "./resource.ts";import { AssignmentSchema } from "./assignment.ts";import { CalendarSchema } from "./calendar.ts";import { RunProvenanceSchema } from "./provenance.ts";
export const ProjectPropertiesSchema = z.object({ title: z.nullable(z.string()), author: z.nullable(z.string()), startDate: NullableDateStringSchema, finishDate: NullableDateStringSchema, statusDate: NullableDateStringSchema, defaultCalendarUniqueId: z.nullable(z.number()), minutesPerDay: z.number().default(480), minutesPerWeek: z.number().default(2400), daysPerMonth: z.number().default(20), saveVersion: z.nullable(z.number()),});
export const ProjectFileSchema = z.object({ properties: ProjectPropertiesSchema, tasks: z.array(TaskSchema), resources: z.array(ResourceSchema), assignments: z.array(AssignmentSchema), calendars: z.array(CalendarSchema), /** Run provenance embedded by a leveling run (absent on plain reads). */ levelset: RunProvenanceSchema.optional(),});
export type ProjectProperties = z.infer<typeof ProjectPropertiesSchema>;export type ProjectFile = z.infer<typeof ProjectFileSchema>;