import type { ColumnType, Insertable, Selectable, Updateable } from "kysely"
import type { FormsId } from "./Forms"
import type { InvitesId } from "./Invites"
import type { MembershipType } from "./MembershipType"

import { z } from "zod"

import { formsIdSchema } from "./Forms"
import { invitesIdSchema } from "./Invites"
import { membershipTypeSchema } from "./MembershipType"

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

/** Identifier type for public.invite_forms */
export type InviteFormsType = MembershipType

/** Represents the table public.invite_forms */
export interface InviteFormsTable {
	inviteId: ColumnType<InvitesId, InvitesId, InvitesId>

	formId: ColumnType<FormsId, FormsId, FormsId>

	type: ColumnType<InviteFormsType, InviteFormsType, InviteFormsType>

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

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

export type InviteForms = Selectable<InviteFormsTable>

export type NewInviteForms = Insertable<InviteFormsTable>

export type InviteFormsUpdate = Updateable<InviteFormsTable>

export const inviteFormsTypeSchema = membershipTypeSchema as unknown as z.Schema<InviteFormsType>

export const inviteFormsSchema = z.object({
	inviteId: invitesIdSchema,
	formId: formsIdSchema,
	type: inviteFormsTypeSchema,
	createdAt: z.date(),
	updatedAt: z.date(),
})

export const inviteFormsInitializerSchema = z.object({
	inviteId: invitesIdSchema,
	formId: formsIdSchema,
	type: inviteFormsTypeSchema,
	createdAt: z.date().optional(),
	updatedAt: z.date().optional(),
})

export const inviteFormsMutatorSchema = z.object({
	inviteId: invitesIdSchema.optional(),
	formId: formsIdSchema.optional(),
	type: inviteFormsTypeSchema.optional(),
	createdAt: z.date().optional(),
	updatedAt: z.date().optional(),
})
