This commit is contained in:
sdarbinyan
2026-03-24 02:47:31 +04:00
parent 5c6cb051ac
commit 09e8465577
5 changed files with 175 additions and 6 deletions

View File

@@ -11,12 +11,15 @@ export interface ItemTranslation {
export interface ItemName {
language: string;
value: string;
/** Backend typo — some responses use 'valuue' instead of 'value' */
valuue?: string;
}
/** Localized description entry */
export interface ItemDescription {
language: string;
value: string;
valuue?: string;
}
/** Key-value attribute pair */
@@ -25,6 +28,39 @@ export interface ItemAttribute {
value: string;
}
/** Item variant detail (price, size, colour per variant) */
export interface ItemDetail {
color?: string;
colour?: string;
size?: string;
price: number;
currency: string;
remaining: number;
}
/** Photo entry with type (photo or video) */
export interface Photo {
type?: string;
url: string;
}
/** Question on an item */
export interface Question {
question: string;
answer: string;
like?: number;
dislike?: number;
}
/** Review / callback on an item */
export interface Review {
rating?: number;
content?: string;
userID?: string;
answer?: string;
timestamp?: string;
}
export interface Item {
id: string;
name: string;
@@ -48,6 +84,18 @@ export interface Item {
comments?: Comment[];
/** Optional translations keyed by language code: { ru: { name: '...', simpleDescription: '...', description: [...] } } */
translations?: { [lang: string]: ItemTranslation };
// Fields from Go backend struct
itemID?: number;
categoryID?: number;
rating?: number;
visits?: number;
itemDetails?: ItemDetail[];
photos?: Photo[];
questions?: Question[];
callbacks?: Review[];
partnerID?: string;
remaining?: number;
}
export interface ItemDescriptionField {