import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';

@Entity('stock_xunlian_codes')
export class StockXunlianCodes {
  @PrimaryGeneratedColumn({ unsigned: true })
  id!: number;

  @Column({ name: 'code', type: 'varchar', length: 255, nullable: false, comment: '股票代码' })
  code!: string;

  @Column({ name: 'stock_name', type: 'varchar', length: 255, nullable: false, comment: '股票名称' })
  stockName!: string;

  @Column({ name: 'name', type: 'varchar', length: 255, nullable: false, comment: '案例名称' })
  name!: string;

  @Column({ name: 'type', type: 'varchar', length: 255, nullable: true, comment: '案例类型' })
  type!: string | null;

  @Column({ name: 'description', type: 'varchar', length: 255, nullable: true, comment: '案例描述' })
  description!: string | null;

  @Column({ name: 'training_start_date', type: 'timestamp', nullable: false, comment: '训练开始日期' })
  trainingStartDate!: Date;

  @Column({ name: 'training_end_date', type: 'timestamp', nullable: false, comment: '训练结束日期' })
  trainingEndDate!: Date;

  @Column({ name: 'created_at', type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
  createdAt!: Date;

  @Column({ name: 'updated_at', type: 'timestamp', default: () => 'CURRENT_TIMESTAMP', onUpdate: 'CURRENT_TIMESTAMP' })
  updatedAt!: Date;
}