feat: enhance product attributes and event date handling for improved user experience and data management

This commit is contained in:
2026-08-07 14:16:02 -03:00
parent 8d88e1bb13
commit 1977df6765
18 changed files with 368 additions and 187 deletions

View File

@@ -24,13 +24,24 @@ export interface ProductAttributeOption {
metadata: Record<string, unknown> | null;
}
export type ProductAttributeType =
| 'string'
| 'number'
| 'boolean'
| 'select'
| 'multiselect'
| 'color'
| 'image'
| 'event_date';
export interface ProductAttribute {
id: number;
codigo: string;
nombre: string;
is_required: boolean;
allow_multi_select?: boolean;
metadata_schema: Record<string, unknown> | null;
type: string;
type: ProductAttributeType;
options: ProductAttributeOption[];
}
@@ -38,23 +49,17 @@ export type InventoryPolicy = 'tracked' | 'unlimited';
export interface CatalogItemVariant {
id: number;
descripcion?: string | null;
precio?: string;
event_date_id?: number | null;
event_date_ids?: number[];
event_dates?: string[];
stock_tecnico: number | null;
minimum_use_date?: string | null;
maximum_use_date?: string | null;
effective_minimum_use_date?: string | null;
effective_maximum_use_date?: string | null;
values: Record<string, string>;
}
export interface CatalogItemEventDate {
id: number;
variant_id: number;
date: string;
starts_at: string;
ends_at: string;
label: string;
stock_tecnico: number | null;
values: Record<string, string | string[]>;
}
export interface SelectedCatalogItemVariant extends CatalogItemVariant {
@@ -74,12 +79,12 @@ export interface CatalogItemDetail {
category: string | null;
brand: string | null;
inventory_policy: InventoryPolicy;
max_units_per_user?: number | null;
has_tickets: boolean;
minimum_use_date: string | null;
maximum_use_date: string | null;
attributes: ProductAttribute[];
variants: CatalogItemVariant[];
event_dates?: CatalogItemEventDate[];
selected_variant?: SelectedCatalogItemVariant;
stock_tecnico?: number | null;
images?: string[];
@@ -90,8 +95,10 @@ export type CatalogGroupLayout = 'paginated' | 'simple' | 'simple_vertical' | 'c
export interface CatalogFeaturedItemVariant {
id: number;
descripcion?: string | null;
precio?: string;
stock_tecnico: number | null;
values: Record<string, string>;
values: Record<string, string | string[]>;
}
export interface CatalogFeaturedItem {

View File

@@ -29,7 +29,6 @@ export interface PurchaseStatusResponse {
export interface PurchaseSummaryResponse extends PurchaseStatusResponse {
id: number;
event_id: number | null;
created_at: string | null;
total: string;
}
@@ -59,7 +58,6 @@ export interface PurchaseDetailResponse extends PurchaseStatusResponse {
id: number;
cart_id: number | null;
tenant_codigo: string;
event_id: number | null;
user_id: number;
created_at: string | null;
payment_method: string | null;

View File

@@ -54,10 +54,9 @@ export interface ActiveEventDate {
time_end: string;
}
export interface ActiveEvent {
id: number;
name: string;
address: string;
export interface TenantEvent {
title: string;
location: string;
dates: ActiveEventDate[];
}
@@ -108,8 +107,7 @@ export interface Tenant {
website_type_code?: string | null;
website_type?: WebsiteType | null;
extras?: WebsiteExtras;
active_event_id?: number | null;
active_event?: ActiveEvent | null;
event?: TenantEvent | null;
selected_bank_account_id?: number | null;
selected_bank_account?: BankAccount | null;
search_product_layout?: 'row' | 'column_with_image' | 'column_with_cart';

View File

@@ -0,0 +1,17 @@
export interface TimeWindowValidityTime {
id: number;
type: 'time_window';
is_valid: boolean;
start_time?: string;
end_time?: string;
}
export interface FixedWindowValidityTime {
id: number;
type: 'fixed_window';
is_valid: boolean;
fixed_starts_at?: string;
fixed_expires_at?: string;
}
export type ValidityTime = TimeWindowValidityTime | FixedWindowValidityTime;