import { Field, InterfaceType, ObjectType } from 'type-graphql'; import { Column } from 'typeorm'; import { AbstractProductData } from '@/entities/abstract'; import { RetailerProductSource } from '@/entities/types'; import { RetailerURLScalar } from '../types'; @ObjectType({ implements: AbstractProductData.objectTypeImplements, }) @InterfaceType({ implements: AbstractProductData.objectTypeImplements, }) export default class AbstractRetailerProductData extends AbstractProductData { // eslint-disable-next-line @typescript-eslint/ban-types static objectTypeImplements: Function[] = [ ...AbstractProductData.objectTypeImplements, AbstractRetailerProductData, ]; @Column({ type: 'text', nullable: false, }) @Field(() => String, { nullable: false }) retailer!: string; @Column({ type: 'text', nullable: true, }) @Field(() => String, { nullable: true }) source?: RetailerProductSource; @Column({ type: 'text', nullable: false, }) @Field(() => RetailerURLScalar, { nullable: false, }) url!: string; }