1 import {
2 AdminInventoryItem,
3 AdminPrice,
4 AdminProductImage,
5 AdminProductVariant,
6 } from "@medusajs/types"
7
8 export const VARIANT_DETAIL_FIELDS =
9 "*inventory_items,*inventory_items.inventory,*inventory_items.inventory.location_levels,*options,*options.option,*prices,*prices.price_rules,+images.id,+images.url,+images.variants.id"
10
11 export type ExtendedVariantPrice = AdminPrice & {
12 rules?: Record<string, unknown>
13 }
14
15 export type ExtendedVariant = Omit<AdminProductVariant, "images" | "prices"> & {
16 // This field is expanded in other parts of the codebase
17 inventory?: (AdminInventoryItem & {
18 location_levels?: {
19 location_id: string
20 available_quantity: number | null
21 stocked_quantity: number
22 }[]
23 })[]
24 inventory_items?: {
25 inventory: AdminInventoryItem
26 inventory_item_id: string
27 required_quantity: number
28 }[]
29 prices: ExtendedVariantPrice[]
30 images?: (AdminProductImage & {
31 variants?: AdminProductVariant[]
32 })[]
33 }