diff --git a/frontend/types/global.d.ts b/frontend/types/global.d.ts index 72a5ca9..df12200 100644 --- a/frontend/types/global.d.ts +++ b/frontend/types/global.d.ts @@ -24,27 +24,72 @@ declare global { birth_date: string; }; - type Product = { - id: number; - price: string; - name: string; - description: string; - currency: string; - video: string | null; - image1: string; - image2: string; - image3: string; - rating: number; - view: number; - sell: number; - in_stock: number; - discount: number; - slug: string; - meta_description: string | null; - meta_keywords: null; - meta_rating: number | null; + type ProductVariantAttribute = { + "id": number, + "attribute_type": { + "id": number, + "name": string + }, + "value": string + } + + type ProductImage = { + "id": number, + "name": string, + "image": string + } + + + type ProductDetailItem = { + "id": number, + "title": string, + "detail_text1": string, + "detail_text2": string, + "detail_text3": string, + "detail_text4": string + } + + type ProductDetail = { + "id": number, + "detail": ProductDetailItem[], + "detail_category": number + } + + type ProductInPackItem = { + "id": number, + "item_title": string, + "cover": string + } + + type ProductVariant = { + "id": number, + "product_attributes": ProductVariantAttribute[], + "price": string, + "in_pack_items": ProductInPackItem[], + "details": ProductDetail[], + "images": ProductImage[], + "in_stock": number, + "discount": number, + "color": string, + "video": string | null }; + type Product = { + "id": number, + "variants": ProductVariant[], + "related_products": ProductListItem[], + "name": string, + "description": string, + "rating": number, + "slug": string, + "meta_description": string | null, + "meta_keywords": string | null, + "meta_rating": number, + "category": number, + } + + type ProductListItem = Pick + type Article = { id: number; title: string;