import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 项目信息
 */
@Entity('project_info')
export class ProjectInfoEntity extends BaseEntity {
  @Column({ comment: '项目名称', length: 100 })
  name: string;

  @Column({ comment: '项目描述', type: 'text', nullable: true })
  description: string;

  @Column({ comment: '状态 0未开始 1进行中 2已完成 3已归档', default: 0 })
  status: number;

  @Column({ comment: '计划开始日期', type: 'date', nullable: true })
  startDate: string;

  @Column({ comment: '计划结束日期', type: 'date', nullable: true })
  endDate: string;

  @Column({ comment: '进度百分比 0-100', default: 0 })
  progress: number;

  @Index()
  @Column({ comment: '项目经理ID', nullable: true })
  ownerId: number;

  @Column({ comment: '项目经理姓名', length: 50, nullable: true })
  ownerName: string;

  @Column({ comment: '主题色', length: 20, nullable: true })
  color: string;
}
