feat: implement product detail page and define catalog interfaces
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
export interface Product {
|
||||
id: number;
|
||||
tenant_codigo: string;
|
||||
category_id: number;
|
||||
brand_id: number | null;
|
||||
slug: string;
|
||||
@@ -17,7 +16,7 @@ export interface ProductAttributeOption {
|
||||
value: string;
|
||||
label: string;
|
||||
sort_order: number;
|
||||
metadata: Record<string, any> | null;
|
||||
metadata: Record<string, unknown> | null;
|
||||
}
|
||||
|
||||
export interface ProductAttribute {
|
||||
@@ -25,19 +24,27 @@ export interface ProductAttribute {
|
||||
codigo: string;
|
||||
nombre: string;
|
||||
is_required: boolean;
|
||||
metadata_schema: Record<string, any> | null;
|
||||
metadata_schema: Record<string, unknown> | null;
|
||||
type: string;
|
||||
options: ProductAttributeOption[];
|
||||
}
|
||||
|
||||
export interface ProductVariant {
|
||||
variant_id: number;
|
||||
id: number;
|
||||
stock: number;
|
||||
definitions: Record<string, string>;
|
||||
images: string[];
|
||||
}
|
||||
|
||||
export interface ProductVariantMap {
|
||||
variant_id: number;
|
||||
stock: number;
|
||||
attributes: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface ProductDetail extends Product {
|
||||
attributes: ProductAttribute[];
|
||||
default_variant: ProductVariant | null;
|
||||
variants_map: ProductVariantMap[];
|
||||
variant: ProductVariant | null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user