From bbccdd5a1448471a320619bd37a915acb60e1917 Mon Sep 17 00:00:00 2001 From: Daniel Mersiowsky Date: Fri, 13 Sep 2024 14:04:12 +0200 Subject: [PATCH 1/2] Recreated changes from PR #14 --- dw/customer/AuthenticationStatus.js | 14 ++++++++++++++ dw/customer/Customer.js | 1 + dw/customer/CustomerMgr.js | 6 +++++- dw/system.js | 1 + 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 dw/customer/AuthenticationStatus.js diff --git a/dw/customer/AuthenticationStatus.js b/dw/customer/AuthenticationStatus.js new file mode 100644 index 0000000..39a6bf4 --- /dev/null +++ b/dw/customer/AuthenticationStatus.js @@ -0,0 +1,14 @@ +const AuthenticationStatus = function() {} + +AuthenticationStatus.prototype.getCustomer = function getCustomer() {} +AuthenticationStatus.prototype.getStatus = function getStatus() {} +AuthenticationStatus.prototype.isAuthenticated = function isAuthenticated() {} + +AuthenticationStatus.AUTH_OK = "AUTH_OK"; +AuthenticationStatus.ERROR_CUSTOMER_DISABLED = "ERROR_CUSTOMER_DISABLED"; +AuthenticationStatus.ERROR_CUSTOMER_LOCKED = "ERROR_CUSTOMER_LOCKED"; +AuthenticationStatus.ERROR_CUSTOMER_NOT_FOUND = "ERROR_CUSTOMER_NOT_FOUND"; +AuthenticationStatus.ERROR_PASSWORD_EXPIRED = "ERROR_PASSWORD_EXPIRED"; +AuthenticationStatus.ERROR_PASSWORD_MISMATCH = "ERROR_PASSWORD_MISMATCH"; + +module.exports = AuthenticationStatus; diff --git a/dw/customer/Customer.js b/dw/customer/Customer.js index 946ca09..1879c37 100644 --- a/dw/customer/Customer.js +++ b/dw/customer/Customer.js @@ -2,6 +2,7 @@ class Customer { constructor(profile) { this.ID = 'ID'; this.profile = profile || new (require('./Profile'))(); + this.AuthenticationStatus = require('./AuthenticationStatus'); } isRegistered () { diff --git a/dw/customer/CustomerMgr.js b/dw/customer/CustomerMgr.js index 26438ea..fcf9338 100644 --- a/dw/customer/CustomerMgr.js +++ b/dw/customer/CustomerMgr.js @@ -18,7 +18,11 @@ CustomerMgr.getExternallyAuthenticatedCustomerProfile = function(){}; CustomerMgr.loginExternallyAuthenticatedCustomer = function(){}; CustomerMgr.getCustomerByCustomerNumber = function(){}; CustomerMgr.createCustomer = function() {}; -CustomerMgr.logoutCustomer = function() {}; +CustomerMgr.authenticateCustomer = function() {}; +CustomerMgr.loginCustomer = function() {}; +CustomerMgr.getCustomerByLogin = function() {}; +CustomerMgr.isAcceptablePassword = function isAcceptablePassword() {}; +CustomerMgr.logoutCustomer = function logoutCustomer() {}; CustomerMgr.getSiteCustomerList = () => customerList; CustomerMgr.prototype.customerGroups=null; CustomerMgr.prototype.profile=null; diff --git a/dw/system.js b/dw/system.js index 4edb9c5..d022804 100644 --- a/dw/system.js +++ b/dw/system.js @@ -14,3 +14,4 @@ exports.Status = require('./system/Status.js'); exports.StatusItem = require('./system/StatusItem.js'); exports.System = require('./system/System.js'); exports.Logger = require('./system/Logger.js'); +exports.Transaction = require('./system/Transaction.js'); \ No newline at end of file From 849187977dfc8fe21afbe3f89111782793c06ed3 Mon Sep 17 00:00:00 2001 From: Daniel Mersiowsky Date: Fri, 13 Sep 2024 14:08:24 +0200 Subject: [PATCH 2/2] removed anonymous function names --- dw/customer/CustomerMgr.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dw/customer/CustomerMgr.js b/dw/customer/CustomerMgr.js index fcf9338..0aa209d 100644 --- a/dw/customer/CustomerMgr.js +++ b/dw/customer/CustomerMgr.js @@ -21,8 +21,8 @@ CustomerMgr.createCustomer = function() {}; CustomerMgr.authenticateCustomer = function() {}; CustomerMgr.loginCustomer = function() {}; CustomerMgr.getCustomerByLogin = function() {}; -CustomerMgr.isAcceptablePassword = function isAcceptablePassword() {}; -CustomerMgr.logoutCustomer = function logoutCustomer() {}; +CustomerMgr.isAcceptablePassword = function() {}; +CustomerMgr.logoutCustomer = function() {}; CustomerMgr.getSiteCustomerList = () => customerList; CustomerMgr.prototype.customerGroups=null; CustomerMgr.prototype.profile=null;