// src/server/features/operations/db/checkin.table.ts
// Check-in table schema for guest check-in operations

import { mysqlTable, varchar, timestamp, boolean } from 'drizzle-orm/mysql-core';

export const checkins = mysqlTable('checkins', {
  id: varchar('id', { length: 36 }).primaryKey(),
  guestName: varchar('guest_name', { length: 255 }).notNull(),
  roomNumber: varchar('room_number', { length: 10 }).notNull(),
  checkInTime: timestamp('check_in_time').notNull(),
  checkOutTime: timestamp('check_out_time'),
  date: timestamp('date').notNull(), // Дата операции (для архивации)
  isArchived: boolean('is_archived').notNull().default(false), // Флаг архивации
  createdAt: timestamp('created_at').notNull().defaultNow(),
  updatedAt: timestamp('updated_at').notNull().defaultNow().onUpdateNow(),
});
