import { ObjectType, Field } from 'type-graphql'
import { Domain, ScalarAny } from '@things-factory/shell'

@ObjectType()
export class Notification {
  @Field(type => Domain, { nullable: true })
  domain?: Domain

  @Field({ nullable: true })
  subject?: string

  @Field({ nullable: true })
  type?: string

  @Field()
  title: string

  @Field()
  body: string

  @Field({ nullable: true })
  url: string

  @Field({ nullable: true })
  image: string

  @Field(type => ScalarAny, { nullable: true })
  property: any

  @Field({ nullable: true })
  timestamp: Date
}
