// src/server/features/operations/db/inv_linen.table.ts
// Inventory linen reference table with weight information

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

export const invLinen = mysqlTable('inv_linen', {
  id: varchar('id', { length: 36 }).primaryKey(),
  name: varchar('name', { length: 255 }).notNull(), // Название (например, "Простыня", "Полотенце")
  type: varchar('type', { length: 50 }).notNull(), // Тип: SHEETS, TOWELS, PILLOWCASES, BLANKETS, etc.
  weight: decimal('weight', { precision: 5, scale: 2 }).notNull(), // Вес единицы в кг
  unit: varchar('unit', { length: 20 }).notNull().default('шт'), // Единица измерения: шт, компл
  description: varchar('description', { length: 500 }), // Описание
  createdAt: timestamp('created_at').notNull().defaultNow(),
  updatedAt: timestamp('updated_at').notNull().defaultNow().onUpdateNow(),
  archivedAt: timestamp('archived_at'), // Soft delete
});
