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

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

    @Field(() => Time, { nullable: false })
    time: Time

    @Field(() => Int, { nullable: false })
    duration: number

    @Field(() => Team, { nullable: true })
    team?: Team

    @Field(() => Result, { nullable: true })
    result?: Result
}

@InputType()
export class ITimeslot {
    @Field(() => Time, { nullable: false })
    time: Time

    @Field(() => Int, { nullable: false })
    duration: number
}