ProductVariant.ts 413 B

123456789101112131415161718
  1. import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
  2. import { Product } from './Product';
  3. @Entity()
  4. export class ProductVariant {
  5. @PrimaryGeneratedColumn() id: number;
  6. @Column() sku: string;
  7. @Column() name: string;
  8. @Column() image: string;
  9. @Column() price: string;
  10. @ManyToOne(type => Product, product => product.variants)
  11. product: Product[];
  12. }