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

import { z } from "zod"

import { pubsIdSchema } from "./Pubs"
import { stagesIdSchema } from "./Stages"

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

/** Represents the table public.PubsInStages */
export interface PubsInStagesTable {
	pubId: ColumnType<PubsId, PubsId, PubsId>

	stageId: ColumnType<StagesId, StagesId, StagesId>

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

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

export type PubsInStages = Selectable<PubsInStagesTable>

export type NewPubsInStages = Insertable<PubsInStagesTable>

export type PubsInStagesUpdate = Updateable<PubsInStagesTable>

export const pubsInStagesSchema = z.object({
	pubId: pubsIdSchema,
	stageId: stagesIdSchema,
	createdAt: z.date(),
	updatedAt: z.date(),
})

export const pubsInStagesInitializerSchema = z.object({
	pubId: pubsIdSchema,
	stageId: stagesIdSchema,
	createdAt: z.date().optional(),
	updatedAt: z.date().optional(),
})

export const pubsInStagesMutatorSchema = z.object({
	pubId: pubsIdSchema.optional(),
	stageId: stagesIdSchema.optional(),
	createdAt: z.date().optional(),
	updatedAt: z.date().optional(),
})
