feat(medusa): Separate money amount and variant (#4906)
* initial changes * working test * final changes to product tests * update integration tests * update price list integration tests * update integration tests * update unit tests * update plugin integration tests * remove catch from integration test * undo change * add andWhere * update upsertCurrencyMoneyAmount method * undo line item changes * undo changes * update deprecated method * Update packages/medusa/src/migrations/1692953518123-drop_money_amount_constraints_for_pricing_module.ts Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com> * rename joinTable * update with joinTable entity * update load methods * remove await create * re-add context test * update price list behavior for prices * update price list snapshots * re-add admin seeder * pr feedback * fix unit tests * fix plugin integration tests * initial review changes * redo changes to variant creation --------- Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com> Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
co-authored by
Carlos R. L. Rodrigues
Oli Juhl
parent
3d68be2b6b
commit
5d10c46bb1
@@ -1,20 +1,22 @@
|
||||
import { FlagRouter } from "@medusajs/utils"
|
||||
import { Router } from "express"
|
||||
import "reflect-metadata"
|
||||
import { PriceList, Product } from "../../../.."
|
||||
import TaxInclusivePricingFeatureFlag from "../../../../loaders/feature-flags/tax-inclusive-pricing"
|
||||
|
||||
import { DeleteResponse, PaginatedResponse } from "../../../../types/common"
|
||||
import middlewares, {
|
||||
transformBody,
|
||||
transformQuery,
|
||||
} from "../../../middlewares"
|
||||
import { PriceList, Product } from "../../../.."
|
||||
import {
|
||||
defaultAdminProductFields,
|
||||
defaultAdminProductRelations,
|
||||
} from "../products"
|
||||
import { AdminPostPriceListsPriceListReq } from "./create-price-list"
|
||||
import { AdminGetPriceListsPriceListProductsParams } from "./list-price-list-products"
|
||||
import middlewares, {
|
||||
transformBody,
|
||||
transformQuery,
|
||||
} from "../../../middlewares"
|
||||
|
||||
import { AdminGetPriceListPaginationParams } from "./list-price-lists"
|
||||
import { AdminGetPriceListsPriceListProductsParams } from "./list-price-list-products"
|
||||
import { AdminPostPriceListsPriceListReq } from "./create-price-list"
|
||||
import { FlagRouter } from "@medusajs/utils"
|
||||
import { Router } from "express"
|
||||
import TaxInclusivePricingFeatureFlag from "../../../../loaders/feature-flags/tax-inclusive-pricing"
|
||||
|
||||
const route = Router()
|
||||
|
||||
@@ -91,7 +93,11 @@ export const defaultAdminPriceListFields = [
|
||||
"deleted_at",
|
||||
]
|
||||
|
||||
export const defaultAdminPriceListRelations = ["prices", "customer_groups"]
|
||||
export const defaultAdminPriceListRelations = [
|
||||
"prices",
|
||||
"prices.variants",
|
||||
"customer_groups",
|
||||
]
|
||||
|
||||
/**
|
||||
* @schema AdminPriceListRes
|
||||
@@ -285,4 +291,3 @@ export * from "./get-price-list"
|
||||
export * from "./list-price-list-products"
|
||||
export * from "./list-price-lists"
|
||||
export * from "./update-price-list"
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
IsString,
|
||||
ValidateNested,
|
||||
} from "class-validator"
|
||||
import { MedusaError, isDefined } from "medusa-core-utils"
|
||||
|
||||
import { FilterableProductProps } from "../../../../types/product"
|
||||
import PriceListService from "../../../../services/price-list"
|
||||
@@ -17,7 +18,6 @@ import { ProductStatus } from "../../../../models"
|
||||
import { Request } from "express"
|
||||
import { Type } from "class-transformer"
|
||||
import { pickBy } from "lodash"
|
||||
import { isDefined } from "medusa-core-utils"
|
||||
|
||||
/**
|
||||
* @oas [get] /admin/price-lists/{id}/products
|
||||
|
||||
@@ -407,4 +407,3 @@ export * from "./set-metadata"
|
||||
export * from "./update-option"
|
||||
export * from "./update-product"
|
||||
export * from "./update-variant"
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ import {
|
||||
SalesChannelService,
|
||||
} from "../../../../services"
|
||||
|
||||
import { IInventoryService } from "@medusajs/types"
|
||||
import { Type } from "class-transformer"
|
||||
import { Product } from "../../../../models"
|
||||
import { PricedProduct } from "../../../../types/pricing"
|
||||
import { FilterableProductProps } from "../../../../types/product"
|
||||
import { IInventoryService } from "@medusajs/types"
|
||||
import { PricedProduct } from "../../../../types/pricing"
|
||||
import { Product } from "../../../../models"
|
||||
import { Type } from "class-transformer"
|
||||
|
||||
/**
|
||||
* @oas [get] /admin/products
|
||||
|
||||
Reference in New Issue
Block a user