import {Attr, Str, Model, HasOne, Uid} from '@vuex-orm/core'
import {NotificationMessage} from "~/models/Core/NotificationMessage";

export class Notification extends Model {
  static entity = 'notifications'

  @Uid()
  id!: number | string | null

  @Str('')
  name!: string

  @HasOne(() => NotificationMessage, 'id')
  message!: NotificationMessage | null

  @Str(null, { nullable: true })
  type!: string|null

  @Str(null, { nullable: true })
  link!: string|null

  @Attr({})
  notificationUsers!: Array<string>
}
