|
1
|
import { model } from "@medusajs/framework/utils" |
|
2
|
import Product from "./product" |
|
3
|
import ProductOption from "./product-option" |
|
4
|
import ProductOptionValue from "./product-option-value" |
|
5
|
import ProductProductOptionValue from "./product-product-option-value" |
|
6
|
|
|
7
|
/** |
|
8
|
* @since 2.16.0 |
|
9
|
*/ |
|
10
|
const ProductProductOption = model.define("ProductProductOption", { |
|
11
|
id: model.id({ prefix: "prodopt" }).primaryKey(), |
|
12
|
product: model.belongsTo(() => Product, { |
|
13
|
mappedBy: "options", |
|
14
|
}), |
|
15
|
product_option: model.belongsTo(() => ProductOption, { |
|
16
|
mappedBy: "products", |
|
17
|
}), |
|
18
|
values: model.manyToMany(() => ProductOptionValue, { |
|
19
|
pivotEntity: () => ProductProductOptionValue, |
|
20
|
}), |
|
21
|
}) |
|
22
|
|
|
23
|
export default ProductProductOption |