diff --git a/integration-tests/modules/__tests__/prices/price.query.ts b/integration-tests/modules/__tests__/prices/price.query.ts deleted file mode 100644 index 4be91c3d5148e..0000000000000 --- a/integration-tests/modules/__tests__/prices/price.query.ts +++ /dev/null @@ -1,112 +0,0 @@ -import { medusaIntegrationTestRunner } from "@medusajs/test-utils" -import { ContainerRegistrationKeys } from "@medusajs/utils" -import { createAdminUser } from "../../../helpers/create-admin-user" -import { - getPricelistFixture, - getProductFixture, -} from "../../../helpers/fixtures" - -jest.setTimeout(50000) - -const env = { MEDUSA_FF_MEDUSA_V2: true } -const adminHeaders = { - headers: { "x-medusa-access-token": "test_token" }, -} - -medusaIntegrationTestRunner({ - env, - testSuite: ({ dbConnection, getContainer, api }) => { - describe("Query - Price", () => { - let appContainer, query - - beforeAll(async () => { - appContainer = getContainer() - }) - - beforeEach(async () => { - await createAdminUser(dbConnection, adminHeaders, appContainer) - }) - - describe("Query - price", () => { - let product, priceList - - beforeEach(async () => { - query = appContainer.resolve(ContainerRegistrationKeys.QUERY) - - product = ( - await api.post( - "/admin/products", - getProductFixture({ - title: "Base product", - variants: [ - { - title: "Test variant", - prices: [ - { - currency_code: "usd", - amount: 100, - }, - { - currency_code: "eur", - amount: 45, - }, - { - currency_code: "dkk", - amount: 30, - }, - ], - options: { - size: "large", - color: "green", - }, - }, - ], - }), - adminHeaders - ) - ).data.product - - priceList = ( - await api.post( - "/admin/price-lists", - getPricelistFixture({ - title: "New sale", - prices: [ - { - amount: 100, - currency_code: "usd", - variant_id: product.variants[0].id, - min_quantity: 1, - max_quantity: 100, - }, - { - amount: 80, - currency_code: "usd", - variant_id: product.variants[0].id, - min_quantity: 101, - max_quantity: 500, - }, - ], - }), - adminHeaders - ) - ).data.price_list - }) - - it("should query prices filtered by price list", async () => { - const { data } = await query.graph({ - entity: "price", - fields: ["*"], - filters: { - price_list_id: priceList.id, - // correct one - price_set_id: [], - }, - }) - - console.log("data -- ", data) - }) - }) - }) - }, -}) diff --git a/packages/core/types/src/http/fulfillment/store/index.ts b/packages/core/types/src/http/fulfillment/store/index.ts index 0789ad743e694..23a6e449e5cc8 100644 --- a/packages/core/types/src/http/fulfillment/store/index.ts +++ b/packages/core/types/src/http/fulfillment/store/index.ts @@ -75,7 +75,13 @@ export interface StoreCartShippingOption { */ amount: number + /** + * All the prices for this shipping option + */ prices: StorePrice[] + /** + * Calculated price for the shipping option + */ calculated_price: StoreCalculatedPrice } diff --git a/packages/medusa/src/api/store/shipping-options/query-config.ts b/packages/medusa/src/api/store/shipping-options/query-config.ts index d62a4ee58ac8b..07cb17ccfc3f1 100644 --- a/packages/medusa/src/api/store/shipping-options/query-config.ts +++ b/packages/medusa/src/api/store/shipping-options/query-config.ts @@ -4,12 +4,8 @@ export const defaultStoreShippingOptionsFields = [ "price_type", "service_zone_id", "shipping_profile_id", - "provider_id", - "*type", - "*provider", - "*rules", - "*rules", - "*calculated_price", + "fulfillment_provider_id", + "shipping_option_type_id", ] export const listTransformQueryConfig = {