feat(product): add reusable Product Experience 2.0
Unify product details modules behind config-driven contracts so teams can extend UX without changing runtime architecture or bootstrap flow. Keep backward compatibility with existing product payloads by treating new media/specification/variant/related structures as optional extensions. Improve conversion and content discoverability with reusable actions, typed media rendering, grouped specifications, dynamic variants, and multi-collection related products.
This commit is contained in:
@@ -5,6 +5,18 @@ interface Photo {
|
||||
type?: string;
|
||||
}
|
||||
|
||||
export type ProductMediaType = 'image' | 'video' | 'pdf' | 'manual' | 'warranty';
|
||||
|
||||
export interface ProductMedia {
|
||||
id?: string;
|
||||
type: ProductMediaType;
|
||||
url: string;
|
||||
thumbnailUrl?: string;
|
||||
alt?: string;
|
||||
title?: string;
|
||||
labels?: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface DescriptionField {
|
||||
key: string;
|
||||
value: string;
|
||||
@@ -59,6 +71,47 @@ interface ItemAttribute {
|
||||
value: string;
|
||||
}
|
||||
|
||||
interface LocalizedValue {
|
||||
[language: string]: string;
|
||||
}
|
||||
|
||||
export interface ProductSpecificationField {
|
||||
key: string;
|
||||
value: string;
|
||||
label?: string;
|
||||
labels?: LocalizedValue;
|
||||
unit?: string;
|
||||
}
|
||||
|
||||
export interface ProductSpecificationGroup {
|
||||
id?: string;
|
||||
key: string;
|
||||
label?: string;
|
||||
labels?: LocalizedValue;
|
||||
attributes: ProductSpecificationField[];
|
||||
}
|
||||
|
||||
export interface ProductVariantOption {
|
||||
value: string;
|
||||
label?: string;
|
||||
labels?: LocalizedValue;
|
||||
available?: boolean;
|
||||
}
|
||||
|
||||
export interface ProductVariantOptionGroup {
|
||||
key: string;
|
||||
label?: string;
|
||||
labels?: LocalizedValue;
|
||||
options: ProductVariantOption[];
|
||||
}
|
||||
|
||||
export interface RelatedProductCollection {
|
||||
id: string;
|
||||
title: string;
|
||||
titles?: LocalizedValue;
|
||||
products: number[];
|
||||
}
|
||||
|
||||
export interface DeliveryOption {
|
||||
deliveryPrice: number;
|
||||
deliveryPlace: string;
|
||||
@@ -104,6 +157,10 @@ export interface Item {
|
||||
names?: ItemName[];
|
||||
descriptions?: ItemDescription[];
|
||||
attributes?: ItemAttribute[];
|
||||
media?: ProductMedia[];
|
||||
specificationGroups?: ProductSpecificationGroup[];
|
||||
variantOptions?: ProductVariantOptionGroup[];
|
||||
relatedCollections?: RelatedProductCollection[];
|
||||
|
||||
// BackOffice API fields
|
||||
id?: string;
|
||||
|
||||
Reference in New Issue
Block a user