import { PRODUCT_TYPES, PRODUCT_STOCK_STATUS, BACKORDERS } from '../utils'; import { TImage } from '.'; export type TProductType = (typeof PRODUCT_TYPES)[number]['value']; export type TProductStockStatus = (typeof PRODUCT_STOCK_STATUS)[number]['value']; export type TBackorders = (typeof BACKORDERS)[number]['value']; export type TProductAttribute = { id: string; name: string; taxonomy: string; variation: 'yes' | 'no'; visible: 'yes' | 'no'; options: { value: string; label: string; }[]; position: number; }; export type TProductBaseRecord = { id: string; type: Omit; name: string; slug: string; date_created: string; date_modified: string; status: string; featured: boolean; catalog_visibility: string; sku: string; menu_order: number; virtual: boolean; downloadable: boolean; permalink: string; edit_url: string; parent_id: string; editor: 'power-editor' | 'elementor'; description?: string; short_description?: string; page_template?: string; page_template_options?: { value: string; label: string; }[]; price_html: string; regular_price: string; sale_price: string; on_sale: boolean; sale_date_range: [number, number]; date_on_sale_from?: number; date_on_sale_to?: number; total_sales: number; stock: number | null; stock_status: TProductStockStatus; manage_stock: boolean; stock_quantity: number | null; backorders: TBackorders; backorders_allowed: boolean; backordered: boolean; low_stock_amount: number | null; upsell_ids: number[]; cross_sell_ids: number[]; attributes: TProductAttribute[]; default_attributes: { [key: string]: string; }; attribute_summary: string; category_ids: string[]; tag_ids: string[]; images: TImage[]; _subscription_price?: string; _subscription_period?: string; _subscription_period_interval?: string; _subscription_length?: string; _subscription_sign_up_fee?: string; _subscription_trial_length?: string; _subscription_trial_period?: string; children?: TProductVariationBase[]; }; export type TProductVariationBase = TProductBaseRecord & { type: Extract; };