/*
 *
 * Copyright (c) 2025. Jeffery Hsu - Achievement Report Generator
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
 *
 */

import { IStudent } from '@renderer/types'

export class Student implements IStudent {
  private _className: string
  private _major: string
  private _name: string
  private _resitTag: boolean
  private _serialNumber: string

  constructor(
    className: string,
    major: string,
    name: string,
    resitTag: boolean,
    serialNumber: string
  ) {
    this._className = className
    this._major = major
    this._name = name
    this._resitTag = resitTag
    this._serialNumber = serialNumber
  }

  public static factory() {
    return new Student('', '', '', false, '')
  }

  public static factoryFromImpl(impl: IStudent) {
    return new Student(impl.name, impl.major, impl.name, impl.resitTag, impl.serialNumber)
  }

  get className(): string {
    return this._className
  }

  set className(value: string) {
    this._className = value
  }

  get major(): string {
    return this._major
  }

  set major(value: string) {
    this._major = value
  }

  get name(): string {
    return this._name
  }

  set name(value: string) {
    this._name = value
  }

  get resitTag(): boolean {
    return this._resitTag
  }

  set resitTag(value: boolean) {
    this._resitTag = value
  }

  get serialNumber(): string {
    return this._serialNumber
  }

  set serialNumber(value: string) {
    this._serialNumber = value
  }
}
