/** * Space interface. * * @link ecomm.gitngin.com/wiki/interfaces/space * @file Interface of a Space. A space reprensent an selling entity. * @author Alexandre Hébert-Vincent. * @since 01-01-2020 */ import { ObjectId } from 'bson'; import Space from '../../lib/Space'; import { IImageInfo } from '../../utils/file'; import IDeclination from '../Declination'; import { IDocument } from '../Document'; import IProductAttribute from '../ProductAttribute'; import ITranslation from '../Translation'; import { ExternalServiceSlugEnum } from '../Space/IExternalService'; export interface IQueryProps { readonly app: string; readonly api: string; readonly hpp?: number; readonly page?: number; readonly query?: string; readonly filters?: string | string[][]; readonly indice?: string; readonly f?: string; readonly space?: Space | undefined; readonly useProspr?: boolean; } export default interface IProduct { readonly id?: string; readonly slug: string; readonly name: ITranslation[]; readonly draft: boolean; readonly description?: ITranslation[]; readonly full_description?: string; readonly brand?: string; readonly category?: string; readonly documents?: IDocument[]; readonly panel_descriptions?: IPanelDescription[]; readonly product_upsells?: IProductRecommendation[]; readonly product_equivalents?: IProductEquivalent[]; readonly upsell_sku_list?: string[]; readonly is_multiple?: boolean; readonly image_files: IImageInfo[]; readonly suppliers?: IProductSupplier[]; readonly services?: any; readonly keywords?: string[]; readonly declinations?: IDeclination[]; readonly product_attributes?: IProductAttribute[]; readonly classes?: IKeyValue[]; readonly tax_family_id?: string | null; readonly restrict_sale?: IRestriction[]; readonly restrict_shipping?: string[]; readonly exclude_from_free_shipping?: boolean; readonly seo_info?: ISEOInfo; readonly default_size?: string; readonly default_size_complete?: string; readonly default_sku?: string; readonly is_service?: boolean; readonly is_hidden?: boolean; readonly is_hidden_in_client_pos?: boolean; readonly last_update_by?: string; readonly last_update?: Date; readonly custom_promo_applies?: boolean; readonly is_presale?: boolean; readonly release_date?: Date | string; readonly promise_to_purchase_association_ids?: string[]; readonly created_from_external_service?: ExternalServiceSlugEnum; readonly disable_price_auto_update?: boolean; readonly tcg_attributes?: { [key: string]: string; }; } export interface IMongoProduct extends IProduct { readonly _id?: ObjectId; } export interface IProductRecommendation { readonly name: ITranslation[]; readonly actual_qty: number; readonly recommendation_sku: string; readonly recommendation_parent_slug: string; readonly recommendation_qty: number; readonly description?: ITranslation[]; readonly draft?: boolean; readonly matching_qty?: boolean; readonly use_parent?: boolean; readonly show_recommendation_msg?: boolean; readonly is_recommendation?: boolean; readonly auto_add?: boolean; readonly auto_add_exceptions?: string[]; } export declare enum ProductRecommendationType { AUTOADD = "auto_add", RECOMMENDATION = "is_recommendation", SUGGESTED = "suggested" } export interface IProductEquivalent { readonly name: ITranslation[]; readonly recommendation_sku: string; readonly recommendation_parent_slug: string; readonly description?: ITranslation[]; readonly draft?: boolean; readonly use_parent?: boolean; } export interface IPanelDescription { readonly name: ITranslation[]; readonly label_name: ITranslation[]; readonly description: ITranslation[]; readonly draft?: boolean; readonly img?: IImageInfo; } export interface IProductSupplier { readonly supplier_id: string; readonly supplier_order: number; } export interface IKeyValue { readonly key: string; } export interface ISEOInfo { readonly seoTitle: ITranslation[]; readonly seoDescription: ITranslation[]; readonly seoImage?: IImageInfo; } export interface IRestriction { readonly restriction_type: RestrictionTypeEnum; } export declare enum RestrictionTypeEnum { ACUPUNCTURE_STUDENT = "\u00E9tudiant en acupuncture", ACUPUNCTURE = "acupunteurs", VET = "v\u00E9t\u00E9rinaires", PHYSIO = "physioth\u00E9rapeutes" } export declare enum DocumentTypeEnum { PERMIT_NUM = "num\u00E9ro de permis", PROF_ORDER_NUM = "identifiant de l'ordre profesionnel" } export declare const emptyProduct: (space?: Space) => IProduct;