| import {FoodMenuFeed, Menu, MenuItem, MenuSection, MenuItemOption, MenuItemOptionProperty_PropertyType} from './generated/food_menu'; |
| |
| const menu: Menu = { |
| menu_id: 'menu1', |
| merchant_ids: ['dining-1'], |
| display_name: {text: [{text: 'Menu', language_code: 'en-us'}]}, |
| language: 'en-us', |
| menu_section_ids: ['appetizers', 'dinner'], |
| last_merchant_update_time: new Date() |
| }; |
| |
| const section: MenuSection = { |
| menu_section_id: 'appetizers', |
| display_name: {text: [{text: 'Lunch Appetizers', language_code: 'en-us'}]}, |
| menu_section_ids: ['breadsticks-sauce'] |
| }; |
| |
| const item: MenuItem = { |
| menu_item_id: 'breadsticks-sauce', |
| display_name: {text: [{text: 'Breadsticks & Sauce', language_code: 'en-us'}]}, |
| description: { |
| text: [{ |
| text: 'Breakfast basket w/ side of tomato sauce (size 6 or 12)', |
| language_code: 'en-us' |
| }] |
| }, |
| menu_item_option_set: |
| {menu_item_option_ids: ['breadstick-sm', 'breadstick-lg']}, |
| images: [ |
| {uri: 'http://www.example.com/photos/breadsticks.jpg'}, |
| {uri: 'http://www.example.com/photos/sauce.jpg'} |
| ] |
| }; |
| |
| const option: MenuItemOption = { |
| menu_item_option_id: 'breadstick-sm', |
| value: { |
| property_type: MenuItemOptionProperty_PropertyType.SIZE, |
| text_val: { |
| text: [ |
| {text: "Small", language_code: "en-us"} |
| ] |
| } |
| }, |
| offer_set: { |
| offers: [{ |
| price: { |
| currency_code: "USD", |
| units: 8, |
| nanos: 0 |
| } |
| }] |
| } |
| }; |
| |
| const feed: FoodMenuFeed = { |
| data: [{menu}, {section}, {item}, {option}] |
| }; |
| |
| console.log(JSON.stringify(feed)); |