import { Exclude } from 'class-transformer';
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import Admin from './admin.entity';
import { Timestamp } from './timestamp';

@Entity('generate_keys')
export class GenerateKey extends Timestamp {
  @PrimaryGeneratedColumn('increment')
  id: number;

  @Column({ unique: true })
  client_key: string;

  @ManyToOne(() => Admin, (admin) => admin.generateKeys, {
    onDelete: 'CASCADE',
  })
  admin: Admin;
}
