Files
marketplaces/src/app/models/item.model.ts

78 lines
1.4 KiB
TypeScript
Raw Normal View History

2026-01-18 18:57:06 +04:00
export interface Photo {
photo?: string;
video?: string;
url: string;
type?: string;
}
2026-02-20 10:44:03 +04:00
export interface DescriptionField {
key: string;
value: string;
}
export interface Comment {
id?: string;
text: string;
author?: string;
stars?: number;
createdAt?: string;
}
export interface ItemTranslation {
name?: string;
simpleDescription?: string;
description?: DescriptionField[];
}
2026-02-26 21:54:21 +04:00
export interface Review {
2026-01-18 18:57:06 +04:00
rating?: number;
content?: string;
userID?: string;
answer?: string;
timestamp?: string;
}
2026-02-26 21:54:21 +04:00
/** @deprecated Use {@link Review} instead */
export type Callback = Review;
2026-01-18 18:57:06 +04:00
export interface Question {
question: string;
answer: string;
upvotes: number;
downvotes: number;
}
export interface Item {
categoryID: number;
itemID: number;
name: string;
photos: Photo[] | null;
description: string;
currency: string;
price: number;
discount: number;
remainings?: string;
rating: number;
2026-02-26 21:54:21 +04:00
callbacks: Review[] | null;
2026-01-18 18:57:06 +04:00
questions: Question[] | null;
partnerID?: string;
2026-02-20 10:44:03 +04:00
quantity?: number;
// BackOffice API fields
id?: string;
visible?: boolean;
priority?: number;
imgs?: string[];
tags?: string[];
badges?: string[];
simpleDescription?: string;
descriptionFields?: DescriptionField[];
subcategoryId?: string;
translations?: Record<string, ItemTranslation>;
comments?: Comment[];
2026-01-18 18:57:06 +04:00
}
export interface CartItem extends Item {
quantity: number;
}