// Generated by @pikku/cli — do not edit by hand.
// Run `pikku db migrate` to refresh.

import type { ColumnType } from 'kysely'

export type Generated<T> = T extends ColumnType<infer S, infer I, infer U>
  ? ColumnType<S, I | undefined, U>
  : ColumnType<T, T | undefined, T>

export interface AuditLog {
  auditId: Generated<string>
  tableName: string
  recordId: string
  action: "INSERT" | "UPDATE" | "DELETE"
  userId: string | null
  changedFields: string | null
  createdAt: Generated<Date>
}

export interface Company {
  companyId: Generated<string>
  name: string
  registryNo: string | null
  addressLine1: string | null
  addressLine2: string | null
  postcode: string | null
  town: string | null
  country: string | null
  totalShares: Generated<number>
  fiscalYearEnd: string | null
  createdAt: Generated<Date>
}

export interface CompanyMember {
  memberId: Generated<string>
  companyId: string
  userId: string
  role: "managing_director" | "shareholder" | "angel"
  shares: number | null
  createdAt: Generated<Date>
}

export interface Resolution {
  resolutionId: Generated<string>
  companyId: string
  templateKey: string
  title: string
  status: Generated<"draft" | "published" | "archived">
  fieldValues: Generated<string>
  pdfKey: string | null
  createdBy: string
  createdAt: Generated<Date>
  publishedAt: Date | null
}

export interface User {
  userId: Generated<string>
  email: string
  displayName: string
  passwordHash: string | null
  createdAt: Generated<Date>
}

export interface DB {
  auditLog: AuditLog
  company: Company
  companyMember: CompanyMember
  resolution: Resolution
  user: User
}
