{"version":3,"sources":["webpack:///./src/views/Users/DetailEdit.vue?fe5f","webpack:///./src/views/Users/DetailEdit.vue?12bd","webpack:///./src/views/Users/DetailEdit.vue","webpack:///./src/views/Users/DetailEdit.vue?b2d6","webpack:///./src/views/Users/DetailEdit.vue?d14c"],"names":["render","_vm","this","_h","$createElement","_c","_self","currentUser","subscriptionDetails","employeeDetails","staticClass","_v","currentStateIs","states","ERROR","hasErrors","_e","COMPLETE","enableAutomaticUpdateEmployeeDetails","attrs","path","staticStyle","name","INITIAL","LOADING","on","$event","preventDefault","updateEmployeeDetails","_l","field","key","ref","refInFor","inputChange","hasDirtyInput","staticRenderFns","UserDetailEdit","_mixins","_inherits","_super","_createSuper","_this","_classCallCheck","call","inputFields","firstName","value","$store","state","required","type","disabled","placeholder","errors","middleName","lastName","initials","postalCode","houseNumber","address","city","birthDate","gender","options","label","Gender","Male","Female","X","Unknown","emailAddress","phonePersonal","phoneBusiness","iban","hidden","ibanAccountHolder","addressCheckDebounce","_","debounce","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_yield$_this$addressA","data","wrap","_context","prev","next","addressApi","addressCompletionGetCompleteAddressForTheNetherlands","replace","sent","concat","street","stop","_x","_x2","apply","arguments","AddressCompletionApi","previouseHouseNumber","previousePostalcode","_createClass","get","_updateEmployeeDetails","_callee2","_this$currentUser$sub","api","fields","_context2","clearErrors","validateInput","abrupt","SubscriptionApi","subscriptionId","subscription","subscriptionUpdateDetails","t0","setErrors","response","$root","$emit","_this2","Object","entries","forEach","_ref2","_ref3","_slicedToArray","errorKey","errorValue","_ref4","_ref5","fieldKey","fieldValue","toLowerCase","values","isNumber","Number","_this3","valid","keys","input","Array","isArray","$refs","validate","hasError","length","mixins","State","__decorate","Component","components","Content","Toolbar","FormInput","FormButton","component"],"mappings":"kHAAA,W,gECAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OACrF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C,KAAKsG,sBAAwBtG,KAAK2C,YAAYa,WAAWX,QAC7D7C,KAAKqG,qBAAuBrG,KAAK2C,YAAYc,YAAYZ,MACzD7C,KAAKsG,oBAAsBtG,KAAK2C,YAAYa,WAAWX,MAEvD7C,KAAK2E,qBAAqBgE,OAAO3I,KAAK2C,YAAYc,YAAYZ,OAAQ7C,KAAK2C,YAAYa,WAAWX,UAErG,CAAAhB,IAAA,gBAAAgB,MAEO,WAAa,IAAA+F,EAAA,KACfC,GAAQ,EAYZ,OAVAjB,OAAOkB,KAAK9I,KAAK2C,aAAamF,SAAQ,SAACjG,GACrC,IAAIkH,EAEFA,EADEC,MAAMC,QAAQL,EAAKM,MAAMrH,IAClB+G,EAAKM,MAAMrH,GAAmB,GAE/B+G,EAAKM,MAAMrH,GAErBgH,EAASE,EAAoBI,YAAcN,KAGtCA,IACR,CAAAhH,IAAA,YAAA2E,IAED,WACE,IAAI4C,GAAW,EAIf,OAHAxB,OAAOa,OAAOzI,KAAK2C,aAAamF,SAAQ,SAACS,GACvCa,EAAWA,GAAYb,EAAWnF,OAAOiG,OAAS,KAE7CD,MACRjH,EAjSgC,CAASmH,eAAOC,SAA9BpH,EAAcqH,eAAA,CATlCC,eAAU,CACTC,WAAY,CACVC,eACAC,eACAC,iBACAC,sBAIiB3H,WCtHkY,I,wBCQnZ4H,EAAY,eACd,EACAjK,EACAoC,GACA,EACA,KACA,WACA,MAIa,aAAA6H,E","file":"js/chunk-aa47ffb0.a7c237c7.js","sourcesContent":["export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DetailEdit.vue?vue&type=style&index=0&id=fd5a9de2&prod&lang=scss&scoped=true&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (\n _vm.currentUser &&\n _vm.currentUser.subscriptionDetails &&\n _vm.currentUser.employeeDetails\n )?_c('div',{staticClass:\"view view--toolbar\"},[_c('Toolbar',[_c('h2',{},[_vm._v(\"Mijn gegevens aanpassen\")])]),_c('Content',[(_vm.currentStateIs(this.states.ERROR) && !_vm.hasErrors)?_c('AlertError',[_vm._v(\" Oops, er is een onbekende fout opgetreden bij het wijzigen van de gegevens. \")]):(_vm.currentStateIs(this.states.ERROR))?_c('AlertError',[_vm._v(\" Oops, je bent een of meerdere velden vergeten in te vullen, of ze zijn niet goed ingevuld. Pas de velden hieronder alsjeblieft aan en probeer het nog eens. \")]):_vm._e(),(_vm.currentStateIs(this.states.COMPLETE) && _vm.currentUser.subscriptionDetails.enableAutomaticUpdateEmployeeDetails)?_c('AlertSuccess',[_vm._v(\" Bedankt voor het doorgeven van je wijziging, de aanpassing is verwerkt. \"),_c('br'),_c('br'),_c('router-link',{staticClass:\"link\",attrs:{\"to\":{ path: '/' }}},[_c('span',[_vm._v(\"Klik hier\")])]),_vm._v(\" om terug te keren naar het overzicht. \")],1):(_vm.currentStateIs(this.states.COMPLETE))?_c('AlertSuccess',[_vm._v(\" Bedankt voor het doorgeven van je wijziging. We gaan ermee aan de slag! De aanpassingen worden binnen één werkdag verwerkt. \"),_c('br'),_c('br'),_c('router-link',{staticClass:\"link\",attrs:{\"to\":{ path: '/' }}},[_c('span',[_vm._v(\"Klik hier\")])]),_vm._v(\" om terug te keren naar het overzicht. \")],1):_vm._e(),(!_vm.currentStateIs(this.states.COMPLETE))?_c('p',{staticClass:\"paragraph\",staticStyle:{\"margin\":\"0 0 20px 5px\"}},[_vm._v(\" Neem contact op met de \"),_c('router-link',{staticClass:\"link\",attrs:{\"to\":{ name: 'help' }}},[_c('span',[_vm._v(\"klantenservice\")])]),_vm._v(\" als je gegevens van geblokkeerde velden wilt wijzigen. \")],1):_vm._e(),(\n _vm.currentStateIs(this.states.INITIAL) ||\n _vm.currentStateIs(this.states.LOADING) ||\n _vm.currentStateIs(this.states.ERROR)\n )?_c('form',{attrs:{\"novalidate\":\"\"},on:{\"submit\":function($event){$event.preventDefault();return _vm.updateEmployeeDetails()}}},[_vm._l((_vm.inputFields),function(field){return _c('FormInput',{key:(\"field-\" + (field.name)),ref:field.name,refInFor:true,attrs:{\"inputField\":field},on:{\"change\":_vm.inputChange}})}),_c('FormButton',{attrs:{\"caption\":'Gegevens bijwerken',\"loading\":_vm.currentStateIs(this.states.LOADING),\"disabled\":!_vm.hasDirtyInput}})],2):_vm._e()],1)],1):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport Component, { mixins } from 'vue-class-component'\r\nimport { State } from '@/mixins/state'\r\n\r\nimport {\r\n SubscriptionApi,\r\n UpdateEmployeeDetailsCommand,\r\n Gender,\r\n AddressCompletionApi\r\n} from '@/api'\r\n\r\nimport { User } from '@/types'\r\n\r\nimport Content from '@/components/Content.vue'\r\nimport Toolbar from '@/components/Layout/Toolbar.vue'\r\nimport FormInput, { InputField } from '@/components/Form/Input.vue'\r\nimport FormButton from '@/components/Form/Button.vue'\r\nimport _, { isNumber } from 'lodash'\r\n\r\ninterface InputFields {\r\n firstName: InputField;\r\n middleName: InputField;\r\n lastName: InputField;\r\n initials: InputField;\r\n postalCode: InputField;\r\n houseNumber: InputField;\r\n address: InputField;\r\n city: InputField;\r\n birthDate: InputField;\r\n gender: InputField;\r\n emailAddress: InputField;\r\n phonePersonal: InputField;\r\n phoneBusiness: InputField;\r\n iban: InputField;\r\n ibanAccountHolder: InputField;\r\n}\r\n\r\n@Component({\r\n components: {\r\n Content,\r\n Toolbar,\r\n FormInput,\r\n FormButton\r\n }\r\n})\r\n\r\nexport default class UserDetailEdit extends mixins(State) {\r\n inputFields: InputFields = {\r\n firstName: {\r\n name: 'firstName',\r\n value: this.$store.state.currentUser.employeeDetails.firstName,\r\n required: false,\r\n type: 'text',\r\n disabled: true,\r\n placeholder: 'Voornaam',\r\n errors: []\r\n },\r\n\r\n middleName: {\r\n name: 'middleName',\r\n value: this.$store.state.currentUser.employeeDetails.middleName,\r\n required: false,\r\n type: 'text',\r\n disabled: true,\r\n placeholder: 'Tussenvoegsel',\r\n errors: []\r\n },\r\n\r\n lastName: {\r\n name: 'lastName',\r\n value: this.$store.state.currentUser.employeeDetails.lastName,\r\n required: false,\r\n type: 'text',\r\n disabled: true,\r\n placeholder: 'Achternaam',\r\n errors: []\r\n },\r\n\r\n initials: {\r\n name: 'initials',\r\n value: this.$store.state.currentUser.employeeDetails.initials,\r\n required: false,\r\n type: 'text',\r\n disabled: true,\r\n placeholder: 'Initialen',\r\n errors: []\r\n },\r\n\r\n postalCode: {\r\n name: 'postalCode',\r\n value: this.$store.state.currentUser.employeeDetails.postalCode,\r\n required: true,\r\n type: 'text',\r\n placeholder: 'Postcode',\r\n errors: []\r\n },\r\n\r\n houseNumber: {\r\n name: 'houseNumber',\r\n value: '',\r\n required: false,\r\n type: 'number',\r\n placeholder: 'Huisnummer',\r\n errors: []\r\n },\r\n\r\n address: {\r\n name: 'address',\r\n value: this.$store.state.currentUser.employeeDetails.address,\r\n required: false,\r\n type: 'text',\r\n disabled: true,\r\n placeholder: 'Straatnaam',\r\n errors: []\r\n },\r\n\r\n city: {\r\n name: 'city',\r\n value: this.$store.state.currentUser.employeeDetails.city,\r\n required: false,\r\n type: 'text',\r\n disabled: true,\r\n placeholder: 'Woonplaats',\r\n errors: []\r\n },\r\n\r\n birthDate: {\r\n name: 'birthDate',\r\n value: this.$store.state.currentUser.employeeDetails.birthDate,\r\n required: false,\r\n type: 'date',\r\n disabled: true,\r\n placeholder: 'Geboortedatum',\r\n errors: []\r\n },\r\n\r\n gender: {\r\n name: 'gender',\r\n value: this.$store.state.currentUser.employeeDetails.gender,\r\n required: false,\r\n type: 'radio',\r\n disabled: true,\r\n options: [\r\n {\r\n label: 'Man',\r\n value: Gender.Male\r\n },\r\n {\r\n label: 'Vrouw',\r\n value: Gender.Female\r\n },\r\n {\r\n label: 'X',\r\n value: Gender.X\r\n },\r\n {\r\n label: 'Zeg ik liever niet',\r\n value: Gender.Unknown\r\n }\r\n ],\r\n placeholder: 'Geslacht',\r\n errors: []\r\n },\r\n\r\n emailAddress: {\r\n name: 'emailAddress',\r\n value: this.$store.state.currentUser.employeeDetails.emailAddress,\r\n required: false,\r\n type: 'email',\r\n disabled: true,\r\n placeholder: 'E-mailadres',\r\n errors: []\r\n },\r\n\r\n phonePersonal: {\r\n name: 'phonePersonal',\r\n value: this.$store.state.currentUser.employeeDetails.phonePersonal,\r\n required: true,\r\n type: 'tel',\r\n placeholder: 'Telefoon (persoonlijk)',\r\n errors: []\r\n },\r\n\r\n phoneBusiness: {\r\n name: 'phoneBusiness',\r\n value: this.$store.state.currentUser.employeeDetails.phoneBusiness,\r\n required: false,\r\n type: 'tel',\r\n placeholder: 'Telefoon (zakelijk)',\r\n errors: []\r\n },\r\n\r\n iban: {\r\n name: 'iban',\r\n value: this.$store.state.currentUser.employeeDetails.iban,\r\n required: this.$store.state.currentUser.employeeDetails.iban,\r\n type: 'text',\r\n placeholder: 'IBAN-nummer',\r\n errors: [],\r\n hidden: !this.$store.state.currentUser.employeeDetails.iban\r\n },\r\n\r\n ibanAccountHolder: {\r\n name: 'ibanAccountHolder',\r\n value: this.$store.state.currentUser.employeeDetails.ibanAccountHolder,\r\n required: this.$store.state.currentUser.employeeDetails.iban,\r\n type: 'text',\r\n placeholder: 'Naam rekeninghouder',\r\n errors: [],\r\n hidden: !this.$store.state.currentUser.employeeDetails.iban\r\n }\r\n }\r\n\r\n hasDirtyInput = false\r\n private addressApi: AddressCompletionApi\r\n\r\n private previouseHouseNumber: string\r\n private previousePostalcode: string\r\n\r\n get currentUser (): User {\r\n return this.$store.state.currentUser\r\n }\r\n\r\n public constructor () {\r\n super()\r\n this.addressApi = new AddressCompletionApi()\r\n\r\n this.previouseHouseNumber = ''\r\n this.previousePostalcode = ''\r\n }\r\n\r\n public convertStringToGender (gender: string): Gender {\r\n switch (gender) {\r\n case 'Female': return Gender.Female\r\n case 'Male': return Gender.Male\r\n case 'X': return Gender.X\r\n default: return Gender.Unknown\r\n }\r\n }\r\n\r\n public async updateEmployeeDetails () {\r\n this.clearErrors()\r\n if (!this.validateInput()) {\r\n return\r\n }\r\n\r\n const api = new SubscriptionApi()\r\n const fields: UpdateEmployeeDetailsCommand = {\r\n subscriptionId: this.currentUser.subscription?.subscriptionId || 0,\r\n address: this.inputFields.address.value,\r\n postalCode: this.inputFields.postalCode.value,\r\n city: this.inputFields.city.value,\r\n phonePersonal: this.inputFields.phonePersonal.value,\r\n phoneBusiness: this.inputFields.phoneBusiness.value,\r\n iban: this.inputFields.iban.value,\r\n ibanAccountHolder: this.inputFields.ibanAccountHolder.value\r\n }\r\n try {\r\n this.state = this.states.LOADING\r\n this.clearErrors()\r\n await api.subscriptionUpdateDetails(fields)\r\n\r\n this.state = this.states.COMPLETE\r\n } catch (error) {\r\n this.state = this.states.ERROR\r\n\r\n this.setErrors(error.response.data.errors)\r\n\r\n this.$root.$emit('scrollToTop')\r\n }\r\n }\r\n\r\n public setErrors (errors: []) {\r\n Object.entries(errors).forEach(([errorKey, errorValue]) => {\r\n Object.entries(this.inputFields).forEach(([fieldKey, fieldValue]) => {\r\n if (errorKey.toLowerCase() === fieldKey.toLowerCase()) {\r\n fieldValue.errors = errorValue\r\n }\r\n })\r\n })\r\n }\r\n\r\n public clearErrors () {\r\n Object.values(this.inputFields).forEach((fieldValue: InputField) => {\r\n fieldValue.errors = []\r\n })\r\n }\r\n\r\n private addressCheckDebounce = _.debounce(async (houseNumber: number, postalCode: string) => {\r\n const { data } = await this.addressApi.addressCompletionGetCompleteAddressForTheNetherlands({\r\n houseNumber: houseNumber,\r\n postalCode: postalCode.replace(' ', '')\r\n })\r\n\r\n if (data) {\r\n this.inputFields.address.value = `${data.street} ${data.houseNumber}`\r\n this.inputFields.city.value = data.city || ''\r\n }\r\n }, 750)\r\n\r\n public inputChange () {\r\n this.hasDirtyInput = true\r\n if ((this.inputFields.houseNumber.value || this.inputFields.postalCode.value) &&\r\n isNumber(Number(this.inputFields.houseNumber.value)) &&\r\n (this.previouseHouseNumber !== this.inputFields.houseNumber.value ||\r\n this.previousePostalcode !== this.inputFields.postalCode.value)) {\r\n this.previouseHouseNumber = this.inputFields.houseNumber.value\r\n this.previousePostalcode = this.inputFields.postalCode.value\r\n\r\n this.addressCheckDebounce(Number(this.inputFields.houseNumber.value), this.inputFields.postalCode.value)\r\n }\r\n }\r\n\r\n private validateInput () {\r\n let valid = true\r\n\r\n Object.keys(this.inputFields).forEach((key: string) => {\r\n let input\r\n if (Array.isArray(this.$refs[key])) {\r\n input = (this.$refs[key] as Element[])[0]\r\n } else {\r\n input = this.$refs[key]\r\n }\r\n valid = (input as FormInput).validate() && valid\r\n })\r\n\r\n return valid\r\n }\r\n\r\n get hasErrors () {\r\n let hasError = false\r\n Object.values(this.inputFields).forEach((fieldValue: InputField) => {\r\n hasError = hasError || fieldValue.errors.length > 0\r\n })\r\n return hasError\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DetailEdit.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DetailEdit.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./DetailEdit.vue?vue&type=template&id=fd5a9de2&scoped=true&\"\nimport script from \"./DetailEdit.vue?vue&type=script&lang=ts&\"\nexport * from \"./DetailEdit.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./DetailEdit.vue?vue&type=style&index=0&id=fd5a9de2&prod&lang=scss&scoped=true&\"\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 \"fd5a9de2\",\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}