import { Historical } from '~/types/interfaces'
import Person from "~/models/Person/Person";
import ApiModel from "~/models/ApiModel";
import {HasOne, Num, Uid, Attr} from "pinia-orm/dist/decorators";

/**
 * AP2i Model : Access
 *
 * @see https://gitlab.2iopenservice.com/opentalent/ap2i/-/blob/develop/src/Entity/Access/Access.php
 */
export default class Access extends ApiModel {
  static entity = 'accesses'

  @Uid()
  declare id: number | string

  @HasOne(() => Person, 'accessId')
  declare person: Person | null

  @Num(0)
  declare activityYear: number

  @Attr({})
  declare historical: Historical
}
