import {
  Entity,
  PrimaryGeneratedColumn,
  Column,
  CreateDateColumn,
  UpdateDateColumn,
  ManyToOne,
  JoinColumn,
} from 'typeorm';
import { Student } from './student.entity';

@Entity('student_profiles')
export class StudentProfile {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ name: 'student_id', type: 'integer', unique: true })
  studentId: number;

  @ManyToOne(() => Student, { eager: true })
  @JoinColumn({ name: 'student_id' })
  student: Student;

  @Column({ name: 'target_college', length: 100, nullable: true })
  targetCollege: string;

  @Column({ name: 'target_major', length: 100, nullable: true })
  targetMajor: string;

  @Column({ name: 'college_school', length: 100, nullable: true })
  collegeSchool: string;

  @Column({ name: 'college_major', length: 100, nullable: true })
  collegeMajor: string;

  @Column({ name: 'subject_direction', length: 50, nullable: true })
  subjectDirection: string;

  @Column({ length: 20, nullable: true })
  grade: string;

  @Column({ name: 'profile_date', type: 'date', nullable: true })
  profileDate: string;

  @Column({ type: 'text', nullable: true })
  notes: string;


  @CreateDateColumn({ name: 'created_at' })
  createdAt: Date;

  @UpdateDateColumn({ name: 'updated_at' })
  updatedAt: Date;
}
