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

/**
 * 项目阶段
 */
@Entity('project_phase')
export class ProjectPhaseEntity extends BaseEntity {
  @Index()
  @Column({ comment: '所属项目ID' })
  projectId: number;

  @Column({ comment: '阶段名称', length: 100 })
  name: string;

  @Column({ comment: '分类', length: 50, nullable: true })
  type: string;

  @Column({ comment: '状态 0未开始 1进行中 2已完成', 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;

  @Column({ comment: '排序序号', default: 0 })
  sortOrder: number;
}
