import { resolveStoredColumnConfig } from '@/lib/columnConfigStorage';

export const MATERIAL_COLUMN_KEYS = [
  '_index',
  'batch_id',
  'material_name',
  'specification',
  'quantity',
  'unit',
  'brand',
  'source_file',
  'created_by',
  'created_at',
  '_actions',
];

export const MATERIAL_REQUIRED_COLUMN_KEYS = ['_index', '_actions'];

export const MATERIAL_COLUMN_STORAGE_KEY = 'autoprocurement.materials.columns';

export function getInitialMaterialColumnConfig() {
  return resolveStoredColumnConfig({
    storageKey: MATERIAL_COLUMN_STORAGE_KEY,
    allKeys: MATERIAL_COLUMN_KEYS,
    defaultVisibleKeys: MATERIAL_COLUMN_KEYS,
    requiredKeys: MATERIAL_REQUIRED_COLUMN_KEYS,
  });
}
