product-bundle-item.entity.ts 726 B

1234567891011121314151617181920212223242526272829
  1. import { DeepPartial } from '@vendure/common/lib/shared-types';
  2. import { EntityId, ID, Money, ProductVariant, VendureEntity } from '@vendure/core';
  3. import { Column, Entity, ManyToOne } from 'typeorm';
  4. import { ProductBundle } from './product-bundle.entity';
  5. @Entity()
  6. export class ProductBundleItem extends VendureEntity {
  7. constructor(input?: DeepPartial<ProductBundleItem>) {
  8. super(input);
  9. }
  10. @ManyToOne(type => ProductVariant)
  11. productVariant: ProductVariant;
  12. @EntityId()
  13. productVariantId: ID;
  14. @ManyToOne(type => ProductBundle, bundle => bundle.items)
  15. bundle: ProductBundle;
  16. @EntityId()
  17. bundleId: ID;
  18. @Money()
  19. price: number;
  20. @Column()
  21. quantity: number;
  22. }