{"version":3,"sources":["webpack:///./src/utilities/amenities/calculate/ownerEventTotals.js","webpack:///./src/services/Amenities/AmenityReservation/store.js","webpack:///./src/services/Amenities/AmenityReservableTime/Post.js","webpack:///./src/containers/PageContent.vue?c88c","webpack:///src/containers/PageContent.vue","webpack:///./src/containers/PageContent.vue?67b1","webpack:///./src/containers/PageContent.vue","webpack:///./src/services/Amenities/Amenity/Post.js","webpack:///./src/services/Amenities/Amenity/Put.js","webpack:///./src/services/Amenities/store.js","webpack:///./src/utilities/get/Array.js","webpack:///./src/services/Amenities/AmenityReservation/ApproveReservation.js","webpack:///./src/utilities/Date/constants.js","webpack:///./src/services/Amenities/AmenityReservation/Delete.js","webpack:///./src/utilities/amenities/reservationIsApproved.js","webpack:///./src/utilities/time/isInvalid.js","webpack:///./src/utilities/amenities/parseReservations.js"],"names":["calcOwnerEventTotals","amenityData","ownerID","amenityReservations","_get","requiresApproval","now","moment","parseReservations","dates","reservations","your","future","count","list","requests","past","key","thisDate","isPast","isBefore","a","length","r","reservation","isApproved","reservationIsApproved","push","totals","actions","getAmenityReservationById","amenityReservationID","console","debug","kms","get","result","JSON","stringify","notifyProblem","error","cancelWithRefund","dispatch","payload","done","post","results","undefined","detail","notifyError","message","indexOf","updateAmenityReservationForPaymentOnApproval","params","existingAmenityReservation","tokenNumber","isApprovalPending","ownerPaymentMethodID","put","isDebug","Vue","use","Vuex","amenityReservationStore","Store","state","mutations","getters","addReservableTime","json","log","successful","render","_vm","this","_h","$createElement","_c","_self","staticClass","attrs","title","style","_v","_s","_e","subtitle","_t","staticRenderFns","props","String","sectionStyles","type","Object","default","containerStyles","computed","_sectionStyles","component","addAmenity","updateAmenity","amenityStore","amenityAdded","amenityReservableTimeAdded","amenityReservableTimeRemoved","amenityReservationAdded","amenityReservationCancelled","amenityUpdated","updateMain","commit","getArray","b","c","variable","Array","isArray","x","approveAmenityReservation","wkDaysNums","freeze","1","2","3","4","5","6","7","monthNums","8","9","10","11","12","monthNumerals","monthStrs","January","February","March","April","May","June","July","August","September","October","November","December","deleteAmenityReservation","_params","isBeingRejectedByManager","path","delete","approvedByAspNetUserID","timeIsInvalid","t","includes","Number","isInteger","parseInt","s","split","map","e","dayOfWeek","sDate","eDate","reservationOwnerID","rDayOfWeek","day","toLowerCase"],"mappings":"kHAAA,wGAcO,SAASA,EAAT,GAAwD,IAAxBC,EAAwB,EAAxBA,YAAaC,EAAW,EAAXA,QAC5CC,EAAsBC,IAAKH,EAAa,CAAC,uBAAwB,IACjEI,EAAmBD,IAAKH,EAAa,CAAC,oBAAqB,MAE3DK,EAAMC,MAJiD,EAO7BC,eAAkB,CAChDL,sBACAD,YAFoBO,EAPuC,EAOrDC,aAKFC,EAAO,CACXC,OAAQ,CACNF,aAAc,CACZG,MAAO,EACPC,KAAM,IAERC,SAAU,CACRF,MAAO,EACPC,KAAM,KAGVE,KAAM,CACJN,aAAc,CACZG,MAAO,EACPC,KAAM,IAERC,SAAU,CACRF,MAAO,EACPC,KAAM,MAQZ,IAAK,IAAIG,KAAOR,EAKd,IAJA,IAAMS,EAAWX,IAAOU,GAClBE,EAASD,EAASE,SAASd,GAC3BI,EAAeD,EAAMQ,GAElBI,EAAI,EAAGA,EAAIX,EAAaY,OAAQD,IAAK,CAC5C,IAAME,EAAInB,IAAKM,EAAc,CAACW,EAAG,GAAI,MAE/BG,EAAcpB,IAAKM,EAAc,CAACW,EAAG,GAAI,MACzCI,EAAaC,eAAsB,CACvCF,gBAGEL,GACuB,IAArBd,EACEoB,GACFd,EAAKK,KAAKN,aAAaG,OAAS,EAChCF,EAAKK,KAAKN,aAAaI,KAAKa,KAAKJ,KAEjCZ,EAAKK,KAAKD,SAASF,OAAS,EAC5BF,EAAKK,KAAKD,SAASD,KAAKa,KAAKJ,KAG/BZ,EAAKK,KAAKN,aAAaG,OAAS,EAChCF,EAAKK,KAAKN,aAAaI,KAAKa,KAAKJ,KAGV,IAArBlB,EACEoB,GACFd,EAAKC,OAAOF,aAAaG,OAAS,EAClCF,EAAKC,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EAAIlB,EAAoBmB,OAAQD,IAAK,CACnD,IAAMG,EAAcrB,EAAoBkB,GAElC+I,EAAQhK,IAAKoB,EAAa,YAAa,IAAIwI,MAAM,KACjDK,EAAQjK,IAAKoB,EAAa,UAAW,IAAIwI,MAAM,KAErD,GAAIP,eAAcW,EAAM,IACtBpI,QAAQQ,MAAM,eAAgB,CAAE4H,eAGlC,GAAIX,eAAcY,EAAM,IACtBrI,QAAQQ,MAAM,eAAgB,CAAE6H,cADlC,CAKA,IAAMC,EAAqBlK,IAAKoB,EAAa,qBAAsB,IACnE,GAAuB,kBAAZtB,GACLoK,IAAuBpK,EAD7B,CAMA,GAAyB,kBAAdiK,EACT,IACE,IAAMI,EAAajD,OAAW/G,IAAOH,IAAKoB,EAAa,YAAa,KAAKgJ,MAAQ,GACjF,GAAID,EAAWE,gBAAkBN,EAAUM,cACzC,SAEF,MAAOrD,GACPpF,QAAQQ,MAAM4E,GAIbF,MAAMC,QAAQ1G,EAAM2J,EAAM,OAC7B3J,EAAM2J,EAAM,IAAM,IAEpB3J,EAAM2J,EAAM,IAAIzI,KAAK,CAACyI,EAAM,GAAIC,EAAM,GAAI7I,MAG5C,MAAO,CACLd,aAAcD","file":"js/chunk-c234e68c.4cbcdea9.js","sourcesContent":["/*\r\n\timport { calcOwnerEventTotals } from '@/utilities/amenities/calculate/ownerEventTotals'\r\n\r\n\tconst { total } = calcOwnerEventTotals ({\r\n\t\tamenityData,\r\n\t\townerID\r\n\t})\r\n*/\r\n\r\nimport _get from 'lodash/get'\r\nimport moment from 'moment'\r\nimport { parseReservations } from '@/utilities/amenities/parseReservations'\r\nimport { reservationIsApproved } from '@/utilities/amenities/reservationIsApproved'\r\n\r\nexport function calcOwnerEventTotals({ amenityData, ownerID }) {\r\n const amenityReservations = _get(amenityData, ['amenityReservations'], [])\r\n const requiresApproval = _get(amenityData, ['requiresApproval'], null)\r\n\r\n const now = moment()\r\n\r\n // filters by ownerID\r\n const { reservations: dates } = parseReservations({\r\n amenityReservations,\r\n ownerID\r\n })\r\n\r\n const your = {\r\n future: {\r\n reservations: {\r\n count: 0,\r\n list: []\r\n },\r\n requests: {\r\n count: 0,\r\n list: []\r\n }\r\n },\r\n past: {\r\n reservations: {\r\n count: 0,\r\n list: []\r\n },\r\n requests: {\r\n count: 0,\r\n list: []\r\n }\r\n }\r\n }\r\n\r\n /*\r\n\t\tcalculate \r\n\t*/\r\n for (let key in dates) {\r\n const thisDate = moment(key)\r\n const isPast = thisDate.isBefore(now)\r\n const reservations = dates[key]\r\n\r\n for (let a = 0; a < reservations.length; a++) {\r\n const r = _get(reservations, [a, 2], null)\r\n\r\n const reservation = _get(reservations, [a, 2], null)\r\n const isApproved = reservationIsApproved({\r\n reservation\r\n })\r\n\r\n if (isPast) {\r\n if (requiresApproval === true) {\r\n if (isApproved) {\r\n your.past.reservations.count += 1\r\n your.past.reservations.list.push(r)\r\n } else {\r\n your.past.requests.count += 1\r\n your.past.requests.list.push(r)\r\n }\r\n } else {\r\n your.past.reservations.count += 1\r\n your.past.reservations.list.push(r)\r\n }\r\n } else {\r\n if (requiresApproval === true) {\r\n if (isApproved) {\r\n your.future.reservations.count += 1\r\n your.future.reservations.list.push(r)\r\n } else {\r\n your.future.requests.count += 1\r\n your.future.requests.list.push(r)\r\n }\r\n } else {\r\n your.future.reservations.count += 1\r\n your.future.reservations.list.push(r)\r\n }\r\n }\r\n }\r\n }\r\n\r\n return {\r\n totals: your\r\n }\r\n}\r\n","// /*\r\n// import { amenityReservationStore } from '@/services/Amenities/AmenityReservation/store'\r\n//})\r\n// */\r\n\r\nimport Vue from 'vue'\r\nimport Vuex from 'vuex'\r\nimport { notifyProblem, notifyError } from '@/services/notify'\r\nimport kms from '@/services/kms'\r\n\r\n/* eslint-disable no-empty-pattern */\r\nconst actions = {\r\n async getAmenityReservationById({}, { amenityReservationID }) {\r\n try {\r\n console.debug('in getAmenityReservationById...')\r\n const result = await kms.get(`/Amenities/AmenityReservation/${amenityReservationID}`)\r\n\r\n console.debug('getAmenityReservationById=' + JSON.stringify(result))\r\n\r\n return {\r\n result: result\r\n }\r\n } catch (exception) {\r\n notifyProblem(`There was a problem retrieving this amenity reservation.`)\r\n console.error(exception)\r\n }\r\n\r\n return {\r\n result: {}\r\n }\r\n },\r\n\r\n async cancelWithRefund({ dispatch }, { payload = {}, done }) {\r\n try {\r\n const results = await kms.post(\r\n `/Amenities/AmenityReservation/CancelReservation?amenityReservationID=${payload.amenityReservationID}`\r\n )\r\n\r\n console.debug('cancelWithRefund=' + JSON.stringify(results))\r\n\r\n if (dispatch && dispatch != undefined) console.debug(dispatch)\r\n\r\n if (results.amenityReservationID > 0) {\r\n console.debug(`Successfully refunded the cancellation of this amenity reservation.`)\r\n done({ detail: results })\r\n } else {\r\n notifyError('There was a problem refunding the cancellation of this amenity reservation.')\r\n }\r\n } catch (exception) {\r\n if (exception.message.indexOf('did not pass validation') > -1) {\r\n notifyProblem(exception.message)\r\n } else {\r\n notifyProblem(\r\n `There was a problem refunding the cancellation for this amenity reservation.`\r\n )\r\n }\r\n\r\n console.error(exception)\r\n }\r\n },\r\n\r\n async updateAmenityReservationForPaymentOnApproval({ dispatch }, { params = {}, done }) {\r\n try {\r\n //retrieve by id\r\n var existingAmenityReservation = await kms.get(\r\n `/Amenities/AmenityReservation/${params.amenityReservationID}`\r\n )\r\n\r\n if (existingAmenityReservation !== undefined && existingAmenityReservation) {\r\n console.debug('params for update=' + JSON.stringify(params))\r\n\r\n if (params.tokenNumber !== undefined && params.tokenNumber && params.tokenNumber !== '') {\r\n existingAmenityReservation.tokenNumber =\r\n params.tokenNumber !== undefined && params.tokenNumber ? params.tokenNumber : null\r\n } else {\r\n existingAmenityReservation.tokenNumber = null\r\n }\r\n\r\n if (params.isApprovalPending !== undefined && params.isApprovalPending === true) {\r\n existingAmenityReservation.isApprovalPending = true\r\n } else {\r\n existingAmenityReservation.isApprovalPending = null\r\n }\r\n\r\n if (\r\n params.ownerPaymentMethodID !== undefined &&\r\n params.ownerPaymentMethodID &&\r\n params.ownerPaymentMethodID > 0\r\n ) {\r\n existingAmenityReservation.ownerPaymentMethodID =\r\n params.ownerPaymentMethodID !== undefined && params.ownerPaymentMethodID\r\n ? params.ownerPaymentMethodID\r\n : null\r\n } else {\r\n existingAmenityReservation.ownerPaymentMethodID = null\r\n }\r\n\r\n const payload = existingAmenityReservation\r\n\r\n const results = await kms.put(`/Amenities/AmenityReservation`, payload)\r\n\r\n if (this.isDebug == true) console.debug('results=' + JSON.stringify(results))\r\n\r\n if (dispatch && dispatch != undefined) console.debug(dispatch)\r\n\r\n if (results.amenityReservationID > 0) {\r\n console.debug(`Successfully updated this amenity reservation for payment on approval.`)\r\n done({ detail: results })\r\n } else {\r\n notifyError(\r\n 'There was a problem updating this amenity reservation for payment on approval.'\r\n )\r\n }\r\n }\r\n } catch (exception) {\r\n if (exception.message.indexOf('did not pass validation') > -1) {\r\n notifyProblem(exception.message)\r\n }\r\n notifyProblem(\r\n `There was a problem updating this amenity reservation for payment on approval.`\r\n )\r\n console.error(exception)\r\n }\r\n }\r\n}\r\n/* eslint-enable no-empty-pattern */\r\n\r\nVue.use(Vuex)\r\nexport const amenityReservationStore = new Vuex.Store({\r\n state: {},\r\n mutations: {},\r\n getters: {},\r\n actions\r\n})\r\n","/*\r\n\timport { addReservableTime } from '@/services/Amenities/AmenityReservableTime/Post';\r\n\r\n const { successful, message } = await addReservableTime ({\r\n json: {\r\n \"amenityID\": 14,\r\n \"dayOfWeek\": \"Wednesday\",\r\n \"startTime\": \"2023-01-11T01:08:16.817Z\",\r\n \"endTime\": \"2023-01-11T01:11:16.817Z\",\r\n \"cleanupDurationInMinutes\": 18,\r\n }\r\n });\r\n if (!successful) {\r\n console.error (message);\r\n return;\r\n }\r\n*/\r\n\r\nimport kms from '@/services/kms'\r\n\r\nexport async function addReservableTime({ json }) {\r\n let message = 'The amenity could not be added.'\r\n\r\n console.log({ json })\r\n\r\n try {\r\n await kms.post(`/Amenities/AmenityReservableTime`, json)\r\n\r\n return {\r\n successful: true,\r\n message\r\n }\r\n } catch (exception) {\r\n console.error(exception)\r\n }\r\n\r\n return {\r\n successful: false,\r\n message\r\n }\r\n}\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"page\",attrs:{\"role\":\"main\",\"aria-label\":_vm.title,\"tests-id\":(\"PageContent-\" + _vm.title)}},[_c('div',{staticClass:\"container\",style:(_vm.containerStyles)},[_c('div',{staticClass:\"section\",style:(_vm._sectionStyles)},[(_vm.title)?_c('h3',[_vm._v(_vm._s(_vm.title))]):_vm._e(),(_vm.subtitle)?_c('span',{staticClass:\"subtitle\"},[_vm._v(_vm._s(_vm.subtitle))]):_vm._e(),_vm._t(\"default\")],2)])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n \r\n \r\n \r\n {{ title }}\r\n {{ subtitle }}\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PageContent.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PageContent.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./PageContent.vue?vue&type=template&id=2b51c2b9&\"\nimport script from \"./PageContent.vue?vue&type=script&lang=js&\"\nexport * from \"./PageContent.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","/*\r\n\timport { addAmenity } from '@/services/Amenities/Amenity/Post';\r\n\r\n const { successful, message } = await addAmenity ({\r\n json: {\r\n\t\t\thoaID\r\n }\r\n });\r\n if (!successful) {\r\n console.error (message);\r\n return;\r\n }\r\n*/\r\n\r\nimport kms from '@/services/kms'\r\n\r\nexport async function addAmenity({ json }) {\r\n let message = 'The amenity could not be added.'\r\n\r\n try {\r\n const result = await kms.post(`/Amenities/Amenity`, json)\r\n\r\n return {\r\n successful: true,\r\n message,\r\n result\r\n }\r\n } catch (exception) {\r\n console.error(exception)\r\n }\r\n\r\n return {\r\n successful: false,\r\n message,\r\n result: null\r\n }\r\n}\r\n","/*\r\n\timport { updateAmenity } from '@/services/Amenities/Amenity/Put';\r\n\r\n const { successful, message } = await updateAmenity ({\r\n json: {\r\n\t\t\thoaID\r\n ...\r\n }\r\n });\r\n if (!successful) {\r\n console.error (message);\r\n return;\r\n }\r\n*/\r\n\r\nimport kms from '@/services/kms'\r\n\r\nexport async function updateAmenity({ json }) {\r\n let message = 'The amenity could not be updated.'\r\n\r\n try {\r\n const result = await kms.put(`/Amenities/Amenity/UpdateMinimal`, json)\r\n\r\n return {\r\n successful: true,\r\n message,\r\n result\r\n }\r\n } catch (exception) {\r\n console.error(exception)\r\n }\r\n\r\n return {\r\n successful: false,\r\n message,\r\n result: null\r\n }\r\n}\r\n","/*\r\n import { amenityStore } from '@/services/Amenities/store'\r\n\r\n this.unsubAmenityStore = amenityStore.subscribe((mutation, state) => {\r\n const mType = mutation.type;\r\n\r\n\r\n })\r\n\r\n this.unsubAmenityStore();\r\n*/\r\n\r\nimport { addAmenity } from '@/services/Amenities/Amenity/Post'\r\nimport { addReservableTime } from '@/services/Amenities/AmenityReservableTime/Post'\r\nimport { updateAmenity } from '@/services/Amenities/Amenity/Put'\r\n\r\nimport Vue from 'vue'\r\nimport Vuex from 'vuex'\r\n\r\nVue.use(Vuex)\r\nexport const amenityStore = new Vuex.Store({\r\n state: {},\r\n mutations: {\r\n async amenityAdded() {},\r\n async amenityReservableTimeAdded() {},\r\n async amenityReservableTimeRemoved() {},\r\n async amenityReservationAdded() {},\r\n async amenityReservationCancelled() {},\r\n async amenityUpdated() {},\r\n\r\n /*\r\n\t\t\tawait amenityStore.commit ('updateMain');\r\n */\r\n async updateMain() {}\r\n },\r\n /* eslint-disable no-empty-pattern */\r\n actions: {\r\n /*\r\n\t const { successful, message } = await amenityStore.dispatch ('addAmenity', {\r\n\t json: {\r\n\t\t\t\t\t\r\n\t }\r\n\t });\r\n\t */\r\n async addAmenity({ commit }, { json }) {\r\n const { successful, message } = await addAmenity({\r\n json\r\n })\r\n if (successful) {\r\n commit('amenityAdded')\r\n }\r\n\r\n return {\r\n successful,\r\n message\r\n }\r\n },\r\n\r\n async updateAmenity({ commit }, { json }) {\r\n const { successful, message } = await updateAmenity({\r\n json\r\n })\r\n if (successful) {\r\n commit('amenityUpdated')\r\n }\r\n\r\n return {\r\n successful,\r\n message\r\n }\r\n },\r\n /*\r\n\t const { successful, message } = await amenityStore.dispatch ('addReservableTime', {\r\n\t json: {\r\n\t\t\t\t\t\r\n\t }\r\n\t });\r\n\t */\r\n async addReservableTime({ commit }, { json }) {\r\n const { successful, message } = await addReservableTime({\r\n json\r\n })\r\n if (successful) {\r\n commit('amenityReservableTimeAdded')\r\n }\r\n\r\n return {\r\n successful,\r\n message\r\n }\r\n }\r\n },\r\n /* eslint-enable no-empty-pattern */\r\n getters: {}\r\n})\r\n","/*\r\n import { getArray } from '@/utilities/get/Array'\r\n\r\n const array = getArray ()\r\n */\r\n\r\nimport _get from 'lodash/get'\r\n\r\nexport function getArray(a, b, c) {\r\n try {\r\n const variable = _get(a, b, c)\r\n\r\n if (Array.isArray(variable)) {\r\n return variable\r\n }\r\n } catch (x) {\r\n console.error(x)\r\n }\r\n\r\n return []\r\n}\r\n","/*\r\n\timport { approveAmenityReservation } from '@/services/Amenities/AmenityReservation/ApproveReservation';\r\n\r\n const { successful, message } = await approveAmenityReservation ({\r\n amenityReservationID\r\n });\r\n if (!successful) {\r\n console.error (message);\r\n return;\r\n }\r\n*/\r\n\r\nimport kms from '@/services/kms'\r\n\r\nexport async function approveAmenityReservation({ amenityReservationID }) {\r\n let message = 'The amenity reservation request could not be approved.'\r\n\r\n try {\r\n await kms.post(\r\n `/Amenities/AmenityReservation/ApproveReservation?amenityReservationID=${amenityReservationID}`\r\n )\r\n\r\n return {\r\n successful: true,\r\n message\r\n }\r\n } catch (exception) {\r\n console.error(exception)\r\n }\r\n\r\n return {\r\n successful: false,\r\n message\r\n }\r\n}\r\n","/*\r\n\timport { wkDaysNums, monthNums, monthStrs, monthNumerals } from '@/utilities/Date/constants'\r\n*/\r\n\r\n/*\r\n\tconst dayOfWeek = wkDaysNums [ moment ().day () + 1 ];\r\n\r\n\t\tmoment.day () \r\n\t\t\t0 -> Sunday\r\n\t\t\t1 -> Monday\r\n\t\t\t...\r\n\t\t\t6 -> Saturday\r\n*/\r\n\r\nexport const wkDaysNums = Object.freeze({\r\n 1: 'Sunday',\r\n 2: 'Monday',\r\n 3: 'Tuesday',\r\n 4: 'Wednesday',\r\n 5: 'Thursday',\r\n 6: 'Friday',\r\n 7: 'Saturday'\r\n})\r\n\r\nexport const monthNums = Object.freeze({\r\n 1: 'January',\r\n 2: 'February',\r\n 3: 'March',\r\n 4: 'April',\r\n 5: 'May',\r\n 6: 'June',\r\n 7: 'July',\r\n 8: 'August',\r\n 9: 'September',\r\n 10: 'October',\r\n 11: 'November',\r\n 12: 'December'\r\n})\r\n\r\nexport const monthNumerals = Object.freeze({\r\n 1: '01',\r\n 2: '02',\r\n 3: '03',\r\n 4: '04',\r\n 5: '05',\r\n 6: '06',\r\n 7: '07',\r\n 8: '08',\r\n 9: '09',\r\n 10: '10',\r\n 11: '11',\r\n 12: '12'\r\n})\r\n\r\nexport const monthStrs = Object.freeze({\r\n January: 1,\r\n February: 2,\r\n March: 3,\r\n April: 4,\r\n May: 5,\r\n June: 6,\r\n July: 7,\r\n August: 8,\r\n September: 9,\r\n October: 10,\r\n November: 11,\r\n December: 12\r\n})\r\n","/*\r\n\timport { deleteAmenityReservation } from '@/services/Amenities/AmenityReservation/Delete';\r\n\r\n const { successful, message } = await deleteAmenityReservation ({\r\n amenityReservationID,\r\n params: {\r\n isBeingRejectedByManager: true\r\n }\r\n });\r\n if (!successful) {\r\n console.error (message);\r\n return;\r\n }\r\n*/\r\n\r\nimport _get from 'lodash/get'\r\nimport kms from '@/services/kms'\r\n\r\nexport async function deleteAmenityReservation({ amenityReservationID, params: _params }) {\r\n let message = 'The amenity reservation could not be deleted.'\r\n\r\n const isBeingRejectedByManager = _get(_params, 'isBeingRejectedByManager', null)\r\n let params = `forceDelete=false`\r\n if (isBeingRejectedByManager === true) {\r\n params += `&isBeingRejectedByManager=true`\r\n }\r\n\r\n const path = `/Amenities/AmenityReservation/${amenityReservationID}?${params}`\r\n\r\n try {\r\n await kms.delete(path, {\r\n params: _params\r\n })\r\n\r\n return {\r\n successful: true,\r\n message\r\n }\r\n } catch (exception) {\r\n console.error(exception)\r\n }\r\n\r\n return {\r\n successful: false,\r\n message\r\n }\r\n}\r\n","/*\r\n\timport { reservationIsApproved } from '@/utilities/amenities/reservationIsApproved'\r\n\r\n\tconst isApproved = reservationIsApproved ({ reservation });\r\n*/\r\n\r\nimport _get from 'lodash/get'\r\n\r\nexport function reservationIsApproved({ reservation }) {\r\n const approvedByAspNetUserID = _get(reservation, 'approvedByAspNetUserID', null)\r\n if (typeof approvedByAspNetUserID === 'string' && approvedByAspNetUserID.length >= 2) {\r\n return true\r\n }\r\n\r\n return false\r\n}\r\n","/*\r\n\timport { timeIsInvalid } from \"@/utilities/time/isInvalid\"\r\n\r\n\tconst a = \"22:00:00\";\r\n\r\n\tconst isntValid = timeIsInvalid (a;\r\n\r\n\r\n\t// results:\r\n\t// 0 -> isntValid -> the time is valid\r\n\t// 1,2,... -> the time isn't valid \r\n*/\r\n\r\n/*\r\n\t00:00:00 to 23:59:59\r\n\r\n\thours: 00 to 25\r\n\t\t00:00:00 is equivalent to 24:00:00\r\n\r\n\tminutes: 00 to 59\r\n\tseconds: 00 to 59\r\n*/\r\nexport function timeIsInvalid(t) {\r\n try {\r\n if (typeof t !== 'string') {\r\n return 1\r\n }\r\n\r\n if (t.length !== 8) {\r\n return 2\r\n }\r\n\r\n /*\r\n\t\t\tmake sure [i,i,c,i,i,c,i,i]\r\n\t\t\t\tint\r\n\t\t\t\tcolon\r\n\r\n\t\t\tc -> cursor\r\n\t\t*/\r\n for (let c = 0; c <= 7; c++) {\r\n if ([0, 1, 3, 4, 6, 7].includes(c)) {\r\n if (!Number.isInteger(parseInt(t[c]))) {\r\n return 3\r\n }\r\n }\r\n\r\n if ([2, 5].includes(c)) {\r\n if (t[c] !== ':') {\r\n return 4\r\n }\r\n }\r\n }\r\n\r\n // s -> split\r\n const s = t.split(':').map(e => parseInt(e))\r\n\r\n // This check may never occur?\r\n for (let c = 0; c <= 2; c++) {\r\n if (!Number.isInteger(s[c])) {\r\n return 5\r\n }\r\n }\r\n\r\n if (s[0] >= 25 || s[0] <= -1) {\r\n return 6\r\n }\r\n if (s[0] === 24) {\r\n if (s[1] !== 0 || s[2] !== 0) {\r\n return 7\r\n }\r\n }\r\n\r\n if (s[1] >= 60 || s[1] <= -1) {\r\n return 8\r\n }\r\n\r\n if (s[2] >= 60 || s[2] <= -1) {\r\n return 9\r\n }\r\n\r\n return 0\r\n } catch (x) {\r\n console.error(x)\r\n }\r\n\r\n return 10\r\n}\r\n","/*\r\n\tdoesn't necessary filter them\r\n\tunless ownerID or dayOfWeek are\r\n\tspecified\r\n\r\n\talways parses\r\n*/\r\n\r\n/*\r\n\timport { parseReservations } from \"@/utilities/amenities/parseReservations\"\r\n\r\n\tconst { reservations } = filterReservations ({\r\n\t\tamenityReservations: [\r\n\t\t\t// { startDate, endDate, reservationOwnerID },\r\n\t\t\t// ...\r\n\t\t\t// { startDate, endDate, reservationOwnerID },\r\n\t\t],\r\n\r\n\t\t// optional\r\n\t\townerID,\r\n\r\n\t\t// optional\r\n\t\tdayOfWeek: \"Thursday\"\r\n\t});\r\n*/\r\n\r\nimport { timeIsInvalid } from '@/utilities/time/isInvalid'\r\nimport { wkDaysNums } from '@/utilities/Date/constants'\r\n//\r\nimport _get from 'lodash/get'\r\nimport moment from 'moment'\r\n//\r\n//\r\nexport function parseReservations({ amenityReservations, ownerID = null, dayOfWeek = null }) {\r\n const dates = {\r\n /* 2021-11-04 */\r\n }\r\n\r\n for (let a = 0; a < amenityReservations.length; a++) {\r\n const reservation = amenityReservations[a]\r\n\r\n const sDate = _get(reservation, 'startDate', '').split('T')\r\n const eDate = _get(reservation, 'endDate', '').split('T')\r\n\r\n if (timeIsInvalid(sDate[1])) {\r\n console.error('invalid date', { sDate })\r\n continue\r\n }\r\n if (timeIsInvalid(eDate[1])) {\r\n console.error('invalid date', { eDate })\r\n continue\r\n }\r\n\r\n const reservationOwnerID = _get(reservation, 'reservationOwnerID', '')\r\n if (typeof ownerID === 'number') {\r\n if (reservationOwnerID !== ownerID) {\r\n continue\r\n }\r\n }\r\n\r\n if (typeof dayOfWeek === 'string') {\r\n try {\r\n const rDayOfWeek = wkDaysNums[moment(_get(reservation, 'startDate', '')).day() + 1]\r\n if (rDayOfWeek.toLowerCase() !== dayOfWeek.toLowerCase()) {\r\n continue\r\n }\r\n } catch (x) {\r\n console.error(x)\r\n }\r\n }\r\n\r\n if (!Array.isArray(dates[sDate[0]])) {\r\n dates[sDate[0]] = []\r\n }\r\n dates[sDate[0]].push([sDate[1], eDate[1], reservation])\r\n }\r\n\r\n return {\r\n reservations: dates\r\n }\r\n}\r\n"],"sourceRoot":""}