feat: Cart SalesChannel link + clean-up (#6418)

This commit is contained in:
Oli Juhl
2024-02-16 20:48:56 +01:00
committed by GitHub
parent 1df14de183
commit 1ba35b02dd
29 changed files with 276 additions and 919 deletions
@@ -1,29 +0,0 @@
import { BeforeInsert, Column, Index, PrimaryColumn } from "typeorm"
import { MedusaV2Flag, SalesChannelFeatureFlag } from "@medusajs/utils"
import { generateEntityId } from "../utils"
import { SoftDeletableEntity } from "../interfaces"
import { FeatureFlagEntity } from "../utils/feature-flag-decorators"
@FeatureFlagEntity([MedusaV2Flag.key, SalesChannelFeatureFlag.key])
export class CartSalesChannel extends SoftDeletableEntity {
@Column()
id: string
@Index("cart_sales_channel_cart_id_unique", {
unique: true,
})
@PrimaryColumn()
cart_id: string
@PrimaryColumn()
sales_channel_id: string
/**
* @apiIgnore
*/
@BeforeInsert()
private beforeInsert(): void {
this.id = generateEntityId(this.id, "cartsc")
}
}