chore(cart): Make all cart entities soft-deletable (#6475)

This commit is contained in:
Oli Juhl
2024-02-23 08:59:02 +01:00
committed by GitHub
parent 3fc2aea752
commit d9636f4631
13 changed files with 763 additions and 214 deletions

View File

@@ -144,11 +144,31 @@
"length": 6, "length": 6,
"default": "now()", "default": "now()",
"mappedType": "datetime" "mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
} }
}, },
"name": "cart_address", "name": "cart_address",
"schema": "public", "schema": "public",
"indexes": [ "indexes": [
{
"keyName": "IDX_cart_address_deleted_at",
"columnNames": [
"deleted_at"
],
"composite": false,
"primary": false,
"unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_cart_address_deleted_at\" ON \"cart_address\" (deleted_at) WHERE deleted_at IS NOT NULL"
},
{ {
"keyName": "cart_address_pkey", "keyName": "cart_address_pkey",
"columnNames": [ "columnNames": [
@@ -283,19 +303,19 @@
"indexes": [ "indexes": [
{ {
"columnNames": [ "columnNames": [
"customer_id" "sales_channel_id"
], ],
"composite": false, "composite": false,
"keyName": "IDX_cart_customer_id", "keyName": "IDX_cart_sales_channel_id",
"primary": false, "primary": false,
"unique": false "unique": false
}, },
{ {
"columnNames": [ "columnNames": [
"shipping_address_id" "currency_code"
], ],
"composite": false, "composite": false,
"keyName": "IDX_cart_shipping_address_id", "keyName": "IDX_cart_curency_code",
"primary": false, "primary": false,
"unique": false "unique": false
}, },
@@ -308,6 +328,66 @@
"primary": false, "primary": false,
"unique": false "unique": false
}, },
{
"keyName": "IDX_cart_region_id",
"columnNames": [
"region_id"
],
"composite": false,
"primary": false,
"unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_cart_region_id\" ON \"cart\" (region_id) WHERE deleted_at IS NULL AND region_id IS NOT NULL"
},
{
"keyName": "IDX_cart_customer_id",
"columnNames": [
"customer_id"
],
"composite": false,
"primary": false,
"unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_cart_customer_id\" ON \"cart\" (customer_id) WHERE deleted_at IS NULL AND customer_id IS NOT NULL"
},
{
"keyName": "IDX_cart_sales_channel_id",
"columnNames": [
"sales_channel_id"
],
"composite": false,
"primary": false,
"unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_cart_sales_channel_id\" ON \"cart\" (sales_channel_id) WHERE deleted_at IS NULL AND sales_channel_id IS NOT NULL"
},
{
"keyName": "IDX_cart_shipping_address_id",
"columnNames": [
"shipping_address_id"
],
"composite": false,
"primary": false,
"unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_cart_shipping_address_id\" ON \"cart\" (shipping_address_id) WHERE deleted_at IS NULL AND shipping_address_id IS NOT NULL"
},
{
"keyName": "IDX_cart_billing_address_id",
"columnNames": [
"billing_address_id"
],
"composite": false,
"primary": false,
"unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_cart_billing_address_id\" ON \"cart\" (billing_address_id) WHERE deleted_at IS NULL AND billing_address_id IS NOT NULL"
},
{
"keyName": "IDX_cart_deleted_at",
"columnNames": [
"deleted_at"
],
"composite": false,
"primary": false,
"unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_cart_deleted_at\" ON \"cart\" (deleted_at) WHERE deleted_at IS NOT NULL"
},
{ {
"keyName": "cart_pkey", "keyName": "cart_pkey",
"columnNames": [ "columnNames": [
@@ -551,6 +631,15 @@
"nullable": true, "nullable": true,
"mappedType": "decimal" "mappedType": "decimal"
}, },
"raw_compare_at_unit_price": {
"name": "raw_compare_at_unit_price",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
},
"unit_price": { "unit_price": {
"name": "unit_price", "name": "unit_price",
"type": "numeric", "type": "numeric",
@@ -560,6 +649,15 @@
"nullable": false, "nullable": false,
"mappedType": "decimal" "mappedType": "decimal"
}, },
"raw_unit_price": {
"name": "raw_unit_price",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "json"
},
"created_at": { "created_at": {
"name": "created_at", "name": "created_at",
"type": "timestamptz", "type": "timestamptz",
@@ -581,28 +679,60 @@
"length": 6, "length": 6,
"default": "now()", "default": "now()",
"mappedType": "datetime" "mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
} }
}, },
"name": "cart_line_item", "name": "cart_line_item",
"schema": "public", "schema": "public",
"indexes": [ "indexes": [
{ {
"keyName": "IDX_line_item_cart_id",
"columnNames": [ "columnNames": [
"cart_id" "cart_id"
], ],
"composite": false, "composite": false,
"keyName": "IDX_line_item_cart_id",
"primary": false, "primary": false,
"unique": false "unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_line_item_cart_id\" ON \"cart_line_item\" (cart_id) WHERE deleted_at IS NULL"
}, },
{ {
"keyName": "IDX_line_item_variant_id",
"columnNames": [ "columnNames": [
"variant_id" "variant_id"
], ],
"composite": false, "composite": false,
"keyName": "IDX_line_item_variant_id",
"primary": false, "primary": false,
"unique": false "unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_line_item_variant_id\" ON \"cart_line_item\" (variant_id) WHERE deleted_at IS NULL AND variant_id IS NOT NULL"
},
{
"keyName": "IDX_line_item_product_id",
"columnNames": [
"product_id"
],
"composite": false,
"primary": false,
"unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_line_item_product_id\" ON \"cart_line_item\" (product_id) WHERE deleted_at IS NULL AND product_id IS NOT NULL"
},
{
"keyName": "IDX_cart_line_item_deleted_at",
"columnNames": [
"deleted_at"
],
"composite": false,
"primary": false,
"unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_cart_line_item_deleted_at\" ON \"cart_line_item\" (deleted_at) WHERE deleted_at IS NOT NULL"
}, },
{ {
"keyName": "cart_line_item_pkey", "keyName": "cart_line_item_pkey",
@@ -614,14 +744,7 @@
"unique": true "unique": true
} }
], ],
"checks": [ "checks": [],
{
"name": "cart_line_item_unit_price_check",
"expression": "unit_price >= 0",
"definition": "check ((unit_price >= 0))",
"columnName": "unit_price"
}
],
"foreignKeys": { "foreignKeys": {
"cart_line_item_cart_id_foreign": { "cart_line_item_cart_id_foreign": {
"constraintName": "cart_line_item_cart_id_foreign", "constraintName": "cart_line_item_cart_id_foreign",
@@ -633,7 +756,6 @@
"id" "id"
], ],
"referencedTableName": "public.cart", "referencedTableName": "public.cart",
"deleteRule": "cascade",
"updateRule": "cascade" "updateRule": "cascade"
} }
} }
@@ -658,15 +780,6 @@
"nullable": true, "nullable": true,
"mappedType": "text" "mappedType": "text"
}, },
"promotion_id": {
"name": "promotion_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"code": { "code": {
"name": "code", "name": "code",
"type": "text", "type": "text",
@@ -722,21 +835,61 @@
"unsigned": false, "unsigned": false,
"autoincrement": false, "autoincrement": false,
"primary": false, "primary": false,
"nullable": false,
"mappedType": "text"
},
"promotion_id": {
"name": "promotion_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true, "nullable": true,
"mappedType": "text" "mappedType": "text"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
} }
}, },
"name": "cart_line_item_adjustment", "name": "cart_line_item_adjustment",
"schema": "public", "schema": "public",
"indexes": [ "indexes": [
{ {
"keyName": "IDX_adjustment_item_id",
"columnNames": [ "columnNames": [
"item_id" "item_id"
], ],
"composite": false, "composite": false,
"keyName": "IDX_adjustment_item_id",
"primary": false, "primary": false,
"unique": false "unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_adjustment_item_id\" ON \"cart_line_item_adjustment\" (item_id) WHERE deleted_at IS NULL"
},
{
"keyName": "IDX_line_item_adjustment_promotion_id",
"columnNames": [
"promotion_id"
],
"composite": false,
"primary": false,
"unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_line_item_adjustment_promotion_id\" ON \"cart_line_item_adjustment\" (promotion_id) WHERE deleted_at IS NULL and promotion_id IS NOT NULL"
},
{
"keyName": "IDX_cart_line_item_adjustment_deleted_at",
"columnNames": [
"deleted_at"
],
"composite": false,
"primary": false,
"unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_cart_line_item_adjustment_deleted_at\" ON \"cart_line_item_adjustment\" (deleted_at) WHERE deleted_at IS NOT NULL"
}, },
{ {
"keyName": "cart_line_item_adjustment_pkey", "keyName": "cart_line_item_adjustment_pkey",
@@ -755,21 +908,7 @@
"definition": "check ((amount >= 0))" "definition": "check ((amount >= 0))"
} }
], ],
"foreignKeys": { "foreignKeys": {}
"cart_line_item_adjustment_item_id_foreign": {
"constraintName": "cart_line_item_adjustment_item_id_foreign",
"columnNames": [
"item_id"
],
"localTableName": "public.cart_line_item_adjustment",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.cart_line_item",
"deleteRule": "cascade",
"updateRule": "cascade"
}
}
}, },
{ {
"columns": { "columns": {
@@ -791,15 +930,6 @@
"nullable": true, "nullable": true,
"mappedType": "text" "mappedType": "text"
}, },
"tax_rate_id": {
"name": "tax_rate_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"code": { "code": {
"name": "code", "name": "code",
"type": "text", "type": "text",
@@ -855,21 +985,61 @@
"unsigned": false, "unsigned": false,
"autoincrement": false, "autoincrement": false,
"primary": false, "primary": false,
"nullable": false,
"mappedType": "text"
},
"tax_rate_id": {
"name": "tax_rate_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true, "nullable": true,
"mappedType": "text" "mappedType": "text"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
} }
}, },
"name": "cart_line_item_tax_line", "name": "cart_line_item_tax_line",
"schema": "public", "schema": "public",
"indexes": [ "indexes": [
{ {
"keyName": "IDX_tax_line_item_id",
"columnNames": [ "columnNames": [
"item_id" "item_id"
], ],
"composite": false, "composite": false,
"keyName": "IDX_tax_line_item_id",
"primary": false, "primary": false,
"unique": false "unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_tax_line_item_id\" ON \"cart_line_item_tax_line\" (item_id) WHERE deleted_at IS NULL"
},
{
"keyName": "IDX_line_item_tax_line_tax_rate_id",
"columnNames": [
"tax_rate_id"
],
"composite": false,
"primary": false,
"unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_line_item_tax_line_tax_rate_id\" ON \"cart_line_item_tax_line\" (tax_rate_id) WHERE deleted_at IS NULL AND tax_rate_id IS NOT NULL"
},
{
"keyName": "IDX_cart_line_item_tax_line_deleted_at",
"columnNames": [
"deleted_at"
],
"composite": false,
"primary": false,
"unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_cart_line_item_tax_line_deleted_at\" ON \"cart_line_item_tax_line\" (deleted_at) WHERE deleted_at IS NOT NULL"
}, },
{ {
"keyName": "cart_line_item_tax_line_pkey", "keyName": "cart_line_item_tax_line_pkey",
@@ -882,21 +1052,7 @@
} }
], ],
"checks": [], "checks": [],
"foreignKeys": { "foreignKeys": {}
"cart_line_item_tax_line_item_id_foreign": {
"constraintName": "cart_line_item_tax_line_item_id_foreign",
"columnNames": [
"item_id"
],
"localTableName": "public.cart_line_item_tax_line",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.cart_line_item",
"deleteRule": "cascade",
"updateRule": "cascade"
}
}
}, },
{ {
"columns": { "columns": {
@@ -945,6 +1101,15 @@
"nullable": false, "nullable": false,
"mappedType": "decimal" "mappedType": "decimal"
}, },
"raw_amount": {
"name": "raw_amount",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "json"
},
"is_tax_inclusive": { "is_tax_inclusive": {
"name": "is_tax_inclusive", "name": "is_tax_inclusive",
"type": "boolean", "type": "boolean",
@@ -1003,19 +1168,50 @@
"length": 6, "length": 6,
"default": "now()", "default": "now()",
"mappedType": "datetime" "mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
} }
}, },
"name": "cart_shipping_method", "name": "cart_shipping_method",
"schema": "public", "schema": "public",
"indexes": [ "indexes": [
{ {
"keyName": "IDX_shipping_method_cart_id",
"columnNames": [ "columnNames": [
"cart_id" "cart_id"
], ],
"composite": false, "composite": false,
"keyName": "IDX_shipping_method_cart_id",
"primary": false, "primary": false,
"unique": false "unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_shipping_method_cart_id\" ON \"cart_shipping_method\" (cart_id) WHERE deleted_at IS NULL"
},
{
"keyName": "IDX_shipping_method_option_id",
"columnNames": [
"shipping_option_id"
],
"composite": false,
"primary": false,
"unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_shipping_method_option_id\" ON \"cart_shipping_method\" (shipping_option_id) WHERE deleted_at IS NULL AND shipping_option_id IS NOT NULL"
},
{
"keyName": "IDX_cart_shipping_method_deleted_at",
"columnNames": [
"deleted_at"
],
"composite": false,
"primary": false,
"unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_cart_shipping_method_deleted_at\" ON \"cart_shipping_method\" (deleted_at) WHERE deleted_at IS NOT NULL"
}, },
{ {
"keyName": "cart_shipping_method_pkey", "keyName": "cart_shipping_method_pkey",
@@ -1045,7 +1241,6 @@
"id" "id"
], ],
"referencedTableName": "public.cart", "referencedTableName": "public.cart",
"deleteRule": "cascade",
"updateRule": "cascade" "updateRule": "cascade"
} }
} }
@@ -1070,15 +1265,6 @@
"nullable": true, "nullable": true,
"mappedType": "text" "mappedType": "text"
}, },
"promotion_id": {
"name": "promotion_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"code": { "code": {
"name": "code", "name": "code",
"type": "text", "type": "text",
@@ -1134,21 +1320,61 @@
"unsigned": false, "unsigned": false,
"autoincrement": false, "autoincrement": false,
"primary": false, "primary": false,
"nullable": false,
"mappedType": "text"
},
"promotion_id": {
"name": "promotion_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true, "nullable": true,
"mappedType": "text" "mappedType": "text"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
} }
}, },
"name": "cart_shipping_method_adjustment", "name": "cart_shipping_method_adjustment",
"schema": "public", "schema": "public",
"indexes": [ "indexes": [
{ {
"keyName": "IDX_adjustment_shipping_method_id",
"columnNames": [ "columnNames": [
"shipping_method_id" "shipping_method_id"
], ],
"composite": false, "composite": false,
"keyName": "IDX_adjustment_shipping_method_id",
"primary": false, "primary": false,
"unique": false "unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_adjustment_shipping_method_id\" ON \"cart_shipping_method_adjustment\" (shipping_method_id) WHERE deleted_at IS NULL"
},
{
"keyName": "IDX_shipping_method_adjustment_promotion_id",
"columnNames": [
"promotion_id"
],
"composite": false,
"primary": false,
"unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_shipping_method_adjustment_promotion_id\" ON \"cart_shipping_method_adjustment\" (promotion_id) WHERE deleted_at IS NULL and promotion_id IS NOT NULL"
},
{
"keyName": "IDX_cart_shipping_method_adjustment_deleted_at",
"columnNames": [
"deleted_at"
],
"composite": false,
"primary": false,
"unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_cart_shipping_method_adjustment_deleted_at\" ON \"cart_shipping_method_adjustment\" (deleted_at) WHERE deleted_at IS NOT NULL"
}, },
{ {
"keyName": "cart_shipping_method_adjustment_pkey", "keyName": "cart_shipping_method_adjustment_pkey",
@@ -1161,21 +1387,7 @@
} }
], ],
"checks": [], "checks": [],
"foreignKeys": { "foreignKeys": {}
"cart_shipping_method_adjustment_shipping_method_id_foreign": {
"constraintName": "cart_shipping_method_adjustment_shipping_method_id_foreign",
"columnNames": [
"shipping_method_id"
],
"localTableName": "public.cart_shipping_method_adjustment",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.cart_shipping_method",
"deleteRule": "cascade",
"updateRule": "cascade"
}
}
}, },
{ {
"columns": { "columns": {
@@ -1197,15 +1409,6 @@
"nullable": true, "nullable": true,
"mappedType": "text" "mappedType": "text"
}, },
"tax_rate_id": {
"name": "tax_rate_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"code": { "code": {
"name": "code", "name": "code",
"type": "text", "type": "text",
@@ -1261,21 +1464,61 @@
"unsigned": false, "unsigned": false,
"autoincrement": false, "autoincrement": false,
"primary": false, "primary": false,
"nullable": false,
"mappedType": "text"
},
"tax_rate_id": {
"name": "tax_rate_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true, "nullable": true,
"mappedType": "text" "mappedType": "text"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
} }
}, },
"name": "cart_shipping_method_tax_line", "name": "cart_shipping_method_tax_line",
"schema": "public", "schema": "public",
"indexes": [ "indexes": [
{ {
"keyName": "IDX_tax_line_shipping_method_id",
"columnNames": [ "columnNames": [
"shipping_method_id" "shipping_method_id"
], ],
"composite": false, "composite": false,
"keyName": "IDX_tax_line_shipping_method_id",
"primary": false, "primary": false,
"unique": false "unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_tax_line_shipping_method_id\" ON \"cart_shipping_method_tax_line\" (shipping_method_id) WHERE deleted_at IS NULL"
},
{
"keyName": "IDX_shipping_method_tax_line_tax_rate_id",
"columnNames": [
"tax_rate_id"
],
"composite": false,
"primary": false,
"unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_shipping_method_tax_line_tax_rate_id\" ON \"cart_shipping_method_tax_line\" (tax_rate_id) WHERE deleted_at IS NULL AND tax_rate_id IS NOT NULL"
},
{
"keyName": "IDX_cart_shipping_method_tax_line_deleted_at",
"columnNames": [
"deleted_at"
],
"composite": false,
"primary": false,
"unique": false,
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_cart_shipping_method_tax_line_deleted_at\" ON \"cart_shipping_method_tax_line\" (deleted_at) WHERE deleted_at IS NOT NULL"
}, },
{ {
"keyName": "cart_shipping_method_tax_line_pkey", "keyName": "cart_shipping_method_tax_line_pkey",
@@ -1288,21 +1531,7 @@
} }
], ],
"checks": [], "checks": [],
"foreignKeys": { "foreignKeys": {}
"cart_shipping_method_tax_line_shipping_method_id_foreign": {
"constraintName": "cart_shipping_method_tax_line_shipping_method_id_foreign",
"columnNames": [
"shipping_method_id"
],
"localTableName": "public.cart_shipping_method_tax_line",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.cart_shipping_method",
"deleteRule": "cascade",
"updateRule": "cascade"
}
}
} }
] ]
} }

View File

@@ -1,6 +1,6 @@
import { Migration } from "@mikro-orm/migrations" import { Migration } from "@mikro-orm/migrations"
export class CartModuleSetup20240122122952 extends Migration { export class Migration20240222170223 extends Migration {
async up(): Promise<void> { async up(): Promise<void> {
this.addSql( this.addSql(
` `
@@ -21,6 +21,7 @@ export class CartModuleSetup20240122122952 extends Migration {
); );
ALTER TABLE "cart" ADD COLUMN IF NOT EXISTS "currency_code" TEXT NOT NULL; ALTER TABLE "cart" ADD COLUMN IF NOT EXISTS "currency_code" TEXT NOT NULL;
ALTER TABLE "cart" ADD COLUMN IF NOT EXISTS "deleted_at" TIMESTAMPTZ NULL;
ALTER TABLE "cart" ALTER COLUMN "region_id" DROP NOT NULL; ALTER TABLE "cart" ALTER COLUMN "region_id" DROP NOT NULL;
ALTER TABLE "cart" ALTER COLUMN "email" DROP NOT NULL; ALTER TABLE "cart" ALTER COLUMN "email" DROP NOT NULL;
@@ -31,11 +32,11 @@ export class CartModuleSetup20240122122952 extends Migration {
ALTER TABLE "cart" DROP CONSTRAINT IF EXISTS "FK_a2bd3c26f42e754b9249ba78fd6"; ALTER TABLE "cart" DROP CONSTRAINT IF EXISTS "FK_a2bd3c26f42e754b9249ba78fd6";
ALTER TABLE "cart" DROP CONSTRAINT IF EXISTS "FK_ced15a9a695d2b5db9dabce763d"; ALTER TABLE "cart" DROP CONSTRAINT IF EXISTS "FK_ced15a9a695d2b5db9dabce763d";
CREATE INDEX IF NOT EXISTS "IDX_cart_customer_id" ON "cart" ("customer_id"); CREATE INDEX IF NOT EXISTS "IDX_cart_customer_id" ON "cart" ("customer_id") WHERE deleted_at IS NULL AND customer_id IS NOT NULL;
CREATE INDEX IF NOT EXISTS "IDX_cart_shipping_address_id" ON "cart" ("shipping_address_id"); CREATE INDEX IF NOT EXISTS "IDX_cart_shipping_address_id" ON "cart" ("shipping_address_id") WHERE deleted_at IS NULL AND shipping_address_id IS NOT NULL;
CREATE INDEX IF NOT EXISTS "IDX_cart_billing_address_id" ON "cart" ("billing_address_id"); CREATE INDEX IF NOT EXISTS "IDX_cart_billing_address_id" ON "cart" ("billing_address_id") WHERE deleted_at IS NULL AND billing_address_id IS NOT NULL;
CREATE INDEX IF NOT EXISTS "IDX_cart_region_id" ON "cart" ("region_id"); CREATE INDEX IF NOT EXISTS "IDX_cart_region_id" ON "cart" ("region_id") WHERE deleted_at IS NULL AND region_id IS NOT NULL;
CREATE INDEX IF NOT EXISTS "IDX_cart_sales_channel_id" ON "cart" ("sales_channel_id"); CREATE INDEX IF NOT EXISTS "IDX_cart_sales_channel_id" ON "cart" ("sales_channel_id") WHERE deleted_at IS NULL AND sales_channel_id IS NOT NULL;
CREATE INDEX IF NOT EXISTS "IDX_cart_currency_code" ON "cart" ("currency_code"); CREATE INDEX IF NOT EXISTS "IDX_cart_currency_code" ON "cart" ("currency_code");
CREATE TABLE IF NOT EXISTS "cart_address" ( CREATE TABLE IF NOT EXISTS "cart_address" (
@@ -54,6 +55,7 @@ export class CartModuleSetup20240122122952 extends Migration {
"metadata" JSONB NULL, "metadata" JSONB NULL,
"created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(), "created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"updated_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(), "updated_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"deleted_at" TIMESTAMPTZ NULL,
CONSTRAINT "cart_address_pkey" PRIMARY KEY ("id") CONSTRAINT "cart_address_pkey" PRIMARY KEY ("id")
); );
@@ -85,6 +87,7 @@ export class CartModuleSetup20240122122952 extends Migration {
"raw_unit_price" JSONB NOT NULL, "raw_unit_price" JSONB NOT NULL,
"created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(), "created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"updated_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(), "updated_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"deleted_at" TIMESTAMPTZ NULL,
CONSTRAINT "cart_line_item_pkey" PRIMARY KEY ("id"), CONSTRAINT "cart_line_item_pkey" PRIMARY KEY ("id"),
CONSTRAINT cart_line_item_unit_price_check CHECK (unit_price >= 0) CONSTRAINT cart_line_item_unit_price_check CHECK (unit_price >= 0)
); );
@@ -92,9 +95,9 @@ export class CartModuleSetup20240122122952 extends Migration {
ALTER TABLE "cart" ADD CONSTRAINT "cart_shipping_address_id_foreign" FOREIGN KEY ("shipping_address_id") REFERENCES "cart_address" ("id") ON UPDATE CASCADE ON DELETE SET NULL; ALTER TABLE "cart" ADD CONSTRAINT "cart_shipping_address_id_foreign" FOREIGN KEY ("shipping_address_id") REFERENCES "cart_address" ("id") ON UPDATE CASCADE ON DELETE SET NULL;
ALTER TABLE "cart" ADD CONSTRAINT "cart_billing_address_id_foreign" FOREIGN KEY ("billing_address_id") REFERENCES "cart_address" ("id") ON UPDATE CASCADE ON DELETE SET NULL; ALTER TABLE "cart" ADD CONSTRAINT "cart_billing_address_id_foreign" FOREIGN KEY ("billing_address_id") REFERENCES "cart_address" ("id") ON UPDATE CASCADE ON DELETE SET NULL;
CREATE INDEX IF NOT EXISTS "IDX_line_item_cart_id" ON "cart_line_item" ("cart_id"); CREATE INDEX IF NOT EXISTS "IDX_line_item_cart_id" ON "cart_line_item" ("cart_id") WHERE deleted_at IS NULL;
CREATE INDEX IF NOT EXISTS "IDX_line_item_product_id" ON "cart_line_item" ("product_id"); CREATE INDEX IF NOT EXISTS "IDX_line_item_product_id" ON "cart_line_item" ("product_id") WHERE deleted_at IS NULL AND product_id IS NOT NULL;
CREATE INDEX IF NOT EXISTS "IDX_line_item_variant_id" ON "cart_line_item" ("variant_id"); CREATE INDEX IF NOT EXISTS "IDX_line_item_variant_id" ON "cart_line_item" ("variant_id") WHERE deleted_at IS NULL AND variant_id IS NOT NULL;
CREATE TABLE IF NOT EXISTS "cart_line_item_adjustment" ( CREATE TABLE IF NOT EXISTS "cart_line_item_adjustment" (
@@ -106,13 +109,14 @@ export class CartModuleSetup20240122122952 extends Migration {
"provider_id" TEXT NULL, "provider_id" TEXT NULL,
"created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(), "created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"updated_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(), "updated_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"deleted_at" TIMESTAMPTZ NULL,
"item_id" TEXT NULL, "item_id" TEXT NULL,
CONSTRAINT "cart_line_item_adjustment_pkey" PRIMARY KEY ("id"), CONSTRAINT "cart_line_item_adjustment_pkey" PRIMARY KEY ("id"),
CONSTRAINT cart_line_item_adjustment_check CHECK (amount >= 0) CONSTRAINT cart_line_item_adjustment_check CHECK (amount >= 0)
); );
CREATE INDEX IF NOT EXISTS "IDX_adjustment_item_id" ON "cart_line_item_adjustment" ("item_id"); CREATE INDEX IF NOT EXISTS "IDX_adjustment_item_id" ON "cart_line_item_adjustment" ("item_id") WHERE deleted_at IS NULL;
CREATE INDEX IF NOT EXISTS "IDX_line_item_adjustment_promotion_id" ON "cart_line_item_adjustment" ("promotion_id"); CREATE INDEX IF NOT EXISTS "IDX_line_item_adjustment_promotion_id" ON "cart_line_item_adjustment" ("promotion_id") WHERE deleted_at IS NULL AND promotion_id IS NOT NULL;
CREATE TABLE IF NOT EXISTS "cart_line_item_tax_line" ( CREATE TABLE IF NOT EXISTS "cart_line_item_tax_line" (
"id" TEXT NOT NULL, "id" TEXT NOT NULL,
@@ -123,12 +127,13 @@ export class CartModuleSetup20240122122952 extends Migration {
"provider_id" TEXT NULL, "provider_id" TEXT NULL,
"created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(), "created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"updated_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(), "updated_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"deleted_at" TIMESTAMPTZ NULL,
"item_id" TEXT NULL, "item_id" TEXT NULL,
CONSTRAINT "cart_line_item_tax_line_pkey" PRIMARY KEY ("id") CONSTRAINT "cart_line_item_tax_line_pkey" PRIMARY KEY ("id")
); );
CREATE INDEX IF NOT EXISTS "IDX_tax_line_item_id" ON "cart_line_item_tax_line" ("item_id"); CREATE INDEX IF NOT EXISTS "IDX_tax_line_item_id" ON "cart_line_item_tax_line" ("item_id") WHERE deleted_at IS NULL;
CREATE INDEX IF NOT EXISTS "IDX_line_item_tax_line_tax_rate_id" ON "cart_line_item_tax_line" ("tax_rate_id"); CREATE INDEX IF NOT EXISTS "IDX_line_item_tax_line_tax_rate_id" ON "cart_line_item_tax_line" ("tax_rate_id") WHERE deleted_at IS NULL AND tax_rate_id IS NOT NULL;
CREATE TABLE IF NOT EXISTS "cart_shipping_method" ( CREATE TABLE IF NOT EXISTS "cart_shipping_method" (
"id" TEXT NOT NULL, "id" TEXT NOT NULL,
@@ -143,12 +148,13 @@ export class CartModuleSetup20240122122952 extends Migration {
"metadata" JSONB NULL, "metadata" JSONB NULL,
"created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(), "created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"updated_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(), "updated_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"deleted_at" TIMESTAMPTZ NULL,
CONSTRAINT "cart_shipping_method_pkey" PRIMARY KEY ("id"), CONSTRAINT "cart_shipping_method_pkey" PRIMARY KEY ("id"),
CONSTRAINT cart_shipping_method_check CHECK (amount >= 0) CONSTRAINT cart_shipping_method_check CHECK (amount >= 0)
); );
CREATE INDEX IF NOT EXISTS "IDX_shipping_method_cart_id" ON "cart_shipping_method" ("cart_id"); CREATE INDEX IF NOT EXISTS "IDX_shipping_method_cart_id" ON "cart_shipping_method" ("cart_id") WHERE deleted_at IS NULL;
CREATE INDEX IF NOT EXISTS "IDX_shipping_method_option_id" ON "cart_shipping_method" ("shipping_option_id"); CREATE INDEX IF NOT EXISTS "IDX_shipping_method_option_id" ON "cart_shipping_method" ("shipping_option_id") WHERE deleted_at IS NULL AND shipping_option_id IS NOT NULL;
CREATE TABLE IF NOT EXISTS "cart_shipping_method_adjustment" ( CREATE TABLE IF NOT EXISTS "cart_shipping_method_adjustment" (
"id" TEXT NOT NULL, "id" TEXT NOT NULL,
@@ -159,12 +165,13 @@ export class CartModuleSetup20240122122952 extends Migration {
"provider_id" TEXT NULL, "provider_id" TEXT NULL,
"created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(), "created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"updated_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(), "updated_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"deleted_at" TIMESTAMPTZ NULL,
"shipping_method_id" TEXT NULL, "shipping_method_id" TEXT NULL,
CONSTRAINT "cart_shipping_method_adjustment_pkey" PRIMARY KEY ("id") CONSTRAINT "cart_shipping_method_adjustment_pkey" PRIMARY KEY ("id")
); );
CREATE INDEX IF NOT EXISTS "IDX_adjustment_shipping_method_id" ON "cart_shipping_method_adjustment" ("shipping_method_id"); CREATE INDEX IF NOT EXISTS "IDX_adjustment_shipping_method_id" ON "cart_shipping_method_adjustment" ("shipping_method_id") WHERE deleted_at IS NULL;
CREATE INDEX IF NOT EXISTS "IDX_shipping_method_adjustment_promotion_id" ON "cart_shipping_method_adjustment" ("promotion_id"); CREATE INDEX IF NOT EXISTS "IDX_shipping_method_adjustment_promotion_id" ON "cart_shipping_method_adjustment" ("promotion_id") WHERE deleted_at IS NULL AND promotion_id IS NOT NULL;
CREATE TABLE IF NOT EXISTS "cart_shipping_method_tax_line" ( CREATE TABLE IF NOT EXISTS "cart_shipping_method_tax_line" (
"id" TEXT NOT NULL, "id" TEXT NOT NULL,
@@ -175,12 +182,13 @@ export class CartModuleSetup20240122122952 extends Migration {
"provider_id" TEXT NULL, "provider_id" TEXT NULL,
"created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(), "created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"updated_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(), "updated_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"deleted_at" TIMESTAMPTZ NULL,
"shipping_method_id" TEXT NULL, "shipping_method_id" TEXT NULL,
CONSTRAINT "cart_shipping_method_tax_line_pkey" PRIMARY KEY ("id") CONSTRAINT "cart_shipping_method_tax_line_pkey" PRIMARY KEY ("id")
); );
CREATE INDEX IF NOT EXISTS "IDX_tax_line_shipping_method_id" ON "cart_shipping_method_tax_line" ("shipping_method_id"); CREATE INDEX IF NOT EXISTS "IDX_tax_line_shipping_method_id" ON "cart_shipping_method_tax_line" ("shipping_method_id") WHERE deleted_at IS NULL;
CREATE INDEX IF NOT EXISTS "IDX_shipping_method_tax_line_tax_rate_id" ON "cart_shipping_method_tax_line" ("tax_rate_id"); CREATE INDEX IF NOT EXISTS "IDX_shipping_method_tax_line_tax_rate_id" ON "cart_shipping_method_tax_line" ("tax_rate_id") WHERE deleted_at IS NULL AND tax_rate_id IS NOT NULL;
ALTER TABLE "cart_line_item" ADD CONSTRAINT "cart_line_item_cart_id_foreign" FOREIGN KEY ("cart_id") REFERENCES "cart" ("id") ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE "cart_line_item" ADD CONSTRAINT "cart_line_item_cart_id_foreign" FOREIGN KEY ("cart_id") REFERENCES "cart" ("id") ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE "cart_line_item_adjustment" ADD CONSTRAINT "cart_line_item_adjustment_item_id_foreign" FOREIGN KEY ("item_id") REFERENCES "cart_line_item" ("id") ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE "cart_line_item_adjustment" ADD CONSTRAINT "cart_line_item_adjustment_item_id_foreign" FOREIGN KEY ("item_id") REFERENCES "cart_line_item" ("id") ON UPDATE CASCADE ON DELETE CASCADE;
@@ -188,6 +196,15 @@ export class CartModuleSetup20240122122952 extends Migration {
ALTER TABLE "cart_shipping_method" ADD CONSTRAINT "cart_shipping_method_cart_id_foreign" FOREIGN KEY ("cart_id") REFERENCES "cart" ("id") ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE "cart_shipping_method" ADD CONSTRAINT "cart_shipping_method_cart_id_foreign" FOREIGN KEY ("cart_id") REFERENCES "cart" ("id") ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE "cart_shipping_method_adjustment" ADD CONSTRAINT "cart_shipping_method_adjustment_shipping_method_id_foreign" FOREIGN KEY ("shipping_method_id") REFERENCES "cart_shipping_method" ("id") ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE "cart_shipping_method_adjustment" ADD CONSTRAINT "cart_shipping_method_adjustment_shipping_method_id_foreign" FOREIGN KEY ("shipping_method_id") REFERENCES "cart_shipping_method" ("id") ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE "cart_shipping_method_tax_line" ADD CONSTRAINT "cart_shipping_method_tax_line_shipping_method_id_foreign" FOREIGN KEY ("shipping_method_id") REFERENCES "cart_shipping_method" ("id") ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE "cart_shipping_method_tax_line" ADD CONSTRAINT "cart_shipping_method_tax_line_shipping_method_id_foreign" FOREIGN KEY ("shipping_method_id") REFERENCES "cart_shipping_method" ("id") ON UPDATE CASCADE ON DELETE CASCADE;
CREATE INDEX IF NOT EXISTS "IDX_cart_deleted_at" ON "cart" (deleted_at) WHERE deleted_at IS NOT NULL;
CREATE INDEX IF NOT EXISTS "IDX_cart_address_deleted_at" ON "cart_address" (deleted_at) WHERE deleted_at IS NOT NULL;
CREATE INDEX IF NOT EXISTS "IDX_cart_line_item_adjustment_deleted_at" ON "cart_line_item_adjustment" (deleted_at) WHERE deleted_at IS NOT NULL;
CREATE INDEX IF NOT EXISTS "IDX_cart_shipping_method_adjustment_deleted_at" ON "cart_shipping_method_adjustment" (deleted_at) WHERE deleted_at IS NOT NULL;
CREATE INDEX IF NOT EXISTS "IDX_cart_line_item_tax_line_deleted_at" ON "cart_line_item_tax_line" (deleted_at) WHERE deleted_at IS NOT NULL;
CREATE INDEX IF NOT EXISTS "IDX_cart_shipping_method_tax_line_deleted_at" ON "cart_shipping_method_tax_line" (deleted_at) WHERE deleted_at IS NOT NULL;
CREATE INDEX IF NOT EXISTS "IDX_cart_shipping_method_deleted_at" ON "cart_shipping_method" (deleted_at) WHERE deleted_at IS NOT NULL;
CREATE INDEX IF NOT EXISTS "IDX_cart_line_item_deleted_at" ON "cart_line_item" (deleted_at) WHERE deleted_at IS NOT NULL;
` `
) )
} }

View File

@@ -1,17 +1,23 @@
import { DAL } from "@medusajs/types" import { DAL } from "@medusajs/types"
import { generateEntityId } from "@medusajs/utils" import {
DALUtils,
createPsqlIndexStatementHelper,
generateEntityId,
} from "@medusajs/utils"
import { import {
BeforeCreate, BeforeCreate,
Entity, Entity,
Filter,
OnInit, OnInit,
OptionalProps, OptionalProps,
PrimaryKey, PrimaryKey,
Property, Property,
} from "@mikro-orm/core" } from "@mikro-orm/core"
type OptionalAddressProps = DAL.EntityDateColumns // TODO: To be revisited when more clear type OptionalAddressProps = DAL.SoftDeletableEntityDateColumns
@Entity({ tableName: "cart_address" }) @Entity({ tableName: "cart_address" })
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
export default class Address { export default class Address {
[OptionalProps]: OptionalAddressProps [OptionalProps]: OptionalAddressProps
@@ -69,6 +75,14 @@ export default class Address {
}) })
updated_at: Date updated_at: Date
@createPsqlIndexStatementHelper({
tableName: "cart_address",
columns: "deleted_at",
where: "deleted_at IS NOT NULL",
}).MikroORMIndex()
@Property({ columnType: "timestamptz", nullable: true })
deleted_at: Date | null = null
@BeforeCreate() @BeforeCreate()
onCreate() { onCreate() {
this.id = generateEntityId(this.id, "caaddr") this.id = generateEntityId(this.id, "caaddr")

View File

@@ -1,7 +1,7 @@
import { DAL } from "@medusajs/types" import { DAL } from "@medusajs/types"
import { OptionalProps, PrimaryKey, Property } from "@mikro-orm/core" import { OptionalProps, PrimaryKey, Property } from "@mikro-orm/core"
type OptionalAdjustmentLineProps = DAL.EntityDateColumns // TODO: To be revisited when more clear type OptionalAdjustmentLineProps = DAL.SoftDeletableEntityDateColumns
/** /**
* As per the Mikro ORM docs, superclasses should use the abstract class definition * As per the Mikro ORM docs, superclasses should use the abstract class definition
@@ -16,12 +16,6 @@ export default abstract class AdjustmentLine {
@Property({ columnType: "text", nullable: true }) @Property({ columnType: "text", nullable: true })
description: string | null = null description: string | null = null
@Property({
columnType: "text",
nullable: true,
})
promotion_id: string | null = null
@Property({ columnType: "text", nullable: true }) @Property({ columnType: "text", nullable: true })
code: string | null = null code: string | null = null

View File

@@ -1,10 +1,15 @@
import { DAL } from "@medusajs/types" import { DAL } from "@medusajs/types"
import { generateEntityId } from "@medusajs/utils" import {
DALUtils,
createPsqlIndexStatementHelper,
generateEntityId,
} from "@medusajs/utils"
import { import {
BeforeCreate, BeforeCreate,
Cascade, Cascade,
Collection, Collection,
Entity, Entity,
Filter,
ManyToOne, ManyToOne,
OnInit, OnInit,
OneToMany, OneToMany,
@@ -19,29 +24,40 @@ import ShippingMethod from "./shipping-method"
type OptionalCartProps = type OptionalCartProps =
| "shipping_address" | "shipping_address"
| "billing_address" | "billing_address"
| DAL.EntityDateColumns | DAL.SoftDeletableEntityDateColumns
@Entity({ tableName: "cart" }) @Entity({ tableName: "cart" })
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
export default class Cart { export default class Cart {
[OptionalProps]?: OptionalCartProps [OptionalProps]?: OptionalCartProps
@PrimaryKey({ columnType: "text" }) @PrimaryKey({ columnType: "text" })
id: string id: string
@Property({ @createPsqlIndexStatementHelper({
columnType: "text", name: "IDX_cart_region_id",
nullable: true, tableName: "cart",
index: "IDX_cart_region_id", columns: "region_id",
}) where: "deleted_at IS NULL AND region_id IS NOT NULL",
}).MikroORMIndex()
@Property({ columnType: "text", nullable: true })
region_id: string | null = null region_id: string | null = null
@Property({ @createPsqlIndexStatementHelper({
columnType: "text", name: "IDX_cart_customer_id",
nullable: true, tableName: "cart",
index: "IDX_cart_customer_id", columns: "customer_id",
}) where: "deleted_at IS NULL AND customer_id IS NOT NULL",
}).MikroORMIndex()
@Property({ columnType: "text", nullable: true })
customer_id: string | null = null customer_id: string | null = null
@createPsqlIndexStatementHelper({
name: "IDX_cart_sales_channel_id",
tableName: "cart",
columns: "sales_channel_id",
where: "deleted_at IS NULL AND sales_channel_id IS NOT NULL",
}).MikroORMIndex()
@Property({ @Property({
columnType: "text", columnType: "text",
nullable: true, nullable: true,
@@ -55,6 +71,12 @@ export default class Cart {
@Property({ columnType: "text", index: "IDX_cart_curency_code" }) @Property({ columnType: "text", index: "IDX_cart_curency_code" })
currency_code: string currency_code: string
@createPsqlIndexStatementHelper({
name: "IDX_cart_shipping_address_id",
tableName: "cart",
columns: "shipping_address_id",
where: "deleted_at IS NULL AND shipping_address_id IS NOT NULL",
}).MikroORMIndex()
@Property({ columnType: "text", nullable: true }) @Property({ columnType: "text", nullable: true })
shipping_address_id?: string | null shipping_address_id?: string | null
@@ -62,11 +84,16 @@ export default class Cart {
entity: () => Address, entity: () => Address,
fieldName: "shipping_address_id", fieldName: "shipping_address_id",
nullable: true, nullable: true,
index: "IDX_cart_shipping_address_id",
cascade: [Cascade.PERSIST], cascade: [Cascade.PERSIST],
}) })
shipping_address?: Address | null shipping_address?: Address | null
@createPsqlIndexStatementHelper({
name: "IDX_cart_billing_address_id",
tableName: "cart",
columns: "billing_address_id",
where: "deleted_at IS NULL AND billing_address_id IS NOT NULL",
}).MikroORMIndex()
@Property({ columnType: "text", nullable: true }) @Property({ columnType: "text", nullable: true })
billing_address_id?: string | null billing_address_id?: string | null
@@ -83,12 +110,12 @@ export default class Cart {
metadata: Record<string, unknown> | null = null metadata: Record<string, unknown> | null = null
@OneToMany(() => LineItem, (lineItem) => lineItem.cart, { @OneToMany(() => LineItem, (lineItem) => lineItem.cart, {
cascade: [Cascade.REMOVE], cascade: [Cascade.PERSIST, "soft-remove"] as any,
}) })
items = new Collection<LineItem>(this) items = new Collection<LineItem>(this)
@OneToMany(() => ShippingMethod, (shippingMethod) => shippingMethod.cart, { @OneToMany(() => ShippingMethod, (shippingMethod) => shippingMethod.cart, {
cascade: [Cascade.REMOVE], cascade: [Cascade.PERSIST, "soft-remove"] as any,
}) })
shipping_methods = new Collection<ShippingMethod>(this) shipping_methods = new Collection<ShippingMethod>(this)
@@ -107,6 +134,11 @@ export default class Cart {
}) })
updated_at: Date updated_at: Date
@createPsqlIndexStatementHelper({
tableName: "cart",
columns: "deleted_at",
where: "deleted_at IS NOT NULL",
}).MikroORMIndex()
@Property({ columnType: "timestamptz", nullable: true }) @Property({ columnType: "timestamptz", nullable: true })
deleted_at: Date | null = null deleted_at: Date | null = null

View File

@@ -1,9 +1,14 @@
import { generateEntityId } from "@medusajs/utils" import {
DALUtils,
createPsqlIndexStatementHelper,
generateEntityId,
} from "@medusajs/utils"
import { import {
BeforeCreate, BeforeCreate,
Cascade, Cascade,
Check, Check,
Entity, Entity,
Filter,
ManyToOne, ManyToOne,
OnInit, OnInit,
Property, Property,
@@ -15,17 +20,40 @@ import LineItem from "./line-item"
@Check<LineItemAdjustment>({ @Check<LineItemAdjustment>({
expression: (columns) => `${columns.amount} >= 0`, expression: (columns) => `${columns.amount} >= 0`,
}) })
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
export default class LineItemAdjustment extends AdjustmentLine { export default class LineItemAdjustment extends AdjustmentLine {
@ManyToOne({ @ManyToOne({
entity: () => LineItem, entity: () => LineItem,
index: "IDX_adjustment_item_id", cascade: [Cascade.REMOVE, Cascade.PERSIST, "soft-remove"] as any,
cascade: [Cascade.REMOVE, Cascade.PERSIST],
}) })
item: LineItem item: LineItem
@createPsqlIndexStatementHelper({
name: "IDX_adjustment_item_id",
tableName: "cart_line_item_adjustment",
columns: "item_id",
where: "deleted_at IS NULL",
}).MikroORMIndex()
@Property({ columnType: "text" }) @Property({ columnType: "text" })
item_id: string item_id: string
@createPsqlIndexStatementHelper({
name: "IDX_line_item_adjustment_promotion_id",
tableName: "cart_line_item_adjustment",
columns: "promotion_id",
where: "deleted_at IS NULL and promotion_id IS NOT NULL",
}).MikroORMIndex()
@Property({ columnType: "text", nullable: true })
promotion_id: string | null = null
@createPsqlIndexStatementHelper({
tableName: "cart_line_item_adjustment",
columns: "deleted_at",
where: "deleted_at IS NOT NULL",
}).MikroORMIndex()
@Property({ columnType: "timestamptz", nullable: true })
deleted_at: Date | null = null
@BeforeCreate() @BeforeCreate()
onCreate() { onCreate() {
this.id = generateEntityId(this.id, "caliadj") this.id = generateEntityId(this.id, "caliadj")

View File

@@ -1,8 +1,13 @@
import { generateEntityId } from "@medusajs/utils" import {
DALUtils,
createPsqlIndexStatementHelper,
generateEntityId,
} from "@medusajs/utils"
import { import {
BeforeCreate, BeforeCreate,
Cascade, Cascade,
Entity, Entity,
Filter,
ManyToOne, ManyToOne,
OnInit, OnInit,
Property, Property,
@@ -11,17 +16,40 @@ import LineItem from "./line-item"
import TaxLine from "./tax-line" import TaxLine from "./tax-line"
@Entity({ tableName: "cart_line_item_tax_line" }) @Entity({ tableName: "cart_line_item_tax_line" })
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
export default class LineItemTaxLine extends TaxLine { export default class LineItemTaxLine extends TaxLine {
@ManyToOne({ @ManyToOne({
entity: () => LineItem, entity: () => LineItem,
index: "IDX_tax_line_item_id", cascade: [Cascade.REMOVE, Cascade.PERSIST, "soft-remove"] as any,
cascade: [Cascade.REMOVE, Cascade.PERSIST]
}) })
item: LineItem item: LineItem
@createPsqlIndexStatementHelper({
name: "IDX_tax_line_item_id",
tableName: "cart_line_item_tax_line",
columns: "item_id",
where: "deleted_at IS NULL",
}).MikroORMIndex()
@Property({ columnType: "text" }) @Property({ columnType: "text" })
item_id: string item_id: string
@createPsqlIndexStatementHelper({
name: "IDX_line_item_tax_line_tax_rate_id",
tableName: "cart_line_item_tax_line",
columns: "tax_rate_id",
where: "deleted_at IS NULL AND tax_rate_id IS NOT NULL",
}).MikroORMIndex()
@Property({ columnType: "text", nullable: true })
tax_rate_id: string | null = null
@createPsqlIndexStatementHelper({
tableName: "cart_line_item_tax_line",
columns: "deleted_at",
where: "deleted_at IS NOT NULL",
}).MikroORMIndex()
@Property({ columnType: "timestamptz", nullable: true })
deleted_at: Date | null = null
@BeforeCreate() @BeforeCreate()
onCreate() { onCreate() {
this.id = generateEntityId(this.id, "calitxl") this.id = generateEntityId(this.id, "calitxl")

View File

@@ -1,11 +1,17 @@
import { BigNumberRawValue, DAL } from "@medusajs/types" import { BigNumberRawValue, DAL } from "@medusajs/types"
import { BigNumber, generateEntityId } from "@medusajs/utils" import {
BigNumber,
DALUtils,
createPsqlIndexStatementHelper,
generateEntityId,
} from "@medusajs/utils"
import { import {
BeforeCreate, BeforeCreate,
BeforeUpdate, BeforeUpdate,
Cascade, Cascade,
Collection, Collection,
Entity, Entity,
Filter,
ManyToOne, ManyToOne,
OnInit, OnInit,
OneToMany, OneToMany,
@@ -23,23 +29,28 @@ type OptionalLineItemProps =
| "compare_at_unit_price" | "compare_at_unit_price"
| "requires_shipping" | "requires_shipping"
| "cart" | "cart"
| DAL.EntityDateColumns | DAL.SoftDeletableEntityDateColumns
@Entity({ tableName: "cart_line_item" }) @Entity({ tableName: "cart_line_item" })
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
export default class LineItem { export default class LineItem {
[OptionalProps]?: OptionalLineItemProps [OptionalProps]?: OptionalLineItemProps
@PrimaryKey({ columnType: "text" }) @PrimaryKey({ columnType: "text" })
id: string id: string
@createPsqlIndexStatementHelper({
name: "IDX_line_item_cart_id",
tableName: "cart_line_item",
columns: "cart_id",
where: "deleted_at IS NULL",
}).MikroORMIndex()
@Property({ columnType: "text" }) @Property({ columnType: "text" })
cart_id: string cart_id: string
@ManyToOne({ @ManyToOne({
entity: () => Cart, entity: () => Cart,
onDelete: "cascade", cascade: [Cascade.REMOVE, Cascade.PERSIST, "soft-remove"] as any,
index: "IDX_line_item_cart_id",
cascade: [Cascade.REMOVE, Cascade.PERSIST],
}) })
cart: Cart cart: Cart
@@ -55,18 +66,22 @@ export default class LineItem {
@Property({ columnType: "integer" }) @Property({ columnType: "integer" })
quantity: number quantity: number
@Property({ @createPsqlIndexStatementHelper({
columnType: "text", name: "IDX_line_item_variant_id",
nullable: true, tableName: "cart_line_item",
index: "IDX_line_item_variant_id", columns: "variant_id",
}) where: "deleted_at IS NULL AND variant_id IS NOT NULL",
}).MikroORMIndex()
@Property({ columnType: "text", nullable: true })
variant_id: string | null = null variant_id: string | null = null
@Property({ @createPsqlIndexStatementHelper({
columnType: "text", name: "IDX_line_item_product_id",
nullable: true, tableName: "cart_line_item",
index: "IDX_line_item_product_id", columns: "product_id",
}) where: "deleted_at IS NULL AND product_id IS NOT NULL",
}).MikroORMIndex()
@Property({ columnType: "text", nullable: true })
product_id: string | null = null product_id: string | null = null
@Property({ columnType: "text", nullable: true }) @Property({ columnType: "text", nullable: true })
@@ -121,12 +136,12 @@ export default class LineItem {
raw_unit_price: BigNumberRawValue raw_unit_price: BigNumberRawValue
@OneToMany(() => LineItemTaxLine, (taxLine) => taxLine.item, { @OneToMany(() => LineItemTaxLine, (taxLine) => taxLine.item, {
cascade: [Cascade.REMOVE], cascade: [Cascade.PERSIST, "soft-remove"] as any,
}) })
tax_lines = new Collection<LineItemTaxLine>(this) tax_lines = new Collection<LineItemTaxLine>(this)
@OneToMany(() => LineItemAdjustment, (adjustment) => adjustment.item, { @OneToMany(() => LineItemAdjustment, (adjustment) => adjustment.item, {
cascade: [Cascade.REMOVE], cascade: [Cascade.PERSIST, "soft-remove"] as any,
}) })
adjustments = new Collection<LineItemAdjustment>(this) adjustments = new Collection<LineItemAdjustment>(this)
@@ -145,6 +160,14 @@ export default class LineItem {
}) })
updated_at: Date updated_at: Date
@createPsqlIndexStatementHelper({
tableName: "cart_line_item",
columns: "deleted_at",
where: "deleted_at IS NOT NULL",
}).MikroORMIndex()
@Property({ columnType: "timestamptz", nullable: true })
deleted_at: Date | null = null
@BeforeCreate() @BeforeCreate()
onCreate() { onCreate() {
this.id = generateEntityId(this.id, "cali") this.id = generateEntityId(this.id, "cali")

View File

@@ -1,8 +1,13 @@
import { generateEntityId } from "@medusajs/utils" import {
DALUtils,
createPsqlIndexStatementHelper,
generateEntityId,
} from "@medusajs/utils"
import { import {
BeforeCreate, BeforeCreate,
Cascade, Cascade,
Entity, Entity,
Filter,
ManyToOne, ManyToOne,
OnInit, OnInit,
Property, Property,
@@ -11,17 +16,40 @@ import AdjustmentLine from "./adjustment-line"
import ShippingMethod from "./shipping-method" import ShippingMethod from "./shipping-method"
@Entity({ tableName: "cart_shipping_method_adjustment" }) @Entity({ tableName: "cart_shipping_method_adjustment" })
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
export default class ShippingMethodAdjustment extends AdjustmentLine { export default class ShippingMethodAdjustment extends AdjustmentLine {
@ManyToOne({ @ManyToOne({
entity: () => ShippingMethod, entity: () => ShippingMethod,
index: "IDX_adjustment_shipping_method_id", cascade: [Cascade.REMOVE, Cascade.PERSIST, "soft-remove"] as any,
cascade: [Cascade.REMOVE, Cascade.PERSIST],
}) })
shipping_method: ShippingMethod shipping_method: ShippingMethod
@createPsqlIndexStatementHelper({
name: "IDX_adjustment_shipping_method_id",
tableName: "cart_shipping_method_adjustment",
columns: "shipping_method_id",
where: "deleted_at IS NULL",
}).MikroORMIndex()
@Property({ columnType: "text" }) @Property({ columnType: "text" })
shipping_method_id: string shipping_method_id: string
@createPsqlIndexStatementHelper({
name: "IDX_shipping_method_adjustment_promotion_id",
tableName: "cart_shipping_method_adjustment",
columns: "promotion_id",
where: "deleted_at IS NULL and promotion_id IS NOT NULL",
}).MikroORMIndex()
@Property({ columnType: "text", nullable: true })
promotion_id: string | null = null
@createPsqlIndexStatementHelper({
tableName: "cart_shipping_method_adjustment",
columns: "deleted_at",
where: "deleted_at IS NOT NULL",
}).MikroORMIndex()
@Property({ columnType: "timestamptz", nullable: true })
deleted_at: Date | null = null
@BeforeCreate() @BeforeCreate()
onCreate() { onCreate() {
this.id = generateEntityId(this.id, "casmadj") this.id = generateEntityId(this.id, "casmadj")

View File

@@ -1,8 +1,13 @@
import { generateEntityId } from "@medusajs/utils" import {
DALUtils,
createPsqlIndexStatementHelper,
generateEntityId,
} from "@medusajs/utils"
import { import {
BeforeCreate, BeforeCreate,
Cascade, Cascade,
Entity, Entity,
Filter,
ManyToOne, ManyToOne,
OnInit, OnInit,
Property, Property,
@@ -11,17 +16,40 @@ import ShippingMethod from "./shipping-method"
import TaxLine from "./tax-line" import TaxLine from "./tax-line"
@Entity({ tableName: "cart_shipping_method_tax_line" }) @Entity({ tableName: "cart_shipping_method_tax_line" })
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
export default class ShippingMethodTaxLine extends TaxLine { export default class ShippingMethodTaxLine extends TaxLine {
@ManyToOne({ @ManyToOne({
entity: () => ShippingMethod, entity: () => ShippingMethod,
index: "IDX_tax_line_shipping_method_id", cascade: [Cascade.REMOVE, Cascade.PERSIST, "soft-remove"] as any,
cascade: [Cascade.REMOVE, Cascade.PERSIST],
}) })
shipping_method: ShippingMethod shipping_method: ShippingMethod
@createPsqlIndexStatementHelper({
name: "IDX_tax_line_shipping_method_id",
tableName: "cart_shipping_method_tax_line",
columns: "shipping_method_id",
where: "deleted_at IS NULL",
}).MikroORMIndex()
@Property({ columnType: "text" }) @Property({ columnType: "text" })
shipping_method_id: string shipping_method_id: string
@createPsqlIndexStatementHelper({
name: "IDX_shipping_method_tax_line_tax_rate_id",
tableName: "cart_shipping_method_tax_line",
columns: "tax_rate_id",
where: "deleted_at IS NULL AND tax_rate_id IS NOT NULL",
}).MikroORMIndex()
@Property({ columnType: "text", nullable: true })
tax_rate_id: string | null = null
@createPsqlIndexStatementHelper({
tableName: "cart_shipping_method_tax_line",
columns: "deleted_at",
where: "deleted_at IS NOT NULL",
}).MikroORMIndex()
@Property({ columnType: "timestamptz", nullable: true })
deleted_at: Date | null = null
@BeforeCreate() @BeforeCreate()
onCreate() { onCreate() {
this.id = generateEntityId(this.id, "casmtxl") this.id = generateEntityId(this.id, "casmtxl")

View File

@@ -1,14 +1,21 @@
import { BigNumberRawValue } from "@medusajs/types" import { BigNumberRawValue, DAL } from "@medusajs/types"
import { BigNumber, generateEntityId } from "@medusajs/utils" import {
BigNumber,
DALUtils,
createPsqlIndexStatementHelper,
generateEntityId,
} from "@medusajs/utils"
import { import {
BeforeCreate, BeforeCreate,
Cascade, Cascade,
Check, Check,
Collection, Collection,
Entity, Entity,
Filter,
ManyToOne, ManyToOne,
OnInit, OnInit,
OneToMany, OneToMany,
OptionalProps,
PrimaryKey, PrimaryKey,
Property, Property,
} from "@mikro-orm/core" } from "@mikro-orm/core"
@@ -17,19 +24,32 @@ import Cart from "./cart"
import ShippingMethodAdjustment from "./shipping-method-adjustment" import ShippingMethodAdjustment from "./shipping-method-adjustment"
import ShippingMethodTaxLine from "./shipping-method-tax-line" import ShippingMethodTaxLine from "./shipping-method-tax-line"
type OptionalShippingMethodProps =
| "cart"
| "is_tax_inclusive"
| DAL.SoftDeletableEntityDateColumns
@Entity({ tableName: "cart_shipping_method" }) @Entity({ tableName: "cart_shipping_method" })
@Check<ShippingMethod>({ expression: (columns) => `${columns.amount} >= 0` }) @Check<ShippingMethod>({ expression: (columns) => `${columns.amount} >= 0` })
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
export default class ShippingMethod { export default class ShippingMethod {
[OptionalProps]?: OptionalShippingMethodProps
@PrimaryKey({ columnType: "text" }) @PrimaryKey({ columnType: "text" })
id: string id: string
@createPsqlIndexStatementHelper({
name: "IDX_shipping_method_cart_id",
tableName: "cart_shipping_method",
columns: "cart_id",
where: "deleted_at IS NULL",
}).MikroORMIndex()
@Property({ columnType: "text" }) @Property({ columnType: "text" })
cart_id: string cart_id: string
@ManyToOne({ @ManyToOne({
entity: () => Cart, entity: () => Cart,
index: "IDX_shipping_method_cart_id", cascade: [Cascade.REMOVE, Cascade.PERSIST, "soft-remove"] as any,
cascade: [Cascade.REMOVE, Cascade.PERSIST],
}) })
cart: Cart cart: Cart
@@ -48,11 +68,13 @@ export default class ShippingMethod {
@Property({ columnType: "boolean" }) @Property({ columnType: "boolean" })
is_tax_inclusive = false is_tax_inclusive = false
@Property({ @createPsqlIndexStatementHelper({
columnType: "text", name: "IDX_shipping_method_option_id",
nullable: true, tableName: "cart_shipping_method",
index: "IDX_shipping_method_option_id", columns: "shipping_option_id",
}) where: "deleted_at IS NULL AND shipping_option_id IS NOT NULL",
}).MikroORMIndex()
@Property({ columnType: "text", nullable: true })
shipping_option_id: string | null = null shipping_option_id: string | null = null
@Property({ columnType: "jsonb", nullable: true }) @Property({ columnType: "jsonb", nullable: true })
@@ -65,7 +87,7 @@ export default class ShippingMethod {
() => ShippingMethodTaxLine, () => ShippingMethodTaxLine,
(taxLine) => taxLine.shipping_method, (taxLine) => taxLine.shipping_method,
{ {
cascade: [Cascade.REMOVE], cascade: [Cascade.PERSIST, "soft-remove"] as any,
} }
) )
tax_lines = new Collection<ShippingMethodTaxLine>(this) tax_lines = new Collection<ShippingMethodTaxLine>(this)
@@ -74,7 +96,7 @@ export default class ShippingMethod {
() => ShippingMethodAdjustment, () => ShippingMethodAdjustment,
(adjustment) => adjustment.shipping_method, (adjustment) => adjustment.shipping_method,
{ {
cascade: [Cascade.REMOVE], cascade: [Cascade.PERSIST, "soft-remove"] as any,
} }
) )
adjustments = new Collection<ShippingMethodAdjustment>(this) adjustments = new Collection<ShippingMethodAdjustment>(this)
@@ -94,6 +116,14 @@ export default class ShippingMethod {
}) })
updated_at: Date updated_at: Date
@createPsqlIndexStatementHelper({
tableName: "cart_shipping_method",
columns: "deleted_at",
where: "deleted_at IS NOT NULL",
}).MikroORMIndex()
@Property({ columnType: "timestamptz", nullable: true })
deleted_at: Date | null = null
@BeforeCreate() @BeforeCreate()
onCreate() { onCreate() {
this.id = generateEntityId(this.id, "casm") this.id = generateEntityId(this.id, "casm")

View File

@@ -1,22 +1,21 @@
import { PrimaryKey, Property } from "@mikro-orm/core" import { DAL } from "@medusajs/types"
import { OptionalProps, PrimaryKey, Property } from "@mikro-orm/core"
type OptionalTaxLineProps = DAL.SoftDeletableEntityDateColumns
/** /**
* As per the Mikro ORM docs, superclasses should use the abstract class definition * As per the Mikro ORM docs, superclasses should use the abstract class definition
* Source: https://mikro-orm.io/docs/inheritance-mapping * Source: https://mikro-orm.io/docs/inheritance-mapping
*/ */
export default abstract class TaxLine { export default abstract class TaxLine {
[OptionalProps]?: OptionalTaxLineProps
@PrimaryKey({ columnType: "text" }) @PrimaryKey({ columnType: "text" })
id: string id: string
@Property({ columnType: "text", nullable: true }) @Property({ columnType: "text", nullable: true })
description?: string | null description?: string | null
@Property({
columnType: "text",
nullable: true,
})
tax_rate_id?: string | null
@Property({ columnType: "text" }) @Property({ columnType: "text" })
code: string code: string

View File

@@ -1,4 +1,5 @@
import { FindConfig } from "../common" import { FindConfig } from "../common"
import { RestoreReturn, SoftDeleteReturn } from "../dal"
import { IModuleService } from "../modules-sdk" import { IModuleService } from "../modules-sdk"
import { Context } from "../shared-context" import { Context } from "../shared-context"
import { import {
@@ -329,4 +330,102 @@ export interface ICartModuleService extends IModuleService {
selector: FilterableShippingMethodTaxLineProps, selector: FilterableShippingMethodTaxLineProps,
sharedContext?: Context sharedContext?: Context
): Promise<void> ): Promise<void>
softDelete<TReturnableLinkableKeys extends string = string>(
ids: string[],
config?: SoftDeleteReturn<TReturnableLinkableKeys>,
sharedContext?: Context
): Promise<Record<TReturnableLinkableKeys, string[]> | void>
restore<TReturnableLinkableKeys extends string = string>(
ids: string[],
config?: RestoreReturn<TReturnableLinkableKeys>,
sharedContext?: Context
): Promise<Record<TReturnableLinkableKeys, string[]> | void>
softDeleteAddresses<TReturnableLinkableKeys extends string = string>(
ids: string[],
config?: SoftDeleteReturn<TReturnableLinkableKeys>,
sharedContext?: Context
): Promise<Record<TReturnableLinkableKeys, string[]> | void>
restoreAddresses<TReturnableLinkableKeys extends string = string>(
ids: string[],
config?: RestoreReturn<TReturnableLinkableKeys>,
sharedContext?: Context
): Promise<Record<TReturnableLinkableKeys, string[]> | void>
softDeleteLineItems<TReturnableLinkableKeys extends string = string>(
ids: string[],
config?: SoftDeleteReturn<TReturnableLinkableKeys>,
sharedContext?: Context
): Promise<Record<TReturnableLinkableKeys, string[]> | void>
restoreLineItems<TReturnableLinkableKeys extends string = string>(
ids: string[],
config?: RestoreReturn<TReturnableLinkableKeys>,
sharedContext?: Context
): Promise<Record<TReturnableLinkableKeys, string[]> | void>
softDeleteShippingMethods<TReturnableLinkableKeys extends string = string>(
ids: string[],
config?: SoftDeleteReturn<TReturnableLinkableKeys>,
sharedContext?: Context
): Promise<Record<TReturnableLinkableKeys, string[]> | void>
restoreShippingMethods<TReturnableLinkableKeys extends string = string>(
ids: string[],
config?: RestoreReturn<TReturnableLinkableKeys>,
sharedContext?: Context
): Promise<Record<TReturnableLinkableKeys, string[]> | void>
softDeleteLineItemAdjustments<
TReturnableLinkableKeys extends string = string
>(
ids: string[],
config?: SoftDeleteReturn<TReturnableLinkableKeys>,
sharedContext?: Context
): Promise<Record<TReturnableLinkableKeys, string[]> | void>
restoreLineItemAdjustments<TReturnableLinkableKeys extends string = string>(
ids: string[],
config?: RestoreReturn<TReturnableLinkableKeys>,
sharedContext?: Context
): Promise<Record<TReturnableLinkableKeys, string[]> | void>
softDeleteShippingMethodAdjustments<
TReturnableLinkableKeys extends string = string
>(
ids: string[],
config?: SoftDeleteReturn<TReturnableLinkableKeys>,
sharedContext?: Context
): Promise<Record<TReturnableLinkableKeys, string[]> | void>
restoreShippingMethodAdjustments<
TReturnableLinkableKeys extends string = string
>(
ids: string[],
config?: RestoreReturn<TReturnableLinkableKeys>,
sharedContext?: Context
): Promise<Record<TReturnableLinkableKeys, string[]> | void>
softDeleteLineItemTaxLines<TReturnableLinkableKeys extends string = string>(
ids: string[],
config?: SoftDeleteReturn<TReturnableLinkableKeys>,
sharedContext?: Context
): Promise<Record<TReturnableLinkableKeys, string[]> | void>
restoreLineItemTaxLines<TReturnableLinkableKeys extends string = string>(
ids: string[],
config?: RestoreReturn<TReturnableLinkableKeys>,
sharedContext?: Context
): Promise<Record<TReturnableLinkableKeys, string[]> | void>
softDeleteShippingMethodTaxLines<
TReturnableLinkableKeys extends string = string
>(
ids: string[],
config?: SoftDeleteReturn<TReturnableLinkableKeys>,
sharedContext?: Context
): Promise<Record<TReturnableLinkableKeys, string[]> | void>
restoreShippingMethodTaxLines<
TReturnableLinkableKeys extends string = string
>(
ids: string[],
config?: RestoreReturn<TReturnableLinkableKeys>,
sharedContext?: Context
): Promise<Record<TReturnableLinkableKeys, string[]> | void>
} }