import { Uid, Str, Bool, Attr } from 'pinia-orm/dist/decorators'
import ApiModel from '~/models/ApiModel'
import type Tag from '~/models/Maestro/Tag'

/**
 * Maestro Model : News
 *
 * @see https://gitlab.2iopenservice.com/opentalent/maestro/-/blob/master/src/Entity/News/News.php?ref_type=heads
 */
export default class News extends ApiModel {
  static override entity = 'public/news'

  @Uid()
  declare id: number | string

  @Str(null)
  declare type: string | null

  @Str(null)
  declare title: string | null

  @Str(null)
  declare slug: string | null

  @Str(null)
  declare leadText: string | null

  @Str(null)
  declare bodyText: string | null

  @Bool(false)
  declare featured: boolean

  @Bool(false)
  declare favorite: boolean

  @Attr({})
  declare attachmentFile: object

  @Str(null)
  declare attachment: string | null

  @Str(null)
  declare startPublication: string | null

  @Str(null)
  declare updatedAt: string | null

  @Str(null)
  declare endPublication: string | null

  @Str(null)
  declare domainType: string | null

  @Str(null)
  declare eventType: string | null

  @Str(null)
  declare categoryType: string | null

  @Str(null)
  declare productType: string | null

  @Str(null)
  declare optionsType: string | null

  @Str(null)
  declare subOptionsType: string | null

  @Attr([])
  declare tags: Tag[]

  @Str(null)
  declare linkButton: string
}
