feat: update type definitions and models
Product Model: - Add sku, price, status, category properties - Add status to ProductFilters interface Category Model: - Add parent_id property for hierarchical categories ProductOption Model: - Add name property for better identification These changes resolve TS2339 property errors throughout the application
This commit is contained in:
parent
81d9f0fdd2
commit
57287c866c
|
|
@ -2,6 +2,7 @@ export interface Category {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
|
parent_id?: number;
|
||||||
created_at: string;
|
created_at: string;
|
||||||
updated_at: string;
|
updated_at: string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ export interface Option {
|
||||||
export interface ProductOption {
|
export interface ProductOption {
|
||||||
id: number;
|
id: number;
|
||||||
title: string;
|
title: string;
|
||||||
|
name: string;
|
||||||
description: string;
|
description: string;
|
||||||
maintenance: Maintenance;
|
maintenance: Maintenance;
|
||||||
options: Option[];
|
options: Option[];
|
||||||
|
|
|
||||||
|
|
@ -33,10 +33,14 @@ export interface Product {
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
category_ids?: number[];
|
category_ids?: number[];
|
||||||
categories?: Category[];
|
categories?: Category[];
|
||||||
|
category?: Category;
|
||||||
product_option_id?: number;
|
product_option_id?: number;
|
||||||
product_option?: ProductOption;
|
product_option?: ProductOption;
|
||||||
total_sold: number;
|
total_sold: number;
|
||||||
type: number;
|
type: number;
|
||||||
|
sku?: string;
|
||||||
|
price?: number;
|
||||||
|
status?: string;
|
||||||
attributes?: Record<string, any>;
|
attributes?: Record<string, any>;
|
||||||
images: ProductImage[];
|
images: ProductImage[];
|
||||||
variants?: ProductVariant[];
|
variants?: ProductVariant[];
|
||||||
|
|
@ -75,6 +79,7 @@ export interface ProductVariantFormData {
|
||||||
export interface ProductFilters {
|
export interface ProductFilters {
|
||||||
search?: string;
|
search?: string;
|
||||||
category_id?: number;
|
category_id?: number;
|
||||||
|
status?: string;
|
||||||
min_price?: number;
|
min_price?: number;
|
||||||
max_price?: number;
|
max_price?: number;
|
||||||
page?: number;
|
page?: number;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue