import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'
import { DesignPackage } from './design-package'

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

  @Field()
  description: string

  @Field()
  model: string

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

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

@InputType()
export class DesignPackagePatch {
  @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 DesignPackageList {
  @Field(type => [DesignPackage])
  items: DesignPackage[]

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