import { ColumnType, Insertable, Selectable, Updateable } from "npm:kysely"; import { UserID } from "../core/entities.ts"; type DateOrStr = Date | string type WrittableOnce = ColumnType export interface TableUsers extends UserID { tg_id: number | null joined_byreferal_from_user_id: WrittableOnce is_chat_participant: boolean is_captcha_passed: boolean is_timeout: boolean is_banned: boolean created_at: ColumnType joined_chat_at: ColumnType timeout_until: ColumnType } export interface TableInviteLinks { link: WrittableOnce expect_user_tg_id: WrittableOnce } export interface Database { users: TableUsers inviteLinks: TableInviteLinks } export type SelectUser = Selectable export type InsertUser = Insertable export type UpdateUser = Updateable export type SelectInviteLinks = Selectable export type InsertInviteLinks = Insertable export type UpdateInviteLinks = Updateable