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

const ROLES_COLUMNS: ColumnMetadata[] = [
  {
    field: 'name',
    headerName: 'Name',
    type: 'text',
    editable: true,
  },
  {
    field: 'permissions',
    headerName: 'Permissions',
    type: 'relationMany',
    entityRef: 'permissions',
    editable: false,
  },
  {
    field: 'actions',
    headerName: '',
    type: 'actions',
  },
];

export const loadColumns = createColumnLoader({
  entityName: 'roles',
  columns: ROLES_COLUMNS,
});
