import { DB_SCHEMA } from 'src/utils';
import {
  Column,
  Entity,
  Index,
  JoinColumn,
  ManyToOne,
  PrimaryGeneratedColumn,
} from 'typeorm';
import { MasteragentEntity } from './Masteragent.entity';

@Index('associateId', ['masteragentId', 'masteragentProductIds'], {})
@Entity('masteragent_productids', { schema: DB_SCHEMA })
export class MasteragentProductidsEntity {
  @PrimaryGeneratedColumn({ type: 'smallint', name: 'id' })
  id: number;

  @Column('smallint', { name: 'masteragentId' })
  masteragentId: number;

  @Column('smallint', { name: 'masteragentProductIds' })
  masteragentProductIds: number;
  //comment
  @ManyToOne(() => MasteragentEntity, (agent) => agent.products)
  @JoinColumn({ name: 'masteragentId' })
  master_agent: MasteragentEntity;
}
