import { Field, Int, ObjectType } from "@nestjs/graphql";
import { Build, BuildIban } from "@/models/build.model";
import { BuildArea } from "@/models/build-area.model";
import { Company } from "@/models/company.model";
import { Person } from "@/models/person.model";

@ObjectType()
export class ListBuildResponse {

    @Field(() => [Build], { nullable: true })
    data?: Build[];

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

}

@ObjectType()
export class ListPartialAreaResponse {

    @Field(() => [BuildArea], { nullable: true })
    data?: BuildArea[];

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

}

@ObjectType()
export class ListPartialIbanResponse {

    @Field(() => [BuildIban], { nullable: true })
    data?: BuildIban[];

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

}

@ObjectType()
class ResponsibleCompanyPerson {

    @Field(() => Company, { nullable: true })
    company?: Company;

    @Field(() => Person, { nullable: true })
    person?: Person;
}

@ObjectType()
export class ListPartialCompanyResponse {

    @Field(() => [ResponsibleCompanyPerson])
    data: ResponsibleCompanyPerson[];

    @Field(() => Int)
    totalCount: number;
}