From 932be9e7db7bc4828d877d808ea023edffafbaca Mon Sep 17 00:00:00 2001 From: goga-m Date: Thu, 12 Oct 2017 15:28:44 +0300 Subject: [PATCH] Provide Daily Volume in customer's api --- lib/customers.js | 39 ++++++++++-- public/elm.js | 163 ++++++++++++++++++++++++++++------------------- 2 files changed, 131 insertions(+), 71 deletions(-) diff --git a/lib/customers.js b/lib/customers.js index 0a78f40a..4be96d89 100644 --- a/lib/customers.js +++ b/lib/customers.js @@ -19,13 +19,8 @@ function add (customer) { function get (phone) { const sql = 'select * from customers where phone=$1' return db.oneOrNone(sql, [phone]) - .then(customer => { - if (!customer) return - return getDailyVolume(customer.id).then(dailyVolume => { - const formatted = camelize(customer) - return _.set('dailyVolume', dailyVolume, formatted) - }) - }) + .then(populateDailyVolume) + .then(camelize) } /** @@ -49,6 +44,7 @@ function update (id, data, userToken) { .then(addComplianceOverrides(id, updateData, userToken)) .then(populateOverrideUsernames) .then(computeStatus) + .then(populateDailyVolume) .then(camelize) } @@ -57,9 +53,20 @@ function getById (id, userToken) { return db.oneOrNone(sql, [id]) .then(populateOverrideUsernames) .then(computeStatus) + .then(populateDailyVolume) .then(camelize) } +/** + * Get and calculate customer's daily volume + * for both cash_in & cash_out txs + * + * @name getDailyVolume + * @function + * + * @param {string} id Customer's id + * @returns {Bignumber} Customer's daily volume + */ function getDailyVolume (id) { return Promise.all([ db.one(`select coalesce(sum(fiat), 0) as total from cash_in_txs @@ -73,6 +80,23 @@ function getDailyVolume (id) { }) } +/** + * Populate customer object + * with dailyVolume information + * + * @name populateDailyVolume + * @function + * + * @param {object} customer Customer object + * @returns {object} Customer object populated with dailyVolume + */ +function populateDailyVolume (customer) { + if (!customer) return + return getDailyVolume(customer.id).then(dailyVolume => { + return _.set('daily_volume', dailyVolume, customer) + }) +} + /** * Get all available complianceTypes * that can be overriden (excluding hard_limit) @@ -236,6 +260,7 @@ function batch () { .then(customers => Promise.all(_.map(customer => { return populateOverrideUsernames(customer) .then(computeStatus) + .then(populateDailyVolume) .then(camelize) }, customers))) } diff --git a/public/elm.js b/public/elm.js index 8b4c5cec..5a8f1a06 100644 --- a/public/elm.js +++ b/public/elm.js @@ -31995,7 +31995,9 @@ var _user$project$Common_Customer_Types$Customer = function (a) { return function (_5) { return function (_6) { return function (_7) { - return {id: a, name: b, phone: c, phoneAt: d, smsOverride: e, smsOverrideByName: f, smsOverrideAt: g, created: h, status: i, authorizedOverride: j, authorizedOverrideByName: k, authorizedOverrideAt: l, authorizedAt: m, idCardData: n, idCardDataOverride: o, idCardDataOverrideByName: p, idCardDataOverrideAt: q, idCardDataAt: r, idCardPhotoPath: s, idCardPhotoOverride: t, idCardPhotoOverrideByName: u, idCardPhotoOverrideAt: v, idCardPhotoAt: w, sanctions: x, sanctionsOverride: y, sanctionsOverrideByName: z, sanctionsOverrideAt: _1, sanctionsAt: _2, frontCameraPath: _3, frontCameraOverride: _4, frontCameraOverrideByName: _5, frontCameraOverrideAt: _6, frontCameraAt: _7}; + return function (_8) { + return {id: a, name: b, phone: c, phoneAt: d, smsOverride: e, smsOverrideByName: f, smsOverrideAt: g, created: h, status: i, authorizedOverride: j, authorizedOverrideByName: k, authorizedOverrideAt: l, authorizedAt: m, idCardData: n, idCardDataOverride: o, idCardDataOverrideByName: p, idCardDataOverrideAt: q, idCardDataAt: r, idCardPhotoPath: s, idCardPhotoOverride: t, idCardPhotoOverrideByName: u, idCardPhotoOverrideAt: v, idCardPhotoAt: w, sanctions: x, sanctionsOverride: y, sanctionsOverrideByName: z, sanctionsOverrideAt: _1, sanctionsAt: _2, frontCameraPath: _3, frontCameraOverride: _4, frontCameraOverrideByName: _5, frontCameraOverrideAt: _6, frontCameraAt: _7, dailyVolume: _8}; + }; }; }; }; @@ -32050,137 +32052,141 @@ var _user$project$Common_Customer_Decoder$mapAuthorizedTypes = function (s) { var _user$project$Common_Customer_Decoder$authorizedDecoder = A2(_elm_lang$core$Json_Decode$andThen, _user$project$Common_Customer_Decoder$mapAuthorizedTypes, _elm_lang$core$Json_Decode$string); var _user$project$Common_Customer_Decoder$customerDecoder = A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'frontCameraAt', - _elm_lang$core$Json_Decode$nullable(_elm_community$json_extra$Json_Decode_Extra$date), + 'dailyVolume', + _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'frontCameraOverrideAt', + 'frontCameraAt', _elm_lang$core$Json_Decode$nullable(_elm_community$json_extra$Json_Decode_Extra$date), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'frontCameraOverrideByName', - _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), + 'frontCameraOverrideAt', + _elm_lang$core$Json_Decode$nullable(_elm_community$json_extra$Json_Decode_Extra$date), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'frontCameraOverride', - _user$project$Common_Customer_Decoder$authorizedDecoder, + 'frontCameraOverrideByName', + _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'frontCameraPath', - _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), + 'frontCameraOverride', + _user$project$Common_Customer_Decoder$authorizedDecoder, A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'sanctionsAt', - _elm_lang$core$Json_Decode$nullable(_elm_community$json_extra$Json_Decode_Extra$date), + 'frontCameraPath', + _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'sanctionsOverrideAt', + 'sanctionsAt', _elm_lang$core$Json_Decode$nullable(_elm_community$json_extra$Json_Decode_Extra$date), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'sanctionsOverrideByName', - _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), + 'sanctionsOverrideAt', + _elm_lang$core$Json_Decode$nullable(_elm_community$json_extra$Json_Decode_Extra$date), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'sanctionsOverride', - _user$project$Common_Customer_Decoder$authorizedDecoder, + 'sanctionsOverrideByName', + _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'sanctions', - _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), + 'sanctionsOverride', + _user$project$Common_Customer_Decoder$authorizedDecoder, A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'idCardPhotoAt', - _elm_lang$core$Json_Decode$nullable(_elm_community$json_extra$Json_Decode_Extra$date), + 'sanctions', + _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'idCardPhotoOverrideAt', + 'idCardPhotoAt', _elm_lang$core$Json_Decode$nullable(_elm_community$json_extra$Json_Decode_Extra$date), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'idCardPhotoOverrideByName', - _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), + 'idCardPhotoOverrideAt', + _elm_lang$core$Json_Decode$nullable(_elm_community$json_extra$Json_Decode_Extra$date), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'idCardPhotoOverride', - _user$project$Common_Customer_Decoder$authorizedDecoder, + 'idCardPhotoOverrideByName', + _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'idCardPhotoPath', - _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), + 'idCardPhotoOverride', + _user$project$Common_Customer_Decoder$authorizedDecoder, A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'idCardDataAt', - _elm_lang$core$Json_Decode$nullable(_elm_community$json_extra$Json_Decode_Extra$date), + 'idCardPhotoPath', + _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'idCardDataOverrideAt', + 'idCardDataAt', _elm_lang$core$Json_Decode$nullable(_elm_community$json_extra$Json_Decode_Extra$date), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'idCardDataOverrideByName', - _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), + 'idCardDataOverrideAt', + _elm_lang$core$Json_Decode$nullable(_elm_community$json_extra$Json_Decode_Extra$date), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'idCardDataOverride', - _user$project$Common_Customer_Decoder$authorizedDecoder, + 'idCardDataOverrideByName', + _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'idCardData', - _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), + 'idCardDataOverride', + _user$project$Common_Customer_Decoder$authorizedDecoder, A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'authorizedAt', - _elm_lang$core$Json_Decode$nullable(_elm_community$json_extra$Json_Decode_Extra$date), + 'idCardData', + _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'authorizedOverrideAt', + 'authorizedAt', _elm_lang$core$Json_Decode$nullable(_elm_community$json_extra$Json_Decode_Extra$date), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'authorizedOverrideByName', - _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), + 'authorizedOverrideAt', + _elm_lang$core$Json_Decode$nullable(_elm_community$json_extra$Json_Decode_Extra$date), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'authorizedOverride', - _user$project$Common_Customer_Decoder$authorizedDecoder, + 'authorizedOverrideByName', + _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'status', - _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), + 'authorizedOverride', + _user$project$Common_Customer_Decoder$authorizedDecoder, A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'created', - _elm_community$json_extra$Json_Decode_Extra$date, + 'status', + _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'smsOverrideAt', - _elm_lang$core$Json_Decode$nullable(_elm_community$json_extra$Json_Decode_Extra$date), + 'created', + _elm_community$json_extra$Json_Decode_Extra$date, A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'smsOverrideByName', - _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), + 'smsOverrideAt', + _elm_lang$core$Json_Decode$nullable(_elm_community$json_extra$Json_Decode_Extra$date), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'smsOverride', - _user$project$Common_Customer_Decoder$authorizedDecoder, + 'smsOverrideByName', + _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'phoneAt', - _elm_lang$core$Json_Decode$nullable(_elm_community$json_extra$Json_Decode_Extra$date), + 'smsOverride', + _user$project$Common_Customer_Decoder$authorizedDecoder, A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'phone', - _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), + 'phoneAt', + _elm_lang$core$Json_Decode$nullable(_elm_community$json_extra$Json_Decode_Extra$date), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'name', + 'phone', _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), A3( _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'id', - _elm_lang$core$Json_Decode$string, - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$decode(_user$project$Common_Customer_Types$Customer)))))))))))))))))))))))))))))))))); + 'name', + _elm_lang$core$Json_Decode$nullable(_elm_lang$core$Json_Decode$string), + A3( + _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, + 'id', + _elm_lang$core$Json_Decode$string, + _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$decode(_user$project$Common_Customer_Types$Customer))))))))))))))))))))))))))))))))))); var _user$project$Common_Customer_Decoder$customersDecoder = A2( _elm_lang$core$Json_Decode$field, 'customers', @@ -38603,7 +38609,36 @@ var _user$project$Customer_View$customerView = function (customer) { _1: {ctor: '[]'} } }), - _1: {ctor: '[]'} + _1: { + ctor: '::', + _0: A2( + _elm_lang$html$Html$tr, + {ctor: '[]'}, + { + ctor: '::', + _0: A2( + _elm_lang$html$Html$td, + {ctor: '[]'}, + { + ctor: '::', + _0: _elm_lang$html$Html$text('Daily Volume '), + _1: {ctor: '[]'} + }), + _1: { + ctor: '::', + _0: A2( + _elm_lang$html$Html$td, + {ctor: '[]'}, + { + ctor: '::', + _0: _user$project$Customer_View$maybeText(customer.dailyVolume), + _1: {ctor: '[]'} + }), + _1: {ctor: '[]'} + } + }), + _1: {ctor: '[]'} + } } } } @@ -42033,7 +42068,7 @@ var _user$project$Main$Model = function (a) { var Elm = {}; Elm['Main'] = Elm['Main'] || {}; if (typeof _user$project$Main$main !== 'undefined') { - _user$project$Main$main(Elm['Main'], 'Main', {"types":{"unions":{"Selectize.Status":{"args":[],"tags":{"Editing":[],"Idle":[],"Blurred":[],"Cleared":[],"Initial":[]}},"BasicTypes.SavingStatus":{"args":[],"tags":{"Saving":[],"Editing":[],"NotSaving":[],"Saved":[]}},"Dict.LeafColor":{"args":[],"tags":{"LBBlack":[],"LBlack":[]}},"Account.SavingStatus":{"args":[],"tags":{"Saving":[],"Editing":[],"NotSaving":[],"Saved":[]}},"ConfigTypes.ConfigScope":{"args":[],"tags":{"Specific":[],"Both":[],"Global":[]}},"FieldSet.Types.Msg":{"args":[],"tags":{"Input":["String","String"]}},"ConfigTypes.FieldType":{"args":[],"tags":{"FieldOnOffType":[],"FieldPercentageType":[],"FieldLanguageType":[],"FieldCryptoCurrencyType":[],"FieldDecimalType":[],"FieldIntegerType":[],"FieldFiatCurrencyType":[],"FieldStringType":[],"FieldCountryType":[],"FieldAccountType":[]}},"Customers.Types.Msg":{"args":[],"tags":{"Load":["Customers.Types.Model"]}},"Pair.Msg":{"args":[],"tags":{"SubmitName":[],"Load":["RemoteData.WebData String"],"InputName":["String"]}},"Common.Customer.Types.Authorized":{"args":[],"tags":{"Automatic":[],"Verified":[],"Blocked":[]}},"Dict.Dict":{"args":["k","v"],"tags":{"RBNode_elm_builtin":["Dict.NColor","k","v","Dict.Dict k v","Dict.Dict k v"],"RBEmpty_elm_builtin":["Dict.LeafColor"]}},"ConfigTypes.DisplayTop":{"args":[],"tags":{"DisplayTopSolo":["String"],"DisplayTopLeader":["Int","String"],"DisplayTopNone":[]}},"Customer.Types.Msg":{"args":[],"tags":{"PatchCustomer":["String","String","Common.Customer.Types.Authorized"],"Load":["Customer.Types.Model"]}},"Date.Date":{"args":[],"tags":{"Date":[]}},"Account.Msg":{"args":[],"tags":{"Load":["Account.Model"],"FieldSetMsg":["FieldSet.Types.Msg"],"Submit":[],"HideSaveIndication":[]}},"MaintenanceFunding.Types.Msg":{"args":[],"tags":{"Load":["MaintenanceFunding.Types.Model"],"CryptoSwitch":["String"]}},"Common.TransactionTypes.Tx":{"args":[],"tags":{"CashInTx":["Common.TransactionTypes.CashInTxRec"],"CashOutTx":["Common.TransactionTypes.CashOutTxRec"]}},"Maybe.Maybe":{"args":["a"],"tags":{"Just":["a"],"Nothing":[]}},"Transaction.Types.Msg":{"args":[],"tags":{"Load":["Transaction.Types.Model"],"HideSaveIndication":[],"Cancel":["String"]}},"RemoteData.RemoteData":{"args":["e","a"],"tags":{"NotAsked":[],"Success":["a"],"Loading":[],"Failure":["e"]}},"MaintenanceMachines.Types.Msg":{"args":[],"tags":{"Action":[],"Load":["MaintenanceMachines.Types.Model"],"InputCassette":["MaintenanceMachines.Types.Machine","MaintenanceMachines.Types.Position","String"],"Submit":["MaintenanceMachines.Types.MachineAction"],"HideSaveIndication":[]}},"ConfigTypes.Crypto":{"args":[],"tags":{"GlobalCrypto":[],"CryptoCode":["String"]}},"CoreTypes.Msg":{"args":[],"tags":{"WebSocketMsg":["String"],"ConfigMsg":["Config.Msg"],"CustomersMsg":["Customers.Types.Msg"],"TransactionsMsg":["Transactions.Msg"],"LoadAccounts":["List ( String, String )"],"NewUrl":["String"],"Interval":[],"MaintenanceMachinesMsg":["MaintenanceMachines.Types.Msg"],"LoadStatus":["StatusTypes.WebStatus"],"UrlChange":["Navigation.Location"],"TransactionMsg":["Transaction.Types.Msg"],"MaintenanceFundingMsg":["MaintenanceFunding.Types.Msg"],"CustomerMsg":["Customer.Types.Msg"],"AccountMsg":["Account.Msg"],"PairMsg":["Pair.Msg"]}},"Dict.NColor":{"args":[],"tags":{"BBlack":[],"Red":[],"NBlack":[],"Black":[]}},"FieldSet.Types.FieldValue":{"args":[],"tags":{"FieldInteger":["Int"],"FieldString":["String"],"FieldPassword":["FieldSet.Types.FieldPasswordType"]}},"ConfigTypes.Machine":{"args":[],"tags":{"MachineId":["String"],"GlobalMachine":[]}},"Config.Msg":{"args":[],"tags":{"Focus":["ConfigTypes.FieldLocator"],"BlurSelectize":["ConfigTypes.FieldLocator","Selectize.State"],"Remove":["ConfigTypes.FieldLocator","Selectize.State"],"Load":["Config.WebConfigGroup"],"Input":["ConfigTypes.FieldLocator","String"],"Blur":["ConfigTypes.FieldLocator"],"Add":["ConfigTypes.FieldLocator","String","Selectize.State"],"Submit":[],"SelectizeMsg":["ConfigTypes.FieldLocator","Selectize.State"],"FocusSelectize":["ConfigTypes.FieldLocator","Selectize.State"],"HideSaveIndication":[],"NoOp":[],"CryptoSwitch":["ConfigTypes.Crypto"]}},"Transactions.Msg":{"args":[],"tags":{"Load":["Transactions.Model"]}},"ConfigTypes.FieldValidator":{"args":[],"tags":{"FieldRequired":[],"FieldMin":["Int"],"FieldMax":["Int"]}},"MaintenanceMachines.Types.MachineAction":{"args":[],"tags":{"RebootMachine":["MaintenanceMachines.Types.Machine"],"ResetCashOutBills":["MaintenanceMachines.Types.Machine"],"UnpairMachine":["MaintenanceMachines.Types.Machine"]}},"Http.Error":{"args":[],"tags":{"BadUrl":["String"],"NetworkError":[],"Timeout":[],"BadStatus":["Http.Response String"],"BadPayload":["String","Http.Response String"]}},"ConfigTypes.FieldValue":{"args":[],"tags":{"FieldIntegerValue":["Int"],"FieldDecimalValue":["Float"],"FieldCryptoCurrencyValue":["List String"],"FieldCountryValue":["String"],"FieldFiatCurrencyValue":["String"],"FieldStringValue":["String"],"FieldOnOffValue":["Bool"],"FieldAccountValue":["String"],"FieldLanguageValue":["List String"],"FieldPercentageValue":["Float"]}},"FieldSet.Types.FieldPasswordType":{"args":[],"tags":{"PasswordEmpty":[],"PasswordHidden":[],"Password":["String"]}},"MaintenanceMachines.Types.Position":{"args":[],"tags":{"Bottom":[],"Top":[]}}},"aliases":{"ConfigTypes.ConfigSchema":{"args":[],"type":"{ code : String , display : String , cryptoScope : ConfigTypes.ConfigScope , machineScope : ConfigTypes.ConfigScope , entries : List ConfigTypes.FieldDescriptor }"},"Selectize.State":{"args":[],"type":"{ boxPosition : Int, status : Selectize.Status, string : String }"},"RemoteData.WebData":{"args":["a"],"type":"RemoteData.RemoteData Http.Error a"},"ConfigTypes.FieldLocator":{"args":[],"type":"{ fieldScope : ConfigTypes.FieldScope , code : String , fieldType : ConfigTypes.FieldType , fieldClass : Maybe.Maybe String }"},"AccountTypes.Account":{"args":[],"type":"{ code : String , display : String , fields : List FieldSet.Types.Field }"},"Http.Response":{"args":["body"],"type":"{ url : String , status : { code : Int, message : String } , headers : Dict.Dict String String , body : body }"},"StatusTypes.WebStatus":{"args":[],"type":"RemoteData.WebData StatusTypes.StatusRec"},"Common.TransactionTypes.CashOutTxRec":{"args":[],"type":"{ id : String , machineName : String , toAddress : String , cryptoAtoms : Int , cryptoCode : String , fiat : Float , fiatCode : String , status : String , dispense : Bool , notified : Bool , redeemed : Bool , phone : Maybe.Maybe String , error : Maybe.Maybe String , created : Date.Date , confirmed : Bool }"},"MaintenanceMachines.Types.Machine":{"args":[],"type":"{ deviceId : String , name : String , cashbox : Int , cassette1 : Int , cassette2 : Int , paired : Bool , cashOut : Bool }"},"ConfigTypes.ConfigData":{"args":[],"type":"{ cryptoCurrencies : List ConfigTypes.CryptoDisplay , currencies : List ConfigTypes.DisplayRec , languages : List ConfigTypes.DisplayRec , countries : List ConfigTypes.DisplayRec , accounts : List ConfigTypes.AccountRec , machines : List ConfigTypes.MachineDisplay }"},"Transaction.Types.Model":{"args":[],"type":"RemoteData.WebData Transaction.Types.SubModel"},"Account.Model":{"args":[],"type":"RemoteData.WebData Account.SubModel"},"Customer.Types.Model":{"args":[],"type":"RemoteData.WebData Common.Customer.Types.Customer"},"MaintenanceFunding.Types.Model":{"args":[],"type":"RemoteData.WebData MaintenanceFunding.Types.SubModel"},"Common.Customer.Types.Customers":{"args":[],"type":"List Common.Customer.Types.Customer"},"MaintenanceFunding.Types.CryptoDisplay":{"args":[],"type":"{ cryptoCode : String, display : String }"},"ConfigTypes.CryptoDisplay":{"args":[],"type":"{ crypto : ConfigTypes.Crypto, display : String }"},"Config.WebConfigGroup":{"args":[],"type":"RemoteData.WebData ConfigTypes.ConfigGroup"},"FieldSet.Types.Field":{"args":[],"type":"{ code : String , display : String , placeholder : String , required : Bool , value : FieldSet.Types.FieldValue , loadedValue : FieldSet.Types.FieldValue }"},"ConfigTypes.DisplayRec":{"args":[],"type":"{ code : String, display : String }"},"Transaction.Types.SubModel":{"args":[],"type":"{ status : BasicTypes.SavingStatus, tx : Common.TransactionTypes.Tx }"},"Account.SubModel":{"args":[],"type":"{ status : Account.SavingStatus, account : AccountTypes.Account }"},"MaintenanceFunding.Types.SubModel":{"args":[],"type":"{ cryptoCode : String , cryptoDisplays : List MaintenanceFunding.Types.CryptoDisplay , fundingAddress : String , fundingAddressUrl : String , confirmedBalance : String , pending : String , fiatConfirmedBalance : String , fiatPending : String , fiatCode : String }"},"Common.TransactionTypes.CashInTxRec":{"args":[],"type":"{ id : String , machineName : String , toAddress : String , cryptoAtoms : Int , cryptoCode : String , fiat : Float , fiatCode : String , txHash : Maybe.Maybe String , phone : Maybe.Maybe String , error : Maybe.Maybe String , operatorCompleted : Bool , send : Bool , sendConfirmed : Bool , expired : Bool , created : Date.Date }"},"ConfigTypes.FieldScope":{"args":[],"type":"{ crypto : ConfigTypes.Crypto, machine : ConfigTypes.Machine }"},"MaintenanceMachines.Types.Model":{"args":[],"type":"RemoteData.WebData MaintenanceMachines.Types.SubModel"},"ConfigTypes.ConfigGroup":{"args":[],"type":"{ schema : ConfigTypes.ConfigSchema , values : List ConfigTypes.Field , selectedCryptos : List String , data : ConfigTypes.ConfigData }"},"ConfigTypes.AccountRec":{"args":[],"type":"{ code : String , display : String , class : String , cryptos : Maybe.Maybe (List ConfigTypes.Crypto) }"},"ConfigTypes.Field":{"args":[],"type":"{ fieldLocator : ConfigTypes.FieldLocator , fieldValue : ConfigTypes.FieldValue , fieldEnabledIfAny : List String , fieldEnabledIfAll : List String , inScope : Bool }"},"ConfigTypes.MachineDisplay":{"args":[],"type":"{ machine : ConfigTypes.Machine, display : String }"},"Common.Customer.Types.Customer":{"args":[],"type":"{ id : String , name : Maybe.Maybe String , phone : Maybe.Maybe String , phoneAt : Maybe.Maybe Date.Date , smsOverride : Common.Customer.Types.Authorized , smsOverrideByName : Maybe.Maybe String , smsOverrideAt : Maybe.Maybe Date.Date , created : Date.Date , status : Maybe.Maybe String , authorizedOverride : Common.Customer.Types.Authorized , authorizedOverrideByName : Maybe.Maybe String , authorizedOverrideAt : Maybe.Maybe Date.Date , authorizedAt : Maybe.Maybe Date.Date , idCardData : Maybe.Maybe String , idCardDataOverride : Common.Customer.Types.Authorized , idCardDataOverrideByName : Maybe.Maybe String , idCardDataOverrideAt : Maybe.Maybe Date.Date , idCardDataAt : Maybe.Maybe Date.Date , idCardPhotoPath : Maybe.Maybe String , idCardPhotoOverride : Common.Customer.Types.Authorized , idCardPhotoOverrideByName : Maybe.Maybe String , idCardPhotoOverrideAt : Maybe.Maybe Date.Date , idCardPhotoAt : Maybe.Maybe Date.Date , sanctions : Maybe.Maybe String , sanctionsOverride : Common.Customer.Types.Authorized , sanctionsOverrideByName : Maybe.Maybe String , sanctionsOverrideAt : Maybe.Maybe Date.Date , sanctionsAt : Maybe.Maybe Date.Date , frontCameraPath : Maybe.Maybe String , frontCameraOverride : Common.Customer.Types.Authorized , frontCameraOverrideByName : Maybe.Maybe String , frontCameraOverrideAt : Maybe.Maybe Date.Date , frontCameraAt : Maybe.Maybe Date.Date }"},"StatusTypes.ServerRec":{"args":[],"type":"{ up : Bool , lastPing : Maybe.Maybe String , rates : List StatusTypes.Rate , machineStatus : String , wasConfigured : Bool }"},"MaintenanceMachines.Types.SubModel":{"args":[],"type":"{ status : BasicTypes.SavingStatus , machines : MaintenanceMachines.Types.Machines }"},"StatusTypes.Rate":{"args":[],"type":"{ crypto : String, bid : Float, ask : Float }"},"Customers.Types.Model":{"args":[],"type":"RemoteData.WebData Common.Customer.Types.Customers"},"Transactions.Txs":{"args":[],"type":"List Common.TransactionTypes.Tx"},"MaintenanceMachines.Types.Machines":{"args":[],"type":"List MaintenanceMachines.Types.Machine"},"Transactions.Model":{"args":[],"type":"RemoteData.WebData Transactions.Txs"},"ConfigTypes.FieldDescriptor":{"args":[],"type":"{ code : String , cryptoScope : ConfigTypes.ConfigScope , machineScope : ConfigTypes.ConfigScope , displayTop : ConfigTypes.DisplayTop , displayBottom : String , displayCount : Maybe.Maybe Int , fieldType : ConfigTypes.FieldType , fieldValidation : List ConfigTypes.FieldValidator , fieldClass : Maybe.Maybe String , fieldEnabledIfAny : List String , fieldEnabledIfAll : List String , readOnly : Bool }"},"StatusTypes.StatusRec":{"args":[],"type":"{ server : StatusTypes.ServerRec, invalidConfigGroups : List String }"},"Navigation.Location":{"args":[],"type":"{ href : String , host : String , hostname : String , protocol : String , origin : String , port_ : String , pathname : String , search : String , hash : String , username : String , password : String }"}},"message":"CoreTypes.Msg"},"versions":{"elm":"0.18.0"}}); + _user$project$Main$main(Elm['Main'], 'Main', {"types":{"unions":{"Selectize.Status":{"args":[],"tags":{"Editing":[],"Idle":[],"Blurred":[],"Cleared":[],"Initial":[]}},"BasicTypes.SavingStatus":{"args":[],"tags":{"Saving":[],"Editing":[],"NotSaving":[],"Saved":[]}},"Dict.LeafColor":{"args":[],"tags":{"LBBlack":[],"LBlack":[]}},"Account.SavingStatus":{"args":[],"tags":{"Saving":[],"Editing":[],"NotSaving":[],"Saved":[]}},"ConfigTypes.ConfigScope":{"args":[],"tags":{"Specific":[],"Both":[],"Global":[]}},"FieldSet.Types.Msg":{"args":[],"tags":{"Input":["String","String"]}},"ConfigTypes.FieldType":{"args":[],"tags":{"FieldOnOffType":[],"FieldPercentageType":[],"FieldLanguageType":[],"FieldCryptoCurrencyType":[],"FieldDecimalType":[],"FieldIntegerType":[],"FieldFiatCurrencyType":[],"FieldStringType":[],"FieldCountryType":[],"FieldAccountType":[]}},"Customers.Types.Msg":{"args":[],"tags":{"Load":["Customers.Types.Model"]}},"Pair.Msg":{"args":[],"tags":{"SubmitName":[],"Load":["RemoteData.WebData String"],"InputName":["String"]}},"Common.Customer.Types.Authorized":{"args":[],"tags":{"Automatic":[],"Verified":[],"Blocked":[]}},"Dict.Dict":{"args":["k","v"],"tags":{"RBNode_elm_builtin":["Dict.NColor","k","v","Dict.Dict k v","Dict.Dict k v"],"RBEmpty_elm_builtin":["Dict.LeafColor"]}},"ConfigTypes.DisplayTop":{"args":[],"tags":{"DisplayTopSolo":["String"],"DisplayTopLeader":["Int","String"],"DisplayTopNone":[]}},"Customer.Types.Msg":{"args":[],"tags":{"PatchCustomer":["String","String","Common.Customer.Types.Authorized"],"Load":["Customer.Types.Model"]}},"Date.Date":{"args":[],"tags":{"Date":[]}},"Account.Msg":{"args":[],"tags":{"Load":["Account.Model"],"FieldSetMsg":["FieldSet.Types.Msg"],"Submit":[],"HideSaveIndication":[]}},"MaintenanceFunding.Types.Msg":{"args":[],"tags":{"Load":["MaintenanceFunding.Types.Model"],"CryptoSwitch":["String"]}},"Common.TransactionTypes.Tx":{"args":[],"tags":{"CashInTx":["Common.TransactionTypes.CashInTxRec"],"CashOutTx":["Common.TransactionTypes.CashOutTxRec"]}},"Maybe.Maybe":{"args":["a"],"tags":{"Just":["a"],"Nothing":[]}},"Transaction.Types.Msg":{"args":[],"tags":{"Load":["Transaction.Types.Model"],"HideSaveIndication":[],"Cancel":["String"]}},"RemoteData.RemoteData":{"args":["e","a"],"tags":{"NotAsked":[],"Success":["a"],"Loading":[],"Failure":["e"]}},"MaintenanceMachines.Types.Msg":{"args":[],"tags":{"Action":[],"Load":["MaintenanceMachines.Types.Model"],"InputCassette":["MaintenanceMachines.Types.Machine","MaintenanceMachines.Types.Position","String"],"Submit":["MaintenanceMachines.Types.MachineAction"],"HideSaveIndication":[]}},"ConfigTypes.Crypto":{"args":[],"tags":{"GlobalCrypto":[],"CryptoCode":["String"]}},"CoreTypes.Msg":{"args":[],"tags":{"WebSocketMsg":["String"],"ConfigMsg":["Config.Msg"],"CustomersMsg":["Customers.Types.Msg"],"TransactionsMsg":["Transactions.Msg"],"LoadAccounts":["List ( String, String )"],"NewUrl":["String"],"Interval":[],"MaintenanceMachinesMsg":["MaintenanceMachines.Types.Msg"],"LoadStatus":["StatusTypes.WebStatus"],"UrlChange":["Navigation.Location"],"TransactionMsg":["Transaction.Types.Msg"],"MaintenanceFundingMsg":["MaintenanceFunding.Types.Msg"],"CustomerMsg":["Customer.Types.Msg"],"AccountMsg":["Account.Msg"],"PairMsg":["Pair.Msg"]}},"Dict.NColor":{"args":[],"tags":{"BBlack":[],"Red":[],"NBlack":[],"Black":[]}},"FieldSet.Types.FieldValue":{"args":[],"tags":{"FieldInteger":["Int"],"FieldString":["String"],"FieldPassword":["FieldSet.Types.FieldPasswordType"]}},"ConfigTypes.Machine":{"args":[],"tags":{"MachineId":["String"],"GlobalMachine":[]}},"Config.Msg":{"args":[],"tags":{"Focus":["ConfigTypes.FieldLocator"],"BlurSelectize":["ConfigTypes.FieldLocator","Selectize.State"],"Remove":["ConfigTypes.FieldLocator","Selectize.State"],"Load":["Config.WebConfigGroup"],"Input":["ConfigTypes.FieldLocator","String"],"Blur":["ConfigTypes.FieldLocator"],"Add":["ConfigTypes.FieldLocator","String","Selectize.State"],"Submit":[],"SelectizeMsg":["ConfigTypes.FieldLocator","Selectize.State"],"FocusSelectize":["ConfigTypes.FieldLocator","Selectize.State"],"HideSaveIndication":[],"NoOp":[],"CryptoSwitch":["ConfigTypes.Crypto"]}},"Transactions.Msg":{"args":[],"tags":{"Load":["Transactions.Model"]}},"ConfigTypes.FieldValidator":{"args":[],"tags":{"FieldRequired":[],"FieldMin":["Int"],"FieldMax":["Int"]}},"MaintenanceMachines.Types.MachineAction":{"args":[],"tags":{"RebootMachine":["MaintenanceMachines.Types.Machine"],"ResetCashOutBills":["MaintenanceMachines.Types.Machine"],"UnpairMachine":["MaintenanceMachines.Types.Machine"]}},"Http.Error":{"args":[],"tags":{"BadUrl":["String"],"NetworkError":[],"Timeout":[],"BadStatus":["Http.Response String"],"BadPayload":["String","Http.Response String"]}},"ConfigTypes.FieldValue":{"args":[],"tags":{"FieldIntegerValue":["Int"],"FieldDecimalValue":["Float"],"FieldCryptoCurrencyValue":["List String"],"FieldCountryValue":["String"],"FieldFiatCurrencyValue":["String"],"FieldStringValue":["String"],"FieldOnOffValue":["Bool"],"FieldAccountValue":["String"],"FieldLanguageValue":["List String"],"FieldPercentageValue":["Float"]}},"FieldSet.Types.FieldPasswordType":{"args":[],"tags":{"PasswordEmpty":[],"PasswordHidden":[],"Password":["String"]}},"MaintenanceMachines.Types.Position":{"args":[],"tags":{"Bottom":[],"Top":[]}}},"aliases":{"ConfigTypes.ConfigSchema":{"args":[],"type":"{ code : String , display : String , cryptoScope : ConfigTypes.ConfigScope , machineScope : ConfigTypes.ConfigScope , entries : List ConfigTypes.FieldDescriptor }"},"Selectize.State":{"args":[],"type":"{ boxPosition : Int, status : Selectize.Status, string : String }"},"RemoteData.WebData":{"args":["a"],"type":"RemoteData.RemoteData Http.Error a"},"ConfigTypes.FieldLocator":{"args":[],"type":"{ fieldScope : ConfigTypes.FieldScope , code : String , fieldType : ConfigTypes.FieldType , fieldClass : Maybe.Maybe String }"},"AccountTypes.Account":{"args":[],"type":"{ code : String , display : String , fields : List FieldSet.Types.Field }"},"Http.Response":{"args":["body"],"type":"{ url : String , status : { code : Int, message : String } , headers : Dict.Dict String String , body : body }"},"StatusTypes.WebStatus":{"args":[],"type":"RemoteData.WebData StatusTypes.StatusRec"},"Common.TransactionTypes.CashOutTxRec":{"args":[],"type":"{ id : String , machineName : String , toAddress : String , cryptoAtoms : Int , cryptoCode : String , fiat : Float , fiatCode : String , status : String , dispense : Bool , notified : Bool , redeemed : Bool , phone : Maybe.Maybe String , error : Maybe.Maybe String , created : Date.Date , confirmed : Bool }"},"MaintenanceMachines.Types.Machine":{"args":[],"type":"{ deviceId : String , name : String , cashbox : Int , cassette1 : Int , cassette2 : Int , paired : Bool , cashOut : Bool }"},"ConfigTypes.ConfigData":{"args":[],"type":"{ cryptoCurrencies : List ConfigTypes.CryptoDisplay , currencies : List ConfigTypes.DisplayRec , languages : List ConfigTypes.DisplayRec , countries : List ConfigTypes.DisplayRec , accounts : List ConfigTypes.AccountRec , machines : List ConfigTypes.MachineDisplay }"},"Transaction.Types.Model":{"args":[],"type":"RemoteData.WebData Transaction.Types.SubModel"},"Account.Model":{"args":[],"type":"RemoteData.WebData Account.SubModel"},"Customer.Types.Model":{"args":[],"type":"RemoteData.WebData Common.Customer.Types.Customer"},"MaintenanceFunding.Types.Model":{"args":[],"type":"RemoteData.WebData MaintenanceFunding.Types.SubModel"},"Common.Customer.Types.Customers":{"args":[],"type":"List Common.Customer.Types.Customer"},"MaintenanceFunding.Types.CryptoDisplay":{"args":[],"type":"{ cryptoCode : String, display : String }"},"ConfigTypes.CryptoDisplay":{"args":[],"type":"{ crypto : ConfigTypes.Crypto, display : String }"},"Config.WebConfigGroup":{"args":[],"type":"RemoteData.WebData ConfigTypes.ConfigGroup"},"FieldSet.Types.Field":{"args":[],"type":"{ code : String , display : String , placeholder : String , required : Bool , value : FieldSet.Types.FieldValue , loadedValue : FieldSet.Types.FieldValue }"},"ConfigTypes.DisplayRec":{"args":[],"type":"{ code : String, display : String }"},"Transaction.Types.SubModel":{"args":[],"type":"{ status : BasicTypes.SavingStatus, tx : Common.TransactionTypes.Tx }"},"Account.SubModel":{"args":[],"type":"{ status : Account.SavingStatus, account : AccountTypes.Account }"},"MaintenanceFunding.Types.SubModel":{"args":[],"type":"{ cryptoCode : String , cryptoDisplays : List MaintenanceFunding.Types.CryptoDisplay , fundingAddress : String , fundingAddressUrl : String , confirmedBalance : String , pending : String , fiatConfirmedBalance : String , fiatPending : String , fiatCode : String }"},"Common.TransactionTypes.CashInTxRec":{"args":[],"type":"{ id : String , machineName : String , toAddress : String , cryptoAtoms : Int , cryptoCode : String , fiat : Float , fiatCode : String , txHash : Maybe.Maybe String , phone : Maybe.Maybe String , error : Maybe.Maybe String , operatorCompleted : Bool , send : Bool , sendConfirmed : Bool , expired : Bool , created : Date.Date }"},"ConfigTypes.FieldScope":{"args":[],"type":"{ crypto : ConfigTypes.Crypto, machine : ConfigTypes.Machine }"},"MaintenanceMachines.Types.Model":{"args":[],"type":"RemoteData.WebData MaintenanceMachines.Types.SubModel"},"ConfigTypes.ConfigGroup":{"args":[],"type":"{ schema : ConfigTypes.ConfigSchema , values : List ConfigTypes.Field , selectedCryptos : List String , data : ConfigTypes.ConfigData }"},"ConfigTypes.AccountRec":{"args":[],"type":"{ code : String , display : String , class : String , cryptos : Maybe.Maybe (List ConfigTypes.Crypto) }"},"ConfigTypes.Field":{"args":[],"type":"{ fieldLocator : ConfigTypes.FieldLocator , fieldValue : ConfigTypes.FieldValue , fieldEnabledIfAny : List String , fieldEnabledIfAll : List String , inScope : Bool }"},"ConfigTypes.MachineDisplay":{"args":[],"type":"{ machine : ConfigTypes.Machine, display : String }"},"Common.Customer.Types.Customer":{"args":[],"type":"{ id : String , name : Maybe.Maybe String , phone : Maybe.Maybe String , phoneAt : Maybe.Maybe Date.Date , smsOverride : Common.Customer.Types.Authorized , smsOverrideByName : Maybe.Maybe String , smsOverrideAt : Maybe.Maybe Date.Date , created : Date.Date , status : Maybe.Maybe String , authorizedOverride : Common.Customer.Types.Authorized , authorizedOverrideByName : Maybe.Maybe String , authorizedOverrideAt : Maybe.Maybe Date.Date , authorizedAt : Maybe.Maybe Date.Date , idCardData : Maybe.Maybe String , idCardDataOverride : Common.Customer.Types.Authorized , idCardDataOverrideByName : Maybe.Maybe String , idCardDataOverrideAt : Maybe.Maybe Date.Date , idCardDataAt : Maybe.Maybe Date.Date , idCardPhotoPath : Maybe.Maybe String , idCardPhotoOverride : Common.Customer.Types.Authorized , idCardPhotoOverrideByName : Maybe.Maybe String , idCardPhotoOverrideAt : Maybe.Maybe Date.Date , idCardPhotoAt : Maybe.Maybe Date.Date , sanctions : Maybe.Maybe String , sanctionsOverride : Common.Customer.Types.Authorized , sanctionsOverrideByName : Maybe.Maybe String , sanctionsOverrideAt : Maybe.Maybe Date.Date , sanctionsAt : Maybe.Maybe Date.Date , frontCameraPath : Maybe.Maybe String , frontCameraOverride : Common.Customer.Types.Authorized , frontCameraOverrideByName : Maybe.Maybe String , frontCameraOverrideAt : Maybe.Maybe Date.Date , frontCameraAt : Maybe.Maybe Date.Date , dailyVolume : Maybe.Maybe String }"},"StatusTypes.ServerRec":{"args":[],"type":"{ up : Bool , lastPing : Maybe.Maybe String , rates : List StatusTypes.Rate , machineStatus : String , wasConfigured : Bool }"},"MaintenanceMachines.Types.SubModel":{"args":[],"type":"{ status : BasicTypes.SavingStatus , machines : MaintenanceMachines.Types.Machines }"},"StatusTypes.Rate":{"args":[],"type":"{ crypto : String, bid : Float, ask : Float }"},"Customers.Types.Model":{"args":[],"type":"RemoteData.WebData Common.Customer.Types.Customers"},"Transactions.Txs":{"args":[],"type":"List Common.TransactionTypes.Tx"},"MaintenanceMachines.Types.Machines":{"args":[],"type":"List MaintenanceMachines.Types.Machine"},"Transactions.Model":{"args":[],"type":"RemoteData.WebData Transactions.Txs"},"ConfigTypes.FieldDescriptor":{"args":[],"type":"{ code : String , cryptoScope : ConfigTypes.ConfigScope , machineScope : ConfigTypes.ConfigScope , displayTop : ConfigTypes.DisplayTop , displayBottom : String , displayCount : Maybe.Maybe Int , fieldType : ConfigTypes.FieldType , fieldValidation : List ConfigTypes.FieldValidator , fieldClass : Maybe.Maybe String , fieldEnabledIfAny : List String , fieldEnabledIfAll : List String , readOnly : Bool }"},"StatusTypes.StatusRec":{"args":[],"type":"{ server : StatusTypes.ServerRec, invalidConfigGroups : List String }"},"Navigation.Location":{"args":[],"type":"{ href : String , host : String , hostname : String , protocol : String , origin : String , port_ : String , pathname : String , search : String , hash : String , username : String , password : String }"}},"message":"CoreTypes.Msg"},"versions":{"elm":"0.18.0"}}); } if (typeof define === "function" && define['amd'])