Created
December 2, 2023 09:52
-
-
Save shailen-naidoo/a35a69bb0afce9dd0597825ee48f197c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******/ (function(modules) { // webpackBootstrap | |
/******/ // install a JSONP callback for chunk loading | |
/******/ function webpackJsonpCallback(data) { | |
/******/ var chunkIds = data[0]; | |
/******/ var moreModules = data[1]; | |
/******/ var executeModules = data[2]; | |
/******/ | |
/******/ // add "moreModules" to the modules object, | |
/******/ // then flag all "chunkIds" as loaded and fire callback | |
/******/ var moduleId, chunkId, i = 0, resolves = []; | |
/******/ for(;i < chunkIds.length; i++) { | |
/******/ chunkId = chunkIds[i]; | |
/******/ if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) { | |
/******/ resolves.push(installedChunks[chunkId][0]); | |
/******/ } | |
/******/ installedChunks[chunkId] = 0; | |
/******/ } | |
/******/ for(moduleId in moreModules) { | |
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { | |
/******/ modules[moduleId] = moreModules[moduleId]; | |
/******/ } | |
/******/ } | |
/******/ if(parentJsonpFunction) parentJsonpFunction(data); | |
/******/ | |
/******/ while(resolves.length) { | |
/******/ resolves.shift()(); | |
/******/ } | |
/******/ | |
/******/ // add entry modules from loaded chunk to deferred list | |
/******/ deferredModules.push.apply(deferredModules, executeModules || []); | |
/******/ | |
/******/ // run deferred modules when all chunks ready | |
/******/ return checkDeferredModules(); | |
/******/ }; | |
/******/ function checkDeferredModules() { | |
/******/ var result; | |
/******/ for(var i = 0; i < deferredModules.length; i++) { | |
/******/ var deferredModule = deferredModules[i]; | |
/******/ var fulfilled = true; | |
/******/ for(var j = 1; j < deferredModule.length; j++) { | |
/******/ var depId = deferredModule[j]; | |
/******/ if(installedChunks[depId] !== 0) fulfilled = false; | |
/******/ } | |
/******/ if(fulfilled) { | |
/******/ deferredModules.splice(i--, 1); | |
/******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]); | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ return result; | |
/******/ } | |
/******/ | |
/******/ // The module cache | |
/******/ var installedModules = {}; | |
/******/ | |
/******/ // object to store loaded CSS chunks | |
/******/ var installedCssChunks = { | |
/******/ 6: 0 | |
/******/ }; | |
/******/ | |
/******/ // object to store loaded and loading chunks | |
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched | |
/******/ // Promise = chunk loading, 0 = chunk loaded | |
/******/ var installedChunks = { | |
/******/ 6: 0 | |
/******/ }; | |
/******/ | |
/******/ var deferredModules = []; | |
/******/ | |
/******/ // script path function | |
/******/ function jsonpScriptSrc(chunkId) { | |
/******/ return __webpack_require__.p + "js/" + ({"0":"chunk-common"}[chunkId]||chunkId) + "." + {"0":"85924914","2":"03c3490d","3":"e5137a23","4":"a4950095","5":"e6b49680","7":"defacd84","8":"f62513f1","9":"27403f2c","10":"e9cf8544","11":"b290f98c","12":"903b0675","13":"1114e2cb","14":"b5e8f155","15":"65a6de8f","16":"49055a02","17":"788c6d09","18":"3a8b3312","19":"ba15776f","20":"5aa4d976","21":"6c72c517","22":"aecbe9c8","23":"a7f3685b","24":"706e13dc","25":"3a22c83d","26":"90b3a20f","27":"ae02dc38","28":"6ba2a6ef","29":"55524ff5","30":"d4dd9da1","31":"201d2c70","32":"f77992d6","33":"635007d5","34":"23b69ae8","35":"0a28bb9b","36":"6f679a0b","37":"cbd8d12f","38":"b7ff18a7","39":"4079a226","40":"d9433e3a","41":"12c3f08c","42":"b6330b20","43":"5fe65129","44":"6ca7894f","45":"e0ad4fd8","46":"ce090055","47":"5b902def","48":"576a19fb","49":"22485365","50":"d2e97d09","51":"4f3d8e59","52":"f7209985","53":"a22f5026","54":"7295c026","55":"d3609d7a","56":"f4727835","57":"6cd72e87","58":"fcfe758b","59":"5ca8387d","60":"f667749c","61":"e59ef8d4","62":"aecac5b3","63":"39f512c0","64":"8aef8441","65":"31178761","66":"0abe7e72","67":"073ce4b1","68":"45818c73","69":"fd779613","70":"ac51ef48","71":"1d8fd2dc","72":"faf1e178","73":"f09cac31","74":"e7671d22","75":"1a207cbd","76":"c1832db7","77":"7e82f13c","78":"78dbcd1f","79":"b4bcc05e","80":"daf6f4ff"}[chunkId] + ".js" | |
/******/ } | |
/******/ | |
/******/ // The require function | |
/******/ function __webpack_require__(moduleId) { | |
/******/ | |
/******/ // Check if module is in cache | |
/******/ if(installedModules[moduleId]) { | |
/******/ return installedModules[moduleId].exports; | |
/******/ } | |
/******/ // Create a new module (and put it into the cache) | |
/******/ var module = installedModules[moduleId] = { | |
/******/ i: moduleId, | |
/******/ l: false, | |
/******/ exports: {} | |
/******/ }; | |
/******/ | |
/******/ // Execute the module function | |
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | |
/******/ | |
/******/ // Flag the module as loaded | |
/******/ module.l = true; | |
/******/ | |
/******/ // Return the exports of the module | |
/******/ return module.exports; | |
/******/ } | |
/******/ | |
/******/ // This file contains only the entry chunk. | |
/******/ // The chunk loading function for additional chunks | |
/******/ __webpack_require__.e = function requireEnsure(chunkId) { | |
/******/ var promises = []; | |
/******/ | |
/******/ | |
/******/ // mini-css-extract-plugin CSS loading | |
/******/ var cssChunks = {"0":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1}; | |
/******/ if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]); | |
/******/ else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) { | |
/******/ promises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) { | |
/******/ var href = "css/" + ({"0":"chunk-common"}[chunkId]||chunkId) + "." + {"0":"0a0f90dd","2":"31d6cfe0","3":"31d6cfe0","4":"31d6cfe0","5":"31d6cfe0","7":"fe59a2c1","8":"56bd29d6","9":"f6dd9973","10":"2eb2a53b","11":"ef1d83e4","12":"1658dd98","13":"41a8b9e6","14":"225e559c","15":"44bae7fc","16":"521749b2","17":"d2270a81","18":"3cac6a8f","19":"31d6cfe0","20":"31d6cfe0","21":"31d6cfe0","22":"31d6cfe0","23":"31d6cfe0","24":"31d6cfe0","25":"31d6cfe0","26":"31d6cfe0","27":"31d6cfe0","28":"31d6cfe0","29":"31d6cfe0","30":"31d6cfe0","31":"31d6cfe0","32":"31d6cfe0","33":"31d6cfe0","34":"31d6cfe0","35":"31d6cfe0","36":"31d6cfe0","37":"31d6cfe0","38":"31d6cfe0","39":"31d6cfe0","40":"31d6cfe0","41":"31d6cfe0","42":"31d6cfe0","43":"31d6cfe0","44":"31d6cfe0","45":"31d6cfe0","46":"31d6cfe0","47":"31d6cfe0","48":"31d6cfe0","49":"31d6cfe0","50":"31d6cfe0","51":"31d6cfe0","52":"31d6cfe0","53":"31d6cfe0","54":"31d6cfe0","55":"31d6cfe0","56":"31d6cfe0","57":"31d6cfe0","58":"31d6cfe0","59":"31d6cfe0","60":"31d6cfe0","61":"31d6cfe0","62":"31d6cfe0","63":"31d6cfe0","64":"31d6cfe0","65":"31d6cfe0","66":"31d6cfe0","67":"31d6cfe0","68":"31d6cfe0","69":"31d6cfe0","70":"31d6cfe0","71":"31d6cfe0","72":"31d6cfe0","73":"31d6cfe0","74":"31d6cfe0","75":"31d6cfe0","76":"31d6cfe0","77":"31d6cfe0","78":"31d6cfe0","79":"31d6cfe0","80":"31d6cfe0"}[chunkId] + ".css"; | |
/******/ var fullhref = __webpack_require__.p + href; | |
/******/ var existingLinkTags = document.getElementsByTagName("link"); | |
/******/ for(var i = 0; i < existingLinkTags.length; i++) { | |
/******/ var tag = existingLinkTags[i]; | |
/******/ var dataHref = tag.getAttribute("data-href") || tag.getAttribute("href"); | |
/******/ if(tag.rel === "stylesheet" && (dataHref === href || dataHref === fullhref)) return resolve(); | |
/******/ } | |
/******/ var existingStyleTags = document.getElementsByTagName("style"); | |
/******/ for(var i = 0; i < existingStyleTags.length; i++) { | |
/******/ var tag = existingStyleTags[i]; | |
/******/ var dataHref = tag.getAttribute("data-href"); | |
/******/ if(dataHref === href || dataHref === fullhref) return resolve(); | |
/******/ } | |
/******/ var linkTag = document.createElement("link"); | |
/******/ linkTag.rel = "stylesheet"; | |
/******/ linkTag.type = "text/css"; | |
/******/ linkTag.onload = resolve; | |
/******/ linkTag.onerror = function(event) { | |
/******/ var request = event && event.target && event.target.src || fullhref; | |
/******/ var err = new Error("Loading CSS chunk " + chunkId + " failed.\n(" + request + ")"); | |
/******/ err.code = "CSS_CHUNK_LOAD_FAILED"; | |
/******/ err.request = request; | |
/******/ delete installedCssChunks[chunkId] | |
/******/ linkTag.parentNode.removeChild(linkTag) | |
/******/ reject(err); | |
/******/ }; | |
/******/ linkTag.href = fullhref; | |
/******/ | |
/******/ var head = document.getElementsByTagName("head")[0]; | |
/******/ head.appendChild(linkTag); | |
/******/ }).then(function() { | |
/******/ installedCssChunks[chunkId] = 0; | |
/******/ })); | |
/******/ } | |
/******/ | |
/******/ // JSONP chunk loading for javascript | |
/******/ | |
/******/ var installedChunkData = installedChunks[chunkId]; | |
/******/ if(installedChunkData !== 0) { // 0 means "already installed". | |
/******/ | |
/******/ // a Promise means "currently loading". | |
/******/ if(installedChunkData) { | |
/******/ promises.push(installedChunkData[2]); | |
/******/ } else { | |
/******/ // setup Promise in chunk cache | |
/******/ var promise = new Promise(function(resolve, reject) { | |
/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject]; | |
/******/ }); | |
/******/ promises.push(installedChunkData[2] = promise); | |
/******/ | |
/******/ // start chunk loading | |
/******/ var script = document.createElement('script'); | |
/******/ var onScriptComplete; | |
/******/ | |
/******/ script.charset = 'utf-8'; | |
/******/ script.timeout = 120; | |
/******/ if (__webpack_require__.nc) { | |
/******/ script.setAttribute("nonce", __webpack_require__.nc); | |
/******/ } | |
/******/ script.src = jsonpScriptSrc(chunkId); | |
/******/ | |
/******/ // create error before stack unwound to get useful stacktrace later | |
/******/ var error = new Error(); | |
/******/ onScriptComplete = function (event) { | |
/******/ // avoid mem leaks in IE. | |
/******/ script.onerror = script.onload = null; | |
/******/ clearTimeout(timeout); | |
/******/ var chunk = installedChunks[chunkId]; | |
/******/ if(chunk !== 0) { | |
/******/ if(chunk) { | |
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); | |
/******/ var realSrc = event && event.target && event.target.src; | |
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; | |
/******/ error.name = 'ChunkLoadError'; | |
/******/ error.type = errorType; | |
/******/ error.request = realSrc; | |
/******/ chunk[1](error); | |
/******/ } | |
/******/ installedChunks[chunkId] = undefined; | |
/******/ } | |
/******/ }; | |
/******/ var timeout = setTimeout(function(){ | |
/******/ onScriptComplete({ type: 'timeout', target: script }); | |
/******/ }, 120000); | |
/******/ script.onerror = script.onload = onScriptComplete; | |
/******/ document.head.appendChild(script); | |
/******/ } | |
/******/ } | |
/******/ return Promise.all(promises); | |
/******/ }; | |
/******/ | |
/******/ // expose the modules object (__webpack_modules__) | |
/******/ __webpack_require__.m = modules; | |
/******/ | |
/******/ // expose the module cache | |
/******/ __webpack_require__.c = installedModules; | |
/******/ | |
/******/ // define getter function for harmony exports | |
/******/ __webpack_require__.d = function(exports, name, getter) { | |
/******/ if(!__webpack_require__.o(exports, name)) { | |
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); | |
/******/ } | |
/******/ }; | |
/******/ | |
/******/ // define __esModule on exports | |
/******/ __webpack_require__.r = function(exports) { | |
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | |
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | |
/******/ } | |
/******/ Object.defineProperty(exports, '__esModule', { value: true }); | |
/******/ }; | |
/******/ | |
/******/ // create a fake namespace object | |
/******/ // mode & 1: value is a module id, require it | |
/******/ // mode & 2: merge all properties of value into the ns | |
/******/ // mode & 4: return value when already ns object | |
/******/ // mode & 8|1: behave like require | |
/******/ __webpack_require__.t = function(value, mode) { | |
/******/ if(mode & 1) value = __webpack_require__(value); | |
/******/ if(mode & 8) return value; | |
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; | |
/******/ var ns = Object.create(null); | |
/******/ __webpack_require__.r(ns); | |
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); | |
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); | |
/******/ return ns; | |
/******/ }; | |
/******/ | |
/******/ // getDefaultExport function for compatibility with non-harmony modules | |
/******/ __webpack_require__.n = function(module) { | |
/******/ var getter = module && module.__esModule ? | |
/******/ function getDefault() { return module['default']; } : | |
/******/ function getModuleExports() { return module; }; | |
/******/ __webpack_require__.d(getter, 'a', getter); | |
/******/ return getter; | |
/******/ }; | |
/******/ | |
/******/ // Object.prototype.hasOwnProperty.call | |
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; | |
/******/ | |
/******/ // __webpack_public_path__ | |
/******/ __webpack_require__.p = ""; | |
/******/ | |
/******/ // on error function for async loading | |
/******/ __webpack_require__.oe = function(err) { console.error(err); throw err; }; | |
/******/ | |
/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; | |
/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); | |
/******/ jsonpArray.push = webpackJsonpCallback; | |
/******/ jsonpArray = jsonpArray.slice(); | |
/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]); | |
/******/ var parentJsonpFunction = oldJsonpFunction; | |
/******/ | |
/******/ | |
/******/ // add entry module to deferred list | |
/******/ deferredModules.push([0,1]); | |
/******/ // run deferred modules when ready | |
/******/ return checkDeferredModules(); | |
/******/ }) | |
/************************************************************************/ | |
/******/ ({ | |
/***/ 0: | |
/***/ (function(module, exports, __webpack_require__) { | |
module.exports = __webpack_require__("2f39"); | |
/***/ }), | |
/***/ "0174": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
// EXPORTS | |
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ ClientService_ClientService; }); | |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js | |
var defineProperty = __webpack_require__("9523"); | |
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty); | |
// EXTERNAL MODULE: ./src/helpers/http.js + 1 modules | |
var http = __webpack_require__("825e"); | |
// EXTERNAL MODULE: ./src/models/ClientModel/index.js + 1 modules | |
var ClientModel = __webpack_require__("1844"); | |
// CONCATENATED MODULE: ./src/services/ClientService/constants.js | |
const DETECTORS_URL = '/api/detectors'; | |
const DISABLE_CLIENT_URL = clientId => `/api/detectors/${clientId}/disable`; | |
const ENABLE_CLIENT_URL = clientId => `/api/detectors/${clientId}/enable`; | |
const DETECTORS_PHOTOS_URL = '/api/detectors/photos'; | |
const APPEND_DETECTORS_NOTE = detectorId => `${DETECTORS_URL}/${detectorId}/append-note`; | |
const UPDATE_DETECTORS = detectorId => `${DETECTORS_URL}/${detectorId}/update`; | |
const UPDATE_LIVES_ASSURED = clientId => `${DETECTORS_URL}/${clientId}/lives-assured-bulk-update`; | |
const CREATE_FIRE_ALERT = clientId => `internal/software/test/${clientId}`; | |
// EXTERNAL MODULE: ./src/helpers/detectorStatus.js | |
var detectorStatus = __webpack_require__("53c7"); | |
// EXTERNAL MODULE: ./src/helpers/constants.js | |
var constants = __webpack_require__("5b55"); | |
// CONCATENATED MODULE: ./src/services/ClientService/index.js | |
class ClientService_ClientService { | |
static getClientById(clientId, options) { | |
const params = { | |
options: { | |
...options, | |
selected_related: ['insurance_user'] | |
} | |
}; | |
return http["a" /* default */].get(`${DETECTORS_URL}/${clientId}`, { | |
params | |
}).then(res => ClientModel["a" /* ClientModel */].fromLkJSON(res.data.detector)); | |
} | |
static listActivePolicyByPolicyNumberContains(policyNumberContains) { | |
const params = { | |
filters: { | |
status: detectorStatus["a" /* default */].ACTIVE, | |
system_app_type_not__in: [constants["L" /* SYSTEM_APP_TYPE */].SENSORS_APP], | |
device_barcode__contains: policyNumberContains | |
}, | |
options: { | |
include_count: true | |
} | |
}; | |
return http["a" /* default */].get(DETECTORS_URL, { | |
params | |
}).then(res => { | |
const clients = res.data.detectors.map(client => ClientModel["a" /* ClientModel */].fromLkJSON(client)); | |
const meta = { | |
policyNumbersCount: res.data.detectors_count | |
}; | |
return { | |
clients, | |
meta | |
}; | |
}); | |
} | |
static disableClient(clientId, disableReason) { | |
const params = { | |
detector: { | |
disable_reason: disableReason | |
} | |
}; | |
return http["a" /* default */].delete(DISABLE_CLIENT_URL(clientId), { | |
params | |
}).then(res => ClientModel["a" /* ClientModel */].fromLkJSON(res.data)); | |
} | |
static listClients(filters = {}, pagination = {}) { | |
const params = { | |
filters: {}, | |
options: { | |
include_count: true, | |
order_by: '-system_created', | |
selected_related: ['insurance_user'] | |
} | |
}; | |
if (pagination && pagination.rowsPerPage > 0) { | |
params.filters.page_size = pagination.rowsPerPage; | |
params.filters.page_number = pagination.page; | |
} | |
if (filters.clientIdsIn) { | |
params.filters.id__in = filters.clientIdsIn; | |
} | |
if (filters.deviceBarcodeContains) { | |
params.filters.device_barcode__contains = filters.deviceBarcodeContains; | |
} | |
if (filters.customerNameIContains) { | |
params.filters.customer_name_icontains = filters.customerNameIContains; | |
} | |
if (filters.status) { | |
params.filters.status = filters.status; | |
} | |
if (filters.systemAppTypeIn) { | |
params.filters.system_app_type__in = filters.systemAppTypeIn; | |
} | |
if (filters.locationName) { | |
params.filters.location_name__icontains = filters.locationName; | |
} | |
if (filters.insuranceMemberIds) { | |
params.filters.insurance_member_ids__icontains = filters.insuranceMemberIds; | |
} | |
if (filters.customerName) { | |
params.filters.customer_name_icontains = filters.customerName; | |
} | |
if (filters.customerMobileNumber) { | |
params.filters.customer_mobile_number__icontains = filters.customerMobileNumber; | |
} | |
if (filters.insuranceUserName) { | |
params.filters.insurance_user_full_name = filters.insuranceUserName; | |
} | |
if (filters.insuranceCommencementDate) { | |
params.filters.insurance_commencement_date__contains = filters.insuranceCommencementDate; | |
} | |
if (filters.insuranceSuspensionDateLessThan) { | |
params.filters.insurance_suspension_date__lte = filters.insuranceSuspensionDateLessThan; | |
} | |
if (filters.easyPayNumberIContains) { | |
params.filters.easypay_number__icontains = filters.easyPayNumberIContains; | |
} | |
if (filters.payAtNumberIContains) { | |
params.filters.pay_at_number__icontains = filters.payAtNumberIContains; | |
} | |
return http["a" /* default */].get(DETECTORS_URL, { | |
params | |
}).then(res => { | |
const clients = res.data.detectors.map(detector => ClientModel["a" /* ClientModel */].fromLkJSON(detector)); | |
const meta = { | |
detectorsCount: res.data.detectors_count, | |
pagination: { | |
...pagination | |
} | |
}; | |
return { | |
clients, | |
meta | |
}; | |
}); | |
} | |
} | |
defineProperty_default()(ClientService_ClientService, "getByPolicyId", ({ | |
firePolicyId, | |
funeralPolicyId | |
}) => { | |
const params = { | |
filters: { | |
status_in: [detectorStatus["a" /* default */].ACTIVE, detectorStatus["a" /* default */].DELETED] | |
} | |
}; | |
if (firePolicyId) { | |
params.filters.policy_id = firePolicyId; | |
} | |
if (funeralPolicyId) { | |
params.filters.funeral_policy_id = funeralPolicyId; | |
} | |
return http["a" /* default */].get(DETECTORS_URL, { | |
params | |
}).then(res => { | |
if (res.data.detectors.length > 1) { | |
throw new Error('Multiple old detectors/clients were linked to a policy'); | |
} | |
const [detector = {}] = res.data.detectors.map(client => ClientModel["a" /* ClientModel */].fromLkJSON(client)); | |
return detector; | |
}); | |
}); | |
defineProperty_default()(ClientService_ClientService, "enableClient", clientId => http["a" /* default */].post(ENABLE_CLIENT_URL(clientId)).then(res => ClientModel["a" /* ClientModel */].fromLkJSON(res.data))); | |
defineProperty_default()(ClientService_ClientService, "uploadClientPhoto", (detectorId, photoType, base64Image) => { | |
const params = { | |
detector_id: detectorId, | |
photo_type: constants["g" /* CUSTOMER_PHOTO_LIST */][photoType].backendName | |
}; | |
return http["a" /* default */].uploadBase64File(DETECTORS_PHOTOS_URL, base64Image, params).then(({ | |
data | |
}) => ClientModel["a" /* ClientModel */].fromLkJSON(data)); | |
}); | |
defineProperty_default()(ClientService_ClientService, "appendClientNote", (detectorId, noteToAppend) => { | |
const params = { | |
detector: { | |
note: noteToAppend | |
} | |
}; | |
return http["a" /* default */].post(APPEND_DETECTORS_NOTE(detectorId), params).then(res => ClientModel["a" /* ClientModel */].fromLkJSON(res.data)); | |
}); | |
defineProperty_default()(ClientService_ClientService, "updateClient", (detectorToUpdate, clientId, options) => { | |
const params = { | |
detector: detectorToUpdate, | |
options | |
}; | |
return http["a" /* default */].post(UPDATE_DETECTORS(clientId), params).then(res => ClientModel["a" /* ClientModel */].fromLkJSON(res.data)); | |
}); | |
defineProperty_default()(ClientService_ClientService, "updateLivesAssured", (livesAssuredToUpdate, clientId) => { | |
const params = { | |
lives_assured: livesAssuredToUpdate | |
}; | |
return http["a" /* default */].post(UPDATE_LIVES_ASSURED(clientId), params); | |
}); | |
defineProperty_default()(ClientService_ClientService, "createFireAlertForClient", clientId => http["a" /* default */].post(CREATE_FIRE_ALERT(clientId))); | |
/***/ }), | |
/***/ "064c": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TransactionService; }); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9523"); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__); | |
/* harmony import */ var camelize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("654d"); | |
/* harmony import */ var camelize__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(camelize__WEBPACK_IMPORTED_MODULE_1__); | |
/* harmony import */ var _models__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("3a34"); | |
/* harmony import */ var _HTTPService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("778a"); | |
class TransactionService {} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(TransactionService, "getTransactionById", transactionId => { | |
const params = { | |
include_related: 'payments__policy__customer,payments__funeral_policy,created_by,updated_by' | |
}; | |
return _HTTPService__WEBPACK_IMPORTED_MODULE_3__[/* HTTPService */ "a"].get(`/api/v2/transactions/${transactionId}`, { | |
params | |
}).then(({ | |
data | |
}) => _models__WEBPACK_IMPORTED_MODULE_2__[/* TransactionModel */ "m"].create(camelize__WEBPACK_IMPORTED_MODULE_1___default()(data))); | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(TransactionService, "updateTransactionStatus", (transactionId, status) => { | |
const params = { | |
status | |
}; | |
return _HTTPService__WEBPACK_IMPORTED_MODULE_3__[/* HTTPService */ "a"].patch(`/api/v2/transactions/${transactionId}`, params).then(({ | |
data | |
}) => _models__WEBPACK_IMPORTED_MODULE_2__[/* TransactionModel */ "m"].create(camelize__WEBPACK_IMPORTED_MODULE_1___default()(data))); | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(TransactionService, "listTransactions", (filters = {}, pagination = {}) => { | |
const params = { | |
filters, | |
page_size: pagination.rowsPerPage, | |
page_number: pagination.page, | |
include_related: 'created_by,payments__policy__customer' | |
}; | |
return _HTTPService__WEBPACK_IMPORTED_MODULE_3__[/* HTTPService */ "a"].get('api/v2/transactions', { | |
params | |
}).then(({ | |
data | |
}) => { | |
return { | |
transactions: data.transactions.map(transaction => _models__WEBPACK_IMPORTED_MODULE_2__[/* TransactionModel */ "m"].create(camelize__WEBPACK_IMPORTED_MODULE_1___default()(transaction))), | |
pagination: { | |
page: data.pagination.page_number, | |
rowsPerPage: data.pagination.page_count, | |
rowsNumber: data.pagination.total | |
} | |
}; | |
}); | |
}); | |
/***/ }), | |
/***/ "0921": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return scanBarcode; }); | |
const scanBarcode = () => new Promise((resolve, reject) => { | |
if (window.cordova) { | |
window.cordova.plugins.barcodeScanner.scan(resolve, reject); | |
} else { | |
reject('Barcode Scanner is not available. Cordova not found.'); | |
} | |
}); | |
/***/ }), | |
/***/ "0b56": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* unused harmony export INTRUDER_PAYMENT_TYPES */ | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PAYMENT_TYPE; }); | |
/* unused harmony export isCardPaymentType */ | |
/* unused harmony export isInstallationPaymentType */ | |
/* unused harmony export isPremiumPaymentType */ | |
/* harmony import */ var _enumHelper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("f3ac"); | |
// TODO: Move all this to constant PaymentTypesService, we want to move away from helpers | |
const INTRUDER_PAYMENT_TYPES = Object(_enumHelper__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
PREMIUM_CARD: 'First Premium - Card', | |
PREMIUM_CASH: 'First Premium - Cash', | |
INSTALLATION_FEE_CARD: 'Installation Fee - Card', | |
INSTALLATION_FEE_CASH: 'Installation Fee - Cash' | |
}); | |
const PAYMENT_TYPE = Object(_enumHelper__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
CASH: 'CASH', | |
CARD: 'CARD', | |
DEBIT_ORDER: 'DEBIT_ORDER', | |
BANK_DEPOSIT: 'BANK_DEPOSIT', | |
CLIENT_DISPUTE: 'CLIENT_DISPUTE', | |
CLIENT_REFERRAL: 'CLIENT_REFERRAL', | |
'13TH_MONTH_FREE': '13TH_MONTH_FREE', | |
OTHER_CLIENT_INCENTIVE: 'OTHER_CLIENT_INCENTIVE', | |
VENDOR_PAYMENT_MORGAN: 'VENDOR_PAYMENT_MORGAN', | |
EASYPAY: 'EASYPAY', | |
RETENTION_MONTH: 'RETENTION_MONTH', | |
CLAIM_DEDUCTION: 'CLAIM_DEDUCTION' | |
}, { | |
standardCollectionMethods() { | |
return [PAYMENT_TYPE.CASH, PAYMENT_TYPE.CARD, PAYMENT_TYPE.BANK_DEPOSIT]; | |
}, | |
toStandardCollectionDropDownOptions() { | |
return [PAYMENT_TYPE.CASH, PAYMENT_TYPE.CARD, PAYMENT_TYPE.BANK_DEPOSIT].map(val => ({ | |
label: val, | |
value: val | |
})); | |
} | |
}); | |
const isCardPaymentType = paymentType => [PAYMENT_TYPE.CARD, INTRUDER_PAYMENT_TYPES.INSTALLATION_FEE_CARD, INTRUDER_PAYMENT_TYPES.PREMIUM_CARD].includes(paymentType); | |
const isPremiumPaymentType = paymentTypeOption => [INTRUDER_PAYMENT_TYPES.PREMIUM_CARD, INTRUDER_PAYMENT_TYPES.PREMIUM_CASH].includes(paymentTypeOption); | |
const isInstallationPaymentType = paymentTypeOption => [INTRUDER_PAYMENT_TYPES.INSTALLATION_FEE_CASH, INTRUDER_PAYMENT_TYPES.INSTALLATION_FEE_CARD].includes(paymentTypeOption); | |
/***/ }), | |
/***/ "0dec": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return schemaValidators; }); | |
const schemaValidators = { | |
validateStrict(model) { | |
const { | |
validateStrict, | |
...schema | |
} = this; | |
return Object.entries(schema).map(([key, validators]) => { | |
// eslint-disable-next-line no-underscore-dangle | |
let _validators = validators; | |
if (typeof validators === 'function') { | |
_validators = validators(model); | |
} | |
return _validators.every(validator => validator(model[key])); | |
}).every(e => e); | |
} | |
}; | |
/***/ }), | |
/***/ "144a": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return REGISTER_CLIENT_ROUTES; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return REGISTER_CLIENT_ROUTES_ENUM; }); | |
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ce96"); | |
/* harmony import */ var _router_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("2d72"); | |
const createPath = path => `/register-client/${path}`; | |
const REGISTER_CLIENT_URLS = Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
CLIENT_TYPE: createPath('client-type'), | |
PERSONAL_DATA_CONSENT: createPath('personal-data-consent'), | |
CLIENT_REFERRAL: createPath('client-referral'), | |
CUSTOMER_DETAILS_SECTION_1: createPath('customer-details/section-1'), | |
CUSTOMER_DETAILS_SECTION_2: createPath('customer-details/section-2'), | |
POLICY_TYPE: createPath('policy-type'), | |
NEXT_OF_KIN: createPath('next-of-kin'), | |
BENEFICIARY_DETAILS: createPath('beneficiary-details'), | |
HOUSEHOLD_DETAILS: createPath('household-details'), | |
GEOLOCATION: createPath('geolocation'), | |
BARCODE_SCANNER: createPath('barcode-scanner'), | |
INSTALLATION_INFO: createPath('installation-info'), | |
TAKE_PHOTOS: createPath('take-photos'), | |
NOTES: createPath('notes'), | |
DATA_UPLOAD: createPath('data-upload'), | |
ADDITIONAL_POLICY_INFORMATION: createPath('additional-policy-information'), | |
EXISTING_CLIENT_CONFIRMATION: createPath('existing-client-confirmation'), | |
CLIENT_SEARCH: createPath('client-search'), | |
LIVES_ASSURED: createPath('lives-assured') | |
}); | |
const REGISTER_CLIENT_ROUTES = Object(_router_helpers__WEBPACK_IMPORTED_MODULE_1__[/* addEnableNewFlowConfigValidatorToRoute */ "b"])([{ | |
path: REGISTER_CLIENT_URLS.CLIENT_TYPE, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(37)]).then(__webpack_require__.bind(null, "e329")) | |
}, { | |
path: REGISTER_CLIENT_URLS.PERSONAL_DATA_CONSENT, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(48)]).then(__webpack_require__.bind(null, "3df7")) | |
}, { | |
path: REGISTER_CLIENT_URLS.CLIENT_REFERRAL, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(36)]).then(__webpack_require__.bind(null, "ffa9")) | |
}, { | |
path: REGISTER_CLIENT_URLS.CUSTOMER_DETAILS_SECTION_1, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(38)]).then(__webpack_require__.bind(null, "9e36")) | |
}, { | |
path: REGISTER_CLIENT_URLS.CUSTOMER_DETAILS_SECTION_2, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(39)]).then(__webpack_require__.bind(null, "75f1")) | |
}, { | |
path: REGISTER_CLIENT_URLS.POLICY_TYPE, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(49)]).then(__webpack_require__.bind(null, "9752")) | |
}, { | |
path: REGISTER_CLIENT_URLS.NEXT_OF_KIN, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(46)]).then(__webpack_require__.bind(null, "6f54")) | |
}, { | |
path: REGISTER_CLIENT_URLS.BENEFICIARY_DETAILS, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(35)]).then(__webpack_require__.bind(null, "0f47")) | |
}, { | |
path: REGISTER_CLIENT_URLS.HOUSEHOLD_DETAILS, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(43)]).then(__webpack_require__.bind(null, "ed08")) | |
}, { | |
path: REGISTER_CLIENT_URLS.GEOLOCATION, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(42)]).then(__webpack_require__.bind(null, "ab1c")) | |
}, { | |
path: REGISTER_CLIENT_URLS.BARCODE_SCANNER, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(34)]).then(__webpack_require__.bind(null, "9554")) | |
}, { | |
path: REGISTER_CLIENT_URLS.INSTALLATION_INFO, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(44)]).then(__webpack_require__.bind(null, "5549")) | |
}, { | |
path: REGISTER_CLIENT_URLS.TAKE_PHOTOS, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(50)]).then(__webpack_require__.bind(null, "561f")) | |
}, { | |
path: REGISTER_CLIENT_URLS.NOTES, | |
name: 'register-client-notes', | |
props: true, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(47)]).then(__webpack_require__.bind(null, "1221")) | |
}, { | |
path: REGISTER_CLIENT_URLS.DATA_UPLOAD, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(40)]).then(__webpack_require__.bind(null, "c41f")) | |
}, { | |
path: REGISTER_CLIENT_URLS.ADDITIONAL_POLICY_INFORMATION, | |
name: 'register-client-additional-policy-information', | |
props: true, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(33)]).then(__webpack_require__.bind(null, "5122")) | |
}, { | |
path: REGISTER_CLIENT_URLS.EXISTING_CLIENT_CONFIRMATION, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(41)]).then(__webpack_require__.bind(null, "b1e6")) | |
}, { | |
path: REGISTER_CLIENT_URLS.CLIENT_SEARCH, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(8)]).then(__webpack_require__.bind(null, "093e")) | |
}, { | |
path: REGISTER_CLIENT_URLS.LIVES_ASSURED, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(45)]).then(__webpack_require__.bind(null, "81a0")) | |
}]); | |
const REGISTER_CLIENT_ROUTES_ENUM = Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
CLIENT_TYPE: REGISTER_CLIENT_ROUTES.find(route => route.path === REGISTER_CLIENT_URLS.CLIENT_TYPE), | |
PERSONAL_DATA_CONSENT: REGISTER_CLIENT_ROUTES.find(route => route.path === REGISTER_CLIENT_URLS.PERSONAL_DATA_CONSENT), | |
CLIENT_REFERRAL: REGISTER_CLIENT_ROUTES.find(route => route.path === REGISTER_CLIENT_URLS.CLIENT_REFERRAL), | |
CUSTOMER_DETAILS_SECTION_1: REGISTER_CLIENT_ROUTES.find(route => route.path === REGISTER_CLIENT_URLS.CUSTOMER_DETAILS_SECTION_1), | |
CUSTOMER_DETAILS_SECTION_2: REGISTER_CLIENT_ROUTES.find(route => route.path === REGISTER_CLIENT_URLS.CUSTOMER_DETAILS_SECTION_2), | |
POLICY_TYPE: REGISTER_CLIENT_ROUTES.find(route => route.path === REGISTER_CLIENT_URLS.POLICY_TYPE), | |
NEXT_OF_KIN: REGISTER_CLIENT_ROUTES.find(route => route.path === REGISTER_CLIENT_URLS.NEXT_OF_KIN), | |
BENEFICIARY_DETAILS: REGISTER_CLIENT_ROUTES.find(route => route.path === REGISTER_CLIENT_URLS.BENEFICIARY_DETAILS), | |
HOUSEHOLD_DETAILS: REGISTER_CLIENT_ROUTES.find(route => route.path === REGISTER_CLIENT_URLS.HOUSEHOLD_DETAILS), | |
GEOLOCATION: REGISTER_CLIENT_ROUTES.find(route => route.path === REGISTER_CLIENT_URLS.GEOLOCATION), | |
BARCODE_SCANNER: REGISTER_CLIENT_ROUTES.find(route => route.path === REGISTER_CLIENT_URLS.BARCODE_SCANNER), | |
INSTALLATION_INFO: REGISTER_CLIENT_ROUTES.find(route => route.path === REGISTER_CLIENT_URLS.INSTALLATION_INFO), | |
TAKE_PHOTOS: REGISTER_CLIENT_ROUTES.find(route => route.path === REGISTER_CLIENT_URLS.TAKE_PHOTOS), | |
NOTES: REGISTER_CLIENT_ROUTES.find(route => route.path === REGISTER_CLIENT_URLS.NOTES), | |
DATA_UPLOAD: REGISTER_CLIENT_ROUTES.find(route => route.path === REGISTER_CLIENT_URLS.DATA_UPLOAD), | |
ADDITIONAL_POLICY_INFORMATION: REGISTER_CLIENT_ROUTES.find(route => route.path === REGISTER_CLIENT_URLS.ADDITIONAL_POLICY_INFORMATION), | |
EXISTING_CLIENT_CONFIRMATION: REGISTER_CLIENT_ROUTES.find(route => route.path === REGISTER_CLIENT_URLS.EXISTING_CLIENT_CONFIRMATION), | |
CLIENT_SEARCH: REGISTER_CLIENT_ROUTES.find(route => route.path === REGISTER_CLIENT_URLS.CLIENT_SEARCH), | |
LIVES_ASSURED: REGISTER_CLIENT_ROUTES.find(route => route.path === REGISTER_CLIENT_URLS.LIVES_ASSURED) | |
}); | |
/***/ }), | |
/***/ "155f": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
// EXPORTS | |
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ CommunityService; }); | |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js | |
var defineProperty = __webpack_require__("9523"); | |
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty); | |
// EXTERNAL MODULE: ./src/helpers/http.js + 1 modules | |
var http = __webpack_require__("825e"); | |
// EXTERNAL MODULE: ./src/models/index.js + 5 modules | |
var models = __webpack_require__("3a34"); | |
// CONCATENATED MODULE: ./src/services/CommunityService/constants.js | |
const COMMUNITY_URL = '/api/v2/communities'; | |
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js | |
var es_array_push = __webpack_require__("14d9"); | |
// CONCATENATED MODULE: ./src/services/CommunityService/private.js | |
const constructCommunitiesHierarchy = (communities, includeCommunity) => { | |
const provinces = {}; | |
if (includeCommunity !== null && includeCommunity !== void 0 && includeCommunity.id) { | |
communities.push(new models["c" /* CommunityModel */](includeCommunity)); | |
} | |
communities.forEach(community => { | |
if (!(community.province in provinces)) { | |
provinces[community.province] = {}; | |
} | |
const cities = provinces[community.province]; | |
if (!(community.city in cities)) { | |
cities[community.city] = {}; | |
} | |
const suburbs = cities[community.city]; | |
if (!(community.suburb in suburbs)) { | |
suburbs[community.suburb] = {}; | |
} | |
suburbs[community.suburb][community.name] = community.id; | |
}); | |
return provinces; | |
}; | |
// CONCATENATED MODULE: ./src/services/CommunityService/index.js | |
class CommunityService {} | |
defineProperty_default()(CommunityService, "listCommunities", () => http["a" /* default */].get(COMMUNITY_URL).then(res => res.data.communities.map(community => models["c" /* CommunityModel */].fromLkJSON(community)))); | |
defineProperty_default()(CommunityService, "communitiesHierarchy", includeCommunity => http["a" /* default */].get(COMMUNITY_URL).then(res => res.data.communities.map(community => models["c" /* CommunityModel */].fromLkJSON(community))).then(communities => constructCommunitiesHierarchy(communities, includeCommunity))); | |
/***/ }), | |
/***/ "1645": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HARDWARE_INSTALLATION_ROUTES; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return HARDWARE_INSTALLATION_ROUTES_ENUM; }); | |
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ce96"); | |
/* harmony import */ var _router_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("2d72"); | |
const createPath = path => `/hardware-installation/${path}`; | |
const HARDWARE_INSTALLATION_URLS = Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
INDEX: createPath(''), | |
BARCODE_SCANNER: createPath('barcode-scanner'), | |
INSTALLATION_INFO: createPath('installation-info'), | |
TAKE_PHOTOS: createPath('take-photos'), | |
NOTES: createPath('notes'), | |
DATA_UPLOAD: createPath('data-upload') | |
}); | |
const HARDWARE_INSTALLATION_ROUTES = Object(_router_helpers__WEBPACK_IMPORTED_MODULE_1__[/* addEnableNewFlowConfigValidatorToRoute */ "b"])([{ | |
path: HARDWARE_INSTALLATION_URLS.INDEX, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(4)]).then(__webpack_require__.bind(null, "0b9a")) | |
}, { | |
path: HARDWARE_INSTALLATION_URLS.BARCODE_SCANNER, | |
name: 'hardware-installation-barcode-scanner', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(27)]).then(__webpack_require__.bind(null, "6418")), | |
props: true | |
}, { | |
path: HARDWARE_INSTALLATION_URLS.INSTALLATION_INFO, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(28)]).then(__webpack_require__.bind(null, "1d0e")) | |
}, { | |
path: HARDWARE_INSTALLATION_URLS.TAKE_PHOTOS, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(30)]).then(__webpack_require__.bind(null, "69a5")) | |
}, { | |
path: HARDWARE_INSTALLATION_URLS.NOTES, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(29)]).then(__webpack_require__.bind(null, "488c")) | |
}, { | |
path: HARDWARE_INSTALLATION_URLS.DATA_UPLOAD, | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(3)]).then(__webpack_require__.bind(null, "807f")) | |
}]); | |
const HARDWARE_INSTALLATION_ROUTES_ENUM = Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
INDEX: HARDWARE_INSTALLATION_ROUTES.find(route => route.path === HARDWARE_INSTALLATION_URLS.INDEX), | |
BARCODE_SCANNER: HARDWARE_INSTALLATION_ROUTES.find(route => route.path === HARDWARE_INSTALLATION_URLS.BARCODE_SCANNER), | |
INSTALLATION_INFO: HARDWARE_INSTALLATION_ROUTES.find(route => route.path === HARDWARE_INSTALLATION_URLS.INSTALLATION_INFO), | |
TAKE_PHOTOS: HARDWARE_INSTALLATION_ROUTES.find(route => route.path === HARDWARE_INSTALLATION_URLS.TAKE_PHOTOS), | |
NOTES: HARDWARE_INSTALLATION_ROUTES.find(route => route.path === HARDWARE_INSTALLATION_URLS.NOTES), | |
DATA_UPLOAD: HARDWARE_INSTALLATION_ROUTES.find(route => route.path === HARDWARE_INSTALLATION_URLS.DATA_UPLOAD) | |
}); | |
/***/ }), | |
/***/ "1844": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
// EXPORTS | |
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ ClientModel_ClientModel; }); | |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js | |
var defineProperty = __webpack_require__("9523"); | |
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty); | |
// EXTERNAL MODULE: ./src/helpers/watchtowerLegacyUrlHelper.js | |
var watchtowerLegacyUrlHelper = __webpack_require__("c209"); | |
// EXTERNAL MODULE: ./src/helpers/constants.js | |
var constants = __webpack_require__("5b55"); | |
// EXTERNAL MODULE: ./src/models/index.js + 5 modules | |
var models = __webpack_require__("3a34"); | |
// EXTERNAL MODULE: ./src/models/BaseModel/index.js | |
var BaseModel = __webpack_require__("9599"); | |
// CONCATENATED MODULE: ./src/models/ClientModel/constants.js | |
const LEGACY_VIEW_DEVICE_BASE_URL = '/watchtower/agent/clients/view/id/'; | |
const LEGACY_UPDATE_DEVICE_BASE_URL = '/watchtower/agent/clients/update/id/'; | |
const CLIENT_PHOTOS = Object.freeze({ | |
DEVICE_PHOTO: { | |
displayName: 'Device', | |
name: 'devicePhoto', | |
type: constants["F" /* PHOTO_TYPE */].DETECTOR_PHOTO | |
}, | |
PHOTO_OUTSIDE: { | |
displayName: 'Outside', | |
name: 'photoOutside', | |
type: constants["F" /* PHOTO_TYPE */].FRONT_DOOR_HOUSE_NUMBER_PHOTO | |
}, | |
PHOTO_LEFT: { | |
displayName: 'Left', | |
name: 'photoLeft', | |
type: constants["F" /* PHOTO_TYPE */].PHOTO_LEFT | |
}, | |
PHOTO_RIGHT: { | |
displayName: 'Right', | |
name: 'photoRight', | |
type: constants["F" /* PHOTO_TYPE */].PHOTO_RIGHT | |
}, | |
PHOTO_CLIENT: { | |
displayName: 'Client', | |
name: 'photoClient', | |
type: constants["F" /* PHOTO_TYPE */].CLIENT_PHOTO | |
}, | |
PHOTO_INSIDE_LEFT: { | |
displayName: 'Inside Left', | |
name: 'photoInsideLeft', | |
type: constants["F" /* PHOTO_TYPE */].INSIDE_LEFT_PHOTO | |
}, | |
PHOTO_INSIDE_RIGHT: { | |
displayName: 'Inside Right', | |
name: 'photoInsideRight', | |
type: constants["F" /* PHOTO_TYPE */].INSIDE_RIGHT_PHOTO | |
}, | |
PHOTO_INSIDE_ONE: { | |
displayName: 'Inside One', | |
name: 'photoInsideOne', | |
type: constants["F" /* PHOTO_TYPE */].INSIDE_ONE_PHOTO | |
}, | |
PHOTO_INSIDE_TWO: { | |
displayName: 'Inside Two', | |
name: 'photoInsideTwo', | |
type: constants["F" /* PHOTO_TYPE */].PHOTO_INSIDE_TWO | |
}, | |
PHOTO_RENTAL_AGREEMENT: { | |
displayName: 'Rental Agreement', | |
name: 'photoRentalAgreement', | |
type: constants["F" /* PHOTO_TYPE */].RENTAL_AGREEMENT_PHOTO | |
}, | |
PHOTO_DEBIT_ORDER_FORM: { | |
displayName: 'Debit Order Form', | |
name: 'photoDebitOrderForm', | |
type: constants["F" /* PHOTO_TYPE */].DEBIT_ORDER_FORM_PHOTO | |
}, | |
PHOTO_FUNERAL_POLICYCERT: { | |
displayName: 'Funeral Policy Certificate', | |
name: 'photoFuneralPolicyCert', | |
type: constants["F" /* PHOTO_TYPE */].FUNERAL_POLICY_CERT_PHOTO | |
} | |
}); | |
// CONCATENATED MODULE: ./src/models/ClientModel/index.js | |
const jsonKeyToObjectKeyMap = new Map([['id', 'id'], ['device_barcode', 'deviceBarcode'], ['front_door_barcode', 'frontDoorBarcode'], ['status', 'status'], ['system_app_type', 'systemAppType'], ['insurance_policy_premium', 'insurancePolicyPremium'], ['community_id', 'communityId'], ['cancelled_at', 'cancelledAt'], ['insurance_suspension_date', 'insuranceSuspensionDate'], ['system_created', 'systemCreated'], ['location_gps_latitude', 'locationGpsLatitude'], ['location_gps_longitude', 'locationGpsLongitude'], ['location_gps_accuracy', 'locationGpsAccuracy'], ['location_name', 'locationName'], ['location_house_number', 'locationHouseNumber'], ['location_number_rooms', 'locationNumberRooms'], ['location_household_language', 'locationHouseholdLanguage'], ['location_household_value', 'locationHouseholdValue'], ['house_occupants_number', 'houseOccupantsNumber'], ['customer_first_name', 'customerFirstName'], ['customer_last_name', 'customerLastName'], ['customer_mobile_number', 'customerMobileNumber'], ['insurance_expected_payment_method', 'insuranceExpectedPaymentMethod'], ['insurance_expected_payment_date', 'insuranceExpectedPaymentDate'], ['insurance_commencement_date', 'insuranceCommencementDate'], ['insurance_income_source', 'insuranceIncomeSource'], ['insurance_member_ids', 'insuranceMemberIds'], ['insurance_alternative_contact_details', 'insuranceAlternativeContactDetails'], ['insurance_date_of_birth', 'insuranceDateOfBirth'], ['insurance_gender', 'insuranceGender'], ['insurance_agent_vendor_id', 'insuranceAgentVendorId'], ['insurance_user_id', 'insuranceUserId'], ['installation_agent_id', 'installationAgentId'], ['installation_user_id', 'installationUserId'], ['insurance_kin_first_name', 'insuranceKinFirstName'], ['insurance_kin_last_name', 'insuranceKinLastName'], ['insurance_kin_id_number', 'insuranceKinIdNumber'], ['insurance_kin_dob', 'insuranceKinDob'], ['insurance_kin_gender', 'insuranceKinGender'], ['insurance_kin_cell', 'insuranceKinCell'], ['insurance_referral_name', 'insuranceReferralName'], ['custsomer_whatsapp_number', 'customerWhatsappNumber'], ['customer_work_occupation', 'customerWorkOccupation'], ['insurance_preferred_payment_day_of_the_week', 'insurancePreferredPaymentDayOfTheWeek'], ['insurance_preferred_payment_hour', 'insurancePreferredPaymentHour'], ['notes', 'notes'], ['device_photo', 'devicePhoto'], ['photo_outside', 'photoOutside'], ['photo_left', 'photoLeft'], ['photo_right', 'photoRight'], ['photo_client', 'photoClient'], ['photo_inside_left', 'photoInsideLeft'], ['photo_inside_right', 'photoInsideRight'], ['photo_inside_one', 'photoInsideOne'], ['photo_inside_two', 'photoInsideTwo'], ['photo_rental_agreement', 'photoRentalAgreement'], ['photo_debit_order_form', 'photoDebitOrderForm'], ['photo_funeral_policy_cert', 'photoFuneralPolicyCert'], ['is_free_device', 'isFreeDevice'], ['agent_name', 'agentName'], ['last_payment_date', 'lastPaymentDate'], ['sum_of_payments', 'sumOfPayments'], ['num_of_payments', 'numberOfPayments'], ['system_app_type', 'systemAppType'], ['required_payment_amount_msg', 'requiredPaymentAmountMsg'], ['application_date', 'applicationDate'], ['pay_at_number', 'payAtNumber'], ['easypay_number', 'easyPayNumber'], ['insurance_user', 'insuranceUser'], ['policy_id', 'policyId'], ['customer_id', 'customerId']]); | |
class ClientModel_ClientModel extends BaseModel["a" /* BaseModel */] { | |
constructor(client) { | |
super(); | |
defineProperty_default()(this, "getClientPhotoUrlByName", photoName => { | |
if (!this[photoName]) { | |
return null; | |
} | |
return `${Object(watchtowerLegacyUrlHelper["a" /* getLegacyWatchTowerBaseUrl */])()}${constants["z" /* MEDIA_BASE_URL */]}${this[photoName]}`; | |
}); | |
defineProperty_default()(this, "getResizedClientPhotoUrlByName", (photoName, width, height) => { | |
if (!this[photoName]) { | |
return null; | |
} | |
return `${Object(watchtowerLegacyUrlHelper["a" /* getLegacyWatchTowerBaseUrl */])()}${Object(constants["K" /* RESIZED_IMAGE_URL */])(width, height)}${constants["z" /* MEDIA_BASE_URL */]}${this[photoName]}`; | |
}); | |
defineProperty_default()(this, "getClientPhotoLegacyUrl", photoName => { | |
if (!this[photoName]) { | |
return null; | |
} | |
return `${Object(watchtowerLegacyUrlHelper["a" /* getLegacyWatchTowerBaseUrl */])()}${constants["z" /* MEDIA_BASE_URL */]}${this[photoName]}`; | |
}); | |
defineProperty_default()(this, "getResizedClientPhotoLegacyUrl", (photoName, width, height) => { | |
if (!this[photoName]) { | |
return null; | |
} | |
return `${Object(watchtowerLegacyUrlHelper["a" /* getLegacyWatchTowerBaseUrl */])()}${Object(constants["K" /* RESIZED_IMAGE_URL */])(width, height)}${constants["z" /* MEDIA_BASE_URL */]}${this[photoName]}`; | |
}); | |
for (const [, camelCaseKey] of jsonKeyToObjectKeyMap) { | |
this[camelCaseKey] = client[camelCaseKey]; | |
} | |
} | |
get legacyWatchtowerClientUrl() { | |
return `${Object(watchtowerLegacyUrlHelper["a" /* getLegacyWatchTowerBaseUrl */])()}${LEGACY_VIEW_DEVICE_BASE_URL}${this.id}`; | |
} | |
get legacyWatchtowerUpdateClientUrl() { | |
return `${Object(watchtowerLegacyUrlHelper["a" /* getLegacyWatchTowerBaseUrl */])()}${LEGACY_UPDATE_DEVICE_BASE_URL}${this.id}`; | |
} | |
get customerName() { | |
return `${this.customerFirstName} ${this.customerLastName}`; | |
} | |
get isActive() { | |
return this.status === constants["d" /* CLIENT_STATUS */].ACTIVE; | |
} | |
get isFuneral() { | |
return this.systemAppType === constants["L" /* SYSTEM_APP_TYPE */].FIRE_FUNERAL_APP; | |
} | |
get hasDeviceAttached() { | |
return !!this.deviceBarcode; | |
} | |
toLkJSON() { | |
if (this.insuranceUser) { | |
this.insuranceUser = new models["o" /* UserModel */](this.insuranceUser).toLkJSON(); | |
} | |
return this.toJSONBase(jsonKeyToObjectKeyMap); | |
} | |
} | |
defineProperty_default()(ClientModel_ClientModel, "fromLkJSON", json => { | |
const jsonModel = ClientModel_ClientModel.fromJSONBase(json, jsonKeyToObjectKeyMap); | |
if (jsonModel.insuranceUser) { | |
jsonModel.insuranceUser = models["o" /* UserModel */].fromLkJSON(jsonModel.insuranceUser); | |
} | |
return new ClientModel_ClientModel(jsonModel); | |
}); | |
defineProperty_default()(ClientModel_ClientModel, "create", client => new ClientModel_ClientModel(client)); | |
/***/ }), | |
/***/ "26b0": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
// EXPORTS | |
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ CustomerService; }); | |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js | |
var defineProperty = __webpack_require__("9523"); | |
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty); | |
// EXTERNAL MODULE: ./node_modules/camelize/index.js | |
var camelize = __webpack_require__("654d"); | |
var camelize_default = /*#__PURE__*/__webpack_require__.n(camelize); | |
// EXTERNAL MODULE: ./src/helpers/index.js | |
var helpers = __webpack_require__("ce96"); | |
// EXTERNAL MODULE: ./src/helpers/http.js + 1 modules | |
var http = __webpack_require__("825e"); | |
// EXTERNAL MODULE: ./src/models/index.js + 5 modules | |
var models = __webpack_require__("3a34"); | |
// EXTERNAL MODULE: ./src/services/HTTPService/index.js | |
var HTTPService = __webpack_require__("778a"); | |
// EXTERNAL MODULE: ./src/models/FICAVerificationModel/constants.js | |
var constants = __webpack_require__("7a36"); | |
// CONCATENATED MODULE: ./src/models/FICAVerificationModel/index.js | |
class FICAVerificationModel_FICAVerificationModel { | |
constructor({ | |
id, | |
status, | |
riskRating, | |
requirements, | |
firstName, | |
surname, | |
idPassportNumber, | |
premiumCollectionMethod, | |
channel, | |
dateOfBirth, | |
customerId | |
} = {}) { | |
defineProperty_default()(this, "id", void 0); | |
defineProperty_default()(this, "status", void 0); | |
defineProperty_default()(this, "riskRating", void 0); | |
defineProperty_default()(this, "requirements", void 0); | |
defineProperty_default()(this, "firstName", void 0); | |
defineProperty_default()(this, "surname", void 0); | |
defineProperty_default()(this, "idPassportNumber", void 0); | |
defineProperty_default()(this, "premiumCollectionMethod", void 0); | |
defineProperty_default()(this, "channel", void 0); | |
defineProperty_default()(this, "dateOfBirth", void 0); | |
defineProperty_default()(this, "customerId", void 0); | |
this.id = id; | |
this.status = status; | |
this.riskRating = riskRating; | |
this.requirements = requirements; | |
this.firstName = firstName; | |
this.surname = surname; | |
this.idPassportNumber = idPassportNumber; | |
this.premiumCollectionMethod = premiumCollectionMethod; | |
this.channel = channel; | |
this.dateOfBirth = dateOfBirth; | |
this.customerId = customerId; | |
} | |
get isRefreshable() { | |
return this.status === constants["a" /* FICA_STATUS */].ERROR.value || this.status === constants["a" /* FICA_STATUS */].PENDING.value; | |
} | |
get readableRequirements() { | |
return this.requirements.map(requirement => constants["c" /* REQUIREMENTS */][requirement].label); | |
} | |
get isAcceptable() { | |
const allowablePassportNumberRegex = /^([A-Za-z]{2}\d{6})$/; | |
return this.status === constants["a" /* FICA_STATUS */].VERIFIED.value || allowablePassportNumberRegex.test(this.idPassportNumber) && this.status === constants["a" /* FICA_STATUS */].NONE.value; | |
} | |
get statusWithRequirements() { | |
if (this.requirements.length > 0) { | |
const requirementsLabel = this.requirements.map(requirement => constants["c" /* REQUIREMENTS */][requirement].label); | |
return `${constants["a" /* FICA_STATUS */][this.status].label}\nRequirements:\n${requirementsLabel.join('\n')}`; | |
} | |
return constants["a" /* FICA_STATUS */][this.status].label; | |
} | |
} | |
defineProperty_default()(FICAVerificationModel_FICAVerificationModel, "create", ficaVerification => { | |
return new FICAVerificationModel_FICAVerificationModel(ficaVerification); | |
}); | |
// CONCATENATED MODULE: ./src/services/CustomerService/index.js | |
class CustomerService {} | |
defineProperty_default()(CustomerService, "createCustomer", customer => { | |
return http["a" /* default */].post('/api/v2/customers', Object(helpers["d" /* snakeize */])(customer)).then(res => models["e" /* CustomerModel */].create(camelize_default()(res.data))); | |
}); | |
defineProperty_default()(CustomerService, "getCustomer", customerId => { | |
return HTTPService["a" /* HTTPService */].get(`/api/v2/customers/${customerId}`).then(res => models["e" /* CustomerModel */].create(camelize_default()(res.data))); | |
}); | |
defineProperty_default()(CustomerService, "updateCustomer", (customerId, customerModel) => { | |
const { | |
notes, | |
id, | |
customerPhoto, | |
referredById, | |
ficaVerificationId, | |
...newCustomer | |
} = customerModel; | |
return HTTPService["a" /* HTTPService */].patch(`/api/v2/customers/${customerId}`, Object(helpers["d" /* snakeize */])(newCustomer)).then(res => models["e" /* CustomerModel */].create(camelize_default()(res.data))); | |
}); | |
defineProperty_default()(CustomerService, "appendNotes", (customerId, notes) => { | |
return HTTPService["a" /* HTTPService */].patch(`/api/v2/customers/${customerId}/notes`, { | |
notes | |
}); | |
}); | |
defineProperty_default()(CustomerService, "searchForCustomer", (firstName, surname, idPassportNumber, mobileNumber) => { | |
const filters = {}; | |
if (firstName) { | |
filters.first_name__icontains = firstName; | |
} | |
if (surname) { | |
filters.surname__icontains = surname; | |
} | |
if (mobileNumber) { | |
filters.mobileNumber = mobileNumber; | |
} | |
if (idPassportNumber) { | |
filters.idPassportNumber = idPassportNumber; | |
} | |
return HTTPService["a" /* HTTPService */].get('/api/v2/customers/search', Object(helpers["d" /* snakeize */])({ | |
params: { | |
filters, | |
include_related: 'customer_photo', | |
page_size: 10 | |
} | |
})).then(({ | |
data | |
}) => ({ | |
customers: data.customers.map(customer => models["e" /* CustomerModel */].create(camelize_default()(customer))) | |
})); | |
}); | |
defineProperty_default()(CustomerService, "canCreate", (idPassportNumber, mobileNumber) => { | |
return HTTPService["a" /* HTTPService */].get('/api/v2/customers/can-create', Object(helpers["d" /* snakeize */])({ | |
params: { | |
idPassportNumber, | |
mobileNumber | |
} | |
})).then(({ | |
data | |
}) => ({ | |
status: data.status | |
})); | |
}); | |
defineProperty_default()(CustomerService, "isIdValid", (idType, idPassportNumber, dateOfBirth) => { | |
return HTTPService["a" /* HTTPService */].get('/api/v2/customers/is-id-valid', { | |
params: { | |
id_type: idType, | |
id_passport_number: idPassportNumber, | |
date_of_birth: dateOfBirth | |
} | |
}); | |
}); | |
defineProperty_default()(CustomerService, "isAllowed", (customerId, policyType) => { | |
return HTTPService["a" /* HTTPService */].get(`/api/v2/customers/${customerId}/policies/${policyType}/is-allowed`); | |
}); | |
defineProperty_default()(CustomerService, "getFicaVerification", ficaVerificationId => { | |
return HTTPService["a" /* HTTPService */].get(`/api/v2/fica-verifications/${ficaVerificationId}`).then(res => FICAVerificationModel_FICAVerificationModel.create(camelize_default()(res.data))); | |
}); | |
defineProperty_default()(CustomerService, "refreshFicaVerification", ficaVerificationId => { | |
return HTTPService["a" /* HTTPService */].put(`/api/v2/fica-verifications/${ficaVerificationId}/refresh`).then(res => FICAVerificationModel_FICAVerificationModel.create(camelize_default()(res.data))); | |
}); | |
defineProperty_default()(CustomerService, "createFicaVerification", customerId => { | |
return HTTPService["a" /* HTTPService */].post(`/api/v2/customers/${customerId}/fica-verification`).then(res => FICAVerificationModel_FICAVerificationModel.create(camelize_default()(res.data))); | |
}); | |
/***/ }), | |
/***/ "2792": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
// EXPORTS | |
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ UserService_UserService; }); | |
// EXTERNAL MODULE: ./src/helpers/http.js + 1 modules | |
var http = __webpack_require__("825e"); | |
// EXTERNAL MODULE: ./src/models/index.js + 5 modules | |
var models = __webpack_require__("3a34"); | |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js | |
var defineProperty = __webpack_require__("9523"); | |
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty); | |
// EXTERNAL MODULE: ./src/models/BaseModel/index.js | |
var BaseModel = __webpack_require__("9599"); | |
// EXTERNAL MODULE: ./node_modules/moment/moment.js | |
var moment = __webpack_require__("c1df"); | |
var moment_default = /*#__PURE__*/__webpack_require__.n(moment); | |
// CONCATENATED MODULE: ./src/models/MetricModel/index.js | |
const jsonKeyToObjectKeyMap = new Map([['metric_value', 'value'], ['date_range', 'dateRange'], ['description', 'description']]); | |
class MetricModel_MetricModel extends BaseModel["a" /* BaseModel */] { | |
constructor(metric) { | |
super(); | |
for (const [, camelCaseKey] of jsonKeyToObjectKeyMap) { | |
this[camelCaseKey] = metric[camelCaseKey]; | |
} | |
} | |
toLkJSON() { | |
this.dateRange = this.dateRange.map(date => date.toLkDateFormat()); | |
return this.toJSONBase(jsonKeyToObjectKeyMap); | |
} | |
} | |
defineProperty_default()(MetricModel_MetricModel, "fromLkJSON", json => { | |
const model = MetricModel_MetricModel.fromJSONBase(json, jsonKeyToObjectKeyMap); | |
model.dateRange = model.dateRange.map(date => moment_default()(date)); | |
return new MetricModel_MetricModel(model); | |
}); | |
// CONCATENATED MODULE: ./src/models/WalletModel/index.js | |
const WalletModel_jsonKeyToObjectKeyMap = new Map([['cash_balance', 'cashBalance'], ['collected', 'collected'], ['deposited_this_month', 'depositedThisMonth']]); | |
class WalletModel_WalletModel extends BaseModel["a" /* BaseModel */] { | |
constructor(wallet) { | |
super(); | |
for (const [, camelCaseKey] of WalletModel_jsonKeyToObjectKeyMap) { | |
this[camelCaseKey] = wallet[camelCaseKey]; | |
} | |
} | |
get hasCashInHand() { | |
return this.cashBalance > 0; | |
} | |
toLkJSON() { | |
this.collected = this.collected.map(collected => new MetricModel_MetricModel(collected).toLkJSON()); | |
return this.toJSONBase(WalletModel_jsonKeyToObjectKeyMap); | |
} | |
} | |
defineProperty_default()(WalletModel_WalletModel, "fromLkJSON", json => { | |
const model = WalletModel_WalletModel.fromJSONBase(json, WalletModel_jsonKeyToObjectKeyMap); | |
model.collected = model.collected.map(MetricModel_MetricModel.fromLkJSON); | |
return new WalletModel_WalletModel(model); | |
}); | |
// EXTERNAL MODULE: ./node_modules/camelize/index.js | |
var camelize = __webpack_require__("654d"); | |
var camelize_default = /*#__PURE__*/__webpack_require__.n(camelize); | |
// CONCATENATED MODULE: ./src/services/UserService/constants.js | |
const DETECTORS_URL = '/api/detectors'; | |
const USERS_URL = '/api/users'; | |
const SALES_METRICS_URL = userId => `${USERS_URL}/${userId}/salesmetrics`; | |
const WALLET_URL = userId => `${USERS_URL}/${userId}/wallet`; | |
const UPDATE_STATUS_URL = userId => `${USERS_URL}/${userId}/update-status`; | |
// CONCATENATED MODULE: ./src/models/SalesMetricModel/index.js | |
class SalesMetricModel_SalesMetricModel { | |
constructor({ | |
applications = [], | |
sales = [] | |
}) { | |
defineProperty_default()(this, "applications", void 0); | |
defineProperty_default()(this, "sales", void 0); | |
this.applications = applications; | |
this.sales = sales; | |
if (this.applications[0]) { | |
this.applications[0].dateRange = this.applications[0].dateRange.map(date => moment_default()(date)); | |
this.applications[0].value = this.applications[0].metricValue; | |
} | |
if (this.applications[1]) { | |
this.applications[1].dateRange = this.applications[1].dateRange.map(date => moment_default()(date)); | |
this.applications[1].value = this.applications[1].metricValue; | |
} | |
if (this.sales[0]) { | |
this.sales[0].dateRange = this.sales[0].dateRange.map(date => moment_default()(date)); | |
this.sales[0].value = this.sales[0].metricValue; | |
} | |
if (this.sales[1]) { | |
this.sales[1].dateRange = this.sales[1].dateRange.map(date => moment_default()(date)); | |
this.sales[1].value = this.sales[1].metricValue; | |
} | |
} | |
} | |
defineProperty_default()(SalesMetricModel_SalesMetricModel, "create", salesMetricModel => new SalesMetricModel_SalesMetricModel(salesMetricModel)); | |
// EXTERNAL MODULE: ./src/services/HTTPService/index.js | |
var HTTPService = __webpack_require__("778a"); | |
// CONCATENATED MODULE: ./src/services/UserService/index.js | |
class UserService_UserService { | |
static getUserWallet(userId) { | |
return http["a" /* default */].get(WALLET_URL(userId)).then(res => WalletModel_WalletModel.fromLkJSON(res.data)); | |
} | |
static getUserSalesMetrics(userId) { | |
return http["a" /* default */].get(SALES_METRICS_URL(userId)).then(res => SalesMetricModel_SalesMetricModel.create(camelize_default()(res.data))); | |
} | |
static getUserById(userId) { | |
return HTTPService["a" /* HTTPService */].get(`${USERS_URL}/${userId}`).then(res => models["o" /* UserModel */].fromLkJSON(res.data.user)); | |
} | |
static listUsers(filters = {}, pagination = {}) { | |
const params = { | |
filters: {}, | |
options: { | |
include_count: true | |
} | |
}; | |
if (pagination && pagination.rowsPerPage > 0) { | |
params.filters.page_size = pagination.rowsPerPage; | |
params.filters.page_number = pagination.page; | |
} | |
if (filters.userIdsIn) { | |
params.filters.id__in = filters.userIdsIn; | |
} | |
if (filters.agentFullNameIContains) { | |
params.filters.full_name_icontains = filters.agentFullNameIContains; | |
} | |
if (filters.id) { | |
params.filters.id = filters.id; | |
} | |
if (filters.name) { | |
params.filters.full_name_icontains = filters.name; | |
} | |
if (filters.type) { | |
params.filters.type = filters.type; | |
} | |
if (filters.email) { | |
params.filters.email__icontains = filters.email; | |
} | |
if (filters.mobileNumberContains) { | |
params.filters.mobile_number__contains = filters.mobileNumberContains; | |
} | |
if (filters.community) { | |
params.filters.community_id = filters.community; | |
} | |
if (filters.lastLogin) { | |
params.filters.last_login__contains = filters.lastLogin; | |
} | |
if (filters.dateOfBirth) { | |
params.filters.date_of_birth = filters.dateOfBirth; | |
} | |
if (filters.isActive !== undefined) { | |
params.filters.is_deleted = !filters.isActive; | |
} | |
if (filters.typeIn) { | |
params.filters.type__in = filters.typeIn; | |
} | |
return HTTPService["a" /* HTTPService */].get(USERS_URL, { | |
params | |
}).then(res => { | |
const users = res.data.users.map(user => models["o" /* UserModel */].fromLkJSON(user)); | |
const meta = { | |
usersCount: res.data.users_count, | |
pagination: { | |
...pagination | |
} | |
}; | |
return { | |
users, | |
meta | |
}; | |
}); | |
} | |
static updateUserStatus(user, isActive) { | |
const payload = { | |
user: { | |
is_deleted: !isActive | |
} | |
}; | |
return http["a" /* default */].post(UPDATE_STATUS_URL(user.id), payload).then(res => models["o" /* UserModel */].fromLkJSON(res.data)); | |
} | |
static listFullNameContains(fullNameContains, pagination = {}) { | |
const params = { | |
filters: { | |
full_name_icontains: fullNameContains | |
}, | |
options: { | |
include_count: true | |
} | |
}; | |
return http["a" /* default */].get(USERS_URL, { | |
params | |
}).then(res => { | |
const users = res.data.users.map(user => models["o" /* UserModel */].fromLkJSON(user)); | |
const meta = { | |
usersCount: res.data.users_count, | |
pagination: { | |
...pagination | |
} | |
}; | |
return { | |
users, | |
meta | |
}; | |
}); | |
} | |
} | |
/***/ }), | |
/***/ "27fc": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return PHOTO_RESOURCE; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return PHOTO_LABEL; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PHOTO_DEFINITION; }); | |
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ce96"); | |
const PHOTO_RESOURCE = Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
CUSTOMER: 'customer', | |
POLICY: 'policy', | |
PROPERTY: 'property', | |
DEVICE: 'device' | |
}); | |
const PHOTO_LABEL = Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
POLICY_DOCUMENT: 'policy-document', | |
DEBIT_ORDER: 'debit-order', | |
DEVICE: 'device-photo', | |
CUSTOMER: 'customer-photo', | |
FRONT_DOOR_HOUSE_NUMBER: 'front-door-house-number', | |
OUTSIDE_LEFT: 'outside-left', | |
OUTSIDE_RIGHT: 'outside-right', | |
CONTENTS: 'contents-photo' | |
}); | |
const PHOTO_DEFINITION = Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
FIRE_POLICY_DOCUMENT: { | |
name: 'Fire Policy Document', | |
label: PHOTO_LABEL.POLICY_DOCUMENT, | |
resource: PHOTO_RESOURCE.POLICY | |
}, | |
FUNERAL_POLICY_DOCUMENT: { | |
name: 'Funeral Policy Document', | |
label: PHOTO_LABEL.POLICY_DOCUMENT, | |
resource: PHOTO_RESOURCE.POLICY | |
}, | |
DEBIT_ORDER: { | |
name: 'Debit Order Document', | |
label: PHOTO_LABEL.DEBIT_ORDER, | |
resource: PHOTO_RESOURCE.POLICY | |
}, | |
DEVICE: { | |
name: 'Alarm Photo', | |
label: PHOTO_LABEL.DEVICE, | |
resource: PHOTO_RESOURCE.DEVICE | |
}, | |
CUSTOMER: { | |
name: 'Customer Photo', | |
label: PHOTO_LABEL.CUSTOMER, | |
resource: PHOTO_RESOURCE.CUSTOMER | |
}, | |
FRONT_DOOR_HOUSE_NUMBER: { | |
name: 'Front Door / House Number Photo', | |
label: PHOTO_LABEL.FRONT_DOOR_HOUSE_NUMBER, | |
resource: PHOTO_RESOURCE.PROPERTY | |
}, | |
OUTSIDE_LEFT: { | |
name: 'Outside Left Photo', | |
label: PHOTO_LABEL.OUTSIDE_LEFT, | |
resource: PHOTO_RESOURCE.PROPERTY | |
}, | |
OUTSIDE_RIGHT: { | |
name: 'Outside Right Photo', | |
label: PHOTO_LABEL.OUTSIDE_RIGHT, | |
resource: PHOTO_RESOURCE.PROPERTY | |
}, | |
CONTENTS: i => ({ | |
name: `Contents Photo ${i}`, | |
label: PHOTO_LABEL.CONTENTS, | |
resource: PHOTO_RESOURCE.PROPERTY | |
}) | |
}); | |
/***/ }), | |
/***/ "2d72": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return addErrorHandlerToRouterPush; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return beforeEachHandler; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return addEnableNewFlowConfigValidatorToRoute; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return addEnableOldFlowConfigValidatorToRoute; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addEnableEditClientOMConfigValidatorToRoute; }); | |
/* harmony import */ var src_services_snackBar_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("a4b6"); | |
/* harmony import */ var _services__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("dde5"); | |
function addErrorHandlerToRouterPush(VueRouter) { | |
const handler = VueRouter.prototype.push; | |
// eslint-disable-next-line no-param-reassign | |
VueRouter.prototype.push = function push(...args) { | |
const [location, onComplete, onError = () => {}] = args; | |
// handles promise-based push | |
let flowHandler = () => handler.apply(this, [location]).catch(err => { | |
if ((err === null || err === void 0 ? void 0 : err.name) !== 'NavigationDuplicated') { | |
throw err; | |
} | |
}); | |
if (onComplete) { | |
// handles callback-based push | |
flowHandler = () => handler.apply(this, [location, onComplete, onError]); | |
} | |
return flowHandler(); | |
}; | |
} | |
const beforeEachHandler = (to, from, next) => { | |
if (to.name !== 'app.login') { | |
if (_services__WEBPACK_IMPORTED_MODULE_1__[/* AuthService */ "a"].isSessionExpired()) { | |
_services__WEBPACK_IMPORTED_MODULE_1__[/* AuthService */ "a"].logout(); | |
src_services_snackBar_service__WEBPACK_IMPORTED_MODULE_0__["error"]({ | |
message: 'Session expired. Please, log in again.' | |
}); | |
return next({ | |
name: 'app.login', | |
query: { | |
redirect: to.fullPath | |
} | |
}); | |
} | |
return next(); | |
} | |
return next(); | |
}; | |
const addEnableNewFlowConfigValidatorToRoute = routes => { | |
return routes.map(route => ({ | |
...route, | |
async beforeEnter(to, from, next) { | |
let handler = () => next('/404'); | |
await _services__WEBPACK_IMPORTED_MODULE_1__[/* AuthService */ "a"].whoAmI(); | |
if ((await _services__WEBPACK_IMPORTED_MODULE_1__[/* ConfigService */ "e"].getConfig()).enableNewFlow) { | |
handler = () => next(); | |
} | |
return handler(); | |
} | |
})); | |
}; | |
const addEnableOldFlowConfigValidatorToRoute = routes => { | |
return routes.map(route => ({ | |
...route, | |
async beforeEnter(to, from, next) { | |
let handler = () => next('/404'); | |
await _services__WEBPACK_IMPORTED_MODULE_1__[/* AuthService */ "a"].whoAmI(); | |
if ((await _services__WEBPACK_IMPORTED_MODULE_1__[/* ConfigService */ "e"].getConfig()).enableOldFlow) { | |
handler = () => next(); | |
} | |
return handler(); | |
} | |
})); | |
}; | |
const addEnableEditClientOMConfigValidatorToRoute = routes => { | |
return routes.map(route => ({ | |
...route, | |
async beforeEnter(_to, _from, next) { | |
let handler = () => next('/404'); | |
await _services__WEBPACK_IMPORTED_MODULE_1__[/* AuthService */ "a"].whoAmI(); | |
if ((await _services__WEBPACK_IMPORTED_MODULE_1__[/* ConfigService */ "e"].getConfig()).enableAccessToEditClientPageOldModel) { | |
handler = () => next(); | |
} | |
return handler(); | |
} | |
})); | |
}; | |
/***/ }), | |
/***/ "2f39": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
// ESM COMPAT FLAG | |
__webpack_require__.r(__webpack_exports__); | |
// NAMESPACE OBJECT: ./src/store/modules/services/authentication/mutations.js | |
var mutations_namespaceObject = {}; | |
__webpack_require__.r(mutations_namespaceObject); | |
__webpack_require__.d(mutations_namespaceObject, "setLoggedUser", function() { return setLoggedUser; }); | |
__webpack_require__.d(mutations_namespaceObject, "cleanLoggedUser", function() { return cleanLoggedUser; }); | |
// NAMESPACE OBJECT: ./src/store/modules/services/registerCustomerGeolocation/actions.js | |
var actions_namespaceObject = {}; | |
__webpack_require__.r(actions_namespaceObject); | |
__webpack_require__.d(actions_namespaceObject, "getCurrentGPSLocation", function() { return getCurrentGPSLocation; }); | |
__webpack_require__.d(actions_namespaceObject, "init", function() { return init; }); | |
__webpack_require__.d(actions_namespaceObject, "UpdateOrRemoveMarker", function() { return UpdateOrRemoveMarker; }); | |
__webpack_require__.d(actions_namespaceObject, "next", function() { return next; }); | |
// NAMESPACE OBJECT: ./src/store/modules/models/registerCustomer/actions.js | |
var registerCustomer_actions_namespaceObject = {}; | |
__webpack_require__.r(registerCustomer_actions_namespaceObject); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "init", function() { return registerCustomer_actions_init; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "restore", function() { return restore; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "setCustomerDetails", function() { return setCustomerDetails; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "setFireInsuranceCustomerDetails", function() { return setFireInsuranceCustomerDetails; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "setNextOfKinCustomerDetails", function() { return setNextOfKinCustomerDetails; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "setFuneralBeneficiary", function() { return setFuneralBeneficiary; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "setInsuranceLead", function() { return setInsuranceLead; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "uploadPhoto", function() { return uploadPhoto; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "upgradeFireToFireAndFuneral", function() { return upgradeFireToFireAndFuneral; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "saveCustomerData", function() { return saveCustomerData; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "updateLivesAssuredData", function() { return updateLivesAssuredData; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "uploadAll", function() { return uploadAll; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "editSpouseLifeAssured", function() { return editSpouseLifeAssured; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "setSpouseLifeAssuredAsDeleted", function() { return setSpouseLifeAssuredAsDeleted; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "removeSpouseFromLiveAssured", function() { return removeSpouseFromLiveAssured; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "appendLifeAssuredSpouse", function() { return appendLifeAssuredSpouse; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "editChildLifeAssured", function() { return editChildLifeAssured; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "removeChildFromLiveAssured", function() { return removeChildFromLiveAssured; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "setChildLifeAssuredAsDeleted", function() { return setChildLifeAssuredAsDeleted; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "appendLifeAssuredChild", function() { return appendLifeAssuredChild; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "goToNotes", function() { return goToNotes; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "goToCustomerPaymentDetailsPage", function() { return goToCustomerPaymentDetailsPage; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "paymentDetailPageNext", function() { return paymentDetailPageNext; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "setSystemAppTypeAndGoToNextPage", function() { return setSystemAppTypeAndGoToNextPage; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "scanDetectorBarcode", function() { return scanDetectorBarcode; }); | |
__webpack_require__.d(registerCustomer_actions_namespaceObject, "barcodeScannerPageGoToNext", function() { return barcodeScannerPageGoToNext; }); | |
// NAMESPACE OBJECT: ./src/store/modules/models/registerCustomer/mutations.js | |
var registerCustomer_mutations_namespaceObject = {}; | |
__webpack_require__.r(registerCustomer_mutations_namespaceObject); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "init", function() { return mutations_init; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setDetector", function() { return setDetector; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setDeviceBarcode", function() { return setDeviceBarcode; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setFrontDoorBarcode", function() { return setFrontDoorBarcode; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "updateDeviceLatitudeAndLongitudeIfBetterGPSAccuracy", function() { return updateDeviceLatitudeAndLongitudeIfBetterGPSAccuracy; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setCustomerDetails", function() { return mutations_setCustomerDetails; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setSystemAppType", function() { return setSystemAppType; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setNotes", function() { return setNotes; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setInsurancePolicyPremium", function() { return setInsurancePolicyPremium; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setInsuranceExpectedPaymentDay", function() { return setInsuranceExpectedPaymentDay; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setInsuranceReferralName", function() { return setInsuranceReferralName; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setFireInsuranceCustomerDetails", function() { return mutations_setFireInsuranceCustomerDetails; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setNextOfKinCustomerDetails", function() { return mutations_setNextOfKinCustomerDetails; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setCustomerPaymentDetails", function() { return setCustomerPaymentDetails; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setDetectorId", function() { return setDetectorId; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setFuneralBeneficiary", function() { return mutations_setFuneralBeneficiary; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setInsuranceLead", function() { return mutations_setInsuranceLead; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setClientRegistrationType", function() { return setClientRegistrationType; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setDetectorIdToUpgrade", function() { return setDetectorIdToUpgrade; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setInsurancePhoto", function() { return setInsurancePhoto; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setUpgradeFireToFireFuneralUploadStatus", function() { return setUpgradeFireToFireFuneralUploadStatus; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setCustomerDataUploadStatus", function() { return setCustomerDataUploadStatus; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setLivesAssuredDataUploadStatus", function() { return setLivesAssuredDataUploadStatus; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setIsUpdatingLivesAssuredDetectorId", function() { return setIsUpdatingLivesAssuredDetectorId; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setIsUpdatingLivesAssured", function() { return setIsUpdatingLivesAssured; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setFetchLivesAssured", function() { return setFetchLivesAssured; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "appendLifeAssuredSpouse", function() { return mutations_appendLifeAssuredSpouse; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "removeSpouseFromLiveAssured", function() { return mutations_removeSpouseFromLiveAssured; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setSpouseLifeAssuredAsDeleted", function() { return mutations_setSpouseLifeAssuredAsDeleted; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "editSpouseLifeAssured", function() { return mutations_editSpouseLifeAssured; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "appendLifeAssuredChild", function() { return mutations_appendLifeAssuredChild; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "removeChildFromLiveAssured", function() { return mutations_removeChildFromLiveAssured; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "setChildLifeAssuredAsDeleted", function() { return mutations_setChildLifeAssuredAsDeleted; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "editChildLifeAssured", function() { return mutations_editChildLifeAssured; }); | |
__webpack_require__.d(registerCustomer_mutations_namespaceObject, "resetLivesAssured", function() { return resetLivesAssured; }); | |
// NAMESPACE OBJECT: ./src/store/modules/models/registerCustomer/getters.js | |
var getters_namespaceObject = {}; | |
__webpack_require__.r(getters_namespaceObject); | |
__webpack_require__.d(getters_namespaceObject, "isUpgradeFromFireToFireFuneral", function() { return isUpgradeFromFireToFireFuneral; }); | |
__webpack_require__.d(getters_namespaceObject, "isFreeClientUpgrade", function() { return isFreeClientUpgrade; }); | |
__webpack_require__.d(getters_namespaceObject, "isDetectorReplacementProcess", function() { return isDetectorReplacementProcess; }); | |
__webpack_require__.d(getters_namespaceObject, "isRegisterNewClient", function() { return isRegisterNewClient; }); | |
__webpack_require__.d(getters_namespaceObject, "isFreeInstallation", function() { return isFreeInstallation; }); | |
__webpack_require__.d(getters_namespaceObject, "isFireFuneralClient", function() { return isFireFuneralClient; }); | |
__webpack_require__.d(getters_namespaceObject, "isDebitOrderClient", function() { return isDebitOrderClient; }); | |
__webpack_require__.d(getters_namespaceObject, "isFireClient", function() { return isFireClient; }); | |
__webpack_require__.d(getters_namespaceObject, "getPhoto", function() { return getPhoto; }); | |
__webpack_require__.d(getters_namespaceObject, "photosToTakeMap", function() { return photosToTakeMap; }); | |
// NAMESPACE OBJECT: ./src/store/modules/services/confirmCellphoneNumber/actions.js | |
var confirmCellphoneNumber_actions_namespaceObject = {}; | |
__webpack_require__.r(confirmCellphoneNumber_actions_namespaceObject); | |
__webpack_require__.d(confirmCellphoneNumber_actions_namespaceObject, "init", function() { return confirmCellphoneNumber_actions_init; }); | |
// NAMESPACE OBJECT: ./src/store/modules/services/addLives/actions.js | |
var addLives_actions_namespaceObject = {}; | |
__webpack_require__.r(addLives_actions_namespaceObject); | |
__webpack_require__.d(addLives_actions_namespaceObject, "goToAddSpousePage", function() { return goToAddSpousePage; }); | |
__webpack_require__.d(addLives_actions_namespaceObject, "goToAddChildPage", function() { return goToAddChildPage; }); | |
// NAMESPACE OBJECT: ./src/store/modules/services/addSpouse/actions.js | |
var addSpouse_actions_namespaceObject = {}; | |
__webpack_require__.r(addSpouse_actions_namespaceObject); | |
__webpack_require__.d(addSpouse_actions_namespaceObject, "processSpouseAndGoToNextPage", function() { return processSpouseAndGoToNextPage; }); | |
__webpack_require__.d(addSpouse_actions_namespaceObject, "setSpouseIndex", function() { return setSpouseIndex; }); | |
// NAMESPACE OBJECT: ./src/store/modules/services/addSpouse/mutations.js | |
var addSpouse_mutations_namespaceObject = {}; | |
__webpack_require__.r(addSpouse_mutations_namespaceObject); | |
__webpack_require__.d(addSpouse_mutations_namespaceObject, "setSpouseIndex", function() { return mutations_setSpouseIndex; }); | |
// NAMESPACE OBJECT: ./src/store/modules/services/addChild/actions.js | |
var addChild_actions_namespaceObject = {}; | |
__webpack_require__.r(addChild_actions_namespaceObject); | |
__webpack_require__.d(addChild_actions_namespaceObject, "processChildAndGoToNextPage", function() { return processChildAndGoToNextPage; }); | |
__webpack_require__.d(addChild_actions_namespaceObject, "setChildIndex", function() { return setChildIndex; }); | |
// NAMESPACE OBJECT: ./src/store/modules/services/addChild/mutations.js | |
var addChild_mutations_namespaceObject = {}; | |
__webpack_require__.r(addChild_mutations_namespaceObject); | |
__webpack_require__.d(addChild_mutations_namespaceObject, "setChildIndex", function() { return mutations_setChildIndex; }); | |
// NAMESPACE OBJECT: ./src/store/modules/services/listLivesAssured/actions.js | |
var listLivesAssured_actions_namespaceObject = {}; | |
__webpack_require__.r(listLivesAssured_actions_namespaceObject); | |
__webpack_require__.d(listLivesAssured_actions_namespaceObject, "goToBeneficiaryPage", function() { return goToBeneficiaryPage; }); | |
__webpack_require__.d(listLivesAssured_actions_namespaceObject, "goToRegisterCustomerDataUploadPage", function() { return goToRegisterCustomerDataUploadPage; }); | |
__webpack_require__.d(listLivesAssured_actions_namespaceObject, "init", function() { return listLivesAssured_actions_init; }); | |
__webpack_require__.d(listLivesAssured_actions_namespaceObject, "goToAddLivesAssuredPage", function() { return goToAddLivesAssuredPage; }); | |
__webpack_require__.d(listLivesAssured_actions_namespaceObject, "setChildIndexAndGotToAddChildPage", function() { return setChildIndexAndGotToAddChildPage; }); | |
__webpack_require__.d(listLivesAssured_actions_namespaceObject, "setSpouseIndexAndGotToAddSpousePage", function() { return setSpouseIndexAndGotToAddSpousePage; }); | |
// NAMESPACE OBJECT: ./src/store/modules/services/agentPassword/actions.js | |
var agentPassword_actions_namespaceObject = {}; | |
__webpack_require__.r(agentPassword_actions_namespaceObject); | |
__webpack_require__.d(agentPassword_actions_namespaceObject, "next", function() { return actions_next; }); | |
// NAMESPACE OBJECT: ./src/store/modules/services/frontDoorBarcodeScanner/actions.js | |
var frontDoorBarcodeScanner_actions_namespaceObject = {}; | |
__webpack_require__.r(frontDoorBarcodeScanner_actions_namespaceObject); | |
__webpack_require__.d(frontDoorBarcodeScanner_actions_namespaceObject, "scanFrontDoorBarcode", function() { return scanFrontDoorBarcode; }); | |
__webpack_require__.d(frontDoorBarcodeScanner_actions_namespaceObject, "next", function() { return frontDoorBarcodeScanner_actions_next; }); | |
// EXTERNAL MODULE: ./node_modules/@quasar/extras/material-icons/material-icons.css | |
var material_icons = __webpack_require__("e54f"); | |
// EXTERNAL MODULE: ./node_modules/@quasar/extras/ionicons-v4/ionicons-v4.css | |
var ionicons_v4 = __webpack_require__("35fc"); | |
// EXTERNAL MODULE: ./node_modules/@quasar/extras/mdi-v3/mdi-v3.css | |
var mdi_v3 = __webpack_require__("1867"); | |
// EXTERNAL MODULE: ./node_modules/@quasar/extras/fontawesome-v5/fontawesome-v5.css | |
var fontawesome_v5 = __webpack_require__("573e"); | |
// EXTERNAL MODULE: ./node_modules/quasar/dist/quasar.styl | |
var quasar = __webpack_require__("62f2"); | |
// EXTERNAL MODULE: ./src/css/app.styl | |
var css_app = __webpack_require__("7e6d"); | |
// EXTERNAL MODULE: ./node_modules/vue/dist/vue.runtime.esm.js | |
var vue_runtime_esm = __webpack_require__("2b0e"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/vue-plugin.js + 1 modules | |
var vue_plugin = __webpack_require__("b05d"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/layout/QLayout.js + 1 modules | |
var QLayout = __webpack_require__("4d5a"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/header/QHeader.js | |
var QHeader = __webpack_require__("e359"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/drawer/QDrawer.js | |
var QDrawer = __webpack_require__("9404"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/page-scroller/QPageScroller.js + 1 modules | |
var QPageScroller = __webpack_require__("5096"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/page/QPageContainer.js | |
var QPageContainer = __webpack_require__("09e3"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/page/QPage.js | |
var QPage = __webpack_require__("9989"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/toolbar/QToolbar.js | |
var QToolbar = __webpack_require__("65c6"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/toolbar/QToolbarTitle.js | |
var QToolbarTitle = __webpack_require__("6ac5"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/btn/QBtn.js | |
var QBtn = __webpack_require__("9c40"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/btn-dropdown/QBtnDropdown.js | |
var QBtnDropdown = __webpack_require__("f20b"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/icon/QIcon.js | |
var QIcon = __webpack_require__("0016"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/img/QImg.js + 1 modules | |
var QImg = __webpack_require__("068f"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/item/QList.js | |
var QList = __webpack_require__("1c1c"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/item/QItemLabel.js | |
var QItemLabel = __webpack_require__("0170"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/item/QItem.js | |
var QItem = __webpack_require__("66e5"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/item/QItemSection.js | |
var QItemSection = __webpack_require__("4074"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/input/QInput.js + 1 modules | |
var QInput = __webpack_require__("27f9"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/field/QField.js + 2 modules | |
var QField = __webpack_require__("8572"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/checkbox/QCheckbox.js | |
var QCheckbox = __webpack_require__("8f8e"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/radio/QRadio.js | |
var QRadio = __webpack_require__("3786"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/date/QDate.js | |
var QDate = __webpack_require__("52ee"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/time/QTime.js | |
var QTime = __webpack_require__("ca78"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/select/QSelect.js | |
var QSelect = __webpack_require__("ddd8"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/separator/QSeparator.js | |
var QSeparator = __webpack_require__("eb85"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/card/QCard.js | |
var QCard = __webpack_require__("f09f"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/card/QCardSection.js | |
var QCardSection = __webpack_require__("a370"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/card/QCardActions.js | |
var QCardActions = __webpack_require__("4b7e"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/table/QTable.js + 15 modules | |
var QTable = __webpack_require__("eaac"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/table/QTh.js | |
var QTh = __webpack_require__("357e"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/table/QTr.js | |
var QTr = __webpack_require__("bd08"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/table/QTd.js | |
var QTd = __webpack_require__("db86"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/toggle/QToggle.js | |
var QToggle = __webpack_require__("9564"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/linear-progress/QLinearProgress.js | |
var QLinearProgress = __webpack_require__("6b1d"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/tabs/QTabs.js | |
var QTabs = __webpack_require__("429b"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/badge/QBadge.js | |
var QBadge = __webpack_require__("58a8"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/tabs/QTab.js | |
var QTab = __webpack_require__("7460"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/tab-panels/QTabPanels.js | |
var QTabPanels = __webpack_require__("adad"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/popup-proxy/QPopupProxy.js | |
var QPopupProxy = __webpack_require__("7cbe"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/dialog/QDialog.js | |
var QDialog = __webpack_require__("24e8"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/avatar/QAvatar.js | |
var QAvatar = __webpack_require__("cb32"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/inner-loading/QInnerLoading.js | |
var QInnerLoading = __webpack_require__("74f7"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/spinner/QSpinner.js | |
var QSpinner = __webpack_require__("0d59"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/spinner/QSpinnerDots.js | |
var QSpinnerDots = __webpack_require__("8380"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/expansion-item/QExpansionItem.js + 1 modules | |
var QExpansionItem = __webpack_require__("3b73"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/carousel/QCarousel.js | |
var QCarousel = __webpack_require__("880c"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/carousel/QCarouselControl.js | |
var QCarouselControl = __webpack_require__("32a7"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/carousel/QCarouselSlide.js | |
var QCarouselSlide = __webpack_require__("62cd"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/uploader/QUploader.js + 3 modules | |
var QUploader = __webpack_require__("ee89"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/uploader/QUploaderAddTrigger.js | |
var QUploaderAddTrigger = __webpack_require__("cc04"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/skeleton/QSkeleton.js | |
var QSkeleton = __webpack_require__("293e"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/tooltip/QTooltip.js | |
var QTooltip = __webpack_require__("05c0"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/components/option-group/QOptionGroup.js | |
var QOptionGroup = __webpack_require__("9f0a"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/directives/Ripple.js + 1 modules | |
var Ripple = __webpack_require__("714f"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/directives/ClosePopup.js | |
var ClosePopup = __webpack_require__("7f67"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/directives/TouchSwipe.js | |
var TouchSwipe = __webpack_require__("12c5"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/plugins/Notify.js | |
var Notify = __webpack_require__("2a19"); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/plugins/Loading.js | |
var Loading = __webpack_require__("f508"); | |
// CONCATENATED MODULE: ./.quasar/import-quasar.js | |
/** | |
* THIS FILE IS GENERATED AUTOMATICALLY. | |
* DO NOT EDIT. | |
* | |
* You are probably looking on adding startup/initialization code. | |
* Use "quasar new boot <name>" and add it there. | |
* One boot file per concern. Then reference the file(s) in quasar.conf.js > boot: | |
* boot: ['file', ...] // do not add ".js" extension to it. | |
* | |
* Boot files are your "main.js" | |
**/ | |
; | |
vue_runtime_esm["a" /* default */].use(vue_plugin["a" /* default */], { | |
config: {}, | |
components: { | |
QLayout: QLayout["a" /* default */], | |
QHeader: QHeader["a" /* default */], | |
QDrawer: QDrawer["a" /* default */], | |
QPageScroller: QPageScroller["a" /* default */], | |
QPageContainer: QPageContainer["a" /* default */], | |
QPage: QPage["a" /* default */], | |
QToolbar: QToolbar["a" /* default */], | |
QToolbarTitle: QToolbarTitle["a" /* default */], | |
QBtn: QBtn["a" /* default */], | |
QBtnDropdown: QBtnDropdown["a" /* default */], | |
QIcon: QIcon["a" /* default */], | |
QImg: QImg["a" /* default */], | |
QList: QList["a" /* default */], | |
QItemLabel: QItemLabel["a" /* default */], | |
QItem: QItem["a" /* default */], | |
QItemSection: QItemSection["a" /* default */], | |
QInput: QInput["a" /* default */], | |
QField: QField["a" /* default */], | |
QCheckbox: QCheckbox["a" /* default */], | |
QRadio: QRadio["a" /* default */], | |
QDate: QDate["a" /* default */], | |
QTime: QTime["a" /* default */], | |
QSelect: QSelect["a" /* default */], | |
QSeparator: QSeparator["a" /* default */], | |
QCard: QCard["a" /* default */], | |
QCardSection: QCardSection["a" /* default */], | |
QCardActions: QCardActions["a" /* default */], | |
QTable: QTable["a" /* default */], | |
QTh: QTh["a" /* default */], | |
QTr: QTr["a" /* default */], | |
QTd: QTd["a" /* default */], | |
QToggle: QToggle["a" /* default */], | |
QLinearProgress: QLinearProgress["a" /* default */], | |
QTabs: QTabs["a" /* default */], | |
QBadge: QBadge["a" /* default */], | |
QTab: QTab["a" /* default */], | |
QTabPanels: QTabPanels["a" /* default */], | |
QPopupProxy: QPopupProxy["a" /* default */], | |
QDialog: QDialog["a" /* default */], | |
QAvatar: QAvatar["a" /* default */], | |
QInnerLoading: QInnerLoading["a" /* default */], | |
QSpinner: QSpinner["a" /* default */], | |
QSpinnerDots: QSpinnerDots["a" /* default */], | |
QExpansionItem: QExpansionItem["a" /* default */], | |
QCarousel: QCarousel["a" /* default */], | |
QCarouselControl: QCarouselControl["a" /* default */], | |
QCarouselSlide: QCarouselSlide["a" /* default */], | |
QUploader: QUploader["a" /* default */], | |
QUploaderAddTrigger: QUploaderAddTrigger["a" /* default */], | |
QSkeleton: QSkeleton["a" /* default */], | |
QTooltip: QTooltip["a" /* default */], | |
QOptionGroup: QOptionGroup["a" /* default */] | |
}, | |
directives: { | |
Ripple: Ripple["a" /* default */], | |
ClosePopup: ClosePopup["a" /* default */], | |
TouchSwipe: TouchSwipe["a" /* default */] | |
}, | |
plugins: { | |
Notify: Notify["a" /* default */], | |
Loading: Loading["a" /* default */] | |
} | |
}); | |
// CONCATENATED MODULE: ./node_modules/@quasar/app/lib/webpack/loader.transform-quasar-imports.js!./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--7!./node_modules/@quasar/app/lib/webpack/loader.auto-import-client.js?kebab!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=template&id=561eaa39& | |
var render = function render() { | |
var _vm = this, | |
_c = _vm._self._c; | |
return _c('div', { | |
attrs: { | |
"id": "q-app" | |
} | |
}, [_c('router-view')], 1); | |
}; | |
var staticRenderFns = []; | |
// CONCATENATED MODULE: ./src/App.vue?vue&type=template&id=561eaa39& | |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js | |
var defineProperty = __webpack_require__("9523"); | |
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty); | |
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js | |
var es_array_push = __webpack_require__("14d9"); | |
// EXTERNAL MODULE: ./src/helpers/state-helper.js | |
var state_helper = __webpack_require__("cc5d"); | |
// EXTERNAL MODULE: ./src/services/index.js + 15 modules | |
var services = __webpack_require__("dde5"); | |
// EXTERNAL MODULE: ./src/pages/RegisterClient/Store/store.js | |
var Store_store = __webpack_require__("8c1a"); | |
// EXTERNAL MODULE: ./src/pages/HardwareInstallation/store.js | |
var HardwareInstallation_store = __webpack_require__("a2f2"); | |
// CONCATENATED MODULE: ./src/stores-manager.js | |
const storesToPersistHydrate = [Store_store["b" /* registerClientStoreService */], HardwareInstallation_store["b" /* hardwareInstallationStoreService */]]; | |
const persistStores = () => storesToPersistHydrate.forEach(store => store.persistStore()); | |
const hydrateStores = () => storesToPersistHydrate.forEach(store => store.hydrateStore()); | |
// EXTERNAL MODULE: ./src/helpers/index.js | |
var helpers = __webpack_require__("ce96"); | |
// CONCATENATED MODULE: ./src/model.js | |
Object(helpers["f" /* swapPrimaryAndSecondaryColorsIfQA */])("DEV"); | |
const LOW_MEMORY_WARNING_MESSAGE = 'Lumkani App temporarily interrupted, all changes are saved. ' + 'Please minimise this app, close other open apps on your phone and make sure your phone is properly charged.'; | |
class AppViewModel {} | |
defineProperty_default()(AppViewModel, "data", () => ({ | |
showDialog: false | |
})); | |
defineProperty_default()(AppViewModel, "methods", { | |
// TODO: Kill this once old reg flow is removed | |
onPause: vm => { | |
return state_helper["b" /* stateHelper */].saveFullState(vm.$store.state); | |
}, | |
// TODO: Kill this once old reg flow is removed | |
onResume: async vm => { | |
return vm.$store.commit('registerCustomerModel/init', await state_helper["b" /* stateHelper */].registerCustomerModelState()); | |
} | |
}); | |
defineProperty_default()(AppViewModel, "events", { | |
document: { | |
pause: async vm => { | |
state_helper["a" /* routeManager */].saveLastSavedRoute(vm.$route.fullPath); | |
await vm.onPause(); | |
await persistStores(); | |
}, | |
resume: async (vm, event) => { | |
/* | |
* pendingResult api documentation | |
* https://cordova.apache.org/docs/en/10.x/guide/platforms/android/#retrieving-plugin-callback-results-cordova-android-510 | |
* */ | |
if (event.pendingResult) { | |
await AppViewModel.methods.onResume(vm); | |
await hydrateStores(); | |
await vm.$router.push(state_helper["a" /* routeManager */].lastSavedRoute); | |
vm.$snackbar.asBanner({ | |
message: LOW_MEMORY_WARNING_MESSAGE | |
}); | |
await services["a" /* AuthService */].whoAmI(); | |
throw Error('Low Memory: App Restarted'); | |
} | |
} | |
} | |
}); | |
// CONCATENATED MODULE: ./node_modules/@quasar/app/lib/webpack/loader.transform-quasar-imports.js!./node_modules/babel-loader/lib??ref--2-0!./node_modules/@quasar/app/lib/webpack/loader.auto-import-client.js?kebab!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=script&lang=js& | |
/* harmony default export */ var Appvue_type_script_lang_js_ = ({ | |
name: 'App', | |
ViewModel: AppViewModel | |
}); | |
// CONCATENATED MODULE: ./src/App.vue?vue&type=script&lang=js& | |
/* harmony default export */ var src_Appvue_type_script_lang_js_ = (Appvue_type_script_lang_js_); | |
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js | |
var componentNormalizer = __webpack_require__("2877"); | |
// CONCATENATED MODULE: ./src/App.vue | |
/* normalize component */ | |
var component = Object(componentNormalizer["a" /* default */])( | |
src_Appvue_type_script_lang_js_, | |
render, | |
staticRenderFns, | |
false, | |
null, | |
null, | |
null | |
) | |
/* harmony default export */ var App = (component.exports); | |
// EXTERNAL MODULE: ./node_modules/vuex/dist/vuex.esm.js | |
var vuex_esm = __webpack_require__("2f62"); | |
// CONCATENATED MODULE: ./src/store/modules/services/authentication/state.js | |
const initialState = () => ({ | |
logged_user: undefined | |
}); | |
const state_state = initialState(); | |
// CONCATENATED MODULE: ./src/store/modules/services/authentication/mutations.js | |
const setLoggedUser = (state, user) => { | |
state.logged_user = user; | |
}; | |
const cleanLoggedUser = state => { | |
state.logged_user = null; | |
}; | |
// CONCATENATED MODULE: ./src/store/modules/services/authentication/index.js | |
/* harmony default export */ var authentication = ({ | |
namespaced: true, | |
state: state_state, | |
mutations: mutations_namespaceObject | |
}); | |
// EXTERNAL MODULE: ./node_modules/vue-router/dist/vue-router.esm.js | |
var vue_router_esm = __webpack_require__("8c4f"); | |
// EXTERNAL MODULE: ./src/helpers/navigation.js | |
var navigation = __webpack_require__("ddff"); | |
// EXTERNAL MODULE: ./src/pages/HardwareInstallation/routes.js | |
var routes = __webpack_require__("1645"); | |
// EXTERNAL MODULE: ./src/pages/RegisterClient/routes.js | |
var RegisterClient_routes = __webpack_require__("144a"); | |
// EXTERNAL MODULE: ./src/router/helpers.js | |
var router_helpers = __webpack_require__("2d72"); | |
// CONCATENATED MODULE: ./src/router/routes.js | |
const routes_routes = [{ | |
path: '/login', | |
component: () => __webpack_require__.e(/* import() */ 19).then(__webpack_require__.bind(null, "7240")), | |
children: [{ | |
path: '', | |
name: 'app.login', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(68)]).then(__webpack_require__.bind(null, "e0f6")) | |
}] | |
}, { | |
path: '/404', | |
component: () => __webpack_require__.e(/* import() */ 2).then(__webpack_require__.bind(null, "e51e")) | |
}, { | |
path: '/', | |
redirect: '/home', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(1), __webpack_require__.e(20)]).then(__webpack_require__.bind(null, "79b7")), | |
children: [...RegisterClient_routes["a" /* REGISTER_CLIENT_ROUTES */], ...routes["a" /* HARDWARE_INSTALLATION_ROUTES */], { | |
path: '/home', | |
name: 'app.home', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(63)]).then(__webpack_require__.bind(null, "29db")) | |
}, { | |
path: '/policies/:policyId/', | |
name: 'app.policies', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(32)]).then(__webpack_require__.bind(null, "cfe5")) | |
}, { | |
path: '/policies/:policyId/edit', | |
name: 'app.policiesEdit', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(31)]).then(__webpack_require__.bind(null, "5596")) | |
}, | |
// TODO: /clients/v2/ will be renamed to /clients once legacy view client is killed | |
{ | |
path: '/clients/v2/:clientId/', | |
name: 'app.viewClients', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(25)]).then(__webpack_require__.bind(null, "6239")) | |
}, { | |
path: '/clients/v2/:clientId/edit', | |
name: 'app.viewClientsEdit', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(24)]).then(__webpack_require__.bind(null, "f408")) | |
}, { | |
path: '/sms', | |
name: 'app.sms', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(1), __webpack_require__.e(51)]).then(__webpack_require__.bind(null, "142b")) | |
}, ...Object(router_helpers["c" /* addEnableOldFlowConfigValidatorToRoute */])([{ | |
path: '/registercustomer/geolocation', | |
name: 'app.geolocation', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(74)]).then(__webpack_require__.bind(null, "5548")) | |
}, { | |
path: '/registercustomer/barcodescanner', | |
name: 'app.barcodeScanner', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(56)]).then(__webpack_require__.bind(null, "786f")) | |
}, { | |
path: '/registercustomer/customerdetails', | |
name: 'app.customerDetails', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(73)]).then(__webpack_require__.bind(null, "fff9")) | |
}, { | |
path: '/registercustomer/installinstructions', | |
name: 'app.installInstructions', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(12)]).then(__webpack_require__.bind(null, "b6a6")) | |
}, { | |
path: '/registercustomer/installorinsurance', | |
name: 'app.installOrInsurance', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(65)]).then(__webpack_require__.bind(null, "5e15")) | |
}, { | |
path: '/registercustomer/notes', | |
name: 'app.notesRegisterCustomer', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(75)]).then(__webpack_require__.bind(null, "a0a3")) | |
}, { | |
path: '/registercustomer/referralinformation', | |
name: 'app.referralInformation', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(71)]).then(__webpack_require__.bind(null, "2864")) | |
}, { | |
path: '/registercustomer/insurancelead', | |
name: 'app.insuranceLead', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(66)]).then(__webpack_require__.bind(null, "3b22")) | |
}, { | |
path: '/registercustomer/nextofkindetails', | |
name: 'app.nextOfKinDetails', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(69)]).then(__webpack_require__.bind(null, "a3fe")) | |
}, { | |
path: '/registercustomer/householdphotos', | |
name: 'app.householdPhotos', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(64)]).then(__webpack_require__.bind(null, "2174")) | |
}, { | |
path: '/registercustomer/customerdetailspayment', | |
name: 'app.customerDetailsPayment', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(60)]).then(__webpack_require__.bind(null, "a0f0")) | |
}, { | |
path: '/registercustomer/policytype', | |
name: 'app.policyType', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(70)]).then(__webpack_require__.bind(null, "5501")) | |
}, { | |
path: '/registercustomer/fireinsurancecustomerdetails', | |
name: 'app.fireInsuranceCustomerDetails', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(61)]).then(__webpack_require__.bind(null, "6200")) | |
}, { | |
path: '/registercustomer/dataupload', | |
name: 'app.registerCustomerDataUpload', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(72)]).then(__webpack_require__.bind(null, "6006")) | |
}, { | |
path: '/registercustomer/addlives', | |
name: 'app.addLives', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(52)]).then(__webpack_require__.bind(null, "077a")) | |
}, { | |
path: '/registercustomer/addspouse', | |
name: 'app.addSpouse', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(54)]).then(__webpack_require__.bind(null, "53dc")) | |
}, { | |
path: '/registercustomer/addchild', | |
name: 'app.addChild', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(53)]).then(__webpack_require__.bind(null, "f7ec")) | |
}, { | |
path: '/registercustomer/beneficiarydetails', | |
name: 'app.beneficiaryDetails', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(57)]).then(__webpack_require__.bind(null, "98b6")) | |
}, { | |
path: '/registercustomer/listlivesassured', | |
name: 'app.listLivesAssured', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(5)]).then(__webpack_require__.bind(null, "b0aa")) | |
}, { | |
path: '/registercustomer/frontdoorbarcodescanner', | |
name: 'app.frontDoorBarcodeScanner', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(62)]).then(__webpack_require__.bind(null, "2abb")) | |
}]), { | |
path: '/clientmanagement', | |
name: 'app.clientManagement', | |
component: () => __webpack_require__.e(/* import() */ 23).then(__webpack_require__.bind(null, "38d3")) | |
}, { | |
path: '/confirmcellphonenumber/:clientId', | |
name: 'app.confirmCellphoneNumber', | |
component: () => __webpack_require__.e(/* import() */ 26).then(__webpack_require__.bind(null, "8ba9")), | |
props: true | |
}, { | |
path: '/viewclient/:clientId', | |
name: 'app.viewClient', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(80)]).then(__webpack_require__.bind(null, "d402")), | |
props: true | |
}, { | |
path: '/agentpassword', | |
name: 'app.agentPassword', | |
component: () => __webpack_require__.e(/* import() */ 22).then(__webpack_require__.bind(null, "2599")) | |
}, { | |
path: '/updateclientinfo/:clientId', | |
name: 'app.updateClientInfo', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(79)]).then(__webpack_require__.bind(null, "2e0d")), | |
props: true | |
}, { | |
path: '/clients/:clientId/funeral-beneficiaries/:beneficiaryId/edit', | |
name: 'app.updateBeneficiaryInfo', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(78)]).then(__webpack_require__.bind(null, "bc3b")) | |
}, { | |
path: '/childcoverageinfo', | |
name: 'app.childCoverageInfo', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(58)]).then(__webpack_require__.bind(null, "895e")) | |
}, { | |
path: '/agentInstallationDashboard', | |
name: 'app.agentInstallationDashboard', | |
component: () => __webpack_require__.e(/* import() */ 21).then(__webpack_require__.bind(null, "eb2f")) | |
}, { | |
path: '/agent-dashboard', | |
name: 'app.agentDashboard', | |
component: () => __webpack_require__.e(/* import() */ 55).then(__webpack_require__.bind(null, "eb56")) | |
}, { | |
path: '/validations/geolocation', | |
name: 'validations.geolocation', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(77)]).then(__webpack_require__.bind(null, "7aa9")) | |
}, { | |
path: '/payments/:id/edit', | |
name: 'app.paymentEditStatus', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(11)]).then(__webpack_require__.bind(null, "6587")) | |
}, { | |
path: '/payments', | |
name: 'app.listOfPayments', | |
beforeEnter: navigation["b" /* requiresAdminUser */], | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(14)]).then(__webpack_require__.bind(null, "e190")) | |
}, { | |
path: '/payments/create', | |
name: 'app.createPayment', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(10)]).then(__webpack_require__.bind(null, "e8c8")) | |
}, { | |
path: '/transactions/:id/edit', | |
name: 'app.updateTransaction', | |
beforeEnter: navigation["b" /* requiresAdminUser */], | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(17)]).then(__webpack_require__.bind(null, "2c37")) | |
}, { | |
path: '/transactions', | |
name: 'app.transactions', | |
beforeEnter: navigation["b" /* requiresAdminUser */], | |
component: () => __webpack_require__.e(/* import() */ 18).then(__webpack_require__.bind(null, "5dde")) | |
}, { | |
path: '/reports', | |
name: 'app.reports', | |
component: () => __webpack_require__.e(/* import() */ 76).then(__webpack_require__.bind(null, "1597")) | |
}, { | |
path: '/clients', | |
name: 'app.listOfClients', | |
beforeEnter: navigation["b" /* requiresAdminUser */], | |
component: () => Promise.all(/* import() */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(13)]).then(__webpack_require__.bind(null, "0139")) | |
}, { | |
path: '/users', | |
name: 'app.listOfUsers', | |
beforeEnter: navigation["b" /* requiresAdminUser */], | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(15)]).then(__webpack_require__.bind(null, "3355")) | |
}, { | |
path: '/users/:userId', | |
name: 'app.viewUser', | |
beforeEnter: navigation["b" /* requiresAdminUser */], | |
component: () => __webpack_require__.e(/* import() */ 16).then(__webpack_require__.bind(null, "35ce")) | |
}, { | |
path: '/clients/:id', | |
name: 'app.viewClientDetails', | |
beforeEnter: navigation["b" /* requiresAdminUser */], | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(7)]).then(__webpack_require__.bind(null, "4777")) | |
}, ...Object(router_helpers["a" /* addEnableEditClientOMConfigValidatorToRoute */])([{ | |
path: '/clients/:clientId/edit', | |
name: 'app.editClient', | |
beforeEnter: navigation["b" /* requiresAdminUser */], | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(59)]).then(__webpack_require__.bind(null, "e819")) | |
}]), { | |
path: '/clients/:clientId/edit/photos', | |
name: 'app.editClientPhotos', | |
beforeEnter: navigation["b" /* requiresAdminUser */], | |
component: () => __webpack_require__.e(/* import() */ 9).then(__webpack_require__.bind(null, "f17e")) | |
}, { | |
path: '/clients/:clientId/edit/livesassured', | |
name: 'app.clientsEditListLivesAssured', | |
beforeEnter: navigation["b" /* requiresAdminUser */], | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(5)]).then(__webpack_require__.bind(null, "b0aa")) | |
}, { | |
path: '/internal/software/clients', | |
name: 'validations.theInteralSoftwareClients', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(67)]).then(__webpack_require__.bind(null, "b2eb")) | |
}, { | |
path: '/hardware-installation/', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(4)]).then(__webpack_require__.bind(null, "0b9a")) | |
}, { | |
path: '/hardware-installation/data-upload', | |
component: () => Promise.all(/* import() */[__webpack_require__.e(0), __webpack_require__.e(3)]).then(__webpack_require__.bind(null, "807f")) | |
}] | |
}]; | |
// Always leave this as last one | |
if (true) { | |
routes_routes.push({ | |
path: '*', | |
component: () => __webpack_require__.e(/* import() */ 2).then(__webpack_require__.bind(null, "e51e")) | |
}); | |
} | |
/* harmony default export */ var router_routes = (routes_routes); | |
// CONCATENATED MODULE: ./src/router/index.js | |
Object(router_helpers["d" /* addErrorHandlerToRouterPush */])(vue_router_esm["a" /* default */]); | |
vue_runtime_esm["a" /* default */].use(vue_router_esm["a" /* default */]); | |
const Router = new vue_router_esm["a" /* default */]({ | |
scrollBehavior: () => ({ | |
y: 0 | |
}), | |
routes: router_routes, | |
// Leave these as is and change from quasar.conf.js instead! | |
// quasar.conf.js -> build -> vueRouterMode | |
mode: "hash", | |
base: "" | |
}); | |
// Login interceptor | |
Router.beforeEach(router_helpers["e" /* beforeEachHandler */]); | |
/* harmony default export */ var src_router = (Router); | |
// EXTERNAL MODULE: ./src/helpers/constants.js | |
var constants = __webpack_require__("5b55"); | |
// EXTERNAL MODULE: ./src/helpers/lumkani.js | |
var lumkani = __webpack_require__("b7be"); | |
// EXTERNAL MODULE: ./src/services/loading.service.js | |
var loading_service = __webpack_require__("35d8"); | |
// EXTERNAL MODULE: ./src/services/snackBar.service.js | |
var snackBar_service = __webpack_require__("a4b6"); | |
// EXTERNAL MODULE: ./src/hardware/geolocationPwa.js | |
var geolocationPwa = __webpack_require__("af82"); | |
// EXTERNAL MODULE: ./src/helpers/promise.js | |
var promise = __webpack_require__("9d41"); | |
// CONCATENATED MODULE: ./src/store/modules/services/registerCustomerGeolocation/actions.js | |
function hasValidGpsLocation({ | |
registerCustomerModel: { | |
device | |
} | |
}) { | |
return device.location_gps_latitude !== null && device.location_gps_longitude !== null; | |
} | |
function updateGoogleMapsMarker(rootState, dispatch) { | |
const mapMarker = { | |
location: { | |
latitude: rootState.registerCustomerModel.device.location_gps_latitude, | |
longitude: rootState.registerCustomerModel.device.location_gps_longitude | |
} | |
}; | |
if (rootState.registerCustomerModel.device.location_gps_accuracy) { | |
mapMarker.title = `Coordinate Accuracy (meters): ${rootState.registerCustomerModel.device.location_gps_accuracy}`; | |
} | |
dispatch('googleMapsService/setAndDrawMapMarker', mapMarker, { | |
root: true | |
}); | |
} | |
const getCurrentGPSLocation = async ({ | |
commit, | |
dispatch, | |
rootState | |
}) => { | |
let gpsReading = null; | |
try { | |
for (let i = 1; i <= constants["y" /* MAX_NUM_GPS_READING_ATTEMPTS */]; i++) { | |
if (!gpsReading || i !== constants["y" /* MAX_NUM_GPS_READING_ATTEMPTS */] || gpsReading.accuracy > constants["n" /* GPS_ACCURACY_THRESHOLD_FOR_GPS_ACCEPTANCE */]) { | |
loading_service["show"]({ | |
message: `Loading GPS Location... ${i} out of 3` | |
}); | |
gpsReading = await Object(promise["b" /* withTimeout */])(geolocationPwa["a" /* startGettingCurrentLocation */](), constants["p" /* GPS_TIMEOUT_MS */], constants["o" /* GPS_MESSAGES */].TIMEOUT); | |
commit('registerCustomerModel/updateDeviceLatitudeAndLongitudeIfBetterGPSAccuracy', gpsReading, { | |
root: true | |
}); | |
} | |
} | |
snackBar_service["success"]({ | |
message: constants["o" /* GPS_MESSAGES */].SUCCESSFULLY_FOUND | |
}); | |
return gpsReading; | |
} catch (error) { | |
const message = lumkani["a" /* default */].parseErrorMessage(error); | |
snackBar_service["error"]({ | |
message | |
}); | |
} finally { | |
try { | |
await geolocationPwa["b" /* stopGettingCurrentLocation */](); | |
} catch (error) { | |
const message = lumkani["a" /* default */].parseErrorMessage(error); | |
snackBar_service["error"]({ | |
message | |
}); | |
} finally { | |
if (hasValidGpsLocation(rootState)) { | |
updateGoogleMapsMarker(rootState, dispatch); | |
} | |
loading_service["hide"](); | |
} | |
} | |
}; | |
const init = ({ | |
dispatch | |
}, params) => { | |
const options = { | |
initialMapMarker: { | |
location: constants["l" /* GOOGLE_MAPS_INITIAL_GPS_LOCATION_JHB */] | |
}, | |
mapsZoomLevel: constants["m" /* GOOGLE_MAPS_ZOOM_LEVEL */], | |
mapHtmlElement: params.googleMapsHtmlElement | |
}; | |
if (params.initialMapMarker) { | |
options.initialMapMarker = params.initialMapMarker; | |
} | |
dispatch('googleMapsService/init', options, { | |
root: true | |
}); | |
}; | |
const UpdateOrRemoveMarker = ({ | |
rootState, | |
dispatch | |
}) => { | |
if (!hasValidGpsLocation(rootState)) { | |
dispatch('googleMapsService/removeMarker', null, { | |
root: true | |
}); | |
} else { | |
updateGoogleMapsMarker(rootState, dispatch); | |
} | |
}; | |
const next = ({ | |
rootState, | |
rootGetters | |
}) => { | |
if (hasValidGpsLocation(rootState)) { | |
const gpsAccuracy = rootState.registerCustomerModel.device.location_gps_accuracy; | |
if (!!gpsAccuracy && gpsAccuracy <= constants["v" /* MAXIMUM_GPS_ACCURACY_ACCEPTED */]) { | |
if (rootGetters['registerCustomerModel/isDetectorReplacementProcess']) { | |
src_router.push({ | |
name: 'app.householdPhotos' | |
}); | |
} else { | |
src_router.push({ | |
name: 'app.customerDetails' | |
}); | |
} | |
} else { | |
const message = constants["o" /* GPS_MESSAGES */].ACCURACY_IS_TOO_HIGH; | |
snackBar_service["error"]({ | |
message | |
}); | |
} | |
} else { | |
const message = constants["o" /* GPS_MESSAGES */].INVALID_COORDINATES; | |
snackBar_service["error"]({ | |
message | |
}); | |
} | |
}; | |
// CONCATENATED MODULE: ./src/store/modules/services/registerCustomerGeolocation/index.js | |
/* harmony default export */ var registerCustomerGeolocation = ({ | |
namespaced: true, | |
actions: actions_namespaceObject | |
}); | |
// CONCATENATED MODULE: ./src/store/modules/services/googleMaps/state.js | |
const googleMaps_state_state = { | |
mapMarker: { | |
location: null, | |
title: '' | |
} | |
}; | |
/* harmony default export */ var googleMaps_state = (googleMaps_state_state); | |
// CONCATENATED MODULE: ./src/store/modules/services/googleMaps/mutations.js | |
function setMapMarker(state, newMapMarker) { | |
state.mapMarker = newMapMarker; | |
} | |
const mutations_mutations = { | |
setMapMarker | |
}; | |
/* harmony default export */ var googleMaps_mutations = (mutations_mutations); | |
// EXTERNAL MODULE: ./node_modules/google-maps/lib/Google.js | |
var Google = __webpack_require__("2ee3"); | |
var Google_default = /*#__PURE__*/__webpack_require__.n(Google); | |
// CONCATENATED MODULE: ./src/store/modules/services/googleMaps/actions.js | |
const API_KEY = 'AIzaSyAw2nxEkcy0IEF5u2u21GnM53fnpj0wHj8'; | |
const GOOGLE_MAPS_VERSION = '3.37'; | |
let drawMapMarker; | |
let MapsObject; | |
let marker = null; | |
function convertLatitudeLongitudeToLatLng(location) { | |
return { | |
lat: location.latitude, | |
lng: location.longitude | |
}; | |
} | |
function setAndDrawMapMarker({ | |
commit | |
}, mapMarker) { | |
const newMapMarker = { | |
location: convertLatitudeLongitudeToLatLng(mapMarker.location) | |
}; | |
if (mapMarker.title) { | |
newMapMarker.title = mapMarker.title; | |
} | |
commit('setMapMarker', newMapMarker); | |
drawMapMarker(MapsObject); | |
} | |
function removeMarker() { | |
if (marker != null) { | |
marker.setMap(null); | |
} | |
} | |
function drawMapMarkerFunctionGenerator(state) { | |
return map => { | |
const markerProperties = { | |
position: state.mapMarker.location | |
}; | |
if (state.mapMarker.title) { | |
markerProperties.title = state.mapMarker.title; | |
} | |
const latLng = new google.maps.LatLng(state.mapMarker.location.lat, state.mapMarker.location.lng); | |
map.setCenter(latLng); | |
removeMarker(); | |
marker = new google.maps.Marker({ | |
position: state.mapMarker.location, | |
map | |
}); | |
}; | |
} | |
function actions_init({ | |
commit, | |
state | |
}, options) { | |
drawMapMarker = drawMapMarkerFunctionGenerator(state); | |
const initialMapMarkers = { | |
location: convertLatitudeLongitudeToLatLng(options.initialMapMarker.location) | |
}; | |
if (options.initialMapMarker.title) { | |
initialMapMarkers.title = options.initialMapMarker.title; | |
} | |
commit('setMapMarker', initialMapMarkers); | |
const googleMapsCameraConfig = { | |
center: state.mapMarker.location, | |
zoom: options.mapsZoomLevel, | |
scrollwheel: false, | |
scaleControl: false, | |
fullscreenControl: false, | |
zoomControl: false, | |
mapTypeControl: false, | |
streetViewControl: false | |
}; | |
Google_default.a.VERSION = GOOGLE_MAPS_VERSION; | |
Google_default.a.KEY = API_KEY; | |
Google_default.a.load(google => { | |
const mapElement = options.mapHtmlElement; | |
MapsObject = new google.maps.Map(mapElement, googleMapsCameraConfig); | |
}); | |
} | |
const actions_actions = { | |
init: actions_init, | |
setAndDrawMapMarker, | |
removeMarker | |
}; | |
/* harmony default export */ var googleMaps_actions = (actions_actions); | |
// CONCATENATED MODULE: ./src/store/modules/services/googleMaps/index.js | |
/* harmony default export */ var googleMaps = ({ | |
namespaced: true, | |
state: googleMaps_state, | |
mutations: googleMaps_mutations, | |
actions: googleMaps_actions | |
}); | |
// CONCATENATED MODULE: ./src/store/modules/models/registerCustomer/state.js | |
const state_initialState = () => ({ | |
client_registration_type: null, | |
upgrade_fire_to_fire_funeral_upload_status: constants["M" /* UPLOAD_STATUS */].PENDING, | |
upgrade_fire_to_fire_funeral: { | |
detector_id: null | |
}, | |
updateLivesAssured: { | |
isUpdatingLivesAssured: false, | |
detector_id: null, | |
fetchLivesAssured: false, | |
livesAssuredDataUploadStatus: constants["M" /* UPLOAD_STATUS */].PENDING | |
}, | |
customer_data_upload_status: constants["M" /* UPLOAD_STATUS */].PENDING, | |
device: { | |
device_barcode: null, | |
front_door_barcode: null, | |
location_gps_latitude: null, | |
location_gps_longitude: null, | |
location_gps_accuracy: null, | |
customer_first_name: null, | |
customer_last_name: null, | |
location_name: null, | |
location_number_rooms: null, | |
house_occupants_number: null, | |
location_house_number: null, | |
customer_mobile_number: null, | |
system_app_type: null, | |
insurance_policy_premium: null, | |
notes: null, | |
insurance_referral_name: null, | |
// Fire insurance info | |
insurance_member_ids: null, | |
insurance_date_of_birth: null, | |
insurance_gender: null, | |
location_household_value: null, | |
location_household_language: null, | |
insurance_income_source: null, | |
customer_work_occupation: null, | |
custsomer_whatsapp_number: null, | |
insurance_alternative_contact_details: null, | |
// next of kin | |
insurance_kin_first_name: null, | |
insurance_kin_last_name: null, | |
insurance_kin_id_number: null, | |
insurance_kin_dob: null, | |
insurance_kin_cell: null, | |
// customerPaymentDetails | |
insurance_expected_payment_method: null, | |
insurance_expected_payment_date: null, | |
insurance_preffered_payment_hour: null, | |
insurance_preffered_payment_day_of_the_week: null | |
}, | |
insurance_photos: new Array(Object.keys(constants["F" /* PHOTO_TYPE */]).length), | |
funeral: { | |
spouse: [], | |
children: [], | |
beneficiary: { | |
first_name: '', | |
last_name: '', | |
member_id: '', | |
date_of_birth: '', | |
address: '', | |
mobile_number: '', | |
has_south_africa_bank_account: false, | |
is_living_in_south_africa: false | |
} | |
}, | |
insuranceLead: {} | |
}); | |
const registerCustomer_state_state = state_initialState(); | |
// EXTERNAL MODULE: ./src/api/client.js | |
var api_client = __webpack_require__("b39f"); | |
// EXTERNAL MODULE: ./src/api/funeral.js | |
var api_funeral = __webpack_require__("ac36"); | |
// EXTERNAL MODULE: ./node_modules/moment/moment.js | |
var moment = __webpack_require__("c1df"); | |
var moment_default = /*#__PURE__*/__webpack_require__.n(moment); | |
// EXTERNAL MODULE: ./node_modules/lodash/lodash.js | |
var lodash = __webpack_require__("2ef0"); | |
// CONCATENATED MODULE: ./src/helpers/detectorApiDataAdapter.js | |
function getLivesAssuredArray(funeral) { | |
const livesAssured = funeral.children.map(child => { | |
const ret = { | |
...child | |
}; | |
ret.date_of_birth = moment_default()(ret.date_of_birth).format(lumkani["a" /* default */].DATE_FORMAT); | |
return ret; | |
}); | |
if (funeral.spouse) { | |
funeral.spouse.forEach(spouse => { | |
const ret = { | |
...spouse | |
}; | |
ret.date_of_birth = moment_default()(ret.date_of_birth).format(lumkani["a" /* default */].DATE_FORMAT); | |
livesAssured.push(ret); | |
}); | |
return livesAssured; | |
} | |
} | |
function getBeneficiary(state) { | |
const newBeneficiary = { | |
...state.beneficiary | |
}; | |
newBeneficiary.date_of_birth = moment_default()(newBeneficiary.date_of_birth).format(lumkani["a" /* default */].DATE_FORMAT); | |
return newBeneficiary; | |
} | |
function getDetectorWithFormatedDateTimeFileds(detector) { | |
const detectorWithFormatedDateTimeFileds = { | |
...detector | |
}; | |
if (!lumkani["a" /* default */].isEmpty(detector.insurance_date_of_birth)) { | |
detectorWithFormatedDateTimeFileds.insurance_date_of_birth = moment_default()(detector.insurance_date_of_birth).format(lumkani["a" /* default */].DATE_FORMAT); | |
} | |
if (!lumkani["a" /* default */].isEmpty(detector.insurance_kin_dob)) { | |
detectorWithFormatedDateTimeFileds.insurance_kin_dob = moment_default()(detector.insurance_kin_dob).format(lumkani["a" /* default */].DATE_FORMAT); | |
} | |
if (!lumkani["a" /* default */].isEmpty(detector.insurance_preffered_payment_hour)) { | |
detectorWithFormatedDateTimeFileds.insurance_preffered_payment_hour = moment_default()(detector.insurance_preffered_payment_hour, lumkani["a" /* default */].TIME_FORMAT).format(lumkani["a" /* default */].TIME_FORMAT); | |
} | |
return detectorWithFormatedDateTimeFileds; | |
} | |
function adapt(state) { | |
let adaptedDetector = lumkani["a" /* default */].cleanBlankProperties(state.device); | |
adaptedDetector = getDetectorWithFormatedDateTimeFileds(adaptedDetector); | |
const data = { | |
detector: adaptedDetector | |
}; | |
if (state.device.system_app_type === constants["L" /* SYSTEM_APP_TYPE */].FIRE_FUNERAL_APP) { | |
data.options = {}; | |
data.options.include_lives_assured = getLivesAssuredArray(state.funeral); | |
data.options.include_funeral_beneficiary = getBeneficiary(state.funeral); | |
} else if (state.device.system_app_type === constants["L" /* SYSTEM_APP_TYPE */].SENSORS_APP && Object(lodash["isEmpty"])(state.insuranceLead) === false) { | |
data.options = {}; | |
data.options.include_insurance_lead = state.insuranceLead; | |
} | |
return data; | |
} | |
const detectorApiDataAdapter = { | |
adapt, | |
getBeneficiary, | |
getLivesAssuredArray | |
}; | |
/* harmony default export */ var helpers_detectorApiDataAdapter = (detectorApiDataAdapter); | |
// EXTERNAL MODULE: ./src/helpers/detectorStatus.js | |
var detectorStatus = __webpack_require__("53c7"); | |
// EXTERNAL MODULE: ./src/services/client.service.js | |
var client_service = __webpack_require__("beae"); | |
// EXTERNAL MODULE: ./src/helpers/dateTimeHelper.js | |
var dateTimeHelper = __webpack_require__("dde4"); | |
// CONCATENATED MODULE: ./src/builders/client.builder.js | |
class Client { | |
constructor(build) { | |
this.id = build.id; | |
this.status = build.status; | |
this.cancelled_at = build.cancelled_at; | |
} | |
static get Builder() { | |
class Builder { | |
withId(id) { | |
this.id = id; | |
return this; | |
} | |
withStatus(status) { | |
this.status = status; | |
return this; | |
} | |
withCancelledAt(cancelledAt) { | |
this.cancelled_at = cancelledAt; | |
return this; | |
} | |
build() { | |
return new Client(this); | |
} | |
} | |
return Builder; | |
} | |
toJson() { | |
return { | |
id: this.id, | |
status: this.status, | |
cancelled_at: this.cancelled_at | |
}; | |
} | |
} | |
// EXTERNAL MODULE: ./src/hardware/BarcodeScanner.js | |
var BarcodeScanner = __webpack_require__("0921"); | |
// EXTERNAL MODULE: ./src/helpers/http.js + 1 modules | |
var http = __webpack_require__("825e"); | |
// CONCATENATED MODULE: ./src/api/detector.js | |
const getDetectorsCount = ({ | |
filters | |
}) => http["a" /* default */].get('/api/detectors', { | |
params: { | |
filters: { | |
...filters, | |
status__in: [detectorStatus["a" /* default */].ACTIVE, detectorStatus["a" /* default */].UPGRADED_FIRE_TO_FIRE_FUNERAL] | |
}, | |
options: { | |
detectors_count_only: true | |
} | |
} | |
}); | |
function getActiveDetectorByBarcode(detectorBarcode) { | |
const params = { | |
filters: { | |
device_barcode: detectorBarcode, | |
status: detectorStatus["a" /* default */].ACTIVE | |
} | |
}; | |
return http["a" /* default */].get('/api/detectors', { | |
params | |
}); | |
} | |
function getActiveDetectorByFrontDoorBarcode(frontDoorBarcode) { | |
const params = { | |
filters: { | |
front_door_barcode: frontDoorBarcode, | |
status: detectorStatus["a" /* default */].ACTIVE | |
} | |
}; | |
return http["a" /* default */].get('/api/detectors', { | |
params | |
}); | |
} | |
function getDetectorsCountByUserIdAndCreatedDate(userId, createdStartDate) { | |
const params = { | |
filters: { | |
user_id_installation_agent: userId, | |
created_start_date: createdStartDate | |
}, | |
options: { | |
detectors_count_only: true | |
} | |
}; | |
return http["a" /* default */].get('/api/detectors', { | |
params | |
}); | |
} | |
function getDetectorsCountByUserIdAndCreatedDateRange(userId, createdStartDate, createdEndDate) { | |
const params = { | |
filters: { | |
user_id_installation_agent: userId, | |
created_start_date: createdStartDate, | |
created_end_date: createdEndDate | |
}, | |
options: { | |
detectors_count_only: true | |
} | |
}; | |
return http["a" /* default */].get('/api/detectors', { | |
params | |
}); | |
} | |
/* harmony default export */ var api_detector = ({ | |
getActiveDetectorByBarcode, | |
getActiveDetectorByFrontDoorBarcode, | |
getDetectorsCountByUserIdAndCreatedDate, | |
getDetectorsCountByUserIdAndCreatedDateRange, | |
getDetectorsCount | |
}); | |
// EXTERNAL MODULE: ./src/services/AuthService/index.js + 1 modules | |
var AuthService = __webpack_require__("9b05"); | |
// CONCATENATED MODULE: ./src/store/modules/models/registerCustomer/actions.js | |
const registerCustomer_actions_init = ({ | |
commit | |
}, clientRegistrationType) => { | |
commit('init', state_initialState()); | |
commit('setClientRegistrationType', clientRegistrationType); | |
}; | |
const restore = ({ | |
commit | |
}, storedState) => { | |
commit('init', storedState); | |
}; | |
const setCustomerDetails = ({ | |
commit | |
}, customerDetails) => { | |
commit('setCustomerDetails', customerDetails); | |
}; | |
const setFireInsuranceCustomerDetails = ({ | |
commit | |
}, fireInsuranceCustomerDetails) => { | |
commit('setFireInsuranceCustomerDetails', fireInsuranceCustomerDetails); | |
}; | |
const setNextOfKinCustomerDetails = ({ | |
commit | |
}, nextOfKinCustomerDetails) => { | |
commit('setNextOfKinCustomerDetails', nextOfKinCustomerDetails); | |
}; | |
const setFuneralBeneficiary = ({ | |
commit | |
}, beneficiary) => { | |
commit('setFuneralBeneficiary', beneficiary); | |
}; | |
const setInsuranceLead = ({ | |
commit | |
}, insuranceLead) => { | |
commit('setInsuranceLead', insuranceLead); | |
}; | |
const uploadPhoto = async ({ | |
state, | |
commit | |
}, uploadInfo) => { | |
let photoInfo; | |
try { | |
photoInfo = { | |
...state.insurance_photos[uploadInfo.photoType] | |
}; | |
if (state.device.id) { | |
if (photoInfo.status !== constants["M" /* UPLOAD_STATUS */].SUCCESS) { | |
loading_service["show"]({ | |
message: 'Uploading ...' | |
}); | |
await services["c" /* ClientService */].uploadClientPhoto(state.device.id, photoInfo.type, photoInfo.base64Image); | |
photoInfo.status = constants["M" /* UPLOAD_STATUS */].SUCCESS; | |
} | |
} else { | |
const message = 'Save the customer data before'; | |
snackBar_service["error"]({ | |
message | |
}); | |
} | |
} catch (error) { | |
const message = lumkani["a" /* default */].parseErrorMessage(error); | |
snackBar_service["error"]({ | |
message | |
}); | |
photoInfo.status = constants["M" /* UPLOAD_STATUS */].FAILED; | |
} finally { | |
commit('setInsurancePhoto', photoInfo); | |
if (uploadInfo.singleUpload) { | |
loading_service["hide"](); | |
} | |
} | |
}; | |
const upgradeFireToFireAndFuneral = async ({ | |
state, | |
commit, | |
getters | |
}, singleUpload) => { | |
try { | |
if (getters.isUpgradeFromFireToFireFuneral) { | |
if (state.upgrade_fire_to_fire_funeral_upload_status !== constants["M" /* UPLOAD_STATUS */].SUCCESS) { | |
loading_service["show"]({ | |
message: 'Marking as upgraded...' | |
}); | |
const detectorId = state.upgrade_fire_to_fire_funeral.detector_id; | |
const status = detectorStatus["a" /* default */].UPGRADED_FIRE_TO_FIRE_FUNERAL; | |
const cancelledAt = dateTimeHelper["b" /* default */].formatDate(moment_default()()); | |
const client = new Client.Builder().withId(detectorId).withStatus(status).withCancelledAt(cancelledAt).build(); | |
await client_service["c" /* saveClient */](client); | |
commit('setUpgradeFireToFireFuneralUploadStatus', constants["M" /* UPLOAD_STATUS */].SUCCESS); | |
} | |
} | |
} catch (error) { | |
commit('setUpgradeFireToFireFuneralUploadStatus', constants["M" /* UPLOAD_STATUS */].FAILED); | |
if (singleUpload) { | |
const message = `Error trying to upload data - ${lumkani["a" /* default */].parseErrorMessage(error)}`; | |
snackBar_service["error"]({ | |
message | |
}); | |
} else { | |
throw error; | |
} | |
} finally { | |
if (singleUpload) { | |
loading_service["hide"](); | |
} | |
} | |
}; | |
function isUpgradeInformationSaved({ | |
getters, | |
state | |
}) { | |
let result = true; | |
if (getters.isUpgradeFromFireToFireFuneral) { | |
result = state.upgrade_fire_to_fire_funeral_upload_status === constants["M" /* UPLOAD_STATUS */].SUCCESS; | |
} | |
return result; | |
} | |
const saveCustomerData = async ({ | |
state, | |
commit, | |
getters | |
}, singleUpload) => { | |
try { | |
if (isUpgradeInformationSaved({ | |
getters, | |
state | |
})) { | |
if (state.customer_data_upload_status !== constants["M" /* UPLOAD_STATUS */].SUCCESS) { | |
loading_service["show"]({ | |
message: 'Saving customer data...' | |
}); | |
const adaptedData = helpers_detectorApiDataAdapter.adapt(state); | |
const result = await api_client["a" /* default */].saveCustomer(adaptedData); | |
const detector = result.data; | |
commit('setDetectorId', detector.id); | |
commit('setCustomerDataUploadStatus', constants["M" /* UPLOAD_STATUS */].SUCCESS); | |
} | |
} else { | |
const message = 'Save upgrade information first, please'; | |
snackBar_service["error"]({ | |
message | |
}); | |
} | |
} catch (error) { | |
commit('setCustomerDataUploadStatus', constants["M" /* UPLOAD_STATUS */].FAILED); | |
if (singleUpload) { | |
const message = `Error trying to upload data - ${lumkani["a" /* default */].parseErrorMessage(error)}`; | |
snackBar_service["error"]({ | |
message | |
}); | |
} else { | |
throw error; | |
} | |
} finally { | |
if (singleUpload) { | |
loading_service["hide"](); | |
} | |
} | |
}; | |
const updateLivesAssuredData = async ({ | |
state, | |
commit | |
}, singleUpload) => { | |
try { | |
if (state.updateLivesAssured.livesAssuredDataUploadStatus !== constants["M" /* UPLOAD_STATUS */].SUCCESS) { | |
loading_service["show"]({ | |
message: 'Updating lives assured...' | |
}); | |
const adaptedData = helpers_detectorApiDataAdapter.getLivesAssuredArray(state.funeral); | |
await api_funeral["d" /* updateLivesAssured */](adaptedData); | |
commit('setLivesAssuredDataUploadStatus', constants["M" /* UPLOAD_STATUS */].SUCCESS); | |
src_router.push({ | |
name: 'app.viewClient', | |
params: { | |
clientId: state.updateLivesAssured.detector_id | |
} | |
}); | |
} | |
} catch (error) { | |
commit('setLivesAssuredDataUploadStatus', constants["M" /* UPLOAD_STATUS */].FAILED); | |
if (singleUpload) { | |
const message = `Error trying to upload data - ${lumkani["a" /* default */].parseErrorMessage(error)}`; | |
snackBar_service["error"]({ | |
message | |
}); | |
} else { | |
throw error; | |
} | |
} finally { | |
loading_service["hide"](); | |
} | |
}; | |
const uploadAll = async ({ | |
state, | |
commit, | |
getters | |
}) => { | |
try { | |
const context = { | |
state, | |
commit, | |
getters | |
}; | |
if (state.updateLivesAssured.isUpdatingLivesAssured) { | |
await updateLivesAssuredData(context); | |
} else { | |
await upgradeFireToFireAndFuneral(context, false); | |
await saveCustomerData(context, false); | |
const takenPhotoTypes = Object.keys(getters.photosToTakeMap); | |
for (let i = 0; i < takenPhotoTypes.length; i++) { | |
await uploadPhoto(context, { | |
photoType: takenPhotoTypes[i], | |
singleUpload: false | |
}); | |
} | |
if (state.insurance_photos.some(photoInfo => photoInfo && photoInfo.status === constants["M" /* UPLOAD_STATUS */].FAILED)) return; | |
if (getters.isDetectorReplacementProcess) { | |
const clientId = state.device.id; | |
src_router.replace({ | |
name: 'app.viewClient', | |
params: { | |
clientId | |
} | |
}); | |
} else { | |
src_router.replace({ | |
name: 'app.home' | |
}); | |
} | |
} | |
const message = 'Data uploaded successfully'; | |
snackBar_service["success"]({ | |
message | |
}); | |
} catch (error) { | |
const message = `Error trying to upload data - ${lumkani["a" /* default */].parseErrorMessage(error)}`; | |
snackBar_service["error"]({ | |
message | |
}); | |
} finally { | |
loading_service["hide"](); | |
} | |
}; | |
const editSpouseLifeAssured = ({ | |
commit | |
}, spouseInformation) => { | |
commit('editSpouseLifeAssured', spouseInformation); | |
}; | |
const setSpouseLifeAssuredAsDeleted = ({ | |
commit | |
}, index) => { | |
commit('setSpouseLifeAssuredAsDeleted', index); | |
}; | |
const removeSpouseFromLiveAssured = ({ | |
commit | |
}, index) => { | |
commit('removeSpouseFromLiveAssured', index); | |
}; | |
const appendLifeAssuredSpouse = async ({ | |
commit, | |
state | |
}, spouse) => { | |
if (lumkani["a" /* default */].getNumberOfActiveLivesAssured(state.funeral.spouse) >= constants["x" /* MAX_NUMBER_OF_SPOUSE */]) { | |
throw Error('A client cannot have more than 1 spouse. Delete the current spouse to add a new one.'); | |
} else { | |
commit('appendLifeAssuredSpouse', spouse); | |
} | |
}; | |
const editChildLifeAssured = ({ | |
commit | |
}, childInformation) => { | |
commit('editChildLifeAssured', childInformation); | |
}; | |
const removeChildFromLiveAssured = ({ | |
commit | |
}, index) => { | |
commit('removeChildFromLiveAssured', index); | |
}; | |
const setChildLifeAssuredAsDeleted = ({ | |
commit | |
}, index) => { | |
commit('setChildLifeAssuredAsDeleted', index); | |
}; | |
const appendLifeAssuredChild = async ({ | |
commit, | |
state | |
}, child) => { | |
if (lumkani["a" /* default */].getNumberOfActiveLivesAssured(state.funeral.children) >= constants["w" /* MAX_NUMBER_OF_CHILDREN */]) { | |
throw Error(`Unable to add child to the list. The limit of ${constants["w" /* MAX_NUMBER_OF_CHILDREN */]} children to be assured has been reached.`); | |
} else { | |
commit('appendLifeAssuredChild', child); | |
} | |
}; | |
const checkInsurancePhotos = (state, compulsoryPhotosToTakeMap) => { | |
let isValid = true; | |
for (const photoType in compulsoryPhotosToTakeMap) { | |
const photo = state.insurance_photos[photoType]; | |
if (!!photo === false) { | |
isValid = false; | |
const message = compulsoryPhotosToTakeMap[photoType].validationErrorMsg; | |
snackBar_service["error"]({ | |
message | |
}); | |
} | |
} | |
return isValid; | |
}; | |
function isValidPhotos({ | |
state, | |
getters | |
}) { | |
return checkInsurancePhotos(state, getters.photosToTakeMap); | |
} | |
const goToNotes = store => { | |
if (isValidPhotos({ | |
...store | |
})) { | |
src_router.push({ | |
name: 'app.notesRegisterCustomer' | |
}); | |
} | |
}; | |
const goToCustomerPaymentDetailsPage = () => { | |
src_router.push({ | |
name: 'app.customerDetailsPayment' | |
}); | |
}; | |
const paymentDetailPageNext = ({ | |
commit, | |
getters | |
}, paymentDetail) => { | |
commit('setCustomerPaymentDetails', paymentDetail); | |
if (getters.isUpgradeFromFireToFireFuneral) { | |
src_router.push({ | |
name: 'app.listLivesAssured' | |
}); | |
} else { | |
src_router.push({ | |
name: 'app.policyType' | |
}); | |
} | |
}; | |
const setSystemAppTypeAndGoToNextPage = ({ | |
commit, | |
getters | |
}, policyType) => { | |
commit('setSystemAppType', policyType); | |
if (getters.isFireClient) { | |
src_router.push({ | |
name: 'app.householdPhotos' | |
}); | |
} else { | |
src_router.push({ | |
name: 'app.listLivesAssured' | |
}); | |
} | |
}; | |
const scanDetectorBarcode = async ({ | |
commit | |
}) => { | |
const result = await Object(BarcodeScanner["a" /* scanBarcode */])(); | |
commit('setDeviceBarcode', result.text); | |
return result; | |
}; | |
const barcodeScannerPageGoToNext = async ({ | |
commit | |
}, detectorBarcode) => { | |
try { | |
loading_service["show"]({ | |
message: 'Validating detector barcode...' | |
}); | |
const result = await api_detector.getActiveDetectorByBarcode(detectorBarcode); | |
if (result.data.detectors.length !== 0) { | |
snackBar_service["error"]({ | |
message: 'Barcode is already registered' | |
}); | |
return; | |
} | |
commit('setDeviceBarcode', detectorBarcode); | |
const loggedUser = await AuthService["a" /* AuthService */].whoAmI(); | |
const defaultGPS = constants["h" /* DEFAULT_GPS_BY_COMMUNITY */][loggedUser.communityId]; | |
if (!!defaultGPS === false) { | |
src_router.push({ | |
name: 'app.geolocation', | |
query: src_router.query | |
}); | |
} else { | |
commit('updateDeviceLatitudeAndLongitudeIfBetterGPSAccuracy', defaultGPS); | |
src_router.push({ | |
name: 'app.customerDetails' | |
}); | |
} | |
} catch (error) { | |
const message = lumkani["a" /* default */].parseErrorMessage(error); | |
snackBar_service["error"]({ | |
message | |
}); | |
} finally { | |
loading_service["hide"](); | |
} | |
}; | |
// CONCATENATED MODULE: ./src/store/modules/models/registerCustomer/mutations.js | |
const mutations_init = (state, newState) => { | |
Object.assign(state, newState); | |
}; | |
const setDetector = (state, detector) => { | |
Object.assign(state.device, detector); | |
}; | |
const setDeviceBarcode = (state, deviceBarcode) => { | |
state.device.device_barcode = deviceBarcode; | |
}; | |
const setFrontDoorBarcode = (state, frontDoorBarcode) => { | |
state.device.front_door_barcode = frontDoorBarcode; | |
}; | |
const updateDeviceLatitudeAndLongitudeIfBetterGPSAccuracy = (state, location) => { | |
if (!state.device.location_gps_accuracy || state.device.location_gps_accuracy > location.accuracy) { | |
state.device.location_gps_latitude = location.latitude; | |
state.device.location_gps_longitude = location.longitude; | |
state.device.location_gps_accuracy = location.accuracy; | |
} | |
}; | |
const mutations_setCustomerDetails = (state, customerDetails) => { | |
Object.assign(state.device, customerDetails); | |
}; | |
const setSystemAppType = (state, systemAppType) => { | |
state.device.system_app_type = systemAppType; | |
}; | |
const setNotes = (state, notes) => { | |
state.device.notes = notes; | |
}; | |
const setInsurancePolicyPremium = (state, insurancePolicyPremium) => { | |
state.device.insurance_policy_premium = insurancePolicyPremium; | |
}; | |
const setInsuranceExpectedPaymentDay = (state, insuranceExpectedPaymentDay) => { | |
state.device.insurance_expected_payment_date = insuranceExpectedPaymentDay; | |
}; | |
const setInsuranceReferralName = (state, insuranceReferralName) => { | |
state.device.insurance_referral_name = insuranceReferralName; | |
}; | |
const mutations_setFireInsuranceCustomerDetails = (state, fireInsuranceCustomerDetails) => { | |
Object.assign(state.device, fireInsuranceCustomerDetails); | |
}; | |
const mutations_setNextOfKinCustomerDetails = (state, nextOfKinCustomerDetails) => { | |
Object.assign(state.device, nextOfKinCustomerDetails); | |
}; | |
const setCustomerPaymentDetails = (state, customerPaymentDetails) => { | |
Object.assign(state.device, customerPaymentDetails); | |
}; | |
const setDetectorId = (state, detectorId) => { | |
state.device.id = detectorId; | |
}; | |
const mutations_setFuneralBeneficiary = (state, beneficiary) => { | |
Object.assign(state.funeral.beneficiary, beneficiary); | |
}; | |
const mutations_setInsuranceLead = (state, insuranceLead) => { | |
Object.assign(state.insuranceLead, insuranceLead); | |
}; | |
const setClientRegistrationType = (state, clientRegistrationType) => { | |
state.client_registration_type = clientRegistrationType; | |
}; | |
const setDetectorIdToUpgrade = (state, detectorId) => { | |
state.upgrade_fire_to_fire_funeral.detector_id = detectorId; | |
}; | |
const setInsurancePhoto = (state, photo) => { | |
vue_runtime_esm["a" /* default */].set(state.insurance_photos, photo.type, { | |
...photo | |
}); | |
}; | |
const setUpgradeFireToFireFuneralUploadStatus = (state, uploadStatus) => { | |
state.upgrade_fire_to_fire_funeral_upload_status = uploadStatus; | |
}; | |
const setCustomerDataUploadStatus = (state, uploadStatus) => { | |
state.customer_data_upload_status = uploadStatus; | |
}; | |
const setLivesAssuredDataUploadStatus = (state, uploadStatus) => { | |
state.updateLivesAssured.livesAssuredDataUploadStatus = uploadStatus; | |
}; | |
const setIsUpdatingLivesAssuredDetectorId = (state, detectorId) => { | |
state.updateLivesAssured.detector_id = detectorId; | |
}; | |
const setIsUpdatingLivesAssured = (state, status) => { | |
state.updateLivesAssured.isUpdatingLivesAssured = status; | |
}; | |
const setFetchLivesAssured = (state, status) => { | |
state.updateLivesAssured.fetchLivesAssured = status; | |
}; | |
const mutations_appendLifeAssuredSpouse = (state, spouse) => { | |
spouse.life_assured_type = lumkani["a" /* default */].SPOUSE; | |
state.funeral.spouse.push(spouse); | |
}; | |
const mutations_removeSpouseFromLiveAssured = (state, index) => { | |
state.funeral.spouse.splice(index, 1); | |
}; | |
const mutations_setSpouseLifeAssuredAsDeleted = (state, index) => { | |
state.funeral.spouse[index].status = constants["s" /* LIFE_ASSURED_STATUS */].DELETED; | |
}; | |
const mutations_editSpouseLifeAssured = (state, spouseInformation) => { | |
state.funeral.spouse[spouseInformation.index] = spouseInformation.spouse; | |
}; | |
const mutations_appendLifeAssuredChild = (state, child) => { | |
child.life_assured_type = lumkani["a" /* default */].CHILD; | |
state.funeral.children.push(child); | |
}; | |
const mutations_removeChildFromLiveAssured = (state, index) => { | |
state.funeral.children.splice(index, 1); | |
}; | |
const mutations_setChildLifeAssuredAsDeleted = (state, index) => { | |
state.funeral.children[index].status = constants["s" /* LIFE_ASSURED_STATUS */].DELETED; | |
}; | |
const mutations_editChildLifeAssured = (state, childInformation) => { | |
state.funeral.children[childInformation.index] = childInformation.child; | |
}; | |
const resetLivesAssured = state => { | |
state.funeral.children = []; | |
state.funeral.spouse = []; | |
}; | |
// CONCATENATED MODULE: ./src/store/modules/models/registerCustomer/getters.js | |
const isUpgradeFromFireToFireFuneral = state => state.client_registration_type === constants["c" /* CLIENT_REGISTRATION_TYPE */].UPGRADE_FIRE_TO_FIRE_FUNERAL; | |
const isFreeClientUpgrade = state => state.client_registration_type === constants["c" /* CLIENT_REGISTRATION_TYPE */].UPGRADE_FREE_CLIENT; | |
const isDetectorReplacementProcess = state => state.client_registration_type === constants["c" /* CLIENT_REGISTRATION_TYPE */].DETECTOR_REPLACEMENT; | |
const isRegisterNewClient = state => state.client_registration_type === constants["c" /* CLIENT_REGISTRATION_TYPE */].CREATE; | |
const isFreeInstallation = state => state.device.system_app_type === constants["L" /* SYSTEM_APP_TYPE */].SENSORS_APP; | |
const isFireFuneralClient = state => state.device.system_app_type === constants["L" /* SYSTEM_APP_TYPE */].FIRE_FUNERAL_APP; | |
const isDebitOrderClient = state => client_service["b" /* isDebitOrderClient */](state.device); | |
const isFireClient = state => state.device.system_app_type === constants["L" /* SYSTEM_APP_TYPE */].INSURANCE_APP; | |
const getPhoto = state => photoType => { | |
if (state.insurance_photos[photoType]) { | |
return state.insurance_photos[photoType].base64Image; | |
} | |
return lumkani["a" /* default */].IMAGE_PLACEHOLDER_URL; | |
}; | |
const photosToTakeMap = (_, getters) => { | |
let photoTypeList = []; | |
if (getters.isFreeInstallation || getters.isDetectorReplacementProcess) { | |
photoTypeList.push(constants["F" /* PHOTO_TYPE */].DETECTOR_PHOTO); | |
} else { | |
photoTypeList = photoTypeList.concat([constants["F" /* PHOTO_TYPE */].CLIENT_PHOTO, constants["F" /* PHOTO_TYPE */].RENTAL_AGREEMENT_PHOTO, constants["F" /* PHOTO_TYPE */].FRONT_DOOR_HOUSE_NUMBER_PHOTO, constants["F" /* PHOTO_TYPE */].INSIDE_RIGHT_PHOTO, constants["F" /* PHOTO_TYPE */].INSIDE_LEFT_PHOTO, constants["F" /* PHOTO_TYPE */].INSIDE_ONE_PHOTO]); | |
if (getters.isFireFuneralClient) { | |
photoTypeList.push(constants["F" /* PHOTO_TYPE */].FUNERAL_POLICY_CERT_PHOTO); | |
} | |
if (getters.isDebitOrderClient) { | |
photoTypeList.push(constants["F" /* PHOTO_TYPE */].DEBIT_ORDER_FORM_PHOTO); | |
} | |
if (!getters.isUpgradeFromFireToFireFuneral && !getters.isFreeClientUpgrade) { | |
photoTypeList.push(constants["F" /* PHOTO_TYPE */].DETECTOR_PHOTO); | |
} | |
} | |
const mapPhotosToTake = {}; | |
photoTypeList.forEach(photoType => { | |
mapPhotosToTake[photoType] = constants["g" /* CUSTOMER_PHOTO_LIST */][photoType]; | |
}); | |
return mapPhotosToTake; | |
}; | |
// CONCATENATED MODULE: ./src/store/modules/models/registerCustomer/index.js | |
/* harmony default export */ var registerCustomer = ({ | |
namespaced: true, | |
state: registerCustomer_state_state, | |
actions: registerCustomer_actions_namespaceObject, | |
mutations: registerCustomer_mutations_namespaceObject, | |
getters: getters_namespaceObject | |
}); | |
// CONCATENATED MODULE: ./src/store/modules/services/clientManagement/state.js | |
const clientManagement_state_state = { | |
clients: [], | |
numberOfClientApplications: 0, | |
numberOfTotalClients: 0, | |
numberOfClientPaymentToday: 0, | |
numberOfClientPaymentNextTwoDays: 0, | |
numberOfClientsMissedPaymentLast5Days: 0, | |
numberOfClientsNearToSuspension: 0, | |
numberOfClientsInGrace1: 0, | |
numberOfClientsPaid: 0, | |
numberOfClientsDebitOrder: 0, | |
activeTab: '' | |
}; | |
/* harmony default export */ var clientManagement_state = (clientManagement_state_state); | |
// EXTERNAL MODULE: ./src/helpers/insurancePaymentMethods.js | |
var insurancePaymentMethods = __webpack_require__("6b7e"); | |
// CONCATENATED MODULE: ./src/store/modules/services/clientManagement/actions.js | |
const COUNT_DETECTOR_OPTIONS = { | |
detectors_count_only: true | |
}; | |
const ALPHABETIC_ORDER_OPTIONS = { | |
order_by: 'customer_first_name' | |
}; | |
const SYSTEM_CREATED_DATE_ORDER_OPTION = { | |
order_by: 'system_created' | |
}; | |
function saveActiveTab({ | |
commit | |
}, tab) { | |
commit('setActiveTab', tab); | |
} | |
function goToConfirmCellphoneNumberPage(context, clientId) { | |
src_router.push({ | |
name: 'app.confirmCellphoneNumber', | |
params: { | |
clientId | |
} | |
}); | |
} | |
function cleanState({ | |
commit | |
}) { | |
const emptyState = { | |
clients: [], | |
numberOfClientApplications: 0, | |
numberOfTotalClients: 0, | |
numberOfClientPaymentToday: 0, | |
numberOfClientPaymentNextTwoDays: 0, | |
numberOfClientsMissedPaymentLast5Days: 0, | |
numberOfClientsNearToSuspension: 0 | |
}; | |
commit('init', emptyState); | |
} | |
function buildClientsOfPaymentDayXNotPaidLast18DaysFilterParams({ | |
rootState | |
}, expectedPaymentDateList) { | |
return { | |
agentId: rootState.authenticationService.logged_user.id, | |
expectedPaymentDateList, | |
lastPaymentDateLessThenEqual: moment_default()().subtract(18, 'days').format(lumkani["a" /* default */].DATE_FORMAT) | |
}; | |
} | |
function getListOfExpectedPaymentsDateForTodaysClient() { | |
const today = moment_default()(); | |
const numberOfDaysInMonth = today.daysInMonth(); | |
if (today.date() < numberOfDaysInMonth) { | |
return [today.date()]; | |
} | |
return dateTimeHelper["b" /* default */].getDaysNotInGivenDaysMonth(today); | |
} | |
function getListOfExpectedPaymentsDateForNextTwoDaysClient() { | |
const initialDate = moment_default()(); | |
const numberOfUpcomingDays = 2; | |
const numberOfDaysInMonth = initialDate.daysInMonth(); | |
const upcomingDays = dateTimeHelper["b" /* default */].getUpcomingDaysList(initialDate, numberOfUpcomingDays); | |
if (lumkani["a" /* default */].getArrayLast(upcomingDays) < numberOfDaysInMonth) { | |
return upcomingDays; | |
} | |
return dateTimeHelper["b" /* default */].getDaysNotInGivenDaysMonth(initialDate); | |
} | |
function buildClientsMissedPaymentLast5Days({ | |
rootState | |
}) { | |
const initialDate = moment_default()(); | |
const numberOfPreviousDay = 5; | |
const previousDaysList = dateTimeHelper["b" /* default */].getPreviousDaysList(initialDate, numberOfPreviousDay); | |
return buildClientsOfPaymentDayXNotPaidLast18DaysFilterParams({ | |
rootState | |
}, previousDaysList); | |
} | |
function buildClientsNearToSuspensionFilter({ | |
rootState | |
}) { | |
return { | |
agentId: rootState.authenticationService.logged_user.id, | |
lessThanInsuranceSuspensionDate: moment_default()().add(30, 'days').format(lumkani["a" /* default */].DATE_FORMAT) | |
}; | |
} | |
function buildClientsInGrace1Filter({ | |
rootState | |
}) { | |
return { | |
agentId: rootState.authenticationService.logged_user.id, | |
lessThanInsuranceSuspensionDate: moment_default()().add(60, 'days').format(lumkani["a" /* default */].DATE_FORMAT), | |
greaterThanInsuranceSuspensionDate: moment_default()().add(30, 'days').format(lumkani["a" /* default */].DATE_FORMAT) | |
}; | |
} | |
function buildClientsPaidFilter({ | |
rootState | |
}) { | |
return { | |
agentId: rootState.authenticationService.logged_user.id, | |
lastPaymentDateGreaterThanEqual: moment_default()().subtract(30, 'days').format(lumkani["a" /* default */].DATE_FORMAT) | |
}; | |
} | |
function buildClientsDebitOrderFilter({ | |
rootState | |
}) { | |
return { | |
agentId: rootState.authenticationService.logged_user.id, | |
includePaymentType: insurancePaymentMethods["a" /* default */].DEBIT_ORDER | |
}; | |
} | |
async function clientManagement_actions_init({ | |
rootState, | |
commit | |
}) { | |
cleanState({ | |
commit | |
}); | |
const userID = rootState.authenticationService.logged_user.id; | |
const todaysClientsParams = buildClientsOfPaymentDayXNotPaidLast18DaysFilterParams({ | |
rootState | |
}, getListOfExpectedPaymentsDateForTodaysClient()); | |
const nextTwoDaysClientsParams = buildClientsOfPaymentDayXNotPaidLast18DaysFilterParams({ | |
rootState | |
}, getListOfExpectedPaymentsDateForNextTwoDaysClient()); | |
const clientsHaventPaidLast5DaysParams = buildClientsMissedPaymentLast5Days({ | |
rootState | |
}); | |
const clientsNearToSuspensionParams = buildClientsNearToSuspensionFilter({ | |
rootState | |
}); | |
const clientsInGrace1Params = buildClientsInGrace1Filter({ | |
rootState | |
}); | |
const clientsPaidParams = buildClientsPaidFilter({ | |
rootState | |
}); | |
const clientsDebitOrderParams = buildClientsDebitOrderFilter({ | |
rootState | |
}); | |
const promises = []; | |
promises.push(api_client["a" /* default */].getActiveClientApplications(userID, COUNT_DETECTOR_OPTIONS)); | |
promises.push(api_client["a" /* default */].getActiveInsuranceClients(userID, COUNT_DETECTOR_OPTIONS)); | |
promises.push(api_client["a" /* default */].getActiveClientByExpectedPaymentDateAndLastPaymentNoDebitOrder(todaysClientsParams, COUNT_DETECTOR_OPTIONS)); | |
promises.push(api_client["a" /* default */].getActiveClientByExpectedPaymentDateAndLastPaymentNoDebitOrder(clientsHaventPaidLast5DaysParams, COUNT_DETECTOR_OPTIONS)); | |
promises.push(api_client["a" /* default */].getActiveClientsBySuspensionDate(clientsNearToSuspensionParams, COUNT_DETECTOR_OPTIONS)); | |
promises.push(api_client["a" /* default */].getActiveClientByExpectedPaymentDateAndLastPaymentNoDebitOrder(nextTwoDaysClientsParams, COUNT_DETECTOR_OPTIONS)); | |
promises.push(api_client["a" /* default */].getActiveClientsBySuspensionDate(clientsInGrace1Params, COUNT_DETECTOR_OPTIONS)); | |
promises.push(api_client["a" /* default */].getActiveClientByLastPaymentDate(clientsPaidParams, COUNT_DETECTOR_OPTIONS)); | |
promises.push(api_client["a" /* default */].getActiveClientsByPaymentType(clientsDebitOrderParams, COUNT_DETECTOR_OPTIONS)); | |
const result = await Promise.all(promises); | |
commit('setNumberOfClientApplications', result[0].data.detectors_count); | |
commit('setNumberOfTotalClients', result[1].data.detectors_count); | |
commit('setNumberOfClientPaymentToday', result[2].data.detectors_count); | |
commit('setNumberOfClientsMissedPaymentLast5Days', result[3].data.detectors_count); | |
commit('setNumberOfClientsNearToSuspension', result[4].data.detectors_count); | |
commit('setNumberOfClientPaymentNextTwoDays', result[5].data.detectors_count); | |
commit('setNumberOfClientsInGrace1', result[6].data.detectors_count); | |
commit('setNumberOfClientsPaid', result[7].data.detectors_count); | |
commit('setNumberOfClientsDebitOrder', result[8].data.detectors_count); | |
return result; | |
} | |
async function getActiveClientApplications({ | |
rootState, | |
commit | |
}) { | |
const userID = rootState.authenticationService.logged_user.id; | |
const result = await api_client["a" /* default */].getActiveClientApplications(userID, SYSTEM_CREATED_DATE_ORDER_OPTION); | |
commit('setClientsDetails', result.data.detectors); | |
commit('setNumberOfClientApplications', result.data.detectors.length); | |
} | |
function calculateDaysToSuspensionCount(detectors) { | |
let detectorInsuranceSuspensionDate; | |
for (let i = 0; i < detectors.length; i++) { | |
detectorInsuranceSuspensionDate = moment_default()(detectors[i].insurance_suspension_date, 'YYYY-MM-DD'); | |
detectors[i].daysToSuspensionCount = moment_default()().diff(detectorInsuranceSuspensionDate, 'days'); | |
} | |
return detectors; | |
} | |
function orderByNearestUpcomingExpectedPaymentDate() { | |
const currentDate = moment_default()().date(); | |
return lumkani["a" /* default */].getCompareFnOrderByFurthestDayOfMonthByProperty(currentDate, 'insurance_expected_payment_date'); | |
} | |
function orderMostOverdueByExpectedPaymentDate() { | |
const currentDate = moment_default()().date(); | |
return lumkani["a" /* default */].getCompareFnOrderByFurthestDayOfMonthByProperty(currentDate, 'insurance_expected_payment_date'); | |
} | |
function orderByMostSuspendedtoTheLeast(d1, d2) { | |
return d2.daysToSuspensionCount - d1.daysToSuspensionCount; | |
} | |
function orderByPayment(d1, d2) { | |
return moment_default()(d2.last_payment_date) - moment_default()(d1.last_payment_date); | |
} | |
async function getActiveInsuranceClients({ | |
rootState, | |
commit | |
}) { | |
const userID = rootState.authenticationService.logged_user.id; | |
const result = await api_client["a" /* default */].getActiveInsuranceClients(userID, ALPHABETIC_ORDER_OPTIONS); | |
commit('setClientsDetails', calculateDaysToSuspensionCount(result.data.detectors)); | |
commit('setNumberOfTotalClients', result.data.detectors.length); | |
return result; | |
} | |
async function getClientsOfPaymentTodayNotPaidLast18Days({ | |
rootState, | |
commit | |
}) { | |
const todaysClientsParams = buildClientsOfPaymentDayXNotPaidLast18DaysFilterParams({ | |
rootState | |
}, getListOfExpectedPaymentsDateForTodaysClient()); | |
const result = await api_client["a" /* default */].getActiveClientByExpectedPaymentDateAndLastPaymentNoDebitOrder(todaysClientsParams, ALPHABETIC_ORDER_OPTIONS); | |
commit('setClientsDetails', calculateDaysToSuspensionCount(result.data.detectors)); | |
commit('setNumberOfClientPaymentToday', result.data.detectors.length); | |
return result; | |
} | |
async function getClientsOfPaymentNextTwoDaysNotPaidLast18Days({ | |
rootState, | |
commit | |
}) { | |
const twoDaysClientsParams = buildClientsOfPaymentDayXNotPaidLast18DaysFilterParams({ | |
rootState | |
}, getListOfExpectedPaymentsDateForNextTwoDaysClient()); | |
const result = await api_client["a" /* default */].getActiveClientByExpectedPaymentDateAndLastPaymentNoDebitOrder(twoDaysClientsParams, ALPHABETIC_ORDER_OPTIONS); | |
result.data.detectors.sort(orderByNearestUpcomingExpectedPaymentDate()); | |
commit('setClientsDetails', calculateDaysToSuspensionCount(result.data.detectors)); | |
commit('setNumberOfClientPaymentNextTwoDays', result.data.detectors.length); | |
} | |
async function getClientsMissedPaymentLast5Days({ | |
rootState, | |
commit | |
}) { | |
const clientsHaventPaidLast5DaysParams = buildClientsMissedPaymentLast5Days({ | |
rootState | |
}); | |
const result = await api_client["a" /* default */].getActiveClientByExpectedPaymentDateAndLastPaymentNoDebitOrder(clientsHaventPaidLast5DaysParams); | |
result.data.detectors.sort(orderMostOverdueByExpectedPaymentDate()); | |
commit('setClientsDetails', calculateDaysToSuspensionCount(result.data.detectors)); | |
commit('setNumberOfClientsMissedPaymentLast5Days', result.data.detectors.length); | |
return result; | |
} | |
async function getClientsNearToSuspension({ | |
rootState, | |
commit | |
}) { | |
const clientsNearToSuspensionParams = buildClientsNearToSuspensionFilter({ | |
rootState | |
}); | |
const result = await api_client["a" /* default */].getActiveClientsBySuspensionDate(clientsNearToSuspensionParams); | |
const allDetectors = calculateDaysToSuspensionCount(result.data.detectors); | |
allDetectors.sort(orderByMostSuspendedtoTheLeast); | |
commit('setClientsDetails', allDetectors); | |
commit('setNumberOfClientsNearToSuspension', result.data.detectors.length); | |
return result; | |
} | |
async function getClientsInGrace1({ | |
rootState, | |
commit | |
}) { | |
const clientsInGrace1Params = buildClientsInGrace1Filter({ | |
rootState | |
}); | |
const result = await api_client["a" /* default */].getActiveClientsBySuspensionDate(clientsInGrace1Params); | |
const allDetectors = calculateDaysToSuspensionCount(result.data.detectors); | |
allDetectors.sort(orderByMostSuspendedtoTheLeast); | |
commit('setClientsDetails', allDetectors); | |
commit('setNumberOfClientsInGrace1', result.data.detectors.length); | |
} | |
async function getPaidClientsThisMonth({ | |
rootState, | |
commit | |
}) { | |
const options = { | |
include_last_payment_date: true | |
}; | |
const paidClientsThisMonthParams = buildClientsPaidFilter({ | |
rootState | |
}); | |
const result = await api_client["a" /* default */].getActiveClientByLastPaymentDate(paidClientsThisMonthParams, options); | |
const allDetectors = calculateDaysToSuspensionCount(result.data.detectors); | |
allDetectors.sort(orderByPayment); | |
commit('setClientsDetails', allDetectors); | |
commit('setNumberOfClientsPaid', result.data.detectors.length); | |
} | |
async function getClientsDebitOrder({ | |
rootState, | |
commit | |
}) { | |
const clientsDebitOrderParams = buildClientsDebitOrderFilter({ | |
rootState | |
}); | |
const result = await api_client["a" /* default */].getActiveClientsByPaymentType(clientsDebitOrderParams); | |
const allDetectors = calculateDaysToSuspensionCount(result.data.detectors); | |
allDetectors.sort(orderByMostSuspendedtoTheLeast); | |
commit('setClientsDetails', allDetectors); | |
commit('setNumberOfClientsDebitOrder', result.data.detectors.length); | |
} | |
const clientManagement_actions_actions = { | |
init: clientManagement_actions_init, | |
goToConfirmCellphoneNumberPage, | |
getActiveClientApplications, | |
getActiveInsuranceClients, | |
getClientsOfPaymentTodayNotPaidLast18Days, | |
getClientsOfPaymentNextTwoDaysNotPaidLast18Days, | |
getClientsMissedPaymentLast5Days, | |
getClientsNearToSuspension, | |
getClientsInGrace1, | |
getPaidClientsThisMonth, | |
getClientsDebitOrder, | |
saveActiveTab | |
}; | |
/* harmony default export */ var clientManagement_actions = (clientManagement_actions_actions); | |
// CONCATENATED MODULE: ./src/store/modules/services/clientManagement/mutations.js | |
function clientManagement_mutations_init(state, newState) { | |
Object.assign(state, newState); | |
} | |
function setClientsDetails(state, clients) { | |
state.clients = clients; | |
} | |
function setNumberOfClientApplications(state, numberOfClientApplications) { | |
state.numberOfClientApplications = numberOfClientApplications; | |
} | |
function setNumberOfTotalClients(state, numberOfTotalClients) { | |
state.numberOfTotalClients = numberOfTotalClients; | |
} | |
function setNumberOfClientPaymentToday(state, numberOfClientPaymentToday) { | |
state.numberOfClientPaymentToday = numberOfClientPaymentToday; | |
} | |
function setNumberOfClientPaymentNextTwoDays(state, numberOfClientPaymentNextTwoDays) { | |
state.numberOfClientPaymentNextTwoDays = numberOfClientPaymentNextTwoDays; | |
} | |
function setNumberOfClientsMissedPaymentLast5Days(state, numberOfClientsMissedPaymentLast5Days) { | |
state.numberOfClientsMissedPaymentLast5Days = numberOfClientsMissedPaymentLast5Days; | |
} | |
function setNumberOfClientsNearToSuspension(state, numberOfClientsNearToSuspension) { | |
state.numberOfClientsNearToSuspension = numberOfClientsNearToSuspension; | |
} | |
function setNumberOfClientsInGrace1(state, numberOfClientsInGrace1) { | |
state.numberOfClientsInGrace1 = numberOfClientsInGrace1; | |
} | |
function setNumberOfClientsPaid(state, numberOfClientsPaid) { | |
state.numberOfClientsPaid = numberOfClientsPaid; | |
} | |
function setNumberOfClientsDebitOrder(state, numberOfClientsDebitOrder) { | |
state.numberOfClientsDebitOrder = numberOfClientsDebitOrder; | |
} | |
function setActiveTab(state, activeTab) { | |
state.activeTab = activeTab; | |
} | |
const clientManagement_mutations_mutations = { | |
init: clientManagement_mutations_init, | |
setClientsDetails, | |
setNumberOfClientApplications, | |
setNumberOfTotalClients, | |
setNumberOfClientPaymentToday, | |
setNumberOfClientsMissedPaymentLast5Days, | |
setNumberOfClientsNearToSuspension, | |
setNumberOfClientPaymentNextTwoDays, | |
setNumberOfClientsInGrace1, | |
setNumberOfClientsPaid, | |
setNumberOfClientsDebitOrder, | |
setActiveTab | |
}; | |
/* harmony default export */ var clientManagement_mutations = (clientManagement_mutations_mutations); | |
// CONCATENATED MODULE: ./src/store/modules/services/clientManagement/index.js | |
/* harmony default export */ var clientManagement = ({ | |
namespaced: true, | |
state: clientManagement_state, | |
actions: clientManagement_actions, | |
mutations: clientManagement_mutations | |
}); | |
// CONCATENATED MODULE: ./src/store/modules/services/confirmCellphoneNumber/actions.js | |
const confirmCellphoneNumber_actions_init = async (_, clientId) => { | |
try { | |
loading_service["show"]({ | |
message: 'Loading client information...' | |
}); | |
const result = await api_client["a" /* default */].getClientById(clientId); | |
return result.data.detector; | |
} catch (error) { | |
const message = lumkani["a" /* default */].parseErrorMessage(error); | |
snackBar_service["error"]({ | |
message | |
}); | |
} finally { | |
loading_service["hide"](); | |
} | |
}; | |
// CONCATENATED MODULE: ./src/store/modules/services/confirmCellphoneNumber/index.js | |
/* harmony default export */ var confirmCellphoneNumber = ({ | |
namespaced: true, | |
actions: confirmCellphoneNumber_actions_namespaceObject | |
}); | |
// CONCATENATED MODULE: ./src/store/modules/services/installOrInsurance/actions.js | |
function goToReferralInformationPage({ | |
commit | |
}) { | |
commit('registerCustomerModel/setSystemAppType', null, { | |
root: true | |
}); | |
src_router.push({ | |
name: 'app.referralInformation' | |
}); | |
} | |
function setSystemAppTypeAsSensorAPPAndGoToInsuranceLeadPage({ | |
commit | |
}) { | |
commit('registerCustomerModel/setSystemAppType', constants["L" /* SYSTEM_APP_TYPE */].SENSORS_APP, { | |
root: true | |
}); | |
commit('registerCustomerModel/setInsuranceExpectedPaymentDay', 0, { | |
root: true | |
}); | |
src_router.push({ | |
name: 'app.insuranceLead' | |
}); | |
} | |
const installOrInsurance_actions_actions = { | |
goToReferralInformationPage, | |
setSystemAppTypeAsSensorAPPAndGoToInsuranceLeadPage | |
}; | |
/* harmony default export */ var installOrInsurance_actions = (installOrInsurance_actions_actions); | |
// CONCATENATED MODULE: ./src/store/modules/services/installOrInsurance/index.js | |
/* harmony default export */ var installOrInsurance = ({ | |
namespaced: true, | |
actions: installOrInsurance_actions | |
}); | |
// CONCATENATED MODULE: ./src/store/modules/services/registerCustomerNotes/actions.js | |
function addNotesAndGoToRegisterCustomerDataUpload({ | |
commit | |
}, notes) { | |
commit('registerCustomerModel/setNotes', notes, { | |
root: true | |
}); | |
src_router.push({ | |
name: 'app.registerCustomerDataUpload' | |
}); | |
} | |
const registerCustomerNotes_actions_actions = { | |
addNotesAndGoToRegisterCustomerDataUpload | |
}; | |
/* harmony default export */ var registerCustomerNotes_actions = (registerCustomerNotes_actions_actions); | |
// CONCATENATED MODULE: ./src/store/modules/services/registerCustomerNotes/index.js | |
/* harmony default export */ var registerCustomerNotes = ({ | |
namespaced: true, | |
actions: registerCustomerNotes_actions | |
}); | |
// CONCATENATED MODULE: ./src/store/modules/services/referralInformation/actions.js | |
function setInsuranceReferralNameAndGoToInsuranceCustomerDetail({ | |
commit | |
}, referee) { | |
if (referee.isReferred) { | |
if (!lumkani["a" /* default */].isEmpty(referee.name)) { | |
commit('registerCustomerModel/setInsuranceReferralName', referee.name, { | |
root: true | |
}); | |
src_router.push({ | |
name: 'app.fireInsuranceCustomerDetails' | |
}); | |
} | |
} else { | |
commit('registerCustomerModel/setInsuranceReferralName', null, { | |
root: true | |
}); | |
src_router.push({ | |
name: 'app.fireInsuranceCustomerDetails' | |
}); | |
} | |
} | |
const referralInformation_actions_actions = { | |
setInsuranceReferralNameAndGoToInsuranceCustomerDetail | |
}; | |
/* harmony default export */ var referralInformation_actions = (referralInformation_actions_actions); | |
// CONCATENATED MODULE: ./src/store/modules/services/referralInformation/index.js | |
/* harmony default export */ var referralInformation = ({ | |
namespaced: true, | |
actions: referralInformation_actions | |
}); | |
// CONCATENATED MODULE: ./src/store/modules/services/addLives/actions.js | |
const goToAddSpousePage = ({ | |
rootState | |
}) => { | |
if (lumkani["a" /* default */].getNumberOfActiveLivesAssured(rootState.registerCustomerModel.funeral.spouse) >= constants["x" /* MAX_NUMBER_OF_SPOUSE */]) { | |
const message = 'Limit of 1 spouse has been reached'; | |
snackBar_service["error"]({ | |
message | |
}); | |
} else { | |
src_router.push({ | |
name: 'app.addSpouse' | |
}); | |
} | |
}; | |
const goToAddChildPage = ({ | |
rootState | |
}) => { | |
if (lumkani["a" /* default */].getNumberOfActiveLivesAssured(rootState.registerCustomerModel.funeral.children) >= constants["w" /* MAX_NUMBER_OF_CHILDREN */]) { | |
const message = 'Limit of 5 children has been reached'; | |
snackBar_service["error"]({ | |
message | |
}); | |
} else { | |
src_router.push({ | |
name: 'app.childCoverageInfo' | |
}); | |
} | |
}; | |
// CONCATENATED MODULE: ./src/store/modules/services/addLives/index.js | |
/* harmony default export */ var addLives = ({ | |
namespaced: true, | |
actions: addLives_actions_namespaceObject | |
}); | |
// CONCATENATED MODULE: ./src/store/modules/services/addSpouse/actions.js | |
function cleanSpouseIndex(commit) { | |
commit('setSpouseIndex', null); | |
} | |
function editSpouseLifeAssuredAndGoToListLivesPage(dispatch, commit, spouseIndex, spouse) { | |
dispatch('registerCustomerModel/editSpouseLifeAssured', { | |
index: spouseIndex, | |
spouse | |
}, { | |
root: true | |
}).then(() => { | |
cleanSpouseIndex(commit); | |
src_router.go(constants["j" /* DOWN_ONE_PAGE */]); | |
}).catch(error => { | |
snackBar_service["error"]({ | |
message: error | |
}); | |
}); | |
} | |
function assignDetectorId(spouse, detectorId) { | |
if (detectorId && spouse.detector_id == null) { | |
spouse.detector_id = detectorId; | |
} | |
return spouse; | |
} | |
function appendSpouseAndGoToAddLivesOrListLivesPage(dispatch, spouse) { | |
dispatch('registerCustomerModel/appendLifeAssuredSpouse', spouse, { | |
root: true | |
}).then(() => { | |
src_router.go(constants["k" /* DOWN_TWO_PAGES */]); | |
}).catch(error => { | |
snackBar_service["error"]({ | |
message: error | |
}); | |
}); | |
} | |
const processSpouseAndGoToNextPage = ({ | |
rootState, | |
dispatch, | |
commit | |
}, spouse) => { | |
const isUpdatingLifeAssured = rootState.registerCustomerModel.updateLivesAssured.isUpdatingLivesAssured; | |
const { | |
spouseIndex | |
} = rootState.addSpouseService; | |
const detectorID = rootState.registerCustomerModel.updateLivesAssured.detector_id; | |
const finalSpouse = assignDetectorId(spouse, detectorID); | |
if (isUpdatingLifeAssured && spouseIndex != null) { | |
editSpouseLifeAssuredAndGoToListLivesPage(dispatch, commit, spouseIndex, finalSpouse); | |
} else { | |
appendSpouseAndGoToAddLivesOrListLivesPage(dispatch, finalSpouse); | |
} | |
}; | |
const setSpouseIndex = ({ | |
commit | |
}, index) => { | |
commit('setSpouseIndex', index); | |
}; | |
// CONCATENATED MODULE: ./src/store/modules/services/addSpouse/state.js | |
const addSpouse_state_initialState = () => ({ | |
spouseIndex: null | |
}); | |
const addSpouse_state_state = addSpouse_state_initialState(); | |
// CONCATENATED MODULE: ./src/store/modules/services/addSpouse/mutations.js | |
const mutations_setSpouseIndex = (state, index) => { | |
state.spouseIndex = index; | |
}; | |
// CONCATENATED MODULE: ./src/store/modules/services/addSpouse/index.js | |
/* harmony default export */ var addSpouse = ({ | |
namespaced: true, | |
actions: addSpouse_actions_namespaceObject, | |
state: addSpouse_state_state, | |
mutations: addSpouse_mutations_namespaceObject | |
}); | |
// CONCATENATED MODULE: ./src/store/modules/services/addChild/actions.js | |
function actions_assignDetectorId(child, detectorId) { | |
if (detectorId && child.detector_id == null) { | |
child.detector_id = detectorId; | |
} | |
return child; | |
} | |
function cleanChildIndex(commit) { | |
commit('setChildIndex', null); | |
} | |
function editChildLifeAssuredListLivesPage(dispatch, commit, childIndex, child) { | |
dispatch('registerCustomerModel/editChildLifeAssured', { | |
index: childIndex, | |
child | |
}, { | |
root: true | |
}).then(() => { | |
cleanChildIndex(commit); | |
src_router.go(constants["j" /* DOWN_ONE_PAGE */]); | |
}).catch(error => { | |
snackBar_service["error"]({ | |
message: error | |
}); | |
}); | |
} | |
function appendChildAndGoToListLivesPage(dispatch, child) { | |
dispatch('registerCustomerModel/appendLifeAssuredChild', child, { | |
root: true | |
}).then(() => { | |
src_router.go(constants["k" /* DOWN_TWO_PAGES */]); | |
}).catch(error => { | |
snackBar_service["error"]({ | |
message: error | |
}); | |
}); | |
} | |
const processChildAndGoToNextPage = ({ | |
rootState, | |
dispatch, | |
commit | |
}, child) => { | |
const isUpdatingLifeAssured = rootState.registerCustomerModel.updateLivesAssured.isUpdatingLivesAssured; | |
const { | |
childIndex | |
} = rootState.addChildService; | |
const detectorID = rootState.registerCustomerModel.updateLivesAssured.detector_id; | |
const finalChild = actions_assignDetectorId(child, detectorID); | |
if (isUpdatingLifeAssured && childIndex != null) { | |
editChildLifeAssuredListLivesPage(dispatch, commit, childIndex, finalChild); | |
} else { | |
appendChildAndGoToListLivesPage(dispatch, finalChild); | |
} | |
}; | |
const setChildIndex = ({ | |
commit | |
}, index) => { | |
commit('setChildIndex', index); | |
}; | |
// CONCATENATED MODULE: ./src/store/modules/services/addChild/state.js | |
const addChild_state_initialState = () => ({ | |
childIndex: null | |
}); | |
const addChild_state_state = addChild_state_initialState(); | |
// CONCATENATED MODULE: ./src/store/modules/services/addChild/mutations.js | |
const mutations_setChildIndex = (state, index) => { | |
state.childIndex = index; | |
}; | |
// CONCATENATED MODULE: ./src/store/modules/services/addChild/index.js | |
/* harmony default export */ var addChild = ({ | |
namespaced: true, | |
actions: addChild_actions_namespaceObject, | |
state: addChild_state_state, | |
mutations: addChild_mutations_namespaceObject | |
}); | |
// CONCATENATED MODULE: ./src/store/modules/services/listLivesAssured/actions.js | |
const goToBeneficiaryPage = () => { | |
src_router.push({ | |
name: 'app.beneficiaryDetails' | |
}); | |
}; | |
const goToRegisterCustomerDataUploadPage = () => { | |
src_router.push({ | |
name: 'app.registerCustomerDataUpload' | |
}); | |
}; | |
function actions_cleanState({ | |
commit | |
}) { | |
const emptyState = { | |
funeral: { | |
spouse: [], | |
children: [] | |
} | |
}; | |
commit('registerCustomerModel/init', emptyState, { | |
root: true | |
}); | |
commit('registerCustomerModel/setFetchLivesAssured', false, { | |
root: true | |
}); | |
} | |
function actions_appendLifeAssuredSpouse({ | |
commit | |
}, spouse) { | |
commit('registerCustomerModel/appendLifeAssuredSpouse', spouse, { | |
root: true | |
}); | |
} | |
function actions_appendLifeAssuredChild({ | |
commit | |
}, child) { | |
commit('registerCustomerModel/appendLifeAssuredChild', child, { | |
root: true | |
}); | |
} | |
async function getLivesAssuredByClientId(commit, clientId) { | |
const result = await api_funeral["b" /* getLivesAssuredByClientId */](clientId); | |
if (result) { | |
for (let i = 0; i < result.data.lives_assured.length; i++) { | |
if (result.data.lives_assured[i].life_assured_type === lumkani["a" /* default */].CHILD) { | |
actions_appendLifeAssuredChild({ | |
commit | |
}, result.data.lives_assured[i]); | |
} else { | |
actions_appendLifeAssuredSpouse({ | |
commit | |
}, result.data.lives_assured[i]); | |
} | |
} | |
} | |
} | |
const listLivesAssured_actions_init = ({ | |
commit | |
}, clientId) => { | |
actions_cleanState({ | |
commit | |
}); | |
return getLivesAssuredByClientId(commit, clientId); | |
}; | |
const goToAddLivesAssuredPage = () => { | |
src_router.push({ | |
name: 'app.addLives' | |
}); | |
}; | |
const setChildIndexAndGotToAddChildPage = ({ | |
dispatch | |
}, index) => { | |
dispatch('addChildService/setChildIndex', index, { | |
root: true | |
}); | |
src_router.push({ | |
name: 'app.addChild' | |
}); | |
}; | |
const setSpouseIndexAndGotToAddSpousePage = ({ | |
dispatch | |
}, index) => { | |
dispatch('addSpouseService/setSpouseIndex', index, { | |
root: true | |
}); | |
src_router.push({ | |
name: 'app.addSpouse' | |
}); | |
}; | |
// CONCATENATED MODULE: ./src/store/modules/services/listLivesAssured/index.js | |
/* harmony default export */ var listLivesAssured = ({ | |
namespaced: true, | |
actions: listLivesAssured_actions_namespaceObject | |
}); | |
// CONCATENATED MODULE: ./src/store/modules/services/agentPassword/actions.js | |
const actions_next = async (_, password) => { | |
try { | |
loading_service["show"]({ | |
message: 'Authenticating...' | |
}); | |
await AuthService["a" /* AuthService */].authenticateUserPassword(password); | |
src_router.push({ | |
name: 'app.paymentDataUpload' | |
}); | |
} catch (error) { | |
const message = lumkani["a" /* default */].parseErrorMessage(error); | |
snackBar_service["error"]({ | |
message | |
}); | |
} finally { | |
loading_service["hide"](); | |
} | |
}; | |
// CONCATENATED MODULE: ./src/store/modules/services/agentPassword/index.js | |
/* harmony default export */ var agentPassword = ({ | |
namespaced: true, | |
actions: agentPassword_actions_namespaceObject | |
}); | |
// CONCATENATED MODULE: ./src/store/modules/services/frontDoorBarcodeScanner/actions.js | |
const scanFrontDoorBarcode = async ({ | |
commit | |
}) => { | |
const result = await Object(BarcodeScanner["a" /* scanBarcode */])(); | |
commit('registerCustomerModel/setFrontDoorBarcode', result.text, { | |
root: true | |
}); | |
return result; | |
}; | |
const frontDoorBarcodeScanner_actions_next = async ({ | |
commit | |
}, frontDoorBarcode) => { | |
try { | |
loading_service["show"]({ | |
message: 'Validating front door barcode...' | |
}); | |
const result = await api_detector.getActiveDetectorByFrontDoorBarcode(frontDoorBarcode); | |
if (result.data.detectors.length === 0) { | |
commit('registerCustomerModel/setFrontDoorBarcode', frontDoorBarcode, { | |
root: true | |
}); | |
src_router.push({ | |
name: 'app.householdPhotos' | |
}); | |
} else { | |
snackBar_service["error"]({ | |
message: 'Barcode is already registered' | |
}); | |
} | |
} catch (error) { | |
const message = lumkani["a" /* default */].parseErrorMessage(error); | |
snackBar_service["error"]({ | |
message | |
}); | |
} finally { | |
loading_service["hide"](); | |
} | |
}; | |
// CONCATENATED MODULE: ./src/store/modules/services/frontDoorBarcodeScanner/index.js | |
/* harmony default export */ var frontDoorBarcodeScanner = ({ | |
namespaced: true, | |
actions: frontDoorBarcodeScanner_actions_namespaceObject | |
}); | |
// CONCATENATED MODULE: ./src/store/modules/services/agentInstallationDashboard/state.js | |
const agentInstallationDashboard_state_state = { | |
agentInstallationDashboardStats: { | |
install_progress_percentage: 0, | |
installs_today: 0, | |
installs_yesterday: 0, | |
installs_this_week: 0, | |
install_daily_target: 0 | |
} | |
}; | |
/* harmony default export */ var agentInstallationDashboard_state = (agentInstallationDashboard_state_state); | |
// CONCATENATED MODULE: ./src/store/modules/services/agentInstallationDashboard/actions.js | |
function getInstalledDetectorsTodayByUserId(userId) { | |
return api_detector.getDetectorsCountByUserIdAndCreatedDate(userId, dateTimeHelper["b" /* default */].formatDate(dateTimeHelper["b" /* default */].getDateToday())); | |
} | |
function getInstallsByDateRange(userId, startDate, endDate) { | |
return api_detector.getDetectorsCountByUserIdAndCreatedDateRange(userId, startDate, endDate); | |
} | |
function getInstalledDetectorsYesterdayByUserId(userId) { | |
const dateToday = dateTimeHelper["b" /* default */].formatDate(dateTimeHelper["b" /* default */].getDateToday()); | |
const dateYesterday = dateTimeHelper["b" /* default */].formatDate(dateTimeHelper["b" /* default */].getDateYesterday()); | |
return getInstallsByDateRange(userId, dateYesterday, dateToday); | |
} | |
function getInstalledDetectorsThisWeekByUserId(userId) { | |
const dateTodayObject = dateTimeHelper["b" /* default */].getDateToday(); | |
const weekRange = dateTimeHelper["b" /* default */].getWeekRange(dateTodayObject); | |
const previousFridayDate = dateTimeHelper["b" /* default */].formatDate(weekRange[0]); | |
const nextFridayMidnightDate = dateTimeHelper["b" /* default */].formatDate(weekRange[1]); | |
return getInstallsByDateRange(userId, previousFridayDate, nextFridayMidnightDate); | |
} | |
function calculateProgressPercentage(installsToday) { | |
let percentage = 0; | |
if (installsToday > 0) { | |
percentage = installsToday / lumkani["a" /* default */].AGENT_INSTALLATION_TARGET; | |
} | |
return percentage; | |
} | |
async function getAgentInstallationDashboardStats({ | |
rootState, | |
commit | |
}) { | |
try { | |
loading_service["show"]({ | |
message: 'Loading Agent Stats...' | |
}); | |
const userId = rootState.authenticationService.logged_user.id; | |
const getInstalledDetectorsTodayByUserIdPromise = getInstalledDetectorsTodayByUserId(userId); | |
const getInstalledDetectorsYesterdayByUserIdPromise = getInstalledDetectorsYesterdayByUserId(userId); | |
const getInstalledDetectorsThisWeekByUserIdPromise = getInstalledDetectorsThisWeekByUserId(userId); | |
const result = await Promise.all([getInstalledDetectorsTodayByUserIdPromise, getInstalledDetectorsYesterdayByUserIdPromise, getInstalledDetectorsThisWeekByUserIdPromise]); | |
const installsToday = result[0].data.detectors_count; | |
commit('setInstallsToday', installsToday); | |
commit('setInstallsYesterday', result[1].data.detectors_count); | |
commit('setInstallsThisWeek', result[2].data.detectors_count); | |
const progressPercentage = calculateProgressPercentage(installsToday); | |
commit('setInstallProgressPercentage', progressPercentage); | |
} catch (error) { | |
const message = lumkani["a" /* default */].parseErrorMessage(error); | |
snackBar_service["error"]({ | |
message | |
}); | |
throw error; | |
} finally { | |
loading_service["hide"](); | |
} | |
} | |
async function agentInstallationDashboard_actions_init({ | |
commit, | |
rootState, | |
dispatch | |
}) { | |
const emptyAgentInstallationDashboardStats = { | |
agentInstallationDashboardStats: { | |
install_progress_percentage: 0, | |
installs_today: 0, | |
installs_yesterday: 0, | |
installs_this_week: 0, | |
install_daily_target: lumkani["a" /* default */].AGENT_INSTALLATION_TARGET | |
} | |
}; | |
commit('init', emptyAgentInstallationDashboardStats); | |
return getAgentInstallationDashboardStats({ | |
rootState, | |
commit, | |
dispatch | |
}); | |
} | |
const agentInstallationDashboard_actions_actions = { | |
init: agentInstallationDashboard_actions_init | |
}; | |
/* harmony default export */ var agentInstallationDashboard_actions = (agentInstallationDashboard_actions_actions); | |
// CONCATENATED MODULE: ./src/store/modules/services/agentInstallationDashboard/mutations.js | |
function agentInstallationDashboard_mutations_init(state, newState) { | |
Object.assign(state, newState); | |
} | |
function setInstallProgressPercentage(state, installProgressPercentage) { | |
state.agentInstallationDashboardStats.install_progress_percentage = installProgressPercentage; | |
} | |
function setInstallsToday(state, installsToday) { | |
state.agentInstallationDashboardStats.installs_today = installsToday; | |
} | |
function setInstallsYesterday(state, installsYesterday) { | |
state.agentInstallationDashboardStats.installs_yesterday = installsYesterday; | |
} | |
function setInstallsThisWeek(state, installsThisWeek) { | |
state.agentInstallationDashboardStats.installs_this_week = installsThisWeek; | |
} | |
const agentInstallationDashboard_mutations_mutations = { | |
init: agentInstallationDashboard_mutations_init, | |
setInstallProgressPercentage, | |
setInstallsToday, | |
setInstallsYesterday, | |
setInstallsThisWeek | |
}; | |
/* harmony default export */ var agentInstallationDashboard_mutations = (agentInstallationDashboard_mutations_mutations); | |
// CONCATENATED MODULE: ./src/store/modules/services/agentInstallationDashboard/getters.js | |
const getters_getters = {}; | |
/* harmony default export */ var agentInstallationDashboard_getters = (getters_getters); | |
// CONCATENATED MODULE: ./src/store/modules/services/agentInstallationDashboard/index.js | |
/* harmony default export */ var agentInstallationDashboard = ({ | |
namespaced: true, | |
state: agentInstallationDashboard_state, | |
actions: agentInstallationDashboard_actions, | |
mutations: agentInstallationDashboard_mutations, | |
getters: agentInstallationDashboard_getters | |
}); | |
// CONCATENATED MODULE: ./src/store/modules/services/updateClientInfo/actions.js | |
function updateClientInfo_actions_init(_, clientId) { | |
loading_service["show"]({ | |
message: 'Loading client information...' | |
}); | |
return api_client["a" /* default */].getClientById(clientId).then(result => result.data.detector).catch(error => { | |
snackBar_service["error"]({ | |
message: error | |
}); | |
}).finally(() => { | |
loading_service["hide"](); | |
}); | |
} | |
function updateClientInfoAndGoToViewClientPage(_, client) { | |
loading_service["show"]({ | |
message: 'Updating client information...' | |
}); | |
client.insurance_kin_dob = moment_default()(client.insurance_kin_dob).toLkDateFormat(); | |
api_client["a" /* default */].updateClientInfo(client).then(() => { | |
src_router.push({ | |
name: 'app.viewClient', | |
params: { | |
clientId: client.id | |
} | |
}); | |
}).catch(error => { | |
snackBar_service["error"]({ | |
message: error | |
}); | |
}).finally(() => { | |
loading_service["hide"](); | |
}); | |
} | |
const updateClientInfo_actions_actions = { | |
init: updateClientInfo_actions_init, | |
updateClientInfoAndGoToViewClientPage | |
}; | |
/* harmony default export */ var updateClientInfo_actions = (updateClientInfo_actions_actions); | |
// CONCATENATED MODULE: ./src/store/modules/services/updateClientInfo/index.js | |
/* harmony default export */ var updateClientInfo = ({ | |
namespaced: true, | |
actions: updateClientInfo_actions | |
}); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/utils/scroll.js | |
var utils_scroll = __webpack_require__("0831"); | |
// CONCATENATED MODULE: ./src/store/modules/services/scroll/actions.js | |
; | |
function scrollToTab(_, el) { | |
const { | |
getScrollTarget, | |
setHorizontalScrollPosition, | |
getHorizontalScrollPosition | |
} = utils_scroll["a" /* default */]; | |
const target = getScrollTarget(el); | |
const offset = getHorizontalScrollPosition(el); | |
const duration = 100; | |
setHorizontalScrollPosition(target, offset, duration); | |
} | |
const scroll_actions_actions = { | |
scrollToTab | |
}; | |
/* harmony default export */ var scroll_actions = (scroll_actions_actions); | |
// CONCATENATED MODULE: ./src/store/modules/services/scroll/index.js | |
/* harmony default export */ var services_scroll = ({ | |
namespaced: true, | |
actions: scroll_actions | |
}); | |
// CONCATENATED MODULE: ./src/store/index.js | |
vue_runtime_esm["a" /* default */].use(vuex_esm["a" /* default */]); | |
/* harmony default export */ var src_store = (() => { | |
const Store = new vuex_esm["a" /* default */].Store({ | |
strict: true, | |
modules: { | |
authenticationService: authentication, | |
googleMapsService: googleMaps, | |
registerCustomerModel: registerCustomer, | |
registerCustomerGeolocationService: registerCustomerGeolocation, | |
clientManagementService: clientManagement, | |
confirmCellphoneNumberService: confirmCellphoneNumber, | |
installOrInsuranceService: installOrInsurance, | |
registerCustomerNotesService: registerCustomerNotes, | |
referralInformationService: referralInformation, | |
addLivesService: addLives, | |
addSpouseService: addSpouse, | |
addChildService: addChild, | |
listLivesAssuredService: listLivesAssured, | |
agentPasswordService: agentPassword, | |
frontDoorBarcodeScannerService: frontDoorBarcodeScanner, | |
agentInstallationDashboardService: agentInstallationDashboard, | |
updateClientInfoService: updateClientInfo, | |
scrollService: services_scroll | |
} | |
}); | |
return Store; | |
}); | |
// CONCATENATED MODULE: ./.quasar/app.js | |
/** | |
* THIS FILE IS GENERATED AUTOMATICALLY. | |
* DO NOT EDIT. | |
* | |
* You are probably looking on adding startup/initialization code. | |
* Use "quasar new boot <name>" and add it there. | |
* One boot file per concern. Then reference the file(s) in quasar.conf.js > boot: | |
* boot: ['file', ...] // do not add ".js" extension to it. | |
* | |
* Boot files are your "main.js" | |
**/ | |
/* harmony default export */ var _quasar_app = (async function () { | |
// create store and router instances | |
const store = typeof src_store === 'function' ? await src_store({ | |
Vue: vue_runtime_esm["a" /* default */] | |
}) : src_store; | |
const router = typeof src_router === 'function' ? await src_router({ | |
Vue: vue_runtime_esm["a" /* default */], | |
store | |
}) : src_router; | |
// make router instance available in store | |
store.$router = router; | |
// Create the app instantiation Object. | |
// Here we inject the router, store to all child components, | |
// making them available everywhere as `this.$router` and `this.$store`. | |
const app = { | |
router, | |
store, | |
render: h => h(App) | |
}; | |
app.el = '#q-app'; | |
// expose the app, the router and the store. | |
// note we are not mounting the app here, since bootstrapping will be | |
// different depending on whether we are in a browser or on the server. | |
return { | |
app, | |
store, | |
router | |
}; | |
}); | |
// EXTERNAL MODULE: ./src/models/ErrorModel/index.js | |
var ErrorModel = __webpack_require__("9ea1"); | |
// CONCATENATED MODULE: ./src/boot/index.js | |
vue_runtime_esm["a" /* default */].prototype.deepCopy = helpers["b" /* deepCopy */]; | |
vue_runtime_esm["a" /* default */].config.errorHandler = (err, vm) => { | |
if (err instanceof ErrorModel["a" /* default */]) { | |
if (err.config.asBanner) { | |
vm.$snackbar.asErrorBanner({ | |
message: err.message, | |
color: 'negative' | |
}); | |
} | |
} else { | |
vm.$snackbar.error({ | |
message: vm.$lk.parseErrorMessage(err) | |
}); | |
} | |
if (true) { | |
throw err; | |
} | |
}; | |
// EXTERNAL MODULE: ./node_modules/axios/index.js | |
var axios = __webpack_require__("bc3a"); | |
var axios_default = /*#__PURE__*/__webpack_require__.n(axios); | |
// CONCATENATED MODULE: ./src/boot/axios.js | |
/* harmony default export */ var boot_axios = (({ | |
Vue | |
}) => { | |
Vue.prototype.$axios = axios_default.a; | |
}); | |
// EXTERNAL MODULE: ./node_modules/vuelidate/lib/index.js | |
var lib = __webpack_require__("1dce"); | |
var lib_default = /*#__PURE__*/__webpack_require__.n(lib); | |
// CONCATENATED MODULE: ./src/boot/vuelidate.js | |
/* harmony default export */ var vuelidate = (({ | |
Vue | |
}) => { | |
Vue.use(lib_default.a); | |
}); | |
// EXTERNAL MODULE: ./node_modules/@sentry/vue/esm/sdk.js + 16 modules | |
var sdk = __webpack_require__("8a39"); | |
// EXTERNAL MODULE: ./node_modules/@sentry/vue/esm/router.js | |
var esm_router = __webpack_require__("1ddb"); | |
// EXTERNAL MODULE: ./node_modules/@sentry/core/esm/exports.js | |
var esm_exports = __webpack_require__("02c5"); | |
// EXTERNAL MODULE: ./node_modules/@sentry/tracing/esm/index.js + 19 modules | |
var esm = __webpack_require__("688d"); | |
// CONCATENATED MODULE: ./src/boot/sentry-browser.js | |
/* eslint no-console: "off" */ | |
console.log(`Sentry ${"DEV"}`); | |
let sentryDNS = null; | |
if (false) {} else if (false) {} else if (true) { | |
sentryDNS = 'https://[email protected]/5732505'; | |
} else {} | |
if (sentryDNS != null) { | |
sdk["a" /* init */]({ | |
Vue: vue_runtime_esm["a" /* default */], | |
dsn: sentryDNS, | |
integrations: [new esm["a" /* BrowserTracing */]({ | |
routingInstrumentation: esm_router["a" /* vueRouterInstrumentation */](src_router) | |
})], | |
release: `lumkani-quasar-app-${"DEV".toLowerCase()}@${"3.3.0-rc"}` | |
}); | |
esm_exports["c" /* configureScope */](scope => { | |
scope.setExtra('apiBaseUrl', "https://dev.lumkani.org"); | |
scope.setExtra('appVersion', "3.3.0-rc"); | |
scope.setExtra('environmentIndicator', " - DEV"); | |
scope.setTag('stage', "DEV"); | |
scope.setExtra('stage', "DEV"); | |
scope.setExtra('quasarModeName', "spa"); | |
}); | |
} else { | |
console.log('Sentry disabled locally'); | |
} | |
// EXTERNAL MODULE: ./node_modules/@vue/babel-helper-vue-jsx-merge-props/dist/helper.js | |
var helper = __webpack_require__("2638"); | |
var helper_default = /*#__PURE__*/__webpack_require__.n(helper); | |
// CONCATENATED MODULE: ./node_modules/@quasar/app/lib/webpack/loader.transform-quasar-imports.js!./node_modules/babel-loader/lib??ref--2-0!./node_modules/@quasar/app/lib/webpack/loader.auto-import-client.js?kebab!./node_modules/vue-loader/lib??vue-loader-options!./src/components/BaseInput/index.vue?vue&type=script&lang=js& | |
const getValidators = ({ | |
data, | |
parent | |
}) => { | |
const { | |
$error, | |
$touch | |
} = data.model.expression.split('.').reduce((result, val) => result[val], parent.$v); | |
return { | |
onError: $error || false, | |
onBlur: $touch || (() => {}) | |
}; | |
}; | |
const getEvents = ({ | |
props, | |
listeners | |
}) => props.counter ? { | |
input: e => listeners.input(e) | |
} : { | |
change: e => listeners.input(e.target.value) | |
}; | |
/* harmony default export */ var BaseInputvue_type_script_lang_js_ = ({ | |
functional: true, | |
render: (h, ctx) => { | |
const { | |
onError, | |
onBlur | |
} = getValidators(ctx); | |
const events = getEvents(ctx); | |
return h("QInput", helper_default()([{}, { | |
"props": { | |
floatLabel: true, | |
error: onError, | |
errorMessage: ctx.props.errorMessage || 'This field is required', | |
...ctx.props | |
} | |
}, { | |
"attrs": { | |
"data-e2e": ctx.props.dataE2e | |
} | |
}, { | |
"on": { | |
blur: onBlur, | |
...events | |
} | |
}])); | |
} | |
}); | |
// CONCATENATED MODULE: ./src/components/BaseInput/index.vue?vue&type=script&lang=js& | |
/* harmony default export */ var components_BaseInputvue_type_script_lang_js_ = (BaseInputvue_type_script_lang_js_); | |
// CONCATENATED MODULE: ./src/components/BaseInput/index.vue | |
var BaseInput_render, BaseInput_staticRenderFns | |
/* normalize component */ | |
var BaseInput_component = Object(componentNormalizer["a" /* default */])( | |
components_BaseInputvue_type_script_lang_js_, | |
BaseInput_render, | |
BaseInput_staticRenderFns, | |
false, | |
null, | |
null, | |
null | |
) | |
/* harmony default export */ var BaseInput = (BaseInput_component.exports); | |
// CONCATENATED MODULE: ./node_modules/@quasar/app/lib/webpack/loader.transform-quasar-imports.js!./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--7!./node_modules/@quasar/app/lib/webpack/loader.auto-import-client.js?kebab!./node_modules/vue-loader/lib??vue-loader-options!./src/components/BaseSelect/index.vue?vue&type=template&id=32a7daf8& | |
var BaseSelectvue_type_template_id_32a7daf8_render = function render() { | |
var _vm = this, | |
_c = _vm._self._c; | |
return _c('q-select', _vm._b({ | |
attrs: { | |
"float-label": "", | |
"emit-value": "", | |
"map-options": "", | |
"data-e2e": _vm.dataE2e | |
}, | |
on: { | |
"blur": _vm.blur, | |
"input": function ($event) { | |
return _vm.$emit('input', $event); | |
} | |
}, | |
scopedSlots: _vm._u([{ | |
key: "option", | |
fn: function ({ | |
index, | |
opt, | |
toggleOption | |
}) { | |
return [_c('q-item', { | |
attrs: { | |
"clickable": "", | |
"data-e2e": `${_vm.dataE2e}-option-${index}` | |
}, | |
on: { | |
"click": function ($event) { | |
return toggleOption(opt); | |
} | |
} | |
}, [_c('q-item-section', [_vm._v("\n " + _vm._s(opt.label) + "\n ")])], 1)]; | |
} | |
}]) | |
}, 'q-select', _vm.$attrs, false)); | |
}; | |
var BaseSelectvue_type_template_id_32a7daf8_staticRenderFns = []; | |
// CONCATENATED MODULE: ./src/components/BaseSelect/index.vue?vue&type=template&id=32a7daf8& | |
// CONCATENATED MODULE: ./node_modules/@quasar/app/lib/webpack/loader.transform-quasar-imports.js!./node_modules/babel-loader/lib??ref--2-0!./node_modules/@quasar/app/lib/webpack/loader.auto-import-client.js?kebab!./node_modules/vue-loader/lib??vue-loader-options!./src/components/BaseSelect/index.vue?vue&type=script&lang=js& | |
; | |
/* harmony default export */ var BaseSelectvue_type_script_lang_js_ = ({ | |
components: { | |
QSelect: QSelect["a" /* default */] | |
}, | |
props: { | |
dataE2e: { | |
type: String, | |
required: false, | |
default: '' | |
}, | |
blur: { | |
type: Function, | |
default: () => {} | |
} | |
} | |
}); | |
// CONCATENATED MODULE: ./src/components/BaseSelect/index.vue?vue&type=script&lang=js& | |
/* harmony default export */ var components_BaseSelectvue_type_script_lang_js_ = (BaseSelectvue_type_script_lang_js_); | |
// EXTERNAL MODULE: ./node_modules/@quasar/app/lib/webpack/runtime.auto-import.js | |
var runtime_auto_import = __webpack_require__("eebe"); | |
var runtime_auto_import_default = /*#__PURE__*/__webpack_require__.n(runtime_auto_import); | |
// CONCATENATED MODULE: ./src/components/BaseSelect/index.vue | |
/* normalize component */ | |
var BaseSelect_component = Object(componentNormalizer["a" /* default */])( | |
components_BaseSelectvue_type_script_lang_js_, | |
BaseSelectvue_type_template_id_32a7daf8_render, | |
BaseSelectvue_type_template_id_32a7daf8_staticRenderFns, | |
false, | |
null, | |
null, | |
null | |
) | |
/* harmony default export */ var BaseSelect = (BaseSelect_component.exports); | |
runtime_auto_import_default()(BaseSelect_component, 'components', {QSelect: QSelect["a" /* default */],QItem: QItem["a" /* default */],QItemSection: QItemSection["a" /* default */]}); | |
// CONCATENATED MODULE: ./node_modules/@quasar/app/lib/webpack/loader.transform-quasar-imports.js!./node_modules/babel-loader/lib??ref--2-0!./node_modules/@quasar/app/lib/webpack/loader.auto-import-client.js?kebab!./node_modules/vue-loader/lib??vue-loader-options!./src/components/BaseLayout/index.vue?vue&type=script&lang=js& | |
/* harmony default export */ var BaseLayoutvue_type_script_lang_js_ = ({ | |
functional: true, | |
render: (h, ctx) => { | |
const defaultLayout = ({ | |
children | |
}) => h("main", { | |
"class": "row justify-center" | |
}, [h("section", { | |
"class": "col-md-4 col-sm-6 col-xs-12" | |
}, [children])]); | |
const gridLayout = ({ | |
scopedSlots | |
}) => h("main", { | |
"class": "q-pa-md" | |
}, [h("section", { | |
"class": "q-gutter-sm l-grid" | |
}, [scopedSlots.grid()])]); | |
let layout = defaultLayout; | |
if (ctx.scopedSlots.grid) { | |
layout = gridLayout; | |
} | |
return layout(ctx); | |
} | |
}); | |
// CONCATENATED MODULE: ./src/components/BaseLayout/index.vue?vue&type=script&lang=js& | |
/* harmony default export */ var components_BaseLayoutvue_type_script_lang_js_ = (BaseLayoutvue_type_script_lang_js_); | |
// CONCATENATED MODULE: ./src/components/BaseLayout/index.vue | |
var BaseLayout_render, BaseLayout_staticRenderFns | |
/* normalize component */ | |
var BaseLayout_component = Object(componentNormalizer["a" /* default */])( | |
components_BaseLayoutvue_type_script_lang_js_, | |
BaseLayout_render, | |
BaseLayout_staticRenderFns, | |
false, | |
null, | |
null, | |
null | |
) | |
/* harmony default export */ var BaseLayout = (BaseLayout_component.exports); | |
// CONCATENATED MODULE: ./node_modules/@quasar/app/lib/webpack/loader.transform-quasar-imports.js!./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--7!./node_modules/@quasar/app/lib/webpack/loader.auto-import-client.js?kebab!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SignaturePad/index.vue?vue&type=template&id=074220ac& | |
var SignaturePadvue_type_template_id_074220ac_render = function render() { | |
var _vm = this, | |
_c = _vm._self._c; | |
return _c('div', [_c('canvas', _vm._b({ | |
ref: "canvas", | |
staticClass: "signature-canvas full-width p-solid-porder-1 q-mt-md", | |
attrs: { | |
"id": "canvas", | |
"height": "600" | |
} | |
}, 'canvas', _vm.$attrs, false)), _vm._t("default", null, null, { | |
clearSignature: _vm.clearSignature, | |
captureSignature: _vm.captureSignature | |
})], 2); | |
}; | |
var SignaturePadvue_type_template_id_074220ac_staticRenderFns = []; | |
// CONCATENATED MODULE: ./src/components/SignaturePad/index.vue?vue&type=template&id=074220ac& | |
// EXTERNAL MODULE: ./node_modules/signature_pad/dist/signature_pad.js | |
var signature_pad = __webpack_require__("90e2"); | |
// CONCATENATED MODULE: ./src/components/SignaturePad/model.js | |
let signaturePad = {}; | |
const onResize = () => { | |
const ratio = Math.max(window.devicePixelRatio || 1, 1); | |
signaturePad.canvas.width = signaturePad.canvas.offsetWidth * ratio; | |
signaturePad.canvas.height = signaturePad.canvas.offsetHeight * ratio; | |
signaturePad.canvas.getContext('2d').scale(ratio, ratio); | |
signaturePad.clear(); | |
}; | |
class SignaturePadViewModel {} | |
defineProperty_default()(SignaturePadViewModel, "methods", { | |
captureSignature: vm => { | |
if (signaturePad.isEmpty()) { | |
vm.$snackbar.error({ | |
message: 'Please sign to proceed' | |
}); | |
} else { | |
vm.$emit('input', signaturePad.toDataURL('image/jpeg')); | |
} | |
}, | |
clearSignature: vm => { | |
signaturePad.clear(); | |
vm.$emit('input', ''); | |
} | |
}); | |
defineProperty_default()(SignaturePadViewModel, "created", () => window.addEventListener('resize', onResize)); | |
defineProperty_default()(SignaturePadViewModel, "mounted", vm => { | |
signaturePad = new signature_pad["a" /* default */](vm.$refs.canvas, { | |
backgroundColor: 'rgb(255, 255, 255)' | |
}); | |
onResize(); | |
if (vm.value) { | |
signaturePad.fromDataURL(vm.value); | |
} | |
}); | |
defineProperty_default()(SignaturePadViewModel, "beforeDestroy", () => { | |
window.removeEventListener('resize', onResize); | |
signaturePad = {}; | |
}); | |
// CONCATENATED MODULE: ./node_modules/@quasar/app/lib/webpack/loader.transform-quasar-imports.js!./node_modules/babel-loader/lib??ref--2-0!./node_modules/@quasar/app/lib/webpack/loader.auto-import-client.js?kebab!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SignaturePad/index.vue?vue&type=script&lang=js& | |
/* harmony default export */ var SignaturePadvue_type_script_lang_js_ = ({ | |
props: { | |
value: { | |
type: [String], | |
required: true | |
} | |
}, | |
ViewModel: SignaturePadViewModel | |
}); | |
// CONCATENATED MODULE: ./src/components/SignaturePad/index.vue?vue&type=script&lang=js& | |
/* harmony default export */ var components_SignaturePadvue_type_script_lang_js_ = (SignaturePadvue_type_script_lang_js_); | |
// CONCATENATED MODULE: ./src/components/SignaturePad/index.vue | |
/* normalize component */ | |
var SignaturePad_component = Object(componentNormalizer["a" /* default */])( | |
components_SignaturePadvue_type_script_lang_js_, | |
SignaturePadvue_type_template_id_074220ac_render, | |
SignaturePadvue_type_template_id_074220ac_staticRenderFns, | |
false, | |
null, | |
null, | |
null | |
) | |
/* harmony default export */ var SignaturePad = (SignaturePad_component.exports); | |
// EXTERNAL MODULE: ./src/components/TakePhotoButton/index.vue + 8 modules | |
var TakePhotoButton = __webpack_require__("b0ae"); | |
// CONCATENATED MODULE: ./node_modules/@quasar/app/lib/webpack/loader.transform-quasar-imports.js!./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--7!./node_modules/@quasar/app/lib/webpack/loader.auto-import-client.js?kebab!./node_modules/vue-loader/lib??vue-loader-options!./src/components/AgentDetailsEdit/index.vue?vue&type=template&id=6135f25f& | |
var AgentDetailsEditvue_type_template_id_6135f25f_render = function render() { | |
var _vm = this, | |
_c = _vm._self._c; | |
return _c('q-card', { | |
staticClass: "col-grow l-card-top" | |
}, [_c('q-expansion-item', { | |
staticClass: "l-card-top l-page-title", | |
attrs: { | |
"label": "Agent Details", | |
"default-opened": "" | |
} | |
}, [_c('div', { | |
staticClass: "column q-gutter-y-sm q-px-md" | |
}, [_c('div', { | |
staticClass: "l-flex-table" | |
}, [_c('p', { | |
staticClass: "l-text-heading ma-0" | |
}, [_vm._v("\n Agent\n ")]), _c('q-select', { | |
attrs: { | |
"outlined": "", | |
"dense": "", | |
"hide-dropdown-icon": "", | |
"clearable": "", | |
"use-input": "", | |
"use-chips": "", | |
"hide-hint": "", | |
"option-value": "id", | |
"option-label": "name", | |
"map-options": "", | |
"error-message": "This field is required", | |
"options": _vm.users, | |
"error": _vm.$v.agentDetails.id.$error | |
}, | |
on: { | |
"blur": _vm.$v.agentDetails.id.$touch, | |
"~input": function ($event) { | |
return _vm.$v.agentDetails.id.$touch.apply(null, arguments); | |
}, | |
"filter": _vm.filterUsers | |
}, | |
scopedSlots: _vm._u([{ | |
key: "no-option", | |
fn: function () { | |
return [_c('q-item', [_c('q-item-section', { | |
staticClass: "text-grey" | |
}, [_vm._v("\n No results\n ")])], 1)]; | |
}, | |
proxy: true | |
}]), | |
model: { | |
value: _vm.agentDetails, | |
callback: function ($$v) { | |
_vm.agentDetails = $$v; | |
}, | |
expression: "agentDetails" | |
} | |
})], 1), _c('q-btn', { | |
staticClass: "l-btn-full", | |
attrs: { | |
"type": "button", | |
"label": "Update Agent Details", | |
"no-caps": "", | |
"color": "primary", | |
"size": "1rem", | |
"disable": _vm.disableAgentUpdateButton | |
}, | |
on: { | |
"click": function ($event) { | |
return _vm.$emit('click'); | |
} | |
} | |
})], 1)])], 1); | |
}; | |
var AgentDetailsEditvue_type_template_id_6135f25f_staticRenderFns = []; | |
// CONCATENATED MODULE: ./src/components/AgentDetailsEdit/index.vue?vue&type=template&id=6135f25f& | |
// CONCATENATED MODULE: ./src/components/AgentDetailsEdit/constants.js | |
const MINIMUM_STRING_LENGTH = 3; | |
// CONCATENATED MODULE: ./src/components/AgentDetailsEdit/private.js | |
const listUsers = params => { | |
const filters = { | |
typeIn: [constants["O" /* USER_TYPE */].ADMIN, constants["O" /* USER_TYPE */].INSURANCE], | |
isActive: true, | |
...params | |
}; | |
// !TODO: We exposing too much of the internals of the API, we should tighten up the abstraction and change everywhere else | |
return services["t" /* UserService */].listUsers(filters); | |
}; | |
const filterUsers = async (vm, filters) => { | |
try { | |
const { | |
users | |
} = await listUsers(filters); | |
vm.users = users; | |
} catch (e) { | |
const message = vm.$lk.parseErrorMessage(e); | |
vm.$snackbar.error({ | |
message | |
}); | |
} | |
}; | |
const resetUsers = (vm, abort) => { | |
vm.users = []; | |
return abort(); | |
}; | |
const updateUser = vm => { | |
if (vm.$v.agentDetails.$anyDirty && !vm.$v.agentDetails.id.$error) { | |
vm.$loader.show({ | |
message: 'Updating Agent Details' | |
}); | |
return services["q" /* PolicyService */].updatePolicy(vm.clientId, { | |
userId: vm.agentDetails.id | |
}).then(() => { | |
vm.$v.agentDetails.$reset(); | |
vm.$snackbar.success({ | |
message: 'Updated Agent Details Successfully' | |
}); | |
}).catch(err => vm.$snackbar.error({ | |
message: vm.$lk.parseErrorMessage(err) | |
})).finally(vm.$loader.hide); | |
} | |
}; | |
// CONCATENATED MODULE: ./src/components/AgentDetailsEdit/model.js | |
class AgentDetailsEditViewModel {} | |
defineProperty_default()(AgentDetailsEditViewModel, "data", () => ({ | |
agentDetails: { | |
id: null | |
}, | |
users: [] | |
})); | |
defineProperty_default()(AgentDetailsEditViewModel, "methods", { | |
filterUsers: (vm, val, update, abort) => { | |
let handler = () => resetUsers(vm, abort); | |
if (val.length >= MINIMUM_STRING_LENGTH) { | |
handler = () => update(() => filterUsers(vm, { | |
name: val | |
})); | |
} | |
return handler(); | |
}, | |
updateUser: updateUser | |
}); | |
defineProperty_default()(AgentDetailsEditViewModel, "validations", ({ | |
required | |
}) => ({ | |
agentDetails: { | |
id: { | |
required | |
} | |
} | |
})); | |
defineProperty_default()(AgentDetailsEditViewModel, "computed", { | |
disableAgentUpdateButton: vm => { | |
var _vm$agentDetails; | |
return !(vm.$v.agentDetails.$anyDirty && (_vm$agentDetails = vm.agentDetails) !== null && _vm$agentDetails !== void 0 && _vm$agentDetails.id); | |
} | |
}); | |
defineProperty_default()(AgentDetailsEditViewModel, "watch", { | |
'$v.agentDetails.$anyDirty': (vm, n) => vm.$emit('data-changed', n), | |
'$v.agentDetails.$error': (vm, n) => vm.$emit('error-state', n) | |
}); | |
defineProperty_default()(AgentDetailsEditViewModel, "mounted", async vm => { | |
const user = await services["t" /* UserService */].getUserById(vm.userId); | |
vm.agentDetails = user; | |
vm.$emit('handler', vm.updateUser); | |
}); | |
// CONCATENATED MODULE: ./node_modules/@quasar/app/lib/webpack/loader.transform-quasar-imports.js!./node_modules/babel-loader/lib??ref--2-0!./node_modules/@quasar/app/lib/webpack/loader.auto-import-client.js?kebab!./node_modules/vue-loader/lib??vue-loader-options!./src/components/AgentDetailsEdit/index.vue?vue&type=script&lang=js& | |
/* harmony default export */ var AgentDetailsEditvue_type_script_lang_js_ = ({ | |
props: { | |
userId: { | |
type: Number, | |
required: true | |
}, | |
clientId: { | |
type: Number, | |
required: true | |
} | |
}, | |
ViewModel: AgentDetailsEditViewModel | |
}); | |
// CONCATENATED MODULE: ./src/components/AgentDetailsEdit/index.vue?vue&type=script&lang=js& | |
/* harmony default export */ var components_AgentDetailsEditvue_type_script_lang_js_ = (AgentDetailsEditvue_type_script_lang_js_); | |
// CONCATENATED MODULE: ./src/components/AgentDetailsEdit/index.vue | |
/* normalize component */ | |
var AgentDetailsEdit_component = Object(componentNormalizer["a" /* default */])( | |
components_AgentDetailsEditvue_type_script_lang_js_, | |
AgentDetailsEditvue_type_template_id_6135f25f_render, | |
AgentDetailsEditvue_type_template_id_6135f25f_staticRenderFns, | |
false, | |
null, | |
null, | |
null | |
) | |
/* harmony default export */ var AgentDetailsEdit = (AgentDetailsEdit_component.exports); | |
runtime_auto_import_default()(AgentDetailsEdit_component, 'components', {QCard: QCard["a" /* default */],QExpansionItem: QExpansionItem["a" /* default */],QSelect: QSelect["a" /* default */],QItem: QItem["a" /* default */],QItemSection: QItemSection["a" /* default */],QBtn: QBtn["a" /* default */]}); | |
// CONCATENATED MODULE: ./src/boot/global-components.js | |
vue_runtime_esm["a" /* default */].component('BaseInput', BaseInput); | |
vue_runtime_esm["a" /* default */].component('BaseSelect', BaseSelect); | |
vue_runtime_esm["a" /* default */].component('Responsive', BaseLayout); | |
vue_runtime_esm["a" /* default */].component('SignaturePad', SignaturePad); | |
vue_runtime_esm["a" /* default */].component('TakePhotoButton', TakePhotoButton["a" /* default */]); | |
vue_runtime_esm["a" /* default */].component('AgentDetailsEdit', AgentDetailsEdit); | |
// CONCATENATED MODULE: ./src/boot/global-classes-extensions.js | |
Date.prototype.isFriday = function isFriday() { | |
return this.getDate() === 5; | |
}; | |
moment_default.a.prototype.toLkDateFormat = function toLkDateFormat() { | |
return this.format(lumkani["a" /* default */].DATE_FORMAT); | |
}; | |
moment_default.a.prototype.toLkDateTimeFormat = function toLkDateTimeFormat() { | |
return this.format(`${lumkani["a" /* default */].DATE_FORMAT} ${lumkani["a" /* default */].TIME_FORMAT}`); | |
}; | |
moment_default.a.prototype.toLkDatabaseDateTimeFormat = function toLkDatabaseDateTimeFormat() { | |
return this.format(lumkani["a" /* default */].DATABASE_DATETIME_FORMAT); | |
}; | |
moment_default.a.prototype.toLkMonthNameAndYearFormat = function toLkMonthNameAndYearFormat() { | |
return this.format(lumkani["a" /* default */].MONTH_NAME_AND_YEAR_DATE_FORMAT); | |
}; | |
window.resolveLocalFileSystemURLWithPromise = nativeURL => new Promise((resolve, reject) => { | |
window.resolveLocalFileSystemURL(nativeURL, fileEntry => { | |
resolve(fileEntry); | |
}, error => { | |
reject(error); | |
}); | |
}); | |
// CONCATENATED MODULE: ./src/boot/auth.js | |
const auth = vue_runtime_esm["a" /* default */].observable({ | |
loggedUser: {}, | |
config: {} | |
}); | |
const beforeCreate = async vm => { | |
if (!vm.$options.ViewModel) { | |
return; | |
} | |
if (!vue_runtime_esm["a" /* default */].prototype.$auth) { | |
vue_runtime_esm["a" /* default */].prototype.$auth = auth; | |
} | |
auth.loggedUser = await services["a" /* AuthService */].whoAmI(); | |
if (auth.loggedUser) { | |
auth.config = await services["e" /* ConfigService */].getConfig(); | |
} | |
}; | |
const authMixin = { | |
beforeCreate() { | |
return beforeCreate(this); | |
} | |
}; | |
vue_runtime_esm["a" /* default */].mixin(authMixin); | |
// EXTERNAL MODULE: ./node_modules/@lumkani/view-model-api/dist/view-model-api.esm.js | |
var view_model_api_esm = __webpack_require__("5b3e"); | |
// EXTERNAL MODULE: ./node_modules/vueventjs/dist/vuevent.esm.js | |
var vuevent_esm = __webpack_require__("c531"); | |
// EXTERNAL MODULE: ./node_modules/vuelidate/lib/validators/index.js | |
var lib_validators = __webpack_require__("b5ae"); | |
// EXTERNAL MODULE: ./src/helpers/filters.js | |
var helpers_filters = __webpack_require__("726d"); | |
// EXTERNAL MODULE: ./src/filters/index.js + 1 modules | |
var src_filters = __webpack_require__("8975"); | |
// CONCATENATED MODULE: ./modifiers.js | |
const addVuelidate = ctx => { | |
const { | |
validations | |
} = ctx.ViewModel; | |
const validators = { | |
...lib_validators, | |
...helpers_filters, | |
...src_filters | |
}; | |
if (validations) { | |
const dynamicValidationFn = validations(validators); | |
const isDynamicValidation = typeof dynamicValidationFn === 'function' ? () => dynamicValidationFn(ctx.vm) : dynamicValidationFn; | |
ctx.vm.$options.validations = isDynamicValidation; | |
} | |
}; | |
const addConstants = ctx => { | |
const { | |
constants = () => ({}) | |
} = ctx.ViewModel; | |
const constantsObject = constants(ctx.vm); | |
const constantsKeys = Object.keys(constantsObject); | |
for (const key of constantsKeys) { | |
Object.defineProperty(ctx.vm, key, { | |
value: Object.freeze(constantsObject[key]), | |
writable: false, | |
configurable: false, | |
enumerable: false | |
}); | |
} | |
}; | |
const addVuex = ctx => { | |
const { | |
vuex = {} | |
} = ctx.ViewModel; | |
const { | |
state = {}, | |
getters = {}, | |
mutations = {}, | |
actions = {} | |
} = vuex; | |
ctx.addToComputed({ | |
...Object(vuex_esm["e" /* mapState */])(state), | |
...Object(vuex_esm["c" /* mapGetters */])(getters) | |
}); | |
ctx.addToMethods({ | |
...Object(vuex_esm["d" /* mapMutations */])(mutations), | |
...Object(vuex_esm["b" /* mapActions */])(actions) | |
}); | |
}; | |
const addGeneralHelpers = () => { | |
vue_runtime_esm["a" /* default */].prototype.$snackbar = snackBar_service; | |
vue_runtime_esm["a" /* default */].prototype.$loader = loading_service; | |
vue_runtime_esm["a" /* default */].prototype.$lk = lumkani["a" /* default */]; | |
}; | |
const addStore = ctx => { | |
const { | |
store | |
} = ctx.ViewModel; | |
if (store) { | |
const computedMappers = Object.keys(store).reduce((result, key) => { | |
let cp = () => store[key]; | |
if (typeof store[key] !== 'object' || store[key] == null) { | |
cp = { | |
get: cp, | |
set: value => { | |
store[key] = value; | |
} | |
}; | |
} | |
return { | |
...result, | |
[key]: cp | |
}; | |
}, {}); | |
ctx.vm.$options.computed = { | |
...ctx.vm.$options.computed, | |
...computedMappers, | |
$s: () => store | |
}; | |
} | |
}; | |
const addVuevent = ctx => { | |
const { | |
events | |
} = ctx.ViewModel; | |
if (events) { | |
const { | |
window: w = {}, | |
document: d = {} | |
} = events; | |
const eventsToHandler = { | |
window: {}, | |
document: {} | |
}; | |
Object.entries(w).forEach(([key, fn]) => { | |
eventsToHandler.window[key] = (...args) => fn(ctx.vm, ...args); | |
}); | |
Object.entries(d).forEach(([key, fn]) => { | |
eventsToHandler.document[key] = (...args) => fn(ctx.vm, ...args); | |
}); | |
ctx.vm.$options.events = eventsToHandler; | |
} | |
}; | |
const modifiers = [addVuevent, addGeneralHelpers, addVuelidate, addConstants, addVuex, addStore]; | |
// CONCATENATED MODULE: ./src/boot/view-model.js | |
/** | |
* Please ensure that the ViewModel plugin is registered before the Vuevent plugin. | |
* If not in the correct order the app crash model events would no longer fire. | |
*/ | |
vue_runtime_esm["a" /* default */].use(view_model_api_esm["a" /* ViewModel */], { | |
modifiers: modifiers | |
}); | |
vue_runtime_esm["a" /* default */].use(vuevent_esm["a" /* Vuevent */]); | |
// CONCATENATED MODULE: ./src/boot/unregister-service-worker.js | |
/* eslint no-console: "off" */ | |
/* eslint no-magic-numbers: "off" */ | |
const IS_WEB = document.URL.includes('http://') || document.URL.includes('https://'); | |
function unRegisterSw() { | |
console.log('Uninstalling Service Worker if one exists'); | |
if (!('serviceWorker' in navigator)) { | |
console.log('Service Worker API not available therefore no service workers to uninstall'); | |
return; | |
} | |
navigator.serviceWorker.getRegistrations().then(registrations => { | |
for (const registration of registrations) { | |
registration.unregister().then(() => { | |
console.log('Service worker successfully uninstalled'); | |
}); | |
} | |
}); | |
} | |
/* harmony default export */ var unregister_service_worker = (() => { | |
if (IS_WEB) { | |
setTimeout(unRegisterSw, 30000); | |
} | |
}); | |
// CONCATENATED MODULE: ./.quasar/client-entry.js | |
/** | |
* THIS FILE IS GENERATED AUTOMATICALLY. | |
* DO NOT EDIT. | |
* | |
* You are probably looking on adding startup/initialization code. | |
* Use "quasar new boot <name>" and add it there. | |
* One boot file per concern. Then reference the file(s) in quasar.conf.js > boot: | |
* boot: ['file', ...] // do not add ".js" extension to it. | |
* | |
* Boot files are your "main.js" | |
**/ | |
// We load Quasar stylesheet file | |
vue_runtime_esm["a" /* default */].config.devtools = true; | |
vue_runtime_esm["a" /* default */].config.productionTip = false; | |
const publicPath = ``; | |
async function start() { | |
const { | |
app, | |
store, | |
router | |
} = await _quasar_app(); | |
let hasRedirected = false; | |
const redirect = url => { | |
hasRedirected = true; | |
const normalized = Object(url) === url ? router.resolve(url).route.fullPath : url; | |
window.location.href = normalized; | |
}; | |
const urlPath = window.location.href.replace(window.location.origin, ''); | |
const bootFiles = [/* Cannot get final name for export "default" in "./src/boot/index.js" (known exports: , known reexports: ) */ undefined, boot_axios, vuelidate, /* Cannot get final name for export "default" in "./src/boot/sentry-browser.js" (known exports: , known reexports: ) */ undefined, /* Cannot get final name for export "default" in "./src/boot/global-components.js" (known exports: , known reexports: ) */ undefined, /* Cannot get final name for export "default" in "./src/boot/global-classes-extensions.js" (known exports: , known reexports: ) */ undefined, /* Cannot get final name for export "default" in "./src/boot/auth.js" (known exports: , known reexports: ) */ undefined, /* Cannot get final name for export "default" in "./src/boot/view-model.js" (known exports: , known reexports: ) */ undefined, unregister_service_worker]; | |
for (let i = 0; hasRedirected === false && i < bootFiles.length; i++) { | |
if (typeof bootFiles[i] !== 'function') { | |
continue; | |
} | |
try { | |
await bootFiles[i]({ | |
app, | |
router, | |
store, | |
Vue: vue_runtime_esm["a" /* default */], | |
ssrContext: null, | |
redirect, | |
urlPath, | |
publicPath | |
}); | |
} catch (err) { | |
if (err && err.url) { | |
window.location.href = err.url; | |
return; | |
} | |
console.error('[Quasar] boot error:', err); | |
return; | |
} | |
} | |
if (hasRedirected === true) { | |
return; | |
} | |
new vue_runtime_esm["a" /* default */](app); | |
} | |
start(); | |
/***/ }), | |
/***/ "35d8": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "show", function() { return show; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hide", function() { return hide; }); | |
/* harmony import */ var quasar_src_plugins_Loading_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("f508"); | |
; | |
const show = options => { | |
quasar_src_plugins_Loading_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].show({ | |
group: 'default', | |
...options | |
}); | |
}; | |
const hide = (group = 'default') => { | |
quasar_src_plugins_Loading_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].hide(group); | |
}; | |
/***/ }), | |
/***/ "37ab": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return LANGUAGES_ENUM; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return GENDERS_ENUM; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return INCOME_SOURCE_ENUM; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return ID_TYPE_ENUM; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CAN_CREATE_ENUM; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CLIENT_AGE_FUNERAL_ENUM; }); | |
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ce96"); | |
const LANGUAGES_ENUM = Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
ENGLISH: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'English', | |
value: 'ENGLISH' | |
}), | |
ISIXHOSA: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'IsiXhosa', | |
value: 'ISIXHOSA' | |
}), | |
ISIZULU: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'IsiZulu', | |
value: 'ISIZULU' | |
}), | |
AFRIKAANS: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Afrikaans', | |
value: 'AFRIKAANS' | |
}), | |
SEPEDI: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'SePedi', | |
value: 'SEPEDI' | |
}), | |
ISINDEBELE: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'IsiNdebele', | |
value: 'ISINDEBELE' | |
}), | |
SESOTHO: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'SeSotho', | |
value: 'SESOTHO' | |
}), | |
SISWATI: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'SiSwati', | |
value: 'SISWATI' | |
}), | |
XITSONGA: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'XiTsonga', | |
value: 'XITSONGA' | |
}), | |
SETSWANA: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'SeTswana', | |
value: 'SETSWANA' | |
}), | |
TSHIVENDA: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'TshiVenda', | |
value: 'TSHIVENDA' | |
}), | |
OTHER: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Other', | |
value: 'OTHER' | |
}) | |
}); | |
const GENDERS_ENUM = Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
MALE: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Male', | |
value: 'MALE' | |
}), | |
FEMALE: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Female', | |
value: 'FEMALE' | |
}), | |
TRANS_NON_BINARY: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Trans/Non-binary', | |
value: 'TRANS_NON_BINARY' | |
}) | |
}); | |
const INCOME_SOURCE_ENUM = Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
EMPLOYMENT: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Employment', | |
value: 'EMPLOYMENT' | |
}), | |
GRANT: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Grant', | |
value: 'GRANT' | |
}), | |
PART_TIME_EMPLOYMENT: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Part-time Employment', | |
value: 'PART_TIME_EMPLOYMENT' | |
}), | |
PAYMENT_FROM_FAMILY_FRIEND: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Payment from family/friend', | |
value: 'PAYMENT_FROM_FAMILY_FRIEND' | |
}), | |
PENSION: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Pension', | |
value: 'PENSION' | |
}), | |
SELF_EMPLOYED: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Self Employed', | |
value: 'SELF_EMPLOYED' | |
}), | |
PIECE_JOBS: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Piece Jobs', | |
value: 'PIECE_JOBS' | |
}), | |
NONE: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'None', | |
value: 'NONE' | |
}) | |
}); | |
const ID_TYPE_ENUM = Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
ID_DOCUMENT: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'SA ID', | |
value: 'ID_DOCUMENT' | |
}), | |
PASSPORT: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Passport', | |
value: 'PASSPORT' | |
}), | |
NO_ID: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'No ID', | |
value: 'NO_ID' | |
}) | |
}, { | |
realTypes() { | |
return [ID_TYPE_ENUM.ID_DOCUMENT, ID_TYPE_ENUM.PASSPORT]; | |
} | |
}); | |
const CAN_CREATE_ENUM = Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
OK: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
value: 'OK' | |
}), | |
NOT_OK_ID_DUPLICATED: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
value: 'NOT_OK_ID_DUPLICATED' | |
}), | |
OK_PHONE_NUMBER_DUPLICATED: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
value: 'OK_PHONE_NUMBER_DUPLICATED' | |
}) | |
}); | |
const CLIENT_AGE_FUNERAL_ENUM = Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
MIN: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
value: 18 | |
}), | |
MAX: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
value: 65 | |
}) | |
}); | |
/***/ }), | |
/***/ "3a34": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
// EXPORTS | |
__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ ClientModel["a" /* ClientModel */]; }); | |
__webpack_require__.d(__webpack_exports__, "i", function() { return /* reexport */ PaymentModel["a" /* PaymentModel */]; }); | |
__webpack_require__.d(__webpack_exports__, "o", function() { return /* reexport */ UserModel["a" /* UserModel */]; }); | |
__webpack_require__.d(__webpack_exports__, "l", function() { return /* reexport */ ReportModel_ReportModel; }); | |
__webpack_require__.d(__webpack_exports__, "n", function() { return /* reexport */ UpdatedReportModel_UpdatedReportModel; }); | |
__webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ CommunityModel["a" /* CommunityModel */]; }); | |
__webpack_require__.d(__webpack_exports__, "m", function() { return /* reexport */ TransactionModel_TransactionModel; }); | |
__webpack_require__.d(__webpack_exports__, "g", function() { return /* reexport */ LifeAssuredModel["a" /* LifeAssuredModel */]; }); | |
__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ BeneficiaryModel["a" /* BeneficiaryModel */]; }); | |
__webpack_require__.d(__webpack_exports__, "e", function() { return /* reexport */ CustomerModel_CustomerModel; }); | |
__webpack_require__.d(__webpack_exports__, "h", function() { return /* reexport */ NextOfKinModel["a" /* NextOfKinModel */]; }); | |
__webpack_require__.d(__webpack_exports__, "j", function() { return /* reexport */ PolicyModel["c" /* PolicyModel */]; }); | |
__webpack_require__.d(__webpack_exports__, "k", function() { return /* reexport */ PropertyModel["a" /* PropertyModel */]; }); | |
__webpack_require__.d(__webpack_exports__, "f", function() { return /* reexport */ EmergencyContact["a" /* EmergencyContact */]; }); | |
__webpack_require__.d(__webpack_exports__, "d", function() { return /* reexport */ ConfigModel_ConfigModel; }); | |
// EXTERNAL MODULE: ./src/models/ClientModel/index.js + 1 modules | |
var ClientModel = __webpack_require__("1844"); | |
// EXTERNAL MODULE: ./src/models/PaymentModel/index.js | |
var PaymentModel = __webpack_require__("a31b"); | |
// EXTERNAL MODULE: ./src/models/UserModel/index.js + 1 modules | |
var UserModel = __webpack_require__("ba0c"); | |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js | |
var defineProperty = __webpack_require__("9523"); | |
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty); | |
// EXTERNAL MODULE: ./src/models/BaseModel/index.js | |
var BaseModel = __webpack_require__("9599"); | |
// CONCATENATED MODULE: ./src/models/ReportModel/index.js | |
const jsonKeyToObjectKeyMap = new Map([['Main ID Number', 'insuranceMemberIds'], ['Policy Number', 'deviceBarcode'], ['Main Cellphone Number', 'customerMobileNumber'], ['Waiting Period', 'waitingPeriod'], ['Main Member Address', 'fullAddress'], ['Main Member Date of Birth', 'mainMemberDateOfBirth'], ['Insured Date of Birth', 'insuranceDateOfBirth'], ['Employer', 'employer'], ['Insured First Name', 'customerFirstName'], ['Insured Surname', 'customerLastName'], ['Insured Relationship', 'insuredRelationship'], ['Policy Description', 'policyDescription'], ['Policy Start Date', 'insuranceCommencementDate'], ['Premium', 'premium'], ['Cover', 'cover'], ['Age At Inception', 'ageAtInception'], ['Beneficiary first name', 'beneficiaryFirstName'], ['Beneficiary last name', 'beneficiaryLastName'], ['Beneficiary DOB', 'beneficiaryDob'], ['Beneficiary ID', 'beneficiaryId'], ['Month Commenced', 'monthCommenced'], ['Suspension Date', 'suspensionDate'], ['Last Payment Date', 'lastPaymentDate'], ['Status', 'status']]); | |
class ReportModel_ReportModel extends BaseModel["a" /* BaseModel */] { | |
constructor(report) { | |
super(); | |
for (const [, camelCaseKey] of jsonKeyToObjectKeyMap) { | |
this[camelCaseKey] = report[camelCaseKey]; | |
} | |
} | |
toLkJSON() { | |
return this.toJSONBase(jsonKeyToObjectKeyMap); | |
} | |
} | |
defineProperty_default()(ReportModel_ReportModel, "fromLkJSON", json => { | |
const jsonModel = ReportModel_ReportModel.fromJSONBase(json, jsonKeyToObjectKeyMap); | |
return new ReportModel_ReportModel(jsonModel); | |
}); | |
// CONCATENATED MODULE: ./src/models/UpdatedReportModel/index.js | |
const UpdatedReportModel_jsonKeyToObjectKeyMap = new Map([['Policy_Number', 'deviceBarcode'], ['Type', 'type'], ['Main_IDNumber', 'insuranceMemberIds'], ['Main_Gender', 'mainGender'], ['Main_Cellphone', 'customerMobileNumber'], ['Main_Address', 'mainAddress'], ['Main_DateOfBirth', 'insuranceDateOfBirth'], ['Relationship', 'relationship'], ['Name', 'name'], ['Surname', 'surname'], ['DateOfBirth', 'dateOfBirth'], ['CellPhone', 'cellphone'], ['Waiting_Period', 'waitingPeriod'], ['Policy_Description', 'policyDescription'], ['Policy_Start_Date', 'insuranceCommencementDate'], ['Adjusted_Premium', 'adjustedPremium'], ['Cover', 'cover'], ['Instructions', 'instructions'], ['_', '_'], ['Lumkani_Policy_Status', 'status']]); | |
class UpdatedReportModel_UpdatedReportModel extends BaseModel["a" /* BaseModel */] { | |
constructor(report) { | |
super(); | |
for (const [, camelCaseKey] of UpdatedReportModel_jsonKeyToObjectKeyMap) { | |
this[camelCaseKey] = report[camelCaseKey]; | |
} | |
} | |
toLkJSON() { | |
return this.toJSONBase(UpdatedReportModel_jsonKeyToObjectKeyMap); | |
} | |
} | |
defineProperty_default()(UpdatedReportModel_UpdatedReportModel, "fromLkJSON", json => { | |
const jsonModel = UpdatedReportModel_UpdatedReportModel.fromJSONBase(json, UpdatedReportModel_jsonKeyToObjectKeyMap); | |
return new UpdatedReportModel_UpdatedReportModel(jsonModel); | |
}); | |
// EXTERNAL MODULE: ./src/models/CommunityModel/index.js | |
var CommunityModel = __webpack_require__("a3c6"); | |
// EXTERNAL MODULE: ./src/helpers/constants.js | |
var constants = __webpack_require__("5b55"); | |
// CONCATENATED MODULE: ./src/models/TransactionModel/index.js | |
class TransactionModel_TransactionUserModel { | |
constructor({ | |
id, | |
email, | |
firstName, | |
lastName, | |
oldAgentId | |
}) { | |
defineProperty_default()(this, "id", void 0); | |
defineProperty_default()(this, "email", void 0); | |
defineProperty_default()(this, "firstName", void 0); | |
defineProperty_default()(this, "lastName", void 0); | |
defineProperty_default()(this, "oldAgentId", void 0); | |
this.id = id; | |
this.email = email; | |
this.firstName = firstName; | |
this.lastName = lastName; | |
this.oldAgentId = oldAgentId; | |
} | |
get fullName() { | |
return `${this.firstName} ${this.lastName}`; | |
} | |
get appLink() { | |
return { | |
name: 'app.viewUser', | |
params: { | |
userId: this.id | |
} | |
}; | |
} | |
} | |
defineProperty_default()(TransactionModel_TransactionUserModel, "create", user => new TransactionModel_TransactionUserModel(user)); | |
class TransactionModel_TransactionCustomerModel { | |
constructor({ | |
id, | |
fullName | |
}) { | |
defineProperty_default()(this, "id", void 0); | |
defineProperty_default()(this, "fullName", void 0); | |
this.id = id; | |
this.fullName = fullName; | |
} | |
get appLink() { | |
return { | |
name: 'app.viewClients', | |
params: { | |
clientId: this.id | |
} | |
}; | |
} | |
} | |
defineProperty_default()(TransactionModel_TransactionCustomerModel, "create", customer => new TransactionModel_TransactionCustomerModel(customer)); | |
class TransactionModel_TransactionPolicyModel { | |
constructor({ | |
id, | |
policyNumber, | |
customer | |
}) { | |
defineProperty_default()(this, "id", void 0); | |
defineProperty_default()(this, "policyNumber", void 0); | |
defineProperty_default()(this, "customer", null); | |
this.id = id; | |
this.policyNumber = policyNumber; | |
if (customer) { | |
this.customer = new TransactionModel_TransactionCustomerModel(customer); | |
} | |
} | |
get appLink() { | |
return { | |
name: 'app.policies', | |
params: { | |
policyId: this.id | |
} | |
}; | |
} | |
} | |
defineProperty_default()(TransactionModel_TransactionPolicyModel, "create", policy => new TransactionModel_TransactionPolicyModel(policy)); | |
class TransactionModel_TransactionPaymentModel { | |
constructor({ | |
id, | |
paymentAmount, | |
policy, | |
funeralPolicy | |
}) { | |
defineProperty_default()(this, "id", void 0); | |
defineProperty_default()(this, "paymentAmount", void 0); | |
defineProperty_default()(this, "policy", null); | |
defineProperty_default()(this, "funeralPolicy", null); | |
this.id = id; | |
this.paymentAmount = paymentAmount; | |
if (policy) { | |
this.policy = new TransactionModel_TransactionPolicyModel(policy); | |
} | |
if (funeralPolicy) { | |
this.funeralPolicy = new TransactionModel_TransactionPolicyModel(funeralPolicy); | |
} | |
} | |
get policies() { | |
return [this.policy, this.funeralPolicy].filter(Boolean); | |
} | |
} | |
defineProperty_default()(TransactionModel_TransactionPaymentModel, "create", payment => new TransactionModel_TransactionPaymentModel(payment)); | |
class TransactionModel_TransactionModel { | |
constructor({ | |
id, | |
userId, | |
description, | |
totalAmount, | |
extraAmount, | |
paymentType, | |
status, | |
actualPaymentDate, | |
notes, | |
createdAt, | |
updatedAt, | |
createdBy, | |
updatedBy, | |
payments | |
}) { | |
defineProperty_default()(this, "id", void 0); | |
defineProperty_default()(this, "userId", void 0); | |
defineProperty_default()(this, "description", void 0); | |
defineProperty_default()(this, "totalAmount", void 0); | |
defineProperty_default()(this, "extraAmount", void 0); | |
defineProperty_default()(this, "paymentType", void 0); | |
defineProperty_default()(this, "status", void 0); | |
defineProperty_default()(this, "actualPaymentDate", void 0); | |
defineProperty_default()(this, "notes", void 0); | |
defineProperty_default()(this, "createdAt", void 0); | |
defineProperty_default()(this, "updatedAt", void 0); | |
defineProperty_default()(this, "createdBy", null); | |
defineProperty_default()(this, "updatedBy", null); | |
defineProperty_default()(this, "payments", []); | |
this.id = id; | |
this.userId = userId; | |
this.description = description; | |
this.totalAmount = totalAmount; | |
this.extraAmount = extraAmount; | |
this.paymentType = paymentType; | |
this.status = status; | |
this.actualPaymentDate = actualPaymentDate; | |
this.notes = notes; | |
this.createdAt = createdAt; | |
this.updatedAt = updatedAt; | |
if (createdBy) { | |
this.createdBy = new TransactionModel_TransactionUserModel(createdBy); | |
} | |
if (updatedBy) { | |
this.updatedBy = new TransactionModel_TransactionUserModel(updatedBy); | |
} | |
if (payments) { | |
this.payments = payments.map(payment => new TransactionModel_TransactionPaymentModel(payment)); | |
} | |
} | |
// TODO We should update PAYMENT_STATUS to use "createEnum" rather than frozen object. | |
// However, this would lead to large refactor of payments and allocations. | |
// We'd need to use .value on all usages so i did not updated yet | |
get isSuccessful() { | |
return this.status === constants["E" /* PAYMENT_STATUS */].SUCCESSFUL; | |
} | |
get customer() { | |
var _this$payments, _this$payments$, _this$payments$$polic; | |
return (_this$payments = this.payments) === null || _this$payments === void 0 ? void 0 : (_this$payments$ = _this$payments[0]) === null || _this$payments$ === void 0 ? void 0 : (_this$payments$$polic = _this$payments$.policy) === null || _this$payments$$polic === void 0 ? void 0 : _this$payments$$polic.customer; | |
} | |
get policies() { | |
var _this$payments2; | |
return (_this$payments2 = this.payments) === null || _this$payments2 === void 0 ? void 0 : _this$payments2.filter(p => p.policy).flatMap(p => p.policies); | |
} | |
} | |
defineProperty_default()(TransactionModel_TransactionModel, "create", transaction => new TransactionModel_TransactionModel(transaction)); | |
// EXTERNAL MODULE: ./src/models/LifeAssuredModel/index.js | |
var LifeAssuredModel = __webpack_require__("4d59"); | |
// EXTERNAL MODULE: ./src/models/BeneficiaryModel/index.js | |
var BeneficiaryModel = __webpack_require__("dbe7"); | |
// EXTERNAL MODULE: ./node_modules/vuelidate/lib/validators/index.js | |
var validators = __webpack_require__("b5ae"); | |
// EXTERNAL MODULE: ./src/models/schema-validators.js | |
var schema_validators = __webpack_require__("0dec"); | |
// EXTERNAL MODULE: ./src/filters/index.js + 1 modules | |
var filters = __webpack_require__("8975"); | |
// EXTERNAL MODULE: ./src/models/FICAVerificationModel/constants.js | |
var FICAVerificationModel_constants = __webpack_require__("7a36"); | |
// CONCATENATED MODULE: ./src/models/CustomerModel/index.js | |
class CustomerModel_CustomerModel { | |
constructor({ | |
id, | |
dateOfBirth, | |
emailAddress, | |
expectedPaymentDate, | |
expectedPaymentMethod, | |
firstName, | |
surname, | |
gender, | |
homeLanguage, | |
idPassportNumber, | |
idType, | |
incomeSource, | |
mobileNumber, | |
notes, | |
occupation, | |
receiveMarketingCommunication, | |
secondaryNumber, | |
whatsappNumber, | |
referredById, | |
ficaVerificationId | |
} = {}) { | |
defineProperty_default()(this, "id", void 0); | |
defineProperty_default()(this, "dateOfBirth", void 0); | |
defineProperty_default()(this, "emailAddress", void 0); | |
defineProperty_default()(this, "expectedPaymentDate", void 0); | |
defineProperty_default()(this, "expectedPaymentMethod", void 0); | |
defineProperty_default()(this, "firstName", void 0); | |
defineProperty_default()(this, "surname", void 0); | |
defineProperty_default()(this, "gender", void 0); | |
defineProperty_default()(this, "homeLanguage", void 0); | |
defineProperty_default()(this, "idPassportNumber", void 0); | |
defineProperty_default()(this, "idType", void 0); | |
defineProperty_default()(this, "incomeSource", void 0); | |
defineProperty_default()(this, "mobileNumber", void 0); | |
defineProperty_default()(this, "notes", void 0); | |
defineProperty_default()(this, "occupation", void 0); | |
defineProperty_default()(this, "receiveMarketingCommunication", void 0); | |
defineProperty_default()(this, "secondaryNumber", void 0); | |
defineProperty_default()(this, "whatsappNumber", void 0); | |
defineProperty_default()(this, "referredById", void 0); | |
defineProperty_default()(this, "ficaVerificationId", void 0); | |
this.id = id; | |
this.dateOfBirth = dateOfBirth; | |
this.emailAddress = emailAddress; | |
this.expectedPaymentDate = expectedPaymentDate; | |
this.expectedPaymentMethod = expectedPaymentMethod; | |
this.firstName = firstName; | |
this.surname = surname; | |
this.gender = gender; | |
this.homeLanguage = homeLanguage; | |
this.idPassportNumber = idPassportNumber; | |
this.idType = idType; | |
this.incomeSource = incomeSource; | |
this.mobileNumber = mobileNumber; | |
this.notes = notes; | |
this.occupation = occupation; | |
this.receiveMarketingCommunication = receiveMarketingCommunication; | |
this.secondaryNumber = secondaryNumber; | |
this.whatsappNumber = whatsappNumber; | |
this.referredById = referredById; | |
this.ficaVerificationId = ficaVerificationId; | |
} | |
get fullName() { | |
return `${this.firstName} ${this.surname}`; | |
} | |
get isValid() { | |
return CustomerModel_CustomerModel.schema.validateStrict(this); | |
} | |
get ficaDetailsMatch() { | |
return this.idPassportNumber === this.ficaVerification.idPassportNumber && this.dateOfBirth === this.ficaVerification.dateOfBirth && this.firstName === this.ficaVerification.firstName && this.surname === this.ficaVerification.surname && FICAVerificationModel_constants["b" /* PREMIUM_COLLECTION_METHOD */].fromCustomerPaymentMethod(this.expectedPaymentMethod).value === this.ficaVerification.premiumCollectionMethod; | |
} | |
get ficaVerified() { | |
var _this$ficaVerificatio; | |
return ((_this$ficaVerificatio = this.ficaVerification) === null || _this$ficaVerificatio === void 0 ? void 0 : _this$ficaVerificatio.isAcceptable) && (this === null || this === void 0 ? void 0 : this.ficaDetailsMatch) || false; | |
} | |
setFICAVerification(ficaVerification) { | |
this.ficaVerification = ficaVerification; | |
} | |
} | |
defineProperty_default()(CustomerModel_CustomerModel, "create", customer => { | |
return new CustomerModel_CustomerModel(customer); | |
}); | |
defineProperty_default()(CustomerModel_CustomerModel, "schema", { | |
idPassportNumber: filters["idPassportNumber"], | |
firstName: [validators["required"]], | |
surname: [validators["required"]], | |
mobileNumber: [validators["required"], filters["isMobileNumber"]], | |
secondaryNumber: [Object(filters["isOptional"])(filters["isMobileNumber"])], | |
whatsappNumber: [Object(filters["isOptional"])(filters["isMobileNumber"])], | |
emailAddress: [Object(filters["isOptional"])(validators["email"])], | |
expectedPaymentDate: [validators["required"], filters["isValidDate"]], | |
expectedPaymentMethod: [validators["required"]], | |
gender: [validators["required"]], | |
incomeSource: [validators["required"]], | |
idType: [validators["required"]], | |
homeLanguage: [validators["required"]], | |
dateOfBirth: [validators["required"], filters["olderThan18Filter"]], | |
...schema_validators["a" /* schemaValidators */] | |
}); | |
// EXTERNAL MODULE: ./src/models/NextOfKinModel/index.js | |
var NextOfKinModel = __webpack_require__("e614"); | |
// EXTERNAL MODULE: ./src/models/PolicyModel/index.js | |
var PolicyModel = __webpack_require__("3c40"); | |
// EXTERNAL MODULE: ./src/models/PropertyModel/index.js | |
var PropertyModel = __webpack_require__("7a71"); | |
// EXTERNAL MODULE: ./src/models/EmergencyContact/index.js | |
var EmergencyContact = __webpack_require__("6699"); | |
// CONCATENATED MODULE: ./src/models/ConfigModel/index.js | |
const castToBoolean = value => value === '1'; | |
class ConfigModel_ConfigModel { | |
constructor({ | |
MINIMUM_APP_VERSION, | |
ENABLE_OLD_FLOW, | |
ENABLE_NEW_FLOW, | |
ENABLE_FUNERAL_FLOW, | |
ENABLE_HTML_5_CAMERA, | |
ENABLE_UPGRADE_TO_FUNERAL_OLD_MODEL, | |
ENABLE_ACCESS_TO_EDIT_CLIENT_PAGE_OLD_MODEL, | |
ENABLE_UPDATE_CLIENT_STATUS_VIA_OLD_MODEL, | |
ENABLE_VIEW_CLIENT_NEW_MODEL, | |
ENABLE_VIEW_POLICY_NEW_MODEL, | |
ENABLE_EDIT_CLIENT_NEW_MODEL, | |
ENABLE_EDIT_POLICY_NEW_MODEL, | |
ENABLE_EDIT_CLIENT_DATA_VIA_OLD_MODEL, | |
ENABLE_PHOTOS_VIA_OLD_MODEL, | |
ENABLE_PHOTO_UPDATE_NEW_MODEL | |
}) { | |
defineProperty_default()(this, "minimumAppVersion", void 0); | |
defineProperty_default()(this, "enableOldFlow", void 0); | |
defineProperty_default()(this, "enableNewFlow", void 0); | |
defineProperty_default()(this, "enableFuneralFlow", void 0); | |
defineProperty_default()(this, "enableHTML5Camera", void 0); | |
defineProperty_default()(this, "enableUpgradeToFuneralOldModel", void 0); | |
defineProperty_default()(this, "enableAccessToEditClientPageOldModel", void 0); | |
defineProperty_default()(this, "enableUpdateClientStatusViaOldModel", void 0); | |
defineProperty_default()(this, "enableViewClientNewModel", void 0); | |
defineProperty_default()(this, "enableViewPolicyNewModel", void 0); | |
defineProperty_default()(this, "enableEditClientNewModel", void 0); | |
defineProperty_default()(this, "enableEditPolicyNewModel", void 0); | |
defineProperty_default()(this, "enableEditClientDataViaOldModel", void 0); | |
defineProperty_default()(this, "enablePhotosViaOldModel", void 0); | |
defineProperty_default()(this, "enablePhotoUpdateNewModel", void 0); | |
this.minimumAppVersion = MINIMUM_APP_VERSION; | |
this.enableOldFlow = castToBoolean(ENABLE_OLD_FLOW); | |
this.enableNewFlow = castToBoolean(ENABLE_NEW_FLOW); | |
this.enableFuneralFlow = castToBoolean(ENABLE_FUNERAL_FLOW); | |
this.enableHTML5Camera = castToBoolean(ENABLE_HTML_5_CAMERA); | |
this.enableUpgradeToFuneralOldModel = castToBoolean(ENABLE_UPGRADE_TO_FUNERAL_OLD_MODEL); | |
this.enableAccessToEditClientPageOldModel = castToBoolean(ENABLE_ACCESS_TO_EDIT_CLIENT_PAGE_OLD_MODEL); | |
this.enableUpdateClientStatusViaOldModel = castToBoolean(ENABLE_UPDATE_CLIENT_STATUS_VIA_OLD_MODEL); | |
this.enableViewClientNewModel = castToBoolean(ENABLE_VIEW_CLIENT_NEW_MODEL); | |
this.enableViewPolicyNewModel = castToBoolean(ENABLE_VIEW_POLICY_NEW_MODEL); | |
this.enableEditClientNewModel = castToBoolean(ENABLE_EDIT_CLIENT_NEW_MODEL); | |
this.enableEditPolicyNewModel = castToBoolean(ENABLE_EDIT_POLICY_NEW_MODEL); | |
this.enableEditClientDataViaOldModel = castToBoolean(ENABLE_EDIT_CLIENT_DATA_VIA_OLD_MODEL); | |
this.enablePhotosViaOldModel = castToBoolean(ENABLE_PHOTOS_VIA_OLD_MODEL); | |
this.enablePhotoUpdateNewModel = castToBoolean(ENABLE_PHOTO_UPDATE_NEW_MODEL); | |
} | |
} | |
defineProperty_default()(ConfigModel_ConfigModel, "create", config => new ConfigModel_ConfigModel(config)); | |
// CONCATENATED MODULE: ./src/models/index.js | |
/***/ }), | |
/***/ "3c40": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FUNERAL_PLAN_CATEGORY; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return FUNERAL_POLICY_PLAN_TYPE; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return PolicyModel; }); | |
/* unused harmony export FuneralPlanModel */ | |
/* unused harmony export FirePlanModel */ | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9523"); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__); | |
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("3a34"); | |
/* harmony import */ var _services_PolicyService_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("d0c5"); | |
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("ce96"); | |
const FUNERAL_PLAN_CATEGORY = Object(_helpers__WEBPACK_IMPORTED_MODULE_3__[/* createEnum */ "a"])({ | |
CLASSIC: Object(_helpers__WEBPACK_IMPORTED_MODULE_3__[/* createEnum */ "a"])({ | |
value: 'CLASSIC', | |
premium: 70 | |
}), | |
FLEXIBLE: Object(_helpers__WEBPACK_IMPORTED_MODULE_3__[/* createEnum */ "a"])({ | |
value: 'FLEXIBLE', | |
premium: 80 | |
}) | |
}); | |
const FUNERAL_POLICY_PLAN_TYPE = Object(_helpers__WEBPACK_IMPORTED_MODULE_3__[/* createEnum */ "a"])({ | |
KING_PRICE: Object(_helpers__WEBPACK_IMPORTED_MODULE_3__[/* createEnum */ "a"])({ | |
value: 'KING_PRICE', | |
extended_family_members: 0, | |
FUNERAL_PLAN_CATEGORY: FUNERAL_PLAN_CATEGORY.CLASSIC | |
}), | |
CORE_FAMILY_MINIMUM_COVERAGE: Object(_helpers__WEBPACK_IMPORTED_MODULE_3__[/* createEnum */ "a"])({ | |
value: 'CORE_FAMILY_MINIMUM_COVERAGE', | |
extended_family_members: 0, | |
FUNERAL_PLAN_CATEGORY: FUNERAL_PLAN_CATEGORY.CLASSIC | |
}), | |
CORE_FAMILY: Object(_helpers__WEBPACK_IMPORTED_MODULE_3__[/* createEnum */ "a"])({ | |
value: 'CORE_FAMILY', | |
extended_family_members: 0, | |
FUNERAL_PLAN_CATEGORY: FUNERAL_PLAN_CATEGORY.FLEXIBLE | |
}), | |
EXTENDED_FAMILY_PLUS_ONE: Object(_helpers__WEBPACK_IMPORTED_MODULE_3__[/* createEnum */ "a"])({ | |
value: 'EXTENDED_FAMILY_PLUS_ONE', | |
extended_family_members: 1, | |
FUNERAL_PLAN_CATEGORY: FUNERAL_PLAN_CATEGORY.FLEXIBLE | |
}), | |
EXTENDED_FAMILY_PLUS_TWO: Object(_helpers__WEBPACK_IMPORTED_MODULE_3__[/* createEnum */ "a"])({ | |
value: 'EXTENDED_FAMILY_PLUS_TWO', | |
extended_family_members: 2, | |
FUNERAL_PLAN_CATEGORY: FUNERAL_PLAN_CATEGORY.FLEXIBLE | |
}), | |
EXTENDED_FAMILY_PLUS_THREE: Object(_helpers__WEBPACK_IMPORTED_MODULE_3__[/* createEnum */ "a"])({ | |
value: 'EXTENDED_FAMILY_PLUS_THREE', | |
extended_family_members: 3, | |
FUNERAL_PLAN_CATEGORY: FUNERAL_PLAN_CATEGORY.FLEXIBLE | |
}), | |
EXTENDED_FAMILY_PLUS_FOUR: Object(_helpers__WEBPACK_IMPORTED_MODULE_3__[/* createEnum */ "a"])({ | |
value: 'EXTENDED_FAMILY_PLUS_FOUR', | |
extended_family_members: 4, | |
FUNERAL_PLAN_CATEGORY: FUNERAL_PLAN_CATEGORY.FLEXIBLE | |
}) | |
}); | |
class FirePlanModel { | |
constructor({ | |
id, | |
firePlanType, | |
firePlanCoverage, | |
firePlanPremium, | |
premium | |
}) { | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "id", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "firePlanType", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "firePlanCoverage", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "firePlanPremium", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "premium", void 0); | |
this.id = id; | |
this.firePlanType = firePlanType; | |
this.firePlanCoverage = firePlanCoverage; | |
this.firePlanPremium = firePlanPremium; | |
this.premium = premium.amount; | |
} | |
} | |
class FuneralPlanModel { | |
constructor({ | |
id, | |
funeralPlanType, | |
coreMemberCount, | |
coreMemberCoverage, | |
extendedMemberCount, | |
extendedMemberCoverage, | |
premium | |
}) { | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "id", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "funeralPlanType", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "coreMemberCount", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "coreMemberCoverage", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "extendedMemberCount", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "extendedMemberCoverage", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "premium", void 0); | |
this.id = id; | |
this.funeralPlanType = funeralPlanType; | |
this.coreMemberCount = coreMemberCount; | |
this.coreMemberCoverage = coreMemberCoverage; | |
this.extendedMemberCount = extendedMemberCount; | |
this.extendedMemberCoverage = extendedMemberCoverage; | |
this.premium = premium.amount; | |
} | |
get isKingPrice() { | |
return this.funeralPlanType === FUNERAL_POLICY_PLAN_TYPE.KING_PRICE.value; | |
} | |
} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(FuneralPlanModel, "create", (funeralPlan = {}) => new FuneralPlanModel(funeralPlan)); | |
class PolicyModel { | |
constructor({ | |
customer, | |
customerId, | |
debitOrderPhoto, | |
id, | |
beneficiaryId, | |
nextOfKinId, | |
notes, | |
policyDocumentPhoto1, | |
policyDocumentPhoto2, | |
policyNumber, | |
policyType, | |
funeralPlan, | |
firePlan, | |
property, | |
propertyId, | |
receiveAlerts, | |
userId, | |
deviceId, | |
devices, | |
emergencyContacts, | |
user, | |
isDeleted, | |
createdAt, | |
deletedAt, | |
hasLinkedFuneral, | |
payAtNumber, | |
commencementDate, | |
suspensionDate | |
}) { | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "customer", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "customerId", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "debitOrderPhoto", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "id", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "beneficiaryId", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "nextOfKinId", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "notes", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "policyDocumentPhoto1", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "policyDocumentPhoto2", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "policyNumber", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "policyType", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "funeralPlan", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "firePlan", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "property", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "propertyId", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "receiveAlerts", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "userId", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "deviceId", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "devices", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "emergencyContacts", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "user", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "isDeleted", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "createdAt", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "deletedAt", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "hasLinkedFuneral", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "payAtNumber", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "commencementDate", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "suspensionDate", void 0); | |
this.customerId = customerId; | |
this.debitOrderPhoto = debitOrderPhoto; | |
this.id = id; | |
this.beneficiaryId = beneficiaryId; | |
this.nextOfKinId = nextOfKinId; | |
this.notes = notes; | |
this.policyDocumentPhoto1 = policyDocumentPhoto1; | |
this.policyDocumentPhoto2 = policyDocumentPhoto2; | |
this.policyNumber = policyNumber; | |
this.policyType = policyType; | |
this.propertyId = propertyId; | |
this.receiveAlerts = receiveAlerts; | |
this.userId = userId; | |
if (customer) { | |
this.customer = new ___WEBPACK_IMPORTED_MODULE_1__[/* CustomerModel */ "e"](customer); | |
} | |
if (funeralPlan) { | |
this.funeralPlan = new FuneralPlanModel(funeralPlan); | |
} | |
if (firePlan) { | |
this.firePlan = new FirePlanModel(firePlan); | |
} | |
if (property) { | |
this.property = new ___WEBPACK_IMPORTED_MODULE_1__[/* PropertyModel */ "k"](property); | |
} | |
this.deviceId = deviceId; | |
this.devices = devices; | |
this.emergencyContacts = emergencyContacts; | |
this.user = user; | |
this.createdAt = createdAt; | |
this.deletedAt = deletedAt; | |
this.isDeleted = isDeleted; | |
this.hasLinkedFuneral = hasLinkedFuneral; | |
this.payAtNumber = payAtNumber; | |
this.commencementDate = commencementDate; | |
this.suspensionDate = suspensionDate; | |
} | |
get isDeviceAttached() { | |
return !!this.deviceId; | |
} | |
get isEnabled() { | |
return !this.isDeleted; | |
} | |
get isFire() { | |
return this.policyType === _services_PolicyService_constants__WEBPACK_IMPORTED_MODULE_2__[/* POLICY_TYPES_ENUM */ "a"].FIRE.value; | |
} | |
get isFuneral() { | |
return this.policyType === _services_PolicyService_constants__WEBPACK_IMPORTED_MODULE_2__[/* POLICY_TYPES_ENUM */ "a"].FUNERAL.value; | |
} | |
get plan() { | |
return this.funeralPlan || this.firePlan; | |
} | |
get planType() { | |
var _this$funeralPlan, _this$firePlan; | |
return ((_this$funeralPlan = this.funeralPlan) === null || _this$funeralPlan === void 0 ? void 0 : _this$funeralPlan.funeralPlanType) || ((_this$firePlan = this.firePlan) === null || _this$firePlan === void 0 ? void 0 : _this$firePlan.firePlanType); | |
} | |
get isKingPrice() { | |
return this.policyType === _services_PolicyService_constants__WEBPACK_IMPORTED_MODULE_2__[/* POLICY_TYPES_ENUM */ "a"].FUNERAL.value && this.funeralPlan.isKingPrice; | |
} | |
} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(PolicyModel, "create", policy => new PolicyModel(policy)); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(PolicyModel, "STATUS", Object.freeze({ | |
ACTIVE: 'ACTIVE', | |
DELETED: 'DELETED' | |
})); | |
/***/ }), | |
/***/ "4678": | |
/***/ (function(module, exports, __webpack_require__) { | |
var map = { | |
"./af": "2bfb", | |
"./af.js": "2bfb", | |
"./ar": "8e73", | |
"./ar-dz": "a356", | |
"./ar-dz.js": "a356", | |
"./ar-kw": "423e", | |
"./ar-kw.js": "423e", | |
"./ar-ly": "1cfd", | |
"./ar-ly.js": "1cfd", | |
"./ar-ma": "0a84", | |
"./ar-ma.js": "0a84", | |
"./ar-sa": "8230", | |
"./ar-sa.js": "8230", | |
"./ar-tn": "6d83", | |
"./ar-tn.js": "6d83", | |
"./ar.js": "8e73", | |
"./az": "485c", | |
"./az.js": "485c", | |
"./be": "1fc1", | |
"./be.js": "1fc1", | |
"./bg": "84aa", | |
"./bg.js": "84aa", | |
"./bm": "a7fa", | |
"./bm.js": "a7fa", | |
"./bn": "9043", | |
"./bn-bd": "9686", | |
"./bn-bd.js": "9686", | |
"./bn.js": "9043", | |
"./bo": "d26a", | |
"./bo.js": "d26a", | |
"./br": "6887", | |
"./br.js": "6887", | |
"./bs": "2554", | |
"./bs.js": "2554", | |
"./ca": "d716", | |
"./ca.js": "d716", | |
"./cs": "3c0d", | |
"./cs.js": "3c0d", | |
"./cv": "03ec", | |
"./cv.js": "03ec", | |
"./cy": "9797", | |
"./cy.js": "9797", | |
"./da": "0f14", | |
"./da.js": "0f14", | |
"./de": "b469", | |
"./de-at": "b3eb", | |
"./de-at.js": "b3eb", | |
"./de-ch": "bb71", | |
"./de-ch.js": "bb71", | |
"./de.js": "b469", | |
"./dv": "598a", | |
"./dv.js": "598a", | |
"./el": "8d47", | |
"./el.js": "8d47", | |
"./en-au": "0e6b", | |
"./en-au.js": "0e6b", | |
"./en-ca": "3886", | |
"./en-ca.js": "3886", | |
"./en-gb": "39a6", | |
"./en-gb.js": "39a6", | |
"./en-ie": "e1d3", | |
"./en-ie.js": "e1d3", | |
"./en-il": "7333", | |
"./en-il.js": "7333", | |
"./en-in": "ec2e", | |
"./en-in.js": "ec2e", | |
"./en-nz": "6f50", | |
"./en-nz.js": "6f50", | |
"./en-sg": "b7e9", | |
"./en-sg.js": "b7e9", | |
"./eo": "65db", | |
"./eo.js": "65db", | |
"./es": "898b", | |
"./es-do": "0a3c", | |
"./es-do.js": "0a3c", | |
"./es-mx": "b5b7", | |
"./es-mx.js": "b5b7", | |
"./es-us": "55c9", | |
"./es-us.js": "55c9", | |
"./es.js": "898b", | |
"./et": "ec18", | |
"./et.js": "ec18", | |
"./eu": "0ff2", | |
"./eu.js": "0ff2", | |
"./fa": "8df4", | |
"./fa.js": "8df4", | |
"./fi": "81e9", | |
"./fi.js": "81e9", | |
"./fil": "d69a", | |
"./fil.js": "d69a", | |
"./fo": "0721", | |
"./fo.js": "0721", | |
"./fr": "9f26", | |
"./fr-ca": "d9f8", | |
"./fr-ca.js": "d9f8", | |
"./fr-ch": "0e49", | |
"./fr-ch.js": "0e49", | |
"./fr.js": "9f26", | |
"./fy": "7118", | |
"./fy.js": "7118", | |
"./ga": "5120", | |
"./ga.js": "5120", | |
"./gd": "f6b4", | |
"./gd.js": "f6b4", | |
"./gl": "8840", | |
"./gl.js": "8840", | |
"./gom-deva": "aaf2", | |
"./gom-deva.js": "aaf2", | |
"./gom-latn": "0caa", | |
"./gom-latn.js": "0caa", | |
"./gu": "e0c5", | |
"./gu.js": "e0c5", | |
"./he": "c7aa", | |
"./he.js": "c7aa", | |
"./hi": "dc4d", | |
"./hi.js": "dc4d", | |
"./hr": "4ba9", | |
"./hr.js": "4ba9", | |
"./hu": "5b14", | |
"./hu.js": "5b14", | |
"./hy-am": "d6b6", | |
"./hy-am.js": "d6b6", | |
"./id": "5038", | |
"./id.js": "5038", | |
"./is": "0558", | |
"./is.js": "0558", | |
"./it": "6e98", | |
"./it-ch": "6f12", | |
"./it-ch.js": "6f12", | |
"./it.js": "6e98", | |
"./ja": "079e", | |
"./ja.js": "079e", | |
"./jv": "b540", | |
"./jv.js": "b540", | |
"./ka": "201b", | |
"./ka.js": "201b", | |
"./kk": "6d79", | |
"./kk.js": "6d79", | |
"./km": "e81d", | |
"./km.js": "e81d", | |
"./kn": "3e92", | |
"./kn.js": "3e92", | |
"./ko": "22f8", | |
"./ko.js": "22f8", | |
"./ku": "2421", | |
"./ku.js": "2421", | |
"./ky": "9609", | |
"./ky.js": "9609", | |
"./lb": "440c", | |
"./lb.js": "440c", | |
"./lo": "b29d", | |
"./lo.js": "b29d", | |
"./lt": "26f9", | |
"./lt.js": "26f9", | |
"./lv": "b97c", | |
"./lv.js": "b97c", | |
"./me": "293c", | |
"./me.js": "293c", | |
"./mi": "688b", | |
"./mi.js": "688b", | |
"./mk": "6909", | |
"./mk.js": "6909", | |
"./ml": "02fb", | |
"./ml.js": "02fb", | |
"./mn": "958b", | |
"./mn.js": "958b", | |
"./mr": "39bd", | |
"./mr.js": "39bd", | |
"./ms": "ebe4", | |
"./ms-my": "6403", | |
"./ms-my.js": "6403", | |
"./ms.js": "ebe4", | |
"./mt": "1b45", | |
"./mt.js": "1b45", | |
"./my": "8689", | |
"./my.js": "8689", | |
"./nb": "6ce3", | |
"./nb.js": "6ce3", | |
"./ne": "3a39", | |
"./ne.js": "3a39", | |
"./nl": "facd", | |
"./nl-be": "db29", | |
"./nl-be.js": "db29", | |
"./nl.js": "facd", | |
"./nn": "b84c", | |
"./nn.js": "b84c", | |
"./oc-lnc": "167b", | |
"./oc-lnc.js": "167b", | |
"./pa-in": "f3ff", | |
"./pa-in.js": "f3ff", | |
"./pl": "8d57", | |
"./pl.js": "8d57", | |
"./pt": "f260", | |
"./pt-br": "d2d4", | |
"./pt-br.js": "d2d4", | |
"./pt.js": "f260", | |
"./ro": "972c", | |
"./ro.js": "972c", | |
"./ru": "957c", | |
"./ru.js": "957c", | |
"./sd": "6784", | |
"./sd.js": "6784", | |
"./se": "ffff", | |
"./se.js": "ffff", | |
"./si": "eda5", | |
"./si.js": "eda5", | |
"./sk": "7be6", | |
"./sk.js": "7be6", | |
"./sl": "8155", | |
"./sl.js": "8155", | |
"./sq": "c8f3", | |
"./sq.js": "c8f3", | |
"./sr": "cf1e", | |
"./sr-cyrl": "13e9", | |
"./sr-cyrl.js": "13e9", | |
"./sr.js": "cf1e", | |
"./ss": "52bd", | |
"./ss.js": "52bd", | |
"./sv": "5fbd", | |
"./sv.js": "5fbd", | |
"./sw": "74dc", | |
"./sw.js": "74dc", | |
"./ta": "3de5", | |
"./ta.js": "3de5", | |
"./te": "5cbb", | |
"./te.js": "5cbb", | |
"./tet": "576c", | |
"./tet.js": "576c", | |
"./tg": "3b1b", | |
"./tg.js": "3b1b", | |
"./th": "10e8", | |
"./th.js": "10e8", | |
"./tk": "5aff", | |
"./tk.js": "5aff", | |
"./tl-ph": "0f38", | |
"./tl-ph.js": "0f38", | |
"./tlh": "cf75", | |
"./tlh.js": "cf75", | |
"./tr": "0e81", | |
"./tr.js": "0e81", | |
"./tzl": "cf51", | |
"./tzl.js": "cf51", | |
"./tzm": "c109", | |
"./tzm-latn": "b53d", | |
"./tzm-latn.js": "b53d", | |
"./tzm.js": "c109", | |
"./ug-cn": "6117", | |
"./ug-cn.js": "6117", | |
"./uk": "ada2", | |
"./uk.js": "ada2", | |
"./ur": "5294", | |
"./ur.js": "5294", | |
"./uz": "2e8c", | |
"./uz-latn": "010e", | |
"./uz-latn.js": "010e", | |
"./uz.js": "2e8c", | |
"./vi": "2921", | |
"./vi.js": "2921", | |
"./x-pseudo": "fd7e", | |
"./x-pseudo.js": "fd7e", | |
"./yo": "7f33", | |
"./yo.js": "7f33", | |
"./zh-cn": "5c3a", | |
"./zh-cn.js": "5c3a", | |
"./zh-hk": "49ab", | |
"./zh-hk.js": "49ab", | |
"./zh-mo": "3a6c", | |
"./zh-mo.js": "3a6c", | |
"./zh-tw": "90ea", | |
"./zh-tw.js": "90ea" | |
}; | |
function webpackContext(req) { | |
var id = webpackContextResolve(req); | |
return __webpack_require__(id); | |
} | |
function webpackContextResolve(req) { | |
if(!__webpack_require__.o(map, req)) { | |
var e = new Error("Cannot find module '" + req + "'"); | |
e.code = 'MODULE_NOT_FOUND'; | |
throw e; | |
} | |
return map[req]; | |
} | |
webpackContext.keys = function webpackContextKeys() { | |
return Object.keys(map); | |
}; | |
webpackContext.resolve = webpackContextResolve; | |
module.exports = webpackContext; | |
webpackContext.id = "4678"; | |
/***/ }), | |
/***/ "475d": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
// EXPORTS | |
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ BeneficiaryService; }); | |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js | |
var defineProperty = __webpack_require__("9523"); | |
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty); | |
// EXTERNAL MODULE: ./node_modules/camelize/index.js | |
var camelize = __webpack_require__("654d"); | |
var camelize_default = /*#__PURE__*/__webpack_require__.n(camelize); | |
// EXTERNAL MODULE: ./src/helpers/http.js + 1 modules | |
var http = __webpack_require__("825e"); | |
// EXTERNAL MODULE: ./src/models/index.js + 5 modules | |
var models = __webpack_require__("3a34"); | |
// EXTERNAL MODULE: ./src/helpers/index.js | |
var helpers = __webpack_require__("ce96"); | |
// EXTERNAL MODULE: ./src/models/BeneficiaryModel/index.js | |
var BeneficiaryModel = __webpack_require__("dbe7"); | |
// EXTERNAL MODULE: ./src/services/HTTPService/index.js | |
var HTTPService = __webpack_require__("778a"); | |
// CONCATENATED MODULE: ./src/services/BeneficiaryService/constants.js | |
const BENEFICIARY_BY_CLIENT_ID = clientId => `api/detectors/${clientId}/funeral-beneficiaries`; | |
const UPDATE_BENEFICIARIES = (clientId, beneficiaryId) => `api/detectors/${clientId}/funeral-beneficiaries/${beneficiaryId}`; | |
// CONCATENATED MODULE: ./src/services/BeneficiaryService/index.js | |
class BeneficiaryService {} | |
defineProperty_default()(BeneficiaryService, "getBeneficiaryByClientId", clientId => http["a" /* default */].get(BENEFICIARY_BY_CLIENT_ID(clientId)).then(res => models["a" /* BeneficiaryModel */].fromLkJSON(res.data.beneficiary))); | |
defineProperty_default()(BeneficiaryService, "updateBeneficiary", (beneficiaryToUpdate, clientId, beneficiaryId) => { | |
const params = { | |
beneficiary: beneficiaryToUpdate | |
}; | |
return http["a" /* default */].post(UPDATE_BENEFICIARIES(clientId, beneficiaryId), params).then(res => models["a" /* BeneficiaryModel */].fromLkJSON(res.data)); | |
}); | |
defineProperty_default()(BeneficiaryService, "getBeneficiary", beneficiaryId => { | |
return HTTPService["a" /* HTTPService */].get(`/api/v2/beneficiaries/${beneficiaryId}`).then(({ | |
data | |
}) => BeneficiaryModel["b" /* BeneficiaryNewModel */].create(camelize_default()(data))); | |
}); | |
defineProperty_default()(BeneficiaryService, "updateBeneficiaryNewModel", (beneficiaryId, beneficiaryModel) => { | |
return HTTPService["a" /* HTTPService */].patch(`/api/v2/beneficiaries/${beneficiaryId}`, Object(helpers["d" /* snakeize */])(beneficiaryModel)).then(({ | |
data | |
}) => BeneficiaryModel["b" /* BeneficiaryNewModel */].create(camelize_default()(data))); | |
}); | |
defineProperty_default()(BeneficiaryService, "isIdValid", (idType, idPassportNumber, dateOfBirth) => { | |
return HTTPService["a" /* HTTPService */].get('/api/v2/beneficiaries/is-id-valid', { | |
params: { | |
id_type: idType, | |
id_passport_number: idPassportNumber, | |
date_of_birth: dateOfBirth | |
} | |
}); | |
}); | |
/***/ }), | |
/***/ "4b2b": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* unused harmony export LIVES_ASSURED_BY_CLIENT_ID */ | |
/* unused harmony export MIN_CHILD_AGE */ | |
/* unused harmony export MAX_CHILD_AGE */ | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return MAX_NUMBER_OF_CHILDREN_THAT_CAN_BE_ASSURED; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return LIFE_ASSURED_TYPE_ENUM; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return MAX_NUMBER_OF_EXTENDED_FAMILY; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return LIFE_ASSURED_VALIDATIONS; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CHILD_AGE_REQUIRING_CELL_NUMBER; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return COST_PER_EXTENDED_FAMILY_MEMBER; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return MAX_CHILD_AGE_FOR_COVER; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return OLDEST_MIGRATING_SPOUSE_AGE; }); | |
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ce96"); | |
const LIVES_ASSURED_BY_CLIENT_ID = clientId => `api/detectors/${clientId}/lives-assured`; | |
const MIN_CHILD_AGE = 0; | |
const MAX_CHILD_AGE = 21; | |
const MAX_CHILD_AGE_FOR_COVER = 25; | |
const OLDEST_MIGRATING_SPOUSE_AGE = 84; | |
const MAX_NUMBER_OF_CHILDREN_THAT_CAN_BE_ASSURED = 5; | |
const MAX_NUMBER_OF_EXTENDED_FAMILY = 4; | |
const CHILD_AGE_REQUIRING_CELL_NUMBER = 18; | |
const COST_PER_EXTENDED_FAMILY_MEMBER = 25; | |
const LIFE_ASSURED_TYPE_ENUM = Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
SPOUSE: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
value: 'SPOUSE', | |
label: 'Spouse', | |
category: 'CORE' | |
}), | |
CHILD: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
value: 'CHILD', | |
label: 'Child', | |
category: 'CORE' | |
}), | |
ADDITIONAL_PARTNER: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
value: 'ADDITIONAL_PARTNER', | |
label: 'Additional Partner', | |
category: 'EXTENDED' | |
}), | |
ADULT_CHILD: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
value: 'ADULT_CHILD', | |
label: 'Adult Child', | |
category: 'EXTENDED' | |
}), | |
PARENT: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
value: 'PARENT', | |
label: 'Parent', | |
category: 'EXTENDED' | |
}), | |
GRANDPARENT: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
value: 'GRANDPARENT', | |
label: 'Grandparent', | |
category: 'EXTENDED' | |
}), | |
SIBLING: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
value: 'SIBLING', | |
label: 'Sibling', | |
category: 'EXTENDED' | |
}), | |
SIBLING_IN_LAW: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
value: 'SIBLING_IN_LAW', | |
label: 'Sibling In Law', | |
category: 'EXTENDED' | |
}), | |
NIECE_NEPHEW: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
value: 'NIECE_NEPHEW', | |
label: 'Niece/Nephew', | |
category: 'EXTENDED' | |
}), | |
AUNT_UNCLE: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
value: 'AUNT_UNCLE', | |
label: 'Aunt/Uncle', | |
category: 'EXTENDED' | |
}) | |
}); | |
const LIFE_ASSURED_VALIDATIONS = { | |
SPOUSE: { | |
min_age: 18, | |
max_age: 65, | |
mobile_required: true, | |
id_required: false | |
}, | |
CHILD: { | |
min_age: 0, | |
max_age: 21, | |
mobile_required: false, | |
id_required: false | |
}, | |
ADDITIONAL_PARTNER: { | |
min_age: 0, | |
max_age: 65, | |
mobile_required: true, | |
id_required: false | |
}, | |
ADULT_CHILD: { | |
min_age: 0, | |
max_age: 65, | |
mobile_required: true, | |
id_required: false | |
}, | |
PARENT: { | |
min_age: 21, | |
max_age: 65, | |
mobile_required: true, | |
id_required: false | |
}, | |
GRANDPARENT: { | |
min_age: 0, | |
max_age: 65, | |
mobile_required: true, | |
id_required: false | |
}, | |
SIBLING: { | |
min_age: 0, | |
max_age: 65, | |
mobile_required: true, | |
id_required: false | |
}, | |
SIBLING_IN_LAW: { | |
min_age: 0, | |
max_age: 65, | |
mobile_required: true, | |
id_required: false | |
}, | |
NIECE_NEPHEW: { | |
min_age: 0, | |
max_age: 65, | |
mobile_required: true, | |
id_required: false | |
}, | |
AUNT_UNCLE: { | |
min_age: 0, | |
max_age: 65, | |
mobile_required: true, | |
id_required: false | |
} | |
}; | |
/***/ }), | |
/***/ "4d59": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LifeAssuredModel; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return LifeAssuredNewModel; }); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9523"); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__); | |
/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("14d9"); | |
/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__); | |
/* harmony import */ var vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("b5ae"); | |
/* harmony import */ var vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__); | |
/* harmony import */ var _filters__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("8975"); | |
/* harmony import */ var _services_LifeAssuredService_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("4b2b"); | |
/* harmony import */ var _BaseModel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("9599"); | |
/* harmony import */ var _services_CustomerService_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("37ab"); | |
/* harmony import */ var _helpers_lumkani__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("b7be"); | |
const jsonKeyToObjectKeyMap = new Map([['id', 'id'], ['first_name', 'firstName'], ['last_name', 'lastName'], ['member_id', 'memberId'], ['mobile_number', 'mobileNumber'], ['life_assured_type', 'lifeAssuredType'], ['date_of_birth', 'dateOfBirth'], ['status', 'status']]); | |
class LifeAssuredModel extends _BaseModel__WEBPACK_IMPORTED_MODULE_5__[/* BaseModel */ "a"] { | |
constructor(lifeAssured) { | |
super(); | |
for (const [, camelCaseKey] of jsonKeyToObjectKeyMap) { | |
this[camelCaseKey] = lifeAssured[camelCaseKey]; | |
} | |
} | |
toLkJSON() { | |
return this.toJSONBase(jsonKeyToObjectKeyMap); | |
} | |
get lifeAssuredTypeDescription() { | |
let typeDescription = 'Spouse'; | |
if (this.lifeAssuredType === 1) { | |
typeDescription = 'Child'; | |
} | |
return typeDescription; | |
} | |
} | |
// TODO: Change to LifeAssuredModel once we kill the old one | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(LifeAssuredModel, "fromLkJSON", json => { | |
const model = LifeAssuredModel.fromJSONBase(json, jsonKeyToObjectKeyMap); | |
return new LifeAssuredModel(model); | |
}); | |
class LifeAssuredNewModel { | |
constructor({ | |
id, | |
policyId, | |
firstName, | |
surname, | |
mobileNumber, | |
dateOfBirth, | |
idType, | |
idPassportNumber, | |
lifeAssuredType, | |
isDeleted | |
} = {}) { | |
this.id = id; | |
this.policyId = policyId; | |
this.firstName = firstName; | |
this.surname = surname; | |
this.mobileNumber = mobileNumber || null; | |
this.dateOfBirth = dateOfBirth; | |
this.idType = idType; | |
this.idPassportNumber = idPassportNumber; | |
this.lifeAssuredType = lifeAssuredType; | |
this.isDeleted = isDeleted; | |
for (const k of ['id', 'isDeleted', 'policyId']) { | |
if (this[k] === undefined) { | |
delete this[k]; | |
} | |
} | |
} | |
static mobileIsRequired(lifeAssuredType, dateOfBirth) { | |
let childMobileRequired = false; | |
if (lifeAssuredType === _services_LifeAssuredService_constants__WEBPACK_IMPORTED_MODULE_4__[/* LIFE_ASSURED_TYPE_ENUM */ "c"].CHILD.value) { | |
childMobileRequired = dateOfBirth ? _helpers_lumkani__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"].calculateAge(dateOfBirth) >= _services_LifeAssuredService_constants__WEBPACK_IMPORTED_MODULE_4__[/* CHILD_AGE_REQUIRING_CELL_NUMBER */ "a"] : false; | |
} | |
return childMobileRequired || _services_LifeAssuredService_constants__WEBPACK_IMPORTED_MODULE_4__[/* LIFE_ASSURED_VALIDATIONS */ "d"][lifeAssuredType].mobile_required; | |
} | |
cleanToUpdate() { | |
delete this.id; | |
delete this.isDeleted; | |
delete this.policyId; | |
delete this.lifeAssuredType; | |
return this; | |
} | |
} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(LifeAssuredNewModel, "create", lifeAssured => new LifeAssuredNewModel(lifeAssured)); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(LifeAssuredNewModel, "schema", { | |
firstName: [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__["required"]], | |
surname: [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__["required"]], | |
mobileNumber: ({ | |
lifeAssuredType, | |
dateOfBirth | |
}) => { | |
const handler = [_filters__WEBPACK_IMPORTED_MODULE_3__["isMobileNumber"]]; | |
if (lifeAssuredType === undefined) { | |
return handler; | |
} | |
if (LifeAssuredNewModel.mobileIsRequired(lifeAssuredType, dateOfBirth)) { | |
handler.push(vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__["required"]); | |
} | |
return handler; | |
}, | |
dateOfBirth: ({ | |
lifeAssuredType | |
}, isMigration = false) => { | |
if (lifeAssuredType === undefined) { | |
return [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__["required"]]; | |
} | |
const { | |
min_age: minAge, | |
max_age: maxAge | |
} = _services_LifeAssuredService_constants__WEBPACK_IMPORTED_MODULE_4__[/* LIFE_ASSURED_VALIDATIONS */ "d"][lifeAssuredType]; | |
let ageValidationFn; | |
if (isMigration) { | |
if (lifeAssuredType === _services_LifeAssuredService_constants__WEBPACK_IMPORTED_MODULE_4__[/* LIFE_ASSURED_TYPE_ENUM */ "c"].CHILD.value) { | |
ageValidationFn = value => Object(_filters__WEBPACK_IMPORTED_MODULE_3__["isAgeWithinRange"])(value, minAge, _services_LifeAssuredService_constants__WEBPACK_IMPORTED_MODULE_4__[/* MAX_CHILD_AGE_FOR_COVER */ "e"]); | |
} else if (lifeAssuredType === _services_LifeAssuredService_constants__WEBPACK_IMPORTED_MODULE_4__[/* LIFE_ASSURED_TYPE_ENUM */ "c"].SPOUSE.value) { | |
ageValidationFn = value => Object(_filters__WEBPACK_IMPORTED_MODULE_3__["isAgeWithinRange"])(value, minAge, _services_LifeAssuredService_constants__WEBPACK_IMPORTED_MODULE_4__[/* OLDEST_MIGRATING_SPOUSE_AGE */ "h"]); | |
} else { | |
ageValidationFn = value => Object(_filters__WEBPACK_IMPORTED_MODULE_3__["isAgeWithinRange"])(value, minAge, maxAge); | |
} | |
} else { | |
ageValidationFn = value => Object(_filters__WEBPACK_IMPORTED_MODULE_3__["isAgeWithinRange"])(value, minAge, maxAge); | |
} | |
return [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__["required"], ageValidationFn]; | |
}, | |
idType: ({ | |
lifeAssuredType, | |
idType | |
}) => { | |
if (lifeAssuredType === undefined) { | |
return []; | |
} | |
const { | |
id_required: idRequired | |
} = _services_LifeAssuredService_constants__WEBPACK_IMPORTED_MODULE_4__[/* LIFE_ASSURED_VALIDATIONS */ "d"][lifeAssuredType]; | |
if (idRequired || idType !== _services_CustomerService_constants__WEBPACK_IMPORTED_MODULE_6__[/* ID_TYPE_ENUM */ "d"].NO_ID.value) { | |
return [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__["required"]]; | |
} | |
return []; | |
}, | |
idPassportNumber: _filters__WEBPACK_IMPORTED_MODULE_3__["idPassportNumber"], | |
lifeAssuredType: [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__["required"]] | |
}); | |
/***/ }), | |
/***/ "4dc8": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DeviceModel; }); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9523"); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__); | |
/* harmony import */ var vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("b5ae"); | |
/* harmony import */ var vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__); | |
/* harmony import */ var _helpers_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("5b55"); | |
/* harmony import */ var _filters__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("8975"); | |
/* harmony import */ var _schema_validators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("0dec"); | |
class DeviceModel { | |
/** | |
* @param {Object} device | |
* @param {string} device.deviceBarcode - The 9 digit device barcode | |
* @param {null|string} device.devicePhoto1 - Photo URL | |
* @param {null|string} device.devicePhoto2 - Photo URL | |
* @param {null|string} device.devicePhoto3 - Photo URL | |
* @param {DEVICE_TYPES_ENUM} device.deviceType - Device types supported | |
* @param {number} device.id | |
*/ | |
constructor({ | |
deviceBarcode, | |
devicePhoto1, | |
devicePhoto2, | |
devicePhoto3, | |
deviceType, | |
id | |
}) { | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "deviceBarcode", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "devicePhoto1", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "devicePhoto2", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "devicePhoto3", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "deviceType", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "id", void 0); | |
this.deviceBarcode = deviceBarcode; | |
this.devicePhoto1 = devicePhoto1; | |
this.devicePhoto2 = devicePhoto2; | |
this.devicePhoto3 = devicePhoto3; | |
this.deviceType = deviceType; | |
this.id = id; | |
} | |
valuesToUpdate() { | |
delete this.id; | |
delete this.devicePhoto1; | |
delete this.devicePhoto2; | |
delete this.devicePhoto3; | |
return this; | |
} | |
get isValid() { | |
return DeviceModel.schema.validateStrict(this); | |
} | |
} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(DeviceModel, "create", device => new DeviceModel(device)); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(DeviceModel, "schema", { | |
deviceBarcode: [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__["required"], _filters__WEBPACK_IMPORTED_MODULE_3__["numbersOnlyFilter"], Object(vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__["minLength"])(_helpers_constants__WEBPACK_IMPORTED_MODULE_2__[/* DEVICE_BARCODE_LENGTH */ "i"]), Object(vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__["maxLength"])(_helpers_constants__WEBPACK_IMPORTED_MODULE_2__[/* DEVICE_BARCODE_LENGTH */ "i"])], | |
..._schema_validators__WEBPACK_IMPORTED_MODULE_4__[/* schemaValidators */ "a"] | |
}); | |
/***/ }), | |
/***/ "53c7": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
const DETECTOR_STATUS = Object.freeze({ | |
ACTIVE: 'ACTIVE', | |
DELETED: 'DELETED', | |
UPGRADED_FIRE_TO_FIRE_FUNERAL: 'UPGRADED_FIRE_TO_FIRE_FUNERAL', | |
DOWNGRADED_TO_FREE: 'DOWNGRADED_TO_FREE', | |
NTU: 'NTU' | |
}); | |
/* harmony default export */ __webpack_exports__["a"] = (DETECTOR_STATUS); | |
/***/ }), | |
/***/ "5b55": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "H", function() { return PRIMARY_COLOR; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return DEVICE_BARCODE_LENGTH; }); | |
/* unused harmony export ALARM_BARCODE_LENGTH */ | |
/* unused harmony export FRONT_DOOR_BARCODE_LENGTH */ | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return GOOGLE_MAPS_ZOOM_LEVEL; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return GPS_ACCURACY_THRESHOLD_FOR_GPS_ACCEPTANCE; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return MAXIMUM_GPS_ACCURACY_ACCEPTED; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return GPS_TIMEOUT_MS; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return CONVERSION_TO_CENTS_UNIT; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return CSV_LOADING_MESSAGE; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "A", function() { return NO_RESULTS; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return INSURANCE_EXPECTED_PAYMENT_DATE; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return INSURANCE_COMMENCEMENT_DATE_ORDER_DESC; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CENTS_TO_RAND_CONVERSION_AMOUNT; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return GPS_MESSAGES; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return GOOGLE_MAPS_INITIAL_GPS_LOCATION_JHB; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return MAX_NUM_GPS_READING_ATTEMPTS; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return CLIENT_REGISTRATION_TYPE; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "M", function() { return UPLOAD_STATUS; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F", function() { return PHOTO_TYPE; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return CUSTOMER_PHOTO_LIST; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "w", function() { return MAX_NUMBER_OF_CHILDREN; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return MAX_NUMBER_OF_SPOUSE; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return LIFE_ASSURED_STATUS; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return DOWN_TWO_PAGES; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return DOWN_ONE_PAGE; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "L", function() { return SYSTEM_APP_TYPE; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "G", function() { return POLICY_TYPE_OPTIONS; }); | |
/* unused harmony export GLOBAL_COMMUNITY_IDS */ | |
/* unused harmony export COMMUNITY_IDS */ | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return DEFAULT_GPS_BY_COMMUNITY; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "E", function() { return PAYMENT_STATUS; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "J", function() { return REPORT_NAME; }); | |
/* unused harmony export PROVINCE_ENUM */ | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "I", function() { return PROVINCE_MAP; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return LIFE_ASSURED_TYPE; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return LIFE_ASSURED_TYPE_MAP; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "z", function() { return MEDIA_BASE_URL; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return CLIENT_STATUS; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "K", function() { return RESIZED_IMAGE_URL; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "N", function() { return USER_STATUS; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CLIENT_GENDER; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "O", function() { return USER_TYPE; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "D", function() { return PAYMENT_CATEGORIES; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "B", function() { return OLD_MODEL_LANGUAGE_OPTIONS; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "C", function() { return PAGE_SIZE_DISABLE_PAGINATION; }); | |
/* harmony import */ var quasar_src_utils_colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("bc78"); | |
; | |
const PRIMARY_COLOR = quasar_src_utils_colors_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].getPaletteColor('primary'); | |
const DEVICE_BARCODE_LENGTH = 9; | |
const ALARM_BARCODE_LENGTH = 11; | |
const FRONT_DOOR_BARCODE_LENGTH = 11; | |
const GOOGLE_MAPS_ZOOM_LEVEL = 17; | |
const GPS_ACCURACY_THRESHOLD_FOR_GPS_ACCEPTANCE = 15; | |
const MAXIMUM_GPS_ACCURACY_ACCEPTED = 30; | |
const GPS_TIMEOUT_MS = 20000; | |
const CONVERSION_TO_CENTS_UNIT = 100; | |
const CSV_LOADING_MESSAGE = 'Generating CSV file...'; | |
const NO_RESULTS = 'No results'; | |
const INSURANCE_EXPECTED_PAYMENT_DATE = 'insurance_expected_payment_date'; | |
const INSURANCE_COMMENCEMENT_DATE_ORDER_DESC = '-insurance_commencement_date'; | |
const CENTS_TO_RAND_CONVERSION_AMOUNT = 100; | |
const GPS_MESSAGES = { | |
TIMEOUT: 'Timeout error! Please go outside the home to capture the location.', | |
SUCCESSFULLY_FOUND: 'Location found successfully', | |
ACCURACY_IS_TOO_HIGH: `Please, capture another location. Accuracy must be less than ${MAXIMUM_GPS_ACCURACY_ACCEPTED} meters`, | |
INVALID_COORDINATES: 'Invalid coordinates, please try to capture again' | |
}; | |
const GOOGLE_MAPS_INITIAL_GPS_LOCATION_JHB = { | |
latitude: -26.195246, | |
longitude: 28.034088 | |
}; | |
const MAX_NUM_GPS_READING_ATTEMPTS = 3; | |
const CLIENT_REGISTRATION_TYPE = Object.freeze({ | |
CREATE: 0, | |
UPGRADE_FREE_CLIENT: 1, | |
UPGRADE_FIRE_TO_FIRE_FUNERAL: 2, | |
DETECTOR_REPLACEMENT: 3 | |
}); | |
const UPLOAD_STATUS = Object.freeze({ | |
PENDING: 'Pending', | |
FAILED: 'Failed', | |
SUCCESS: 'Success' | |
}); | |
const PHOTO_TYPE = Object.freeze({ | |
DETECTOR_PHOTO: 0, | |
DEBIT_ORDER_FORM_PHOTO: 1, | |
FUNERAL_POLICY_CERT_PHOTO: 2, | |
CLIENT_PHOTO: 3, | |
RENTAL_AGREEMENT_PHOTO: 4, | |
FRONT_DOOR_HOUSE_NUMBER_PHOTO: 5, | |
INSIDE_RIGHT_PHOTO: 6, | |
INSIDE_LEFT_PHOTO: 7, | |
INSIDE_ONE_PHOTO: 8, | |
PHOTO_LEFT: 9, | |
PHOTO_RIGHT: 10, | |
PHOTO_INSIDE_TWO: 11 | |
}); | |
const CUSTOMER_PHOTO_LIST = { | |
[PHOTO_TYPE.DEBIT_ORDER_FORM_PHOTO]: { | |
label: 'Debit Order Form', | |
name: 'photoDebitOrderForm', | |
sublabel: 'Capture client\'s debit order form', | |
validationErrorMsg: 'Please take a photo of the debit order form', | |
backendName: 'photo_debit_order_form' | |
}, | |
[PHOTO_TYPE.FUNERAL_POLICY_CERT_PHOTO]: { | |
label: 'Funeral Policy Certificate', | |
name: 'photoFuneralPolicyCert', | |
sublabel: 'Capture client\'s funeral policy certificate', | |
validationErrorMsg: 'Please take a photo of the funeral policy certificate', | |
backendName: 'photo_funeral_policy_cert' | |
}, | |
[PHOTO_TYPE.RENTAL_AGREEMENT_PHOTO]: { | |
label: 'Rental Agreement', | |
name: 'photoRentalAgreement', | |
sublabel: 'Capture client\'s rental agreement', | |
validationErrorMsg: 'Please take a photo of the rental agreement', | |
backendName: 'photo_rental_agreement' | |
}, | |
[PHOTO_TYPE.DETECTOR_PHOTO]: { | |
label: 'Detector Photo', | |
name: 'devicePhoto', | |
sublabel: 'Capture a picture of the fire detector once installed', | |
validationErrorMsg: 'Please take a detector photo', | |
backendName: 'device_photo' | |
}, | |
[PHOTO_TYPE.CLIENT_PHOTO]: { | |
label: 'Client', | |
name: 'photoClient', | |
sublabel: 'Capture the client', | |
validationErrorMsg: 'Please take a client photo', | |
backendName: 'photo_client' | |
}, | |
[PHOTO_TYPE.FRONT_DOOR_HOUSE_NUMBER_PHOTO]: { | |
label: 'Front Door & House Number', | |
name: 'photoOutside', | |
sublabel: 'Capture front door & house number the home', | |
validationErrorMsg: 'Please take a front door & house number photo', | |
backendName: 'photo_outside' | |
}, | |
[PHOTO_TYPE.INSIDE_RIGHT_PHOTO]: { | |
type: PHOTO_TYPE.INSIDE_RIGHT_PHOTO, | |
label: 'Inside Right', | |
name: 'photoInsideRight', | |
sublabel: 'Capture the right inside of the home', | |
validationErrorMsg: 'Please take an inside right photo', | |
backendName: 'photo_inside_right' | |
}, | |
[PHOTO_TYPE.INSIDE_LEFT_PHOTO]: { | |
type: PHOTO_TYPE.INSIDE_LEFT_PHOTO, | |
label: 'Inside Left', | |
name: 'photoInsideLeft', | |
sublabel: 'Capture the left inside of the home', | |
validationErrorMsg: 'Please take an inside left photo', | |
backendName: 'photo_inside_left' | |
}, | |
[PHOTO_TYPE.INSIDE_ONE_PHOTO]: { | |
label: 'Inside One', | |
name: 'photoInsideOne', | |
sublabel: 'Capture the inside of the home', | |
validationErrorMsg: 'Please take an inside one photo', | |
backendName: 'photo_inside_one' | |
}, | |
[PHOTO_TYPE.PHOTO_LEFT]: { | |
label: 'Photo Left', | |
name: 'photoLeft', | |
sublabel: 'Capture the left of the home', | |
validationErrorMsg: 'Please take a left photo', | |
backendName: 'photo_left' | |
}, | |
[PHOTO_TYPE.PHOTO_RIGHT]: { | |
label: 'Photo Right', | |
name: 'photoRight', | |
sublabel: 'Capture the right of the home', | |
validationErrorMsg: 'Please take a right photo', | |
backendName: 'photo_right' | |
}, | |
[PHOTO_TYPE.PHOTO_INSIDE_TWO]: { | |
label: 'Inside Two', | |
name: 'photoInsideTwo', | |
sublabel: 'Capture the another inside of the home', | |
validationErrorMsg: 'Please take an inside two photo', | |
backendName: 'photo_inside_two' | |
} | |
}; | |
const MAX_NUMBER_OF_CHILDREN = 5; | |
const MAX_NUMBER_OF_SPOUSE = 1; | |
const LIFE_ASSURED_STATUS = Object.freeze({ | |
ACTIVE: 'ACTIVE', | |
DELETED: 'DELETED' | |
}); | |
const DOWN_TWO_PAGES = -2; | |
const DOWN_ONE_PAGE = -1; | |
const SYSTEM_APP_TYPE = Object.freeze({ | |
SENSORS_APP: 'Sensors App', | |
INSURANCE_APP: 'Insurance App', | |
FIRE_FUNERAL_APP: 'Fire funeral App', | |
GOLD_INTRUDER_PLUS_R100_DEVICE_APP: 'Gold Intruder plus R100 Device App', | |
GOLD_INTRUDER_APP: 'Gold Intruder App', | |
DIAMOND_INTRUDER_PLUS_R100_DEVICE_APP: 'Diamond Intruder plus R100 Device App', | |
DIAMOND_INTRUDER_APP: 'Diamond Intruder App' | |
}); | |
const POLICY_TYPE_OPTIONS = [{ | |
label: 'Fire', | |
value: SYSTEM_APP_TYPE.INSURANCE_APP | |
}, { | |
label: 'Fire + Funeral', | |
value: SYSTEM_APP_TYPE.FIRE_FUNERAL_APP | |
}]; | |
const GLOBAL_COMMUNITY_IDS = { | |
MURUKU: 27 | |
}; | |
const COMMUNITY_IDS = { | |
...GLOBAL_COMMUNITY_IDS, | |
TIRO_RFP: 25 | |
}; | |
const DEFAULT_GPS_BY_COMMUNITY = { | |
[COMMUNITY_IDS.TIRO_RFP]: { | |
latitude: -26.528775, | |
longitude: 27.828393, | |
accuracy: 0 | |
} | |
}; | |
const PAYMENT_STATUS = Object.freeze({ | |
SUCCESSFUL: 'SUCCESSFUL', | |
CANCELLED: 'CANCELLED' | |
}); | |
const REPORT_NAME = Object.freeze({ | |
CLIENTS_IN_APPLICATION: 'Clients In Application Phase', | |
CLIENTS_COMMENCED: 'Clients That Have Commenced', | |
CLIENTS_MISSED_PAYMENT_DATE: 'Clients That missed expected payment date', | |
FUNERAL_BORDEREAU_ALL_CLIENTS: 'Funeral Bordereau - All clients', | |
FUNERAL_BORDEREAU_ADDED_CLIENTS: 'Funeral Bordereau - Added ', | |
FUNERAL_BORDEREAU_REMOVED_CLIENTS: 'Funeral Bordereau - Removed ', | |
CANCELLED_CLIENTS: 'Cancelled Clients ', | |
UPDATED_FUNERAL_INFO: 'Updated Funeral Info' | |
}); | |
const PROVINCE_ENUM = Object.freeze({ | |
GAUTENG: 0, | |
WESTERN_CAPE: 1, | |
BANGLADESH: 2, | |
ADMIN_PROVINCE: 3, | |
MANUFACTURING_PROVINCE: 4 | |
}); | |
const PROVINCE_MAP = Object.freeze({ | |
[PROVINCE_ENUM.GAUTENG]: { | |
description: 'Gauteng' | |
}, | |
[PROVINCE_ENUM.WESTERN_CAPE]: { | |
description: 'Western Cape' | |
}, | |
[PROVINCE_ENUM.BANGLADESH]: { | |
description: 'Bangladesh' | |
}, | |
[PROVINCE_ENUM.ADMIN_PROVINCE]: { | |
description: 'Admin Province' | |
}, | |
[PROVINCE_ENUM.MANUFACTURING_PROVINCE]: { | |
description: 'Manufacturing Province' | |
} | |
}); | |
const LIFE_ASSURED_TYPE = Object.freeze({ | |
SPOUSE: 0, | |
CHILD: 1 | |
}); | |
const LIFE_ASSURED_TYPE_MAP = Object.freeze({ | |
[LIFE_ASSURED_TYPE.SPOUSE]: { | |
description: 'Spouse' | |
}, | |
[LIFE_ASSURED_TYPE.CHILD]: { | |
description: 'Child' | |
} | |
}); | |
const MEDIA_BASE_URL = '/watchtower/data/'; | |
const CLIENT_STATUS = Object.freeze({ | |
ACTIVE: 'ACTIVE', | |
DELETED: 'DELETED' | |
}); | |
const RESIZED_IMAGE_URL = (width, height) => `/watchtower/image.php?width=${width}&height=${height}&cropratio=1:1&image=`; | |
const USER_STATUS = { | |
ACTIVE: 'ACTIVE', | |
INACTIVE: 'INACTIVE' | |
}; | |
const CLIENT_GENDER = Object.freeze({ | |
MALE: 'Male', | |
FEMALE: 'Female', | |
NON_BINARY: 'Trans/Non-binary' | |
}); | |
const USER_TYPE = Object.freeze({ | |
INSURANCE: 'INSURANCE', | |
INSTALLATION: 'INSTALLATION', | |
ADMIN: 'ADMIN', | |
GLOBAL_INSTALLATION: 'GLOBAL_INSTALLATION' | |
}); | |
const PAYMENT_CATEGORIES = Object.freeze({ | |
PREMIUM: 'PREMIUM', | |
INSTALLATION_FEE: 'INSTALLATION_FEE' | |
}); | |
const OLD_MODEL_LANGUAGE_OPTIONS = [{ | |
label: 'English', | |
value: 'english' | |
}, { | |
label: 'IsiXhosa', | |
value: 'isixhosa' | |
}, { | |
label: 'IsiZulu', | |
value: 'isizulu' | |
}, { | |
label: 'Afrikaans', | |
value: 'afrikaans' | |
}, { | |
label: 'SePedi', | |
value: 'sepedi' | |
}, { | |
label: 'IsiNdebele', | |
value: 'isindebele' | |
}, { | |
label: 'SeSotho', | |
value: 'sesotho' | |
}, { | |
label: 'SiSwati', | |
value: 'siswati' | |
}, { | |
label: 'XiTsonga', | |
value: 'xitsonga' | |
}, { | |
label: 'SeTswana', | |
value: 'setswana' | |
}, { | |
label: 'TshiVenda', | |
value: 'tshivenda' | |
}]; | |
const PAGE_SIZE_DISABLE_PAGINATION = -1; | |
/***/ }), | |
/***/ "6699": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return EmergencyContact; }); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9523"); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__); | |
/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("14d9"); | |
/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__); | |
/* harmony import */ var vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("b5ae"); | |
/* harmony import */ var vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__); | |
/* harmony import */ var _filters__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("8975"); | |
/* harmony import */ var _schema_validators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("0dec"); | |
class EmergencyContact { | |
constructor({ | |
id, | |
mobileNumber, | |
name, | |
policyId | |
}) { | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "id", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "mobileNumber", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "name", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "policyId", void 0); | |
this.id = id; | |
this.mobileNumber = mobileNumber; | |
this.name = name; | |
this.policyId = policyId; | |
} | |
} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(EmergencyContact, "create", emergencyContact => new EmergencyContact(emergencyContact)); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(EmergencyContact, "schema", { | |
mobileNumber: model => { | |
const validations = [_filters__WEBPACK_IMPORTED_MODULE_3__["isMobileNumber"]]; | |
if (model.name) { | |
validations.push(vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__["required"]); | |
} | |
return validations; | |
}, | |
name: model => { | |
const validations = []; | |
if (model.mobileNumber) { | |
validations.push(vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__["required"]); | |
} | |
return validations; | |
}, | |
..._schema_validators__WEBPACK_IMPORTED_MODULE_4__[/* schemaValidators */ "a"] | |
}); | |
/***/ }), | |
/***/ "6b7e": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony import */ var _enumHelper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("f3ac"); | |
const INSURANCE_PAYMENT_METHODS = Object(_enumHelper__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
BANK_DEPOSIT: 'Bank deposit', | |
PAY_AT: 'Pay@', | |
DEBIT_ORDER: 'Debit order' | |
}); | |
/* harmony default export */ __webpack_exports__["a"] = (INSURANCE_PAYMENT_METHODS); | |
/***/ }), | |
/***/ "726d": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "numbersOnlyFilter", function() { return numbersOnlyFilter; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trueOnlyFilter", function() { return trueOnlyFilter; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "youngerThanOrEqualToFilter", function() { return youngerThanOrEqualToFilter; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "notFutureDate", function() { return notFutureDate; }); | |
/* harmony import */ var src_helpers_lumkani__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("b7be"); | |
/* harmony import */ var vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("b5ae"); | |
/* harmony import */ var vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__); | |
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("c1df"); | |
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_2__); | |
// TODO: Deprecate | |
const numbersOnlyFilter = vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__["helpers"].regex('numbersOnlyFilter', /^[0-9]*$/); | |
const trueOnlyFilter = value => value; | |
const youngerThanOrEqualToFilter = age => value => src_helpers_lumkani__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].calculateAge(value) <= age; | |
const notFutureDate = value => !(moment__WEBPACK_IMPORTED_MODULE_2___default()(value, src_helpers_lumkani__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].DATE_FORMAT) && moment__WEBPACK_IMPORTED_MODULE_2___default()(value, src_helpers_lumkani__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].DATE_FORMAT) > moment__WEBPACK_IMPORTED_MODULE_2___default()()); | |
/***/ }), | |
/***/ "76c5": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
const USER_TYPE = Object.freeze({ | |
INSURANCE: 'INSURANCE', | |
INSTALLATION: 'INSTALLATION', | |
ADMIN: 'ADMIN', | |
GLOBAL_INSTALLATION: 'GLOBAL_INSTALLATION' | |
}); | |
/* harmony default export */ __webpack_exports__["a"] = (USER_TYPE); | |
/***/ }), | |
/***/ "778a": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HTTPService; }); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9523"); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__); | |
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("bc3a"); | |
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_1__); | |
/* harmony import */ var quasar_src_plugins_Platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("0967"); | |
; | |
const DEFAULT_REQUEST_TIMEOUT_VALUE_MS = 60000; | |
const AxiosInstance = axios__WEBPACK_IMPORTED_MODULE_1___default.a.create({ | |
baseURL: "https://dev.lumkani.org", | |
timeout: DEFAULT_REQUEST_TIMEOUT_VALUE_MS | |
}); | |
// TODO: Find a better way to mock this for the tests. Remove the if and see the error by yourself :) | |
if (quasar_src_plugins_Platform_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "b"] !== undefined && quasar_src_plugins_Platform_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "b"].is !== undefined) { | |
const text = `AgentApp/${"3.3.0-rc"} ${quasar_src_plugins_Platform_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "b"].is.name}/${quasar_src_plugins_Platform_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "b"].is.version} ${quasar_src_plugins_Platform_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "b"].is.platform}`; | |
AxiosInstance.defaults.headers.common['lumkani-http-agent'] = text; | |
} | |
class HTTPService { | |
static uploadBase64File(url, name, blob, params, method) { | |
const formData = new FormData(); | |
const fileName = `photo.${blob.type.split('/')[1]}`; | |
formData.append(name, blob, fileName); | |
for (const p in params) { | |
formData.append(p, params[p]); | |
} | |
const config = { | |
headers: { | |
'Content-Type': 'multipart/form-data' | |
} | |
}; | |
return HTTPService.request({ | |
url, | |
method, | |
data: formData, | |
config | |
}); | |
} | |
} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(HTTPService, "put", AxiosInstance.put); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(HTTPService, "get", AxiosInstance.get); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(HTTPService, "patch", AxiosInstance.patch); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(HTTPService, "post", AxiosInstance.post); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(HTTPService, "request", AxiosInstance.request); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(HTTPService, "delete", (url, data) => AxiosInstance.delete(url, { | |
data | |
})); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(HTTPService, "postFormData", (url, formData) => AxiosInstance.post(url, formData, { | |
headers: { | |
'Content-Type': 'multipart/form-data' | |
} | |
})); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(HTTPService, "setAuthorizationToken", token => { | |
AxiosInstance.defaults.headers.common.Authorization = `Token ${token}`; | |
}); | |
/***/ }), | |
/***/ "7844": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
// EXPORTS | |
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ PaymentService_PaymentService; }); | |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js | |
var defineProperty = __webpack_require__("9523"); | |
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty); | |
// EXTERNAL MODULE: ./src/helpers/http.js + 1 modules | |
var http = __webpack_require__("825e"); | |
// EXTERNAL MODULE: ./src/models/PaymentModel/index.js | |
var PaymentModel = __webpack_require__("a31b"); | |
// EXTERNAL MODULE: ./src/models/BaseModel/index.js | |
var BaseModel = __webpack_require__("9599"); | |
// EXTERNAL MODULE: ./src/helpers/constants.js | |
var constants = __webpack_require__("5b55"); | |
// CONCATENATED MODULE: ./src/models/MinimumRequiredPaymentInfoModel/index.js | |
const jsonKeyToObjectKeyMap = new Map([['insurance_policy_premium', 'insurancePolicyPremium'], ['grace_one_payment_amount', 'graceOnePaymentAmount'], ['grace_two_payment_amount', 'graceTwoPaymentAmount'], ['coverage_payment_amount', 'coveragePaymentAmount']]); | |
class MinimumRequiredPaymentInfoModel_MinimumRequiredPaymentInfoModel extends BaseModel["a" /* BaseModel */] { | |
constructor(minimumRequiredPaymentInfo = {}) { | |
super(); | |
for (const [, camelCaseKey] of jsonKeyToObjectKeyMap) { | |
this[camelCaseKey] = minimumRequiredPaymentInfo[camelCaseKey]; | |
} | |
} | |
get insurancePolicyPremiumAsRands() { | |
return this.insurancePolicyPremium / constants["e" /* CONVERSION_TO_CENTS_UNIT */]; | |
} | |
} | |
defineProperty_default()(MinimumRequiredPaymentInfoModel_MinimumRequiredPaymentInfoModel, "fromLkJSON", json => { | |
const jsonModel = MinimumRequiredPaymentInfoModel_MinimumRequiredPaymentInfoModel.fromJSONBase(json, jsonKeyToObjectKeyMap); | |
return new MinimumRequiredPaymentInfoModel_MinimumRequiredPaymentInfoModel(jsonModel); | |
}); | |
// CONCATENATED MODULE: ./src/services/PaymentService/constants.js | |
const PAYMENTS_URL = '/api/payments'; | |
const PAYMENTS_PHOTOS_URL = '/api/payments/photos'; | |
const PAYMENTS_AMOUNT = '/api/payments/amount'; | |
const PAYMENTS_BATCH = '/api/payments/batch'; | |
const PAYMENTS_EASYPAY_CSV = '/api/payments/easypay-csv-report'; | |
const UPDATE_PAYMENT_STATUS_URL = paymentID => `/api/payments/${paymentID}/update-status`; | |
const COLLECT_PAYMENT_URL = detectorID => `/api/detectors/${detectorID}/collect-payment`; | |
const MINIMUM_REQUIRED_PAYMENT_INFO_URL = detectorID => `api/detectors/${detectorID}/minimum-required-payment`; | |
// EXTERNAL MODULE: ./src/services/HTTPService/index.js | |
var HTTPService = __webpack_require__("778a"); | |
// CONCATENATED MODULE: ./src/services/PaymentService/index.js | |
class PaymentService_PaymentService { | |
static savePayment(payment, params = {}) { | |
const options = {}; | |
if (params.withCustomerNotification !== null) { | |
options.with_created_notification_to_customer = params.withCustomerNotification; | |
} | |
return http["a" /* default */].post(PAYMENTS_URL, { | |
payment, | |
options | |
}).then(res => PaymentModel["a" /* PaymentModel */].fromLkJSON(res.data)); | |
} | |
static savePaymentPhoto(paymentId, base64Image) { | |
const params = { | |
id: paymentId, | |
photo_type: 'payment_photo' | |
}; | |
return http["a" /* default */].uploadBase64File(PAYMENTS_PHOTOS_URL, base64Image, params).then(({ | |
data | |
}) => PaymentModel["a" /* PaymentModel */].fromLkJSON(data)); | |
} | |
static saveSignatureImage(paymentId, signatureImageBase64Url) { | |
const params = { | |
id: paymentId, | |
photo_type: 'payment_signature_image' | |
}; | |
return http["a" /* default */].uploadBase64File(PAYMENTS_PHOTOS_URL, signatureImageBase64Url, params); | |
} | |
static getPaymentById(paymentId) { | |
return http["a" /* default */].get(`${PAYMENTS_URL}/${paymentId}`).then(res => PaymentModel["a" /* PaymentModel */].fromLkJSON(res.data.payment)); | |
} | |
static listPayments(filters = {}, pagination = {}, options = {}) { | |
const params = { | |
filters: {}, | |
options: { | |
...options, | |
include_count: true | |
} | |
}; | |
if (pagination && pagination.rowsPerPage > 0) { | |
params.filters.page_size = pagination.rowsPerPage; | |
params.filters.page_number = pagination.page; | |
} | |
if (filters.clientIds) { | |
params.filters.device_id__in = filters.clientIds; | |
} | |
if (filters.deviceId) { | |
params.filters.device_id = filters.deviceId; | |
} | |
if (filters.userIds) { | |
params.filters.user_id__in = filters.userIds; | |
} | |
if (filters.paymentAmount !== null) { | |
params.filters.payment_amount = filters.paymentAmount; | |
} | |
if (filters.paymentType) { | |
params.filters.payment_type = filters.paymentType; | |
} | |
if (filters.notes) { | |
params.filters.notes = filters.notes; | |
} | |
if (filters.status) { | |
params.filters.status = filters.status; | |
} | |
if (filters.createdAt) { | |
params.filters.created_at = filters.createdAt; | |
} | |
if (filters.paymentCategory) { | |
params.filters.payment_category = filters.paymentCategory; | |
} | |
if (filters.actualPaymentDate) { | |
params.filters.actual_payment_date__contains = filters.actualPaymentDate; | |
} | |
if (filters.match) { | |
params.filters.non_matching_payment_amounts = filters.match === 'nonMatch'; | |
} | |
return http["a" /* default */].get(PAYMENTS_URL, { | |
params | |
}).then(res => { | |
const payments = res.data.payments.map(payment => PaymentModel["a" /* PaymentModel */].fromLkJSON(payment)); | |
const meta = { | |
paymentsCount: res.data.payments_count, | |
pagination: { | |
...pagination | |
} | |
}; | |
return { | |
payments, | |
meta | |
}; | |
}); | |
} | |
static updatePaymentStatus(paymentId, status) { | |
const payload = { | |
payment: { | |
status | |
} | |
}; | |
return http["a" /* default */].post(UPDATE_PAYMENT_STATUS_URL(paymentId), payload).then(res => PaymentModel["a" /* PaymentModel */].fromLkJSON(res.data)); | |
} | |
static collectPayment(detectorId, payment, params = {}) { | |
const options = {}; | |
if (params.withCustomerNotification !== null) { | |
options.with_created_notification_to_customer = params.withCustomerNotification; | |
} | |
return http["a" /* default */].post(COLLECT_PAYMENT_URL(detectorId), { | |
payment, | |
options | |
}).then(res => PaymentModel["a" /* PaymentModel */].fromLkJSON(res.data)); | |
} | |
static getMinimumRequiredPaymentInfo(detectorId) { | |
return http["a" /* default */].get(MINIMUM_REQUIRED_PAYMENT_INFO_URL(detectorId)).then(res => MinimumRequiredPaymentInfoModel_MinimumRequiredPaymentInfoModel.fromLkJSON(res.data)); | |
} | |
} | |
defineProperty_default()(PaymentService_PaymentService, "buildUploadConfig", () => { | |
const config = http["a" /* default */].buildUploaderHeader(); | |
config.url = `${config.url}${PAYMENTS_BATCH}`; | |
return config; | |
}); | |
defineProperty_default()(PaymentService_PaymentService, "buildEasyPayUploadConfig", () => { | |
const config = http["a" /* default */].buildUploaderHeader(); | |
config.url = `${config.url}${PAYMENTS_EASYPAY_CSV}`; | |
return config; | |
}); | |
defineProperty_default()(PaymentService_PaymentService, "parseFailedUpload", res => JSON.parse(res.xhr.response)); | |
defineProperty_default()(PaymentService_PaymentService, "parseSuccessfulUpload", res => { | |
const { | |
payments | |
} = JSON.parse(res.xhr.response); | |
return payments.map(result => PaymentModel["a" /* PaymentModel */].fromLkJSON(result)); | |
}); | |
defineProperty_default()(PaymentService_PaymentService, "listPaymentAmountValues", () => http["a" /* default */].get(PAYMENTS_AMOUNT).then(res => res.data.payment_amounts)); | |
defineProperty_default()(PaymentService_PaymentService, "uploadPayAtCSVReport", file => { | |
const formData = new FormData(); | |
formData.append('file', file); | |
return HTTPService["a" /* HTTPService */].postFormData('/api/payments/pay-at-csv-report', formData); | |
}); | |
/***/ }), | |
/***/ "7a36": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FICA_STATUS; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return REQUIREMENTS; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return PREMIUM_COLLECTION_METHOD; }); | |
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ce96"); | |
const FICA_STATUS = Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
PENDING: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Pending', | |
value: 'PENDING' | |
}), | |
VERIFIED: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Verified', | |
value: 'VERIFIED' | |
}), | |
NOT_VERIFIED: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Not verified', | |
value: 'NOT_VERIFIED' | |
}), | |
NONE: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'None', | |
value: 'NONE' | |
}), | |
ERROR: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Error', | |
value: 'ERROR' | |
}) | |
}); | |
const REQUIREMENTS = Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
PROOF_OF_IDENTITY: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Proof of Identity', | |
value: 'PROOF_OF_IDENTITY' | |
}), | |
PROOF_OF_ADDRESS: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Proof of Address', | |
value: 'PROOF_OF_ADDRESS' | |
}), | |
PROOF_OF_SOURCE_OF_INCOME: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Proof of Source of Income', | |
value: 'PROOF_OF_SOURCE_OF_INCOME' | |
}), | |
PROOF_OF_SOURCE_OF_WEALTH: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Proof of Source of Wealth', | |
value: 'PROOF_OF_SOURCE_OF_WEALTH' | |
}) | |
}); | |
const PREMIUM_COLLECTION_METHOD = Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
DEBIT_ORDER: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Debit Order', | |
value: 'DEBIT_ORDER' | |
}), | |
CASH: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Cash', | |
value: 'CASH' | |
}) | |
}, { | |
fromCustomerPaymentMethod(_, customerPaymentMethod) { | |
if (customerPaymentMethod === 'DEBIT_ORDER') { | |
return PREMIUM_COLLECTION_METHOD.DEBIT_ORDER; | |
} | |
return PREMIUM_COLLECTION_METHOD.CASH; | |
} | |
}); | |
/***/ }), | |
/***/ "7a71": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PropertyModel; }); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9523"); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__); | |
/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("14d9"); | |
/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__); | |
/* harmony import */ var vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("b5ae"); | |
/* harmony import */ var vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__); | |
/* harmony import */ var _schema_validators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("0dec"); | |
/* harmony import */ var _filters__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("8975"); | |
/* harmony import */ var _AddressModel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("e427"); | |
const NUMBER_OF_ROOMS_MIN = 0; | |
const NUMBER_OF_LIVING_PEOPLE_MIN = 0; | |
const NUMBER_OF_LIVING_PEOPLE_MAX = 20; | |
const FIXED_DECIMALS = 8; | |
class PropertyModel { | |
constructor({ | |
id, | |
gpsLocation, | |
frontDoorHouseNumberPhoto, | |
propertyPurpose, | |
propertyType, | |
policyId, | |
address, | |
numberOfPeopleLiving, | |
contentsPhoto1, | |
contentsPhoto2, | |
contentsPhoto3, | |
contentsPhoto4, | |
contentsPhoto5, | |
contentsPhoto6, | |
isOwned, | |
numberOfRooms | |
}) { | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "id", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "gpsLocation", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "frontDoorHouseNumberPhoto", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "propertyPurpose", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "propertyType", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "policyId", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "address", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "numberOfPeopleLiving", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "contentsPhoto1", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "contentsPhoto2", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "contentsPhoto3", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "contentsPhoto4", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "contentsPhoto5", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "contentsPhoto6", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "isOwned", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "numberOfRooms", void 0); | |
this.gpsLocation = gpsLocation || {}; | |
this.frontDoorHouseNumberPhoto = frontDoorHouseNumberPhoto; | |
this.propertyPurpose = propertyPurpose; | |
this.propertyType = propertyType; | |
this.policyId = policyId; | |
this.address = _AddressModel__WEBPACK_IMPORTED_MODULE_5__[/* AddressModel */ "a"].create(address); | |
this.id = id; | |
this.numberOfPeopleLiving = numberOfPeopleLiving; | |
this.contentsPhoto1 = contentsPhoto1; | |
this.contentsPhoto2 = contentsPhoto2; | |
this.contentsPhoto3 = contentsPhoto3; | |
this.contentsPhoto4 = contentsPhoto4; | |
this.contentsPhoto5 = contentsPhoto5; | |
this.contentsPhoto6 = contentsPhoto6; | |
this.isOwned = isOwned; | |
this.numberOfRooms = numberOfRooms; | |
// Cast number to string | |
if ([this.gpsLocation.latitude, this.gpsLocation.longitude, this.gpsLocation.accuracy].every(x => x)) { | |
this.gpsLocation.latitude = parseFloat(this.gpsLocation.latitude).toFixed(FIXED_DECIMALS).toString(); | |
this.gpsLocation.longitude = parseFloat(this.gpsLocation.longitude).toFixed(FIXED_DECIMALS).toString(); | |
this.gpsLocation.accuracy = parseFloat(this.gpsLocation.accuracy).toFixed(FIXED_DECIMALS).toString(); | |
} | |
} | |
get fullAddress() { | |
return this.address.toString(); | |
} | |
} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(PropertyModel, "create", property => new PropertyModel(property)); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(PropertyModel, "schema", { | |
propertyPurpose: [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__["required"]], | |
propertyType: [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__["required"]], | |
gpsLocation: { | |
latitude: model => { | |
const validations = [_filters__WEBPACK_IMPORTED_MODULE_4__["gpsCoordinate"], _filters__WEBPACK_IMPORTED_MODULE_4__["gpsCoordinateMinAndMaxDecimals"], _filters__WEBPACK_IMPORTED_MODULE_4__["latitudeFilter"]]; | |
if (model.gpsLocation.longitude) { | |
validations.push(vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__["required"]); | |
} | |
return validations; | |
}, | |
longitude: model => { | |
const validations = [_filters__WEBPACK_IMPORTED_MODULE_4__["gpsCoordinate"], _filters__WEBPACK_IMPORTED_MODULE_4__["gpsCoordinateMinAndMaxDecimals"], _filters__WEBPACK_IMPORTED_MODULE_4__["longitudeFilter"]]; | |
if (model.gpsLocation.latitude) { | |
validations.push(vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__["required"]); | |
} | |
return validations; | |
} | |
}, | |
numberOfPeopleLiving: [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__["required"], _filters__WEBPACK_IMPORTED_MODULE_4__["numbersOnlyFilter"], Object(_filters__WEBPACK_IMPORTED_MODULE_4__["greaterThan"])(NUMBER_OF_LIVING_PEOPLE_MIN), Object(_filters__WEBPACK_IMPORTED_MODULE_4__["lessThanOrEqual"])(NUMBER_OF_LIVING_PEOPLE_MAX)], | |
isOwned: [_filters__WEBPACK_IMPORTED_MODULE_4__["requiredPropertyOwnership"]], | |
numberOfRooms: [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__["required"], _filters__WEBPACK_IMPORTED_MODULE_4__["numbersOnlyFilter"], Object(_filters__WEBPACK_IMPORTED_MODULE_4__["greaterThan"])(NUMBER_OF_ROOMS_MIN)], | |
..._schema_validators__WEBPACK_IMPORTED_MODULE_3__[/* schemaValidators */ "a"] | |
}); | |
/***/ }), | |
/***/ "7e6d": | |
/***/ (function(module, exports, __webpack_require__) { | |
// extracted by mini-css-extract-plugin | |
/***/ }), | |
/***/ "825e": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js | |
var es_array_push = __webpack_require__("14d9"); | |
// EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-exception.stack.js | |
var web_dom_exception_stack = __webpack_require__("b7ef"); | |
// EXTERNAL MODULE: ./node_modules/axios/index.js | |
var axios = __webpack_require__("bc3a"); | |
var axios_default = /*#__PURE__*/__webpack_require__.n(axios); | |
// EXTERNAL MODULE: ./node_modules/quasar/src/plugins/Platform.js | |
var Platform = __webpack_require__("0967"); | |
// CONCATENATED MODULE: ./src/helpers/axios.js | |
; | |
const DEFAULT_REQUEST_TIMEOUT_VALUE_MS = 60000; | |
const AxiosInstance = axios_default.a.create({ | |
baseURL: "https://dev.lumkani.org", | |
timeout: DEFAULT_REQUEST_TIMEOUT_VALUE_MS | |
}); | |
// TODO: Find a better way to mock this for the tests. Remove the if and see the error by yourself :) | |
if (Platform["b" /* default */] !== undefined && Platform["b" /* default */].is !== undefined) { | |
const text = `AgentApp/${"3.3.0-rc"} ${Platform["b" /* default */].is.name}/${Platform["b" /* default */].is.version} ${Platform["b" /* default */].is.platform}`; | |
AxiosInstance.defaults.headers.common['lumkani-http-agent'] = text; | |
} | |
/* harmony default export */ var helpers_axios = (AxiosInstance); | |
// CONCATENATED MODULE: ./src/helpers/http.js | |
// TODO: Move http to a service like HttpService since it is a wrapper around an API | |
function post(...args) { | |
return helpers_axios.post(...args); | |
} | |
function get(...args) { | |
return helpers_axios.get(...args); | |
} | |
function put(...args) { | |
return helpers_axios.put(...args); | |
} | |
function patch(...args) { | |
return helpers_axios.patch(...args); | |
} | |
function buildUploaderHeader() { | |
const config = {}; | |
const headers = []; | |
const objectValues = Object.entries(helpers_axios.defaults.headers.common); | |
for (const [jsonKey, objKey] of objectValues) { | |
headers.push({ | |
name: jsonKey, | |
value: objKey | |
}); | |
} | |
config.headers = headers; | |
config.url = helpers_axios.defaults.baseURL; | |
return config; | |
} | |
// helper function: generate a new file from base64 String | |
function dataURLtoFile(dataurl) { | |
const arr = dataurl.split(','); | |
const mime = arr[0].match(/:(.*?);/)[1]; | |
const bstr = atob(arr[1]); | |
let n = bstr.length; | |
const u8arr = new Uint8Array(n); | |
while (n) { | |
u8arr[n - 1] = bstr.charCodeAt(n - 1); | |
n -= 1; | |
} | |
return { | |
data: [u8arr], | |
type: mime | |
}; | |
} | |
function uploadBase64File(url, base64Url, params) { | |
const file = dataURLtoFile(base64Url); | |
const formData = new FormData(); | |
formData.append('file', new Blob(file.data, { | |
type: file.type | |
})); | |
for (const p in params) { | |
formData.append(p, params[p]); | |
} | |
const config = { | |
headers: { | |
'Content-Type': 'multipart/form-data' | |
} | |
}; | |
return helpers_axios.post(url, formData, config); | |
} | |
function setAuthorizationToken(token) { | |
helpers_axios.defaults.headers.common.Authorization = `Token ${token}`; | |
} | |
const http = { | |
get, | |
post, | |
put, | |
patch, | |
delete: helpers_axios.delete, | |
uploadBase64File, | |
setAuthorizationToken, | |
buildUploaderHeader | |
}; | |
/* harmony default export */ var helpers_http = __webpack_exports__["a"] = (http); | |
/***/ }), | |
/***/ "8975": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
// ESM COMPAT FLAG | |
__webpack_require__.r(__webpack_exports__); | |
// EXPORTS | |
__webpack_require__.d(__webpack_exports__, "isMobileNumber", function() { return /* binding */ isMobileNumber; }); | |
__webpack_require__.d(__webpack_exports__, "isOptional", function() { return /* binding */ isOptional; }); | |
__webpack_require__.d(__webpack_exports__, "isValidDate", function() { return /* binding */ isValidDate; }); | |
__webpack_require__.d(__webpack_exports__, "olderThan18Filter", function() { return /* binding */ olderThan18Filter; }); | |
__webpack_require__.d(__webpack_exports__, "numbersOnlyFilter", function() { return /* binding */ numbersOnlyFilter; }); | |
__webpack_require__.d(__webpack_exports__, "gpsCoordinate", function() { return /* binding */ gpsCoordinate; }); | |
__webpack_require__.d(__webpack_exports__, "greaterThan", function() { return /* binding */ greaterThan; }); | |
__webpack_require__.d(__webpack_exports__, "lessThanOrEqual", function() { return /* binding */ lessThanOrEqual; }); | |
__webpack_require__.d(__webpack_exports__, "latitudeFilter", function() { return /* binding */ latitudeFilter; }); | |
__webpack_require__.d(__webpack_exports__, "longitudeFilter", function() { return /* binding */ longitudeFilter; }); | |
__webpack_require__.d(__webpack_exports__, "idPassportNumber", function() { return /* binding */ idPassportNumber; }); | |
__webpack_require__.d(__webpack_exports__, "gpsCoordinateMinAndMaxDecimals", function() { return /* binding */ gpsCoordinateMinAndMaxDecimals; }); | |
__webpack_require__.d(__webpack_exports__, "requiredPropertyOwnership", function() { return /* binding */ requiredPropertyOwnership; }); | |
__webpack_require__.d(__webpack_exports__, "isYoungerThan65Filter", function() { return /* binding */ isYoungerThan65Filter; }); | |
__webpack_require__.d(__webpack_exports__, "hasNoEmojis", function() { return /* binding */ hasNoEmojis; }); | |
__webpack_require__.d(__webpack_exports__, "isAgeWithinRange", function() { return /* binding */ isAgeWithinRange; }); | |
// EXTERNAL MODULE: ./node_modules/vuelidate/lib/validators/index.js | |
var validators = __webpack_require__("b5ae"); | |
// EXTERNAL MODULE: ./src/helpers/lumkani.js | |
var lumkani = __webpack_require__("b7be"); | |
// EXTERNAL MODULE: ./src/services/CustomerService/constants.js | |
var constants = __webpack_require__("37ab"); | |
// CONCATENATED MODULE: ./src/filters/constants.js | |
const MIN_EXPECTED_DATE = 1; | |
const MAX_EXPECTED_DATE = 31; | |
const LATITUDE_NEGATIVE = -90; | |
const LATITUDE_POSITIVE = 90; | |
const LONGITUDE_NEGATIVE = -180; | |
const LONGITUDE_POSITIVE = 180; | |
const SOUTH_AFRICAN_PHONE_CODE_LENGTH = 2; | |
const MIN_GPS_DECIMAL_PLACE = 5; | |
const MAX_GPS_DECIMAL_PLACE = 8; | |
// CONCATENATED MODULE: ./src/filters/index.js | |
const numbersOnlyFilter = validators["helpers"].regex('numbersOnlyFilter', /^[0-9]*$/); | |
const olderThan18Filter = value => lumkani["a" /* default */].calculateAge(value) >= constants["b" /* CLIENT_AGE_FUNERAL_ENUM */].MIN.value; | |
const isAgeWithinRange = (value, minAge, maxAge) => { | |
const age = lumkani["a" /* default */].calculateAge(value); | |
return age >= minAge && age <= maxAge; | |
}; | |
const isYoungerThan65Filter = value => lumkani["a" /* default */].calculateAge(value) <= constants["b" /* CLIENT_AGE_FUNERAL_ENUM */].MAX.value; | |
const isValidSouthAfricaPhoneInitials = value => { | |
if (!value) { | |
return true; | |
} | |
const digits = value.substring(0, SOUTH_AFRICAN_PHONE_CODE_LENGTH); | |
return ['06', '07', '08'].includes(digits); | |
}; | |
const hasNoEmojis = value => { | |
return !/\p{Extended_Pictographic}/u.test(value); | |
}; | |
const isMobileNumber = value => [Object(validators["minLength"])(lumkani["a" /* default */].SOUTH_AFRICAN_CELLPHONE_NUMBER_LENGTH)(value), Object(validators["maxLength"])(lumkani["a" /* default */].SOUTH_AFRICAN_CELLPHONE_NUMBER_LENGTH)(value), numbersOnlyFilter(value), isValidSouthAfricaPhoneInitials(value)].every(v => v); | |
const isOptional = validator => value => { | |
if (!value) { | |
return true; | |
} | |
return validator(value); | |
}; | |
const isValidDate = value => { | |
let handler = value >= MIN_EXPECTED_DATE && value <= MAX_EXPECTED_DATE; | |
if (!Number.isInteger(Number(value))) { | |
handler = false; | |
} | |
return handler; | |
}; | |
const gpsCoordinate = validators["helpers"].regex('gpsCoordinate', /^-?\d*(\.\d+)?$/); | |
const countDecimals = value => { | |
var _value$split$; | |
return ((_value$split$ = value.split('.')[1]) === null || _value$split$ === void 0 ? void 0 : _value$split$.length) || 0; | |
}; | |
const gpsCoordinateMinAndMaxDecimals = value => { | |
if (!value) { | |
return true; | |
} | |
return countDecimals(value) >= MIN_GPS_DECIMAL_PLACE && countDecimals(value) <= MAX_GPS_DECIMAL_PLACE; | |
}; | |
const greaterThan = min => value => Number(value) > min; | |
const lessThanOrEqual = min => value => Number(value) <= min; | |
const latitudeFilter = value => parseFloat(value) >= LATITUDE_NEGATIVE && parseFloat(value) <= LATITUDE_POSITIVE; | |
const longitudeFilter = value => parseFloat(value) >= LONGITUDE_NEGATIVE && parseFloat(value) <= LONGITUDE_POSITIVE; | |
const idPassportNumber = model => { | |
if (model.idType === constants["d" /* ID_TYPE_ENUM */].NO_ID.value) { | |
return []; | |
} | |
const validations = [validators["required"], Object(validators["minLength"])(lumkani["a" /* default */].MAX_ID_NUMBER_LENGTH), Object(validators["maxLength"])(lumkani["a" /* default */].MAX_ID_NUMBER_LENGTH), validators["alphaNum"]]; | |
if (model.idType === constants["d" /* ID_TYPE_ENUM */].PASSPORT.value) { | |
validations[1] = Object(validators["minLength"])(lumkani["a" /* default */].MIN_ID_NUMBER_LENGTH); | |
} | |
return validations; | |
}; | |
const requiredPropertyOwnership = value => { | |
return typeof value === 'boolean'; | |
}; | |
/***/ }), | |
/***/ "8c1a": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return registerClientStoreService; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return registerClientStore; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return resetStore; }); | |
/* unused harmony export state */ | |
/* harmony import */ var src_helpers_promise__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9d41"); | |
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("2b0e"); | |
/* harmony import */ var _services_StoreService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("dd0a"); | |
/* harmony import */ var _models_AddressModel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("e427"); | |
/* harmony import */ var _models_PhotoManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("e436"); | |
/* harmony import */ var _services_LifeAssuredService_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("4b2b"); | |
const state = () => ({ | |
flow: { | |
isFuneral: false, | |
isUpgradeToFuneral: false, | |
isMigration: false | |
}, | |
personalDataConsent: { | |
consent: { | |
option1: false, | |
receiveMarketingCommunication: false | |
}, | |
signature: '' | |
}, | |
customerDetails: { | |
id: null, | |
section1: { | |
firstName: null, | |
surname: null, | |
homeLanguage: null, | |
mobileNumber: null, | |
secondaryNumber: null, | |
whatsappNumber: null, | |
emailAddress: null, | |
gender: null, | |
idPassportNumber: null, | |
idType: null, | |
dateOfBirth: null | |
}, | |
section2: { | |
incomeSource: null, | |
occupation: null, | |
expectedPaymentMethod: null, | |
expectedPaymentDate: null | |
} | |
}, | |
clientSearch: { | |
referredById: null | |
}, | |
notes: { | |
fireNotes: '', | |
funeralNotes: '' | |
}, | |
policyIdToUpgrade: null, | |
policyIdToMigrate: null, | |
policyType: null, | |
funeralPlanCategory: null, | |
nextOfKin: { | |
firstName: null, | |
surname: null, | |
dateOfBirth: null, | |
mobileNumber: null | |
}, | |
livesAssured: [], | |
get extendedLivesAssured() { | |
return this.livesAssured.filter(lifeAssured => Object.values(_services_LifeAssuredService_constants__WEBPACK_IMPORTED_MODULE_5__[/* LIFE_ASSURED_TYPE_ENUM */ "c"]).filter(enumItem => enumItem.category === 'EXTENDED').map(enumItem => enumItem.value).includes(lifeAssured.lifeAssuredType)); | |
}, | |
beneficiary: { | |
firstName: null, | |
surname: null, | |
idPassportNumber: null, | |
idType: null, | |
mobileNumber: null, | |
dateOfBirth: null, | |
address: null, | |
hasSouthAfricanBankAccount: false, | |
isLivingInSouthAfrica: false | |
}, | |
householdDetails: { | |
address: _models_AddressModel__WEBPACK_IMPORTED_MODULE_3__[/* AddressModel */ "a"].create(), | |
propertyPurposeOption: null, | |
propertyTypeOption: null, | |
propertyTypeText: null, | |
numberOfPeopleLiving: null, | |
isOwned: null, | |
numberOfRooms: null, | |
gpsLocation: { | |
latitude: null, | |
longitude: null, | |
accuracy: null | |
}, | |
get propertyPurpose() { | |
return this.propertyPurposeOption; | |
}, | |
get propertyType() { | |
return this.propertyTypeText || this.propertyTypeOption; | |
} | |
}, | |
barcodeScanner: { | |
deviceBarcode: null | |
}, | |
photoManager: _models_PhotoManager__WEBPACK_IMPORTED_MODULE_4__[/* RegistrationPhotoManager */ "e"].createWithImagePlaceholders(), | |
dataUpload: { | |
promiseCache: new src_helpers_promise__WEBPACK_IMPORTED_MODULE_0__[/* PromiseCache */ "a"]() | |
} | |
}); | |
const registerWatchers = store => { | |
Object(vue__WEBPACK_IMPORTED_MODULE_1__[/* watch */ "b"])(() => store.customerDetails.section2.expectedPaymentMethod, value => { | |
store.photoManager.addOrRemoveDebitOrderPhoto(value); | |
}); | |
Object(vue__WEBPACK_IMPORTED_MODULE_1__[/* watch */ "b"])(() => store.flow.isFuneral, value => { | |
store.photoManager.addOrRemoveFuneralPhoto(value); | |
}); | |
}; | |
const registerClientStoreService = new _services_StoreService__WEBPACK_IMPORTED_MODULE_2__[/* StoreService */ "a"](state, 'register-client'); | |
const registerClientStore = registerClientStoreService.store; | |
registerWatchers(registerClientStore); | |
const { | |
resetStore | |
} = registerClientStoreService; | |
/***/ }), | |
/***/ "9599": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BaseModel; }); | |
/* | |
Don't implement toJSON method (Including in the BaseModel's Subclasses) | |
https://www.npmjs.com/package/pretty-format is a package used by jest to print the diff results | |
https://github.com/facebook/jest/blob/8da17b946034f48d80f585bff8f8c0db8e629f50/packages/jest-diff/src/index.ts#L142 | |
The problem is that if toJson method exists, pretty-format is gonna call toJSON when printing the diff which in our case | |
would be confusing | |
Example: | |
- Expected | |
+ Received | |
Object { | |
"id": 12345, | |
- "insurance_policy_premium": 60, | |
+ "insurancePolicyPremium": 70, | |
} | |
The problem: One value is snake case as it is how we print in toJson method | |
* */ | |
class BaseModel { | |
static fromJSONBase(json, jsonKeyToObjectKeyMap) { | |
const model = {}; | |
// Convert snake_case to cammelCase | |
for (const [jsonKey, objKey] of jsonKeyToObjectKeyMap) { | |
if (json.hasOwnProperty(jsonKey)) { | |
model[objKey] = json[jsonKey]; | |
} | |
} | |
// Also Accept cammelCase Straight. Is this a good idea? It will help to when the API only returns cammelCase | |
// And also allow us to use fixture and Models like UserModel in our tests (check src/pages/Policies/_PolicyId/model.spec.js) | |
for (const [, objKey] of jsonKeyToObjectKeyMap) { | |
if (json.hasOwnProperty(objKey)) { | |
model[objKey] = json[objKey]; | |
} | |
} | |
return model; | |
} | |
toJSONBase(jsonKeyToObjectKeyMap) { | |
const json = {}; | |
for (const [jsonKey, objKey] of jsonKeyToObjectKeyMap) { | |
if (this[objKey] !== undefined) { | |
json[jsonKey] = this[objKey]; | |
} | |
} | |
return json; | |
} | |
} | |
/***/ }), | |
/***/ "9b05": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
// EXPORTS | |
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ AuthService_AuthService; }); | |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js | |
var defineProperty = __webpack_require__("9523"); | |
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty); | |
// EXTERNAL MODULE: ./node_modules/@sentry/core/esm/exports.js | |
var esm_exports = __webpack_require__("02c5"); | |
// EXTERNAL MODULE: ./src/models/UserModel/index.js + 1 modules | |
var UserModel = __webpack_require__("ba0c"); | |
// EXTERNAL MODULE: ./src/helpers/http.js + 1 modules | |
var http = __webpack_require__("825e"); | |
// CONCATENATED MODULE: ./src/services/AuthService/constants.js | |
const LUMKANI_USER_KEY_LOCAL_STORAGE = 'lumkaniUserLogin'; | |
const LOGIN_URL = '/api/login'; | |
const LOGOUT_URL = '/api/logout'; | |
const WHO_AM_I_URL = '/api/whoami'; | |
const AUTHENTICATE_PWD_URL = '/api/user/authenticatepassword'; | |
// EXTERNAL MODULE: ./src/services/HTTPService/index.js | |
var HTTPService = __webpack_require__("778a"); | |
// EXTERNAL MODULE: ./src/services/ConfigService/index.js | |
var ConfigService = __webpack_require__("cd77"); | |
// CONCATENATED MODULE: ./src/services/AuthService/index.js | |
class AuthService_AuthService { | |
static async login(email, password) { | |
const user = await http["a" /* default */].post(LOGIN_URL, { | |
email, | |
password | |
}).then(res => res.data); | |
http["a" /* default */].setAuthorizationToken(user.token); | |
HTTPService["a" /* HTTPService */].setAuthorizationToken(user.token); | |
const lumkaniUserLogin = { | |
date: new Date().getDate(), | |
token: user.token | |
}; | |
localStorage.setItem(LUMKANI_USER_KEY_LOCAL_STORAGE, JSON.stringify(lumkaniUserLogin)); | |
return UserModel["a" /* UserModel */].fromLkJSON(user); | |
} | |
static async logout() { | |
await http["a" /* default */].post(LOGOUT_URL); | |
localStorage.removeItem(LUMKANI_USER_KEY_LOCAL_STORAGE); | |
this.loggedUserModel = null; | |
ConfigService["a" /* ConfigService */].clearCache(); | |
} | |
static async whoAmI() { | |
let user = null; | |
const lumkaniUserLogin = JSON.parse(localStorage.getItem(LUMKANI_USER_KEY_LOCAL_STORAGE)); | |
if (this.isSessionExpired()) { | |
localStorage.removeItem(LUMKANI_USER_KEY_LOCAL_STORAGE); | |
ConfigService["a" /* ConfigService */].clearCache(); | |
} else { | |
if (!this.loggedUserModel) { | |
http["a" /* default */].setAuthorizationToken(lumkaniUserLogin.token); | |
HTTPService["a" /* HTTPService */].setAuthorizationToken(lumkaniUserLogin.token); | |
const whoAmIres = await http["a" /* default */].get(WHO_AM_I_URL).then(res => res.data); | |
this.loggedUserModel = UserModel["a" /* UserModel */].fromLkJSON(whoAmIres); | |
esm_exports["c" /* configureScope */](scope => { | |
const userWithoutToken = { | |
...this.loggedUserModel.toLkJSON() | |
}; | |
delete userWithoutToken.token; | |
scope.setUser(userWithoutToken); | |
}); | |
} | |
user = this.loggedUserModel; | |
} | |
return user; | |
} | |
static isSessionExpired() { | |
const lumkaniUserLogin = JSON.parse(localStorage.getItem(LUMKANI_USER_KEY_LOCAL_STORAGE)); | |
if (!lumkaniUserLogin) { | |
return true; | |
} | |
return lumkaniUserLogin.date !== new Date().getDate(); | |
} | |
static authenticateUserPassword(password) { | |
return HTTPService["a" /* HTTPService */].post(AUTHENTICATE_PWD_URL, { | |
password | |
}).then(res => UserModel["a" /* UserModel */].fromLkJSON(res.data)); | |
} | |
} | |
defineProperty_default()(AuthService_AuthService, "loggedUserModel", null); | |
/***/ }), | |
/***/ "9d41": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return withTimeout; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PromiseCache; }); | |
const withTimeout = (promise, ms, message) => { | |
const timeout = new Promise((resolve, reject) => { | |
const id = setTimeout(() => { | |
clearTimeout(id); | |
reject({ | |
message | |
}); | |
}, ms); | |
}); | |
// Returns a race between our timeout and the passed in promise | |
return Promise.race([promise, timeout]); | |
}; | |
class PromiseCache { | |
constructor() { | |
this.cache = {}; | |
} | |
cacheOnSuccess(cacheName, fn, ...fnArgs) { | |
if (this.cache[cacheName] != null) { | |
return Promise.resolve(this.cache[cacheName]); | |
} | |
return fn(...fnArgs).then(result => { | |
this.cache[cacheName] = result; | |
return result; | |
}); | |
} | |
} | |
/***/ }), | |
/***/ "9ea1": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9523"); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__); | |
var _class; | |
class LumkaniError extends Error { | |
constructor(message, name, config = { | |
asBanner: false | |
}, ...params) { | |
super(message, ...params); | |
this.name = name.value; | |
this.config = config; | |
} | |
} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(LumkaniError, "Name", (_class = class { | |
constructor(value) { | |
this.value = value; | |
} | |
}, _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(_class, "DataUpload", new _class('CustomerRegistrationDataUploadError')), _class)); | |
/* harmony default export */ __webpack_exports__["a"] = (LumkaniError); | |
/***/ }), | |
/***/ "a2f2": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return hardwareInstallationStoreService; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hardwareInstallationStore; }); | |
/* unused harmony export resetStore */ | |
/* unused harmony export hydrateStore */ | |
/* unused harmony export state */ | |
/* harmony import */ var src_helpers_promise__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9d41"); | |
/* harmony import */ var _services_StoreService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("dd0a"); | |
/* harmony import */ var _models_PhotoManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("e436"); | |
const state = () => ({ | |
installationInfo: { | |
policyType: null, | |
policyId: null, | |
deviceId: null | |
}, | |
barcodeScanner: { | |
deviceBarcode: null | |
}, | |
emergencyContacts: { | |
emergencyContact1: { | |
name: null, | |
mobileNumber: null | |
}, | |
emergencyContact2: { | |
name: null, | |
mobileNumber: null | |
}, | |
emergencyContact3: { | |
name: null, | |
mobileNumber: null | |
}, | |
consent: { | |
receiveAlerts: true | |
} | |
}, | |
dataUpload: { | |
promiseCache: new src_helpers_promise__WEBPACK_IMPORTED_MODULE_0__[/* PromiseCache */ "a"]() | |
}, | |
additionalHardwareDetails: { | |
notes: '' | |
}, | |
photoManager: _models_PhotoManager__WEBPACK_IMPORTED_MODULE_2__[/* HardwareInstallationPhotoManager */ "c"].createWithImagePlaceholders() | |
}); | |
const hardwareInstallationStoreService = new _services_StoreService__WEBPACK_IMPORTED_MODULE_1__[/* StoreService */ "a"](state, 'hardware-installation'); | |
const hardwareInstallationStore = hardwareInstallationStoreService.store; | |
const { | |
resetStore, | |
hydrateStore | |
} = hardwareInstallationStoreService; | |
/***/ }), | |
/***/ "a31b": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PaymentModel; }); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9523"); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__); | |
/* harmony import */ var src_helpers_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("5b55"); | |
/* harmony import */ var src_helpers_watchtowerLegacyUrlHelper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("c209"); | |
/* harmony import */ var _BaseModel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("9599"); | |
const jsonKeyToObjectKeyMap = new Map([['id', 'id'], ['created_at', 'createdAt'], ['device_id', 'detectorId'], ['user_id', 'userId'], ['payment_category', 'paymentCategory'], ['payment_premium', 'paymentPremium'], ['payment_type', 'paymentType'], ['payment_amount', 'paymentAmount'], ['payment_signature_image', 'paymentSignatureImage'], ['payment_photo', 'paymentPhoto'], ['status', 'status'], ['notes', 'notes'], ['marked_payment_amount_match_by_user_id', 'markedPaymentAmountMatchByUserId'], ['actual_payment_date', 'actualPaymentDate']]); | |
class PaymentModel extends _BaseModel__WEBPACK_IMPORTED_MODULE_3__[/* BaseModel */ "a"] { | |
constructor(payment = {}) { | |
super(); | |
for (const [, camelCaseKey] of jsonKeyToObjectKeyMap) { | |
this[camelCaseKey] = payment[camelCaseKey]; | |
} | |
} | |
get paymentPremiumAsRand() { | |
return this.paymentPremium / src_helpers_constants__WEBPACK_IMPORTED_MODULE_1__[/* CONVERSION_TO_CENTS_UNIT */ "e"]; | |
} | |
get paymentPhotoLegacyUrl() { | |
if (!this.paymentPhoto) { | |
return null; | |
} | |
return `${Object(src_helpers_watchtowerLegacyUrlHelper__WEBPACK_IMPORTED_MODULE_2__[/* getLegacyWatchTowerBaseUrl */ "a"])()}${src_helpers_constants__WEBPACK_IMPORTED_MODULE_1__[/* MEDIA_BASE_URL */ "z"]}${this.paymentPhoto}`; | |
} | |
get paymentSignatureImageLegacyUrl() { | |
if (!this.paymentSignatureImage) { | |
return null; | |
} | |
return `${Object(src_helpers_watchtowerLegacyUrlHelper__WEBPACK_IMPORTED_MODULE_2__[/* getLegacyWatchTowerBaseUrl */ "a"])()}${src_helpers_constants__WEBPACK_IMPORTED_MODULE_1__[/* MEDIA_BASE_URL */ "z"]}${this.paymentSignatureImage}`; | |
} | |
resizedPaymentPhotoLegacyUrl(width, height) { | |
if (!this.paymentPhoto) { | |
return null; | |
} | |
return `${Object(src_helpers_watchtowerLegacyUrlHelper__WEBPACK_IMPORTED_MODULE_2__[/* getLegacyWatchTowerBaseUrl */ "a"])()}${Object(src_helpers_constants__WEBPACK_IMPORTED_MODULE_1__[/* RESIZED_IMAGE_URL */ "K"])(width, height)}${src_helpers_constants__WEBPACK_IMPORTED_MODULE_1__[/* MEDIA_BASE_URL */ "z"]}${this.paymentPhoto}`; | |
} | |
resizedPaymentSignatureImageLegacyUrl(width, height) { | |
if (!this.paymentSignatureImage) { | |
return null; | |
} | |
return `${Object(src_helpers_watchtowerLegacyUrlHelper__WEBPACK_IMPORTED_MODULE_2__[/* getLegacyWatchTowerBaseUrl */ "a"])()}${Object(src_helpers_constants__WEBPACK_IMPORTED_MODULE_1__[/* RESIZED_IMAGE_URL */ "K"])(width, height)}${src_helpers_constants__WEBPACK_IMPORTED_MODULE_1__[/* MEDIA_BASE_URL */ "z"]}${this.paymentSignatureImage}`; | |
} | |
toLkJSON() { | |
return this.toJSONBase(jsonKeyToObjectKeyMap); | |
} | |
} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(PaymentModel, "fromLkJSON", json => { | |
const jsonModel = PaymentModel.fromJSONBase(json, jsonKeyToObjectKeyMap); | |
return new PaymentModel(jsonModel); | |
}); | |
/***/ }), | |
/***/ "a3c6": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CommunityModel; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return MISSING_COMMUNITY_VALUE; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return OTHER_COMMUNITY_NAME; }); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9523"); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__); | |
/* harmony import */ var vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("b5ae"); | |
/* harmony import */ var vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__); | |
/* harmony import */ var _BaseModel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("9599"); | |
/* harmony import */ var _schema_validators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("0dec"); | |
const jsonKeyToObjectKeyMap = new Map([['id', 'id'], ['province', 'province'], ['city', 'city'], ['suburb', 'suburb'], ['name', 'name']]); | |
const MISSING_COMMUNITY_VALUE = '[MISSING]'; | |
const OTHER_COMMUNITY_NAME = 'other'; | |
class CommunityModel extends _BaseModel__WEBPACK_IMPORTED_MODULE_2__[/* BaseModel */ "a"] { | |
constructor(community = {}) { | |
super(); | |
for (const [, camelCaseKey] of jsonKeyToObjectKeyMap) { | |
this[camelCaseKey] = community[camelCaseKey]; | |
} | |
} | |
anyMissing() { | |
return ['city', 'suburb'].some(v => this[v] === MISSING_COMMUNITY_VALUE); | |
} | |
nameIsOther() { | |
var _this$name; | |
return (_this$name = this.name) === null || _this$name === void 0 ? void 0 : _this$name.toLowerCase().endsWith(OTHER_COMMUNITY_NAME); | |
} | |
toLkJSON() { | |
return this.toJSONBase(jsonKeyToObjectKeyMap); | |
} | |
} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(CommunityModel, "schema", { | |
province: [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__["required"]], | |
city: [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__["required"]], | |
suburb: model => model.anyMissing(model) ? [] : [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__["required"]], | |
name: model => model.anyMissing(model) ? [] : [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__["required"]], | |
id: model => model.anyMissing(model) ? [] : [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__["required"]], | |
..._schema_validators__WEBPACK_IMPORTED_MODULE_3__[/* schemaValidators */ "a"] | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(CommunityModel, "create", (community = {}) => new CommunityModel(community || {})); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(CommunityModel, "fromLkJSON", json => { | |
const jsonModel = CommunityModel.fromJSONBase(json, jsonKeyToObjectKeyMap); | |
return new CommunityModel(jsonModel); | |
}); | |
/***/ }), | |
/***/ "a4b6": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "success", function() { return success; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "error", function() { return error; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asBanner", function() { return asBanner; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asErrorBanner", function() { return asErrorBanner; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asToast", function() { return asToast; }); | |
/* harmony import */ var quasar_src_plugins_Notify_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("2a19"); | |
; | |
const DEFAULT_MESSAGE_TIMEOUT = 3500; | |
const PERSISTENT_MESSAGE_TIMEOUT = 0; | |
const THUMBS_UP_ICON = 'thumb_up'; | |
const WARNING_ICON = 'warning'; | |
const POSITIVE_NOTIFICATION_TYPE = 'positive'; | |
const NEGATIVE_NOTIFICATION_TYPE = 'negative'; | |
const TOP_POSITION = 'top'; | |
const BOTTOM_POSITION = 'bottom'; | |
const success = options => { | |
quasar_src_plugins_Notify_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].create({ | |
...options, | |
icon: THUMBS_UP_ICON, | |
timeout: DEFAULT_MESSAGE_TIMEOUT, | |
color: POSITIVE_NOTIFICATION_TYPE, | |
position: TOP_POSITION | |
}); | |
}; | |
const error = options => { | |
quasar_src_plugins_Notify_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].create({ | |
...options, | |
icon: WARNING_ICON, | |
timeout: DEFAULT_MESSAGE_TIMEOUT, | |
color: NEGATIVE_NOTIFICATION_TYPE, | |
position: TOP_POSITION | |
}); | |
}; | |
const asBanner = options => { | |
quasar_src_plugins_Notify_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].create({ | |
...options, | |
icon: 'info', | |
timeout: PERSISTENT_MESSAGE_TIMEOUT, | |
position: TOP_POSITION, | |
classes: 'banner-info', | |
actions: [{ | |
label: 'OK', | |
color: 'primary', | |
handler: null | |
}] | |
}); | |
}; | |
const asErrorBanner = options => { | |
quasar_src_plugins_Notify_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].create({ | |
...options, | |
icon: 'info', | |
timeout: PERSISTENT_MESSAGE_TIMEOUT, | |
position: TOP_POSITION, | |
classes: 'banner-info', | |
actions: [{ | |
label: 'DISMISS', | |
color: 'white', | |
handler: null | |
}] | |
}); | |
}; | |
const asToast = options => { | |
quasar_src_plugins_Notify_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].create({ | |
...options, | |
icon: 'info', | |
timeout: DEFAULT_MESSAGE_TIMEOUT, | |
classes: 'disabled', | |
position: BOTTOM_POSITION | |
}); | |
}; | |
/***/ }), | |
/***/ "ac36": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getBeneficiaryByClientId; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return updateBeneficiary; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getLivesAssuredByClientId; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return updateLivesAssured; }); | |
/* harmony import */ var src_helpers_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("5b55"); | |
/* harmony import */ var _helpers_http__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("825e"); | |
const getBeneficiaryByClientId = detectorId => { | |
const params = { | |
filters: { | |
detector_id: detectorId | |
} | |
}; | |
return _helpers_http__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].get('/api/beneficiaries', { | |
params | |
}); | |
}; | |
const updateBeneficiary = beneficiaryData => _helpers_http__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].post('/api/beneficiaries', beneficiaryData); | |
const getLivesAssuredByClientId = detectorId => { | |
const params = { | |
filters: { | |
detector_id: detectorId, | |
status: src_helpers_constants__WEBPACK_IMPORTED_MODULE_0__[/* LIFE_ASSURED_STATUS */ "s"].ACTIVE | |
} | |
}; | |
return _helpers_http__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].get('/api/lives-assured', { | |
params | |
}); | |
}; | |
const updateLivesAssured = livesAssuredData => _helpers_http__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].post('/api/lives-assured', livesAssuredData); | |
/***/ }), | |
/***/ "af82": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return stopGettingCurrentLocation; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return startGettingCurrentLocation; }); | |
const TIMEOUT = 50000; | |
const DISABLE_MAX_AGE_AND_GPS_CACHE = 0; | |
const GEOLOCATION_PWA_OPTIONS = { | |
enableHighAccuracy: true, | |
timeout: TIMEOUT, | |
maximumAge: DISABLE_MAX_AGE_AND_GPS_CACHE | |
}; | |
function createGetCurrentLocationSuccessCallback(resolve) { | |
return result => { | |
const { | |
timestamp, | |
coords | |
} = result; | |
const formattedGpsData = { | |
accuracy: coords.accuracy, | |
latitude: coords.latitude, | |
longitude: coords.longitude, | |
speed: coords.speed, | |
altitude: coords.altitude, | |
altitudeAccuracy: coords.altitudeAccuracy, | |
heading: coords.heading, | |
timestamp | |
}; | |
resolve(formattedGpsData); | |
}; | |
} | |
function createErrorCallback(reject) { | |
return error => { | |
let message = `Navigator has returned and unhandled error code ${error.code}`; | |
switch (error.code) { | |
case error.PERMISSION_DENIED: | |
message = 'User denied the request for Geolocation.'; | |
break; | |
case error.POSITION_UNAVAILABLE: | |
message = 'Location information is unavailable.'; | |
break; | |
case error.TIMEOUT: | |
message = 'The request to get user location timed out.'; | |
break; | |
case error.UNKNOWN_ERROR: | |
message = 'An unknown error occurred.'; | |
break; | |
default: | |
message = 'An unknown error occurred'; | |
} | |
reject({ | |
message | |
}); | |
}; | |
} | |
const stopGettingCurrentLocation = () => {}; | |
const startGettingCurrentLocation = () => { | |
const promise = new Promise((resolve, reject) => { | |
const getCurrentLocationSuccessCallback = createGetCurrentLocationSuccessCallback(resolve); | |
const getCurrentLocationErrorCallback = createErrorCallback(reject); | |
navigator.geolocation.getCurrentPosition(getCurrentLocationSuccessCallback, getCurrentLocationErrorCallback, GEOLOCATION_PWA_OPTIONS); | |
}); | |
return promise; | |
}; | |
/***/ }), | |
/***/ "b0ae": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
// CONCATENATED MODULE: ./node_modules/@quasar/app/lib/webpack/loader.transform-quasar-imports.js!./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--7!./node_modules/@quasar/app/lib/webpack/loader.auto-import-client.js?kebab!./node_modules/vue-loader/lib??vue-loader-options!./src/components/TakePhotoButton/index.vue?vue&type=template&id=54808c2d& | |
var render = function render() { | |
var _vm = this, | |
_c = _vm._self._c; | |
return _c('div', [_vm._t("default", null, null, { | |
takePhoto: _vm.takePhoto | |
}), _c('input', { | |
ref: "fileInput", | |
staticStyle: { | |
"display": "none" | |
}, | |
attrs: { | |
"type": "file", | |
"capture": "environment", | |
"data-e2e": _vm.E2E_TAGS.UPLOAD_FILE_BUTTON | |
}, | |
on: { | |
"change": _vm.onChange | |
} | |
})], 2); | |
}; | |
var staticRenderFns = []; | |
// CONCATENATED MODULE: ./src/components/TakePhotoButton/index.vue?vue&type=template&id=54808c2d& | |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js | |
var defineProperty = __webpack_require__("9523"); | |
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty); | |
// CONCATENATED MODULE: ./src/helpers/file-reader.js | |
const readAsDataURL = file => new Promise((resolve, reject) => { | |
const reader = new FileReader(); | |
reader.onload = event => resolve(event.target.result); | |
reader.onerror = event => reject(event.target.error); | |
reader.readAsDataURL(file); | |
}); | |
// CONCATENATED MODULE: ./src/hardware/Camera.js | |
const takePicture = () => new Promise((resolve, reject) => { | |
navigator.camera.getPicture(fileSystemPath => { | |
window.resolveLocalFileSystemURL(fileSystemPath, fileEntry => { | |
fileEntry.file(file => readAsDataURL(file).then(resolve)); | |
}, error => { | |
reject(error); | |
}); | |
}, error => { | |
reject(error); | |
}); | |
}); | |
// CONCATENATED MODULE: ./e2e/constants/payment-process.js | |
// TODO: Move this to GLOBAL_TAGS | |
const TAGS = Object.freeze({ | |
TAKE_PAYMENT: { | |
PHOTO: { | |
UPLOAD_FILE_BUTTON: 'take-photo-button-input' | |
} | |
} | |
}); | |
// CONCATENATED MODULE: ./src/components/TakePhotoButton/model.js | |
const { | |
UPLOAD_FILE_BUTTON | |
} = TAGS.TAKE_PAYMENT.PHOTO; | |
class TakePhotoButtonViewModel {} | |
defineProperty_default()(TakePhotoButtonViewModel, "constants", () => ({ | |
E2E_TAGS: { | |
UPLOAD_FILE_BUTTON | |
} | |
})); | |
defineProperty_default()(TakePhotoButtonViewModel, "methods", { | |
takePhotoWebHandler: vm => vm.$refs.fileInput.click(), | |
takePhotoNativeHandler: vm => takePicture().then(photo => vm.$emit('file', photo)).catch(error => vm.$snackbar.error({ | |
message: vm.$lk.parseErrorMessage(error) | |
})), | |
onChange: (vm, e) => readAsDataURL(e.target.files[0]).then(base64Image => vm.$emit('file', base64Image)).catch(error => vm.$snackbar.error({ | |
message: vm.$lk.parseErrorMessage(error) | |
})) | |
}); | |
defineProperty_default()(TakePhotoButtonViewModel, "computed", { | |
takePhoto: vm => { | |
let handler = vm.takePhotoWebHandler; | |
if (vm.$q.platform.is.cordova) { | |
handler = vm.takePhotoNativeHandler; | |
} | |
return handler; | |
} | |
}); | |
// CONCATENATED MODULE: ./node_modules/@quasar/app/lib/webpack/loader.transform-quasar-imports.js!./node_modules/babel-loader/lib??ref--2-0!./node_modules/@quasar/app/lib/webpack/loader.auto-import-client.js?kebab!./node_modules/vue-loader/lib??vue-loader-options!./src/components/TakePhotoButton/index.vue?vue&type=script&lang=js& | |
/* harmony default export */ var TakePhotoButtonvue_type_script_lang_js_ = ({ | |
inheritAttrs: false, | |
props: { | |
customClass: { | |
type: String, | |
default: '' | |
} | |
}, | |
ViewModel: TakePhotoButtonViewModel | |
}); | |
// CONCATENATED MODULE: ./src/components/TakePhotoButton/index.vue?vue&type=script&lang=js& | |
/* harmony default export */ var components_TakePhotoButtonvue_type_script_lang_js_ = (TakePhotoButtonvue_type_script_lang_js_); | |
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js | |
var componentNormalizer = __webpack_require__("2877"); | |
// CONCATENATED MODULE: ./src/components/TakePhotoButton/index.vue | |
/* normalize component */ | |
var component = Object(componentNormalizer["a" /* default */])( | |
components_TakePhotoButtonvue_type_script_lang_js_, | |
render, | |
staticRenderFns, | |
false, | |
null, | |
null, | |
null | |
) | |
/* harmony default export */ var TakePhotoButton = __webpack_exports__["a"] = (component.exports); | |
/***/ }), | |
/***/ "b39f": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony import */ var src_helpers_http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("825e"); | |
/* harmony import */ var src_helpers_detectorStatus__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("53c7"); | |
/* harmony import */ var src_helpers_insurancePaymentMethods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("6b7e"); | |
function getActiveClientsBySuspensionDate({ | |
agentId, | |
lessThanInsuranceSuspensionDate, | |
greaterThanInsuranceSuspensionDate = null | |
}, options) { | |
const filters = { | |
status: src_helpers_detectorStatus__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].ACTIVE, | |
user_id_insurance_agent_vendor: agentId, | |
insurance_suspension_date__lte: lessThanInsuranceSuspensionDate | |
}; | |
if (greaterThanInsuranceSuspensionDate) { | |
filters.insurance_suspension_date__gte = greaterThanInsuranceSuspensionDate; | |
} | |
const params = { | |
filters, | |
options: { | |
...options | |
} | |
}; | |
return src_helpers_http__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].get('/api/detectors', { | |
params | |
}); | |
} | |
function getActiveClientByExpectedPaymentDateAndLastPaymentNoDebitOrder({ | |
agentId, | |
expectedPaymentDateList, | |
lastPaymentDateLessThanEqual | |
}, options) { | |
const params = { | |
filters: { | |
status: src_helpers_detectorStatus__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].ACTIVE, | |
insurance_expected_payment_date__in: expectedPaymentDateList, | |
last_payment_date__lte_or_null: lastPaymentDateLessThanEqual, | |
user_id_insurance_agent_vendor: agentId, | |
insurance_expected_payment_method_not: src_helpers_insurancePaymentMethods__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].DEBIT_ORDER | |
}, | |
options: { | |
...options | |
} | |
}; | |
return src_helpers_http__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].get('/api/detectors', { | |
params | |
}); | |
} | |
function getActiveClientByLastPaymentDate({ | |
agentId, | |
lastPaymentDateGreaterThanEqual | |
}, options) { | |
const params = { | |
filters: { | |
status: src_helpers_detectorStatus__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].ACTIVE, | |
last_payment_date__gte: lastPaymentDateGreaterThanEqual, | |
user_id_insurance_agent_vendor: agentId | |
}, | |
options: { | |
...options | |
} | |
}; | |
return src_helpers_http__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].get('/api/detectors', { | |
params | |
}); | |
} | |
function getActiveClientsByPaymentType({ | |
agentId, | |
includePaymentType | |
}, options) { | |
const params = { | |
filters: { | |
status: src_helpers_detectorStatus__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].ACTIVE, | |
insurance_expected_payment_method: includePaymentType, | |
user_id_insurance_agent_vendor: agentId | |
}, | |
options: { | |
...options | |
} | |
}; | |
return src_helpers_http__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].get('/api/detectors', { | |
params | |
}); | |
} | |
function getActiveClientApplications(agentId, options) { | |
const params = { | |
filters: { | |
status: src_helpers_detectorStatus__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].ACTIVE, | |
user_id_insurance_agent_vendor: agentId, | |
has_insurance_commencement_date: false, | |
with_premium: true | |
}, | |
options: { | |
...options | |
} | |
}; | |
return src_helpers_http__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].get('/api/detectors', { | |
params | |
}); | |
} | |
function getActiveInsuranceClients(agentId, options) { | |
const params = { | |
filters: { | |
status: src_helpers_detectorStatus__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].ACTIVE, | |
user_id_insurance_agent_vendor: agentId, | |
with_premium: true | |
}, | |
options: { | |
...options | |
} | |
}; | |
return src_helpers_http__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].get('/api/detectors', { | |
params | |
}); | |
} | |
function getClientById(clientId) { | |
return src_helpers_http__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].get(`/api/detectors/${clientId}`, null); | |
} | |
function saveCustomer(adaptedData) { | |
return src_helpers_http__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].post('/api/detectors', adaptedData); | |
} | |
function saveClientPhoneNumbers(client) { | |
const params = { | |
detector: { | |
id: client.id, | |
customer_mobile_number: client.customer_mobile_number, | |
custsomer_whatsapp_number: client.custsomer_whatsapp_number, | |
insurance_alternative_contact_details: client.insurance_alternative_contact_details, | |
insurance_kin_cell: client.insurance_kin_cell | |
} | |
}; | |
return src_helpers_http__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].post('/api/detectors', params); | |
} | |
function updateClientInfo(client) { | |
const params = { | |
detector: { | |
id: client.id, | |
location_household_value: client.location_household_value, | |
insurance_expected_payment_method: client.insurance_expected_payment_method, | |
insurance_expected_payment_date: client.insurance_expected_payment_date, | |
insurance_income_source: client.insurance_income_source, | |
insurance_kin_first_name: client.insurance_kin_first_name, | |
insurance_kin_last_name: client.insurance_kin_last_name, | |
insurance_kin_id_number: client.insurance_kin_id_number, | |
insurance_kin_dob: client.insurance_kin_dob, | |
insurance_kin_cell: client.insurance_kin_cell | |
} | |
}; | |
return src_helpers_http__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].post('/api/detectors', params); | |
} | |
/* harmony default export */ __webpack_exports__["a"] = ({ | |
getActiveInsuranceClients, | |
getActiveClientApplications, | |
getClientById, | |
getActiveClientByExpectedPaymentDateAndLastPaymentNoDebitOrder, | |
getActiveClientsBySuspensionDate, | |
getActiveClientByLastPaymentDate, | |
getActiveClientsByPaymentType, | |
saveCustomer, | |
saveClientPhoneNumbers, | |
updateClientInfo | |
}); | |
/***/ }), | |
/***/ "b7be": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("2ef0"); | |
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); | |
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("5b55"); | |
const LK = { | |
IMAGE_PLACEHOLDER_URL: 'images/camera.svg', | |
SOUTH_AFRICAN_CELLPHONE_NUMBER_LENGTH: 10, | |
SPOUSE: 0, | |
CHILD: 1, | |
BARCODE_LENGTH: _constants__WEBPACK_IMPORTED_MODULE_1__[/* DEVICE_BARCODE_LENGTH */ "i"], | |
FRONTDOOR_BARCODE_LENGTH: 11, | |
MIN_PAYMENT_DATE: 1, | |
MAX_PAYMENT_DATE: 31, | |
MIN_HOUSEHOLD_VALUE: 5000, | |
MIN_NUMBER_OF_KIDS: 0, | |
MIN_NUMBER_OF_ROOMS: 1, | |
MIN_NUMBER_OF_HOUSE_OCCUPANTS: 1, | |
MIN_BENEFICIARY_AGE: 18, | |
AGE_OF_CHILD_IN_VARSITY_OR_DISABLED: 21, | |
MAX_CHILD_AGE: 25, | |
MIN_ID_NUMBER_LENGTH: 6, | |
MAX_ID_NUMBER_LENGTH: 13, | |
MIN_SPOUSE_AGE: 18, | |
MIN_FIRE_INSURANCE_CUSTOMER_AGE: 18, | |
MIN_NEXT_OF_KIN_AGE: 18, | |
DATE_FORMAT: 'YYYY-MM-DD', | |
DATABASE_DATETIME_FORMAT: 'YYYY-MM-DD HH:mm:ss', | |
MONTH_NAME_AND_YEAR_DATE_FORMAT: 'MMMM YYYY', | |
TIME_FORMAT: 'HH:mm:ss', | |
PHOTO_UPLOAD_TIMEOUT_MS: 40000, | |
PHOTO_TIMEOUT_MESSAGE: 'Timeout error! Please check network and try again.', | |
AGENT_INSTALLATION_TARGET: 30 | |
}; | |
const BAD_REQUEST_HTTP = 400; | |
const EPOCH_DATE_YEAR_ANCHOR = 1970; | |
function isEmpty(value) { | |
// either variable is null or undefined | |
return value == null || value === ''; | |
} | |
const objectKeyValueToString = obj => { | |
let message; | |
if (Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isObject"])(obj)) { | |
message = ''; | |
for (const [key, value] of Object.entries(obj)) { | |
message = message.concat(`${key}: ${value}\n`); | |
} | |
} else { | |
message = obj; | |
} | |
return message.trim(); | |
}; | |
function parseErrorMessage(error) { | |
let errorMessage = null; | |
if (error.response) { | |
if (error.response.data) { | |
if (error.response.data.message) { | |
errorMessage = error.response.data.message; | |
} else if (error.response.data.short_description) { | |
errorMessage = `${error.response.data.short_description}: ${objectKeyValueToString(error.response.data.detail)}`; | |
} else if (error.response.data.detail) { | |
// V2 api standard error | |
errorMessage = objectKeyValueToString(error.response.data.detail); | |
} else if (error.response.data.error) { | |
errorMessage = error.response.data.error; | |
} else if (error.response.data && error.response.status >= BAD_REQUEST_HTTP) { | |
errorMessage = objectKeyValueToString(error.response.data); | |
} | |
} | |
} else if (error.message) { | |
errorMessage = error.message; | |
} else if (error.msg) { | |
errorMessage = error.msg; | |
} | |
if (errorMessage === null) { | |
errorMessage = error.toString(); | |
} | |
if (errorMessage === '[object Object]') { | |
errorMessage = 'Failed to parse error message'; | |
} | |
return errorMessage; | |
} | |
function calculateAge(dateString) { | |
const birthday = new Date(dateString); | |
const ageDifMs = Date.now() - birthday.getTime(); | |
const ageDate = new Date(ageDifMs); | |
return ageDate.getFullYear() - EPOCH_DATE_YEAR_ANCHOR; | |
} | |
function cleanBlankProperties(obj) { | |
const copyObj = { | |
...obj | |
}; | |
for (const propName in copyObj) { | |
if (copyObj.hasOwnProperty(propName) && (copyObj[propName] === null || copyObj[propName] === undefined)) { | |
delete copyObj[propName]; | |
} | |
} | |
return copyObj; | |
} | |
function isValidPhoneNumber(number) { | |
return isNaN(number) === false && isEmpty(number) === false && number.length === LK.SOUTH_AFRICAN_CELLPHONE_NUMBER_LENGTH; | |
} | |
function isValidIDNumber(iDNumber) { | |
return !isEmpty(iDNumber) && iDNumber.length >= LK.MIN_ID_NUMBER_LENGTH && iDNumber.length <= LK.MAX_ID_NUMBER_LENGTH; | |
} | |
function getCompareFnOrderByFurthestDayOfMonthByProperty(currentDate, prop) { | |
return (a, b) => { | |
if (a[prop] < currentDate && b[prop] < currentDate || a[prop] > currentDate && b[prop] > currentDate) { | |
return a[prop] - b[prop]; | |
} | |
return b[prop] - a[prop]; | |
}; | |
} | |
function getArrayLast(array) { | |
return array[array.length - 1]; | |
} | |
function* range(start, end) { | |
if (end < start) return; | |
yield start; | |
if (start === end) return; | |
yield* range(start + 1, end); | |
} | |
function getNumberOfActiveLivesAssured(LivesAssured) { | |
let count = 0; | |
for (let i = 0; i < LivesAssured.length; i++) { | |
if (LivesAssured[i].status !== _constants__WEBPACK_IMPORTED_MODULE_1__[/* LIFE_ASSURED_STATUS */ "s"].DELETED) { | |
count += 1; | |
} | |
} | |
return count; | |
} | |
function localStorageGet(key) { | |
return window.localStorage.getItem(key); | |
} | |
function localStorageSet(key, value) { | |
window.localStorage.removeItem(key); | |
window.localStorage.setItem(key, value); | |
} | |
function getCompareFnOrderByNearestDayOfMonthByProperty(currentDate, prop) { | |
return (a, b) => { | |
if (a[prop] > currentDate && b[prop] > currentDate || a[prop] < currentDate && b[prop] < currentDate) { | |
return b[prop] - a[prop]; | |
} | |
return a[prop] - b[prop]; | |
}; | |
} | |
function humanizeCamelCase(str) { | |
const splitStr = str.replace(/([a-z](?=[A-Z]))/g, '$1 '); | |
return splitStr[0].toUpperCase() + splitStr.substring(1); | |
} | |
/* harmony default export */ __webpack_exports__["a"] = ({ | |
isEmpty, | |
parseErrorMessage, | |
calculateAge, | |
cleanBlankProperties, | |
isValidPhoneNumber, | |
isValidIDNumber, | |
getCompareFnOrderByFurthestDayOfMonthByProperty, | |
range, | |
getArrayLast, | |
getNumberOfActiveLivesAssured, | |
localStorageGet, | |
localStorageSet, | |
getCompareFnOrderByNearestDayOfMonthByProperty, | |
humanizeCamelCase, | |
...LK | |
}); | |
/***/ }), | |
/***/ "b89e": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
// EXPORTS | |
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ ReportService; }); | |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js | |
var defineProperty = __webpack_require__("9523"); | |
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty); | |
// EXTERNAL MODULE: ./src/helpers/constants.js | |
var constants = __webpack_require__("5b55"); | |
// EXTERNAL MODULE: ./src/helpers/detectorStatus.js | |
var detectorStatus = __webpack_require__("53c7"); | |
// EXTERNAL MODULE: ./node_modules/moment/moment.js | |
var moment = __webpack_require__("c1df"); | |
var moment_default = /*#__PURE__*/__webpack_require__.n(moment); | |
// EXTERNAL MODULE: ./src/helpers/dateTimeHelper.js | |
var dateTimeHelper = __webpack_require__("dde4"); | |
// EXTERNAL MODULE: ./src/helpers/lumkani.js | |
var lumkani = __webpack_require__("b7be"); | |
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js | |
var es_array_push = __webpack_require__("14d9"); | |
// CONCATENATED MODULE: ./src/helpers/graphQlHelper.js | |
const getFuneralCoverAmountForLifeAssured = lifeAssured => { | |
let coverAmount; | |
if (lifeAssured.lifeAssuredType === constants["t" /* LIFE_ASSURED_TYPE */].SPOUSE) { | |
coverAmount = '20000'; | |
} else { | |
const age = moment_default()().diff(lifeAssured.dateOfBirth, 'years', false); | |
if (age >= 14 && age <= 25) { | |
coverAmount = '20000'; | |
} else if (age >= 6 && age <= 13) { | |
coverAmount = '10000'; | |
} else if (age >= 1 && age <= 5) { | |
coverAmount = '5000'; | |
} else if (age < 1) { | |
coverAmount = '2500'; | |
} else { | |
coverAmount = 'INVALID AGE'; | |
} | |
} | |
return coverAmount; | |
}; | |
const parseGQLFuneralInformation = result => { | |
const deviceEdges = result.data.data.devices.edges; | |
return deviceEdges.map(deviceEdge => { | |
const detector = deviceEdge.node; | |
detector.livesAssured = detector.livesAssured.edges.map(livesAssuredEdge => livesAssuredEdge.node); | |
if (detector.funeralBeneficiaries.edges.length > 0) { | |
detector.funeralBeneficiaries = detector.funeralBeneficiaries.edges[0].node; | |
} else { | |
detector.funeralBeneficiaries = null; | |
} | |
detector.community = detector.community.edges[0].node; | |
return detector; | |
}); | |
}; | |
const LIVES_ASSURED_FIELDS_FRAGMENT = ` | |
fragment livesAssuredFields on LivesAssuredNode { | |
firstName | |
lastName | |
memberId | |
dateOfBirth | |
mobileNumber | |
lifeAssuredType | |
status | |
updatedAt | |
createdAt | |
} | |
`; | |
const DEVICES_FIELDS_FRAGMENT = ` | |
fragment devicesFields on DevicesNode { | |
deviceBarcode | |
systemAppType | |
insuranceMemberIds | |
customerMobileNumber | |
insuranceDateOfBirth | |
customerFirstName | |
customerLastName | |
insuranceCommencementDate | |
status | |
locationHouseNumber | |
locationName | |
} | |
`; | |
const FUNERAL_BENEFICIARIES_FIELDS_FRAGMENT = ` | |
fragment funeralBeneficiariesFields on FuneralBeneficiariesNode { | |
firstName | |
lastName | |
memberId | |
dateOfBirth | |
mobileNumber | |
updatedAt | |
createdAt | |
} | |
`; | |
const COMMUNITY_FIELDS_FRAGMENT = ` | |
fragment communityFields on CommunityNode { | |
name | |
province | |
} | |
`; | |
const appendEdgesAndNodes = queryString => ` | |
edges { | |
node { | |
${queryString} | |
} | |
} | |
`; | |
const parseFuneralInformation = clients => { | |
const data = []; | |
clients.forEach(client => { | |
if (client.funeralBeneficiaries != null || client.livesAssured.length > 0) { | |
const clientBaseInformation = {}; | |
clientBaseInformation.Policy_Number = client.deviceBarcode; | |
clientBaseInformation.Type = 'Funeral & Fire Cover'; | |
clientBaseInformation.Main_IDNumber = client.insuranceMemberIds; | |
clientBaseInformation.Main_Gender = ''; | |
clientBaseInformation.Main_Cellphone = client.customerMobileNumber; | |
// eslint-disable-next-line max-len | |
clientBaseInformation.Main_Address = `${client.locationHouseNumber}, ${client.locationName}, ${constants["I" /* PROVINCE_MAP */][client.community.province].description}`; | |
clientBaseInformation.Main_DateOfBirth = client.insuranceDateOfBirth; | |
clientBaseInformation.Relationship = null; | |
clientBaseInformation.Name = null; | |
clientBaseInformation.Surname = null; | |
clientBaseInformation.DateOfBirth = null; | |
clientBaseInformation.CellPhone = null; | |
clientBaseInformation.Waiting_Period = '4 months'; | |
clientBaseInformation.Policy_Description = null; | |
clientBaseInformation.Policy_Start_Date = client.insuranceCommencementDate; | |
clientBaseInformation.Adjusted_Premium = '55,99'; | |
clientBaseInformation.Cover = null; | |
clientBaseInformation.Instructions = null; | |
clientBaseInformation._ = null; | |
clientBaseInformation.Lumkani_Policy_Status = client.status; | |
client.livesAssured.forEach(lifeAssured => { | |
const lifeAssuredRow = { | |
...clientBaseInformation | |
}; | |
lifeAssuredRow.Name = lifeAssured.firstName; | |
lifeAssuredRow.Surname = lifeAssured.lastName; | |
lifeAssuredRow.DateOfBirth = lifeAssured.dateOfBirth; | |
lifeAssuredRow.CellPhone = lifeAssured.mobileNumber; | |
lifeAssuredRow.Relationship = constants["u" /* LIFE_ASSURED_TYPE_MAP */][lifeAssured.lifeAssuredType].description; | |
lifeAssuredRow.Cover = getFuneralCoverAmountForLifeAssured(lifeAssured); | |
let instructions = `Unknown status - ${lifeAssured.status}`; | |
if (lifeAssured.status === constants["s" /* LIFE_ASSURED_STATUS */].ACTIVE) { | |
instructions = 'Update Life Assured Information according to this row'; | |
} else if (lifeAssured.status === constants["s" /* LIFE_ASSURED_STATUS */].DELETED) { | |
instructions = 'Delete Life Assured in this row - the client requested this life assured be removed from their policy'; | |
} | |
lifeAssuredRow.Instructions = instructions; | |
data.push(lifeAssuredRow); | |
}); | |
if (client.funeralBeneficiaries != null) { | |
const beneficiaryRow = { | |
...clientBaseInformation | |
}; | |
beneficiaryRow.Name = client.funeralBeneficiaries.firstName; | |
beneficiaryRow.Surname = client.funeralBeneficiaries.lastName; | |
beneficiaryRow.DateOfBirth = client.funeralBeneficiaries.dateOfBirth; | |
beneficiaryRow.CellPhone = client.funeralBeneficiaries.mobileNumber; | |
beneficiaryRow.Relationship = 'Beneficiary'; | |
beneficiaryRow.Instructions = 'Update Beneficiary Information according to this row'; | |
data.push(beneficiaryRow); | |
} | |
} | |
}); | |
return data; | |
}; | |
// EXTERNAL MODULE: ./src/models/index.js + 5 modules | |
var models = __webpack_require__("3a34"); | |
// EXTERNAL MODULE: ./src/helpers/insurancePaymentMethods.js | |
var insurancePaymentMethods = __webpack_require__("6b7e"); | |
// EXTERNAL MODULE: ./src/services/HTTPService/index.js | |
var HTTPService = __webpack_require__("778a"); | |
// EXTERNAL MODULE: ./src/helpers/http.js + 1 modules | |
var http = __webpack_require__("825e"); | |
// CONCATENATED MODULE: ./src/services/ReportService/constants.js | |
const DETECTORS_URL = '/api/detectors'; | |
const BORDEREAU_URL = '/api/reports/funeral-bordereau'; | |
const GRAPHQL_URL = '/graphql'; | |
const REPORTS_URL = '/api/reports'; | |
// CONCATENATED MODULE: ./src/services/ReportService/index.js | |
const SUBTRACTING_DAYS = 18; | |
const ADDING_DAYS = 210; | |
const replaceNewLineCharactersInNotes = ({ | |
notes, | |
...otherValues | |
}) => ({ | |
...otherValues, | |
notes: `"${notes.replace(/(\r\n|\n|\r)/gm, ' - ')}"` | |
}); | |
const convertPaymentPremiumToRands = ({ | |
insurancePolicyPremium, | |
...otherValues | |
}) => ({ | |
...otherValues, | |
insurancePolicyPremium: insurancePolicyPremium / constants["a" /* CENTS_TO_RAND_CONVERSION_AMOUNT */] | |
}); | |
const buildClientsMissedPaymentLast7Days = () => { | |
const initialDate = moment_default()(); | |
const numberOfPreviousDay = 7; | |
const listOfPreviousDays = dateTimeHelper["b" /* default */].getPreviousDaysList(initialDate, numberOfPreviousDay); | |
return { | |
expectedPaymentDateList: listOfPreviousDays, | |
lastPaymentDateLessThenEqual: moment_default()().subtract(SUBTRACTING_DAYS, 'days').format(lumkani["a" /* default */].DATE_FORMAT), | |
lessThanInsuranceSuspensionDate: moment_default()().add(ADDING_DAYS, 'days').format(lumkani["a" /* default */].DATE_FORMAT), | |
insuranceExpectedPaymentMethodNot: insurancePaymentMethods["a" /* default */].DEBIT_ORDER | |
}; | |
}; | |
const orderDetectorsBasedOnNearestExpectedPaymentDate = () => { | |
const currentDate = moment_default()().date(); | |
return lumkani["a" /* default */].getCompareFnOrderByNearestDayOfMonthByProperty(currentDate, constants["r" /* INSURANCE_EXPECTED_PAYMENT_DATE */]); | |
}; | |
class ReportService {} | |
defineProperty_default()(ReportService, "getActiveClientsInApplicationPhase", () => { | |
const params = { | |
filters: { | |
status: detectorStatus["a" /* default */].ACTIVE, | |
has_insurance_commencement_date: false, | |
with_premium: true | |
} | |
}; | |
return http["a" /* default */].get(DETECTORS_URL, { | |
params | |
}).then(res => { | |
const result = res.data.detectors.map(replaceNewLineCharactersInNotes).map(models["b" /* ClientModel */].fromLkJSON); | |
return result; | |
}); | |
}); | |
defineProperty_default()(ReportService, "getClientsThatHaveCommenced", () => { | |
const params = { | |
filters: { | |
status: detectorStatus["a" /* default */].ACTIVE, | |
has_insurance_commencement_date: true, | |
with_premium: true, | |
has_successful_payments: true | |
}, | |
options: { | |
order_by: constants["q" /* INSURANCE_COMMENCEMENT_DATE_ORDER_DESC */], | |
include_last_payment_date: true, | |
include_sum_of_payments: true, | |
include_num_of_payments: true | |
} | |
}; | |
return HTTPService["a" /* HTTPService */].get(DETECTORS_URL, { | |
params | |
}).then(res => { | |
const result = res.data.detectors.map(replaceNewLineCharactersInNotes).map(models["b" /* ClientModel */].fromLkJSON).map(convertPaymentPremiumToRands).map(client => new models["b" /* ClientModel */](client)); | |
return result; | |
}); | |
}); | |
defineProperty_default()(ReportService, "getActiveClientByExpectedPaymentDateAndLastPayment", () => { | |
const clientsThatHavePaidLast7DaysParams = buildClientsMissedPaymentLast7Days(); | |
const params = { | |
filters: { | |
status: detectorStatus["a" /* default */].ACTIVE, | |
has_insurance_commencement_date: true, | |
insurance_expected_payment_date__in: clientsThatHavePaidLast7DaysParams.expectedPaymentDateList, | |
last_payment_date__lte_or_null: clientsThatHavePaidLast7DaysParams.lastPaymentDateLessThenEqual, | |
insurance_suspension_date__lte: clientsThatHavePaidLast7DaysParams.lessThanInsuranceSuspensionDate, | |
insurance_expected_payment_method_not: clientsThatHavePaidLast7DaysParams.insuranceExpectedPaymentMethodNot | |
} | |
}; | |
return http["a" /* default */].get(DETECTORS_URL, { | |
params | |
}).then(res => { | |
const result = res.data.detectors.sort(orderDetectorsBasedOnNearestExpectedPaymentDate()).map(replaceNewLineCharactersInNotes).map(models["b" /* ClientModel */].fromLkJSON); | |
return result; | |
}); | |
}); | |
defineProperty_default()(ReportService, "getCancelledClients", (startDate, endDateTime) => { | |
const params = { | |
filters: { | |
status_in: [detectorStatus["a" /* default */].DOWNGRADED_TO_FREE, detectorStatus["a" /* default */].DELETED], | |
cancelled_at__range: [startDate, endDateTime], | |
has_successful_payments: true | |
}, | |
options: { | |
include_last_payment_date: true, | |
include_sum_of_payments: true, | |
include_num_of_payments: true | |
} | |
}; | |
return HTTPService["a" /* HTTPService */].get(DETECTORS_URL, { | |
params | |
}).then(res => { | |
const result = res.data.detectors.map(replaceNewLineCharactersInNotes).map(models["b" /* ClientModel */].fromLkJSON).map(convertPaymentPremiumToRands).map(client => new models["b" /* ClientModel */](client)); | |
return result; | |
}); | |
}); | |
defineProperty_default()(ReportService, "getPolicyPayments", (startDate, endDate) => { | |
return http["a" /* default */].get('/api/payments/report', { | |
params: { | |
start: startDate, | |
end: endDate | |
} | |
}).then(res => res.data); | |
}); | |
defineProperty_default()(ReportService, "getAllClientsFuneralBordereau", () => { | |
const params = { | |
filters: { | |
status: detectorStatus["a" /* default */].ACTIVE, | |
has_insurance_commencement_date: true, | |
system_app_type: constants["L" /* SYSTEM_APP_TYPE */].FIRE_FUNERAL_APP | |
}, | |
options: { | |
include_last_payment_date: true, | |
include_extra_fields: true | |
} | |
}; | |
return http["a" /* default */].get(BORDEREAU_URL, { | |
params | |
}).then(res => res.data.funeral_bordereau.map(models["l" /* ReportModel */].fromLkJSON)); | |
}); | |
defineProperty_default()(ReportService, "getAddedClientsFuneralBordereau", (startDate, endDateTime) => { | |
const params = { | |
filters: { | |
status: detectorStatus["a" /* default */].ACTIVE, | |
has_insurance_commencement_date: true, | |
system_app_type: constants["L" /* SYSTEM_APP_TYPE */].FIRE_FUNERAL_APP, | |
insurance_commencement_date__range: [startDate, endDateTime] | |
} | |
}; | |
return http["a" /* default */].get(BORDEREAU_URL, { | |
params | |
}).then(res => res.data.funeral_bordereau.map(models["l" /* ReportModel */].fromLkJSON)); | |
}); | |
defineProperty_default()(ReportService, "getRemovedClientsFuneralBordereau", (startDate, endDate) => { | |
const params = { | |
type: 'FUNERAL_REMOVED_CLIENTS', | |
options: { | |
date_range: [startDate, endDate] | |
} | |
}; | |
return http["a" /* default */].get(REPORTS_URL, { | |
params | |
}); | |
}); | |
defineProperty_default()(ReportService, "getUpdatedFuneralInformationBordereau", (startDate, endDateTime) => { | |
const params = { | |
query: ` | |
query($policyType:String!, $status:String!, $startDate:Date!, $startDateTime:DateTime!, $endDateTime:DateTime!) { | |
devices(systemAppType: $policyType, status: $status, insuranceCommencementDate_Lt: $startDate) { | |
${appendEdgesAndNodes(` | |
...devicesFields | |
livesAssured(updatedAt_Gt: $startDateTime, updatedAt_Lt: $endDateTime) { | |
${appendEdgesAndNodes('...livesAssuredFields')} | |
} | |
funeralBeneficiaries(updatedAt_Gt: $startDateTime, updatedAt_Lt: $endDateTime) { | |
${appendEdgesAndNodes('...funeralBeneficiariesFields')} | |
} | |
community { | |
${appendEdgesAndNodes('...communityFields')} | |
}`)} | |
} | |
}, | |
${LIVES_ASSURED_FIELDS_FRAGMENT}, | |
${DEVICES_FIELDS_FRAGMENT} | |
${FUNERAL_BENEFICIARIES_FIELDS_FRAGMENT} | |
${COMMUNITY_FIELDS_FRAGMENT} | |
`, | |
variables: { | |
policyType: constants["L" /* SYSTEM_APP_TYPE */].FIRE_FUNERAL_APP, | |
status: detectorStatus["a" /* default */].ACTIVE, | |
startDate, | |
startDateTime: moment_default()(startDate, dateTimeHelper["a" /* ISO_DATE_TIME_FORMAT_NO_TZ */]).format(dateTimeHelper["a" /* ISO_DATE_TIME_FORMAT_NO_TZ */]), | |
endDateTime | |
} | |
}; | |
return http["a" /* default */].get(GRAPHQL_URL, { | |
params | |
}).then(result => { | |
const data = parseGQLFuneralInformation(result); | |
return parseFuneralInformation(data).map(models["n" /* UpdatedReportModel */].fromLkJSON); | |
}); | |
}); | |
/***/ }), | |
/***/ "ba0c": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
// EXPORTS | |
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ UserModel_UserModel; }); | |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js | |
var defineProperty = __webpack_require__("9523"); | |
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty); | |
// EXTERNAL MODULE: ./src/helpers/userType.js | |
var userType = __webpack_require__("76c5"); | |
// EXTERNAL MODULE: ./src/helpers/watchtowerLegacyUrlHelper.js | |
var watchtowerLegacyUrlHelper = __webpack_require__("c209"); | |
// EXTERNAL MODULE: ./src/models/BaseModel/index.js | |
var BaseModel = __webpack_require__("9599"); | |
// CONCATENATED MODULE: ./src/models/UserModel/constants.js | |
const LEGACY_AGENT_BASE_URL = '/watchtower/agent/'; | |
// CONCATENATED MODULE: ./src/models/UserModel/index.js | |
const jsonKeyToObjectKeyMap = new Map([['id', 'id'], ['email', 'email'], ['community_id', 'communityId'], ['community', 'community'], ['first_name', 'firstName'], ['last_name', 'lastName'], ['name', 'name'], ['token', 'token'], ['type', 'type'], ['old_agent_id', 'oldAgentId'], ['last_login', 'lastLogin'], ['mobile_number', 'mobileNumber'], ['is_deleted', 'isDeleted'], ['date_of_birth', 'dateOfBirth'], ['deleted_by', 'deletedBy'], ['deleted_at', 'deletedAt'], ['created_by', 'createdBy'], ['created_at', 'createdAt']]); | |
class UserModel_UserModel extends BaseModel["a" /* BaseModel */] { | |
constructor(user) { | |
super(); | |
for (const [, camelCaseKey] of jsonKeyToObjectKeyMap) { | |
this[camelCaseKey] = user[camelCaseKey]; | |
} | |
} | |
get fullName() { | |
return `${this.firstName} ${this.lastName}`; | |
} | |
get isInsuranceAgent() { | |
return this.type === userType["a" /* default */].INSURANCE; | |
} | |
get isInstallationAgent() { | |
return this.type === userType["a" /* default */].INSTALLATION; | |
} | |
get isGlobalAgent() { | |
return this.type === userType["a" /* default */].GLOBAL_INSTALLATION; | |
} | |
get isAdminUser() { | |
return this.type === userType["a" /* default */].ADMIN; | |
} | |
get legacyWatchtowerUserUrl() { | |
return `${Object(watchtowerLegacyUrlHelper["a" /* getLegacyWatchTowerBaseUrl */])()}${LEGACY_AGENT_BASE_URL}${this.oldAgentId}`; | |
} | |
get isActive() { | |
return this.isDeleted === false; | |
} | |
toLkJSON() { | |
if (this.createdBy) { | |
this.createdBy = new UserModel_UserModel(this.createdBy).toLkJSON(); | |
} | |
if (this.deletedBy) { | |
this.deletedBy = new UserModel_UserModel(this.deletedBy).toLkJSON(); | |
} | |
return this.toJSONBase(jsonKeyToObjectKeyMap); | |
} | |
} | |
defineProperty_default()(UserModel_UserModel, "fromLkJSON", json => { | |
const model = UserModel_UserModel.fromJSONBase(json, jsonKeyToObjectKeyMap); | |
if (model.createdBy) { | |
model.createdBy = UserModel_UserModel.fromLkJSON(model.createdBy); | |
} | |
if (model.deletedBy) { | |
model.deletedBy = UserModel_UserModel.fromLkJSON(model.deletedBy); | |
} | |
return new UserModel_UserModel(model); | |
}); | |
/***/ }), | |
/***/ "beae": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getInsuranceTypeBySystemAppType; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isDebitOrderClient; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return saveClient; }); | |
/* harmony import */ var src_helpers_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("5b55"); | |
/* harmony import */ var src_api_client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("b39f"); | |
/* harmony import */ var src_helpers_insurancePaymentMethods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("6b7e"); | |
const getInsuranceTypeBySystemAppType = client => { | |
if (client.system_app_type === src_helpers_constants__WEBPACK_IMPORTED_MODULE_0__[/* SYSTEM_APP_TYPE */ "L"].INSURANCE_APP) { | |
return 'Fire Insurance'; | |
} | |
if (client.system_app_type === src_helpers_constants__WEBPACK_IMPORTED_MODULE_0__[/* SYSTEM_APP_TYPE */ "L"].FIRE_FUNERAL_APP) { | |
return 'Fire And Funeral Insurance'; | |
} | |
if (client.system_app_type === src_helpers_constants__WEBPACK_IMPORTED_MODULE_0__[/* SYSTEM_APP_TYPE */ "L"].GOLD_INTRUDER_PLUS_R100_DEVICE_APP) { | |
return 'Gold Intruder Plus'; | |
} | |
if (client.system_app_type === src_helpers_constants__WEBPACK_IMPORTED_MODULE_0__[/* SYSTEM_APP_TYPE */ "L"].GOLD_INTRUDER_APP) { | |
return 'Gold Intruder'; | |
} | |
if (client.system_app_type === src_helpers_constants__WEBPACK_IMPORTED_MODULE_0__[/* SYSTEM_APP_TYPE */ "L"].DIAMOND_INTRUDER_PLUS_R100_DEVICE_APP) { | |
return 'Diamond Intruder Plus'; | |
} | |
if (client.system_app_type === src_helpers_constants__WEBPACK_IMPORTED_MODULE_0__[/* SYSTEM_APP_TYPE */ "L"].DIAMOND_INTRUDER_APP) { | |
return 'Diamond Intruder'; | |
} | |
return 'Unknown Insurance type'; | |
}; | |
const isDebitOrderClient = client => client.insurance_expected_payment_method === src_helpers_insurancePaymentMethods__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].DEBIT_ORDER; | |
const saveClient = client => { | |
const data = { | |
detector: { | |
...client.toJson() | |
} | |
}; | |
return src_api_client__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].saveCustomer(data); | |
}; | |
/***/ }), | |
/***/ "c209": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getLegacyWatchTowerBaseUrl; }); | |
const getLegacyWatchTowerBaseUrl = () => "https://qa.admin.lumkani.org"; | |
/***/ }), | |
/***/ "cc5d": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return stateHelper; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return routeManager; }); | |
/* unused harmony export legacyRegistrationDB */ | |
/* harmony import */ var localforage__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("a002"); | |
/* harmony import */ var localforage__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(localforage__WEBPACK_IMPORTED_MODULE_0__); | |
/* harmony import */ var _lumkani__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("b7be"); | |
const legacyRegistrationDB = localforage__WEBPACK_IMPORTED_MODULE_0___default.a.createInstance({ | |
name: 'legacy-registration' | |
}); | |
const KEY_APP_ROUTE = 'current_app_route'; | |
const routeManager = { | |
saveLastSavedRoute(route) { | |
_lumkani__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].localStorageSet(KEY_APP_ROUTE, route); | |
}, | |
get lastSavedRoute() { | |
return _lumkani__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].localStorageGet(KEY_APP_ROUTE) || ''; | |
} | |
}; | |
// TODO: Kill this once old reg flow is removed | |
const stateHelper = { | |
saveFullState(state) { | |
return legacyRegistrationDB.setItem('store', state); | |
}, | |
async registerCustomerModelState() { | |
const appState = await legacyRegistrationDB.getItem('store'); | |
if (!appState || !appState.registerCustomerModel) { | |
return null; | |
} | |
return appState.registerCustomerModel; | |
} | |
}; | |
/***/ }), | |
/***/ "cd77": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ConfigService; }); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9523"); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__); | |
/* harmony import */ var _models__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("3a34"); | |
/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("dde5"); | |
class ConfigService {} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(ConfigService, "getConfig", () => { | |
if (!ConfigService._configPromiseCache) { | |
ConfigService._configPromiseCache = _index__WEBPACK_IMPORTED_MODULE_2__[/* HTTPService */ "k"].get('/api/v2/config'); | |
} | |
return Promise.resolve(ConfigService._configPromiseCache).then(({ | |
data | |
}) => _models__WEBPACK_IMPORTED_MODULE_1__[/* ConfigModel */ "d"].create(data)); | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(ConfigService, "clearCache", () => { | |
ConfigService._configPromiseCache = null; | |
}); | |
/***/ }), | |
/***/ "ce96": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return storeModuleMapper; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return deepCopy; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createEnum; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return snakeize; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return enumToTitle; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return swapPrimaryAndSecondaryColorsIfQA; }); | |
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("2ef0"); | |
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); | |
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("2b0e"); | |
/* harmony import */ var quasar_src_utils_colors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("bc78"); | |
/* harmony import */ var _promise__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("9d41"); | |
/* harmony import */ var _models_PhotoManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("e436"); | |
; | |
const storeModuleMapper = module => key => `${module}/${key}`; | |
function deepCopy(source, dest) { | |
for (const k in source) { | |
if (source[k] != null && typeof source[k] === 'object') { | |
if (dest[k] instanceof _promise__WEBPACK_IMPORTED_MODULE_3__[/* PromiseCache */ "a"]) { | |
dest[k] = new _promise__WEBPACK_IMPORTED_MODULE_3__[/* PromiseCache */ "a"](); | |
} | |
if (dest[k] instanceof _models_PhotoManager__WEBPACK_IMPORTED_MODULE_4__[/* RegistrationPhotoManager */ "e"]) { | |
dest[k] = _models_PhotoManager__WEBPACK_IMPORTED_MODULE_4__[/* RegistrationPhotoManager */ "e"].fromJSON(source[k]); | |
continue; | |
} | |
if (Array.isArray(dest[k])) { | |
dest[k].splice(0, dest[k].length); | |
source[k].forEach((x, i) => { | |
vue__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].set(dest[k], i, x); | |
}); | |
} | |
deepCopy(source[k], dest[k]); | |
} else { | |
dest[k] = source[k]; | |
} | |
} | |
} | |
function createEnum(enumEntries, methods = {}) { | |
const filter = predicate => Object.keys(enumEntries).filter(key => predicate(enumEntries[key])).map(key => enumEntries[key]); | |
Object.defineProperty(enumEntries, 'filter', { | |
value: filter, | |
writable: false, | |
enumerable: false, | |
configurable: false | |
}); | |
const frozenEnumEntries = Object.freeze(enumEntries); | |
methods.values = Object.values; | |
const mappedMethodsWithEnumEntriesAsParameter = Object.entries(methods).reduce((result, [key, value]) => ({ | |
...result, | |
[key]: (...args) => value(frozenEnumEntries, ...args) | |
}), {}); | |
const theEnum = { | |
...frozenEnumEntries | |
}; | |
Object.defineProperties(theEnum, Object.entries(mappedMethodsWithEnumEntriesAsParameter).reduce((result, [key, value]) => ({ | |
...result, | |
[key]: { | |
value, | |
writable: false, | |
configurable: false, | |
enumerable: false | |
} | |
}), {})); | |
return Object.freeze(theEnum); | |
} | |
function snakeize(aObj) { | |
if (!Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isObject"])(aObj)) return aObj; | |
if (Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isDate"])(aObj) || Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isRegExp"])(aObj)) return aObj; | |
if (Array.isArray(aObj)) return aObj.map(snakeize); | |
return Object.keys(aObj).reduce((acc, key) => { | |
const snakeCaseKey = key[0].toLowerCase() + key.slice(1).replace(/([A-Z0-9]+)/g, (m, x) => { | |
return `_${x.toLowerCase()}`; | |
}); | |
acc[snakeCaseKey] = snakeize(aObj[key]); | |
return acc; | |
}, {}); | |
} | |
function enumToTitle(enumStr) { | |
return enumStr.split('_').map(x => x[0] + x.slice(1).toLowerCase()).join(' '); | |
} | |
function swapPrimaryAndSecondaryColorsIfQA(env) { | |
if (env !== 'QA') return; | |
const primary = quasar_src_utils_colors_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].getBrand('primary'); | |
quasar_src_utils_colors_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].setBrand('primary', quasar_src_utils_colors_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].getBrand('secondary')); | |
quasar_src_utils_colors_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].setBrand('secondary', primary); | |
} | |
/***/ }), | |
/***/ "d0c5": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return POLICY_TYPES_ENUM; }); | |
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ce96"); | |
const POLICY_TYPES_ENUM = Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
FIRE: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Fire', | |
value: 'FIRE' | |
}), | |
INTRUDER_GOLD_PLUS_R100_DEVICE: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Gold Intruder plus R100 Device App', | |
value: 'INTRUDER_GOLD_PLUS_R100_DEVICE' | |
}), | |
INTRUDER_DIAMOND_PLUS_R100_DEVICE: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Diamond Intruder plus R100 Device App', | |
value: 'INTRUDER_DIAMOND_PLUS_R100_DEVICE' | |
}), | |
FUNERAL: Object(_helpers__WEBPACK_IMPORTED_MODULE_0__[/* createEnum */ "a"])({ | |
label: 'Funeral', | |
value: 'FUNERAL' | |
}) | |
}, { | |
intruderPolicies(entries) { | |
return [entries.INTRUDER_GOLD_PLUS_R100_DEVICE, entries.INTRUDER_DIAMOND_PLUS_R100_DEVICE]; | |
}, | |
policyTypesAvailableForRegistration(entries) { | |
return [entries.FIRE]; | |
} | |
}); | |
/***/ }), | |
/***/ "dbb4": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LifeAssuredService; }); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9523"); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__); | |
/* harmony import */ var camelize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("654d"); | |
/* harmony import */ var camelize__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(camelize__WEBPACK_IMPORTED_MODULE_1__); | |
/* harmony import */ var _HTTPService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("778a"); | |
/* harmony import */ var _models_LifeAssuredModel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("4d59"); | |
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("ce96"); | |
const DEFAULT_PAGINATION_SETTINGS = { | |
rowsPerPage: 10, | |
page: 1 | |
}; | |
class LifeAssuredService {} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(LifeAssuredService, "createLifeAssured", (funeralPolicyId, lifeAssured) => { | |
return _HTTPService__WEBPACK_IMPORTED_MODULE_2__[/* HTTPService */ "a"].post(`/api/v2/policies/${funeralPolicyId}/life-assured`, Object(_helpers__WEBPACK_IMPORTED_MODULE_4__[/* snakeize */ "d"])(lifeAssured)).then(({ | |
data | |
}) => _models_LifeAssuredModel__WEBPACK_IMPORTED_MODULE_3__[/* LifeAssuredNewModel */ "b"].create(camelize__WEBPACK_IMPORTED_MODULE_1___default()(data))); | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(LifeAssuredService, "deleteLifeAssured", lifeAssuredId => { | |
return _HTTPService__WEBPACK_IMPORTED_MODULE_2__[/* HTTPService */ "a"].delete(`/api/v2/lives-assured/${lifeAssuredId}`).then(({ | |
data | |
}) => _models_LifeAssuredModel__WEBPACK_IMPORTED_MODULE_3__[/* LifeAssuredNewModel */ "b"].create(data)); | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(LifeAssuredService, "updateLifeAssured", (lifeAssuredId, lifeAssured) => { | |
return _HTTPService__WEBPACK_IMPORTED_MODULE_2__[/* HTTPService */ "a"].patch(`/api/v2/lives-assured/${lifeAssuredId}`, Object(_helpers__WEBPACK_IMPORTED_MODULE_4__[/* snakeize */ "d"])(lifeAssured)).then(({ | |
data | |
}) => _models_LifeAssuredModel__WEBPACK_IMPORTED_MODULE_3__[/* LifeAssuredNewModel */ "b"].create(data)); | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(LifeAssuredService, "getLivesAssured", (policyId, pagination = {}) => { | |
return _HTTPService__WEBPACK_IMPORTED_MODULE_2__[/* HTTPService */ "a"].get('/api/v2/lives-assured', { | |
params: { | |
filters: { | |
policy_id: policyId, | |
is_deleted: false | |
}, | |
page_size: pagination.rowsPerPage || DEFAULT_PAGINATION_SETTINGS.rowsPerPage, | |
page_number: pagination.page || DEFAULT_PAGINATION_SETTINGS.page | |
} | |
}).then(({ | |
data | |
}) => { | |
return { | |
pagination: data.pagination, | |
livesAssured: data.lives_assured.map(lifeAssured => _models_LifeAssuredModel__WEBPACK_IMPORTED_MODULE_3__[/* LifeAssuredNewModel */ "b"].create(camelize__WEBPACK_IMPORTED_MODULE_1___default()(lifeAssured))) | |
}; | |
}); | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(LifeAssuredService, "isIdValid", (idType, idPassportNumber, dateOfBirth) => { | |
return _HTTPService__WEBPACK_IMPORTED_MODULE_2__[/* HTTPService */ "a"].get('/api/v2/lives-assured/is-id-valid', { | |
params: { | |
id_type: idType, | |
id_passport_number: idPassportNumber, | |
date_of_birth: dateOfBirth | |
} | |
}); | |
}); | |
/***/ }), | |
/***/ "dbe7": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BeneficiaryModel; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return BeneficiaryNewModel; }); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9523"); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__); | |
/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("14d9"); | |
/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__); | |
/* harmony import */ var vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("b5ae"); | |
/* harmony import */ var vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__); | |
/* harmony import */ var _filters__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("8975"); | |
/* harmony import */ var _helpers_filters__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("726d"); | |
/* harmony import */ var _BaseModel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("9599"); | |
/* harmony import */ var _schema_validators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("0dec"); | |
const jsonKeyToObjectKeyMap = new Map([['id', 'id'], ['first_name', 'firstName'], ['last_name', 'lastName'], ['member_id', 'memberId'], ['address', 'address'], ['date_of_birth', 'dateOfBirth'], ['mobile_number', 'mobileNumber'], ['mobile_number', 'mobileNumber'], ['has_south_africa_bank_account', 'hasSouthAfricaBankAccount'], ['is_living_in_south_africa', 'isLivingInSouthAfrica']]); | |
class BeneficiaryModel extends _BaseModel__WEBPACK_IMPORTED_MODULE_5__[/* BaseModel */ "a"] { | |
constructor(beneficiary) { | |
super(); | |
for (const [, camelCaseKey] of jsonKeyToObjectKeyMap) { | |
this[camelCaseKey] = beneficiary[camelCaseKey]; | |
} | |
} | |
get fullName() { | |
return `${this.firstName} ${this.lastName}`; | |
} | |
toLkJSON() { | |
return this.toJSONBase(jsonKeyToObjectKeyMap); | |
} | |
} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(BeneficiaryModel, "fromLkJSON", json => { | |
const model = BeneficiaryModel.fromJSONBase(json, jsonKeyToObjectKeyMap); | |
return new BeneficiaryModel(model); | |
}); | |
class BeneficiaryNewModel { | |
constructor({ | |
id, | |
firstName, | |
surname, | |
mobileNumber, | |
dateOfBirth, | |
idType, | |
idPassportNumber, | |
address, | |
hasSouthAfricanBankAccount, | |
isLivingInSouthAfrica | |
} = {}) { | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "id", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "firstName", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "surname", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "mobileNumber", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "dateOfBirth", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "idType", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "idPassportNumber", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "address", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "hasSouthAfricanBankAccount", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "isLivingInSouthAfrica", void 0); | |
this.id = id; | |
this.firstName = firstName; | |
this.surname = surname; | |
this.mobileNumber = mobileNumber; | |
this.dateOfBirth = dateOfBirth; | |
this.idType = idType; | |
this.idPassportNumber = idPassportNumber; | |
this.address = address; | |
this.hasSouthAfricanBankAccount = hasSouthAfricanBankAccount; | |
this.isLivingInSouthAfrica = isLivingInSouthAfrica; | |
} | |
get fullName() { | |
return `${this.firstName} ${this.surname}`; | |
} | |
get isValid() { | |
return BeneficiaryNewModel.schema.validateStrict(this); | |
} | |
cleanToUpdate() { | |
delete this.id; | |
return this; | |
} | |
} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(BeneficiaryNewModel, "schema", { | |
firstName: [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__["required"]], | |
surname: [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__["required"]], | |
mobileNumber: [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__["required"], _filters__WEBPACK_IMPORTED_MODULE_3__["isMobileNumber"]], | |
dateOfBirth: [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__["required"], _filters__WEBPACK_IMPORTED_MODULE_3__["olderThan18Filter"]], | |
idType: [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__["required"]], | |
idPassportNumber: _filters__WEBPACK_IMPORTED_MODULE_3__["idPassportNumber"], | |
address: [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_2__["required"]], | |
hasSouthAfricanBankAccount: model => { | |
const handler = []; | |
if (!model.isLivingInSouthAfrica) { | |
handler.push(_helpers_filters__WEBPACK_IMPORTED_MODULE_4__["trueOnlyFilter"]); | |
} | |
return handler; | |
}, | |
isLivingInSouthAfrica: model => { | |
const handler = []; | |
if (!model.hasSouthAfricanBankAccount) { | |
handler.push(_helpers_filters__WEBPACK_IMPORTED_MODULE_4__["trueOnlyFilter"]); | |
} | |
return handler; | |
}, | |
..._schema_validators__WEBPACK_IMPORTED_MODULE_6__[/* schemaValidators */ "a"] | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(BeneficiaryNewModel, "create", beneficiary => new BeneficiaryNewModel(beneficiary)); | |
/***/ }), | |
/***/ "dd0a": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return StoreService; }); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9523"); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__); | |
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("2b0e"); | |
/* harmony import */ var localforage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("a002"); | |
/* harmony import */ var localforage__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(localforage__WEBPACK_IMPORTED_MODULE_2__); | |
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("ce96"); | |
const CACHE_KEY_STORE = 'store'; | |
class StoreService { | |
constructor(stateFn, indexName) { | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "stateFn", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "store", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "stateDB", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "resetStore", () => { | |
Object(_helpers__WEBPACK_IMPORTED_MODULE_3__[/* deepCopy */ "b"])(this.stateFn(), this.store); | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "persistStore", () => { | |
return this.stateDB.setItem(CACHE_KEY_STORE, this.store); | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "hydrateStore", async () => { | |
const store = await this.stateDB.getItem(CACHE_KEY_STORE); | |
Object(_helpers__WEBPACK_IMPORTED_MODULE_3__[/* deepCopy */ "b"])(store, this.store); | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "setStore", store => { | |
Object(_helpers__WEBPACK_IMPORTED_MODULE_3__[/* deepCopy */ "b"])(store, this.store); | |
}); | |
this.stateFn = stateFn; | |
this.store = vue__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].observable(this.stateFn()); | |
this.stateDB = localforage__WEBPACK_IMPORTED_MODULE_2___default.a.createInstance({ | |
name: indexName | |
}); | |
} | |
} | |
/***/ }), | |
/***/ "dde4": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getEpochDate; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ISO_DATE_TIME_FORMAT_NO_TZ; }); | |
/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("14d9"); | |
/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__); | |
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("c1df"); | |
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_1__); | |
/* harmony import */ var src_helpers_lumkani__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("b7be"); | |
const MAX_NUMBER_OF_DAYS_IN_A_MONTH = 31; | |
const NUMBER_OF_DAYS_IN_A_WEEK = 7; | |
function getDateToday() { | |
const dateToday = new Date(); | |
dateToday.setHours(0, 0, 0, 0); | |
return dateToday; | |
} | |
function getDateYesterday() { | |
return moment__WEBPACK_IMPORTED_MODULE_1___default()().subtract(1, 'days'); | |
} | |
function getWeekRange(date) { | |
const currentDate = new Date(date); | |
const weekRange = []; | |
while (!currentDate.isFriday()) { | |
currentDate.setDate(currentDate.getDate() - 1); | |
} | |
const previousFridayDate = new Date(currentDate); | |
weekRange.push(previousFridayDate); | |
currentDate.setDate(currentDate.getDate() + NUMBER_OF_DAYS_IN_A_WEEK); | |
weekRange.push(currentDate); | |
return weekRange; | |
} | |
function getDaysNotInGivenDaysMonth(month) { | |
return [...src_helpers_lumkani__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].range(month.daysInMonth(), MAX_NUMBER_OF_DAYS_IN_A_MONTH)]; | |
} | |
function formatDate(dateTime) { | |
return moment__WEBPACK_IMPORTED_MODULE_1___default()(dateTime).format(`${src_helpers_lumkani__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].DATE_FORMAT} ${src_helpers_lumkani__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].TIME_FORMAT}`); | |
} | |
function getPreviousDaysList(initialDate, numberOfPreviousDay) { | |
const currentDay = initialDate.date(); | |
let previousDaysList; | |
if (currentDay <= numberOfPreviousDay) { | |
let initialDaysOfTheMonth = []; | |
if (currentDay > 1) { | |
initialDaysOfTheMonth = [...src_helpers_lumkani__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].range(1, currentDay - 1)]; | |
} | |
const numberOfDaysInPreviousMonth = initialDate.subtract(1, 'months').daysInMonth(); | |
const startRangeDaysInPreviousMonth = numberOfDaysInPreviousMonth - (numberOfPreviousDay - initialDaysOfTheMonth.length) + 1; | |
const daysInPreviousMonth = [...src_helpers_lumkani__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].range(startRangeDaysInPreviousMonth, MAX_NUMBER_OF_DAYS_IN_A_MONTH)]; | |
previousDaysList = daysInPreviousMonth.concat(initialDaysOfTheMonth); | |
} else { | |
const endRange = currentDay - 1; | |
const startRange = currentDay - numberOfPreviousDay; | |
previousDaysList = [...src_helpers_lumkani__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].range(startRange, endRange)]; | |
} | |
return previousDaysList; | |
} | |
function getUpcomingDaysList(initialDate, numberOfUpcomingDays) { | |
const currentDay = initialDate.date(); | |
let upcomingDaysList = []; | |
const maxDaysThisMonth = initialDate.daysInMonth(); | |
let lastDaysOfTheMonth = []; | |
if (currentDay + numberOfUpcomingDays > maxDaysThisMonth) { | |
if (currentDay < maxDaysThisMonth) { | |
lastDaysOfTheMonth = [...src_helpers_lumkani__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].range(currentDay + 1, maxDaysThisMonth)]; | |
} | |
const initialDaysOfNextMonth = [...src_helpers_lumkani__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].range(1, numberOfUpcomingDays - lastDaysOfTheMonth.length)]; | |
upcomingDaysList = lastDaysOfTheMonth.concat(initialDaysOfNextMonth); | |
} else { | |
const endRange = currentDay + numberOfUpcomingDays; | |
const startRange = currentDay + 1; | |
upcomingDaysList = [...src_helpers_lumkani__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].range(startRange, endRange)]; | |
} | |
return upcomingDaysList; | |
} | |
const getEpochDate = () => moment__WEBPACK_IMPORTED_MODULE_1___default()(); | |
const ISO_DATE_TIME_FORMAT_NO_TZ = 'YYYY-MM-DDTHH:mm:ss'; | |
const DT = { | |
getDateToday, | |
getDateYesterday, | |
getWeekRange, | |
formatDate, | |
getPreviousDaysList, | |
getUpcomingDaysList, | |
getDaysNotInGivenDaysMonth | |
}; | |
/* harmony default export */ __webpack_exports__["b"] = (DT); | |
/***/ }), | |
/***/ "dde5": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
// EXPORTS | |
__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ AuthService["a" /* AuthService */]; }); | |
__webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ ClientService["a" /* ClientService */]; }); | |
__webpack_require__.d(__webpack_exports__, "n", function() { return /* reexport */ PaymentService["a" /* PaymentService */]; }); | |
__webpack_require__.d(__webpack_exports__, "t", function() { return /* reexport */ UserService["a" /* UserService */]; }); | |
__webpack_require__.d(__webpack_exports__, "d", function() { return /* reexport */ CommunityService["a" /* CommunityService */]; }); | |
__webpack_require__.d(__webpack_exports__, "i", function() { return /* reexport */ GoogleMapsService_GoogleMapsService; }); | |
__webpack_require__.d(__webpack_exports__, "l", function() { return /* reexport */ LifeAssuredService["a" /* LifeAssuredService */]; }); | |
__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ BeneficiaryService["a" /* BeneficiaryService */]; }); | |
__webpack_require__.d(__webpack_exports__, "q", function() { return /* reexport */ PolicyService["a" /* PolicyService */]; }); | |
__webpack_require__.d(__webpack_exports__, "f", function() { return /* reexport */ CustomerService["a" /* CustomerService */]; }); | |
__webpack_require__.d(__webpack_exports__, "p", function() { return /* reexport */ PhotosService; }); | |
__webpack_require__.d(__webpack_exports__, "g", function() { return /* reexport */ DeviceService; }); | |
__webpack_require__.d(__webpack_exports__, "o", function() { return /* reexport */ PaymentTypesService; }); | |
__webpack_require__.d(__webpack_exports__, "m", function() { return /* reexport */ NextOfKinsService; }); | |
__webpack_require__.d(__webpack_exports__, "r", function() { return /* reexport */ PropertyService; }); | |
__webpack_require__.d(__webpack_exports__, "h", function() { return /* reexport */ EmergencyContactsService; }); | |
__webpack_require__.d(__webpack_exports__, "s", function() { return /* reexport */ SMSService; }); | |
__webpack_require__.d(__webpack_exports__, "k", function() { return /* reexport */ HTTPService["a" /* HTTPService */]; }); | |
__webpack_require__.d(__webpack_exports__, "e", function() { return /* reexport */ ConfigService["a" /* ConfigService */]; }); | |
__webpack_require__.d(__webpack_exports__, "j", function() { return /* reexport */ GoogleMapsURLService; }); | |
// UNUSED EXPORTS: ReportService, TransactionService, FileService | |
// EXTERNAL MODULE: ./src/services/AuthService/index.js + 1 modules | |
var AuthService = __webpack_require__("9b05"); | |
// EXTERNAL MODULE: ./src/services/ClientService/index.js + 1 modules | |
var ClientService = __webpack_require__("0174"); | |
// EXTERNAL MODULE: ./src/services/PaymentService/index.js + 2 modules | |
var PaymentService = __webpack_require__("7844"); | |
// EXTERNAL MODULE: ./src/services/UserService/index.js + 4 modules | |
var UserService = __webpack_require__("2792"); | |
// EXTERNAL MODULE: ./src/services/ReportService/index.js + 2 modules | |
var ReportService = __webpack_require__("b89e"); | |
// EXTERNAL MODULE: ./src/services/CommunityService/index.js + 2 modules | |
var CommunityService = __webpack_require__("155f"); | |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js | |
var defineProperty = __webpack_require__("9523"); | |
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty); | |
// EXTERNAL MODULE: ./node_modules/google-maps/lib/Google.js | |
var Google = __webpack_require__("2ee3"); | |
var Google_default = /*#__PURE__*/__webpack_require__.n(Google); | |
// CONCATENATED MODULE: ./src/services/GoogleMapsService/constants.js | |
const API_KEY = 'AIzaSyAw2nxEkcy0IEF5u2u21GnM53fnpj0wHj8'; | |
const GOOGLE_MAPS_VERSION = '3.37'; | |
const GOOGLE_MAPS_ZOOM_LEVEL = 17; | |
const LUMKANI_ICON = 'images/lumkani-maps-marker.png'; | |
const GOOGLE_MAPS_INITIAL_GPS_LOCATION_JHB = { | |
lat: -26.195246, | |
lng: 28.034088 | |
}; | |
const GOOGLE_MAPS_CAMERA_CONFIG = { | |
center: GOOGLE_MAPS_INITIAL_GPS_LOCATION_JHB, | |
zoom: GOOGLE_MAPS_ZOOM_LEVEL, | |
scrollwheel: false, | |
scaleControl: false, | |
fullscreenControl: false, | |
zoomControl: false, | |
mapTypeControl: false, | |
streetViewControl: false | |
}; | |
// CONCATENATED MODULE: ./src/services/GoogleMapsService/index.js | |
class GoogleMapsService_GoogleMapsService { | |
constructor() { | |
defineProperty_default()(this, "initiateMaps", (googleMapsHtmlElement, onLoadFunction, customMapConfig = {}) => { | |
if (googleMapsHtmlElement) { | |
Google_default.a.load(google => { | |
this.mapsObject = new google.maps.Map(googleMapsHtmlElement, { | |
...GOOGLE_MAPS_CAMERA_CONFIG, | |
...customMapConfig | |
}); | |
google.maps.event.addListenerOnce(this.mapsObject, 'idle', typeof onLoadFunction === 'function' ? onLoadFunction : () => {}); | |
}); | |
} | |
}); | |
defineProperty_default()(this, "setMarker", (gpsLocation = {}) => { | |
if (gpsLocation.hasOwnProperty('latitude') && gpsLocation.hasOwnProperty('longitude')) { | |
const location = { | |
...gpsLocation, | |
latitude: parseFloat(gpsLocation.latitude), | |
longitude: parseFloat(gpsLocation.longitude) | |
}; | |
this.mapsObject.setCenter(new google.maps.LatLng(location.latitude, location.longitude)); | |
const marker = new google.maps.Marker({ | |
position: { | |
lat: location.latitude, | |
lng: location.longitude | |
}, | |
map: this.mapsObject, | |
title: location.title, | |
icon: location.icon || LUMKANI_ICON | |
}); | |
this.mapsMarker = marker; | |
} | |
}); | |
defineProperty_default()(this, "removeMarker", () => this.mapsMarker ? this.mapsMarker.setMap(null) : null); | |
Google_default.a.VERSION = GOOGLE_MAPS_VERSION; | |
Google_default.a.KEY = API_KEY; | |
this.mapsObject = null; | |
this.mapsMarker = null; | |
} | |
} | |
// EXTERNAL MODULE: ./src/services/LifeAssuredService/index.js | |
var LifeAssuredService = __webpack_require__("dbb4"); | |
// EXTERNAL MODULE: ./src/services/BeneficiaryService/index.js + 1 modules | |
var BeneficiaryService = __webpack_require__("475d"); | |
// EXTERNAL MODULE: ./src/services/PolicyService/index.js | |
var PolicyService = __webpack_require__("fe2e"); | |
// EXTERNAL MODULE: ./src/services/CustomerService/index.js + 1 modules | |
var CustomerService = __webpack_require__("26b0"); | |
// EXTERNAL MODULE: ./node_modules/camelize/index.js | |
var camelize = __webpack_require__("654d"); | |
var camelize_default = /*#__PURE__*/__webpack_require__.n(camelize); | |
// EXTERNAL MODULE: ./src/services/HTTPService/index.js | |
var HTTPService = __webpack_require__("778a"); | |
// EXTERNAL MODULE: ./src/models/PhotoModel/index.js | |
var PhotoModel = __webpack_require__("f059"); | |
// EXTERNAL MODULE: ./src/helpers/index.js | |
var helpers = __webpack_require__("ce96"); | |
// CONCATENATED MODULE: ./src/services/PhotosService/constants.js | |
const PHOTOS_ENUM = Object(helpers["a" /* createEnum */])({ | |
ALARM1_PHOTO: Object(helpers["a" /* createEnum */])({ | |
label: 'Alarm 1', | |
photoName: 'devicePhoto1', | |
backendPhotoLabel: 'device-photo-1', | |
resource: 'device' | |
}), | |
CLIENT_PHOTO: Object(helpers["a" /* createEnum */])({ | |
label: 'Client', | |
photoName: 'client', | |
backendPhotoLabel: 'customer-photo', | |
resource: 'customer' | |
}), | |
CONTENTS1_PHOTO: Object(helpers["a" /* createEnum */])({ | |
label: 'Contents Photo 1', | |
photoName: 'contentsPhoto1', | |
backendPhotoLabel: 'contents-photo-1', | |
resource: 'property' | |
}), | |
CONTENTS2_PHOTO: Object(helpers["a" /* createEnum */])({ | |
label: 'Contents Photo 2', | |
photoName: 'contentsPhoto2', | |
backendPhotoLabel: 'contents-photo-2', | |
resource: 'property' | |
}), | |
CONTENTS3_PHOTO: Object(helpers["a" /* createEnum */])({ | |
label: 'Contents Photo 3', | |
photoName: 'contentsPhoto3', | |
backendPhotoLabel: 'contents-photo-3', | |
resource: 'property' | |
}), | |
CONTENTS4_PHOTO: Object(helpers["a" /* createEnum */])({ | |
label: 'Contents Photo 4', | |
photoName: 'contentsPhoto4', | |
backendPhotoLabel: 'contents-photo-4', | |
resource: 'property' | |
}), | |
CONTENTS5_PHOTO: Object(helpers["a" /* createEnum */])({ | |
label: 'Contents Photo 5', | |
photoName: 'contentsPhoto5', | |
backendPhotoLabel: 'contents-photo-5', | |
resource: 'property' | |
}), | |
CONTENTS6_PHOTO: Object(helpers["a" /* createEnum */])({ | |
label: 'Contents Photo 6', | |
photoName: 'contentsPhoto6', | |
backendPhotoLabel: 'contents-photo-6', | |
resource: 'property' | |
}), | |
FRONT_DOOR_HOUSE_NUMBER_PHOTO: Object(helpers["a" /* createEnum */])({ | |
label: 'Front Door / House Number', | |
photoName: 'frontDoorHouseNumberPhoto', | |
backendPhotoLabel: 'front-door-house-number', | |
resource: 'property' | |
}), | |
POLICY_DOCUMENT1_PHOTO: Object(helpers["a" /* createEnum */])({ | |
label: 'Policy Document 1', | |
photoName: 'policyDocumentPhoto1', | |
backendPhotoLabel: 'policy-document-1', | |
resource: 'policy' | |
}), | |
POLICY_DOCUMENT2_PHOTO: Object(helpers["a" /* createEnum */])({ | |
label: 'Policy Document 2', | |
photoName: 'policyDocumentPhoto2', | |
backendPhotoLabel: 'policy-document-2', | |
resource: 'policy' | |
}), | |
DEBIT_ORDER_PHOTO: Object(helpers["a" /* createEnum */])({ | |
label: 'Debit Order Document', | |
photoName: 'debitOrderPhoto', | |
backendPhotoLabel: 'debit-order', | |
resource: 'policy' | |
}) | |
}, { | |
hardwarePhotos(entries) { | |
return entries.filter(({ | |
resource | |
}) => resource === 'device'); | |
}, | |
clientPhotos(entries) { | |
return entries.filter(({ | |
resource | |
}) => resource === 'customer'); | |
}, | |
contentsPhotos(entries) { | |
return entries.filter(({ | |
resource | |
}) => resource === 'property'); | |
}, | |
policyPhotos(entries) { | |
return [entries.POLICY_DOCUMENT1_PHOTO, entries.DEBIT_ORDER_PHOTO]; | |
}, | |
policyPhotosForFuneral(entries) { | |
return [entries.POLICY_DOCUMENT1_PHOTO]; | |
}, | |
resources: () => Object.freeze({ | |
customer: 'customer', | |
policy: 'policy', | |
device: 'device', | |
property: 'property' | |
}), | |
photoLabels: entries => Object.freeze({ | |
alarmPhoto1: entries.ALARM1_PHOTO.backendPhotoLabel, | |
contentsPhoto1: entries.CONTENTS1_PHOTO.backendPhotoLabel, | |
contentsPhoto2: entries.CONTENTS2_PHOTO.backendPhotoLabel, | |
contentsPhoto3: entries.CONTENTS3_PHOTO.backendPhotoLabel, | |
contentsPhoto4: entries.CONTENTS4_PHOTO.backendPhotoLabel, | |
contentsPhoto5: entries.CONTENTS5_PHOTO.backendPhotoLabel, | |
contentsPhotos6: entries.CONTENTS6_PHOTO.backendPhotoLabel, | |
frontDoorHouseNumberPhoto: entries.FRONT_DOOR_HOUSE_NUMBER_PHOTO.backendPhotoLabel, | |
customerPhoto: entries.CLIENT_PHOTO.backendPhotoLabel, | |
debitOrder: entries.DEBIT_ORDER_PHOTO.backendPhotoLabel, | |
policyDocumentPhoto1: entries.POLICY_DOCUMENT1_PHOTO.backendPhotoLabel, | |
policyDocumentPhoto2: entries.POLICY_DOCUMENT2_PHOTO.backendPhotoLabel | |
}), | |
photosToViewForRegisterClientFlow: entries => { | |
return [entries.ALARM1_PHOTO, ...PHOTOS_ENUM.policyPhotos(), ...PHOTOS_ENUM.contentsPhotos()]; | |
}, | |
photosToEditPolicyPageFire: () => { | |
return [...PHOTOS_ENUM.policyPhotos(), ...PHOTOS_ENUM.contentsPhotos()]; | |
} | |
}); | |
// EXTERNAL MODULE: ./src/services/FileService/index.js | |
var FileService = __webpack_require__("eda6"); | |
// CONCATENATED MODULE: ./src/services/PhotosService/index.js | |
const create = (id, resource, photoLabel, imageUrl) => { | |
const blob = FileService["a" /* FileService */].dataURLtoBlob(imageUrl); | |
return HTTPService["a" /* HTTPService */].uploadBase64File(`/api/v2/photos/${resource}/${id}/${photoLabel}`, 'file', blob, {}, 'post'); | |
}; | |
const update = (id, imageUrl) => { | |
const blob = FileService["a" /* FileService */].dataURLtoBlob(imageUrl); | |
return HTTPService["a" /* HTTPService */].uploadBase64File(`/api/v2/photos/${id}`, 'photo', blob, {}, 'patch'); | |
}; | |
class PhotosService {} | |
defineProperty_default()(PhotosService, "createOrUpdatePhoto", photo => { | |
if (photo.id) { | |
return update(photo.id, photo.imageUrl).then(({ | |
data | |
}) => PhotoModel["a" /* PhotoModel */].fromApi(camelize_default()(data))); | |
} | |
return create(photo.resourceId, photo.resource, photo.label, photo.imageUrl).then(({ | |
data | |
}) => PhotoModel["a" /* PhotoModel */].fromApi(camelize_default()(data))); | |
}); | |
defineProperty_default()(PhotosService, "getPhotos", (resource, resourceId, pageSize) => { | |
return HTTPService["a" /* HTTPService */].get('/api/v2/photos', { | |
params: { | |
filters: { | |
resource, | |
object_id: resourceId | |
}, | |
page_size: pageSize | |
} | |
}).then(({ | |
data | |
}) => { | |
return data.photos.map(photo => PhotoModel["a" /* PhotoModel */].fromApi(camelize_default()(photo))); | |
}); | |
}); | |
// EXTERNAL MODULE: ./src/helpers/http.js + 1 modules | |
var http = __webpack_require__("825e"); | |
// EXTERNAL MODULE: ./src/models/DeviceModel/index.js | |
var DeviceModel = __webpack_require__("4dc8"); | |
// CONCATENATED MODULE: ./src/services/DeviceService/index.js | |
class DeviceService {} | |
defineProperty_default()(DeviceService, "createDevice", (policyId, device) => { | |
return HTTPService["a" /* HTTPService */].post(`/api/v2/policies/${policyId}/devices`, Object(helpers["d" /* snakeize */])(device)); | |
}); | |
defineProperty_default()(DeviceService, "updateDevice", (policyId, device) => { | |
return DeviceService.createDevice(policyId, device.valuesToUpdate()).then(({ | |
data | |
}) => DeviceModel["a" /* DeviceModel */].create(data)); | |
}); | |
defineProperty_default()(DeviceService, "getDeviceByDeviceId", deviceId => { | |
const params = Object(helpers["d" /* snakeize */])({ | |
include_related: 'device_photo_2,device_photo_3,device_photo_1' | |
}); | |
return http["a" /* default */].get(`/api/v2/devices/${deviceId}`, { | |
params | |
}).then(({ | |
data | |
}) => DeviceModel["a" /* DeviceModel */].create(camelize_default()(data))); | |
}); | |
defineProperty_default()(DeviceService, "listDevicesByDeviceBarcode", deviceBarcode => { | |
const params = { | |
filters: { | |
device_barcode: deviceBarcode | |
} | |
}; | |
return http["a" /* default */].get('/api/v2/devices', { | |
params: Object(helpers["d" /* snakeize */])(params) | |
}); | |
}); | |
defineProperty_default()(DeviceService, "isDataValid", ({ | |
deviceType, | |
deviceBarcode, | |
policyId | |
}) => { | |
return HTTPService["a" /* HTTPService */].get('/api/v2/devices/is-data-valid', { | |
params: { | |
device_type: deviceType, | |
device_barcode: deviceBarcode, | |
policy_id: policyId | |
} | |
}); | |
}); | |
// CONCATENATED MODULE: ./src/services/PaymentTypesService/constants.js | |
const PAYMENT_TYPE_URL = '/api/payment-types/'; | |
// CONCATENATED MODULE: ./src/services/PaymentTypesService/helpers.js | |
// REUSE: This could be used in other services | |
const convertPaymentTypesToDropdownUsableFormat = ({ | |
value, | |
description | |
}) => ({ | |
value, | |
label: description | |
}); | |
// CONCATENATED MODULE: ./src/services/PaymentTypesService/index.js | |
class PaymentTypesService {} | |
defineProperty_default()(PaymentTypesService, "getAllPaymentTypes", () => http["a" /* default */].get(PAYMENT_TYPE_URL).then(res => res.data.payment_types.map(convertPaymentTypesToDropdownUsableFormat))); | |
defineProperty_default()(PaymentTypesService, "getClientRegistrationPaymentTypes", () => HTTPService["a" /* HTTPService */].get(`${PAYMENT_TYPE_URL}client-registration`).then(res => res.data.payment_types.map(convertPaymentTypesToDropdownUsableFormat))); | |
// EXTERNAL MODULE: ./src/models/NextOfKinModel/index.js | |
var NextOfKinModel = __webpack_require__("e614"); | |
// CONCATENATED MODULE: ./src/services/NextOfKinsService/index.js | |
class NextOfKinsService {} | |
defineProperty_default()(NextOfKinsService, "getNextOfKin", nextOfKinId => http["a" /* default */].get(`/api/v2/next-of-kins/${nextOfKinId}`).then(({ | |
data | |
}) => NextOfKinModel["a" /* NextOfKinModel */].create(camelize_default()(data)))); | |
defineProperty_default()(NextOfKinsService, "updateNextOfKin", (nextOfKinId, nextOfKin) => { | |
const { | |
id, | |
...nextOfKinModel | |
} = nextOfKin; | |
return http["a" /* default */].patch(`/api/v2/next-of-kins/${nextOfKinId}`, Object(helpers["d" /* snakeize */])(nextOfKinModel)).then(({ | |
data | |
}) => NextOfKinModel["a" /* NextOfKinModel */].create(camelize_default()(data))); | |
}); | |
// EXTERNAL MODULE: ./src/models/index.js + 5 modules | |
var models = __webpack_require__("3a34"); | |
// CONCATENATED MODULE: ./src/services/PropertyService/index.js | |
class PropertyService {} | |
defineProperty_default()(PropertyService, "updateProperty", (propertyId, property) => { | |
const { | |
contentsPhoto1, | |
contentsPhoto2, | |
contentsPhoto3, | |
contentsPhoto4, | |
contentsPhoto5, | |
contentsPhoto6, | |
frontDoorHouseNumberPhoto, | |
policyId, | |
...otherValues | |
} = property; | |
return HTTPService["a" /* HTTPService */].patch(`/api/v2/properties/${propertyId}`, Object(helpers["d" /* snakeize */])(otherValues)); | |
}); | |
defineProperty_default()(PropertyService, "getProperty", propertyId => { | |
return HTTPService["a" /* HTTPService */].get(`/api/v2/properties/${propertyId}`).then(({ | |
data | |
}) => models["k" /* PropertyModel */].create(camelize_default()(data))); | |
}); | |
// EXTERNAL MODULE: ./src/models/EmergencyContact/index.js | |
var EmergencyContact = __webpack_require__("6699"); | |
// CONCATENATED MODULE: ./src/services/EmergencyContactsService/index.js | |
class EmergencyContactsService {} | |
defineProperty_default()(EmergencyContactsService, "createEmergencyContacts", (policyId, emergencyContacts) => { | |
return http["a" /* default */].post(`api/policies/${policyId}/emergency_contacts`, Object(helpers["d" /* snakeize */])(emergencyContacts)); | |
}); | |
defineProperty_default()(EmergencyContactsService, "getEmergencyContacts", policyId => { | |
return http["a" /* default */].get(`/api/v2/policies/${policyId}/emergency_contacts`).then(({ | |
data | |
}) => data.map(emergencyContact => EmergencyContact["a" /* EmergencyContact */].create(camelize_default()(emergencyContact)))); | |
}); | |
// EXTERNAL MODULE: ./node_modules/moment/moment.js | |
var moment = __webpack_require__("c1df"); | |
var moment_default = /*#__PURE__*/__webpack_require__.n(moment); | |
// CONCATENATED MODULE: ./src/models/ReceivedSMSModel/index.js | |
class ReceivedSMSModel_ReceivedSMSModel { | |
constructor({ | |
id, | |
fromNum, | |
toNum, | |
text, | |
timestamp, | |
lastSentMessage | |
}) { | |
defineProperty_default()(this, "id", void 0); | |
defineProperty_default()(this, "fromNum", void 0); | |
defineProperty_default()(this, "toNum", void 0); | |
defineProperty_default()(this, "text", void 0); | |
defineProperty_default()(this, "timestamp", void 0); | |
defineProperty_default()(this, "lastSentMessage", void 0); | |
this.id = id; | |
this.fromNum = fromNum; | |
this.toNum = toNum; | |
this.text = text; | |
this.timestamp = moment_default()(timestamp).format('YYYY-MM-DD hh:mm:ss'); | |
this.lastSentMessage = lastSentMessage; | |
} | |
} | |
defineProperty_default()(ReceivedSMSModel_ReceivedSMSModel, "create", receivedSms => new ReceivedSMSModel_ReceivedSMSModel(receivedSms)); | |
// CONCATENATED MODULE: ./src/models/SentSMSModel/index.js | |
class SentSMSModel_SentSMSModel { | |
constructor({ | |
id, | |
type, | |
dateSent, | |
sender, | |
status, | |
message, | |
recipients, | |
user, | |
userId, | |
endUsers | |
}) { | |
defineProperty_default()(this, "id", void 0); | |
defineProperty_default()(this, "type", void 0); | |
defineProperty_default()(this, "dateSent", void 0); | |
defineProperty_default()(this, "sender", void 0); | |
defineProperty_default()(this, "status", void 0); | |
defineProperty_default()(this, "message", void 0); | |
defineProperty_default()(this, "recipients", void 0); | |
defineProperty_default()(this, "user", void 0); | |
defineProperty_default()(this, "userId", void 0); | |
defineProperty_default()(this, "endUsers", void 0); | |
this.id = id; | |
this.type = type; | |
this.dateSent = dateSent; | |
this.sender = sender; | |
this.status = status; | |
this.message = message; | |
this.recipients = recipients; | |
this.user = user; | |
this.userId = userId; | |
this.endUsers = endUsers; | |
} | |
get phoneNumbersSentTo() { | |
return this.recipients.join(', '); | |
} | |
} | |
defineProperty_default()(SentSMSModel_SentSMSModel, "create", sentSMS => new SentSMSModel_SentSMSModel(sentSMS)); | |
// CONCATENATED MODULE: ./src/services/SMSService/index.js | |
class SMSService {} | |
defineProperty_default()(SMSService, "getListOfReceivedSMS", ({ | |
filters = {}, | |
pagination = {} | |
} = {}) => { | |
const filtersObj = {}; | |
if (filters.fromNum) { | |
filtersObj.from_num = filters.fromNum; | |
} | |
if (filters.toNum) { | |
filtersObj.to_num = filters.toNum; | |
} | |
if (filters.text) { | |
filtersObj.text = filters.text; | |
} | |
if (filters.timestamp) { | |
filtersObj.timestamp = filters.timestamp; | |
} | |
if (filters.lastSentMessage) { | |
filtersObj.last_sent_message__icontains = filters.lastSentMessage; | |
} | |
if (filters.id) { | |
filtersObj.id = filters.id; | |
} | |
return http["a" /* default */].get('/api/registration-logs', { | |
params: { | |
filters: filtersObj, | |
page_number: pagination.page, | |
page_size: pagination.rowsPerPage, | |
order_by: '-index' | |
} | |
}).then(res => ({ | |
receivedSMSes: res.data.registration_logs.map(ReceivedSMSModel_ReceivedSMSModel.create), | |
total: res.data.pagination.total | |
})); | |
}); | |
defineProperty_default()(SMSService, "sendSMSes", ({ | |
numbers, | |
file, | |
message, | |
allowSMSSplit = false | |
}) => { | |
const formData = new FormData(); | |
if (numbers) { | |
formData.append('recipients', numbers.join(',')); | |
} | |
if (file) { | |
formData.append('recipients_file', file); | |
} | |
formData.append('message', message); | |
formData.append('allow_sms_split', allowSMSSplit); | |
return HTTPService["a" /* HTTPService */].postFormData('/api/notifications/send-sms', formData); | |
}); | |
defineProperty_default()(SMSService, "getListOfSentSMS", ({ | |
filters = {}, | |
pagination = {} | |
} = {}) => { | |
const filtersObj = { | |
type: 'SENT_BY_ADMIN' | |
}; | |
if (filters.dateSent) { | |
filtersObj.date_sent = filters.dateSent; | |
} | |
if (filters.message) { | |
filtersObj.message = filters.message; | |
} | |
if (filters.phoneNumbersSentTo) { | |
filtersObj.recipients__icontains = filters.phoneNumbersSentTo; | |
} | |
if (filters.endUsers) { | |
filtersObj.end_users = filters.endUsers; | |
} | |
if (filters.user) { | |
filtersObj.user__icontains = filters.user; | |
} | |
if (filters.id) { | |
filtersObj.id = filters.id; | |
} | |
return HTTPService["a" /* HTTPService */].get('/api/v2/sent-messages', { | |
params: { | |
filters: filtersObj, | |
order_by: '-id', | |
include_related: 'user', | |
page_number: pagination.page, | |
page_size: pagination.rowsPerPage | |
} | |
}).then(res => ({ | |
sentSMSes: res.data.sent_messages.map(sentSMS => SentSMSModel_SentSMSModel.create(camelize_default()(sentSMS))), | |
total: res.data.pagination.total | |
})); | |
}); | |
// EXTERNAL MODULE: ./src/services/ConfigService/index.js | |
var ConfigService = __webpack_require__("cd77"); | |
// CONCATENATED MODULE: ./src/services/GoogleMapsURLService/index.js | |
class GoogleMapsURLService {} | |
defineProperty_default()(GoogleMapsURLService, "createURL", (latitude, longitude) => { | |
return `https://www.google.com/maps/dir/?api=1&destination=${latitude}%2C${longitude}`; | |
}); | |
// EXTERNAL MODULE: ./src/services/TransactionService/index.js | |
var TransactionService = __webpack_require__("064c"); | |
// CONCATENATED MODULE: ./src/services/index.js | |
/***/ }), | |
/***/ "ddff": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* unused harmony export matchesRoute */ | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return matchesWarnBeforeLeaveRoutes; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return requiresAdminUser; }); | |
/* harmony import */ var src_services__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("dde5"); | |
/* harmony import */ var src_services_snackBar_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("a4b6"); | |
/* harmony import */ var _lumkani__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("b7be"); | |
const WARN_AGENT_BEFORE_LEAVE = [{ | |
to: 'app.viewClient', | |
from: 'app.listLivesAssured' | |
}, { | |
to: 'app.home', | |
from: 'app.householdPhotos' | |
}, { | |
to: 'app.home', | |
from: 'app.frontDoorBarcodeScanner' | |
}]; | |
const matchesRoute = (RoutesArray, { | |
to, | |
from | |
}) => RoutesArray.some(evalRoute => evalRoute.to === to.name && evalRoute.from === from.name); | |
const matchesWarnBeforeLeaveRoutes = payload => matchesRoute(WARN_AGENT_BEFORE_LEAVE, payload); | |
const requiresAdminUser = async (to, from, next) => { | |
const isAdmin = await src_services__WEBPACK_IMPORTED_MODULE_0__[/* AuthService */ "a"].whoAmI().then(user => user.isAdminUser).catch(error => { | |
const message = _lumkani__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].parseErrorMessage(error); | |
src_services_snackBar_service__WEBPACK_IMPORTED_MODULE_1__["error"]({ | |
message | |
}); | |
}); | |
if (!isAdmin) { | |
src_services_snackBar_service__WEBPACK_IMPORTED_MODULE_1__["error"]({ | |
message: 'Permission Error: You need to be ADMIN to access this page' | |
}); | |
next({ | |
name: 'app.home' | |
}); | |
} else { | |
next(); | |
} | |
return isAdmin; | |
}; | |
/***/ }), | |
/***/ "e427": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AddressModel; }); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9523"); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__); | |
/* harmony import */ var vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("b5ae"); | |
/* harmony import */ var vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__); | |
/* harmony import */ var _CommunityModel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("a3c6"); | |
/* harmony import */ var _schema_validators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("0dec"); | |
class AddressModel { | |
constructor({ | |
addressLine1, | |
addressLine2, | |
community | |
}) { | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "addressLine1", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "addressLine2", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "community", void 0); | |
this.addressLine1 = addressLine1; | |
this.addressLine2 = addressLine2; | |
this.community = _CommunityModel__WEBPACK_IMPORTED_MODULE_2__[/* CommunityModel */ "a"].create(community); | |
} | |
get isValid() { | |
return AddressModel.schema.validateStrict(this); | |
} | |
toString() { | |
var _this$community, _this$community2, _this$community3; | |
return [this.addressLine1, this.addressLine2, (_this$community = this.community) === null || _this$community === void 0 ? void 0 : _this$community.suburb, (_this$community2 = this.community) === null || _this$community2 === void 0 ? void 0 : _this$community2.name, (_this$community3 = this.community) === null || _this$community3 === void 0 ? void 0 : _this$community3.city].filter(x => x).join(', '); | |
} | |
toLkRegistrationJSON() { | |
return { | |
community_id: this.community.id, | |
addressLine1: this.addressLine1, | |
addressLine2: this.addressLine2 | |
}; | |
} | |
} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(AddressModel, "schema", { | |
addressLine1: [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__["required"]], | |
addressLine2: model => { | |
if (model.community.nameIsOther()) { | |
return [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__["required"]]; | |
} | |
return model.community.id ? [] : [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__["required"]]; | |
}, | |
..._schema_validators__WEBPACK_IMPORTED_MODULE_3__[/* schemaValidators */ "a"] | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(AddressModel, "create", (address = {}) => new AddressModel(address)); | |
/***/ }), | |
/***/ "e436": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return PhotoManager; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FirePolicyPhotoManager; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return FuneralPolicyPhotoManager; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return RegistrationPhotoManager; }); | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return HardwareInstallationPhotoManager; }); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9523"); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__); | |
/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("14d9"); | |
/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__); | |
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("2ef0"); | |
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__); | |
/* harmony import */ var _helpers_paymentType__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("0b56"); | |
/* harmony import */ var _PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("27fc"); | |
/* harmony import */ var _PhotoModel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("f059"); | |
const REQUIRED_MINIMUM_CONTENTS_PHOTOS = 6; | |
const MAXIMUM_CONTENTS_PHOTOS = 20; | |
class PhotoManager { | |
constructor(photos) { | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "photos", {}); | |
this.photos = photos; | |
} | |
setResourceIds(resourceIds) { | |
for (const photo of this.allPhotosWithImages()) { | |
photo.resourceId = resourceIds[photo.resource]; | |
} | |
} | |
allPhotos() { | |
return Object.values(this.photos).flat(); | |
} | |
allPhotosWithImages() { | |
return this.allPhotos().filter(photo => !photo.isMissing); | |
} | |
missingRequiredPhotos() { | |
return this.allPhotos().filter(photo => photo.isMissing && photo.required); | |
} | |
get photosWithImages() { | |
return Object.entries(this.photos).reduce((acc, [resource, photos]) => { | |
const nonMissing = photos.filter(photo => !photo.isMissing); | |
if (nonMissing.length > 0) { | |
acc[resource] = nonMissing; | |
} | |
return acc; | |
}, {}); | |
} | |
mergePhotos(photos) { | |
for (const photo of photos) { | |
const matchingPhoto = this.photos[photo.resource].find(photoDefinition => photoDefinition.label === photo.label); | |
if (matchingPhoto) { | |
matchingPhoto.merge(photo); | |
} else { | |
this.photos[photo.resource].push(photo); | |
} | |
} | |
} | |
} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(PhotoManager, "create", () => new PhotoManager()); | |
class FirePolicyPhotoManager extends PhotoManager { | |
constructor(photos = {}) { | |
super(photos); | |
} | |
addContentsPhoto(ignoreMaximum = false) { | |
const numberOfContentsPhotos = this.contentsPhotos.length; | |
if (ignoreMaximum || numberOfContentsPhotos < MAXIMUM_CONTENTS_PHOTOS) { | |
const optionalContentsPhoto = _PhotoModel__WEBPACK_IMPORTED_MODULE_5__[/* PhotoModel */ "a"].fromDefinition(_PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].CONTENTS(numberOfContentsPhotos + 1), false); | |
this.photos.property.push(optionalContentsPhoto); | |
return optionalContentsPhoto; | |
} | |
} | |
get contentsPhotos() { | |
if (!this.photos.property) { | |
return []; | |
} | |
return this.photos.property.filter(photo => photo.label === _PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_LABEL */ "b"].CONTENTS); | |
} | |
mergePhotos(photos) { | |
photos.filter(photo => photo.label === _PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_LABEL */ "b"].CONTENTS).forEach(photo => this.addContentsPhoto(true).merge(photo)); | |
const otherPhotos = photos.filter(photo => photo.label !== _PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_LABEL */ "b"].CONTENTS); | |
super.mergePhotos(otherPhotos); | |
} | |
} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(FirePolicyPhotoManager, "createWithImagePlaceholders", () => { | |
const photos = { | |
policy: [_PhotoModel__WEBPACK_IMPORTED_MODULE_5__[/* PhotoModel */ "a"].fromDefinition(_PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].FIRE_POLICY_DOCUMENT), _PhotoModel__WEBPACK_IMPORTED_MODULE_5__[/* PhotoModel */ "a"].fromDefinition(_PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].DEBIT_ORDER)], | |
property: [_PhotoModel__WEBPACK_IMPORTED_MODULE_5__[/* PhotoModel */ "a"].fromDefinition(_PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].FRONT_DOOR_HOUSE_NUMBER), _PhotoModel__WEBPACK_IMPORTED_MODULE_5__[/* PhotoModel */ "a"].fromDefinition(_PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].OUTSIDE_LEFT), _PhotoModel__WEBPACK_IMPORTED_MODULE_5__[/* PhotoModel */ "a"].fromDefinition(_PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].OUTSIDE_RIGHT)], | |
device: [_PhotoModel__WEBPACK_IMPORTED_MODULE_5__[/* PhotoModel */ "a"].fromDefinition(_PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].DEVICE)] | |
}; | |
return new FirePolicyPhotoManager(photos); | |
}); | |
class FuneralPolicyPhotoManager extends PhotoManager { | |
constructor(photos = {}) { | |
super(photos); | |
} | |
} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(FuneralPolicyPhotoManager, "createWIthImagePlaceholders", () => { | |
const photos = { | |
policy: [_PhotoModel__WEBPACK_IMPORTED_MODULE_5__[/* PhotoModel */ "a"].fromDefinition(_PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].FUNERAL_POLICY_DOCUMENT)] | |
}; | |
return new FuneralPolicyPhotoManager(photos); | |
}); | |
class RegistrationPhotoManager extends FirePolicyPhotoManager { | |
constructor(photos = {}) { | |
super(photos); | |
} | |
static fromJSON(photoManagerJson) { | |
const photosJson = photoManagerJson.photos; | |
const photos = Object.entries(photosJson).reduce((acc, [resource, resourcePhotos]) => { | |
acc[resource] = resourcePhotos.map(photo => _PhotoModel__WEBPACK_IMPORTED_MODULE_5__[/* PhotoModel */ "a"].fromJSON(photo)); | |
return acc; | |
}, {}); | |
return new RegistrationPhotoManager(photos); | |
} | |
addOrRemoveDebitOrderPhoto(paymentMethod) { | |
if (paymentMethod === _helpers_paymentType__WEBPACK_IMPORTED_MODULE_3__[/* PAYMENT_TYPE */ "a"].DEBIT_ORDER) { | |
if (!this.photos.policy.find(photo => photo.name === _PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].DEBIT_ORDER.name)) { | |
this.photos.policy.push(_PhotoModel__WEBPACK_IMPORTED_MODULE_5__[/* PhotoModel */ "a"].fromDefinition(_PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].DEBIT_ORDER)); | |
} | |
} else { | |
this.photos.policy = this.photos.policy.filter(photo => photo.name !== _PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].DEBIT_ORDER.name); | |
} | |
} | |
addOrRemoveFuneralPhoto(isFuneralFlow) { | |
if (isFuneralFlow) { | |
if (!this.photos.policy.find(photo => photo.name === _PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].FUNERAL_POLICY_DOCUMENT.name)) { | |
this.photos.policy.push(_PhotoModel__WEBPACK_IMPORTED_MODULE_5__[/* PhotoModel */ "a"].fromDefinition(_PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].FUNERAL_POLICY_DOCUMENT)); | |
} | |
} else { | |
this.photos.policy = this.photos.policy.filter(photo => photo.name !== _PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].FUNERAL_POLICY_DOCUMENT.name); | |
} | |
} | |
} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(RegistrationPhotoManager, "createWithImagePlaceholders", () => { | |
const photos = { | |
customer: [_PhotoModel__WEBPACK_IMPORTED_MODULE_5__[/* PhotoModel */ "a"].fromDefinition(_PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].CUSTOMER)], | |
policy: [_PhotoModel__WEBPACK_IMPORTED_MODULE_5__[/* PhotoModel */ "a"].fromDefinition(_PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].FIRE_POLICY_DOCUMENT)], | |
device: [_PhotoModel__WEBPACK_IMPORTED_MODULE_5__[/* PhotoModel */ "a"].fromDefinition(_PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].DEVICE)], | |
property: [_PhotoModel__WEBPACK_IMPORTED_MODULE_5__[/* PhotoModel */ "a"].fromDefinition(_PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].FRONT_DOOR_HOUSE_NUMBER), _PhotoModel__WEBPACK_IMPORTED_MODULE_5__[/* PhotoModel */ "a"].fromDefinition(_PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].OUTSIDE_LEFT), _PhotoModel__WEBPACK_IMPORTED_MODULE_5__[/* PhotoModel */ "a"].fromDefinition(_PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].OUTSIDE_RIGHT), ...Object(lodash__WEBPACK_IMPORTED_MODULE_2__["range"])(1, REQUIRED_MINIMUM_CONTENTS_PHOTOS + 1).map(i => _PhotoModel__WEBPACK_IMPORTED_MODULE_5__[/* PhotoModel */ "a"].fromDefinition(_PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].CONTENTS(i)))] | |
}; | |
return new RegistrationPhotoManager(photos); | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(RegistrationPhotoManager, "createWithOnlyFuneralImagePlaceholders", () => { | |
const photos = { | |
policy: [_PhotoModel__WEBPACK_IMPORTED_MODULE_5__[/* PhotoModel */ "a"].fromDefinition(_PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].FUNERAL_POLICY_DOCUMENT)] | |
}; | |
return new RegistrationPhotoManager(photos); | |
}); | |
class HardwareInstallationPhotoManager extends PhotoManager { | |
constructor(photos = {}) { | |
super(photos); | |
} | |
} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(HardwareInstallationPhotoManager, "createWithImagePlaceholders", () => { | |
const photos = { | |
device: [_PhotoModel__WEBPACK_IMPORTED_MODULE_5__[/* PhotoModel */ "a"].fromDefinition(_PhotoModel_constants__WEBPACK_IMPORTED_MODULE_4__[/* PHOTO_DEFINITION */ "a"].DEVICE)] | |
}; | |
return new HardwareInstallationPhotoManager(photos); | |
}); | |
/***/ }), | |
/***/ "e614": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NextOfKinModel; }); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9523"); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__); | |
/* harmony import */ var vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("b5ae"); | |
/* harmony import */ var vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__); | |
/* harmony import */ var _filters__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("8975"); | |
/* harmony import */ var _schema_validators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("0dec"); | |
class NextOfKinModel { | |
constructor({ | |
id, | |
firstName, | |
surname, | |
policyId, | |
mobileNumber, | |
dateOfBirth | |
}) { | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "id", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "firstName", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "surname", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "policyId", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "mobileNumber", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "dateOfBirth", void 0); | |
this.id = id; | |
this.firstName = firstName; | |
this.surname = surname; | |
this.policyId = policyId; | |
this.mobileNumber = mobileNumber; | |
this.dateOfBirth = dateOfBirth; | |
} | |
get fullName() { | |
return `${this.firstName} ${this.surname}`; | |
} | |
get isValid() { | |
return NextOfKinModel.schema.validateStrict(this); | |
} | |
} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(NextOfKinModel, "create", nextOfKin => new NextOfKinModel(nextOfKin)); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(NextOfKinModel, "schema", { | |
firstName: [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__["required"]], | |
surname: [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__["required"]], | |
mobileNumber: [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__["required"], _filters__WEBPACK_IMPORTED_MODULE_2__["isMobileNumber"]], | |
dateOfBirth: [vuelidate_lib_validators__WEBPACK_IMPORTED_MODULE_1__["required"], _filters__WEBPACK_IMPORTED_MODULE_2__["olderThan18Filter"]], | |
..._schema_validators__WEBPACK_IMPORTED_MODULE_3__[/* schemaValidators */ "a"] | |
}); | |
/***/ }), | |
/***/ "eda6": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(Buffer) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FileService; }); | |
class FileService { | |
static dataURLtoBlob(dataurl) { | |
const arr = dataurl.split(','); | |
const mime = arr[0].split(':')[1].split(';')[0]; | |
const binaryString = Buffer.from(arr[1], 'base64'); | |
return new Blob([binaryString], { | |
type: mime | |
}); | |
} | |
} | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("1c35").Buffer)) | |
/***/ }), | |
/***/ "f059": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PhotoModel; }); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9523"); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__); | |
/* harmony import */ var _helpers_lumkani__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("b7be"); | |
class PhotoModel { | |
constructor(id, name, label, resource, resourceId, imageUrl, required = true) { | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "id", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "name", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "label", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "resource", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "resourceId", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "imageUrl", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "required", void 0); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(this, "wasChanged", void 0); | |
this.id = id; | |
this.name = name; | |
this.label = label; | |
this.resource = resource; | |
this.resourceId = resourceId; | |
this.imageUrl = imageUrl; | |
this.required = required; | |
this.wasChanged = false; | |
} | |
static fromJSON(json) { | |
return new PhotoModel(json.id, json.name, json.label, json.resource, json.resourceId, json.imageUrl, json.required); | |
} | |
merge(photo) { | |
this.id = photo.id; | |
this.imageUrl = photo.imageUrl; | |
this.resourceId = photo.resourceId; | |
return this; | |
} | |
get isMissing() { | |
return this.imageUrl === _helpers_lumkani__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].IMAGE_PLACEHOLDER_URL; | |
} | |
static stripLegacyNumberFromPhotoLabel(label) { | |
return label === null || label === void 0 ? void 0 : label.replace(/-\d+$/, ''); | |
} | |
static fromApi(apiPhoto) { | |
const label = PhotoModel.stripLegacyNumberFromPhotoLabel(apiPhoto.label); | |
return new PhotoModel(apiPhoto.id, label === null || label === void 0 ? void 0 : label.replaceAll('-', ' '), label, apiPhoto.resource, apiPhoto.objectId, apiPhoto.url); | |
} | |
static placeholder(definition, resourceId, required = true) { | |
return new PhotoModel(null, definition.name, definition.label, definition.resource, resourceId, _helpers_lumkani__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].IMAGE_PLACEHOLDER_URL, required); | |
} | |
} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(PhotoModel, "fromDefinition", (definition, required = true) => PhotoModel.placeholder(definition, null, required)); | |
/***/ }), | |
/***/ "f3ac": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createEnum; }); | |
/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("14d9"); | |
/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__); | |
const createEnum = (enumValues, extraMethods) => { | |
return Object.freeze({ | |
toDropdownOptions() { | |
const options = []; | |
for (const key in enumValues) { | |
options.push({ | |
label: enumValues[key], | |
value: enumValues[key] | |
}); | |
} | |
return options; | |
}, | |
values() { | |
const options = []; | |
for (const key in enumValues) { | |
options.push(enumValues[key]); | |
} | |
return options; | |
}, | |
...enumValues, | |
...extraMethods | |
}); | |
}; | |
/***/ }), | |
/***/ "fe2e": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PolicyService; }); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9523"); | |
/* harmony import */ var _app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__); | |
/* harmony import */ var camelize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("654d"); | |
/* harmony import */ var camelize__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(camelize__WEBPACK_IMPORTED_MODULE_1__); | |
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("ce96"); | |
/* harmony import */ var _helpers_http__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("825e"); | |
/* harmony import */ var _HTTPService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("778a"); | |
/* harmony import */ var _models__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("3a34"); | |
class PolicyService {} | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(PolicyService, "createFirePolicy", policy => { | |
return _HTTPService__WEBPACK_IMPORTED_MODULE_4__[/* HTTPService */ "a"].post('/api/v2/policies/fire', Object(_helpers__WEBPACK_IMPORTED_MODULE_2__[/* snakeize */ "d"])(policy)).then(({ | |
data | |
}) => _models__WEBPACK_IMPORTED_MODULE_5__[/* PolicyModel */ "j"].create(camelize__WEBPACK_IMPORTED_MODULE_1___default()(data))); | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(PolicyService, "appendFuneralPolicyToFirePolicy", policy => { | |
return _HTTPService__WEBPACK_IMPORTED_MODULE_4__[/* HTTPService */ "a"].post('/api/v2/policies/funeral', Object(_helpers__WEBPACK_IMPORTED_MODULE_2__[/* snakeize */ "d"])(policy)).then(({ | |
data | |
}) => _models__WEBPACK_IMPORTED_MODULE_5__[/* PolicyModel */ "j"].create(camelize__WEBPACK_IMPORTED_MODULE_1___default()(data))); | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(PolicyService, "upgradeFireToFireAndFuneralPolicy", (firePolicyId, funeralPolicy) => { | |
return _HTTPService__WEBPACK_IMPORTED_MODULE_4__[/* HTTPService */ "a"].post(`/api/v2/policies/fire/${firePolicyId}/upgrade/`, Object(_helpers__WEBPACK_IMPORTED_MODULE_2__[/* snakeize */ "d"])(funeralPolicy)).then(({ | |
data | |
}) => _models__WEBPACK_IMPORTED_MODULE_5__[/* PolicyModel */ "j"].create(camelize__WEBPACK_IMPORTED_MODULE_1___default()(data))); | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(PolicyService, "migrateToHollardFuneralPolicy", (funeralPolicyId, funeralPolicy) => { | |
return _HTTPService__WEBPACK_IMPORTED_MODULE_4__[/* HTTPService */ "a"].post(`/api/v2/policies/funeral/${funeralPolicyId}/replace/`, Object(_helpers__WEBPACK_IMPORTED_MODULE_2__[/* snakeize */ "d"])(funeralPolicy)).then(({ | |
data | |
}) => _models__WEBPACK_IMPORTED_MODULE_5__[/* PolicyModel */ "j"].create(camelize__WEBPACK_IMPORTED_MODULE_1___default()(data))); | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(PolicyService, "getPolicy", policyId => { | |
return _helpers_http__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].get(`/api/v2/policies/${policyId}`).then(({ | |
data | |
}) => _models__WEBPACK_IMPORTED_MODULE_5__[/* PolicyModel */ "j"].create(camelize__WEBPACK_IMPORTED_MODULE_1___default()(data))); | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(PolicyService, "listActivePoliciesWithoutDevice", (userId, rowsPerPage, pageNumber) => { | |
const params = { | |
filters: { | |
is_deleted: false, | |
device__isnull: true, | |
policy_type_not__in: ['FUNERAL'], | |
user_id: userId | |
}, | |
include_related: 'property,customer', | |
page_size: rowsPerPage, | |
page_number: pageNumber | |
}; | |
return _HTTPService__WEBPACK_IMPORTED_MODULE_4__[/* HTTPService */ "a"].get('/api/v2/policies', { | |
params: Object(_helpers__WEBPACK_IMPORTED_MODULE_2__[/* snakeize */ "d"])(params) | |
}).then(res => { | |
const data = { | |
policies: res.data.policies.map(policy => { | |
return _models__WEBPACK_IMPORTED_MODULE_5__[/* PolicyModel */ "j"].create(camelize__WEBPACK_IMPORTED_MODULE_1___default()(policy)); | |
}) | |
}; | |
const meta = { | |
totalPolicies: res.data.pagination.total, | |
pagination: { | |
rowsPerPage: res.data.pagination.page_count, | |
page: res.data.pagination.page_number | |
} | |
}; | |
return { | |
data, | |
meta | |
}; | |
}); | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(PolicyService, "updatePolicy", (policyId, policy) => { | |
return _helpers_http__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].patch(`/api/v2/policies/${policyId}`, Object(_helpers__WEBPACK_IMPORTED_MODULE_2__[/* snakeize */ "d"])(policy)).then(({ | |
data | |
}) => _models__WEBPACK_IMPORTED_MODULE_5__[/* PolicyModel */ "j"].create(camelize__WEBPACK_IMPORTED_MODULE_1___default()(data))); | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(PolicyService, "setPolicyStatus", (policyId, { | |
isEnabled = true, | |
notes | |
}) => { | |
return _HTTPService__WEBPACK_IMPORTED_MODULE_4__[/* HTTPService */ "a"].delete(`/api/v2/policies/${policyId}`, { | |
is_deleted: isEnabled, | |
notes | |
}).then(({ | |
data | |
}) => _models__WEBPACK_IMPORTED_MODULE_5__[/* PolicyModel */ "j"].create(camelize__WEBPACK_IMPORTED_MODULE_1___default()(data))); | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(PolicyService, "appendNotes", (policyId, notes) => { | |
return _helpers_http__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].patch(`/api/v2/policies/${policyId}/notes`, { | |
notes | |
}).then(({ | |
data | |
}) => _models__WEBPACK_IMPORTED_MODULE_5__[/* PolicyModel */ "j"].create(camelize__WEBPACK_IMPORTED_MODULE_1___default()(data))); | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(PolicyService, "getPoliciesByCustomerId", customerId => { | |
const params = { | |
filters: { | |
customer_id: customerId | |
}, | |
include_related: 'property,funeral_plan', | |
order_by: '-created_at' | |
}; | |
return _helpers_http__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].get('/api/v2/policies', { | |
params | |
}).then(({ | |
data | |
}) => data.policies.map(policy => _models__WEBPACK_IMPORTED_MODULE_5__[/* PolicyModel */ "j"].create(camelize__WEBPACK_IMPORTED_MODULE_1___default()(policy)))); | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(PolicyService, "getLinkedPolicies", policyId => { | |
return _HTTPService__WEBPACK_IMPORTED_MODULE_4__[/* HTTPService */ "a"].get(`/api/v2/policies/${policyId}/policies`).then(({ | |
data | |
}) => data.policies.map(policy => _models__WEBPACK_IMPORTED_MODULE_5__[/* PolicyModel */ "j"].create(camelize__WEBPACK_IMPORTED_MODULE_1___default()(policy)))); | |
}); | |
_app_node_modules_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()(PolicyService, "downgradePolicy", funeralpolicyId => { | |
return _HTTPService__WEBPACK_IMPORTED_MODULE_4__[/* HTTPService */ "a"].post(`/api/v2/policies/funeral/${funeralpolicyId}/downgrade/`, {}).then(({ | |
data | |
}) => _models__WEBPACK_IMPORTED_MODULE_5__[/* PolicyModel */ "j"].create(camelize__WEBPACK_IMPORTED_MODULE_1___default()(data))); | |
}); | |
/***/ }) | |
/******/ }); | |
//# sourceMappingURL=app.2d16f725.js.map |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment