Files
medusa-store/packages/modules/customer/src/models/customer-group-customer.ts
2024-12-11 14:37:27 +05:30

18 lines
533 B
TypeScript

import { model } from "@medusajs/framework/utils"
import Customer from "./customer"
import CustomerGroup from "./customer-group"
const CustomerGroupCustomer = model.define("CustomerGroupCustomer", {
id: model.id({ prefix: "cusgc" }).primaryKey(),
created_by: model.text().nullable(),
metadata: model.json().nullable(),
customer: model.belongsTo(() => Customer, {
mappedBy: "groups",
}),
customer_group: model.belongsTo(() => CustomerGroup, {
mappedBy: "customers",
}),
})
export default CustomerGroupCustomer