appointment.js
6 days ago
appointmentWaitingListOptions.js
6 days ago
attendee.js
6 days ago
auth.js
6 days ago
bookableType.js
6 days ago
booking.js
6 days ago
cabinet.js
6 days ago
cabinetFilters.js
6 days ago
coupon.js
6 days ago
customFields.js
6 days ago
customerInfo.js
6 days ago
employee.js
6 days ago
entities.js
6 days ago
event.js
6 days ago
eventBooking.js
6 days ago
eventEntities.js
6 days ago
eventWaitingListOptions.js
6 days ago
pagination.js
6 days ago
params.js
6 days ago
payment.js
6 days ago
persons.js
6 days ago
recurring.js
6 days ago
shortcodeParams.js
6 days ago
stepByStepFilters.js
6 days ago
tickets.js
6 days ago
appointmentWaitingListOptions.js
79 lines
| 1 | export default { |
| 2 | namespaced: true, |
| 3 | |
| 4 | state: () => ({ |
| 5 | enabled: false, |
| 6 | maxCapacity: 0, |
| 7 | maxExtraPeople: 0, |
| 8 | maxExtraPeopleEnabled: false, |
| 9 | peopleWaiting: 0, |
| 10 | isWaitingListSlot: false, |
| 11 | selectedProviderId: null, |
| 12 | }), |
| 13 | |
| 14 | getters: { |
| 15 | getIsWaitingListSlot(state) { |
| 16 | return state.isWaitingListSlot |
| 17 | }, |
| 18 | |
| 19 | getWaitingListOptions(state) { |
| 20 | return { |
| 21 | enabled: state.enabled, |
| 22 | maxCapacity: state.maxCapacity, |
| 23 | maxExtraPeople: state.maxExtraPeople, |
| 24 | maxExtraPeopleEnabled: state.maxExtraPeopleEnabled, |
| 25 | peopleWaiting: state.peopleWaiting, |
| 26 | isWaitingListSlot: state.isWaitingListSlot, |
| 27 | selectedProviderId: state.selectedProviderId, |
| 28 | } |
| 29 | }, |
| 30 | |
| 31 | getOptions(state) { |
| 32 | return { |
| 33 | enabled: state.enabled, |
| 34 | maxCapacity: state.maxCapacity, |
| 35 | maxExtraPeople: state.maxExtraPeople, |
| 36 | maxExtraPeopleEnabled: state.maxExtraPeopleEnabled, |
| 37 | peopleWaiting: state.peopleWaiting, |
| 38 | isWaitingListSlot: state.isWaitingListSlot, |
| 39 | selectedProviderId: state.selectedProviderId, |
| 40 | } |
| 41 | }, |
| 42 | }, |
| 43 | |
| 44 | mutations: { |
| 45 | setAllData(state, payload) { |
| 46 | state.enabled = payload.enabled |
| 47 | state.maxCapacity = payload.maxCapacity |
| 48 | state.maxExtraPeople = payload.maxExtraPeople |
| 49 | state.maxExtraPeopleEnabled = payload.maxExtraPeopleEnabled |
| 50 | state.peopleWaiting = payload.peopleWaiting |
| 51 | state.isWaitingListSlot = 'isWaitingListSlot' in payload ? payload.isWaitingListSlot : false |
| 52 | state.selectedProviderId = 'selectedProviderId' in payload ? payload.selectedProviderId : null |
| 53 | }, |
| 54 | setIsWaitingListSlot(state, payload) { |
| 55 | state.isWaitingListSlot = !!payload |
| 56 | }, |
| 57 | setPeopleWaiting(state, payload) { |
| 58 | state.peopleWaiting = payload |
| 59 | }, |
| 60 | setSelectedProviderId(state, payload) { |
| 61 | state.selectedProviderId = payload |
| 62 | }, |
| 63 | }, |
| 64 | |
| 65 | actions: { |
| 66 | resetWaitingOptions({ commit }) { |
| 67 | commit('setAllData', { |
| 68 | enabled: false, |
| 69 | maxCapacity: 0, |
| 70 | maxExtraPeople: 0, |
| 71 | maxExtraPeopleEnabled: false, |
| 72 | peopleWaiting: 0, |
| 73 | isWaitingListSlot: false, |
| 74 | selectedProviderId: null, |
| 75 | }) |
| 76 | }, |
| 77 | }, |
| 78 | } |
| 79 |