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

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

  @Column({ name: 'name', type: 'varchar', length: 50, comment: '物流公司名称' })
  name!: string;

  @Column({ name: 'code', type: 'varchar', length: 20, comment: '物流编号' })
  code!: string;

  @Column({ name: 'state', type: 'smallint', unsigned: true, default: 1, comment: '使用状态 1可用 2禁用' })
  state!: number;

  @Column({ name: 'sort', type: 'int', unsigned: true, nullable: true, comment: '优先级 值越大越优先' })
  sort!: number | 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;
}