2026-02-20 09:01:02 +04:00
|
|
|
/**
|
|
|
|
|
* Per-language translation content for an item.
|
|
|
|
|
*/
|
|
|
|
|
export interface ItemTranslation {
|
|
|
|
|
name?: string;
|
|
|
|
|
simpleDescription?: string;
|
|
|
|
|
description?: ItemDescriptionField[];
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-24 00:07:45 +04:00
|
|
|
/** Localized name entry */
|
|
|
|
|
export interface ItemName {
|
|
|
|
|
language: string;
|
|
|
|
|
value: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Localized description entry */
|
|
|
|
|
export interface ItemDescription {
|
|
|
|
|
language: string;
|
|
|
|
|
value: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Key-value attribute pair */
|
|
|
|
|
export interface ItemAttribute {
|
|
|
|
|
key: string;
|
|
|
|
|
value: string;
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-19 23:17:07 +04:00
|
|
|
export interface Item {
|
|
|
|
|
id: string;
|
|
|
|
|
name: string;
|
|
|
|
|
visible: boolean;
|
|
|
|
|
priority: number;
|
|
|
|
|
quantity: number;
|
|
|
|
|
price: number;
|
2026-02-20 10:43:47 +04:00
|
|
|
discount: number;
|
2026-01-19 23:17:07 +04:00
|
|
|
currency: string;
|
|
|
|
|
imgs: string[];
|
|
|
|
|
tags: string[];
|
2026-02-20 01:46:14 +04:00
|
|
|
badges?: string[];
|
2026-03-24 00:07:45 +04:00
|
|
|
colour?: string;
|
|
|
|
|
size?: string;
|
2026-01-19 23:17:07 +04:00
|
|
|
simpleDescription: string;
|
|
|
|
|
description: ItemDescriptionField[];
|
|
|
|
|
subcategoryId: string;
|
2026-03-24 00:07:45 +04:00
|
|
|
names?: ItemName[];
|
|
|
|
|
descriptions?: ItemDescription[];
|
|
|
|
|
attributes?: ItemAttribute[];
|
2026-01-19 23:17:07 +04:00
|
|
|
comments?: Comment[];
|
2026-02-20 09:01:02 +04:00
|
|
|
/** Optional translations keyed by language code: { ru: { name: '...', simpleDescription: '...', description: [...] } } */
|
|
|
|
|
translations?: { [lang: string]: ItemTranslation };
|
2026-01-19 23:17:07 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ItemDescriptionField {
|
|
|
|
|
key: string;
|
|
|
|
|
value: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface Comment {
|
|
|
|
|
id: string;
|
|
|
|
|
text: string;
|
|
|
|
|
createdAt: Date;
|
|
|
|
|
author?: string;
|
2026-01-22 00:41:13 +04:00
|
|
|
stars?: number;
|
2026-01-19 23:17:07 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ItemsListResponse {
|
|
|
|
|
items: Item[];
|
|
|
|
|
total: number;
|
|
|
|
|
page: number;
|
|
|
|
|
limit: number;
|
|
|
|
|
hasMore: boolean;
|
|
|
|
|
}
|