@feedmepos/mf-order-setting 0.0.100 → 0.0.102

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.
Files changed (43) hide show
  1. package/dist/{DisplaySystemView-bnG_JNDd.js → DisplaySystemView-jnt6letY.js} +4 -4
  2. package/dist/{FoodCourtInvitationsView-DbuetF4z.js → FoodCourtInvitationsView-DoynqFWB.js} +4 -4
  3. package/dist/{FoodCourtOrderSettingsView-BXgApCVG.js → FoodCourtOrderSettingsView-DYZLhTHy.js} +1 -1
  4. package/dist/{FoodCourtOrdersView-K0iC1arR.js → FoodCourtOrdersView-CAPOycT3.js} +3 -3
  5. package/dist/{FoodCourtStallsView-DijfdyBw.js → FoodCourtStallsView-CRMTt5BB.js} +2 -2
  6. package/dist/{FoodCourtStatusView-DTriHcSD.js → FoodCourtStatusView-C-b-eI-8.js} +1 -1
  7. package/dist/{KioskDevicesView-d2SWWkhC.js → KioskDevicesView-B0U9JxRl.js} +1 -1
  8. package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-DA6c96uZ.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-V3ai4FVI.js} +5 -5
  9. package/dist/{KioskSettingView-I7Hgzrvr.js → KioskSettingView-rdom_aS8.js} +3 -3
  10. package/dist/{KioskView-B_lLNsaU.js → KioskView-DOON9zR6.js} +6 -6
  11. package/dist/{OrderSettingsView-8OS93YGL.js → OrderSettingsView-BBCnekaj.js} +10959 -10953
  12. package/dist/{RestaurantSelector.vue_vue_type_script_setup_true_lang-K0oCZMt8.js → RestaurantSelector.vue_vue_type_script_setup_true_lang-DjoTyV6m.js} +1 -1
  13. package/dist/{app-qdN8kXAM.js → app-Dvk30CIa.js} +511 -507
  14. package/dist/app.js +1 -1
  15. package/dist/{dayjs.min-C-IKwmsU.js → dayjs.min-DUFHhM7O.js} +1 -1
  16. package/dist/{featureFlag-z_-AhzUC.js → featureFlag-BvcirzHS.js} +1 -1
  17. package/dist/frontend/mf-order/src/api/order-setting/index.d.ts +3 -1
  18. package/dist/frontend/mf-order/src/api/order-setting/queue-counter.d.ts +14 -0
  19. package/dist/frontend/mf-order/src/app.d.ts +4 -0
  20. package/dist/frontend/mf-order/src/main.d.ts +4 -0
  21. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  22. package/dist/{index-BxK-mqfV.js → index-C4n5H7t3.js} +1 -1
  23. package/dist/index-C5n6lil6.js +39 -0
  24. package/dist/{index-DjtNAyFp.js → index-CGxCWKHB.js} +4 -4
  25. package/dist/{index-BK-RT8YN.js → index-CW4VlFWz.js} +1 -1
  26. package/dist/{index-WSlqpTW2.js → index-CaHG3M7C.js} +1 -1
  27. package/dist/{index-DfsaaxdM.js → index-ILnighyU.js} +1 -1
  28. package/dist/{order.dto-BTF8MlM5.js → order.dto-Cb_gh3iB.js} +1119 -1116
  29. package/dist/package/entity/order-setting/order-setting.dto.d.ts +236 -2
  30. package/dist/package/entity/order-setting/queue/queue.dto.d.ts +263 -0
  31. package/package.json +1 -1
  32. package/src/api/order-setting/index.ts +4 -2
  33. package/src/api/order-setting/queue-counter.spec.ts +74 -0
  34. package/src/api/order-setting/queue-counter.ts +34 -0
  35. package/src/locales/en-US.json +1 -0
  36. package/src/locales/ja-JP.json +1 -0
  37. package/src/locales/th-TH.json +1 -0
  38. package/src/locales/zh-CN.json +1 -0
  39. package/src/views/order-settings/queue/QueueSetting.source.spec.ts +29 -0
  40. package/src/views/order-settings/queue/QueueSetting.vue +22 -1
  41. package/src/views/order-settings/reservation/ReservationSetting.vue +710 -715
  42. package/src/views/order-settings/reservation/reservation-pos-note.spec.ts +42 -0
  43. package/dist/index-DeUtM1Z8.js +0 -24
@@ -19,6 +19,7 @@ import { useSnackbarFunctions } from '@/components/snackbar'
19
19
  import { useDialog } from '@feedmepos/ui-library'
20
20
  import moment from 'moment'
21
21
  import CopySettingsSheet from './CopySettingsSheet.vue'
22
+ import { RESERVATION_MIN_POS_VERSION } from '../dine-in/reservation-pos'
22
23
  import notfound from '@/assets/images/not-found.png'
23
24
 
24
25
  const { t } = useI18n()
@@ -779,821 +780,815 @@ function handleCopySettings(copiedSettings: Partial<FdoOrderReservationSettingsV
779
780
  <div class="flex-grow fm-typo-en-title-sm-600 mb-16">
780
781
  {{ t('order.reservationStatus') }}
781
782
  </div>
783
+ <!-- ITS-002856: the same version note as the promotion's time-based rule, so a merchant on
784
+ POS v7 learns before switching on that its staff would never see the bookings. -->
785
+ <FmHelperText
786
+ class="mb-8"
787
+ :state="'warning'"
788
+ :text="t('order.reservationNeedsPosV8', { min: RESERVATION_MIN_POS_VERSION })"
789
+ />
790
+ <!-- Online booking only: staff keep booking on POS while it is off, and an unset
791
+ value is on, as reservation-backend reads it (isRangeEnabled). Closing the
792
+ outlet to POS too is "Accept reservation" in the Dine-in tab. -->
782
793
  <FmSwitch
783
794
  label-placement="right"
784
- :label="'Enable reservation'"
785
- :sublabel="'Enable this to make the outlet available for reservations. This setting does not impact walk-in dining.'"
786
- :model-value="rangeSetting.enable ?? false"
795
+ :label="'Online booking'"
796
+ :sublabel="'Customers can book this outlet online. When off, staff can still add bookings on POS. This setting does not impact walk-in dining.'"
797
+ :model-value="rangeSetting.enable !== false"
787
798
  @update:model-value="(v: boolean) => (rangeSetting.enable = v)"
788
799
  />
789
800
 
790
- <div v-if="rangeSetting.enable && isMultiOutlet" class="ml-56 my-8">
801
+ <div v-if="isMultiOutlet" class="ml-56 my-8">
791
802
  <CopySettingsSheet :current-settings="reservationSettings" @apply="handleCopySettings" />
792
803
  </div>
793
804
  </div>
794
805
 
795
- <template v-if="rangeSetting.enable">
796
- <!-- Notification Settings Section -->
797
- <div class="flex flex-col">
798
- <div class="flex-grow fm-typo-en-title-sm-600 my-8">
799
- {{ t('order.notificationSettings') }}
806
+ <!-- Notification Settings Section -->
807
+ <div class="flex flex-col">
808
+ <div class="flex-grow fm-typo-en-title-sm-600 my-8">
809
+ {{ t('order.notificationSettings') }}
810
+ </div>
811
+ <FmCard variant="outlined" class="p-5">
812
+ <div class="mb-5">
813
+ <FmSwitch
814
+ :model-value="reservationSettings.smsEnabled"
815
+ @update:model-value="(v: boolean) => updateSetting('smsEnabled', v)"
816
+ :label="t('order.smsEnabled')"
817
+ label-placement="right"
818
+ :sublabel="t('order.smsEnabledDescription')"
819
+ />
800
820
  </div>
801
- <FmCard variant="outlined" class="p-5">
802
- <div class="mb-5">
803
- <FmSwitch
804
- :model-value="reservationSettings.smsEnabled"
805
- @update:model-value="(v: boolean) => updateSetting('smsEnabled', v)"
806
- :label="t('order.smsEnabled')"
807
- label-placement="right"
808
- :sublabel="t('order.smsEnabledDescription')"
809
- />
810
- </div>
811
- <div class="mb-5">
812
- <FmSwitch
813
- :model-value="reservationSettings.emailEnabled"
814
- @update:model-value="(v: boolean) => updateSetting('emailEnabled', v)"
815
- :label="t('order.emailEnabled')"
816
- label-placement="right"
817
- :sublabel="t('order.emailEnabledDescription')"
818
- />
821
+ <div class="mb-5">
822
+ <FmSwitch
823
+ :model-value="reservationSettings.emailEnabled"
824
+ @update:model-value="(v: boolean) => updateSetting('emailEnabled', v)"
825
+ :label="t('order.emailEnabled')"
826
+ label-placement="right"
827
+ :sublabel="t('order.emailEnabledDescription')"
828
+ />
829
+ </div>
830
+ <div class="mb-5">
831
+ <FmSwitch
832
+ :model-value="reservationSettings.notifyOnConfirm"
833
+ @update:model-value="(v: boolean) => updateSetting('notifyOnConfirm', v)"
834
+ :label="t('order.notifyOnConfirm')"
835
+ label-placement="right"
836
+ :sublabel="t('order.notifyOnConfirmDescription')"
837
+ />
838
+ </div>
839
+ <div class="mb-5">
840
+ <FmSwitch
841
+ :model-value="reservationSettings.notifyOnCancel"
842
+ @update:model-value="(v: boolean) => updateSetting('notifyOnCancel', v)"
843
+ :label="t('order.notifyOnCancel')"
844
+ label-placement="right"
845
+ :sublabel="t('order.notifyOnCancelDescription')"
846
+ />
847
+ </div>
848
+ <div class="mb-5">
849
+ <div class="mb-8 fm-typo-en-body-md-600 flex items-center gap-8">
850
+ {{ t('order.draftHoldTimeMinutes') }}
851
+ <FmTooltip
852
+ :content="'The amount of time a reservation is held before it is automatically released.'"
853
+ >
854
+ <FmIcon name="info" outline size="sm" class="cursor-pointer" />
855
+ </FmTooltip>
819
856
  </div>
820
- <div class="mb-5">
821
- <FmSwitch
822
- :model-value="reservationSettings.notifyOnConfirm"
823
- @update:model-value="(v: boolean) => updateSetting('notifyOnConfirm', v)"
824
- :label="t('order.notifyOnConfirm')"
825
- label-placement="right"
826
- :sublabel="t('order.notifyOnConfirmDescription')"
827
- />
857
+ <FmTextField
858
+ type="number"
859
+ :model-value="reservationSettings.draftHoldTimeMinutes"
860
+ @update:model-value="
861
+ (v: string | number) =>
862
+ updateSetting('draftHoldTimeMinutes', v === '' ? 15 : Number(v))
863
+ "
864
+ suffix="minutes"
865
+ class="max-w-md"
866
+ />
867
+ </div>
868
+ <div class="mb-5">
869
+ <FmSwitch
870
+ :model-value="reservationSettings.posCanOverbook"
871
+ @update:model-value="(v: boolean) => updateSetting('posCanOverbook', v)"
872
+ :label="t('order.posCanOverbook')"
873
+ label-placement="right"
874
+ :sublabel="t('order.posCanOverbookDescription')"
875
+ />
876
+ </div>
877
+ </FmCard>
878
+ </div>
879
+
880
+ <div class="flex flex-col">
881
+ <div class="flex-grow fm-typo-en-title-sm-600 mb-4">
882
+ {{ t('order.reservationAvailability') }}
883
+ </div>
884
+ <div class="fm-typo-en-body-lg-400 text-fm-color-typo-secondary mb-24">
885
+ This shows when guests can make reservations based on your current settings. The
886
+ availability updates automatically.
887
+ </div>
888
+ <!-- Availability settings (eg. the min/max lead, and time interval + booking duration) -->
889
+ <div class="mb-24">
890
+ <div class="mb-8">Preview</div>
891
+ <div class="flex items-center gap-4 mb-8">
892
+ <div
893
+ class="w-fit border-1 border-fm-color-neutral-gray-200 rounded-md py-4 px-8 bg-fm-color-neutral-gray-100 flex items-center gap-8 text-fm-color-typo-tertiary"
894
+ >
895
+ <FmIcon name="calendar_month" outline />
896
+ <div class="pr-6">
897
+ {{ reservationPreview.start + ' ' + reservationPreview.startHour }}
898
+ </div>
828
899
  </div>
829
- <div class="mb-5">
830
- <FmSwitch
831
- :model-value="reservationSettings.notifyOnCancel"
832
- @update:model-value="(v: boolean) => updateSetting('notifyOnCancel', v)"
833
- :label="t('order.notifyOnCancel')"
834
- label-placement="right"
835
- :sublabel="t('order.notifyOnCancelDescription')"
836
- />
900
+ <div>to</div>
901
+ <div
902
+ class="w-fit border-1 border-fm-color-neutral-gray-200 rounded-md py-4 px-8 bg-fm-color-neutral-gray-100 flex items-center gap-8 text-fm-color-typo-tertiary"
903
+ >
904
+ <FmIcon name="calendar_month" outline />
905
+ <div class="pr-6">
906
+ {{ reservationPreview.end + ' ' + reservationPreview.endHour }}
907
+ </div>
837
908
  </div>
838
- <div class="mb-5">
909
+ </div>
910
+ <div class="fm-typo-en-body-md-400 text-fm-color-typo-secondary">
911
+ Reservations will open on
912
+ <strong> {{ reservationPreview.start + ', ' + reservationPreview.startHour }} </strong>.
913
+ Guests will not be able to make reservations before this time.
914
+ </div>
915
+ </div>
916
+
917
+ <div class="mb-24">
918
+ <div class="mb-8">Presets</div>
919
+ <FmRadioGroup
920
+ :model-value="selectedPreset"
921
+ @update:model-value="(v: number | 'custom') => updateMaxLeadPreset(v)"
922
+ >
923
+ <FmRadio label="30 days" :value="30">
924
+ <template #label>
925
+ <div>30 days <span class="text-fm-color-typo-secondary">(default)</span></div>
926
+ </template>
927
+ </FmRadio>
928
+ <FmRadio label="60 days" :value="60" />
929
+ <FmRadio label="90 days" :value="90" />
930
+ <FmRadio label="Custom" :value="'custom'" />
931
+ </FmRadioGroup>
932
+
933
+ <!-- Custom preset fields -->
934
+ <div
935
+ v-if="selectedPreset === 'custom'"
936
+ class="ml-32 mt-12 p-16 border rounded-md bg-fm-color-neutral-gray-50"
937
+ >
938
+ <div class="mb-16">
839
939
  <div class="mb-8 fm-typo-en-body-md-600 flex items-center gap-8">
840
- {{ t('order.draftHoldTimeMinutes') }}
940
+ Minimum Lead Time
841
941
  <FmTooltip
842
- :content="'The amount of time a reservation is held before it is automatically released.'"
942
+ :content="'The earliest time a guest can make a reservation. For example, if you set this to 1 day, guests can only make reservations from tomorrow onwards.'"
843
943
  >
844
944
  <FmIcon name="info" outline size="sm" class="cursor-pointer" />
845
945
  </FmTooltip>
846
946
  </div>
847
- <FmTextField
848
- type="number"
849
- :model-value="reservationSettings.draftHoldTimeMinutes"
850
- @update:model-value="
851
- (v: string | number) =>
852
- updateSetting('draftHoldTimeMinutes', v === '' ? 15 : Number(v))
853
- "
854
- suffix="minutes"
855
- class="max-w-md"
856
- />
857
- </div>
858
- <div class="mb-5">
859
- <FmSwitch
860
- :model-value="reservationSettings.posCanOverbook"
861
- @update:model-value="(v: boolean) => updateSetting('posCanOverbook', v)"
862
- :label="t('order.posCanOverbook')"
863
- label-placement="right"
864
- :sublabel="t('order.posCanOverbookDescription')"
865
- />
947
+ <div class="flex items-center gap-8">
948
+ <FmStepperField
949
+ :model-value="rangeSetting.minLeadDuration.value"
950
+ @update:model-value="(v: number) => updateMinLeadValue(v)"
951
+ :min="0"
952
+ class=""
953
+ />
954
+ <FmSelect
955
+ :model-value="rangeSetting.minLeadDuration.unit"
956
+ @update:model-value="(v: 'hour' | 'day') => updateMinLeadUnit(v)"
957
+ :items="[
958
+ { label: 'Hours', value: 'hour' },
959
+ { label: 'Days', value: 'day' }
960
+ ]"
961
+ class="w-120"
962
+ />
963
+ </div>
866
964
  </div>
867
- </FmCard>
868
- </div>
869
965
 
870
- <div class="flex flex-col">
871
- <div class="flex-grow fm-typo-en-title-sm-600 mb-4">
872
- {{ t('order.reservationAvailability') }}
873
- </div>
874
- <div class="fm-typo-en-body-lg-400 text-fm-color-typo-secondary mb-24">
875
- This shows when guests can make reservations based on your current settings. The
876
- availability updates automatically.
877
- </div>
878
- <!-- Availability settings (eg. the min/max lead, and time interval + booking duration) -->
879
- <div class="mb-24">
880
- <div class="mb-8">Preview</div>
881
- <div class="flex items-center gap-4 mb-8">
882
- <div
883
- class="w-fit border-1 border-fm-color-neutral-gray-200 rounded-md py-4 px-8 bg-fm-color-neutral-gray-100 flex items-center gap-8 text-fm-color-typo-tertiary"
884
- >
885
- <FmIcon name="calendar_month" outline />
886
- <div class="pr-6">
887
- {{ reservationPreview.start + ' ' + reservationPreview.startHour }}
888
- </div>
966
+ <div>
967
+ <div class="mb-8 fm-typo-en-body-md-600 flex items-center gap-8">
968
+ Maximum Lead Time
969
+ <FmTooltip
970
+ :content="'The furthest in advance a guest can make a reservation. For example, if you set this to 30 days, guests can only make reservations up to 30 days from today.'"
971
+ >
972
+ <FmIcon name="info" outline size="sm" class="cursor-pointer" />
973
+ </FmTooltip>
889
974
  </div>
890
- <div>to</div>
891
- <div
892
- class="w-fit border-1 border-fm-color-neutral-gray-200 rounded-md py-4 px-8 bg-fm-color-neutral-gray-100 flex items-center gap-8 text-fm-color-typo-tertiary"
893
- >
894
- <FmIcon name="calendar_month" outline />
895
- <div class="pr-6">
896
- {{ reservationPreview.end + ' ' + reservationPreview.endHour }}
897
- </div>
975
+ <div class="flex items-center gap-8">
976
+ <FmStepperField
977
+ :model-value="rangeSetting.maxLeadDuration.value"
978
+ @update:model-value="(v: number) => updateMaxLeadValue(v)"
979
+ :min="0"
980
+ class=""
981
+ />
982
+ <FmSelect
983
+ :model-value="rangeSetting.maxLeadDuration.unit"
984
+ @update:model-value="(v: 'hour' | 'day') => updateMaxLeadUnit(v)"
985
+ :items="[
986
+ { label: 'Hours', value: 'hour' },
987
+ { label: 'Days', value: 'day' }
988
+ ]"
989
+ class="w-120"
990
+ />
898
991
  </div>
899
992
  </div>
900
- <div class="fm-typo-en-body-md-400 text-fm-color-typo-secondary">
901
- Reservations will open on
902
- <strong> {{ reservationPreview.start + ', ' + reservationPreview.startHour }} </strong>.
903
- Guests will not be able to make reservations before this time.
993
+
994
+ <!-- Validation error message -->
995
+ <div v-if="validateLeadDurationLocal()" class="mt-16 text-sm text-red-600">
996
+ {{ validateLeadDurationLocal() }}
904
997
  </div>
905
998
  </div>
999
+ </div>
1000
+ </div>
906
1001
 
907
- <div class="mb-24">
908
- <div class="mb-8">Presets</div>
909
- <FmRadioGroup
910
- :model-value="selectedPreset"
911
- @update:model-value="(v: number | 'custom') => updateMaxLeadPreset(v)"
912
- >
913
- <FmRadio label="30 days" :value="30">
914
- <template #label>
915
- <div>30 days <span class="text-fm-color-typo-secondary">(default)</span></div>
916
- </template>
917
- </FmRadio>
918
- <FmRadio label="60 days" :value="60" />
919
- <FmRadio label="90 days" :value="90" />
920
- <FmRadio label="Custom" :value="'custom'" />
921
- </FmRadioGroup>
1002
+ <div class="flex flex-col">
1003
+ <div class="flex-grow fm-typo-en-title-sm-600 mb-4">Time Settings</div>
1004
+ <div class="fm-typo-en-body-lg-400 text-fm-color-typo-secondary mb-12">
1005
+ Choose the start and end time for reservations, and the interval between each time slot.
1006
+ Available time slots will be generated automatically.
1007
+ </div>
922
1008
 
923
- <!-- Custom preset fields -->
1009
+ <!-- Operating hour setting -->
1010
+ <div class="mb-32">
1011
+ <div class="grid grid-cols-[1fr_1fr_3fr] items-start">
924
1012
  <div
925
- v-if="selectedPreset === 'custom'"
926
- class="ml-32 mt-12 p-16 border rounded-md bg-fm-color-neutral-gray-50"
1013
+ class="p-12 fm-typo-en-body-md-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100"
927
1014
  >
928
- <div class="mb-16">
929
- <div class="mb-8 fm-typo-en-body-md-600 flex items-center gap-8">
930
- Minimum Lead Time
931
- <FmTooltip
932
- :content="'The earliest time a guest can make a reservation. For example, if you set this to 1 day, guests can only make reservations from tomorrow onwards.'"
933
- >
934
- <FmIcon name="info" outline size="sm" class="cursor-pointer" />
935
- </FmTooltip>
936
- </div>
937
- <div class="flex items-center gap-8">
938
- <FmStepperField
939
- :model-value="rangeSetting.minLeadDuration.value"
940
- @update:model-value="(v: number) => updateMinLeadValue(v)"
941
- :min="0"
942
- class=""
943
- />
944
- <FmSelect
945
- :model-value="rangeSetting.minLeadDuration.unit"
946
- @update:model-value="(v: 'hour' | 'day') => updateMinLeadUnit(v)"
947
- :items="[
948
- { label: 'Hours', value: 'hour' },
949
- { label: 'Days', value: 'day' }
950
- ]"
951
- class="w-120"
952
- />
953
- </div>
954
- </div>
955
-
956
- <div>
957
- <div class="mb-8 fm-typo-en-body-md-600 flex items-center gap-8">
958
- Maximum Lead Time
959
- <FmTooltip
960
- :content="'The furthest in advance a guest can make a reservation. For example, if you set this to 30 days, guests can only make reservations up to 30 days from today.'"
961
- >
962
- <FmIcon name="info" outline size="sm" class="cursor-pointer" />
963
- </FmTooltip>
964
- </div>
965
- <div class="flex items-center gap-8">
966
- <FmStepperField
967
- :model-value="rangeSetting.maxLeadDuration.value"
968
- @update:model-value="(v: number) => updateMaxLeadValue(v)"
969
- :min="0"
970
- class=""
971
- />
972
- <FmSelect
973
- :model-value="rangeSetting.maxLeadDuration.unit"
974
- @update:model-value="(v: 'hour' | 'day') => updateMaxLeadUnit(v)"
975
- :items="[
976
- { label: 'Hours', value: 'hour' },
977
- { label: 'Days', value: 'day' }
978
- ]"
979
- class="w-120"
980
- />
981
- </div>
982
- </div>
983
-
984
- <!-- Validation error message -->
985
- <div v-if="validateLeadDurationLocal()" class="mt-16 text-sm text-red-600">
986
- {{ validateLeadDurationLocal() }}
987
- </div>
1015
+ Day
988
1016
  </div>
989
- </div>
990
- </div>
991
-
992
- <div class="flex flex-col">
993
- <div class="flex-grow fm-typo-en-title-sm-600 mb-4">Time Settings</div>
994
- <div class="fm-typo-en-body-lg-400 text-fm-color-typo-secondary mb-12">
995
- Choose the start and end time for reservations, and the interval between each time slot.
996
- Available time slots will be generated automatically.
997
- </div>
998
-
999
- <!-- Operating hour setting -->
1000
- <div class="mb-32">
1001
- <div class="grid grid-cols-[1fr_1fr_3fr] items-start">
1002
- <div
1003
- class="p-12 fm-typo-en-body-md-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100"
1004
- >
1005
- Day
1006
- </div>
1007
- <div
1008
- class="p-12 fm-typo-en-body-md-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100"
1009
- >
1010
- Open / Closed
1011
- </div>
1012
- <div
1013
- class="p-12 fm-typo-en-body-md-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100"
1014
- >
1015
- Reservation Time Range
1017
+ <div
1018
+ class="p-12 fm-typo-en-body-md-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100"
1019
+ >
1020
+ Open / Closed
1021
+ </div>
1022
+ <div
1023
+ class="p-12 fm-typo-en-body-md-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100"
1024
+ >
1025
+ Reservation Time Range
1026
+ </div>
1027
+ <template v-for="day in [1, 2, 3, 4, 5, 6, 0] as const" :key="day">
1028
+ <div class="fm-typo-en-body-md-400 py-12 px-12">
1029
+ {{ moment().day(day).format('dddd') }}
1016
1030
  </div>
1017
- <template v-for="day in [1, 2, 3, 4, 5, 6, 0] as const" :key="day">
1018
- <div class="fm-typo-en-body-md-400 py-12 px-12">
1019
- {{ moment().day(day).format('dddd') }}
1020
- </div>
1021
- <template v-if="rangeSetting.operatingHours[day as 0 | 1 | 2 | 3 | 4 | 5 | 6]">
1022
- <template
1023
- v-for="hours in [rangeSetting.operatingHours[day as 0 | 1 | 2 | 3 | 4 | 5 | 6]]"
1024
- :key="`hours-${day}`"
1025
- >
1026
- <div class="px-12 py-8">
1027
- <FmSwitch
1028
- label-placement="right"
1029
- :model-value="hours.enable"
1030
- @update:model-value="
1031
- (v) => {
1032
- rangeSetting.operatingHours[day].enable = v
1033
- rangeSetting.operatingHours[day].hours = v
1034
- ? [
1035
- {
1036
- start: '00:00',
1037
- end: '23:59'
1038
- }
1039
- ]
1040
- : []
1041
- }
1042
- "
1043
- :label="hours.enable ? 'Open' : 'Closed'"
1044
- />
1045
- </div>
1046
- <div class="px-12 self-center">
1047
- <div v-if="!hours.enable" class="">-</div>
1048
- <div v-else class="flex flex-col">
1049
- <div v-for="(hour, hi) in hours.hours" :key="hi" class="flex flex-col gap-4">
1050
- <div class="flex gap-4 items-center justify-between">
1051
- <div class="flex gap-12 items-center flex-1 justify-start py-8">
1052
- <CustomTimePicker
1053
- v-model="hour.start"
1054
- :min-time="hours.hours[hi - 1]?.end ?? '00:00'"
1055
- />
1056
- <div class="text-center w-16 flex-shrink-0">to</div>
1057
- <CustomTimePicker
1058
- v-model="hour.end"
1059
- :min-time="hour.start"
1060
- :restrict-min-time="false"
1061
- />
1062
- </div>
1063
- <div class="mr-8 w-32 flex-shrink">
1064
- <FmButton
1065
- variant="plain"
1066
- icon="add"
1067
- v-if="hi == 0"
1068
- :disabled="hours.hours.length >= 2"
1069
- @click="hours.hours.push({ start: hour.end, end: '23:59' })"
1070
- />
1071
- <FmButton
1072
- variant="plain"
1073
- icon="delete"
1074
- v-if="hi > 0"
1075
- @click="
1076
- deleteTimeRange(day as unknown as 0 | 1 | 2 | 3 | 4 | 5 | 6, hi)
1077
- "
1078
- />
1079
- </div>
1031
+ <template v-if="rangeSetting.operatingHours[day as 0 | 1 | 2 | 3 | 4 | 5 | 6]">
1032
+ <template
1033
+ v-for="hours in [rangeSetting.operatingHours[day as 0 | 1 | 2 | 3 | 4 | 5 | 6]]"
1034
+ :key="`hours-${day}`"
1035
+ >
1036
+ <div class="px-12 py-8">
1037
+ <FmSwitch
1038
+ label-placement="right"
1039
+ :model-value="hours.enable"
1040
+ @update:model-value="
1041
+ (v) => {
1042
+ rangeSetting.operatingHours[day].enable = v
1043
+ rangeSetting.operatingHours[day].hours = v
1044
+ ? [
1045
+ {
1046
+ start: '00:00',
1047
+ end: '23:59'
1048
+ }
1049
+ ]
1050
+ : []
1051
+ }
1052
+ "
1053
+ :label="hours.enable ? 'Open' : 'Closed'"
1054
+ />
1055
+ </div>
1056
+ <div class="px-12 self-center">
1057
+ <div v-if="!hours.enable" class="">-</div>
1058
+ <div v-else class="flex flex-col">
1059
+ <div v-for="(hour, hi) in hours.hours" :key="hi" class="flex flex-col gap-4">
1060
+ <div class="flex gap-4 items-center justify-between">
1061
+ <div class="flex gap-12 items-center flex-1 justify-start py-8">
1062
+ <CustomTimePicker
1063
+ v-model="hour.start"
1064
+ :min-time="hours.hours[hi - 1]?.end ?? '00:00'"
1065
+ />
1066
+ <div class="text-center w-16 flex-shrink-0">to</div>
1067
+ <CustomTimePicker
1068
+ v-model="hour.end"
1069
+ :min-time="hour.start"
1070
+ :restrict-min-time="false"
1071
+ />
1080
1072
  </div>
1081
- <div v-if="getTimeRangeError(day, hi)" class="text-sm text-red-600 ml-4">
1082
- {{ getTimeRangeError(day, hi) }}
1073
+ <div class="mr-8 w-32 flex-shrink">
1074
+ <FmButton
1075
+ variant="plain"
1076
+ icon="add"
1077
+ v-if="hi == 0"
1078
+ :disabled="hours.hours.length >= 2"
1079
+ @click="hours.hours.push({ start: hour.end, end: '23:59' })"
1080
+ />
1081
+ <FmButton
1082
+ variant="plain"
1083
+ icon="delete"
1084
+ v-if="hi > 0"
1085
+ @click="
1086
+ deleteTimeRange(day as unknown as 0 | 1 | 2 | 3 | 4 | 5 | 6, hi)
1087
+ "
1088
+ />
1083
1089
  </div>
1084
1090
  </div>
1091
+ <div v-if="getTimeRangeError(day, hi)" class="text-sm text-red-600 ml-4">
1092
+ {{ getTimeRangeError(day, hi) }}
1093
+ </div>
1085
1094
  </div>
1086
1095
  </div>
1087
- </template>
1096
+ </div>
1088
1097
  </template>
1089
1098
  </template>
1090
- </div>
1099
+ </template>
1091
1100
  </div>
1101
+ </div>
1092
1102
 
1093
- <FmCard variant="outlined" class="grid grid-cols-[1fr_2fr]">
1094
- <div class="border-r py-[24px] px-16">
1095
- <div class="mb-24">
1096
- <div class="mb-8 fm-typo-en-body-lg-600 flex items-center gap-8">
1097
- Time Interval
1098
- <FmTooltip :content="'How often guests can start a reservation'">
1099
- <FmIcon name="info" outline size="sm" class="cursor-pointer" />
1100
- </FmTooltip>
1101
- </div>
1102
- <FmRadioGroup
1103
- :model-value="rangeSetting.slotInterval"
1104
- @update:model-value="(v: number) => updateSlotInterval(v)"
1105
- >
1106
- <FmRadio label="15 min" :value="15" />
1107
- <FmRadio label="30 min (default)" :value="30">
1108
- <template #label
1109
- >30 min <span class="text-fm-color-typo-secondary">(default)</span></template
1110
- >
1111
- </FmRadio>
1112
- <FmRadio label="60 min" :value="60" />
1113
- </FmRadioGroup>
1103
+ <FmCard variant="outlined" class="grid grid-cols-[1fr_2fr]">
1104
+ <div class="border-r py-[24px] px-16">
1105
+ <div class="mb-24">
1106
+ <div class="mb-8 fm-typo-en-body-lg-600 flex items-center gap-8">
1107
+ Time Interval
1108
+ <FmTooltip :content="'How often guests can start a reservation'">
1109
+ <FmIcon name="info" outline size="sm" class="cursor-pointer" />
1110
+ </FmTooltip>
1114
1111
  </div>
1112
+ <FmRadioGroup
1113
+ :model-value="rangeSetting.slotInterval"
1114
+ @update:model-value="(v: number) => updateSlotInterval(v)"
1115
+ >
1116
+ <FmRadio label="15 min" :value="15" />
1117
+ <FmRadio label="30 min (default)" :value="30">
1118
+ <template #label
1119
+ >30 min <span class="text-fm-color-typo-secondary">(default)</span></template
1120
+ >
1121
+ </FmRadio>
1122
+ <FmRadio label="60 min" :value="60" />
1123
+ </FmRadioGroup>
1124
+ </div>
1115
1125
 
1116
- <div class="mb-24">
1117
- <div class="mb-8 fm-typo-en-body-lg-600 flex items-center gap-8">
1118
- Dining Duration
1119
- <FmTooltip :content="'How long a table is reserved for each booking'">
1120
- <FmIcon name="info" outline size="sm" class="cursor-pointer" />
1121
- </FmTooltip>
1122
- </div>
1123
- <FmRadioGroup
1124
- :model-value="rangeSetting.bookingDuration"
1125
- @update:model-value="(v: number) => updateBookingDuration(v)"
1126
- >
1127
- <FmRadio label="60 min" :value="60" />
1128
- <FmRadio label="90 min" :value="90">
1129
- <template #label
1130
- >90 min <span class="text-fm-color-typo-secondary">(default)</span></template
1131
- >
1132
- </FmRadio>
1133
-
1134
- <FmRadio label="120 min" :value="120" />
1135
- </FmRadioGroup>
1126
+ <div class="mb-24">
1127
+ <div class="mb-8 fm-typo-en-body-lg-600 flex items-center gap-8">
1128
+ Dining Duration
1129
+ <FmTooltip :content="'How long a table is reserved for each booking'">
1130
+ <FmIcon name="info" outline size="sm" class="cursor-pointer" />
1131
+ </FmTooltip>
1136
1132
  </div>
1133
+ <FmRadioGroup
1134
+ :model-value="rangeSetting.bookingDuration"
1135
+ @update:model-value="(v: number) => updateBookingDuration(v)"
1136
+ >
1137
+ <FmRadio label="60 min" :value="60" />
1138
+ <FmRadio label="90 min" :value="90">
1139
+ <template #label
1140
+ >90 min <span class="text-fm-color-typo-secondary">(default)</span></template
1141
+ >
1142
+ </FmRadio>
1143
+
1144
+ <FmRadio label="120 min" :value="120" />
1145
+ </FmRadioGroup>
1137
1146
  </div>
1147
+ </div>
1138
1148
 
1139
- <div class="p-16 flex flex-col gap-16">
1140
- <div class="flex items-center justify-between w-full">
1141
- <div class="fm-typo-en-body-lg-600">Available reservation slots (preview)</div>
1142
- <FmSelect
1143
- v-model="selectedPreviewDay"
1144
- :items="[
1145
- { label: 'Monday', value: 1 },
1146
- { label: 'Tuesday', value: 2 },
1147
- { label: 'Wednesday', value: 3 },
1148
- { label: 'Thursday', value: 4 },
1149
- { label: 'Friday', value: 5 },
1150
- { label: 'Saturday', value: 6 },
1151
- { label: 'Sunday', value: 0 }
1152
- ]"
1153
- />
1154
- </div>
1149
+ <div class="p-16 flex flex-col gap-16">
1150
+ <div class="flex items-center justify-between w-full">
1151
+ <div class="fm-typo-en-body-lg-600">Available reservation slots (preview)</div>
1152
+ <FmSelect
1153
+ v-model="selectedPreviewDay"
1154
+ :items="[
1155
+ { label: 'Monday', value: 1 },
1156
+ { label: 'Tuesday', value: 2 },
1157
+ { label: 'Wednesday', value: 3 },
1158
+ { label: 'Thursday', value: 4 },
1159
+ { label: 'Friday', value: 5 },
1160
+ { label: 'Saturday', value: 6 },
1161
+ { label: 'Sunday', value: 0 }
1162
+ ]"
1163
+ />
1164
+ </div>
1155
1165
 
1156
- <template v-if="availableSlots.morning.length > 0">
1157
- <div class="fm-typo-en-body-md-600 text-[#4B4B4B]">Morning</div>
1158
- <div class="grid grid-cols-5 gap-8">
1159
- <div
1160
- v-for="slot in displayedSlots.morning"
1161
- :key="slot.time"
1162
- class="border-1 rounded-md text-center p-8 transition-colors"
1163
- :class="{
1164
- 'bg-[#fafafa] text-fm-color-typo-primary': slot.available,
1165
- 'bg-[#f0f0f0] text-fm-color-typo-disabled border-dashed': !slot.available
1166
- }"
1167
- >
1168
- {{ slot.time }}
1169
- </div>
1170
- <div
1171
- v-if="hasMoreItems.morning && !expandedSegments.morning"
1172
- class="border-2 rounded-md text-center p-8 transition-colors cursor-pointer border-fm-color-primary text-fm-color-primary"
1173
- @click="toggleSegmentExpansion('morning')"
1174
- >
1175
- more
1176
- </div>
1166
+ <template v-if="availableSlots.morning.length > 0">
1167
+ <div class="fm-typo-en-body-md-600 text-[#4B4B4B]">Morning</div>
1168
+ <div class="grid grid-cols-5 gap-8">
1169
+ <div
1170
+ v-for="slot in displayedSlots.morning"
1171
+ :key="slot.time"
1172
+ class="border-1 rounded-md text-center p-8 transition-colors"
1173
+ :class="{
1174
+ 'bg-[#fafafa] text-fm-color-typo-primary': slot.available,
1175
+ 'bg-[#f0f0f0] text-fm-color-typo-disabled border-dashed': !slot.available
1176
+ }"
1177
+ >
1178
+ {{ slot.time }}
1177
1179
  </div>
1178
- </template>
1179
-
1180
- <template v-if="availableSlots.afternoon.length > 0">
1181
- <div class="fm-typo-en-body-md-600 text-[#4B4B4B]">Afternoon</div>
1182
- <div class="grid grid-cols-5 gap-8">
1183
- <div
1184
- v-for="slot in displayedSlots.afternoon"
1185
- :key="slot.time"
1186
- class="border-1 rounded-md text-center p-8 transition-colors"
1187
- :class="{
1188
- 'bg-[#fafafa] text-fm-color-typo-primary': slot.available,
1189
- 'bg-[#f0f0f0] text-fm-color-typo-disabled border-dashed': !slot.available
1190
- }"
1191
- >
1192
- {{ slot.time }}
1193
- </div>
1194
- <div
1195
- v-if="hasMoreItems.afternoon && !expandedSegments.afternoon"
1196
- class="border-2 rounded-md text-center p-8 transition-colors cursor-pointer border-fm-color-primary text-fm-color-primary"
1197
- @click="toggleSegmentExpansion('afternoon')"
1198
- >
1199
- more
1200
- </div>
1180
+ <div
1181
+ v-if="hasMoreItems.morning && !expandedSegments.morning"
1182
+ class="border-2 rounded-md text-center p-8 transition-colors cursor-pointer border-fm-color-primary text-fm-color-primary"
1183
+ @click="toggleSegmentExpansion('morning')"
1184
+ >
1185
+ more
1201
1186
  </div>
1202
- </template>
1203
-
1204
- <template v-if="availableSlots.evening.length > 0">
1205
- <div class="fm-typo-en-body-md-600 text-[#4B4B4B]">Evening</div>
1206
- <div class="grid grid-cols-5 gap-8">
1207
- <div
1208
- v-for="slot in displayedSlots.evening"
1209
- :key="slot.time"
1210
- class="border-1 rounded-md text-center p-8 transition-colors"
1211
- :class="{
1212
- 'bg-[#fafafa] text-fm-color-typo-primary': slot.available,
1213
- 'bg-[#f0f0f0] text-fm-color-typo-disabled border-dashed': !slot.available
1214
- }"
1215
- >
1216
- {{ slot.time }}
1217
- </div>
1218
- <div
1219
- v-if="hasMoreItems.evening && !expandedSegments.evening"
1220
- class="border-2 rounded-md text-center p-8 transition-colors cursor-pointer border-fm-color-primary text-fm-color-primary"
1221
- @click="toggleSegmentExpansion('evening')"
1222
- >
1223
- more
1224
- </div>
1187
+ </div>
1188
+ </template>
1189
+
1190
+ <template v-if="availableSlots.afternoon.length > 0">
1191
+ <div class="fm-typo-en-body-md-600 text-[#4B4B4B]">Afternoon</div>
1192
+ <div class="grid grid-cols-5 gap-8">
1193
+ <div
1194
+ v-for="slot in displayedSlots.afternoon"
1195
+ :key="slot.time"
1196
+ class="border-1 rounded-md text-center p-8 transition-colors"
1197
+ :class="{
1198
+ 'bg-[#fafafa] text-fm-color-typo-primary': slot.available,
1199
+ 'bg-[#f0f0f0] text-fm-color-typo-disabled border-dashed': !slot.available
1200
+ }"
1201
+ >
1202
+ {{ slot.time }}
1203
+ </div>
1204
+ <div
1205
+ v-if="hasMoreItems.afternoon && !expandedSegments.afternoon"
1206
+ class="border-2 rounded-md text-center p-8 transition-colors cursor-pointer border-fm-color-primary text-fm-color-primary"
1207
+ @click="toggleSegmentExpansion('afternoon')"
1208
+ >
1209
+ more
1210
+ </div>
1211
+ </div>
1212
+ </template>
1213
+
1214
+ <template v-if="availableSlots.evening.length > 0">
1215
+ <div class="fm-typo-en-body-md-600 text-[#4B4B4B]">Evening</div>
1216
+ <div class="grid grid-cols-5 gap-8">
1217
+ <div
1218
+ v-for="slot in displayedSlots.evening"
1219
+ :key="slot.time"
1220
+ class="border-1 rounded-md text-center p-8 transition-colors"
1221
+ :class="{
1222
+ 'bg-[#fafafa] text-fm-color-typo-primary': slot.available,
1223
+ 'bg-[#f0f0f0] text-fm-color-typo-disabled border-dashed': !slot.available
1224
+ }"
1225
+ >
1226
+ {{ slot.time }}
1227
+ </div>
1228
+ <div
1229
+ v-if="hasMoreItems.evening && !expandedSegments.evening"
1230
+ class="border-2 rounded-md text-center p-8 transition-colors cursor-pointer border-fm-color-primary text-fm-color-primary"
1231
+ @click="toggleSegmentExpansion('evening')"
1232
+ >
1233
+ more
1225
1234
  </div>
1226
- </template>
1227
-
1228
- <div
1229
- v-if="
1230
- !availableSlots.morning.length &&
1231
- !availableSlots.afternoon.length &&
1232
- !availableSlots.evening.length
1233
- "
1234
- class="text-center text-fm-color-typo-secondary flex flex-col items-center gap-16 p-24"
1235
- >
1236
- <img :src="notfound" class="aspect-square w-[150px]" />
1237
- Uh-oh! This outlet is closed on the selected day. <br />
1238
- Please select another day to view available time slots.
1239
1235
  </div>
1236
+ </template>
1237
+
1238
+ <div
1239
+ v-if="
1240
+ !availableSlots.morning.length &&
1241
+ !availableSlots.afternoon.length &&
1242
+ !availableSlots.evening.length
1243
+ "
1244
+ class="text-center text-fm-color-typo-secondary flex flex-col items-center gap-16 p-24"
1245
+ >
1246
+ <img :src="notfound" class="aspect-square w-[150px]" />
1247
+ Uh-oh! This outlet is closed on the selected day. <br />
1248
+ Please select another day to view available time slots.
1240
1249
  </div>
1241
- </FmCard>
1250
+ </div>
1251
+ </FmCard>
1252
+ </div>
1253
+
1254
+ <div class="flex flex-col">
1255
+ <div class="flex-grow fm-typo-en-title-sm-600 mb-4">Table Capacity Settings</div>
1256
+ <div class="fm-typo-en-body-lg-400 text-fm-color-typo-secondary mb-24">
1257
+ Set how many tables are available for reservation per time slot. You can reduce availability
1258
+ to keep tables for walk-ins.
1242
1259
  </div>
1243
1260
 
1244
- <div class="flex flex-col">
1245
- <div class="flex-grow fm-typo-en-title-sm-600 mb-4">Table Capacity Settings</div>
1246
- <div class="fm-typo-en-body-lg-400 text-fm-color-typo-secondary mb-24">
1247
- Set how many tables are available for reservation per time slot. You can reduce
1248
- availability to keep tables for walk-ins.
1261
+ <!-- Table Capacity Settings -->
1262
+ <div>
1263
+ <div class="grid grid-cols-[4fr_4fr_4fr_1fr]">
1264
+ <div class="bg-fm-color-neutral-gray-100 p-12">Table Type</div>
1265
+ <div class="bg-fm-color-neutral-gray-100 p-12">Guest Range</div>
1266
+ <div class="bg-fm-color-neutral-gray-100 p-12 flex items-center gap-4">
1267
+ Available Table Count
1268
+ <FmTooltip :content="'Adjust how many tables can be booked for each time slot'">
1269
+ <FmIcon name="info" outline size="sm" class="cursor-pointer" />
1270
+ </FmTooltip>
1271
+ </div>
1272
+ <div class="bg-fm-color-neutral-gray-100 p-12"></div>
1249
1273
  </div>
1250
-
1251
- <!-- Table Capacity Settings -->
1252
- <div>
1253
- <div class="grid grid-cols-[4fr_4fr_4fr_1fr]">
1254
- <div class="bg-fm-color-neutral-gray-100 p-12">Table Type</div>
1255
- <div class="bg-fm-color-neutral-gray-100 p-12">Guest Range</div>
1256
- <div class="bg-fm-color-neutral-gray-100 p-12 flex items-center gap-4">
1257
- Available Table Count
1258
- <FmTooltip :content="'Adjust how many tables can be booked for each time slot'">
1259
- <FmIcon name="info" outline size="sm" class="cursor-pointer" />
1260
- </FmTooltip>
1261
- </div>
1262
- <div class="bg-fm-color-neutral-gray-100 p-12"></div>
1274
+ <div
1275
+ class="grid grid-cols-[4fr_4fr_4fr_1fr] items-center gap-8"
1276
+ v-for="tier in rangeSetting.capacityTiers"
1277
+ :key="tier._id"
1278
+ >
1279
+ <div class="p-8">{{ tier.minPax }}{{ tier.maxPax ? `-${tier.maxPax}` : '+' }} pax</div>
1280
+ <div class="flex items-center gap-4 pr-24">
1281
+ <FmStepperField v-model="tier.minPax" :min="1" />
1282
+ <div>to</div>
1283
+ <FmStepperField
1284
+ :model-value="tier.maxPax ?? null"
1285
+ @update:model-value="(v) => (tier.maxPax = v)"
1286
+ :min="tier.minPax"
1287
+ />
1263
1288
  </div>
1264
- <div
1265
- class="grid grid-cols-[4fr_4fr_4fr_1fr] items-center gap-8"
1266
- v-for="tier in rangeSetting.capacityTiers"
1267
- :key="tier._id"
1268
- >
1269
- <div class="p-8">{{ tier.minPax }}{{ tier.maxPax ? `-${tier.maxPax}` : '+' }} pax</div>
1270
- <div class="flex items-center gap-4 pr-24">
1271
- <FmStepperField v-model="tier.minPax" :min="1" />
1272
- <div>to</div>
1273
- <FmStepperField
1274
- :model-value="tier.maxPax ?? null"
1275
- @update:model-value="(v) => (tier.maxPax = v)"
1276
- :min="tier.minPax"
1277
- />
1278
- </div>
1279
- <div class="flex items-center gap-8">
1280
- <FmButton
1281
- variant="tertiary"
1282
- icon="remove"
1283
- @click="tier.capacity--"
1284
- :disabled="tier.capacity <= 1"
1285
- class="!rounded-full !w-10 !h-10 !bg-fm-color-neutral-gray-100"
1286
- />
1287
- <div class="w-32 text-center">{{ tier.capacity }}</div>
1288
- <FmButton
1289
- variant="tertiary"
1290
- icon="add"
1291
- @click="tier.capacity++"
1292
- class="!rounded-full !w-10 !h-10 !bg-fm-color-neutral-gray-100"
1293
- />
1294
-
1295
- <!-- <FmStepperField :model-value="tier.capacity ?? null" @update:model-value="(v) => (tier.capacity = v)" /> -->
1296
- </div>
1289
+ <div class="flex items-center gap-8">
1297
1290
  <FmButton
1298
- icon="delete"
1299
- variant="plain"
1300
- @click="
1301
- rangeSetting.capacityTiers.splice(rangeSetting.capacityTiers.indexOf(tier), 1)
1302
- "
1291
+ variant="tertiary"
1292
+ icon="remove"
1293
+ @click="tier.capacity--"
1294
+ :disabled="tier.capacity <= 1"
1295
+ class="!rounded-full !w-10 !h-10 !bg-fm-color-neutral-gray-100"
1303
1296
  />
1304
- </div>
1305
- <div>
1297
+ <div class="w-32 text-center">{{ tier.capacity }}</div>
1306
1298
  <FmButton
1307
- label="Add table type"
1299
+ variant="tertiary"
1308
1300
  icon="add"
1309
- variant="plain"
1310
- @click="
1311
- rangeSetting.capacityTiers.push({
1312
- _id: generateCapacityTierId(),
1313
- minPax: Math.max(1, ([...rangeSetting.capacityTiers].pop()?.maxPax ?? 0) + 1),
1314
- maxPax: null,
1315
- capacity: 0
1316
- })
1317
- "
1301
+ @click="tier.capacity++"
1302
+ class="!rounded-full !w-10 !h-10 !bg-fm-color-neutral-gray-100"
1318
1303
  />
1304
+
1305
+ <!-- <FmStepperField :model-value="tier.capacity ?? null" @update:model-value="(v) => (tier.capacity = v)" /> -->
1319
1306
  </div>
1307
+ <FmButton
1308
+ icon="delete"
1309
+ variant="plain"
1310
+ @click="rangeSetting.capacityTiers.splice(rangeSetting.capacityTiers.indexOf(tier), 1)"
1311
+ />
1312
+ </div>
1313
+ <div>
1314
+ <FmButton
1315
+ label="Add table type"
1316
+ icon="add"
1317
+ variant="plain"
1318
+ @click="
1319
+ rangeSetting.capacityTiers.push({
1320
+ _id: generateCapacityTierId(),
1321
+ minPax: Math.max(1, ([...rangeSetting.capacityTiers].pop()?.maxPax ?? 0) + 1),
1322
+ maxPax: null,
1323
+ capacity: 0
1324
+ })
1325
+ "
1326
+ />
1320
1327
  </div>
1321
1328
  </div>
1329
+ </div>
1322
1330
 
1323
- <div>
1324
- <div class="flex-grow fm-typo-en-title-sm-600 mb-16">Preorder</div>
1331
+ <div>
1332
+ <div class="flex-grow fm-typo-en-title-sm-600 mb-16">Preorder</div>
1333
+ <FmSwitch
1334
+ label-placement="right"
1335
+ :label="'Enable preorder'"
1336
+ :sublabel="'Enable this to allow guests to place preorders when making a reservation. This allows them to order food in advance.'"
1337
+ :model-value="rangeSetting.enablePreorder"
1338
+ @update:model-value="(v: boolean) => (rangeSetting.enablePreorder = v)"
1339
+ />
1340
+ <!-- Also shown while a window is stored with pre-order off: the server still applies
1341
+ it to bookings that already carry a pre-order, so it must stay visible to turn off. -->
1342
+ <div
1343
+ v-if="rangeSetting.enablePreorder || rangeSetting.freeCancellationBefore"
1344
+ class="ml-32 mt-12 p-16 border rounded-md bg-fm-color-neutral-gray-50"
1345
+ >
1325
1346
  <FmSwitch
1326
1347
  label-placement="right"
1327
- :label="'Enable preorder'"
1328
- :sublabel="'Enable this to allow guests to place preorders when making a reservation. This allows them to order food in advance.'"
1329
- :model-value="rangeSetting.enablePreorder"
1330
- @update:model-value="(v: boolean) => (rangeSetting.enablePreorder = v)"
1348
+ :label="'Limit online cancellation'"
1349
+ :sublabel="'Guests with a pre-order can cancel online only until this long before their booking. After that they need to call the outlet. Staff can still cancel on the POS.'"
1350
+ :model-value="!!rangeSetting.freeCancellationBefore"
1351
+ @update:model-value="(v: boolean) => toggleFreeCancellation(v)"
1331
1352
  />
1332
- <!-- Also shown while a window is stored with pre-order off: the server still applies
1333
- it to bookings that already carry a pre-order, so it must stay visible to turn off. -->
1334
- <div
1335
- v-if="rangeSetting.enablePreorder || rangeSetting.freeCancellationBefore"
1336
- class="ml-32 mt-12 p-16 border rounded-md bg-fm-color-neutral-gray-50"
1337
- >
1338
- <FmSwitch
1339
- label-placement="right"
1340
- :label="'Limit online cancellation'"
1341
- :sublabel="'Guests with a pre-order can cancel online only until this long before their booking. After that they need to call the outlet. Staff can still cancel on the POS.'"
1342
- :model-value="!!rangeSetting.freeCancellationBefore"
1343
- @update:model-value="(v: boolean) => toggleFreeCancellation(v)"
1353
+ <div v-if="rangeSetting.freeCancellationBefore" class="flex items-center gap-8 mt-12">
1354
+ <div class="fm-typo-en-body-md-600">Free cancellation until</div>
1355
+ <FmStepperField
1356
+ :model-value="rangeSetting.freeCancellationBefore.value"
1357
+ @update:model-value="(v: number) => updateFreeCancellationValue(v)"
1358
+ :min="1"
1344
1359
  />
1345
- <div v-if="rangeSetting.freeCancellationBefore" class="flex items-center gap-8 mt-12">
1346
- <div class="fm-typo-en-body-md-600">Free cancellation until</div>
1347
- <FmStepperField
1348
- :model-value="rangeSetting.freeCancellationBefore.value"
1349
- @update:model-value="(v: number) => updateFreeCancellationValue(v)"
1350
- :min="1"
1351
- />
1352
- <FmSelect
1353
- :model-value="rangeSetting.freeCancellationBefore.unit"
1354
- @update:model-value="(v: 'hour' | 'day') => updateFreeCancellationUnit(v)"
1355
- :items="[
1356
- { label: 'Hours', value: 'hour' },
1357
- { label: 'Days', value: 'day' }
1358
- ]"
1359
- class="w-120"
1360
- />
1361
- <div class="fm-typo-en-body-md-400">before the booking</div>
1362
- </div>
1360
+ <FmSelect
1361
+ :model-value="rangeSetting.freeCancellationBefore.unit"
1362
+ @update:model-value="(v: 'hour' | 'day') => updateFreeCancellationUnit(v)"
1363
+ :items="[
1364
+ { label: 'Hours', value: 'hour' },
1365
+ { label: 'Days', value: 'day' }
1366
+ ]"
1367
+ class="w-120"
1368
+ />
1369
+ <div class="fm-typo-en-body-md-400">before the booking</div>
1363
1370
  </div>
1364
1371
  </div>
1372
+ </div>
1365
1373
 
1366
- <div class="flex flex-col">
1367
- <div class="flex-grow fm-typo-en-title-sm-600 mb-4">Guest Preferences</div>
1368
- <div class="fm-typo-en-body-lg-400 text-fm-color-typo-secondary mb-24">
1369
- Allow guests to select preferences during reservation, such as seating preferences,
1370
- allergies, or other notes.
1371
- </div>
1374
+ <div class="flex flex-col">
1375
+ <div class="flex-grow fm-typo-en-title-sm-600 mb-4">Guest Preferences</div>
1376
+ <div class="fm-typo-en-body-lg-400 text-fm-color-typo-secondary mb-24">
1377
+ Allow guests to select preferences during reservation, such as seating preferences,
1378
+ allergies, or other notes.
1379
+ </div>
1372
1380
 
1373
- <FmSwitch
1374
- class="mb-8"
1375
- label="Enable preferences"
1376
- label-placement="right"
1377
- :model-value="rangeSetting.preferences.length > 0"
1378
- @update:model-value="
1379
- (v) => {
1380
- if (v == true) {
1381
- rangeSetting.preferences = [
1382
- {
1383
- name: '',
1384
- type: 'radio',
1385
- options: []
1386
- }
1387
- ]
1388
- } else {
1389
- rangeSetting.preferences = []
1390
- }
1381
+ <FmSwitch
1382
+ class="mb-8"
1383
+ label="Enable preferences"
1384
+ label-placement="right"
1385
+ :model-value="rangeSetting.preferences.length > 0"
1386
+ @update:model-value="
1387
+ (v) => {
1388
+ if (v == true) {
1389
+ rangeSetting.preferences = [
1390
+ {
1391
+ name: '',
1392
+ type: 'radio',
1393
+ options: []
1394
+ }
1395
+ ]
1396
+ } else {
1397
+ rangeSetting.preferences = []
1391
1398
  }
1392
- "
1393
- />
1399
+ }
1400
+ "
1401
+ />
1394
1402
 
1395
- <FmCard
1396
- v-for="(preference, pIndex) in rangeSetting.preferences"
1397
- class="p-16 mb-12"
1398
- variant="outlined"
1399
- :key="pIndex"
1400
- >
1401
- <div class="fm-typo-en-body-lg-600 mb-8">Category title</div>
1402
- <div class="grid grid-cols-[6fr_3fr_1fr] items-start gap-24 mb-24">
1403
- <div>
1404
- <FmTextField v-model="preference.name" placeholder="Enter a name" />
1405
- <div class="fm-typo-en-body-md-400 text-fm-color-typo-tertiary mt-8">
1406
- This title will be shown to guests during reservation.
1407
- </div>
1403
+ <FmCard
1404
+ v-for="(preference, pIndex) in rangeSetting.preferences"
1405
+ class="p-16 mb-12"
1406
+ variant="outlined"
1407
+ :key="pIndex"
1408
+ >
1409
+ <div class="fm-typo-en-body-lg-600 mb-8">Category title</div>
1410
+ <div class="grid grid-cols-[6fr_3fr_1fr] items-start gap-24 mb-24">
1411
+ <div>
1412
+ <FmTextField v-model="preference.name" placeholder="Enter a name" />
1413
+ <div class="fm-typo-en-body-md-400 text-fm-color-typo-tertiary mt-8">
1414
+ This title will be shown to guests during reservation.
1408
1415
  </div>
1409
- <FmSelect
1410
- v-model="preference.type"
1411
- :items="[
1412
- { label: 'Single choice', value: 'radio' },
1413
- { label: 'Multiple choice', value: 'checkbox' }
1414
- ]"
1415
- />
1416
- <FmButton variant="tertiary" icon="delete" @click="removePreference(pIndex)" />
1417
1416
  </div>
1417
+ <FmSelect
1418
+ v-model="preference.type"
1419
+ :items="[
1420
+ { label: 'Single choice', value: 'radio' },
1421
+ { label: 'Multiple choice', value: 'checkbox' }
1422
+ ]"
1423
+ />
1424
+ <FmButton variant="tertiary" icon="delete" @click="removePreference(pIndex)" />
1425
+ </div>
1418
1426
 
1419
- <div v-if="preference.type == 'checkbox' || preference.type == 'radio'">
1420
- <div class="mb-8 fm-typo-en-body-md-600">Options</div>
1421
- <div
1422
- v-for="(option, oIndex) in preference.options"
1423
- :key="oIndex"
1424
- class="flex items-center gap-4 gap-y-8 mb-8"
1425
- >
1426
- <div class="flex items-center w-full">
1427
- <FmCheckbox
1428
- v-if="preference.type == 'checkbox'"
1429
- disabled
1430
- :value="option"
1431
- :model-value="false"
1432
- readonly
1433
- class="mr-8"
1434
- />
1435
- <FmRadio
1436
- v-if="preference.type == 'radio'"
1437
- disabled
1438
- :value="option"
1439
- :model-value="false"
1440
- readonly
1441
- />
1442
-
1443
- <!-- Editable option label -->
1444
- <input
1445
- v-if="isEditingOption(pIndex, oIndex)"
1446
- type="text"
1447
- class="flex-1 outline-none border-b-2 border-fm-color-primary px-4 py-2"
1448
- :value="option"
1449
- @blur="
1450
- (e) => saveOptionEdit(pIndex, oIndex, (e.target as HTMLInputElement).value)
1451
- "
1452
- @keyup.enter="
1453
- (e) => saveOptionEdit(pIndex, oIndex, (e.target as HTMLInputElement).value)
1454
- "
1455
- ref="optionInput"
1456
- />
1457
- <div
1458
- v-else-if="option != 'Other'"
1459
- class="flex-1 cursor-pointer hover:bg-fm-color-neutral-gray-100 px-4 py-2 rounded transition-colors"
1460
- @click="startEditingOption(pIndex, oIndex)"
1461
- title="Click to edit"
1462
- >
1463
- {{ option }}
1464
- </div>
1465
- <div
1466
- v-else-if="option == 'Other'"
1467
- class="flex-1 px-4 py-2 border-b border-fm-color-neutral-gray-200"
1468
- >
1469
- Other:
1470
- </div>
1471
- </div>
1472
- <FmButton
1473
- variant="plain"
1474
- icon="close"
1475
- :class="{ 'opacity-0 pointer-events-nonex': oIndex == 0 }"
1476
- @click="oIndex != 0 && removePreferenceOption(preference, option)"
1477
- />
1478
- </div>
1479
- <div class="flex items-center">
1427
+ <div v-if="preference.type == 'checkbox' || preference.type == 'radio'">
1428
+ <div class="mb-8 fm-typo-en-body-md-600">Options</div>
1429
+ <div
1430
+ v-for="(option, oIndex) in preference.options"
1431
+ :key="oIndex"
1432
+ class="flex items-center gap-4 gap-y-8 mb-8"
1433
+ >
1434
+ <div class="flex items-center w-full">
1480
1435
  <FmCheckbox
1481
1436
  v-if="preference.type == 'checkbox'"
1482
1437
  disabled
1483
- :value="null"
1438
+ :value="option"
1484
1439
  :model-value="false"
1485
1440
  readonly
1441
+ class="mr-8"
1442
+ />
1443
+ <FmRadio
1444
+ v-if="preference.type == 'radio'"
1445
+ disabled
1446
+ :value="option"
1447
+ :model-value="false"
1448
+ readonly
1449
+ />
1450
+
1451
+ <!-- Editable option label -->
1452
+ <input
1453
+ v-if="isEditingOption(pIndex, oIndex)"
1454
+ type="text"
1455
+ class="flex-1 outline-none border-b-2 border-fm-color-primary px-4 py-2"
1456
+ :value="option"
1457
+ @blur="(e) => saveOptionEdit(pIndex, oIndex, (e.target as HTMLInputElement).value)"
1458
+ @keyup.enter="
1459
+ (e) => saveOptionEdit(pIndex, oIndex, (e.target as HTMLInputElement).value)
1460
+ "
1461
+ ref="optionInput"
1486
1462
  />
1487
- <div v-if="preference.type == 'radio'" class="flex items-center">
1488
- <FmRadio disabled :value="null" :model-value="false" readonly />
1463
+ <div
1464
+ v-else-if="option != 'Other'"
1465
+ class="flex-1 cursor-pointer hover:bg-fm-color-neutral-gray-100 px-4 py-2 rounded transition-colors"
1466
+ @click="startEditingOption(pIndex, oIndex)"
1467
+ title="Click to edit"
1468
+ >
1469
+ {{ option }}
1489
1470
  </div>
1490
- <div class="flex items-center w-full">
1491
- <FmButton
1492
- variant="tertiary"
1493
- class="text-fm-color-typo-secondary"
1494
- label="add option"
1495
- @click="
1496
- addPreferenceOption(preference, `Option ${preference.options.length + 1}`)
1497
- "
1498
- >
1499
- <template #default>
1500
- <div>Add option</div>
1501
- </template>
1502
- </FmButton>
1503
- <template v-if="!preference.options.includes('Other')">
1504
- <div>or</div>
1505
- <FmButton
1506
- variant="plain"
1507
- label='add "Other"'
1508
- @click="addPreferenceOption(preference, 'Other')"
1509
- />
1510
- </template>
1471
+ <div
1472
+ v-else-if="option == 'Other'"
1473
+ class="flex-1 px-4 py-2 border-b border-fm-color-neutral-gray-200"
1474
+ >
1475
+ Other:
1511
1476
  </div>
1512
1477
  </div>
1478
+ <FmButton
1479
+ variant="plain"
1480
+ icon="close"
1481
+ :class="{ 'opacity-0 pointer-events-nonex': oIndex == 0 }"
1482
+ @click="oIndex != 0 && removePreferenceOption(preference, option)"
1483
+ />
1513
1484
  </div>
1514
- </FmCard>
1485
+ <div class="flex items-center">
1486
+ <FmCheckbox
1487
+ v-if="preference.type == 'checkbox'"
1488
+ disabled
1489
+ :value="null"
1490
+ :model-value="false"
1491
+ readonly
1492
+ />
1493
+ <div v-if="preference.type == 'radio'" class="flex items-center">
1494
+ <FmRadio disabled :value="null" :model-value="false" readonly />
1495
+ </div>
1496
+ <div class="flex items-center w-full">
1497
+ <FmButton
1498
+ variant="tertiary"
1499
+ class="text-fm-color-typo-secondary"
1500
+ label="add option"
1501
+ @click="addPreferenceOption(preference, `Option ${preference.options.length + 1}`)"
1502
+ >
1503
+ <template #default>
1504
+ <div>Add option</div>
1505
+ </template>
1506
+ </FmButton>
1507
+ <template v-if="!preference.options.includes('Other')">
1508
+ <div>or</div>
1509
+ <FmButton
1510
+ variant="plain"
1511
+ label='add "Other"'
1512
+ @click="addPreferenceOption(preference, 'Other')"
1513
+ />
1514
+ </template>
1515
+ </div>
1516
+ </div>
1517
+ </div>
1518
+ </FmCard>
1519
+
1520
+ <FmCard variant="outlined" class="border-dashed p-16" v-if="rangeSetting.preferences.length">
1521
+ <FmButton
1522
+ label="Add another preference category"
1523
+ icon="add"
1524
+ variant="plain"
1525
+ class="border-1 border-fm-color-primary rounded-lg"
1526
+ @click="addPreference"
1527
+ />
1528
+ </FmCard>
1529
+ </div>
1515
1530
 
1516
- <FmCard
1517
- variant="outlined"
1518
- class="border-dashed p-16"
1519
- v-if="rangeSetting.preferences.length"
1520
- >
1521
- <FmButton
1522
- label="Add another preference category"
1523
- icon="add"
1524
- variant="plain"
1525
- class="border-1 border-fm-color-primary rounded-lg"
1526
- @click="addPreference"
1527
- />
1528
- </FmCard>
1531
+ <div class="flex flex-col">
1532
+ <div class="flex-grow fm-typo-en-title-sm-600 mb-4">Guest Message</div>
1533
+ <div class="fm-typo-en-body-lg-400 text-fm-color-typo-secondary mb-24">
1534
+ Add important information or notes guests should know before their visit.
1529
1535
  </div>
1530
1536
 
1531
- <div class="flex flex-col">
1532
- <div class="flex-grow fm-typo-en-title-sm-600 mb-4">Guest Message</div>
1533
- <div class="fm-typo-en-body-lg-400 text-fm-color-typo-secondary mb-24">
1534
- Add important information or notes guests should know before their visit.
1535
- </div>
1537
+ <FmSwitch
1538
+ class="mb-16"
1539
+ label="Enable guest message"
1540
+ label-placement="right"
1541
+ :model-value="rangeSetting.guestMessage !== null && rangeSetting.guestMessage !== undefined"
1542
+ @update:model-value="toggleGuestMessage"
1543
+ />
1536
1544
 
1537
- <FmSwitch
1538
- class="mb-16"
1539
- label="Enable guest message"
1540
- label-placement="right"
1541
- :model-value="
1542
- rangeSetting.guestMessage !== null && rangeSetting.guestMessage !== undefined
1543
- "
1544
- @update:model-value="toggleGuestMessage"
1545
+ <div v-if="rangeSetting.guestMessage !== null && rangeSetting.guestMessage !== undefined">
1546
+ <div class="mb-8 fm-typo-en-body-md-600">Message</div>
1547
+ <FmTextarea
1548
+ v-model="rangeSetting.guestMessage"
1549
+ :maxLength="600"
1550
+ placeholder="Please take note of the following important details before making a reservation:"
1551
+ class="mb-4"
1545
1552
  />
1546
-
1547
- <div v-if="rangeSetting.guestMessage !== null && rangeSetting.guestMessage !== undefined">
1548
- <div class="mb-8 fm-typo-en-body-md-600">Message</div>
1549
- <FmTextarea
1550
- v-model="rangeSetting.guestMessage"
1551
- :maxLength="600"
1552
- placeholder="Please take note of the following important details before making a reservation:"
1553
- class="mb-4"
1554
- />
1555
- <div class="text-right text-fm-color-typo-tertiary fm-typo-en-body-sm-400">
1556
- {{ rangeSetting.guestMessage?.length || 0 }} / 600 characters
1557
- </div>
1553
+ <div class="text-right text-fm-color-typo-tertiary fm-typo-en-body-sm-400">
1554
+ {{ rangeSetting.guestMessage?.length || 0 }} / 600 characters
1558
1555
  </div>
1559
1556
  </div>
1557
+ </div>
1560
1558
 
1561
- <div class="flex flex-col">
1562
- <div class="flex-grow fm-typo-en-title-sm-600 mb-4">Cancellation Policy</div>
1563
- <div class="fm-typo-en-body-lg-400 text-fm-color-typo-secondary mb-24">
1564
- Set the rules guests should follow when cancelling a reservation.
1565
- </div>
1559
+ <div class="flex flex-col">
1560
+ <div class="flex-grow fm-typo-en-title-sm-600 mb-4">Cancellation Policy</div>
1561
+ <div class="fm-typo-en-body-lg-400 text-fm-color-typo-secondary mb-24">
1562
+ Set the rules guests should follow when cancelling a reservation.
1563
+ </div>
1566
1564
 
1567
- <FmSwitch
1568
- class="mb-16"
1569
- label="Enable cancellation policy"
1570
- label-placement="right"
1571
- :model-value="
1572
- rangeSetting.cancellationPolicy !== null &&
1573
- rangeSetting.cancellationPolicy !== undefined
1574
- "
1575
- @update:model-value="toggleCancellationPolicy"
1576
- />
1565
+ <FmSwitch
1566
+ class="mb-16"
1567
+ label="Enable cancellation policy"
1568
+ label-placement="right"
1569
+ :model-value="
1570
+ rangeSetting.cancellationPolicy !== null && rangeSetting.cancellationPolicy !== undefined
1571
+ "
1572
+ @update:model-value="toggleCancellationPolicy"
1573
+ />
1577
1574
 
1578
- <div
1579
- v-if="
1580
- rangeSetting.cancellationPolicy !== null &&
1581
- rangeSetting.cancellationPolicy !== undefined
1582
- "
1583
- >
1584
- <div class="mb-8 fm-typo-en-body-md-600">Message</div>
1585
- <FmTextarea
1586
- v-model="rangeSetting.cancellationPolicy"
1587
- :maxLength="200"
1588
- placeholder="Cancellation Policy"
1589
- class="mb-4"
1590
- />
1591
- <div class="text-right text-fm-color-typo-tertiary fm-typo-en-body-sm-400">
1592
- {{ rangeSetting.cancellationPolicy?.length || 0 }} / 200 characters
1593
- </div>
1575
+ <div
1576
+ v-if="
1577
+ rangeSetting.cancellationPolicy !== null && rangeSetting.cancellationPolicy !== undefined
1578
+ "
1579
+ >
1580
+ <div class="mb-8 fm-typo-en-body-md-600">Message</div>
1581
+ <FmTextarea
1582
+ v-model="rangeSetting.cancellationPolicy"
1583
+ :maxLength="200"
1584
+ placeholder="Cancellation Policy"
1585
+ class="mb-4"
1586
+ />
1587
+ <div class="text-right text-fm-color-typo-tertiary fm-typo-en-body-sm-400">
1588
+ {{ rangeSetting.cancellationPolicy?.length || 0 }} / 200 characters
1594
1589
  </div>
1595
1590
  </div>
1596
- </template>
1591
+ </div>
1597
1592
 
1598
1593
  <!-- Save Button -->
1599
1594
  <div class="flex mt-5">