import { UbDietaryLabels, UbEnergyInfoDisplayType } from '../enums/ub-menu'; import { UbTaxLabels } from '../enums/ub-utils'; import { UbQuantityConstraintRules } from './ub-quantity-constraint-rules'; import { UbHoursOfWeek, UbMultiLanguageText, UbOverride } from './ub-utils'; export interface UbMenuItem { id: string; /** for POS integrations */ external_data?: string | any; title: UbMultiLanguageText; description?: UbMultiLanguageText; /** * 1. File size must be less than 10MB * 2. Image must be in JPEG, PNG or GIF format * 3. Both width and height must be between 320px and 1144px */ image_url?: string; price_info: UbPriceRules; quantity_info?: UbQuantityConstraintRules; suspension_info?: UbSuspensionRules; modifier_group_ids?: UbModifierGroupsRules; tax_info: UbTaxInfo; nutritional_info?: UbNutritionalInfo; dish_info?: UbDishInfo; visibility_info?: UbVisibilityInfo; tax_label_info?: UbTaxLabelsRuleSet; product_info?: UbProductInfo; } export interface UbModifierGroupsRules { ids: string[]; overrides?: UbModifierGroupsRulesOverride[]; } export interface UbModifierGroupsRulesOverride extends UbOverride { ids: string[]; } export interface UbPriceRules { /** Price of the item in the lowest local currency denomination, e.g. cents. */ price: number; overrides?: UbPriceOverride[]; } export interface UbPriceOverride extends UbOverride { price: number; } /** -------------------------------------------------- */ export interface UbSuspensionRules { suspension?: UbSuspension; overrides?: UbSuspensionOverride[]; } export interface UbSuspension { /** * The time at which the item will return to being available for sale, * specified as a Unix timestamp in seconds since Jan 1, 1970. * A null value, or time in the past, * indicates that an item is available - otherwise it will be shown as “Sold Out” and unavailable to order. */ suspend_until?: number; reason?: string; } export interface UbSuspensionOverride extends UbOverride { suspension: UbSuspension; } export interface UbTaxInfo { /** 0.0 ≤ float ≤ 100.0 */ tax_rate?: number; /** 0.0 ≤ float ≤ 100.0 */ vat_rate_percentage?: number; } export interface UbNutritionalInfo { calories?: UbEnergyInfo; kilojoules?: UbEnergyInfo; } export interface UbEnergyInfo { lower_range?: number; upper_range?: number; display_type: UbEnergyInfoDisplayType; } export interface UbDishInfo { classifications?: UbClassifications; } export interface UbClassifications { can_serve_alone?: boolean; alcoholic_items?: number; dietary_label_info?: UbDietaryLabelInfo; } export interface UbDietaryLabelInfo { labels: UbDietaryLabels[]; } export interface UbVisibilityInfo { hours: UbVisibilityHours; } export interface UbVisibilityHours { start_date?: string; end_date?: string; hours_of_week: UbHoursOfWeek; } export interface UbTaxLabelsRuleSet { default_value: UbTaxLabelsInfo; } export interface UbTaxLabelsInfo { /** https://developer.uber.com/docs/eats/api/v2/get-eats-stores-storeid-menus#request-body-parameters-taxlabels */ labels: UbTaxLabels[]; /** Must be set to “MANUAL” */ source?: any; } export interface UbProductInfo { target_market?: string; gtin?: string; plu?: string; merchant_id?: string; product_type?: string; product_traits?: string[]; countries_of_origin?: string[]; }