import {Field, Float, InputType, Int, ObjectType} from '@nestjs/graphql';
import { UUID } from '../../global/scalars/UUID';

@ObjectType()
export class Result {
    @Field(() => Int,{ nullable: false })
    bonus: number

    @Field(() => Float,{ nullable: false })
    runtime: number

    @Field(() => Float,{ nullable: false })
    calctime: number

    @Field(() => [ApparatusResult], { nullable: false })
    results: ApparatusResult[]
}

@InputType()
export class IResult {
    @Field(() => Int,{ nullable: false })
    bonus: number

    @Field(() => Float,{ nullable: false })
    runtime: number

    @Field(() => Float,{ nullable: false })
    calctime: number

    @Field(() => [IApparatusResult], { nullable: false })
    results: IApparatusResult[]
}

@ObjectType()
export class ApparatusResult {
    @Field(() => UUID,{ nullable: false })
    _id: number

    @Field(() => Boolean,{ nullable: false })
    bonus: boolean

    @Field(() => Boolean,{ nullable: false })
    teile: boolean

    @Field(() => Boolean, { nullable: true })
    bonusteil?: boolean

    @Field(() => Int, { nullable: true })
    fehler?: number

    @Field(() => Boolean,{ nullable: true })
    wechsel?: boolean
}

@InputType()
export class IApparatusResult {
    @Field(() => UUID,{ nullable: false })
    _id: number

    @Field(() => Boolean,{ nullable: false })
    bonus: boolean

    @Field(() => Boolean,{ nullable: false })
    teile: boolean

    @Field(() => Boolean, { nullable: true })
    bonusteil?: boolean

    @Field(() => Int, { nullable: true })
    fehler?: number

    @Field(() => Boolean,{ nullable: true })
    wechsel?: boolean
}