init data-connector

This commit is contained in:
Marcel Arndt
2025-04-10 17:32:06 +02:00
parent 52c1a14609
commit 46631db5b2
105 changed files with 8081 additions and 338 deletions
@@ -0,0 +1,35 @@
import { Args, Parent, Query, ResolveField, Resolver } from '@nestjs/graphql';
import { TicketObjectType } from '../app-ticket-system/ticket.object-type';
import {
AccountingTourArgs,
TourStateMetaObjectType,
} from './accounting-arg.types';
import { AccountingState } from './accounting-state';
import { AccountingValidationService } from './accounting-validation.service';
import { PaginatedTourObjectType } from './accounting.object-type';
import { TourObjectType } from './tour.object-type';
@Resolver(() => TourObjectType)
export class AccountingValidationResolver {
constructor(private readonly service: AccountingValidationService) {}
@Query(() => PaginatedTourObjectType)
accountingTours(
@Args() { state, filters, cursor, take }: AccountingTourArgs,
) {
return this.service.paginateToursByState(state, filters, take, cursor);
}
@Query(() => TourStateMetaObjectType)
accountingStateMeta(
@Args('state', { type: () => AccountingState })
accountingState: AccountingState,
) {
return this.service.getAccountingStateMeta(accountingState);
}
@ResolveField(() => TicketObjectType, { nullable: true })
ticket(@Parent() tour: TourObjectType) {
return this.service.findTicketByTicketId(tour.ticketId);
}
}