async findAll(queryParams: IItemQueryParams): Promise<ItemEntity[]> {
        const query: FindManyOptions<ItemEntity> = {
            where: {
                status: ItemStatus.REMOVED,
            },
            relations: ['category', 'events', 'location'],
            order: { cost: queryParams.sortByCost },
        };

        if (queryParams.eventId) {
            query.where['events.id'] = queryParams.eventId;
        }

        if (queryParams.regoNumber) {
            query.where.regoNumber = queryParams.regoNumber;
        }

        if (queryParams.name) {
            query.where.name = queryParams.name;
        }

        if (queryParams.charityList) {
            query.where.charityList = queryParams.charityList;
        }

        if (queryParams.notes) {
            query.where.notes = queryParams.notes;
        }

        if (queryParams.provenance) {
            query.where.provenance = queryParams.provenance;
        }

        if (queryParams.category) {
            query.where['category.name'] = queryParams.category;
        }

        if (queryParams.subcategory) {
            query.where['category.subCategories'] = queryParams.subcategory;
        }

        if (queryParams.status) {
            query.where.status = queryParams.status;
        }

        if (queryParams.costFrom) {
            query.where.cost = query.where.cost || {};
            query.where.cost.$gte = queryParams.costFrom;
        }

        if (queryParams.costTo) {
            query.where.cost = query.where.cost || {};
            query.where.cost.$lte = queryParams.costTo;
        }

        if (queryParams.locationId) {
            query.where['location.id'] = queryParams.locationId;
        }

        return this.itemRepository.find(query);
    } i keep getting the following errors when i run the above code            ^
TSError: ⨯ Unable to compile TypeScript:
src/modules/items/item.service.ts:166:25 - error TS2339: Property 'regoNumber' does not exist on type 'FindOptionsWhere<ItemEntity> | FindOptionsWhere<ItemEntity>[]'.
  Property 'regoNumber' does not exist on type 'FindOptionsWhere<ItemEntity>[]'.

166             query.where.regoNumber = queryParams.regoNumber;
                            ~~~~~~~~~~
src/modules/items/item.service.ts:170:25 - error TS2339: Property 'name' does not exist on type 'FindOptionsWhere<ItemEntity> | FindOptionsWhere<ItemEntity>[]'.
  Property 'name' does not exist on type 'FindOptionsWhere<ItemEntity>[]'.

170             query.where.name = queryParams.name;
                            ~~~~
src/modules/items/item.service.ts:174:25 - error TS2339: Property 'charityList' does not exist on type 'FindOptionsWhere<ItemEntity> | FindOptionsWhere<ItemEntity>[]'.
  Property 'charityList' does not exist on type 'FindOptionsWhere<ItemEntity>[]'.

174             query.where.charityList = queryParams.charityList;
                            ~~~~~~~~~~~
src/modules/items/item.service.ts:178:25 - error TS2339: Property 'notes' does not exist on type 'FindOptionsWhere<ItemEntity> | FindOptionsWhere<ItemEntity>[]'.
  Property 'notes' does not exist on type 'FindOptionsWhere<ItemEntity>[]'.

178             query.where.notes = queryParams.notes;
                            ~~~~~
src/modules/items/item.service.ts:182:25 - error TS2339: Property 'provenance' does not exist on type 'FindOptionsWhere<ItemEntity> | FindOptionsWhere<ItemEntity>[]'.
  Property 'provenance' does not exist on type 'FindOptionsWhere<ItemEntity>[]'.

182             query.where.provenance = queryParams.provenance;
                            ~~~~~~~~~~
src/modules/items/item.service.ts:194:25 - error TS2339: Property 'status' does not exist on type 'FindOptionsWhere<ItemEntity> | FindOptionsWhere<ItemEntity>[]'.
  Property 'status' does not exist on type 'FindOptionsWhere<ItemEntity>[]'.

194             query.where.status = queryParams.status;
                            ~~~~~~
src/modules/items/item.service.ts:198:25 - error TS2339: Property 'cost' does not exist on type 'FindOptionsWhere<ItemEntity> | FindOptionsWhere<ItemEntity>[]'.
  Property 'cost' does not exist on type 'FindOptionsWhere<ItemEntity>[]'.

198             query.where.cost = query.where.cost || {};
                            ~~~~
src/modules/items/item.service.ts:198:44 - error TS2339: Property 'cost' does not exist on type 'FindOptionsWhere<ItemEntity> | FindOptionsWhere<ItemEntity>[]'.
  Property 'cost' does not exist on type 'FindOptionsWhere<ItemEntity>[]'.

198             query.where.cost = query.where.cost || {};
                                               ~~~~
src/modules/items/item.service.ts:199:25 - error TS2339: Property 'cost' does not exist on type 'FindOptionsWhere<ItemEntity> | FindOptionsWhere<ItemEntity>[]'.
  Property 'cost' does not exist on type 'FindOptionsWhere<ItemEntity>[]'.

199             query.where.cost.$gte = queryParams.costFrom;
                            ~~~~
src/modules/items/item.service.ts:203:25 - error TS2339: Property 'cost' does not exist on type 'FindOptionsWhere<ItemEntity> | FindOptionsWhere<ItemEntity>[]'.
  Property 'cost' does not exist on type 'FindOptionsWhere<ItemEntity>[]'.

203             query.where.cost = query.where.cost || {};
                            ~~~~
src/modules/items/item.service.ts:203:44 - error TS2339: Property 'cost' does not exist on type 'FindOptionsWhere<ItemEntity> | FindOptionsWhere<ItemEntity>[]'.
  Property 'cost' does not exist on type 'FindOptionsWhere<ItemEntity>[]'.

203             query.where.cost = query.where.cost || {};
                                               ~~~~
src/modules/items/item.service.ts:204:25 - error TS2339: Property 'cost' does not exist on type 'FindOptionsWhere<ItemEntity> | FindOptionsWhere<ItemEntity>[]'.
  Property 'cost' does not exist on type 'FindOptionsWhere<ItemEntity>[]'.

204             query.where.cost.$lte = queryParams.costTo; here is me interface import { ItemStatus } from '../entities/item.entity';

export interface IItemQueryParams {
    eventId?: number;
    regoNumber?: string;
    name?: string;
    charityList?: string;
    notes?: string;
    provenance?: string;
    category?: string;
    subcategory?: string;
    status?: ItemStatus;
    costFrom?: number;
    costTo?: number;
    locationId?: number;
    sortByCost?: 'ASC' | 'DESC';
}
and entity import { Column, Entity, JoinTable, ManyToMany, ManyToOne } from 'typeorm';

import { AbstractIdEntity } from '../../../common/abstract.id.entity';
import { CategoryEntity } from '../../categories/entities/category.entity';
import { EventEntity } from '../../event/entities/event.entity';
import { LocationEntity } from '../../location/entities/location.entity';
import { ItemDto } from '../dto/item.dto';

export enum ItemStatus {
    NEW = 'NEW',
    ALLOCATED = 'ALLOCATED',
    SENT_TO_EVENT = 'SENT_TO_EVENT',
    SOLD = 'SOLD',
    SENT_TO_CLIENT = 'SENT_TO_CLIENT',
    DAMAGED = 'DAMAGED',
    REMOVED = 'REMOVED',
}

@Entity({ name: 'item' })
export class ItemEntity extends AbstractIdEntity<ItemDto> {
    @Column({ nullable: false })
    name: string;

    @ManyToOne(() => LocationEntity, { nullable: false })
    location: LocationEntity;

    @ManyToOne(() => CategoryEntity, { nullable: false })
    category: CategoryEntity;

    @Column({ nullable: true })
    charityList: string;

    @Column({ nullable: true })
    cost: number;

    @Column({ nullable: true })
    reserveCost: number;

    @Column({ nullable: true })
    framingCost: number;

    @Column({ nullable: true })
    provenance: string;

    @Column({ nullable: true })
    wrc: number;

    @Column({ nullable: true })
    regoNumber: string;

    @Column({ nullable: true })
    notes: string;

    @Column({ nullable: false, default: 'NEW' })
    status: ItemStatus;

    @ManyToMany(() => EventEntity, (event) => event.items, {
        nullable: true,
        cascade: true,
    })
    @JoinTable({
        name: 'item_events',
        joinColumn: { name: 'item_id', referencedColumnName: 'id' },
        inverseJoinColumn: { name: 'event_id', referencedColumnName: 'id' },
    })
    events: EventEntity[];

    @Column({ nullable: true })
    eventId: number;

    dtoClass = ItemDto;
}