import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'
import { ProcessTemplate } from './process-template'

@InputType()
export class NewProcessTemplate {
  @Field()
  name: string

  @Field()
  description: string

  @Field()
  model: string

  @Field()
  visibility: 'private' | 'public'

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

@InputType()
export class ProcessTemplatePatch {
  @Field(type => ID, { nullable: true })
  id?: string

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

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

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

  @Field({ nullable: true })
  visibility?: 'private' | 'public'

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

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

@ObjectType()
export class ProcessTemplateList {
  @Field(type => [ProcessTemplate])
  items: ProcessTemplate[]

  @Field(type => Int)
  total: number
}
