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

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

  @Column({
    name: 'tenant_id',
    type: 'int',
    unsigned: true,
    nullable: false,
    comment: '租户ID'
  })
  tenantId!: number;

  @Column({
    name: 'name',
    type: 'varchar',
    length: 50,
    comment: '类型名称'
  })
  name!: string;

  @Column({
    name: 'code',
    type: 'varchar',
    length: 20,
    comment: '调用别名'
  })
  code!: string;

  @Column({
    name: 'remark',
    type: 'varchar',
    length: 100,
    nullable: true,
    comment: '备注'
  })
  remark!: string | null;

  @CreateDateColumn({
    name: 'created_at',
    type: 'timestamp',
    comment: '创建时间'
  })
  createdAt!: Date;

  @UpdateDateColumn({
    name: 'updated_at',
    type: 'timestamp',
    comment: '更新时间'
  })
  updatedAt!: Date;

  @Column({
    name: 'created_by',
    type: 'int',
    unsigned: true,
    nullable: true,
    comment: '创建用户ID'
  })
  createdBy!: number | null;

  @Column({
    name: 'updated_by',
    type: 'int',
    unsigned: true,
    nullable: true,
    comment: '更新用户ID'
  })
  updatedBy!: number | null;

  @Column({
    name: 'status',
    type: 'int',
    default: 0,
    comment: '状态 0禁用 1启用'
  })
  status!: number;
}