{"version":3,"sources":["webpack:///./infrastructure/presentation/views/Statement.vue?71c0","webpack:///./infrastructure/presentation/views/Statement.vue?9544","webpack:///./domain/enums/statement.ts","webpack:///./infrastructure/presentation/views/Statement.vue?7101","webpack:///./infrastructure/presentation/views/Statement.vue"],"names":["_withScopeId","n","_hoisted_1","class","_hoisted_2","key","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_23","_hoisted_24","_hoisted_25","_hoisted_26","_hoisted_27","_hoisted_28","_hoisted_29","render","_ctx","_cache","$props","$setup","$data","$options","_component_router_link","statements","length","formatDecoins","user","dcoins","statement","index","formatDate","date","clickable","type","StatementType","PRODUCT","COURSE","collapsed","isOpenedIndex","onClick","$event","toggleStatement","formatName","debit","transactionType","TransactionType","DEBIT","credit","CREDIT","canceled","typeCanceled","StatementTypeCanceled","CANCELED","formattedTransaction","decoins","contents","content","title","order","products","product","name","formattedQuantity","quantity","to","default","_","store","getters","orderStatementsByDate","Array","Intl","NumberFormat","format","Date","toLocaleDateString","arrayOfStatements","forEach","object","sameDateList","push","obj","i","Object","values","flat","isCanceled","async","dispatch","e","message","console","error","id","ACCESS","PILL","EVENT","value","__exports__"],"mappings":"kHAAA,W,gFCEA,MAAMA,EAAeC,IAAM,eAAa,mBAAmBA,EAAEA,IAAI,iBAAcA,GACzEC,EAAa,CAAEC,MAAO,QACtBC,EAAa,CACjBC,IAAK,EACLF,MAAO,aAEHG,EAAa,CAAEH,MAAO,qBACtBI,EAA2BP,EAAa,IAAmB,eAAoB,KAAM,KAAM,sBAAuB,IAClHQ,EAAa,CAAEL,MAAO,sBACtBM,EAA0B,eAAiB,kBAC3CC,EAA2BV,EAAa,IAAmB,eAAoB,KAAM,CAAEG,MAAO,mBAAqB,MAAO,IAC1H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c2D,QAAUpE,EAAQ,KAAOA,GAG/D,MAAO,CACLsB,wBACAN,kBACAX,gBACAX,aACAG,OACAY,gBACAR,aACAL,gBACA4B,uBACAS,oBACApB,aACAD,sB,iCCtJN,MAAMyD,EAA2B,IAAgB,EAAQ,CAAC,CAAC,SAASnF,GAAQ,CAAC,YAAY,qBAE1E","file":"js/chunk-6b7cb4b7.94667ee8.js","sourcesContent":["export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--7-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--7-oneOf-1-1!../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--7-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader-v16/dist/index.js??ref--1-1!./Statement.vue?vue&type=style&index=0&id=b02d1ede&scoped=true&lang=css\"","import { createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeClass as _normalizeClass, createCommentVNode as _createCommentVNode, vShow as _vShow, withDirectives as _withDirectives, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-b02d1ede\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"view\" }\nconst _hoisted_2 = {\n key: 0,\n class: \"statement\"\n}\nconst _hoisted_3 = { class: \"statement__header\" }\nconst _hoisted_4 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"h2\", null, \"Extrato de Decoins\", -1))\nconst _hoisted_5 = { class: \"statement__balance\" }\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\" Saldo atual: \")\nconst _hoisted_7 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"hr\", { class: \"statement__line\" }, null, -1))\nconst _hoisted_8 = { class: \"statement__list\" }\nconst _hoisted_9 = { class: \"statement__container\" }\nconst _hoisted_10 = { class: \"statement__date\" }\nconst _hoisted_11 = [\"onClick\"]\nconst _hoisted_12 = { class: \"statement__title\" }\nconst _hoisted_13 = { class: \"statement__name\" }\nconst _hoisted_14 = { class: \"statement__transaction\" }\nconst _hoisted_15 = { class: \"statement__date-course\" }\nconst _hoisted_16 = { key: 0 }\nconst _hoisted_17 = { class: \"statement__contents\" }\nconst _hoisted_18 = { class: \"statement__content-title\" }\nconst _hoisted_19 = {\n key: 0,\n class: \"statement__content-decoins\"\n}\nconst _hoisted_20 = { key: 1 }\nconst _hoisted_21 = { class: \"statement__orders\" }\nconst _hoisted_22 = { class: \"statement__order-title\" }\nconst _hoisted_23 = { class: \"statement__order-quantity\" }\nconst _hoisted_24 = { class: \"statement__value\" }\nconst _hoisted_25 = {\n key: 1,\n class: \"statement__message-box\"\n}\nconst _hoisted_26 = { class: \"statement__message\" }\nconst _hoisted_27 = /*#__PURE__*/_createTextVNode(\" Você não possui extratos, acesse o \")\nconst _hoisted_28 = /*#__PURE__*/_createTextVNode(\"dashboard\")\nconst _hoisted_29 = /*#__PURE__*/_createTextVNode(\" e finalize algum treinamento para obter decoins. \")\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_router_link = _resolveComponent(\"router-link\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_ctx.statements.length)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, [\n _createElementVNode(\"header\", _hoisted_3, [\n _hoisted_4,\n _createElementVNode(\"div\", _hoisted_5, [\n _createElementVNode(\"h2\", null, [\n _hoisted_6,\n _createElementVNode(\"span\", null, _toDisplayString(_ctx.formatDecoins(_ctx.user.dcoins)), 1)\n ])\n ])\n ]),\n _hoisted_7,\n _createElementVNode(\"ul\", _hoisted_8, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.statements, (statement, index) => {\n return (_openBlock(), _createElementBlock(\"li\", { key: index }, [\n _createElementVNode(\"div\", _hoisted_9, [\n _createElementVNode(\"div\", null, [\n _createElementVNode(\"span\", _hoisted_10, _toDisplayString(_ctx.formatDate(statement.date)), 1),\n _createElementVNode(\"div\", {\n class: _normalizeClass([\r\n 'statement__information',\r\n {\r\n clickable:\r\n statement.type === _ctx.StatementType.PRODUCT ||\r\n statement.type === _ctx.StatementType.COURSE\r\n },\r\n {\r\n collapsed: _ctx.isOpenedIndex === index\r\n }\r\n ]),\n onClick: ($event: any) => (_ctx.toggleStatement(index))\n }, [\n _createElementVNode(\"div\", _hoisted_12, [\n _createElementVNode(\"div\", _hoisted_13, [\n _createElementVNode(\"span\", null, _toDisplayString(_ctx.formatName(statement)), 1)\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_14, [\n _createElementVNode(\"h4\", {\n class: _normalizeClass([\r\n 'statement__type-course',\r\n {\r\n debit:\r\n statement.transactionType === _ctx.TransactionType.DEBIT\r\n },\r\n {\r\n credit:\r\n statement.transactionType === _ctx.TransactionType.CREDIT\r\n },\r\n {\r\n canceled:\r\n statement.typeCanceled ===\r\n _ctx.StatementTypeCanceled.CANCELED\r\n }\r\n ])\n }, _toDisplayString(_ctx.formattedTransaction(\r\n statement.transactionType,\r\n statement.typeCanceled\r\n )), 3),\n _createElementVNode(\"h4\", _hoisted_15, _toDisplayString(_ctx.formatDate(statement.date)), 1),\n _createElementVNode(\"h4\", {\n class: _normalizeClass([\r\n 'statement__total',\r\n {\r\n debit:\r\n statement.transactionType === _ctx.TransactionType.DEBIT\r\n },\r\n {\r\n credit:\r\n statement.transactionType === _ctx.TransactionType.CREDIT\r\n },\r\n {\r\n canceled:\r\n statement.typeCanceled ===\r\n _ctx.StatementTypeCanceled.CANCELED\r\n }\r\n ])\n }, _toDisplayString(_ctx.formatDecoins(statement.decoins)), 3)\n ])\n ], 10, _hoisted_11),\n (statement.type === _ctx.StatementType.COURSE)\n ? _withDirectives((_openBlock(), _createElementBlock(\"ul\", _hoisted_16, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(statement.contents, (content, index) => {\n return (_openBlock(), _createElementBlock(\"li\", { key: index }, [\n _createElementVNode(\"div\", _hoisted_17, [\n _createElementVNode(\"p\", _hoisted_18, _toDisplayString(content.title), 1),\n false\n ? (_openBlock(), _createElementBlock(\"p\", _hoisted_19, _toDisplayString(_ctx.formatDecoins(content.dCoins)), 1))\n : _createCommentVNode(\"\", true)\n ])\n ]))\n }), 128))\n ], 512)), [\n [_vShow, _ctx.isOpenedIndex === index]\n ])\n : (statement.type === _ctx.StatementType.PRODUCT)\n ? _withDirectives((_openBlock(), _createElementBlock(\"ul\", _hoisted_20, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(statement.order.products, (product, index) => {\n return (_openBlock(), _createElementBlock(\"li\", { key: index }, [\n _createElementVNode(\"div\", _hoisted_21, [\n _createElementVNode(\"p\", _hoisted_22, _toDisplayString(product.name), 1),\n _createElementVNode(\"p\", _hoisted_23, \" Qtde\" + _toDisplayString(_ctx.formattedQuantity(product.quantity)) + \": \" + _toDisplayString(product.quantity), 1),\n _createElementVNode(\"p\", _hoisted_24, \" -\" + _toDisplayString(_ctx.formatDecoins(product.decoins)), 1)\n ])\n ]))\n }), 128))\n ], 512)), [\n [_vShow, _ctx.isOpenedIndex === index]\n ])\n : _createCommentVNode(\"\", true)\n ])\n ])\n ]))\n }), 128))\n ])\n ]))\n : (_openBlock(), _createElementBlock(\"span\", _hoisted_25, [\n _createElementVNode(\"p\", _hoisted_26, [\n _hoisted_27,\n _createVNode(_component_router_link, {\n class: \"statement__highlighted-text\",\n to: { name: 'dashboard' }\n }, {\n default: _withCtx(() => [\n _hoisted_28\n ]),\n _: 1\n }),\n _hoisted_29\n ])\n ]))\n ]))\n}","export enum TransactionType {\r\n CREDIT = 0,\r\n DEBIT = 1\r\n}\r\n\r\nexport enum StatementType {\r\n COURSE = 1,\r\n EVENT = 2,\r\n PILL = 3,\r\n ACCESS = 4,\r\n PRODUCT = 5\r\n}\r\n\r\nexport enum StatementTypeCanceled {\r\n CANCELED = 1,\r\n VALID = 0\r\n}\r\n","\r\nimport {\r\n computed,\r\n ComputedRef,\r\n defineComponent,\r\n onBeforeMount,\r\n ref,\r\n Ref\r\n} from \"vue\";\r\nimport { User } from \"../../../domain/entities/entities\";\r\nimport { useStore } from \"vuex\";\r\nimport { dispatchErrorBox } from \"../components/mixins\";\r\nimport { RepositoryException } from \"../../../domain/exceptions/exceptions\";\r\nimport { Statement } from \"../../../domain/entities/statement\";\r\nimport {\r\n StatementType,\r\n StatementTypeCanceled,\r\n TransactionType\r\n} from \"../../../domain/enums/statement\";\r\n\r\nexport default defineComponent({\r\n setup() {\r\n const store = useStore();\r\n\r\n const isOpenedIndex: Ref = ref(null);\r\n\r\n /** User information getter. */\r\n const user: ComputedRef = computed(() => {\r\n return store.getters[\"userProfile_module/user\"];\r\n });\r\n\r\n /** Statements sorted by date. . */\r\n const statements: ComputedRef = computed(() => {\r\n return orderStatementsByDate(\r\n store.getters[\"statement_module/statements\"] || Array()\r\n );\r\n });\r\n\r\n onBeforeMount(async () => {\r\n try {\r\n await store.dispatch(\"statement_module/loadStatements\");\r\n await store.dispatch(\"userProfile_module/loadUser\");\r\n } catch (e) {\r\n if (e instanceof RepositoryException) {\r\n await dispatchErrorBox(e.message);\r\n } else {\r\n console.error(e);\r\n await dispatchErrorBox(\"Ocorreu um erro inesperado.\");\r\n }\r\n }\r\n });\r\n\r\n /** Function responsible for formatting the decoins to Brazilian currency. */\r\n function formatDecoins(decoins: number): string {\r\n return Intl.NumberFormat(\"pt-br\").format(decoins);\r\n }\r\n\r\n /** Function responsible for formatting the date in the Brazilian standard. */\r\n function formatDate(date: string): string {\r\n return new Date(date).toLocaleDateString(\"pt-BR\");\r\n }\r\n\r\n /** Function responsible for grouping statements with the same date. */\r\n function orderStatementsByDate(\r\n statements: Array\r\n ): Array {\r\n if (!statements) {\r\n return new Array();\r\n }\r\n\r\n const arrayOfStatements = new Array>();\r\n\r\n statements.forEach((object: Statement, index) => {\r\n if (\r\n index > 0 &&\r\n index < statements.length &&\r\n formatDate(object.date) == formatDate(statements[index - 1].date)\r\n ) {\r\n return;\r\n }\r\n\r\n /** current date list instance. */\r\n const sameDateList: Array = [];\r\n\r\n /** add the current object to the list. */\r\n sameDateList.push(object);\r\n\r\n /** check if there is an item equal to the current one in all the next items in the list. */\r\n statements.forEach((obj: Statement, i) => {\r\n if (formatDate(obj.date) == formatDate(object.date) && i > index) {\r\n sameDateList.push(obj);\r\n }\r\n });\r\n\r\n arrayOfStatements.push(sameDateList);\r\n });\r\n\r\n return Object.values(arrayOfStatements).flat();\r\n }\r\n\r\n /** Function responsible for handling the type of transaction. */\r\n function formattedTransaction(\r\n type: TransactionType,\r\n isCanceled: StatementTypeCanceled\r\n ): string {\r\n if (isCanceled === StatementTypeCanceled.CANCELED) {\r\n return \"cancelado\";\r\n }\r\n if (type === TransactionType.CREDIT) {\r\n return \"crédito\";\r\n }\r\n if (type === TransactionType.DEBIT) {\r\n return \"débito\";\r\n }\r\n return \"-\";\r\n }\r\n\r\n /** Function to add 's' when the amount is greater than 1.*/\r\n function formattedQuantity(quantity: number): string {\r\n if (quantity > 1) {\r\n return \"s\";\r\n } else {\r\n return \"\";\r\n }\r\n }\r\n\r\n const formatName = (statement: Statement): string => {\r\n switch (statement.type) {\r\n case StatementType.COURSE:\r\n return `Treinamento: ${statement.name}`;\r\n case StatementType.PRODUCT:\r\n return `Pedido: #${statement.order.id}`;\r\n case StatementType.ACCESS:\r\n return `Acesso na plataforma`;\r\n case StatementType.PILL:\r\n return `Pílula: ${statement.name}`;\r\n case StatementType.EVENT:\r\n return `Evento: ${statement.name}`;\r\n }\r\n };\r\n\r\n const toggleStatement = (index: number) => {\r\n isOpenedIndex.value = isOpenedIndex.value === index ? null : index;\r\n };\r\n\r\n return {\r\n StatementTypeCanceled,\r\n TransactionType,\r\n StatementType,\r\n statements,\r\n user,\r\n isOpenedIndex,\r\n formatDate,\r\n formatDecoins,\r\n formattedTransaction,\r\n formattedQuantity,\r\n formatName,\r\n toggleStatement\r\n };\r\n }\r\n});\r\n","import { render } from \"./Statement.vue?vue&type=template&id=b02d1ede&scoped=true&ts=true\"\nimport script from \"./Statement.vue?vue&type=script&lang=ts\"\nexport * from \"./Statement.vue?vue&type=script&lang=ts\"\n\nimport \"./Statement.vue?vue&type=style&index=0&id=b02d1ede&scoped=true&lang=css\"\n\nimport exportComponent from \"C:\\\\Users\\\\guilherme.brisida\\\\AppData\\\\Local\\\\Temp\\\\decolabuild\\\\purple__bee\\\\node_modules\\\\vue-loader-v16\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-b02d1ede\"]])\n\nexport default __exports__"],"sourceRoot":""}