@feedmepos/mf-order-setting 0.0.2 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.dev +13 -0
- package/.env.example +11 -0
- package/.env.prod +12 -0
- package/.eslintrc.cjs +15 -0
- package/.nvmrc +1 -0
- package/.prettierrc.json +8 -0
- package/.vscode/extensions.json +8 -0
- package/README.md +31 -0
- package/dist/KioskSettingView-BTDNtWJ1.js +4 -0
- package/{app-gcisgtft.js → dist/app-XcwzVa60.js} +7363 -7390
- package/dist/app.js +6 -0
- package/dist/frontend/mf-order/src/app.d.ts +4 -0
- package/dist/frontend/mf-order/src/router/routes.d.ts +3 -0
- package/dist/frontend/mf-order/src/views/order-settings/sms/SmsSetting.vue.d.ts +2 -0
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -0
- package/env.d.ts +95 -0
- package/index.html +16 -0
- package/package.json +5 -4
- package/postcss.config.js +6 -0
- package/public/favicon.ico +0 -0
- package/src/App.vue +19 -0
- package/src/Entry.vue +42 -0
- package/src/api/auth/index.ts +20 -0
- package/src/api/delivery/index.ts +15 -0
- package/src/api/index.ts +171 -0
- package/src/api/kiosk/index.ts +22 -0
- package/src/api/menu/index.ts +13 -0
- package/src/api/order/index.ts +15 -0
- package/src/api/order-setting/index.ts +25 -0
- package/src/api/public-setting/index.ts +11 -0
- package/src/api/remoteOrder/index.ts +142 -0
- package/src/api/restaurant-setting/index.ts +55 -0
- package/src/api/table-setting/index.ts +30 -0
- package/src/app.ts +7 -0
- package/src/assets/base.css +6 -0
- package/src/assets/images/no-data.svg +35 -0
- package/src/assets/logo.svg +1 -0
- package/src/assets/main.css +1 -0
- package/src/components/GoogleMap.vue +216 -0
- package/src/components/RestaurantSelection.vue +34 -0
- package/src/components/index.ts +7 -0
- package/src/components/snackbar.ts +44 -0
- package/src/components/type.ts +103 -0
- package/src/composables/index.ts +7 -0
- package/src/composables/loading/index.ts +51 -0
- package/src/composables/search.ts +18 -0
- package/src/helpers/currency.ts +6 -0
- package/src/helpers/date.ts +29 -0
- package/src/helpers/iteration.ts +87 -0
- package/src/helpers/map.ts +92 -0
- package/src/helpers/menu.ts +166 -0
- package/src/helpers/number.ts +25 -0
- package/src/helpers/object.ts +12 -0
- package/src/helpers/profile.ts +52 -0
- package/src/i18n.ts +43 -0
- package/src/index.d.ts +3 -0
- package/src/main.ts +77 -0
- package/src/modules/kiosk/interface.ts +16 -0
- package/src/modules/order-setting/interface.ts +4 -0
- package/src/modules/order-setting/kiosk/interface.ts +52 -0
- package/src/plugins/google-maps.ts +28 -0
- package/src/router/index.ts +10 -0
- package/src/router/routes.ts +43 -0
- package/src/stores/app/index.ts +58 -0
- package/src/stores/iframe/index.ts +23 -0
- package/src/stores/kiosk/index.ts +40 -0
- package/src/stores/kiosk/mapper.ts +25 -0
- package/src/stores/menu/menu.ts +258 -0
- package/src/stores/order-setting/index.ts +61 -0
- package/src/stores/order-setting/mapper.ts +104 -0
- package/src/stores/restaurant/index.ts +138 -0
- package/src/stores/table-settings.ts +160 -0
- package/src/stores/type.ts +65 -0
- package/src/utils/constants/route.ts +15 -0
- package/src/utils/number.ts +16 -0
- package/src/utils/object.ts +15 -0
- package/src/views/all-orders/ActionMenuCell.vue +92 -0
- package/src/views/all-orders/FilterRestaurant.vue +71 -0
- package/src/views/all-orders/FilterStatus.vue +121 -0
- package/src/views/all-orders/FilterStatusMenu.vue +44 -0
- package/src/views/all-orders/Orders.vue +524 -0
- package/src/views/all-orders/ReflowOrder.vue +105 -0
- package/src/views/all-orders/UpdateDeliveryOrderDialog.vue +313 -0
- package/src/views/all-orders/order.ts +584 -0
- package/src/views/feedme-express/FeedMeExpress.vue +139 -0
- package/src/views/feedme-express/FeedMeExpressSummary.vue +62 -0
- package/src/views/kiosk/KioskSummary.vue +74 -0
- package/src/views/kiosk/KioskView.vue +140 -0
- package/src/views/kiosk/devices/KioskDeviceCard.vue +105 -0
- package/src/views/kiosk/devices/KioskDeviceDetail.vue +28 -0
- package/src/views/kiosk/devices/KioskDevicesView.vue +27 -0
- package/src/views/kiosk/devices/KioskOtpDialog.vue +15 -0
- package/src/views/kiosk/devices/KioskUnbindConfirm.vue +28 -0
- package/src/views/kiosk/settings/KioskDineInSection.vue +86 -0
- package/src/views/kiosk/settings/KioskDisplayStandSection.vue +98 -0
- package/src/views/kiosk/settings/KioskPickAtCounterSection.vue +25 -0
- package/src/views/kiosk/settings/KioskSettingView.vue +61 -0
- package/src/views/kiosk/settings/KioskTakeawaySection.vue +39 -0
- package/src/views/order-settings/OrderSettingsView.vue +52 -0
- package/src/views/order-settings/components/RestaurantSelector.vue +77 -0
- package/src/views/order-settings/delivery/DeliverySetting.vue +799 -0
- package/src/views/order-settings/delivery/LocalDelivery.vue +0 -0
- package/src/views/order-settings/delivery/components/ManualIntegratedDeliverySetting.vue +167 -0
- package/src/views/order-settings/delivery/delivery.data.ts +75 -0
- package/src/views/order-settings/delivery/delivery.ts +41 -0
- package/src/views/order-settings/delivery/inhouse/CurrencyInput.vue +47 -0
- package/src/views/order-settings/delivery/inhouse/DeliveryCustomTime.vue +235 -0
- package/src/views/order-settings/delivery/inhouse/DeliveryOrder.vue +236 -0
- package/src/views/order-settings/delivery/inhouse/DeliveryTime.vue +143 -0
- package/src/views/order-settings/delivery/inhouse/InHouseDelivery.vue +186 -0
- package/src/views/order-settings/delivery/inhouse/TimePicker.vue +76 -0
- package/src/views/order-settings/delivery/inhouse/ZoneDialog.vue +143 -0
- package/src/views/order-settings/delivery/integrated-delivery/FeedmeDelivery.vue +244 -0
- package/src/views/order-settings/delivery/integrated-delivery/FoodpandaCampaignDialog.vue +110 -0
- package/src/views/order-settings/delivery/integrated-delivery/FoodpandaSetting.vue +261 -0
- package/src/views/order-settings/delivery/integrated-delivery/GrabfoodSetting.vue +128 -0
- package/src/views/order-settings/delivery/integrated-delivery/IntegratedDelivery.vue +272 -0
- package/src/views/order-settings/delivery/integrated-delivery/ShopeefoodSetting.vue +135 -0
- package/src/views/order-settings/delivery/integrated.data.interface.ts +0 -0
- package/src/views/order-settings/dinein/DineInSetting.vue +128 -0
- package/src/views/order-settings/dinein/OfflinePaymentTypeDialog.vue +51 -0
- package/src/views/order-settings/dinein/OfflinePaymentTypeDialogContent.vue +44 -0
- package/src/views/order-settings/dinein/PaymentType.vue +172 -0
- package/src/views/order-settings/pickup/AddressInput.vue +48 -0
- package/src/views/order-settings/pickup/CustomPayment.vue +84 -0
- package/src/views/order-settings/pickup/PaymentSidesheet.vue +167 -0
- package/src/views/order-settings/pickup/PickUpPointDialog.vue +125 -0
- package/src/views/order-settings/pickup/PickUpPointDialogContent.vue +95 -0
- package/src/views/order-settings/pickup/PickUpSetting.vue +233 -0
- package/src/views/order-settings/pickup/PickUpSettingDialog.vue +148 -0
- package/src/views/order-settings/pickup/PickUpSideSheet.vue +15 -0
- package/src/views/order-settings/pickup/Preorder.vue +139 -0
- package/src/views/order-settings/servicecharge/RateInput.vue +34 -0
- package/src/views/order-settings/servicecharge/ServiceChargeRule.vue +453 -0
- package/src/views/order-settings/servicecharge/ServiceChargeSetting.vue +233 -0
- package/src/views/order-settings/sms/SmsSetting.vue +162 -0
- package/tailwind.config.js +20 -0
- package/tsconfig.app.json +25 -0
- package/tsconfig.json +18 -0
- package/tsconfig.node.json +16 -0
- package/vite.config.ts +60 -0
- package/KioskSettingView-BRJpaAwI.js +0 -4
- package/app.js +0 -5
- package/frontend/mf-order/src/app.d.ts +0 -2
- package/frontend/mf-order/tsconfig.app.tsbuildinfo +0 -1
- package/style.css +0 -1
- package/{common → dist/common}/booking/index.d.ts +0 -0
- package/{common → dist/common}/config/bank/index.d.ts +0 -0
- package/{common → dist/common}/config/bank/malaysia.d.ts +0 -0
- package/{common → dist/common}/config/bank/singapore.d.ts +0 -0
- package/{common → dist/common}/config/index.d.ts +0 -0
- package/{common → dist/common}/convertor/index.d.ts +0 -0
- package/{common → dist/common}/index.d.ts +0 -0
- package/{common → dist/common}/number/index.d.ts +0 -0
- package/{common → dist/common}/sms/index.d.ts +0 -0
- package/{common → dist/common}/util/index.d.ts +0 -0
- package/{favicon.ico → dist/favicon.ico} +0 -0
- package/{frontend → dist/frontend}/mf-order/src/App.vue.d.ts +0 -0
- package/{frontend/mf-order/src/views/all-orders/Orders.vue.d.ts → dist/frontend/mf-order/src/Entry.vue.d.ts} +0 -0
- package/{frontend → dist/frontend}/mf-order/src/api/auth/index.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/api/delivery/index.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/api/index.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/api/kiosk/index.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/api/menu/index.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/api/order/index.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/api/order-setting/index.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/api/public-setting/index.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/api/remoteOrder/index.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/api/restaurant-setting/index.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/api/table-setting/index.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/components/GoogleMap.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/components/RestaurantSelection.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/components/index.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/components/snackbar.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/components/type.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/composables/index.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/composables/loading/index.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/composables/search.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/helpers/currency.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/helpers/date.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/helpers/iteration.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/helpers/map.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/helpers/menu.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/helpers/number.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/helpers/object.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/helpers/profile.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/i18n.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/main.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/modules/kiosk/interface.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/modules/order-setting/interface.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/modules/order-setting/kiosk/interface.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/plugins/google-maps.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/router/index.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/stores/app/index.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/stores/iframe/index.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/stores/kiosk/index.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/stores/kiosk/mapper.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/stores/menu/menu.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/stores/order-setting/index.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/stores/order-setting/mapper.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/stores/restaurant/index.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/stores/table-settings.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/stores/type.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/utils/constants/route.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/utils/number.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/utils/object.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/all-orders/ActionMenuCell.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/all-orders/FilterRestaurant.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/all-orders/FilterStatus.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/all-orders/FilterStatusMenu.vue.d.ts +0 -0
- package/{frontend/mf-order/src/views/feedme-express/FeedMeExpress.vue.d.ts → dist/frontend/mf-order/src/views/all-orders/Orders.vue.d.ts} +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/all-orders/ReflowOrder.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/all-orders/UpdateDeliveryOrderDialog.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/all-orders/order.d.ts +2 -2
- package/{frontend/mf-order/src/views/kiosk/KioskView.vue.d.ts → dist/frontend/mf-order/src/views/feedme-express/FeedMeExpress.vue.d.ts} +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/feedme-express/FeedMeExpressSummary.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/kiosk/KioskSummary.vue.d.ts +0 -0
- package/{frontend/mf-order/src/views/order-settings/OrderSettingsView.vue.d.ts → dist/frontend/mf-order/src/views/kiosk/KioskView.vue.d.ts} +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/kiosk/devices/KioskDeviceCard.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/kiosk/devices/KioskDeviceDetail.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/kiosk/devices/KioskDevicesView.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/kiosk/devices/KioskOtpDialog.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/kiosk/devices/KioskUnbindConfirm.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/kiosk/settings/KioskDineInSection.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/kiosk/settings/KioskDisplayStandSection.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/kiosk/settings/KioskPickAtCounterSection.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/kiosk/settings/KioskSettingView.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/kiosk/settings/KioskTakeawaySection.vue.d.ts +0 -0
- package/{frontend/mf-order/src/views/order-settings/delivery/LocalDelivery.vue.d.ts → dist/frontend/mf-order/src/views/order-settings/OrderSettingsView.vue.d.ts} +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/components/RestaurantSelector.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/delivery/DeliverySetting.vue.d.ts +0 -0
- package/{frontend/mf-order/src/views/order-settings/dinein/DineInSetting.vue.d.ts → dist/frontend/mf-order/src/views/order-settings/delivery/LocalDelivery.vue.d.ts} +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/delivery/components/ManualIntegratedDeliverySetting.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/delivery/delivery.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/delivery/delivery.data.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/delivery/inhouse/CurrencyInput.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/delivery/inhouse/DeliveryCustomTime.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/delivery/inhouse/DeliveryOrder.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/delivery/inhouse/DeliveryTime.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/delivery/inhouse/InHouseDelivery.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/delivery/inhouse/TimePicker.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/delivery/inhouse/ZoneDialog.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/delivery/integrated-delivery/FeedmeDelivery.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/delivery/integrated-delivery/FoodpandaCampaignDialog.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/delivery/integrated-delivery/FoodpandaSetting.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/delivery/integrated-delivery/GrabfoodSetting.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/delivery/integrated-delivery/IntegratedDelivery.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/delivery/integrated-delivery/ShopeefoodSetting.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/delivery/integrated.data.interface.d.ts +0 -0
- package/{frontend/mf-order/src/views/order-settings/pickup/PickUpSideSheet.vue.d.ts → dist/frontend/mf-order/src/views/order-settings/dinein/DineInSetting.vue.d.ts} +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/dinein/OfflinePaymentTypeDialog.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/dinein/OfflinePaymentTypeDialogContent.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/dinein/PaymentType.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/pickup/AddressInput.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/pickup/CustomPayment.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/pickup/PaymentSidesheet.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/pickup/PickUpPointDialog.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/pickup/PickUpPointDialogContent.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/pickup/PickUpSetting.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/pickup/PickUpSettingDialog.vue.d.ts +0 -0
- package/{frontend/mf-order/src/views/order-settings/servicecharge/ServiceChargeSetting.vue.d.ts → dist/frontend/mf-order/src/views/order-settings/pickup/PickUpSideSheet.vue.d.ts} +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/pickup/Preorder.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/servicecharge/RateInput.vue.d.ts +0 -0
- package/{frontend → dist/frontend}/mf-order/src/views/order-settings/servicecharge/ServiceChargeRule.vue.d.ts +0 -0
- package/{frontend/mf-order/src/views/order-settings/sms/SmsSetting.vue.d.ts → dist/frontend/mf-order/src/views/order-settings/servicecharge/ServiceChargeSetting.vue.d.ts} +0 -0
- package/{package → dist/package}/entity/booking/booking.do.d.ts +0 -0
- package/{package → dist/package}/entity/booking/booking.dto.d.ts +0 -0
- package/{package → dist/package}/entity/booking/booking.enum.d.ts +0 -0
- package/{package → dist/package}/entity/business/business.dto.d.ts +0 -0
- package/{package → dist/package}/entity/clickup/clickup.dto.d.ts +0 -0
- package/{package → dist/package}/entity/cursor/cursor.dto.d.ts +0 -0
- package/{package → dist/package}/entity/delivery/delivery.do.d.ts +0 -0
- package/{package → dist/package}/entity/delivery/delivery.dto.d.ts +28 -28
- package/{package → dist/package}/entity/delivery/delivery.enum.d.ts +0 -0
- package/{package → dist/package}/entity/delivery/gateway/grab.dto.d.ts +0 -0
- package/{package → dist/package}/entity/delivery/gateway/grab.enum.d.ts +0 -0
- package/{package → dist/package}/entity/delivery/gateway/kosmo.dto.d.ts +0 -0
- package/{package → dist/package}/entity/delivery/gateway/kosmo.enum.d.ts +0 -0
- package/{package → dist/package}/entity/delivery/gateway/manual.dto.d.ts +0 -0
- package/{package → dist/package}/entity/delivery/gateway/manual.enum.d.ts +0 -0
- package/{package → dist/package}/entity/delivery/gateway/pandago.dto.d.ts +2 -2
- package/{package → dist/package}/entity/delivery/gateway/pandago.enum.d.ts +0 -0
- package/{package → dist/package}/entity/delivery/linked-delivery.do.d.ts +0 -0
- package/{package → dist/package}/entity/food-court/food-court.do.d.ts +0 -0
- package/{package → dist/package}/entity/food-court/food-court.dto.d.ts +0 -0
- package/{package → dist/package}/entity/food-court/food-court.enum.d.ts +0 -0
- package/{package → dist/package}/entity/food-court/order.do.d.ts +0 -0
- package/{package → dist/package}/entity/food-court/order.dto.d.ts +0 -0
- package/{package → dist/package}/entity/general/dateTime.dto.d.ts +0 -0
- package/{package → dist/package}/entity/general/number.dto.d.ts +0 -0
- package/{package → dist/package}/entity/general/search.dto.d.ts +0 -0
- package/{package → dist/package}/entity/incoming-order/incoming-order-to-bill.dto.d.ts +0 -0
- package/{package → dist/package}/entity/incoming-order/incoming-order.do.d.ts +0 -0
- package/{package → dist/package}/entity/incoming-order/incoming-order.dto.d.ts +0 -0
- package/{package → dist/package}/entity/incoming-order/incoming-order.enum.d.ts +0 -0
- package/{package → dist/package}/entity/index.d.ts +0 -0
- package/{package → dist/package}/entity/kiosk/kiosk.do.d.ts +0 -0
- package/{package → dist/package}/entity/kiosk/kiosk.dto.d.ts +0 -0
- package/{package → dist/package}/entity/kiosk/marketing/marketing.dto.d.ts +0 -0
- package/{package → dist/package}/entity/kiosk/scanner/scanner.do.d.ts +0 -0
- package/{package → dist/package}/entity/kiosk/scanner/scanner.dto.d.ts +0 -0
- package/{package → dist/package}/entity/kiosk/scanner/scanner.enum.d.ts +0 -0
- package/{package → dist/package}/entity/marketing/marketing.dto.d.ts +0 -0
- package/{package → dist/package}/entity/member/member.dto.d.ts +0 -0
- package/{package → dist/package}/entity/money/money.enum.d.ts +0 -0
- package/{package → dist/package}/entity/order/dine-in/dine-in.do.d.ts +0 -0
- package/{package → dist/package}/entity/order/dine-in/dine-in.dto.d.ts +0 -0
- package/{package → dist/package}/entity/order/dine-in/qr.do.d.ts +0 -0
- package/{package → dist/package}/entity/order/dine-in/reservation.do.d.ts +0 -0
- package/{package → dist/package}/entity/order/dine-in/reservation.dto.d.ts +0 -0
- package/{package → dist/package}/entity/order/effects/effect.dto.d.ts +0 -0
- package/{package → dist/package}/entity/order/effects/effect.enum.d.ts +0 -0
- package/{package → dist/package}/entity/order/menu/menu.dto.d.ts +0 -0
- package/{package → dist/package}/entity/order/order-item/order-item.dto.d.ts +0 -0
- package/{package → dist/package}/entity/order/order.do.d.ts +0 -0
- package/{package → dist/package}/entity/order/order.dto.d.ts +4 -4
- package/{package → dist/package}/entity/order/order.enum.d.ts +0 -0
- package/{package → dist/package}/entity/order/payment/payment.dto.d.ts +0 -0
- package/{package → dist/package}/entity/order/pickup/pickup.do.d.ts +0 -0
- package/{package → dist/package}/entity/order/pickup/pickup.dto.d.ts +0 -0
- package/{package → dist/package}/entity/order/timeslot/timeslot.dto.d.ts +0 -0
- package/{package → dist/package}/entity/order/timeslot/timeslot.enum.d.ts +0 -0
- package/{package → dist/package}/entity/order-platform/base-integration.do.d.ts +0 -0
- package/{package → dist/package}/entity/order-platform/foodpanda/foodpanda-menu.dto.d.ts +48 -48
- package/{package → dist/package}/entity/order-platform/foodpanda/foodpanda-order.do.d.ts +16 -16
- package/{package → dist/package}/entity/order-platform/foodpanda/foodpanda-order.dto.d.ts +6 -6
- package/{package → dist/package}/entity/order-platform/foodpanda/foodpanda-settings.do.d.ts +0 -0
- package/{package → dist/package}/entity/order-platform/foodpanda/foodpanda-settings.dto.d.ts +0 -0
- package/{package → dist/package}/entity/order-platform/foodpanda/foodpanda.enum.d.ts +0 -0
- package/{package → dist/package}/entity/order-platform/grabfood/grabfood-menu.do.d.ts +0 -0
- package/{package → dist/package}/entity/order-platform/grabfood/grabfood-order.do.d.ts +0 -0
- package/{package → dist/package}/entity/order-platform/grabfood/grabfood-settings.do.d.ts +0 -0
- package/{package → dist/package}/entity/order-platform/grabfood/grabfood.dto.d.ts +0 -0
- package/{package → dist/package}/entity/order-platform/grabfood/grabfood.enum.d.ts +0 -0
- package/{package → dist/package}/entity/order-platform/menu.dto.d.ts +0 -0
- package/{package → dist/package}/entity/order-platform/order-platform.dto.d.ts +0 -0
- package/{package → dist/package}/entity/order-platform/order-platform.enum.d.ts +0 -0
- package/{package → dist/package}/entity/order-platform/shopeefood/shopeefood-menu.do.d.ts +0 -0
- package/{package → dist/package}/entity/order-platform/shopeefood/shopeefood-order.do.d.ts +20 -20
- /package/{package → dist/package}/entity/order-platform/shopeefood/shopeefood-order.dto.d.ts +0 -0
- /package/{package → dist/package}/entity/order-platform/shopeefood/shopeefood-settings.do.d.ts +0 -0
- /package/{package → dist/package}/entity/order-platform/shopeefood/shopeefood-settings.dto.d.ts +0 -0
- /package/{package → dist/package}/entity/order-platform/shopeefood/shopeefood.enum.d.ts +0 -0
- /package/{package → dist/package}/entity/order-setting/customization/color.do.d.ts +0 -0
- /package/{package → dist/package}/entity/order-setting/customization/color.dto.d.ts +0 -0
- /package/{package → dist/package}/entity/order-setting/kiosk/kiosk.do.d.ts +0 -0
- /package/{package → dist/package}/entity/order-setting/kiosk/kiosk.dto.d.ts +0 -0
- /package/{package → dist/package}/entity/order-setting/order-setting.do.d.ts +0 -0
- /package/{package → dist/package}/entity/order-setting/order-setting.dto.d.ts +0 -0
- /package/{package → dist/package}/entity/order-setting/queue/queue.do.d.ts +0 -0
- /package/{package → dist/package}/entity/order-setting/queue/queue.dto.d.ts +0 -0
- /package/{package → dist/package}/entity/order-setting/reservation/reservation.do.d.ts +0 -0
- /package/{package → dist/package}/entity/order-setting/reservation/reservation.dto.d.ts +0 -0
- /package/{package → dist/package}/entity/order-setting/sequence/sequence.do.d.ts +0 -0
- /package/{package → dist/package}/entity/order-setting/sequence/sequence.dto.d.ts +0 -0
- /package/{package → dist/package}/entity/order-setting/sms/sms.do.d.ts +0 -0
- /package/{package → dist/package}/entity/order-setting/sms/sms.dto.d.ts +0 -0
- /package/{package → dist/package}/entity/order-setting/sms/sms.enum.d.ts +0 -0
- /package/{package → dist/package}/entity/order-setting/upselling/upselling.do.d.ts +0 -0
- /package/{package → dist/package}/entity/order-setting/upselling/upselling.dto.d.ts +0 -0
- /package/{package → dist/package}/entity/order-setting/v3/v3.do.d.ts +0 -0
- /package/{package → dist/package}/entity/order-setting/v3/v3.dto.d.ts +0 -0
- /package/{package → dist/package}/entity/pagination/pagination.dto.d.ts +0 -0
- /package/{package → dist/package}/entity/payment/payment.enum.d.ts +0 -0
- /package/{package → dist/package}/entity/printer/printer.do.d.ts +0 -0
- /package/{package → dist/package}/entity/queue/queue.do.d.ts +0 -0
- /package/{package → dist/package}/entity/queue/queue.dto.d.ts +0 -0
- /package/{package → dist/package}/entity/queue/queue.enum.d.ts +0 -0
- /package/{package → dist/package}/entity/restaurant/restaurant.dto.d.ts +0 -0
- /package/{package → dist/package}/entity/user/user.do.d.ts +0 -0
- /package/{package → dist/package}/entity/websocket/websocket.dto.d.ts +0 -0
- /package/{package → dist/package}/entity/websocket/websocket.enum.d.ts +0 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { defineStore } from 'pinia'
|
|
2
|
+
import { restaurantApi, type RestaurantSettingDoc } from '@/api/restaurant-setting'
|
|
3
|
+
import {
|
|
4
|
+
F_PAYOUT_ACCOUNT_STATUS,
|
|
5
|
+
FdoFoodpandaSettings,
|
|
6
|
+
FdoPayoutAccount,
|
|
7
|
+
FdoRestaurantDineIn,
|
|
8
|
+
FdoRestaurantFeedmeDelivery,
|
|
9
|
+
FdoRestaurantInHouseDelivery,
|
|
10
|
+
FdoRestaurantPickup,
|
|
11
|
+
FdoServiceChargeSetting,
|
|
12
|
+
FdoShopeeFoodSettings,
|
|
13
|
+
type FdoAddress,
|
|
14
|
+
type FdoProfile,
|
|
15
|
+
type FdoRestaurant
|
|
16
|
+
} from '@feedmepos/core/entity'
|
|
17
|
+
import { FdoGrabfoodSettings } from '@entity'
|
|
18
|
+
import { FeatureFlag } from '@feedmepos/core'
|
|
19
|
+
import { SvcConfig } from '@/api'
|
|
20
|
+
import { remoteOrderApi } from '@/api/remoteOrder'
|
|
21
|
+
|
|
22
|
+
export interface Profile extends FdoProfile {
|
|
23
|
+
address: Address
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface Address extends FdoAddress {
|
|
27
|
+
formatted: string
|
|
28
|
+
isValidPostcode: boolean
|
|
29
|
+
isValid: boolean
|
|
30
|
+
isValidCoordinate: boolean
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface ExtendedRestaurant extends FdoRestaurant {
|
|
34
|
+
id: string
|
|
35
|
+
profile: Profile
|
|
36
|
+
allowEPayment: true | string
|
|
37
|
+
msicCode?: string
|
|
38
|
+
tinNo?: string
|
|
39
|
+
isEInvoiceActive?: boolean
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface RestaurantState {
|
|
43
|
+
adminRestaurants: FdoRestaurant[]
|
|
44
|
+
managableRestaurants: ExtendedRestaurant[]
|
|
45
|
+
businessRestaurants: ExtendedRestaurant[]
|
|
46
|
+
currentRestaurantId: string
|
|
47
|
+
restaurantSettings: { [restaurantId: string]: RestaurantSettingDoc }
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export declare function setRestaurantId(id?: string | null): void
|
|
51
|
+
|
|
52
|
+
function initRestaurantState(): RestaurantState {
|
|
53
|
+
return {
|
|
54
|
+
adminRestaurants: [],
|
|
55
|
+
managableRestaurants: [],
|
|
56
|
+
businessRestaurants: [],
|
|
57
|
+
currentRestaurantId: '',
|
|
58
|
+
restaurantSettings: {}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
type UpdateRestaurantData = {
|
|
63
|
+
newThumbnailPhoto?: File
|
|
64
|
+
newCoverPhoto?: File
|
|
65
|
+
newPhotos?: File[]
|
|
66
|
+
msicCode?: string
|
|
67
|
+
tinNo?: string
|
|
68
|
+
isEinvoiceActive: boolean
|
|
69
|
+
} & FdoProfile
|
|
70
|
+
|
|
71
|
+
export const useRestaurantStore = defineStore('restaurant', {
|
|
72
|
+
state: () => {
|
|
73
|
+
return initRestaurantState()
|
|
74
|
+
},
|
|
75
|
+
getters: {
|
|
76
|
+
currentRestaurant: (state) => state.businessRestaurants.find((r) => r.id === state.currentRestaurantId),
|
|
77
|
+
currentRestaurantSetting: (state) => state.restaurantSettings[state.currentRestaurantId || ''],
|
|
78
|
+
payoutAccount() {
|
|
79
|
+
const account: FdoPayoutAccount = this.currentRestaurant?.payoutAccount || {
|
|
80
|
+
enable: false,
|
|
81
|
+
methods: [],
|
|
82
|
+
status: F_PAYOUT_ACCOUNT_STATUS.enum.NEW
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
isActive: account.enable,
|
|
86
|
+
canUpdate: account.status === F_PAYOUT_ACCOUNT_STATUS.enum.NEW,
|
|
87
|
+
approved: account.status === F_PAYOUT_ACCOUNT_STATUS.enum.APPROVED
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
actions: {
|
|
92
|
+
async readRestaurantSetting(restaurantId: string, config?: { forceUpdate?: boolean }) {
|
|
93
|
+
if (
|
|
94
|
+
!restaurantId ||
|
|
95
|
+
(this.restaurantSettings[restaurantId] && !(config?.forceUpdate || false))
|
|
96
|
+
)
|
|
97
|
+
return
|
|
98
|
+
const restaurantSetting = await restaurantApi.readRestaurantSetting(restaurantId)
|
|
99
|
+
this.restaurantSettings = {
|
|
100
|
+
...this.restaurantSettings,
|
|
101
|
+
[restaurantId]: restaurantSetting
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
async selectRestaurant(restaurantId: string) {
|
|
105
|
+
await this.readRestaurantSetting(restaurantId)
|
|
106
|
+
this.currentRestaurantId = restaurantId
|
|
107
|
+
SvcConfig.setRestaurantId(restaurantId)
|
|
108
|
+
setRestaurantId(restaurantId)
|
|
109
|
+
FeatureFlag.setRestaurant(restaurantId || undefined)
|
|
110
|
+
localStorage.set('feedme_restaurant', restaurantId)
|
|
111
|
+
},
|
|
112
|
+
async updateServiceCharge(serviceCharge: FdoServiceChargeSetting) {
|
|
113
|
+
await restaurantApi.updateServiceCharge(serviceCharge)
|
|
114
|
+
},
|
|
115
|
+
async updateDineInSetting(restaurantId: string, setting: FdoRestaurantDineIn) {
|
|
116
|
+
await restaurantApi.updateDineInSetting(restaurantId, setting)
|
|
117
|
+
},
|
|
118
|
+
async updatePickupSetting(restaurantId: string, setting: FdoRestaurantPickup) {
|
|
119
|
+
await restaurantApi.updatePickupSetting(restaurantId, setting)
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
async updateInhouseDelivery(restaurantId: string, dto: FdoRestaurantInHouseDelivery) {
|
|
123
|
+
await remoteOrderApi.integratedDelivery.updateInhouse(restaurantId, dto)
|
|
124
|
+
},
|
|
125
|
+
async updateFeedmeDelivery(restaurantId: string, dto: FdoRestaurantFeedmeDelivery) {
|
|
126
|
+
await remoteOrderApi.integratedDelivery.updateFeedme(restaurantId, dto)
|
|
127
|
+
},
|
|
128
|
+
async updateIntegratedFoodpandaDelivery(restaurantId: string, dto: FdoFoodpandaSettings) {
|
|
129
|
+
await remoteOrderApi.integratedDelivery.updateFoodpanda(restaurantId, dto)
|
|
130
|
+
},
|
|
131
|
+
async updateIntegratedGrabfoodDelivery(restaurantId: string, dto: FdoGrabfoodSettings) {
|
|
132
|
+
await remoteOrderApi.integratedDelivery.updateGrabfood(restaurantId, dto)
|
|
133
|
+
},
|
|
134
|
+
async updateIntegratedShopeefoodDelivery(restaurantId: string, dto: FdoShopeeFoodSettings) {
|
|
135
|
+
await remoteOrderApi.integratedDelivery.updateShopeefood(restaurantId, dto)
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
})
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { restaurantApi } from '@/api/restaurant-setting';
|
|
2
|
+
import { tableSettingApi } from '@/api/table-setting';
|
|
3
|
+
import { sort } from '@/helpers/iteration';
|
|
4
|
+
import type { FdoLayout, FdoLayoutSetting, FdoTable } from '@feedmepos/core/entity';
|
|
5
|
+
import { defineStore } from 'pinia';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
interface TableSettingState {
|
|
9
|
+
layout: FdoLayoutSetting;
|
|
10
|
+
tables: FdoTable[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface GroupedTables extends Omit<FdoLayout, 'tables'> {
|
|
14
|
+
tables: FdoTable[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function initTableSettingState(): TableSettingState {
|
|
18
|
+
return {
|
|
19
|
+
layout: {
|
|
20
|
+
_id: '',
|
|
21
|
+
// _rev: '',
|
|
22
|
+
layouts: [],
|
|
23
|
+
},
|
|
24
|
+
tables: [],
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const useTableSettingStore = defineStore('tableSetting', {
|
|
29
|
+
state: () => {
|
|
30
|
+
return initTableSettingState();
|
|
31
|
+
},
|
|
32
|
+
getters: {
|
|
33
|
+
sortedTables: (state): FdoTable[] => {
|
|
34
|
+
return sort(state.tables, { selector: 'name' });
|
|
35
|
+
},
|
|
36
|
+
sortedLayouts: (state): FdoLayout[] => {
|
|
37
|
+
const sortByName = state.layout.layouts.some((layout) => layout.position === undefined);
|
|
38
|
+
if (sortByName) {
|
|
39
|
+
return sort(state.layout.layouts, { selector: 'name' });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return state.layout.layouts.sort((a, b) => a.position - b.position);
|
|
43
|
+
},
|
|
44
|
+
groupedTables(): GroupedTables[] {
|
|
45
|
+
const withinLayouts = this.sortedLayouts.map((layout) => {
|
|
46
|
+
return {
|
|
47
|
+
...layout,
|
|
48
|
+
tables: this.sortedTables.filter((table) => layout.tables.some((v) => v.id === table._id)),
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
const tables = this.layout.layouts.flatMap((v) => v.tables).map((v) => v.id);
|
|
52
|
+
const otherTables = this.sortedTables.filter((t) => !tables.includes(t._id));
|
|
53
|
+
if (!otherTables.length) return withinLayouts;
|
|
54
|
+
return [
|
|
55
|
+
...withinLayouts,
|
|
56
|
+
{
|
|
57
|
+
id: '',
|
|
58
|
+
name: 'Other',
|
|
59
|
+
position: withinLayouts.length,
|
|
60
|
+
tables: otherTables,
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
actions: {
|
|
66
|
+
async readTables(foodCourtId?: string) {
|
|
67
|
+
const resp = await tableSettingApi.readTables();
|
|
68
|
+
|
|
69
|
+
const settings = await restaurantApi.getMobileOrderSetting();
|
|
70
|
+
if (foodCourtId != undefined){
|
|
71
|
+
this.tables = resp.map(e => ({ ...e, qrLink: `${appEndpoint.customerV3App}/dine?seat=${e.name}&fci=${foodCourtId}` }));
|
|
72
|
+
}
|
|
73
|
+
else if (settings.enableV3) {
|
|
74
|
+
this.tables = [
|
|
75
|
+
{
|
|
76
|
+
_id: '',
|
|
77
|
+
name: '#Takeaway',
|
|
78
|
+
qrLink: `${appEndpoint.customerV3App}/dine?seat=_TA_&id=${settings._id}`,
|
|
79
|
+
},
|
|
80
|
+
...resp,
|
|
81
|
+
];
|
|
82
|
+
}
|
|
83
|
+
else this.tables = resp;
|
|
84
|
+
},
|
|
85
|
+
async createTables(layout: FdoLayout | undefined, tables: string[]) {
|
|
86
|
+
await tableSettingApi.createTables(tables.map((t) => ({
|
|
87
|
+
name: t.trim(),
|
|
88
|
+
})));
|
|
89
|
+
await this.readTables();
|
|
90
|
+
if (layout) {
|
|
91
|
+
const tableIds = this.tables
|
|
92
|
+
.filter((t) => tables.includes(t.name))
|
|
93
|
+
.map((t) => t._id);
|
|
94
|
+
await this.moveTables('', layout.id, tableIds);
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
async updateTable(table: FdoTable) {
|
|
98
|
+
await tableSettingApi.updateTable(table);
|
|
99
|
+
await this.readTables();
|
|
100
|
+
},
|
|
101
|
+
async deleteTables(tableIds: string[]) {
|
|
102
|
+
this.tables = await tableSettingApi.deleteTables(tableIds);
|
|
103
|
+
},
|
|
104
|
+
async readLayouts() {
|
|
105
|
+
this.layout = await tableSettingApi.readLayouts();
|
|
106
|
+
},
|
|
107
|
+
async createLayout(name: string) {
|
|
108
|
+
this.layout = await tableSettingApi.createLayout({
|
|
109
|
+
layoutSetting: this.layout,
|
|
110
|
+
payload: {
|
|
111
|
+
id: '',
|
|
112
|
+
name,
|
|
113
|
+
position: this.layout.layouts.length,
|
|
114
|
+
tables: [],
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
async updateLayout(layout: FdoLayout) {
|
|
119
|
+
this.layout = await tableSettingApi.updateLayout({
|
|
120
|
+
...this.layout,
|
|
121
|
+
layouts: this.layout.layouts.map((l) => l.id === layout.id ? layout : l),
|
|
122
|
+
});
|
|
123
|
+
},
|
|
124
|
+
async deleteLayout(layout: FdoLayout) {
|
|
125
|
+
this.layout = await tableSettingApi.updateLayout({
|
|
126
|
+
...this.layout,
|
|
127
|
+
layouts: this.layout.layouts.filter((l) => l.id !== layout.id),
|
|
128
|
+
});
|
|
129
|
+
},
|
|
130
|
+
async moveTables(fromLayout: string, toLayout: string, tableIds: string[]) {
|
|
131
|
+
const layouts = this.layout.layouts.map(l => {
|
|
132
|
+
if (fromLayout === l.id) {
|
|
133
|
+
return {
|
|
134
|
+
...l,
|
|
135
|
+
tables: l.tables.filter((t) => !tableIds.includes(t.id))
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (toLayout === l.id) {
|
|
140
|
+
return {
|
|
141
|
+
...l,
|
|
142
|
+
tables: [
|
|
143
|
+
...l.tables,
|
|
144
|
+
...tableIds.map((id) => ({ id })),
|
|
145
|
+
],
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return l;
|
|
150
|
+
});
|
|
151
|
+
this.layout = await tableSettingApi.updateLayout({
|
|
152
|
+
...this.layout,
|
|
153
|
+
layouts,
|
|
154
|
+
});
|
|
155
|
+
},
|
|
156
|
+
async updateSetting(is: boolean) {
|
|
157
|
+
await tableSettingApi.updateSetting(is);
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export interface BaseRules {
|
|
2
|
+
create: boolean;
|
|
3
|
+
delete: boolean;
|
|
4
|
+
edit: boolean;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface ItemRules extends BaseRules {
|
|
8
|
+
sort: boolean;
|
|
9
|
+
addon: boolean;
|
|
10
|
+
code: boolean;
|
|
11
|
+
name: boolean;
|
|
12
|
+
category: boolean;
|
|
13
|
+
description: boolean;
|
|
14
|
+
thumbnail: boolean;
|
|
15
|
+
orderFrom: boolean;
|
|
16
|
+
orderFromNone: boolean;
|
|
17
|
+
orderFromActiveOnly: boolean;
|
|
18
|
+
openPrice: boolean;
|
|
19
|
+
minPrice: boolean;
|
|
20
|
+
price: boolean;
|
|
21
|
+
editPrice: boolean;
|
|
22
|
+
unit: boolean;
|
|
23
|
+
costing: boolean;
|
|
24
|
+
tax: boolean;
|
|
25
|
+
variant: boolean;
|
|
26
|
+
maxVariant: number;
|
|
27
|
+
group: boolean;
|
|
28
|
+
overrideProductGroup: boolean;
|
|
29
|
+
inventory: boolean;
|
|
30
|
+
bindToVariant: boolean;
|
|
31
|
+
print: boolean;
|
|
32
|
+
toRoot: boolean;
|
|
33
|
+
takeaway: (category?: string | null | undefined) => boolean;
|
|
34
|
+
multiScheduler: boolean;
|
|
35
|
+
canRearrange: boolean;
|
|
36
|
+
sequentialKds: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface GroupRules extends BaseRules {
|
|
40
|
+
type: boolean;
|
|
41
|
+
sort: boolean;
|
|
42
|
+
applyProduct: boolean;
|
|
43
|
+
showAppliedProduct: boolean;
|
|
44
|
+
insertRawItems: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface TakeawayRules extends BaseRules {
|
|
47
|
+
name: boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface CategoryRules extends BaseRules {
|
|
51
|
+
sort: boolean;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface MenuRules {
|
|
55
|
+
item: ItemRules;
|
|
56
|
+
category: CategoryRules;
|
|
57
|
+
group: GroupRules;
|
|
58
|
+
scheduler: { override: boolean };
|
|
59
|
+
takeaway: TakeawayRules;
|
|
60
|
+
catalog: {
|
|
61
|
+
name: boolean;
|
|
62
|
+
defaultOrderFrom: boolean;
|
|
63
|
+
markup: boolean;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const KioskRoute = '/kiosk';
|
|
2
|
+
const KioskDeviceRoute = '/kiosk/device';
|
|
3
|
+
const KioskOrderSettingRoute = '/kiosk/order-setting';
|
|
4
|
+
const OrderSettingView = '/order-settings';
|
|
5
|
+
const FeedMeExpressView = '/delivery-settings';
|
|
6
|
+
const AllOrdersView = '/orders';
|
|
7
|
+
|
|
8
|
+
export const PortalRoute = {
|
|
9
|
+
KioskRoute,
|
|
10
|
+
KioskDeviceRoute,
|
|
11
|
+
KioskOrderSettingRoute,
|
|
12
|
+
OrderSettingView,
|
|
13
|
+
FeedMeExpressView,
|
|
14
|
+
AllOrdersView,
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function applyPadDigits(value: number, padDigit : number): string{
|
|
2
|
+
let strValue: string = value.toString();
|
|
3
|
+
|
|
4
|
+
// Calculate how many digits to pad
|
|
5
|
+
let padLength: number = padDigit - strValue.length;
|
|
6
|
+
|
|
7
|
+
// Pad with padDigit character
|
|
8
|
+
if (padLength > 0) {
|
|
9
|
+
strValue = Array(padLength + 1).join('0') + strValue;
|
|
10
|
+
}
|
|
11
|
+
return strValue;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const NumberUtil = {
|
|
15
|
+
applyPadDigits,
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function clone<T>(value: T, exceptKey: (keyof T)[] = []): T {
|
|
2
|
+
const obj = JSON.parse(JSON.stringify(value));
|
|
3
|
+
if (exceptKey.length > 0) {
|
|
4
|
+
exceptKey.forEach((key): void => {
|
|
5
|
+
if (obj[key] !== undefined) {
|
|
6
|
+
delete obj[key];
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
return obj;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const ObjectUtil = {
|
|
14
|
+
clone,
|
|
15
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<FmMenu>
|
|
4
|
+
<template #menu-button>
|
|
5
|
+
<FmButton variant="tertiary" icon="more_vert" />
|
|
6
|
+
</template>
|
|
7
|
+
<FmMenuItem
|
|
8
|
+
v-for="item in actionItems"
|
|
9
|
+
:key="item.label"
|
|
10
|
+
:label="item.label"
|
|
11
|
+
selectable
|
|
12
|
+
@click="handleActionClick(item)"
|
|
13
|
+
/>
|
|
14
|
+
</FmMenu>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
import { computed, type PropType } from 'vue'
|
|
20
|
+
import { useSnackbarFunctions } from '@/components/snackbar'
|
|
21
|
+
import { SvcCompanyApiError } from '@/api'
|
|
22
|
+
|
|
23
|
+
const { showSuccess, showError, showLoading, closeLoadingSnackbar } = useSnackbarFunctions()
|
|
24
|
+
|
|
25
|
+
const props = defineProps({
|
|
26
|
+
order: {
|
|
27
|
+
type: Object as PropType<any>,
|
|
28
|
+
required: true
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
const actionItems = computed(() => {
|
|
33
|
+
return (
|
|
34
|
+
props.order?.actions.map((action: any) => ({
|
|
35
|
+
label: action.label || 'Unknown Action'
|
|
36
|
+
})) || []
|
|
37
|
+
)
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
const emits = defineEmits<{
|
|
41
|
+
(event: 'action-selected'): void
|
|
42
|
+
(event: 'action-completed', value: unknown): void
|
|
43
|
+
}>()
|
|
44
|
+
|
|
45
|
+
async function handleActionClick(clickedItem: { label: string }) {
|
|
46
|
+
const action = props.order.actions.find((action: any) => action.label === clickedItem.label)
|
|
47
|
+
|
|
48
|
+
emits('action-selected')
|
|
49
|
+
|
|
50
|
+
let loadingMsg: string | undefined
|
|
51
|
+
let successMessage: string
|
|
52
|
+
|
|
53
|
+
switch (action?.label) {
|
|
54
|
+
case 'Reject Order':
|
|
55
|
+
loadingMsg = 'Rejecting order.'
|
|
56
|
+
successMessage = 'Order successfully rejected.'
|
|
57
|
+
break
|
|
58
|
+
case 'Reflow Order':
|
|
59
|
+
loadingMsg = 'Reflowing order.'
|
|
60
|
+
successMessage = 'Order successfully reflowed.'
|
|
61
|
+
break
|
|
62
|
+
case 'Cancel order':
|
|
63
|
+
loadingMsg = 'Cancelling order.'
|
|
64
|
+
successMessage = 'Order successfully cancelled.'
|
|
65
|
+
break
|
|
66
|
+
case 'Edit':
|
|
67
|
+
loadingMsg = undefined
|
|
68
|
+
successMessage = 'Action completed successfully.'
|
|
69
|
+
break
|
|
70
|
+
default:
|
|
71
|
+
loadingMsg = 'Operation in progress.'
|
|
72
|
+
successMessage = 'Action completed successfully.'
|
|
73
|
+
break
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (loadingMsg) showLoading(loadingMsg)
|
|
77
|
+
|
|
78
|
+
try {
|
|
79
|
+
const resp = await action?.callback()
|
|
80
|
+
closeLoadingSnackbar()
|
|
81
|
+
emits('action-completed', resp)
|
|
82
|
+
showSuccess(successMessage)
|
|
83
|
+
} catch (error) {
|
|
84
|
+
closeLoadingSnackbar()
|
|
85
|
+
const errorMessage =
|
|
86
|
+
error instanceof SvcCompanyApiError
|
|
87
|
+
? error.message || 'An unknown error occurred'
|
|
88
|
+
: (error as Error).message || 'An unexpected error occurred'
|
|
89
|
+
showError(errorMessage)
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
</script>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, computed, watch } from 'vue'
|
|
3
|
+
import { FdoRestaurant } from '@feedmepos/core/entity'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
menuItems: { label: string; value: FdoRestaurant }[]
|
|
7
|
+
label: string
|
|
8
|
+
modelValue: FdoRestaurant | null
|
|
9
|
+
}>()
|
|
10
|
+
|
|
11
|
+
const emit = defineEmits(['restaurant-selected'])
|
|
12
|
+
|
|
13
|
+
const selectedRestaurant = ref<FdoRestaurant | null>(null)
|
|
14
|
+
const searchValue = ref('')
|
|
15
|
+
|
|
16
|
+
const filteredResult = computed(() =>
|
|
17
|
+
props.menuItems.filter((item) => {
|
|
18
|
+
const search = searchValue.value.toLowerCase()
|
|
19
|
+
return search
|
|
20
|
+
? item.label.toLowerCase().includes(search) || item.value._id.includes(search)
|
|
21
|
+
: true
|
|
22
|
+
})
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
const selectedLabel = computed(() =>
|
|
26
|
+
selectedRestaurant.value ? selectedRestaurant.value.profile.name : props.label
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
function selectRestaurant(restaurant: { label: string; value: FdoRestaurant }) {
|
|
30
|
+
selectedRestaurant.value = restaurant.value
|
|
31
|
+
emit('restaurant-selected', restaurant.value)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
watch(
|
|
35
|
+
() => props.modelValue,
|
|
36
|
+
(newValue) => {
|
|
37
|
+
selectedRestaurant.value = newValue
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<template>
|
|
43
|
+
<div>
|
|
44
|
+
<FmMenu>
|
|
45
|
+
<template #menu-button>
|
|
46
|
+
<div>
|
|
47
|
+
<FmButton
|
|
48
|
+
variant="tertiary"
|
|
49
|
+
prepend-icon="storefront"
|
|
50
|
+
append-icon="expand_more"
|
|
51
|
+
:label="selectedLabel"
|
|
52
|
+
class="fm-typo-en-body-md-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100"
|
|
53
|
+
:style="{ backgroundColor: '#F2F2F7' }"
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
</template>
|
|
57
|
+
<div>
|
|
58
|
+
<FmSearch v-model:model-value="searchValue" class="w-[250px]" placeholder="Filter result" />
|
|
59
|
+
</div>
|
|
60
|
+
<FmMenuDivider />
|
|
61
|
+
<FmMenuItem
|
|
62
|
+
v-for="item in filteredResult"
|
|
63
|
+
:key="item.value._id"
|
|
64
|
+
:model-value="selectedRestaurant === item.value"
|
|
65
|
+
:label="item.label"
|
|
66
|
+
@click="selectRestaurant(item)"
|
|
67
|
+
/>
|
|
68
|
+
<FmMenuItem v-if="!filteredResult.length" disabled label="No result found" />
|
|
69
|
+
</FmMenu>
|
|
70
|
+
</div>
|
|
71
|
+
</template>
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, computed, watch } from 'vue'
|
|
3
|
+
import { F_SHOPEEFOOD_ORDER_STATUS, GF_ORDER_STATUS, FP_ORDER_STATUS } from '@feedmepos/core/entity'
|
|
4
|
+
import { F_ORDER_STATUS } from '@feedmepos/ordering/package/entity'
|
|
5
|
+
import { sentenceCase } from 'change-case'
|
|
6
|
+
import FilterStatusMenu from './FilterStatusMenu.vue'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<{
|
|
9
|
+
selectedTab: string
|
|
10
|
+
hasRestaurant: boolean
|
|
11
|
+
reset?: boolean
|
|
12
|
+
}>()
|
|
13
|
+
const emit = defineEmits<{
|
|
14
|
+
(e: 'update:selectedFpStatusFilter', value: string | null): void
|
|
15
|
+
(e: 'update:selectedShopeeFoodStatusFilter', value: string | null): void
|
|
16
|
+
(e: 'update:selectedGfStatusFilter', value: string | null): void
|
|
17
|
+
(e: 'update:selectedFeedMeStatusFilter', value: string | null): void
|
|
18
|
+
}>()
|
|
19
|
+
|
|
20
|
+
const selectedFilters = {
|
|
21
|
+
foodpanda: ref<string | null>(null),
|
|
22
|
+
shopeefood: ref<string | null>(null),
|
|
23
|
+
grabfood: ref<string | null>(null),
|
|
24
|
+
feedme: ref<string | null>(null)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
watch(() => props.reset, (newVal) => {
|
|
28
|
+
if (newVal) {
|
|
29
|
+
selectedFilters.foodpanda.value = null;
|
|
30
|
+
selectedFilters.shopeefood.value = null;
|
|
31
|
+
selectedFilters.grabfood.value = null;
|
|
32
|
+
selectedFilters.feedme.value = null;
|
|
33
|
+
emit('update:selectedFpStatusFilter', null);
|
|
34
|
+
emit('update:selectedShopeeFoodStatusFilter', null);
|
|
35
|
+
emit('update:selectedGfStatusFilter', null);
|
|
36
|
+
emit('update:selectedFeedMeStatusFilter', null);
|
|
37
|
+
}
|
|
38
|
+
}, { immediate: true });
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
const filterOptions = {
|
|
42
|
+
feedme: computed(() =>
|
|
43
|
+
F_ORDER_STATUS.options.map((status) => ({
|
|
44
|
+
label: sentenceCase(status),
|
|
45
|
+
value: status
|
|
46
|
+
.replace(/_/g, ' ')
|
|
47
|
+
.toLowerCase()
|
|
48
|
+
.replace(/^\w/, (c) => c.toUpperCase())
|
|
49
|
+
}))
|
|
50
|
+
),
|
|
51
|
+
foodpanda: computed(() =>
|
|
52
|
+
FP_ORDER_STATUS.options.map((status) => ({
|
|
53
|
+
label: sentenceCase(status),
|
|
54
|
+
value: sentenceCase(status)
|
|
55
|
+
}))
|
|
56
|
+
),
|
|
57
|
+
shopeefood: computed(() =>
|
|
58
|
+
F_SHOPEEFOOD_ORDER_STATUS.options.map((status) => ({
|
|
59
|
+
label: sentenceCase(status),
|
|
60
|
+
value: sentenceCase(status)
|
|
61
|
+
}))
|
|
62
|
+
),
|
|
63
|
+
grabfood: computed(() =>
|
|
64
|
+
GF_ORDER_STATUS.options.map((status) => ({
|
|
65
|
+
label: sentenceCase(status),
|
|
66
|
+
value: sentenceCase(status)
|
|
67
|
+
}))
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
function updateFilter({ filterType, value }: { filterType: string; value: string | null }) {
|
|
71
|
+
if (filterType === 'foodpanda') {
|
|
72
|
+
selectedFilters.foodpanda.value = value
|
|
73
|
+
emit('update:selectedFpStatusFilter', value)
|
|
74
|
+
} else if (filterType === 'shopeefood') {
|
|
75
|
+
selectedFilters.shopeefood.value = value
|
|
76
|
+
emit('update:selectedShopeeFoodStatusFilter', value)
|
|
77
|
+
} else if (filterType === 'grabfood') {
|
|
78
|
+
selectedFilters.grabfood.value = value
|
|
79
|
+
emit('update:selectedGfStatusFilter', value)
|
|
80
|
+
} else if (filterType === 'feedme') {
|
|
81
|
+
selectedFilters.feedme.value = value
|
|
82
|
+
emit('update:selectedFeedMeStatusFilter', value)
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<template>
|
|
88
|
+
<div>
|
|
89
|
+
<FilterStatusMenu
|
|
90
|
+
v-if="selectedTab === 'foodpanda'"
|
|
91
|
+
:options="filterOptions.foodpanda.value"
|
|
92
|
+
:selectedFilter="selectedFilters.foodpanda.value"
|
|
93
|
+
filterType="foodpanda"
|
|
94
|
+
@update:filter="updateFilter"
|
|
95
|
+
/>
|
|
96
|
+
|
|
97
|
+
<FilterStatusMenu
|
|
98
|
+
v-if="selectedTab === 'shopeefood'"
|
|
99
|
+
:options="filterOptions.shopeefood.value"
|
|
100
|
+
:selectedFilter="selectedFilters.shopeefood.value"
|
|
101
|
+
filterType="shopeefood"
|
|
102
|
+
@update:filter="updateFilter"
|
|
103
|
+
/>
|
|
104
|
+
|
|
105
|
+
<FilterStatusMenu
|
|
106
|
+
v-if="selectedTab === 'grabfood'"
|
|
107
|
+
:options="filterOptions.grabfood.value"
|
|
108
|
+
:selectedFilter="selectedFilters.grabfood.value"
|
|
109
|
+
filterType="grabfood"
|
|
110
|
+
@update:filter="updateFilter"
|
|
111
|
+
/>
|
|
112
|
+
|
|
113
|
+
<FilterStatusMenu
|
|
114
|
+
v-if="selectedTab === 'feedme' && hasRestaurant === true"
|
|
115
|
+
:options="filterOptions.feedme.value"
|
|
116
|
+
:selectedFilter="selectedFilters.feedme.value"
|
|
117
|
+
filterType="feedme"
|
|
118
|
+
@update:filter="updateFilter"
|
|
119
|
+
/>
|
|
120
|
+
</div>
|
|
121
|
+
</template>
|