Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
1.4 kB · 40 lines
TypeScript
at master
1234567891011121314151617181920212223242526272829303132333435363738394041import { Data, Schema } from "effect";
import { NonEmpty } from "@/lib/validation-schemas";
export const CreateAssignmentInput = Schema.Struct({ title: NonEmpty("Title"), description: Schema.optionalWith(NonEmpty("Description"), { nullable: true, }), goalMapId: NonEmpty("Goal map ID"), layout: Schema.optionalWith(Schema.Literal("preset", "random"), { default: () => "random" as const, }), startDate: Schema.optionalWith(Schema.Number, { nullable: true }), endDate: Schema.optionalWith(Schema.Number, { nullable: true }), cohortIds: Schema.Array(NonEmpty("Cohort ID")), userIds: Schema.Array(NonEmpty("User ID")), preTestFormId: Schema.String, postTestFormId: Schema.optionalWith(Schema.String, { nullable: true }), delayedPostTestFormId: Schema.optionalWith(Schema.String, { nullable: true }), delayedPostTestDelayDays: Schema.optionalWith(Schema.Number, { nullable: true, }),});
export type CreateAssignmentInput = typeof CreateAssignmentInput.Type;
export const DeleteAssignmentInput = Schema.Struct({ id: NonEmpty("Assignment ID"),});
export type DeleteAssignmentInput = typeof DeleteAssignmentInput.Type;
export class AssignmentNotFoundError extends Data.TaggedError("AssignmentNotFoundError")<{ readonly assignmentId: string;}> {}
export class KitNotFoundError extends Data.TaggedError("KitNotFoundError")<{ readonly goalMapId: string;}> {}