import type { ColumnType, Insertable, Selectable, Updateable } from "kysely"
import type { StagesId } from "./Stages"

import { z } from "zod"

import { stagesIdSchema } from "./Stages"

// @generated
// This file is automatically generated by Kanel. Do not modify manually.

/** Represents the table public.move_constraint */
export interface MoveConstraintTable {
	stageId: ColumnType<StagesId, StagesId, StagesId>

	destinationId: ColumnType<StagesId, StagesId, StagesId>

	createdAt: ColumnType<Date, Date | string | undefined, Date | string>

	updatedAt: ColumnType<Date, Date | string | undefined, Date | string>
}

export type MoveConstraint = Selectable<MoveConstraintTable>

export type NewMoveConstraint = Insertable<MoveConstraintTable>

export type MoveConstraintUpdate = Updateable<MoveConstraintTable>

export const moveConstraintSchema = z.object({
	stageId: stagesIdSchema,
	destinationId: stagesIdSchema,
	createdAt: z.date(),
	updatedAt: z.date(),
})

export const moveConstraintInitializerSchema = z.object({
	stageId: stagesIdSchema,
	destinationId: stagesIdSchema,
	createdAt: z.date().optional(),
	updatedAt: z.date().optional(),
})

export const moveConstraintMutatorSchema = z.object({
	stageId: stagesIdSchema.optional(),
	destinationId: stagesIdSchema.optional(),
	createdAt: z.date().optional(),
	updatedAt: z.date().optional(),
})
