Support dine-in

This topic demonstrates the implementations of the syncStore API to support the dine-in service in a store.

Overview

In the food and beverage industry, a store can configure different service types, including:

  • Dine-in: Users dine in the eatery.
  • Pickup: Users pick up the food themselves.
  • Delivery: Users have their food delivered to a specific destination.

To support dine-in, you need to include the following dine-in-related configurations in a store:

  • Include a dine-in menu. The value of the menus.type parameter is DINEIN.
  • Contain the business rules for dine-in in the store.bizRules parameter. The value of the store.bizRules.scene parameter is DINE_IN_SCHEDULE or DINE_IN_ORDER.
  • When the value of the store.bizRules.scene parameter is DINE_IN_SCHEDULE, make sure the ruleData parameter contains available schedules during the store's opening hours and specify the supportDays parameter with a value ranging from 1 to 30.
  • When the value of the store.bizRules.scene parameter is DINE_IN_ORDER, see DineInOrderRule for specific configurations.

Note: To specify the availability of dine-in, pickup, or delivery services, see Set service availability.

Use cases

Add a store that supports dine-in

The following example demonstrates a store that supports dine-in:

  • The store opens from 8:00-23:00 every day.
  • The store supports dine-in and the dine-in service is available from 10:00-11:00 and 12:00-13:00.
  • The value of supportDays is 6, which means users can see a 6-day schedule for the dine-in service every day.
  • Users do not need to fill in the table number when dining in the eatery. And orders are served to the table.

copy
{
    "requestId": "12222211****",
    "store": {
        "storeId": "dineinstoreid01",
        "type": "RESTAURANT",
        "brandId": "Test Brand",
        "name": {
            "value": {
                "en-US": "AAdine01"
            }
        },
        "location": {
            "address": {
                "value": {
                    "en-US": "123 Braddell Tech, Lorong 8 Toa Payoh #12-14, 319123, Singapore"
                }
            },
            "latitude": "1.339953",
            "longitude": "103.858048"
        },
        "status": "OPEN",
        "contacts": [
            {
                "name": {
                    "value": {
                        "en-US": "will"
                    }
                },
                "phoneNo": "+86130******"
            }
        ],
        "contents": [
            {
                "type": "TEXT",
                "scene": "ANNOUNCEMENT",
                "value": "{\"value\":{\"en-US\":\"store abc\"}}"
            },
            {
                "type": "IMAGE",
                "scene": "BACKGROUND",
                "value": "https://omni.store-crm.com/Omni_FnbItem/store01/test.png"
            },
            {
                "type": "TEXT",
                "scene": "DESCRIPTION",
                "value": "{\"value\":{\"en-US\":\"store01\"}}"
            }
        ],
        "serviceSchedules": [
            {
                "scheduleType": "DAILY",
                "schedules": {
                    "FIXED": [
                        {
                            "startTime": "08:00+08:00",
                            "endTime": "23:00+08:00"
                        }
                    ]
                }
            }
        ],
        "bizRules": [
            {
                "scene": "DINE_IN_SCHEDULE",
                "ruleData": "[{\"scheduleType\":\"DAILY\",\"supportDays\":6,\"schedules\":{\"FIXED\":[{\"startTime\":\"10:00+08:00\",\"endTime\":\"11:00+08:00\"},{\"startTime\":\"12:00+08:00\",\"endTime\":\"13:00+08:00\"}]}}]"
            },
            {
                "scene": "DINE_IN_ORDER",
                "ruleData": "{\"isTableNoRequired\":true,\"serviceType\":\"SERVE_TO_TABLE\"}"
            }
        ],
        "menus": [
            {
                "menuId": "menu_id_01",
                "name": {
                    "value": {
                        "en-US": "Beakfast"
                    }
                },
                "status": "VALID",
                "type": "DINEIN",
                "minPrepareMinutes": 15,
                "categories": [
                    {
                        "categoryId": "category_id_01",
                        "name": {
                            "value": {
                                "en-US": "Limited Time Offer"
                            }
                        },
                        "iconUrl": "https://www.example.com/images/antfincdn/cdZOWIR73/0011icon.jpg",
                        "status": "ACTIVE",
                        "extendInfo": {
                            "subtitle": {
                                "value": {
                                    "en-US": "Main Course"
                                }
                            }
                        },
                        "items": [
                            {
                                "itemId": "item01",
                                "name": {
                                    "value": {
                                        "en-US": "Nachos Deluxe Double Beef"
                                    }
                                },
                                "status": "AVAILABLE",
                                "saleType": "SINGLE",
                                "originAmount": {
                                    "currency": "SGD",
                                    "value": "30000"
                                },
                                "saleAmount": {
                                    "currency": "SGD",
                                    "value": "1350"
                                },
                                "quantityRule": {
                                    "min": 0,
                                    "max": 99
                                },
                                "contents": [
                                    {
                                        "type": "IMAGE",
                                        "scene": "BACKGROUND",
                                        "value": "https://omni.posplus-crm.com/Omni_FnbItem/store01/NSDLX_DBBF_AC.png"
                                    },
                                    {
                                        "type": "TEXT",
                                        "scene": "DESCRIPTION",
                                        "value": "{\"value\":{\"en-US\":\"For those who prefer a cheesy meal, indulge in our Nachos Deluxe Double Beef. Served with two beef patties, American cheese, lettuce and a combination of different sauces such as mayonnaise, ketchup and Nachos Cheese sauce!\"}}"
                                    }
                                ],
                                "modifierGroups": [
                                    {
                                        "groupId": "MODIFIERGROUP-1",
                                        "name": {
                                            "value": {
                                                "en-US": "Add-On"
                                            }
                                        },
                                        "quantityRule": {
                                            "min": 0,
                                            "max": 12
                                        },
                                        "childItems": [
                                            {
                                                "itemId": "addonitem01",
                                                "name": {
                                                    "value": {
                                                        "en-US": "Add Beef Patty"
                                                    }
                                                },
                                                "saleType": "ADDON",
                                                "originAmount": {
                                                    "currency": "SGD",
                                                    "value": 0
                                                },
                                                "saleAmount": {
                                                    "currency": "SGD",
                                                    "value": 350
                                                }
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    }
}

Add dine-in service to an existing store

The following example demonstrates adding the dine-in service to an existing store (dineinstoreid01).

Note: To add the dine-in-related rules, pass a new bizRules array with existing and newly added rules, which will overwrite the data in the previous array.

copy
{
    "requestId": "12222211****",
    "store": {
        "storeId": "dineinstoreid01",
        "bizRules": [
            {
                "scene": "DINE_IN_SCHEDULE",
                "ruleData": "[{\"scheduleType\":\"DAILY\",\"supportDays\":6,\"schedules\":{\"FIXED\":[{\"startTime\":\"10:00+08:00\",\"endTime\":\"11:00+08:00\"},{\"startTime\":\"12:00+08:00\",\"endTime\":\"13:00+08:00\"}]}},{\"startTime\":\"2022-10-01T00:00:01+08:00\",\"endTime\":\"2022-10-10T00:00:01+08:00\",\"scheduleType\":\"DAILY\",\"supportDays\":6,\"schedules\":{\"FIXED\":[{\"startTime\":\"11:00+08:00\",\"endTime\":\"12:00+08:00\"},{\"startTime\":\"13:00+08:00\",\"endTime\":\"14:00+08:00\"}]}}]"
            },
            {
                "scene": "DINE_IN_ORDER",
                "ruleData": "{\"isTableNoRequired\":true,\"serviceType\":\"SERVE_TO_TABLE\"}"
            }
        ],
        "menus": [
            {
                "menuId": "menu_id_01",
                "name": {
                    "value": {
                        "en-US": "Beakfast"
                    }
                },
                "status": "VALID",
                "type": "DINEIN",
                "minPrepareMinutes": 15,
                "categories": [
                    {
                        "categoryId": "category_id_01",
                        "name": {
                            "value": {
                                "en-US": "Limited Time Offer"
                            }
                        },
                        "iconUrl": "https://www.example.com/images/antfincdn/cdZOWIR73/0011icon.jpg",
                        "status": "ACTIVE",
                        "extendInfo": {
                            "subtitle": {
                                "value": {
                                    "en-US": "Main Course"
                                }
                            }
                        },
                        "items": [
                            {
                                "itemId": "item01",
                                "name": {
                                    "value": {
                                        "en-US": "Nachos Deluxe Double Beef"
                                    }
                                },
                                "status": "AVAILABLE",
                                "saleType": "SINGLE",
                                "originAmount": {
                                    "currency": "SGD",
                                    "value": "30000"
                                },
                                "saleAmount": {
                                    "currency": "SGD",
                                    "value": "1350"
                                },
                                "quantityRule": {
                                    "min": 0,
                                    "max": 99
                                },
                                "contents": [
                                    {
                                        "type": "IMAGE",
                                        "scene": "BACKGROUND",
                                        "value": "https://omni.posplus-crm.com/Omni_FnbItem/storeabc/NSDLX_DBBF_AC.png"
                                    },
                                    {
                                        "type": "TEXT",
                                        "scene": "DESCRIPTION",
                                        "value": "{\"value\":{\"en-US\":\"For those who prefer a cheesy meal, indulge in our Nachos Deluxe Double Beef. Served with two beef patties, American cheese, lettuce and a combination of different sauces such as mayonnaise, ketchup and Nachos Cheese sauce!\"}}"
                                    }
                                ],
                                "modifierGroups": [
                                    {
                                        "groupId": "MODIFIERGROUP-1",
                                        "name": {
                                            "value": {
                                                "en-US": "Add-On"
                                            }
                                        },
                                        "quantityRule": {
                                            "min": 0,
                                            "max": 12
                                        },
                                        "childItems": [
                                            {
                                                "itemId": "addonitem01",
                                                "name": {
                                                    "value": {
                                                        "en-US": "Add Beef Patty"
                                                    }
                                                },
                                                "saleType": "ADDON",
                                                "originAmount": {
                                                    "currency": "SGD",
                                                    "value": 0
                                                },
                                                "saleAmount": {
                                                    "currency": "SGD",
                                                    "value": 350
                                                }
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    }
}