import type { ColumnType, Insertable, Selectable, Updateable } from "kysely"
import type { PubFieldsId } from "./PubFields"
import type { PubTypesId } from "./PubTypes"

import { z } from "zod"

import { pubFieldsIdSchema } from "./PubFields"
import { pubTypesIdSchema } from "./PubTypes"

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

/** Represents the table public._PubFieldToPubType */
export interface PubFieldToPubTypeTable {
	A: ColumnType<PubFieldsId, PubFieldsId, PubFieldsId>

	B: ColumnType<PubTypesId, PubTypesId, PubTypesId>

	isTitle: ColumnType<boolean, boolean | undefined, boolean>

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

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

	rank: ColumnType<string, string, string>
}

export type PubFieldToPubType = Selectable<PubFieldToPubTypeTable>

export type NewPubFieldToPubType = Insertable<PubFieldToPubTypeTable>

export type PubFieldToPubTypeUpdate = Updateable<PubFieldToPubTypeTable>

export const pubFieldToPubTypeSchema = z.object({
	A: pubFieldsIdSchema,
	B: pubTypesIdSchema,
	isTitle: z.boolean(),
	createdAt: z.date(),
	updatedAt: z.date(),
	rank: z.string(),
})

export const pubFieldToPubTypeInitializerSchema = z.object({
	A: pubFieldsIdSchema,
	B: pubTypesIdSchema,
	isTitle: z.boolean().optional(),
	createdAt: z.date().optional(),
	updatedAt: z.date().optional(),
	rank: z.string(),
})

export const pubFieldToPubTypeMutatorSchema = z.object({
	A: pubFieldsIdSchema.optional(),
	B: pubTypesIdSchema.optional(),
	isTitle: z.boolean().optional(),
	createdAt: z.date().optional(),
	updatedAt: z.date().optional(),
	rank: z.string().optional(),
})
