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

/**
 * 工时记录
 */
@Entity('project_time_log')
export class ProjectTimeLogEntity extends BaseEntity {
  @Index()
  @Column({ comment: '所属任务ID' })
  taskId: number;

  @Index()
  @Column({ comment: '记录人ID' })
  userId: number;

  @Column({ comment: '记录人姓名', length: 50 })
  userName: string;

  @Column({ comment: '工作日期', type: 'date' })
  logDate: string;

  @Column({ comment: '工时(小时)', type: 'decimal', precision: 5, scale: 1 })
  hours: number;

  @Column({ comment: '工作内容描述', length: 500, nullable: true })
  description: string;
}
