import IProduct, { IRestriction, ISEOInfo } from '../../Product'; import IProductAttribute from '../../ProductAttribute'; import Brand from '../../../lib/Brand'; import Category from '../../../lib/Category'; import ITranslation from '../../Translation'; import { ICartItem, ICartItemPrices, IIndexedDeclination } from '../../Cart'; import Space from '../../../lib/Space'; import { IPriceRange } from '../../Algolia'; import { ObjectId } from 'bson'; import { IImageInfo } from '../../../utils/file'; import { ExternalServiceSlugEnum } from '../../Space/IExternalService'; export default interface IIndexedProduct extends Omit { readonly product_id: string; readonly description: ITranslation[]; readonly slug: string; readonly categories: { readonly [key: string]: string; }; readonly price_range: IPriceRange; readonly price_classes_range?: IPriceRange[]; readonly attributes: { readonly [key: string]: string[]; }; readonly stock_level?: { readonly web: number; readonly stores: { store_id: string; qty: number; }[]; readonly is_infinite_stock?: boolean; }; readonly price_type: 'regular' | 'discount' | 'promo'; readonly restrict_sale: IRestriction[]; readonly restrict_shipping: string[]; readonly exclude_from_free_shipping: boolean; readonly brand?: string; readonly brand_name?: ITranslation[]; readonly brand_img?: string; readonly last_update: Date; readonly last_update_by?: string; readonly last_save?: Date; readonly created_at?: Date; readonly keywords: string[]; readonly seo_info?: ISEOInfo; readonly declinations: IIndexedDeclination[]; readonly is_hidden_in_client_pos?: boolean; readonly is_presale?: boolean; readonly release_date?: Date | string; readonly tcg_attributes?: { [key: string]: string; }; readonly created_from_external_service?: ExternalServiceSlugEnum; } export interface IMongoIndexedProduct extends IIndexedProduct { readonly _id?: ObjectId | string; } export interface IIndexedProductAttributes extends IProductAttribute { readonly is_searchable: boolean; readonly is_filterable: boolean; readonly show_in_cart: boolean; } export interface IAPIProductResult { readonly name: string; readonly keywords: string; readonly description: string; readonly slug: string; readonly category: any; readonly brand?: any; readonly price_range: ICartItemPrices[][]; readonly declinations: ICartItem[]; readonly is_simple: boolean; readonly attributes: { readonly attribute_id: string; readonly attribute_name: string; readonly is_searchable: boolean; readonly is_filterable: boolean; readonly values: { readonly value: string; readonly slug: string; }[]; }[]; readonly images_path: IImageInfo[]; readonly stock_level?: { readonly web: number; readonly store: number; }; readonly price_type: 'regular_price' | 'promo_price' | 'discount_price'; readonly last_update: Date; readonly last_save?: Date; readonly created_at?: Date; } /** Pour la liste complette des slug et sku * principalement utilisé pour générer le sitemap */ export interface IProductListSitemap { slug: string; last_edit: string; declinations?: { sku: string; }[]; } export interface IIndexedDeclinationWithCategories extends IIndexedDeclination { readonly categories: ICartItem['categories']; } export declare const populateIndexedProduct: (product: IProduct, categoryTree: string[], space: Space, category?: Category, brand?: Brand) => Promise; /** * Construct a base empty IIndexedProduct object.\ * ❗_**IMPORTANT**: defaults to `draft: true`_! * @param space */ export declare const emptyIndexedProduct: (space?: Space) => IIndexedProduct;