import { Field, Float, ObjectType, registerEnumType } from '@nestjs/graphql';
import { AccountingState } from './accounting-state';
import { Paginated } from 'src/core/base/pagination.input';
import { TourObjectType } from './tour.object-type';
import { CostTypeVariant } from '@prisma/client';

registerEnumType(AccountingState, {
  name: 'AccountingState',
});

@ObjectType('PaginatedTour')
export class PaginatedTourObjectType extends Paginated(TourObjectType) {}

@ObjectType('ServicePosition')
export class ServicePositionObjectType {
  @Field()
  variant: CostTypeVariant;
  @Field()
  description: string;
  @Field(() => Float)
  value: number;
}

@ObjectType('TourCostBreakdown')
export class TourCostBreakdownObjectType {
  @Field()
  tariffDescription: string;
  @Field()
  tariffValidityPeriod: string;

  @Field(() => [ServicePositionObjectType])
  servicePositions: ServicePositionObjectType[];
}
