88 lines
1.7 KiB
TypeScript
88 lines
1.7 KiB
TypeScript
export interface ProductRow {
|
|
id: string;
|
|
gtin: string | null;
|
|
name: string;
|
|
brand: string | null;
|
|
category_path: string | null;
|
|
status: string;
|
|
quality_score: number;
|
|
missing: string[];
|
|
updated_at: string;
|
|
}
|
|
|
|
export interface ProductImage {
|
|
id: string;
|
|
url: string;
|
|
kind: string;
|
|
license: string | null;
|
|
}
|
|
|
|
export interface MSRP {
|
|
id: string;
|
|
amount: number;
|
|
currency: string;
|
|
region: string;
|
|
effective_date: string | null;
|
|
source_url: string | null;
|
|
note: string | null;
|
|
}
|
|
|
|
export interface ProductDetail {
|
|
id: string;
|
|
gtin: string | null;
|
|
name: string;
|
|
brand_id: string | null;
|
|
brand: string | null;
|
|
category_id: string | null;
|
|
category_path: string | null;
|
|
net_content_value: number | null;
|
|
net_content_unit: string | null;
|
|
country_of_origin: string | null;
|
|
status: string;
|
|
quality_score: number;
|
|
ingredients_text: string | null;
|
|
allergens: string[];
|
|
additives: string[];
|
|
nutriments: Record<string, number> | null;
|
|
nutrition_basis: string | null;
|
|
serving_size: string | null;
|
|
nutri_score: string | null;
|
|
images: ProductImage[];
|
|
msrp: MSRP[];
|
|
missing: string[];
|
|
updated_at: string;
|
|
}
|
|
|
|
export interface Brand {
|
|
id: string;
|
|
name: string;
|
|
}
|
|
|
|
export interface Category {
|
|
id: string;
|
|
name_zh: string;
|
|
name_en: string | null;
|
|
path: string;
|
|
level: number;
|
|
}
|
|
|
|
export interface AuditEntry {
|
|
id: string;
|
|
actor: string;
|
|
action: string;
|
|
fields: string[];
|
|
created_at: string;
|
|
}
|
|
|
|
export const FIELD_LABELS: Record<string, string> = {
|
|
name: "名称",
|
|
gtin: "条码",
|
|
brand: "品牌",
|
|
category: "品类",
|
|
net_content: "净含量",
|
|
country_of_origin: "产地",
|
|
nutriments: "营养成分",
|
|
ingredients: "配料",
|
|
image: "图片",
|
|
};
|