import { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'

import { Process } from './process'

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

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

  @Field()
  model: string

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

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

@InputType()
export class ProcessPatch {
  @Field({ nullable: true })
  name: string

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

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

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

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

@ObjectType()
export class ProcessList {
  @Field(type => [Process])
  items: Process[]

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