import {
  createColumnLoader,
  ColumnMetadata,
} from '../DataGrid/configBuilderFactory';

const PRESIGNED_URL_REQUESTS_COLUMNS: ColumnMetadata[] = [
  {
    field: 'project',
    headerName: 'Project',
    type: 'singleSelectRelation',
    entityRef: 'projects',
    editable: true,
  },
  {
    field: 'user',
    headerName: 'User',
    type: 'singleSelectRelation',
    entityRef: 'users',
    editable: true,
  },
  { field: 'purpose', headerName: 'Purpose', type: 'text', editable: true },
  {
    field: 'asset_type',
    headerName: 'Assettype',
    type: 'text',
    editable: true,
  },
  {
    field: 'requested_key',
    headerName: 'Requestedkey',
    type: 'text',
    editable: true,
  },
  { field: 'mime_type', headerName: 'MIMEtype', type: 'text', editable: true },
  {
    field: 'requested_size_mb',
    headerName: 'Requestedsize(MB)',
    type: 'number',
    editable: true,
  },
  {
    field: 'expires_at',
    headerName: 'Expiresat',
    type: 'datetime',
    editable: true,
  },
  { field: 'status', headerName: 'Status', type: 'text', editable: true },
  { field: 'actions', headerName: '', type: 'actions' },
];

export const loadColumns = createColumnLoader({
  entityName: 'presigned_url_requests',
  columns: PRESIGNED_URL_REQUESTS_COLUMNS,
});
