Commit ad2fa4ed15e8a8263b2e65da2ef631a6293ffa3c

Authored by Nattapon Wongpaet
1 parent b77690fa
Exists in master and in 1 other branch dev

update summarylog and stat

ais-structure/src/modules/customer/customer.ctrl.js
@@ -53,7 +53,7 @@ exports.customer = async function (req, res, next) { @@ -53,7 +53,7 @@ exports.customer = async function (req, res, next) {
53 { 53 {
54 stats.receiveRestResponse(d01,method,sendCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage); 54 stats.receiveRestResponse(d01,method,sendCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage);
55 var response = responseMsg.error(req,getCmd,40401); 55 var response = responseMsg.error(req,getCmd,40401);
56 - log.addErrorSummary(req,d01,method+"_"+sendCmd,response.resultCode,response.developerMessage); 56 + log.addErrorSummary(req,d01,method+"_"+sendCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.resultCode,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage);
57 } 57 }
58 } else if(resultObj.resultCode.startsWith("404")){ 58 } else if(resultObj.resultCode.startsWith("404")){
59 stats.receiveRestResponse(d01,method,sendCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage); 59 stats.receiveRestResponse(d01,method,sendCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage);
ais-structure/src/modules/membercard/getMembership.ctrl.js
@@ -77,7 +77,7 @@ exports.getMembership = async function (req, res, next) { @@ -77,7 +77,7 @@ exports.getMembership = async function (req, res, next) {
77 } else { 77 } else {
78 stats.receiveRestResponse(d01,method,sendCusCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage); 78 stats.receiveRestResponse(d01,method,sendCusCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage);
79 var response = responseMsg.error(req,getCmd,40401); 79 var response = responseMsg.error(req,getCmd,40401);
80 - log.addErrorSummary(req,d01,method+"_"+sendCusCmd,response.resultCode,response.developerMessage); 80 + log.addErrorSummary(req,d01,method+"_"+sendCusCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.resultCode,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage);
81 } 81 }
82 } else if(resultObj.resultCode.startsWith("404")){ 82 } else if(resultObj.resultCode.startsWith("404")){
83 stats.receiveRestResponse(d01,method,sendCusCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage); 83 stats.receiveRestResponse(d01,method,sendCusCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage);
ais-structure/src/modules/membercard/postMembership.ctrl.js
@@ -108,7 +108,7 @@ exports.postMembership = async function (req, res, next){ @@ -108,7 +108,7 @@ exports.postMembership = async function (req, res, next){
108 } else { //data not found 108 } else { //data not found
109 109
110 stats.receiveRestResponse(d01,getMethod,sendMemberCardCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage); 110 stats.receiveRestResponse(d01,getMethod,sendMemberCardCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage);
111 - log.addSuccessSummary(req,d01,getMethod+"_"+sendMemberCardCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.resultCode,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage); 111 + log.addErrorSummary(req,d01,getMethod+"_"+sendMemberCardCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.resultCode,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage);
112 112
113 //get customer 113 //get customer
114 114
@@ -116,6 +116,10 @@ exports.postMembership = async function (req, res, next){ @@ -116,6 +116,10 @@ exports.postMembership = async function (req, res, next){
116 var response = await getCustomerHandler(req, getCustomer, resultObj, objDataMembership); 116 var response = await getCustomerHandler(req, getCustomer, resultObj, objDataMembership);
117 } 117 }
118 } else if(resultObj.resultCode.startsWith("404")){ //data not found 118 } else if(resultObj.resultCode.startsWith("404")){ //data not found
  119 +
  120 + stats.receiveRestResponse(d01,getMethod,sendMemberCardCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage);
  121 + log.addErrorSummary(req,d01,getMethod+"_"+sendMemberCardCmd,constant.RESPONSERESULT.DATA_NOT_FOUND.resultCode,constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage);
  122 +
119 //get customer 123 //get customer
120 var getCustomer = await getCustomerD01(req, objDataGetCustomer); 124 var getCustomer = await getCustomerD01(req, objDataGetCustomer);
121 var response = await getCustomerHandler(req, getCustomer, resultObj, objDataMembership); 125 var response = await getCustomerHandler(req, getCustomer, resultObj, objDataMembership);
@@ -286,7 +290,7 @@ async function getCustomerHandler(req, getCustomer, getMemberCard, objDataMember @@ -286,7 +290,7 @@ async function getCustomerHandler(req, getCustomer, getMemberCard, objDataMember
286 } else { 290 } else {
287 stats.receiveRestResponse(d01, getMethod, sendCustomerCmd, constant.RESPONSERESULT.DATA_NOT_FOUND.resultDescription); 291 stats.receiveRestResponse(d01, getMethod, sendCustomerCmd, constant.RESPONSERESULT.DATA_NOT_FOUND.resultDescription);
288 var response = responseMsg.error(req, getCmd, 40401); 292 var response = responseMsg.error(req, getCmd, 40401);
289 - log.addErrorSummary(req,d01, getMethod+"_"+sendCustomerCmd, response.resultCode, response.resultDescription); 293 + log.addErrorSummary(req,d01, getMethod+"_"+sendCustomerCmd, constant.RESPONSERESULT.DATA_NOT_FOUND.resultCode, constant.RESPONSERESULT.DATA_NOT_FOUND.developerMessage);
290 } 294 }
291 } else if(getCustomer.isDirect){ 295 } else if(getCustomer.isDirect){
292 stats.receiveRestResponse(d01, getMethod, sendCustomerCmd, constant.ERROR); 296 stats.receiveRestResponse(d01, getMethod, sendCustomerCmd, constant.ERROR);