feat(medusa): Continue create product workflow changes (#4473)

This commit is contained in:
Adrien de Peretti
2023-07-24 13:30:24 +02:00
committed by GitHub
parent edf93d972d
commit d2a8cf0378
103 changed files with 1859 additions and 524 deletions
@@ -32,7 +32,7 @@ class ProductOptionValue {
@Property({ columnType: "text" })
value: string
@Property({ persist: false })
@Property({ columnType: "text", nullable: true })
option_id!: string
@ManyToOne(() => ProductOption, {
@@ -41,7 +41,7 @@ class ProductOptionValue {
})
option: ProductOption
@Property({ persist: false })
@Property({ columnType: "text", nullable: true })
variant_id!: string
@ManyToOne(() => ProductVariant, {
@@ -29,7 +29,7 @@ class ProductOption {
@Property({ columnType: "text" })
title: string
@Property({ persist: false })
@Property({ columnType: "text", nullable: true })
product_id!: string
@ManyToOne(() => Product, {
@@ -105,7 +105,7 @@ class ProductVariant {
@Property({ columnType: "numeric", nullable: true, default: 0 })
variant_rank?: number | null
@Property({ persist: false })
@Property({ columnType: "text", nullable: true })
product_id!: string
@Property({ onCreate: () => new Date(), columnType: "timestamptz" })
+4 -2
View File
@@ -100,7 +100,7 @@ class Product {
@Property({ columnType: "text", nullable: true })
material?: string | null
@Property({ persist: false })
@Property({ columnType: "text", nullable: true })
collection_id!: string
@ManyToOne(() => ProductCollection, {
@@ -109,7 +109,7 @@ class Product {
})
collection!: ProductCollection
@Property({ persist: false })
@Property({ columnType: "text", nullable: true })
type_id!: string
@ManyToOne(() => ProductType, {
@@ -132,6 +132,8 @@ class Product {
pivotTable: "product_images",
index: "IDX_product_image_id",
cascade: ["soft-remove"] as any,
joinColumn: "product_id",
inverseJoinColumn: "image_id",
})
images = new Collection<ProductImage>(this)