{"version":3,"sources":["webpack:///./src/utils/Defaults.ts","webpack:///./src/assets/Admin/assets/img/dashboard/chef.jpg","webpack:///./src/views/Admin/Coupons.vue?1c86","webpack:///./src/utils/API/CouponsRepository.ts","webpack:///./src/views/Admin/Coupons.vue","webpack:///./src/models/Coupon/Coupon.ts","webpack:///./src/views/Admin/Coupons.vue?fdd1","webpack:///./src/views/Admin/Coupons.vue?8d62","webpack:///./src/views/Admin/Coupons.vue?1528","webpack:///./src/utils/API/PartnersRepository.ts"],"names":["NA","dateTimeDisplayFormat","dateDisplayFormat","module","exports","resource","fetchCoupons","listRequest","Repository","post","concat","withCredentials","createCoupon","updateCoupon","deleteCoupons","deleteCoupon","checkCoupon","couponCode","DiscountType","CouponStatus","CouponType","render","_vm","this","_c","_self","_setupProxy","staticClass","staticStyle","attrs","require","_v","_s","translations","get","on","prepareAddMode","tableHeaders","selectErase","transformCoupons","couponsState","count","totalCount","pageSize","searchable","editableTable","tableLoading","changePage","search","prepareEditMode","prepareDeletePrompt","order","showModal","modalTitle","resetState","$event","preventDefault","submit","apply","arguments","class","errors","has","editMode","directives","name","rawName","value","expression","domProps","target","composing","$set","first","_e","disabledDates","couponType","model","expiryDate","callback","$$v","discountType","_q","usageLimit","partners","partner","slot","isActive","showRemovePrompt","removePromptTitle","confirmDelete","staticRenderFns","Coupons","_Vue","_this","_classCallCheck","coupons","page","filters","orders","field","orderType","OrderType","Asc","partnerId","Absolute","Individual","id","removeList","address","phone","email","couponsCount","to","Date","_inherits","_createClass","key","args","orderings","push","_objectSpread","requestCoupons","ListRequest","_toConsumableArray","ordering","searchString","sortable","toggleModal","found","find","c","temp","ids","length","_this2","$snotify","async","Promise","resolve","reject","CouponsRepository","then","response","body","catch","error","message","data","errorMessages","userVisibleMessage","timeout","closeOnClick","_this3","$validator","validateAll","result","submitUpdate","submitNew","_this4","coupon","simple","Partner","_this5","_this6","map","element","index","e1","code","e2","e3","createdOn","$moment","format","e4","component","props","html","e5","e6","e7","e8","e9","e10","numberOfUsages","meta","link","_this7","_this8","request","$store","getters","getListRequest","dispatch","PARTNERS_REDIRECT","PartnersRepository","fetchPartners","TRANSLATIONS_FETCH","category","collections","document","title","localizationState","Vue","__decorate","Component","components","vTable","vModal","vToggleSwitch","computed","mapState","state","LocalizationModule","newPartner","updatePartner","deletePartner","deletePartners"],"mappings":"kHAAA,sGAAO,IAAMA,EAAK,GACLC,EAAwB,wBACxBC,EAAoB,e,uBCFjCC,EAAOC,QAAU,IAA0B,yB,oCCA3C,W,2DCAA,gBAOMC,EAAW,WAEF,QACXC,aAAY,SAACC,GACT,OAAOC,OAAWC,KAAK,GAADC,OAAIL,EAAQ,gBAAgBE,EAAa,CAAEI,iBAAiB,KAEtFC,aAAY,SAACA,GACT,OAAOJ,OAAWC,KAAK,GAADC,OAAIL,EAAQ,iBAAiBO,EAAc,CAAED,iBAAiB,KAExFE,aAAY,SAACA,GACT,OAAOL,OAAWC,KAAK,GAADC,OAAIL,EAAQ,iBAAiBQ,EAAc,CAAEF,iBAAiB,KAExFG,cAAa,SAACC,GACV,OAAOP,OAAWC,KAAK,GAADC,OAAIL,EAAQ,kBAAkBU,EAAc,CAAEJ,iBAAiB,KAEzFK,YAAW,SAACC,GACR,OAAOT,OAAWC,KAAK,GAADC,OAAIL,EAAQ,iBAAiB,CAAEY,cAAc,CAAEN,iBAAiB,O,yCCvB9F,ICkBYO,EAIAC,EAIAC,ED1BRC,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAUF,EAAIG,MAAMC,YAAY,OAAOF,EAAG,MAAM,CAACG,YAAY,wBAAwB,CAACH,EAAG,MAAM,CAACG,YAAY,WAAW,CAACH,EAAG,MAAM,CAACG,YAAY,sCAAsC,CAACH,EAAG,KAAK,CAACA,EAAG,MAAM,CAACG,YAAY,2BAA2BC,YAAY,CAAC,MAAQ,QAAQC,MAAM,CAAC,IAAMC,EAAQ,QAAoD,IAAM,MAAMR,EAAIS,GAAG,aAAaT,EAAIU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2C,EAAK5J,aAAaC,IAAI,uBAEpD,CAAAmF,IAAA,UAAAlD,MAED,WACE5C,KAAKwK,OAAOG,SAASI,OAAoB,CACvCC,SAAU,QACVC,YAAa,CAAC,UAAW,YAG3BC,SAASC,MAAQ,uBAClB,CAAArF,IAAA,eAAAnF,IAED,WACE,OAAOX,KAAKoL,kBAAkB1K,iBAjnBrB,CAAS2K,QAAhBhH,EAAOiH,eAAA,CAZZC,eAAU,CACTC,WAAY,CACVC,cACAC,cACAC,sBAEFC,SAAQ1F,EAAA,GACH2F,eAAS,CACVT,kBAAmB,SAACU,GAAU,OAAKA,EAAMC,0BAIzC1H,GAonBSA,QChtBoY,I,wBCQ/YoF,EAAY,eACd,EACA3J,EACAsE,GACA,EACA,KACA,WACA,MAIa,aAAAqF,E,2CCnBf,gBAMM3K,EAAW,YAEF,QACXgM,cAAa,SAAC9L,GACV,OAAOC,OAAWC,KAAK,GAADC,OAAIL,EAAQ,iBAAiBE,EAAa,CAACI,iBAAiB,KAEtF4M,WAAU,SAACA,GACP,OAAO/M,OAAWC,KAAK,GAADC,OAAIL,EAAQ,kBAAkBkN,EAAY,CAAC5M,iBAAiB,KAEtF6M,cAAa,SAACA,GACV,OAAOhN,OAAWC,KAAK,GAADC,OAAIL,EAAQ,kBAAkBmN,EAAe,CAAC7M,iBAAiB,KAEzF8M,cAAa,SAACC,GACV,OAAOlN,OAAWC,KAAK,GAADC,OAAIL,EAAQ,mBAAmBqN,EAAgB,CAAC/M,iBAAiB","file":"js/chunk-34294730.9082dd56.js","sourcesContent":["export const NA = '';\r\nexport const dateTimeDisplayFormat = 'DD MMM YYYY - hh:mm A'; // https://momentjs.com/docs/#/parsing/\r\nexport const dateDisplayFormat = 'DD MMM YYYY';","module.exports = __webpack_public_path__ + \"img/chef.43804cf3.jpg\";","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Coupons.vue?vue&type=style&index=0&id=f7b3cb1e&prod&scoped=true&lang=css\"","import Repository from './Repository';\r\nimport ListRequest from '@/models/ListRequest';\r\nimport DeleteCoupons from '@/models/Coupon/DeleteCoupons';\r\nimport UpdateCoupon from '@/models/Coupon/UpdateCoupon';\r\nimport CreateCoupon from '@/models/Coupon/CreateCoupon';\r\n\r\n\r\nconst resource = '/coupons';\r\n\r\nexport default {\r\n fetchCoupons(listRequest: ListRequest) {\r\n return Repository.post(`${resource}/listcoupons`, listRequest, { withCredentials: true });\r\n },\r\n createCoupon(createCoupon: CreateCoupon) {\r\n return Repository.post(`${resource}/createcoupon`, createCoupon, { withCredentials: true });\r\n },\r\n updateCoupon(updateCoupon: UpdateCoupon) {\r\n return Repository.post(`${resource}/updatecoupon`, updateCoupon, { withCredentials: true });\r\n },\r\n deleteCoupons(deleteCoupon: DeleteCoupons) {\r\n return Repository.post(`${resource}/deletecoupons`, deleteCoupon, { withCredentials: true });\r\n },\r\n checkCoupon(couponCode: string) {\r\n return Repository.post(`${resource}/RedeemCoupon`, { couponCode }, { withCredentials: true })\r\n }\r\n};\r\n","var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('div',{staticClass:\"page-content-wrapper\"},[_c('div',{staticClass:\"content\"},[_c('div',{staticClass:\"container-fluid container-fixed-lg\"},[_c('h2',[_c('img',{staticClass:\"img-thumbnail img-circle\",staticStyle:{\"width\":\"75px\"},attrs:{\"src\":require(\"../../assets/Admin/assets/img/dashboard/chef.jpg\"),\"alt\":\"\"}}),_vm._v(\"\\n \"+_vm._s(this.translations.get(\"coupons_title\"))+\"\\n \")])]),_c('div',{staticClass:\"container-fluid container-fixed-lg\"},[_c('div',{staticClass:\"row\",staticStyle:{\"margin-bottom\":\"20px\"}},[_c('div',{staticClass:\"col-md-12\"},[_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"add-btn col-md-9\"},[_c('div',[_c('span',{staticClass:\"btn btn-sm btn-primary btn-fix\",on:{\"click\":_vm.prepareAddMode}},[_c('i',{staticClass:\"fa fa-plus\",attrs:{\"aria-hidden\":\"true\"}}),_vm._v(\"\\n \"+_vm._s(this.translations.get(\"coupons_addbutton\"))+\"\\n \")])])])])])])]),_c('div',{staticClass:\"container-fluid container-fixed-lg\"},[_c('div',{staticClass:\"card card-default\"},[_c('div',{staticClass:\"card-header\"},[_c('div',{staticClass:\"card-title\"},[_vm._v(_vm._s(this.translations.get(\"coupons_table_title\")))]),_c('div',{staticClass:\"clearfix\"})]),_c('div',{staticClass:\"card-body\"},[_c('vTable',{attrs:{\"tableHeaders\":this.tableHeaders,\"selectErase\":_vm.selectErase,\"results\":_vm.transformCoupons,\"total\":_vm.couponsState.count,\"totalCount\":_vm.couponsState.totalCount,\"pageSize\":_vm.couponsState.pageSize,\"searchable\":_vm.searchable,\"editable\":_vm.editableTable,\"loading\":_vm.couponsState.tableLoading},on:{\"changePage\":_vm.changePage,\"search\":_vm.search,\"edit\":_vm.prepareEditMode,\"remove\":_vm.prepareDeletePrompt,\"order\":_vm.order}})],1)])]),_c('vModal',{attrs:{\"show\":_vm.showModal,\"modalTitle\":_vm.modalTitle},on:{\"cancelModal\":_vm.resetState}},[_c('form',{staticClass:\"p-t-15\",attrs:{\"role\":\"form\"},on:{\"submit\":function($event){$event.preventDefault();return _vm.submit.apply(null, arguments)}}},[_c('div',{staticClass:\"form-row\"},[_c('div',{staticClass:\"col-md-6\"},[_c('div',{staticClass:\"form-group\",class:{'has-error':_vm.errors.has('couponName')}},[_c('label',[_vm._v(_vm._s(_vm.translations.get('coupons_modal_coupon_name')))]),(!_vm.editMode)?_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.couponsState.createCoupon.name),expression:\"couponsState.createCoupon.name\"},{name:\"validate\",rawName:\"v-validate\",value:('required'),expression:\"'required'\"}],staticClass:\"form-control\",class:{ 'is-invalid': _vm.errors.has('couponName')},attrs:{\"type\":\"text\",\"placeholder\":_vm.translations.get('coupons_modal_coupon_name_placeholder'),\"name\":\"couponName\",\"data-vv-as\":_vm.translations.get('coupons_modal_coupon_name')},domProps:{\"value\":(_vm.couponsState.createCoupon.name)},on:{\"input\":function($event){if($event.target.composing)return;_vm.$set(_vm.couponsState.createCoupon, \"name\", $event.target.value)}}}):_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.couponsState.updateCoupon.name),expression:\"couponsState.updateCoupon.name\"},{name:\"validate\",rawName:\"v-validate\",value:('required'),expression:\"'required'\"}],staticClass:\"form-control\",class:{ 'is-invalid': _vm.errors.has('couponName')},attrs:{\"type\":\"text\",\"placeholder\":_vm.translations.get('coupons_modal_coupon_name_placeholder'),\"name\":\"couponName\",\"data-vv-as\":_vm.translations.get('coupons_modal_coupon_name')},domProps:{\"value\":(_vm.couponsState.updateCoupon.name)},on:{\"input\":function($event){if($event.target.composing)return;_vm.$set(_vm.couponsState.updateCoupon, \"name\", $event.target.value)}}}),(_vm.errors.has('couponName'))?_c('span',{staticClass:\"error col-12\"},[_vm._v(_vm._s(_vm.errors.first('couponName')))]):_vm._e()])]),_c('div',{staticClass:\"col-md-6\"},[_c('div',{staticClass:\"form-group\"},[_c('label',[_vm._v(_vm._s(_vm.translations.get('coupons_modal_expiry_date')))]),(!_vm.editMode)?_c('datepicker',{attrs:{\"bootstrap-styling\":\"\",\"typeable\":\"\",\"calendar-button-icon\":\"fa fa-calendar\",\"calendar-button\":\"\",\"monday-first\":\"\",\"disabledDates\":_vm.disabledDates,\"disabled\":_vm.couponsState.createCoupon.couponType === 1},model:{value:(_vm.couponsState.createCoupon.expiryDate),callback:function ($$v) {_vm.$set(_vm.couponsState.createCoupon, \"expiryDate\", $$v)},expression:\"couponsState.createCoupon.expiryDate\"}}):_c('datepicker',{attrs:{\"bootstrap-styling\":\"\",\"typeable\":\"\",\"calendar-button-icon\":\"fa fa-calendar\",\"calendar-button\":\"\",\"monday-first\":\"\",\"disabledDates\":_vm.disabledDates,\"disabled\":_vm.couponsState.updateCoupon.couponType === 1},model:{value:(_vm.couponsState.updateCoupon.expiryDate),callback:function ($$v) {_vm.$set(_vm.couponsState.updateCoupon, \"expiryDate\", $$v)},expression:\"couponsState.updateCoupon.expiryDate\"}})],1)])]),_c('div',{staticClass:\"form-row\"},[_c('div',{staticClass:\"form-group col-md-6\"},[_c('label',[_vm._v(_vm._s(_vm.translations.get('coupons_modal_discount_type')))]),(!_vm.editMode)?_c('div',[_c('div',{staticClass:\"radio radio-primary\",staticStyle:{\"display\":\"inline-block\"}},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.couponsState.createCoupon.discountType),expression:\"couponsState.createCoupon.discountType\"}],attrs:{\"id\":\"discountTypeAbsolute\",\"type\":\"radio\"},domProps:{\"value\":0,\"checked\":_vm._q(_vm.couponsState.createCoupon.discountType,0)},on:{\"change\":function($event){return _vm.$set(_vm.couponsState.createCoupon, \"discountType\", 0)}}}),_c('label',{attrs:{\"for\":\"discountTypeAbsolute\"}},[_vm._v(_vm._s(this.translations.get(\"coupons_discounttype_absolute\")))])]),_c('div',{staticClass:\"radio radio-primary\",staticStyle:{\"display\":\"inline-block\"}},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.couponsState.createCoupon.discountType),expression:\"couponsState.createCoupon.discountType\"}],attrs:{\"id\":\"discountTypePercentage\",\"type\":\"radio\"},domProps:{\"value\":1,\"checked\":_vm._q(_vm.couponsState.createCoupon.discountType,1)},on:{\"change\":function($event){return _vm.$set(_vm.couponsState.createCoupon, \"discountType\", 1)}}}),_c('label',{attrs:{\"for\":\"discountTypePercentage\"}},[_vm._v(_vm._s(this.translations.get(\"coupons_discounttype_percentage\")))])])]):_c('div',[_c('div',{staticClass:\"radio radio-primary\",staticStyle:{\"display\":\"inline-block\"}},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.couponsState.updateCoupon.discountType),expression:\"couponsState.updateCoupon.discountType\"}],attrs:{\"id\":\"discountTypeAbsolute\",\"type\":\"radio\"},domProps:{\"value\":0,\"checked\":_vm._q(_vm.couponsState.updateCoupon.discountType,0)},on:{\"change\":function($event){return _vm.$set(_vm.couponsState.updateCoupon, \"discountType\", 0)}}}),_c('label',{attrs:{\"for\":\"discountTypeAbsolute\"}},[_vm._v(_vm._s(this.translations.get(\"coupons_discounttype_absolute\")))])]),_c('div',{staticClass:\"radio radio-primary\",staticStyle:{\"display\":\"inline-block\"}},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.couponsState.updateCoupon.discountType),expression:\"couponsState.updateCoupon.discountType\"}],attrs:{\"id\":\"discountTypePercentage\",\"type\":\"radio\"},domProps:{\"value\":1,\"checked\":_vm._q(_vm.couponsState.updateCoupon.discountType,1)},on:{\"change\":function($event){return _vm.$set(_vm.couponsState.updateCoupon, \"discountType\", 1)}}}),_c('label',{attrs:{\"for\":\"discountTypePercentage\"}},[_vm._v(_vm._s(this.translations.get(\"coupons_discounttype_percentage\")))])])])]),_c('div',{staticClass:\"form-group col-md-6\"},[_c('label',[_vm._v(_vm._s(_vm.translations.get('coupons_modal_discount_value')))]),(!_vm.editMode)?[(_vm.couponsState.createCoupon.discountType === 0)?_c('div',{staticClass:\"input-group\"},[_c('div',{staticClass:\"input-group-prepend\"},[_c('div',{staticClass:\"input-group-text primary\"},[_vm._v(\"$\")])]),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.couponsState.createCoupon.value),expression:\"couponsState.createCoupon.value\"}],staticClass:\"form-control\",attrs:{\"min\":0,\"type\":\"number\",\"placeholder\":_vm.translations.get('coupons_modal_value_absolute_placeholder')},domProps:{\"value\":(_vm.couponsState.createCoupon.value)},on:{\"input\":function($event){if($event.target.composing)return;_vm.$set(_vm.couponsState.createCoupon, \"value\", $event.target.value)}}})]):_vm._e(),(_vm.couponsState.createCoupon.discountType === 1)?_c('div',{staticClass:\"input-group\"},[_c('div',{staticClass:\"input-group-prepend\"},[_c('div',{staticClass:\"input-group-text primary\"},[_vm._v(\"%\")])]),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.couponsState.createCoupon.value),expression:\"couponsState.createCoupon.value\"},{name:\"validate\",rawName:\"v-validate\",value:('min_value:0|max_value:100'),expression:\"'min_value:0|max_value:100'\"}],staticClass:\"form-control\",class:{ 'is-invalid': _vm.errors.has('perValue')},attrs:{\"type\":\"number\",\"min\":0,\"max\":100,\"placeholder\":_vm.translations.get('coupons_modal_value_percentage_placeholder'),\"name\":\"perValue\",\"data-vv-as\":_vm.translations.get('coupons_modal_discount_value')},domProps:{\"value\":(_vm.couponsState.createCoupon.value)},on:{\"input\":function($event){if($event.target.composing)return;_vm.$set(_vm.couponsState.createCoupon, \"value\", $event.target.value)}}}),(_vm.errors.has('perValue'))?_c('span',{staticClass:\"error col-12\"},[_vm._v(_vm._s(_vm.errors.first('perValue')))]):_vm._e()]):_vm._e()]:[(_vm.couponsState.updateCoupon.discountType === 0)?_c('div',{staticClass:\"input-group\"},[_c('div',{staticClass:\"input-group-prepend\"},[_c('div',{staticClass:\"input-group-text primary\"},[_vm._v(\"$\")])]),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.couponsState.updateCoupon.value),expression:\"couponsState.updateCoupon.value\"}],staticClass:\"form-control\",attrs:{\"min\":0,\"type\":\"number\",\"placeholder\":_vm.translations.get('coupons_modal_value_absolute_placeholder')},domProps:{\"value\":(_vm.couponsState.updateCoupon.value)},on:{\"input\":function($event){if($event.target.composing)return;_vm.$set(_vm.couponsState.updateCoupon, \"value\", $event.target.value)}}})]):_vm._e(),(_vm.couponsState.updateCoupon.discountType === 1)?_c('div',{staticClass:\"input-group\"},[_c('div',{staticClass:\"input-group-prepend\"},[_c('div',{staticClass:\"input-group-text primary\"},[_vm._v(\"%\")])]),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.couponsState.updateCoupon.value),expression:\"couponsState.updateCoupon.value\"},{name:\"validate\",rawName:\"v-validate\",value:('min_value:0|max_value:100'),expression:\"'min_value:0|max_value:100'\"}],staticClass:\"form-control\",class:{ 'is-invalid': _vm.errors.has('perValue')},attrs:{\"type\":\"number\",\"min\":0,\"max\":100,\"placeholder\":_vm.translations.get('coupons_modal_value_percentage_placeholder'),\"name\":\"perValue\",\"data-vv-as\":_vm.translations.get('coupons_modal_discount_value')},domProps:{\"value\":(_vm.couponsState.updateCoupon.value)},on:{\"input\":function($event){if($event.target.composing)return;_vm.$set(_vm.couponsState.updateCoupon, \"value\", $event.target.value)}}}),(_vm.errors.has('perValue'))?_c('span',{staticClass:\"error col-12\"},[_vm._v(_vm._s(_vm.errors.first('perValue')))]):_vm._e()]):_vm._e()]],2)]),_c('div',{staticClass:\"form-row\"},[_c('div',{staticClass:\"col-md-6\"},[_c('div',{staticClass:\"form-group\"},[_c('label',[_vm._v(_vm._s(_vm.translations.get('coupons_modal_usage_limit')))]),(!_vm.editMode)?_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.couponsState.createCoupon.usageLimit),expression:\"couponsState.createCoupon.usageLimit\"},{name:\"validate\",rawName:\"v-validate\",value:('required|min_value:0'),expression:\"'required|min_value:0'\"}],staticClass:\"form-control\",class:{ 'is-invalid': _vm.errors.has('couponsNum')},attrs:{\"type\":\"number\",\"placeholder\":_vm.translations.get('coupons_modal_usage_limit_placeholder'),\"min\":0,\"name\":\"couponsNum\",\"data-vv-as\":_vm.translations.get('coupons_modal_usage_limit')},domProps:{\"value\":(_vm.couponsState.createCoupon.usageLimit)},on:{\"input\":function($event){if($event.target.composing)return;_vm.$set(_vm.couponsState.createCoupon, \"usageLimit\", $event.target.value)}}}):_vm._e(),(_vm.editMode)?_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.couponsState.updateCoupon.usageLimit),expression:\"couponsState.updateCoupon.usageLimit\"},{name:\"validate\",rawName:\"v-validate\",value:('required|min_value:0'),expression:\"'required|min_value:0'\"}],staticClass:\"form-control\",class:{ 'is-invalid': _vm.errors.has('couponsNum')},attrs:{\"type\":\"number\",\"placeholder\":_vm.translations.get('coupons_modal_usage_limit_placeholder'),\"min\":0,\"name\":\"couponsNum\",\"data-vv-as\":_vm.translations.get('coupons_modal_usage_limit')},domProps:{\"value\":(_vm.couponsState.updateCoupon.usageLimit)},on:{\"input\":function($event){if($event.target.composing)return;_vm.$set(_vm.couponsState.updateCoupon, \"usageLimit\", $event.target.value)}}}):_vm._e(),(_vm.errors.has('couponsNum'))?_c('span',{staticClass:\"error col-12\"},[_vm._v(_vm._s(_vm.errors.first('couponsNum')))]):_vm._e()])]),_c('div',{staticClass:\"form-group col-md-6\"},[_c('label',[_vm._v(_vm._s(_vm.translations.get('coupons_modal_coupon_type')))]),(!_vm.editMode)?_c('div',[_c('div',{staticClass:\"radio radio-primary\",staticStyle:{\"display\":\"inline-block\"}},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.couponsState.createCoupon.couponType),expression:\"couponsState.createCoupon.couponType\"}],attrs:{\"id\":\"couponTypeIndividual\",\"type\":\"radio\"},domProps:{\"value\":0,\"checked\":_vm._q(_vm.couponsState.createCoupon.couponType,0)},on:{\"change\":function($event){return _vm.$set(_vm.couponsState.createCoupon, \"couponType\", 0)}}}),_c('label',{attrs:{\"for\":\"couponTypeIndividual\"}},[_vm._v(_vm._s(this.translations.get(\"coupons_coupontype_individual\")))])]),_c('div',{staticClass:\"radio radio-primary\",staticStyle:{\"display\":\"inline-block\"}},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.couponsState.createCoupon.couponType),expression:\"couponsState.createCoupon.couponType\"}],attrs:{\"id\":\"couponTypePartner\",\"type\":\"radio\"},domProps:{\"value\":1,\"checked\":_vm._q(_vm.couponsState.createCoupon.couponType,1)},on:{\"change\":function($event){return _vm.$set(_vm.couponsState.createCoupon, \"couponType\", 1)}}}),_c('label',{attrs:{\"for\":\"couponTypePartner\"}},[_vm._v(_vm._s(this.translations.get(\"coupons_coupontype_partner\")))])])]):_c('div',[_c('div',{staticClass:\"radio radio-primary\",staticStyle:{\"display\":\"inline-block\"}},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.couponsState.updateCoupon.couponType),expression:\"couponsState.updateCoupon.couponType\"}],attrs:{\"id\":\"couponTypeIndividual\",\"type\":\"radio\"},domProps:{\"value\":0,\"checked\":_vm._q(_vm.couponsState.updateCoupon.couponType,0)},on:{\"change\":function($event){return _vm.$set(_vm.couponsState.updateCoupon, \"couponType\", 0)}}}),_c('label',{attrs:{\"for\":\"couponTypeIndividual\"}},[_vm._v(_vm._s(this.translations.get(\"coupons_coupontype_individual\")))])]),_c('div',{staticClass:\"radio radio-primary\",staticStyle:{\"display\":\"inline-block\"}},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.couponsState.updateCoupon.couponType),expression:\"couponsState.updateCoupon.couponType\"}],attrs:{\"id\":\"couponTypePartner\",\"type\":\"radio\"},domProps:{\"value\":1,\"checked\":_vm._q(_vm.couponsState.updateCoupon.couponType,1)},on:{\"change\":function($event){return _vm.$set(_vm.couponsState.updateCoupon, \"couponType\", 1)}}}),_c('label',{attrs:{\"for\":\"couponTypePartner\"}},[_vm._v(_vm._s(this.translations.get(\"coupons_coupontype_partner\")))])])])])]),(!_vm.editMode && _vm.couponsState.createCoupon.couponType === 1)?_c('div',{staticClass:\"form-row\"},[_c('div',{staticClass:\"form-group col-md-12\"},[_c('label',{attrs:{\"for\":\"partnersDropdown\"}},[_vm._v(_vm._s(this.translations.get(\"coupons_partners_dropdown_title\")))]),_c('v-select',{attrs:{\"label\":\"name\",\"options\":_vm.couponsState.partners},model:{value:(_vm.couponsState.partner),callback:function ($$v) {_vm.$set(_vm.couponsState, \"partner\", $$v)},expression:\"couponsState.partner\"}},[_c('span',{attrs:{\"slot\":\"no-options\"},slot:\"no-options\"},[_vm._v(_vm._s(this.translations.get(\"no_options\")))])])],1)]):_vm._e(),(_vm.editMode && _vm.couponsState.updateCoupon.couponType === 1)?_c('div',{staticClass:\"form-row\"},[_c('div',{staticClass:\"form-group col-md-12\"},[_c('label',{attrs:{\"for\":\"partnersDropdown\"}},[_vm._v(_vm._s(this.translations.get(\"coupons_partners_dropdown_title\")))]),_c('v-select',{attrs:{\"label\":\"name\",\"options\":_vm.couponsState.partners},model:{value:(_vm.couponsState.partner),callback:function ($$v) {_vm.$set(_vm.couponsState, \"partner\", $$v)},expression:\"couponsState.partner\"}},[_c('span',{attrs:{\"slot\":\"no-options\"},slot:\"no-options\"},[_vm._v(_vm._s(this.translations.get(\"no_options\")))])])],1)]):_vm._e(),(_vm.editMode)?_c('div',{staticClass:\"form-row\"},[_c('div',{staticClass:\"form-group col-md-6\"},[_c('label',[_vm._v(_vm._s(_vm.translations.get('enabled')))]),_c('div',[_c('vToggleSwitch',{on:{\"toggled\":function($event){_vm.couponsState.updateCoupon.isActive = !_vm.couponsState.updateCoupon.isActive}},model:{value:(_vm.couponsState.updateCoupon.isActive),callback:function ($$v) {_vm.$set(_vm.couponsState.updateCoupon, \"isActive\", $$v)},expression:\"couponsState.updateCoupon.isActive\"}})],1)])]):_vm._e(),_c('div',{staticClass:\"form-row\"},[(!_vm.editMode)?_c('button',{staticClass:\"btn btn-primary btn-cons m-t-10\",attrs:{\"type\":\"submit\"}},[_vm._v(_vm._s(this.translations.get(\"submit\")))]):_vm._e(),(_vm.editMode)?_c('button',{staticClass:\"btn btn-primary btn-cons m-t-10\",attrs:{\"type\":\"submit\"}},[_vm._v(_vm._s(this.translations.get(\"save\")))]):_vm._e(),_c('button',{staticClass:\"btn btn-cons m-t-10\",attrs:{\"type\":\"reset\"},on:{\"click\":_vm.resetState}},[_vm._v(_vm._s(this.translations.get(\"cancel\")))])])])]),_c('vModal',{attrs:{\"show\":_vm.showRemovePrompt,\"modalTitle\":_vm.removePromptTitle},on:{\"cancelModal\":_vm.resetState}},[_c('form',{staticClass:\"p-t-15\",attrs:{\"role\":\"form\"},on:{\"submit\":function($event){$event.preventDefault();return _vm.confirmDelete.apply(null, arguments)}}},[_c('div',{staticClass:\"form-row\"},[_c('div',{staticClass:\"form-group col-md-6\"},[_c('button',{staticClass:\"btn btn-primary btn-cons m-t-10\",attrs:{\"type\":\"submit\"}},[_vm._v(_vm._s(this.translations.get(\"yes\")))]),_c('button',{staticClass:\"btn btn-cons m-t-10\",attrs:{\"type\":\"reset\"},on:{\"click\":_vm.resetState}},[_vm._v(_vm._s(this.translations.get(\"cancel\")))])])])])])],1)])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import Partner from '../Partner/Partner';\r\n\r\nexport default interface Coupon {\r\n partner: Partner;\r\n isActive: boolean;\r\n partnerId: any;\r\n usageLimit: number;\r\n expiryDate: any;\r\n value: number;\r\n discountType: DiscountType;\r\n couponType: CouponType;\r\n name: string;\r\n code: string;\r\n createdOn: any;\r\n id: number;\r\n numberOfUsages: number\r\n}\r\n\r\nexport enum DiscountType {\r\n Absolute, Percentage\r\n}\r\n\r\nexport enum CouponStatus {\r\n Active, Inactive\r\n}\r\n\r\nexport enum CouponType {\r\n Individual, Partner\r\n}","\r\nimport { Component, Vue } from \"vue-property-decorator\";\r\n\r\nimport ListRequest, { Filter, Ordering, OrderType } from \"@/models/ListRequest\";\r\nimport Coupon, {\r\n DiscountType,\r\n CouponType,\r\n} from \"@/models/Coupon/Coupon\";\r\nimport CreateCoupon from \"@/models/Coupon/CreateCoupon\";\r\nimport UpdateCoupon from \"@/models/Coupon/UpdateCoupon\";\r\nimport { mapState } from \"vuex\";\r\nimport CouponsRepository from \"@/utils/API/CouponsRepository\";\r\nimport { TRANSLATIONS_FETCH, PARTNERS_REDIRECT } from \"@/store/ActionTypes\";\r\nimport Partner from \"@/models/Partner/Partner\";\r\nimport PartnersRepository from \"@/utils/API/PartnersRepository\";\r\nimport { dateDisplayFormat, dateTimeDisplayFormat } from \"@/utils/Defaults\";\r\n\r\nimport vTable from \"@/components/vTable.vue\";\r\nimport vModal from \"@/components/vModal.vue\";\r\nimport vToggleSwitch from \"@/components/vToggleSwitch.vue\";\r\n\r\ninterface CouponsState {\r\n /**\r\n * Number of packages displayed on the grid\r\n */\r\n count: number;\r\n /**\r\n * Total entries in the grid\r\n */\r\n totalCount: number;\r\n /**\r\n * List of coupons in the system determined by page and page size\r\n */\r\n coupons: Coupon[];\r\n /**\r\n * Current page on the grid\r\n */\r\n page: number;\r\n /**\r\n * Maximum visible rows in the grid\r\n */\r\n pageSize: number;\r\n /**\r\n * List of filters\r\n */\r\n filters: Filter[];\r\n /**\r\n * Ordering\r\n */\r\n orders: Ordering;\r\n \r\n /**\r\n * Model for coupon creation\r\n */\r\n createCoupon: CreateCoupon;\r\n /**\r\n * Model for coupon edit\r\n */\r\n updateCoupon: UpdateCoupon;\r\n /**\r\n * List of coupon ids to be removed\r\n */\r\n removeList: number[];\r\n\r\n /**\r\n * List of partners for creating partner coupon\r\n */\r\n partners: Partner[];\r\n\r\n /**\r\n * Chosen partner for creating partner coupon\r\n */\r\n partner: Partner;\r\n\r\n /**\r\n * Is the grid loading?\r\n */\r\n tableLoading: boolean;\r\n}\r\n\r\n@Component({\r\n components: {\r\n vTable,\r\n vModal,\r\n vToggleSwitch,\r\n },\r\n computed: {\r\n ...mapState({\r\n localizationState: (state: any) => state.LocalizationModule\r\n })\r\n }\r\n})\r\nclass Coupons extends Vue {\r\n localizationState: any;\r\n\r\n couponsState: CouponsState = {\r\n count: 0,\r\n totalCount: 0,\r\n coupons: [],\r\n page: 1,\r\n pageSize: 25,\r\n filters: [],\r\n orders: { field: \"\", orderType: OrderType.Asc },\r\n createCoupon: {\r\n partnerId: 0,\r\n name: \"\",\r\n usageLimit: 0,\r\n expiryDate: null,\r\n value: 0,\r\n discountType: DiscountType.Absolute,\r\n couponType: CouponType.Individual\r\n },\r\n updateCoupon: {\r\n id: 0,\r\n name: \"\",\r\n discountType: DiscountType.Absolute,\r\n couponType: CouponType.Individual,\r\n isActive: false,\r\n partnerId: 0,\r\n usageLimit: 0,\r\n expiryDate: null,\r\n value: 0\r\n },\r\n removeList: [],\r\n\r\n partners: [],\r\n partner: {\r\n id: 0,\r\n name: \"\",\r\n address: \"\",\r\n phone: \"\",\r\n email: \"\",\r\n couponsCount: 0\r\n },\r\n\r\n tableLoading: false\r\n };\r\n\r\n // Properties for vTable grid\r\n selectErase = true;\r\n searchable = true;\r\n editableTable = true;\r\n\r\n // Modal properties\r\n showModal = false;\r\n modalTitle = \"\";\r\n showRemovePrompt = false;\r\n removePromptTitle = \"\";\r\n\r\n editMode = false;\r\n\r\n // Datepicker option object to disable dates before today\r\n disabledDates = {\r\n to: new Date()\r\n };\r\n\r\n /**\r\n * Method used by the grid after catching the 'changePage'\r\n * event from vTable\r\n *\r\n * @param {any} args\r\n */\r\n changePage(args: any) {\r\n const orderings: Ordering[] = [];\r\n orderings.push({ ...args[3] });\r\n\r\n this.requestCoupons(\r\n new ListRequest({\r\n page: args[0],\r\n pageSize: this.couponsState.pageSize,\r\n filters: args[2],\r\n orders: orderings\r\n })\r\n );\r\n this.couponsState.page = args[0];\r\n this.couponsState.orders = { ...args[3] };\r\n this.couponsState.filters = [...args[2]];\r\n }\r\n\r\n /**\r\n * Method used by the grid after catching the 'search'\r\n * event from vTable\r\n *\r\n * @param {Filter[]} filters\r\n * @param {Ordering} ordering\r\n */\r\n search(filters: Filter[], ordering: Ordering) {\r\n const orderings: Ordering[] = [];\r\n orderings.push({ ...ordering });\r\n\r\n this.requestCoupons(\r\n new ListRequest({\r\n page: 1,\r\n pageSize: this.couponsState.pageSize,\r\n filters: filters,\r\n orders: orderings\r\n })\r\n );\r\n\r\n this.couponsState.page = 1;\r\n this.couponsState.orders = { ...ordering };\r\n this.couponsState.filters = [...filters];\r\n }\r\n\r\n /**\r\n * Method used by the grid after catching the 'order'\r\n * event from vTable\r\n *\r\n * @param {Filter[]} filters\r\n * @param {Ordering} ordering\r\n */\r\n order(filters: Filter[], ordering: Ordering) {\r\n const orderings: Ordering[] = [];\r\n orderings.push({ ...ordering });\r\n\r\n this.requestCoupons(\r\n new ListRequest({\r\n page: this.couponsState.page,\r\n pageSize: this.couponsState.pageSize,\r\n filters: filters,\r\n orders: orderings\r\n })\r\n );\r\n\r\n this.couponsState.orders = { ...ordering };\r\n this.couponsState.filters = [...filters];\r\n }\r\n\r\n /**\r\n * Method that resets most variables and closes all modals.\r\n */\r\n resetState() {\r\n this.showModal = false;\r\n this.editMode = false;\r\n this.modalTitle = this.translations.get(\"coupons_modal_title_add\");\r\n\r\n this.showRemovePrompt = false;\r\n this.removePromptTitle = \"\";\r\n\r\n this.couponsState.updateCoupon = {\r\n id: 0,\r\n name: \"\",\r\n discountType: DiscountType.Absolute,\r\n couponType: CouponType.Individual,\r\n isActive: false,\r\n partnerId: 0,\r\n usageLimit: 0,\r\n expiryDate: null,\r\n value: 0\r\n };\r\n\r\n this.couponsState.createCoupon = {\r\n partnerId: 0,\r\n name: \"\",\r\n usageLimit: 0,\r\n expiryDate: null,\r\n value: 0,\r\n discountType: DiscountType.Absolute,\r\n couponType: CouponType.Individual\r\n };\r\n\r\n this.couponsState.partner = {\r\n id: 0,\r\n name: \"\",\r\n address: \"\",\r\n phone: \"\",\r\n email: \"\",\r\n couponsCount: 0\r\n };\r\n }\r\n\r\n /**\r\n * Method for edit / add package modal toggling\r\n */\r\n toggleModal() {\r\n this.showModal = !this.showModal;\r\n }\r\n\r\n /**\r\n * Getter for grid headers. Done this way because headers are translatable and async\r\n */\r\n get tableHeaders() {\r\n return [\r\n {\r\n name: this.translations.get(\"coupons_table_header_name\"),\r\n key: \"Name\",\r\n searchable: true,\r\n searchString: \"\",\r\n sortable: true\r\n },\r\n {\r\n name: this.translations.get(\"coupons_table_header_code\"),\r\n key: \"Code\",\r\n searchable: true,\r\n searchString: \"\",\r\n sortable: true\r\n },\r\n {\r\n name: this.translations.get(\"coupons_table_header_partner\"),\r\n key: \"Partner\",\r\n searchable: true,\r\n searchString: \"\",\r\n sortable: true\r\n },\r\n {\r\n name: this.translations.get(\"coupons_table_header_created_date\"),\r\n key: \"CreatedOn\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: true\r\n },\r\n {\r\n name: this.translations.get(\"coupons_table_header_status\"),\r\n key: \"IsActive\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: true\r\n },\r\n {\r\n name: this.translations.get(\"coupons_table_header_type\"),\r\n key: \"CouponType\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: true\r\n },\r\n {\r\n name: this.translations.get(\"coupons_table_header_expiry_date\"),\r\n key: \"ExpiryDate\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: true\r\n },\r\n {\r\n name: this.translations.get(\"coupons_table_header_discount_type\"),\r\n key: \"DiscountType\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: true\r\n },\r\n {\r\n name: this.translations.get(\"coupons_table_header_value\"),\r\n key: \"Value\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: true\r\n },\r\n {\r\n name: this.translations.get(\"coupons_table_header_limit\"),\r\n key: \"UsageLimit\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: true\r\n },\r\n {\r\n name: this.translations.get(\"coupons_table_used_coupons\"),\r\n key: \"NumberOfUsages\",\r\n searchable: false,\r\n searchString: \"\",\r\n sortable: true\r\n }\r\n ];\r\n }\r\n\r\n /**\r\n * Setting modal title for Adding new coupon and toggling the modal\r\n */\r\n prepareAddMode() {\r\n this.modalTitle = this.translations.get(\"coupons_modal_title_add\");\r\n\r\n this.toggleModal();\r\n }\r\n\r\n /**\r\n * Populating form and toggling the modal for editing coupon.\r\n * Sets the edit mode to true and toggling the modal\r\n *\r\n * @param {number} id Id of the package\r\n */\r\n prepareEditMode(id: number) {\r\n this.editMode = true;\r\n this.modalTitle = this.translations.get(\"coupons_modal_title_edit\");\r\n\r\n let found = this.couponsState.coupons.find(c => c.id === id);\r\n\r\n if (typeof found !== \"undefined\") {\r\n let temp: UpdateCoupon = {\r\n id: found.id,\r\n name: found.name,\r\n discountType: found.discountType,\r\n couponType: found.couponType,\r\n isActive: found.isActive,\r\n partnerId: found.partnerId,\r\n usageLimit: found.usageLimit,\r\n expiryDate: found.expiryDate,\r\n value: found.value\r\n };\r\n\r\n this.couponsState.updateCoupon = { ...temp };\r\n this.couponsState.partner = { ...found.partner };\r\n\r\n this.toggleModal();\r\n }\r\n }\r\n\r\n /**\r\n * Method for displaying prompt message for selected coupons to be deleted\r\n *\r\n * @param {number[]} ids Package ids\r\n */\r\n prepareDeletePrompt(ids: number[]) {\r\n this.couponsState.removeList = ids;\r\n this.removePromptTitle = this.translations.get(\r\n \"coupons_delete_prompt_message\",\r\n ids.length\r\n );\r\n this.showRemovePrompt = true;\r\n }\r\n\r\n /**\r\n * Method for deleting selected coupons and refreshing the grid.\r\n */\r\n confirmDelete() {\r\n // @ts-ignore\r\n this.$snotify.async(\r\n this.translations.get(\r\n \"coupons_toastr_deleting\",\r\n this.couponsState.removeList.length\r\n ),\r\n () =>\r\n new Promise((resolve, reject) => {\r\n CouponsRepository.deleteCoupons({\r\n coupons: this.couponsState.removeList\r\n })\r\n .then(response => {\r\n resolve({\r\n body: this.translations.get(\r\n \"coupons_toastr_deleted\",\r\n this.couponsState.removeList.length\r\n )\r\n });\r\n\r\n this.couponsState.page = 1;\r\n\r\n this.requestCoupons(\r\n new ListRequest({\r\n page: this.couponsState.page,\r\n pageSize: this.couponsState.pageSize,\r\n filters: this.couponsState.filters,\r\n orders: [this.couponsState.orders]\r\n })\r\n );\r\n })\r\n .catch(error => {\r\n let message = \"\";\r\n if (error.response) {\r\n message =\r\n error.response.data.errorMessages[0].userVisibleMessage;\r\n } else {\r\n message = this.translations.get(\"network_error\");\r\n }\r\n reject({ body: message });\r\n });\r\n }),\r\n {\r\n timeout: 3000,\r\n closeOnClick: true\r\n }\r\n );\r\n this.resetState();\r\n }\r\n\r\n /**\r\n * Router method for submitting to API\r\n */\r\n submit() {\r\n this.$validator.validateAll().then(result => {\r\n if (result) {\r\n if (this.editMode) {\r\n this.submitUpdate();\r\n } else {\r\n this.submitNew();\r\n }\r\n return;\r\n }\r\n this.$snotify.error(this.translations.get(\"validation-error-message\"));\r\n });\r\n }\r\n\r\n /**\r\n * Method for submitting edit to api and refreshing the grid\r\n */\r\n submitUpdate() {\r\n let coupon = this.couponsState.coupons.find(\r\n coupon => coupon.id === this.couponsState.updateCoupon.id\r\n );\r\n\r\n if (\r\n typeof coupon !== \"undefined\" &&\r\n (coupon.name !== this.couponsState.updateCoupon.name ||\r\n coupon.discountType !== this.couponsState.updateCoupon.discountType ||\r\n coupon.couponType !== this.couponsState.updateCoupon.couponType ||\r\n coupon.isActive !== this.couponsState.updateCoupon.isActive ||\r\n coupon.partnerId !== this.couponsState.partner.id ||\r\n coupon.usageLimit !== this.couponsState.updateCoupon.usageLimit ||\r\n coupon.expiryDate !== this.couponsState.updateCoupon.expiryDate ||\r\n coupon.value !== this.couponsState.updateCoupon.value)\r\n ) {\r\n if (this.couponsState.updateCoupon.couponType === CouponType.Partner) {\r\n this.couponsState.updateCoupon.expiryDate = null;\r\n this.couponsState.updateCoupon.partnerId = this.couponsState.partner.id;\r\n } else {\r\n this.couponsState.updateCoupon.partnerId = null;\r\n }\r\n // @ts-ignore\r\n this.$snotify.async(\r\n this.translations.get(\"coupons_toastr_updating\"),\r\n () =>\r\n new Promise((resolve, reject) => {\r\n CouponsRepository.updateCoupon(this.couponsState.updateCoupon)\r\n .then(response => {\r\n resolve({\r\n body: this.translations.get(\r\n \"coupons_toastr_updated\",\r\n this.couponsState.updateCoupon.name\r\n )\r\n });\r\n\r\n this.requestCoupons(\r\n new ListRequest({\r\n page: this.couponsState.page,\r\n pageSize: this.couponsState.pageSize,\r\n filters: this.couponsState.filters,\r\n orders: [this.couponsState.orders]\r\n })\r\n );\r\n\r\n this.resetState();\r\n })\r\n .catch(error => {\r\n let message = \"\";\r\n if (error.response) {\r\n message =\r\n error.response.data.errorMessages[0].userVisibleMessage;\r\n } else {\r\n message = this.translations.get(\"network_error\");\r\n }\r\n reject({ body: message });\r\n });\r\n }),\r\n {\r\n timeout: 3000,\r\n closeOnClick: true\r\n }\r\n );\r\n } else {\r\n this.$snotify.simple(this.translations.get(\"toastr_nochanges\"));\r\n this.resetState();\r\n }\r\n }\r\n\r\n /**\r\n * Method for submitting new coupon to api and refreshing the grid\r\n */\r\n submitNew() {\r\n if (this.couponsState.createCoupon.couponType === CouponType.Partner) {\r\n this.couponsState.createCoupon.expiryDate = null;\r\n this.couponsState.createCoupon.partnerId = this.couponsState.partner.id;\r\n } else {\r\n this.couponsState.createCoupon.partnerId = null;\r\n }\r\n\r\n // @ts-ignore\r\n this.$snotify.async(\r\n this.translations.get(\"coupons_toastr_adding\"),\r\n () =>\r\n new Promise((resolve, reject) => {\r\n CouponsRepository.createCoupon(this.couponsState.createCoupon)\r\n .then(response => {\r\n resolve({\r\n body: this.translations.get(\r\n \"coupons_toastr_added\",\r\n this.couponsState.createCoupon.name\r\n )\r\n });\r\n\r\n this.requestCoupons(\r\n new ListRequest({\r\n page: this.couponsState.page,\r\n pageSize: this.couponsState.pageSize,\r\n filters: this.couponsState.filters,\r\n orders: [this.couponsState.orders]\r\n })\r\n );\r\n\r\n this.resetState();\r\n })\r\n .catch(error => {\r\n let message = \"\";\r\n if (error.response) {\r\n message =\r\n error.response.data.errorMessages[0].userVisibleMessage;\r\n } else {\r\n message = this.translations.get(\"network_error\");\r\n }\r\n reject({ body: message });\r\n });\r\n }),\r\n {\r\n timeout: 3000,\r\n closeOnClick: true\r\n }\r\n );\r\n }\r\n\r\n /**\r\n * Getter method to transform the list of coupons to grid data (vTable)\r\n */\r\n get transformCoupons() {\r\n return this.couponsState.coupons.map((element: Coupon, index: number) => {\r\n return {\r\n e1: element.code,\r\n e2: element.partnerId ? element.partner.name : \"\",\r\n e3: element.createdOn\r\n ? this.$moment(element.createdOn).format(dateTimeDisplayFormat)\r\n : \"\",\r\n e4: element.isActive\r\n ? {\r\n component: \"div\",\r\n props: { class: \"label label-success text-center\" },\r\n html: this.translations.get(\"active\")\r\n }\r\n : {\r\n component: \"div\",\r\n props: { class: \"label label-danger text-center\" },\r\n html: this.translations.get(\"inactive\")\r\n },\r\n e5:\r\n element.couponType === CouponType.Individual\r\n ? this.translations.get(\"coupons_type_individual\")\r\n : this.translations.get(\"coupons_type_partner\"),\r\n e6: element.expiryDate\r\n ? this.$moment(element.expiryDate).format(dateDisplayFormat) // element.expiryDate // this.$moment(this.testDate).format('YYYY')\r\n : this.translations.get(\"unlimited\"),\r\n e7:\r\n element.discountType === DiscountType.Absolute\r\n ? this.translations.get(\"coupons_discounttype_absolute\")\r\n : this.translations.get(\"coupons_discounttype_percentage\"),\r\n e8: element.value,\r\n e9: element.usageLimit,\r\n e10: element.numberOfUsages,\r\n meta: {\r\n id: element.id,\r\n link: element.name\r\n }\r\n };\r\n });\r\n }\r\n\r\n /**\r\n * Method for fetching coupons based on list request\r\n * \r\n * @param {ListRequest} listRequest\r\n */\r\n requestCoupons(listRequest: ListRequest) {\r\n this.couponsState.tableLoading = true;\r\n CouponsRepository.fetchCoupons(listRequest)\r\n .then(response => {\r\n this.couponsState.count = response.data.count;\r\n this.couponsState.totalCount = response.data.totalCount;\r\n this.couponsState.coupons = response.data.result;\r\n\r\n this.couponsState.tableLoading = false;\r\n })\r\n .catch(error => {\r\n if (error.response)\r\n this.$snotify.error(\r\n error.response.errorMessages[0].userVisibleMessage\r\n );\r\n else this.$snotify.error(this.translations.get(\"network-error\"));\r\n this.couponsState.tableLoading = false;\r\n });\r\n }\r\n\r\n mounted() {\r\n let request: ListRequest = { ...this.$store.getters.getListRequest };\r\n this.requestCoupons(request);\r\n // Reset redirect info if redirected from Partners\r\n this.$store.dispatch(\r\n PARTNERS_REDIRECT,\r\n new ListRequest({ page: 1, pageSize: 25 })\r\n );\r\n\r\n PartnersRepository.fetchPartners(\r\n new ListRequest({ page: 1, pageSize: 999 })\r\n )\r\n .then(response => {\r\n this.couponsState.partners = response.data.result;\r\n })\r\n .catch(error => {\r\n if (error.response)\r\n this.$snotify.error(\r\n error.response.errorMessages[0].userVisibleMessage\r\n );\r\n else this.$snotify.error(this.translations.get(\"network-error\"));\r\n });\r\n }\r\n\r\n created() {\r\n this.$store.dispatch(TRANSLATIONS_FETCH, {\r\n category: \"pages\",\r\n collections: [\"coupons\", \"common\"]\r\n });\r\n\r\n document.title = 'Coupons | MenuSano';\r\n }\r\n\r\n get translations() {\r\n return this.localizationState.translations;\r\n }\r\n}\r\nexport default Coupons;\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Coupons.vue?vue&type=script&lang=ts\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Coupons.vue?vue&type=script&lang=ts\"","import { render, staticRenderFns } from \"./Coupons.vue?vue&type=template&id=f7b3cb1e&scoped=true\"\nimport script from \"./Coupons.vue?vue&type=script&lang=ts\"\nexport * from \"./Coupons.vue?vue&type=script&lang=ts\"\nimport style0 from \"./Coupons.vue?vue&type=style&index=0&id=f7b3cb1e&prod&scoped=true&lang=css\"\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 \"f7b3cb1e\",\n null\n \n)\n\nexport default component.exports","import Repository from './Repository';\r\nimport ListRequest from '@/models/ListRequest';\r\nimport NewPartner from '@/models/Partner/NewPartner';\r\nimport UpdatePartner from '@/models/Partner/UpdatePartner';\r\nimport DeletePartners from '@/models/Partner/DeletePartners';\r\n\r\nconst resource = '/partners';\r\n\r\nexport default {\r\n fetchPartners(listRequest: ListRequest) {\r\n return Repository.post(`${resource}/listpartners`, listRequest, {withCredentials: true});\r\n },\r\n newPartner(newPartner: NewPartner) {\r\n return Repository.post(`${resource}/createPartner`, newPartner, {withCredentials: true});\r\n },\r\n updatePartner(updatePartner: UpdatePartner) {\r\n return Repository.post(`${resource}/updatePartner`, updatePartner, {withCredentials: true});\r\n },\r\n deletePartner(deletePartners: DeletePartners) {\r\n return Repository.post(`${resource}/deletePartners`, deletePartners, {withCredentials: true});\r\n },\r\n};\r\n"],"sourceRoot":""}