From e7ccb27e4017abb634c5e325b0335ba65034dcc0 Mon Sep 17 00:00:00 2001 From: Mamalizz Date: Thu, 27 Feb 2025 20:47:28 +0330 Subject: [PATCH] added new types --- frontend/types/global.d.ts | 132 +++++++++++++++++++++++-------------- 1 file changed, 81 insertions(+), 51 deletions(-) diff --git a/frontend/types/global.d.ts b/frontend/types/global.d.ts index 16ca7f9..10f0cb4 100644 --- a/frontend/types/global.d.ts +++ b/frontend/types/global.d.ts @@ -25,71 +25,73 @@ declare global { }; type ProductVariantAttribute = { - "id": number, - "attribute_type": { - "id": number, - "name": string - }, - "value": string - } + id: number; + attribute_type: { + id: number; + name: string; + }; + value: string; + }; type ProductImage = { - "id": number, - "name": string, - "image": string - } - + id: number; + name: string; + image: string; + }; type ProductDetailItem = { - "id": number, - "title": string, - "detail_text1": string, - "detail_text2": string, - "detail_text3": string, - "detail_text4": string - } + 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 - } + id: number; + detail: ProductDetailItem[]; + detail_category: number; + }; type ProductInPackItem = { - "id": number, - "item_title": string, - "cover": string - } + 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 + 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, - "colors": string[] - } + 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; + colors: string[]; + }; - type ProductListItem = Pick + type ProductListItem = Pick< + Product, + "id" | "variants" | "name" | "rating" | "slug" | "category" | "colors" + >; type Article = { id: number; @@ -166,12 +168,40 @@ declare global { onClick?: () => void; }; + type Order = { + id: number; + count: number; + images: string[]; + discount_code: string | null; + status: string; + is_paid: boolean; + created_at: string | null; + address: Address | null; + }; + + type ServerFile = { + id: number; + file_link: string; + date: string; + size: number; + name: string; + }; + + type TicketMessage = { + id: number; + content: string; + created_at: string; + attachments: ServerFile[]; + }; + type Ticket = { id: number; + messages: TicketMessage[]; subject: string; ticket_category: string; status: string; created_at: string; updated_at: string; + order: Order; }; }