Example #1
0
        public ReportResponse <DailyTranDetailReportResponsePayload> GenerateReport(ReportRequest reportRequest)
        {
            var reportContainer = ReportResponseFactory.Create <DailyTranDetailReportResponsePayload>(ReportType.DailyTranDetail, reportRequest);

            //DomainTransformation
            var bpTranLookupReq = reportRequest.ToBPTranDetailLookupModel();
            var mtTranLookupReq = reportRequest.ToMTTranDetailLookupModel();

            //Call required Repos
            var sendReport         = _dailyTranDetailReportGenerator.SendReport(mtTranLookupReq, reportRequest.PosIds);
            var receiveReport      = _dailyTranDetailReportGenerator.ReceiveReport(mtTranLookupReq, reportRequest.PosIds);
            var billPayReport      = _dailyTranDetailReportGenerator.BillPayReport(bpTranLookupReq, reportRequest.PosIds);
            var sendTotalReport    = _sendSummaryGenerator.GenerateSummary(sendReport);
            var receiveTotalReport = _receiveSummaryGenerator.GenerateSummary(receiveReport);
            var billPayTotalReport = _billPaymentSummaryGenerator.GenerateSummary(billPayReport);

            reportContainer.Payload = new DailyTranDetailReportResponsePayload
            {
                BillPayReportDetails      = billPayReport,
                BillPayTotalReportDetails = billPayTotalReport,
                ReceiveReportDetails      = receiveReport,
                ReceiveTotalReportDetails = receiveTotalReport,
                SendReportDetails         = sendReport,
                SendTotalReportDetails    = sendTotalReport
            };

            return(reportContainer);
        }
Example #2
0
        public ReportResponse GetContainer(ReportRequest reportRequest)
        {
            var reportContainer = ReportResponseFactory.Create(ReportType.DailyTranDetail, reportRequest);

            //DomainTranformation
            var userReportRequest = reportRequest.ToUserReportsRequestModel();

            var userReport             = new Report(ReportConstants.Common.USER_REPORT_NAME);
            var userReportResponseList = _partnerIntegration.GetUserReportsInfo(userReportRequest);

            foreach (UserReportsInfoResponse userReportsResponse in userReportResponseList.UserReportsInfoList)
            {
                var row = new Dictionary <string, string>();
                row.Add(ReportConstants.UserDetails.ACTIVE_USER_FLAG, string.IsNullOrEmpty(userReportsResponse.ActiveUserFlag) ? string.Empty : userReportsResponse.ActiveUserFlag);
                row.Add(ReportConstants.UserDetails.ACTIVITY_TYPE, string.IsNullOrEmpty(userReportsResponse.ActivityType) ? string.Empty : userReportsResponse.ActivityType);
                row.Add(ReportConstants.Common.AGENT_ID, Convert.ToString(userReportsResponse.AgentId));
                row.Add(ReportConstants.Common.AGENT_NAME, string.IsNullOrEmpty(userReportsResponse.AgentName) ? string.Empty : userReportsResponse.AgentName);
                row.Add(ReportConstants.UserDetails.DEVICE_NAME, string.IsNullOrEmpty(userReportsResponse.DeviceName) ? string.Empty : userReportsResponse.DeviceName);
                row.Add(ReportConstants.UserDetails.EDIR_GUID, string.IsNullOrEmpty(userReportsResponse.EdirGuid) ? string.Empty : userReportsResponse.EdirGuid);
                row.Add(ReportConstants.Common.FIRST_NAME, string.IsNullOrEmpty(userReportsResponse.FirstName) ? string.Empty : userReportsResponse.FirstName);
                row.Add(ReportConstants.UserDetails.LAST_LOGON_LCL_DATE, (userReportsResponse.LastLogonLclDate == null) ? string.Empty : userReportsResponse.LastLogonLclDate.ToString("yyyy MMM dd"));
                row.Add(ReportConstants.Common.LAST_NAME, string.IsNullOrEmpty(userReportsResponse.LastName) ? string.Empty : userReportsResponse.LastName);
                row.Add(ReportConstants.UserDetails.LDAP_USER_ID, string.IsNullOrEmpty(userReportsResponse.LdapUserId) ? string.Empty : userReportsResponse.LdapUserId);
                row.Add(ReportConstants.UserDetails.POS_NUMBER, userReportsResponse.PosNumber.ToString());
                userReport.Rows.Add(row);
            }
            reportContainer.Reports.Add(userReport);

            return(reportContainer);
        }
Example #3
0
        public ReportResponse GetContainer(ReportRequest reportRequest)
        {
            var reportContainer = ReportResponseFactory.Create(ReportType.DailyTranDetail, reportRequest);

            //DomainTranformation
            var tranExceedRequest = reportRequest.ToTransactionExceedRequestModel();

            var transactionExceedReport = new Report(ReportConstants.Common.TRANEXCEED_REPORT_NAME);

            //Call repo
            var transactionExceedInfoResponse = _partnerIntegration.GetTransactionExceedInfo(tranExceedRequest);

            foreach (TransactionExceedReportsInfo item in transactionExceedInfoResponse.transactionExceedReportsInfoList)
            {
                var row = new Dictionary <string, string>();
                row.Add(ReportConstants.Common.AGENT_ID, Convert.ToString(item.AgentId));
                row.Add(ReportConstants.Common.AGENT_NAME, string.IsNullOrEmpty(item.AgentName) ? string.Empty : item.AgentName);

                row.Add(ReportConstants.TransactionExceedDetails.CITY, string.IsNullOrEmpty(item.City) ? string.Empty : item.City);
                row.Add(ReportConstants.Common.POS_ID, string.IsNullOrEmpty(item.PosId) ? string.Empty : item.PosId);
                row.Add(ReportConstants.Common.FIRST_NAME, string.IsNullOrEmpty(item.FirstName) ? string.Empty : item.FirstName);
                row.Add(ReportConstants.Common.LAST_NAME, string.IsNullOrEmpty(item.LastName) ? string.Empty : item.LastName);
                row.Add(ReportConstants.TransactionExceedDetails.LDAP_USER_ID, string.IsNullOrEmpty(item.LdapUserId) ? string.Empty : item.LdapUserId);
                row.Add(ReportConstants.TransactionExceedDetails.EVENT_TRAN_CODE, string.IsNullOrEmpty(item.EventTranCode) ? string.Empty : item.EventTranCode);
                row.Add(ReportConstants.TransactionExceedDetails.EVENT_TRAN_NAME, string.IsNullOrEmpty(item.EventTranName) ? string.Empty : item.EventTranName);
                row.Add(ReportConstants.TransactionExceedDetails.TRAN_REF_ID, string.IsNullOrEmpty(item.TranRefId) ? string.Empty : item.TranRefId);
                row.Add(ReportConstants.TransactionExceedDetails.TRAN_LIM_CODE, Convert.ToString(item.TranLimCode));
                row.Add(ReportConstants.TransactionExceedDetails.TRAN_LIM_BSNS_DESC, string.IsNullOrEmpty(item.TranLimBsnsDesc) ? string.Empty : item.TranLimBsnsDesc);
                row.Add(ReportConstants.TransactionExceedDetails.EVENT_FACE_TRAN_AMT, Convert.ToString(item.EventFaceTranAmt));
                row.Add(ReportConstants.TransactionExceedDetails.TRAN_LIM_USD_AMT, Convert.ToString(item.TranLimUsdAmt));
                row.Add(ReportConstants.TransactionExceedDetails.MGR_FIRST_NAME, string.IsNullOrEmpty(item.MgrFirstName) ? string.Empty : item.MgrFirstName);
                row.Add(ReportConstants.TransactionExceedDetails.MGR_LAST_NAME, string.IsNullOrEmpty(item.MgrLastName) ? string.Empty : item.MgrLastName);
                row.Add(ReportConstants.TransactionExceedDetails.MGR_LDAP_USER_ID, string.IsNullOrEmpty(item.MgrLdapUserId) ? string.Empty : item.MgrLdapUserId);
                row.Add(ReportConstants.TransactionExceedDetails.EVENT_TRAN_EVENT_DATE, (item.EventTranEvntDate == null) ? string.Empty : item.EventTranEvntDate.ToString("yyyy MMM dd"));
                row.Add(ReportConstants.TransactionExceedDetails.EVENT_TRAN_EVENT_LCL_DATE_FIELD, (item.EventTranEvntLclDateField == null) ? string.Empty : item.EventTranEvntLclDateField.ToString("yyyy MMM dd"));

                transactionExceedReport.Rows.Add(row);
            }
            reportContainer.Reports.Add(transactionExceedReport);
            return(reportContainer);
        }
        public ReportResponse GetContainer(ReportRequest reportRequest)
        {
            var reportContainer = ReportResponseFactory.Create(ReportType.DailyTranSales, reportRequest);

            //Domain Tranformation
            var dailyTranLookupReq = reportRequest.ToDailyTranDetailLookupModel();
            var tranType           = string.Empty;

            //Add all the report(s)
            var rpt = new Report(ReportConstants.Common.SR_NAME);

            // Map from ViewModel->Domain
            var tranDetailLookupResp = _dlsIntegration.DailyTransactionDetailLookup(dailyTranLookupReq);

            if (tranDetailLookupResp == null || tranDetailLookupResp.GetDailyTransactionDetailLookupResultList == null)
            {
                return(reportContainer);
            }

            foreach (TransactionDetailLookupResult item in tranDetailLookupResp.GetDailyTransactionDetailLookupResultList)
            {
                if (!reportRequest.PosIds.Contains(item.PosId))
                {
                    continue;
                }

                var posId = string.Empty;
                if (item.PosId == null || !item.PosId.Equals("0"))
                {
                    posId = (item.PosId == null) ? "-" : item.PosId;
                }
                else
                {
                    posId = ReportConstants.Common.SUPER_AGENT;
                }

                Dictionary <string, string> DataInfo = new Dictionary <string, string>();

                DataInfo.Add(ReportConstants.DailyTranSales.AGENT_ID, dailyTranLookupReq.AgentId);
                DataInfo.Add(ReportConstants.DailyTranSales.ISO_CURRENCY_CODE, (string.IsNullOrEmpty(item.IsoCurrencyCode)) ? "-" : item.IsoCurrencyCode);
                DataInfo.Add(ReportConstants.DailyTranSales.AGENT_TIME, (string.IsNullOrEmpty(item.AgentLocalTime)) ? "" : Convert.ToDateTime(item.AgentLocalTime).ToString("HH:mm"));
                DataInfo.Add(ReportConstants.DailyTranSales.EMPLOYEE_NUMBER, string.Empty);
                DataInfo.Add(ReportConstants.DailyTranSales.RECEIVER_NAME, (string.IsNullOrEmpty(item.ReceiverName)) ? "-" : item.ReceiverName);
                DataInfo.Add(ReportConstants.DailyTranSales.REFERENCE_ID, (string.IsNullOrEmpty(item.ReferenceId)) ? "-" : item.ReferenceId);

                var serialNumber = "";
                foreach (string sItem in item.SerialNumberArray)
                {
                    serialNumber += sItem + "-";
                }
                if (!string.IsNullOrEmpty(serialNumber))
                {
                    serialNumber = serialNumber.Substring(0, serialNumber.Length - 1);
                }
                DataInfo.Add(ReportConstants.DailyTranSales.SERIAL_NUMBER, serialNumber);

                tranType = string.Empty;

                if (item.ProductId.Equals(ReportConstants.Common.UTILITY_BILL_PAYMENT_PRODUCT_ID))
                {
                    tranType = ReportConstants.Common.TRAN_TYPE_UP;
                }
                else if (item.ProductId.Equals(ReportConstants.Common.EXPRESS_PAYMENT_PRODUCT_ID))
                {
                    tranType = ReportConstants.Common.TRAN_TYPE_EP;
                }
                else if (item.ProductId.Equals(ReportConstants.Common.MT_PRODUCT_ID) && item.EventCode.Equals(DLSActivityTypeCode.SEN.ToString()))
                {
                    tranType = ReportConstants.Common.TRAN_TYPE_SEND;
                }
                else if (item.ProductId.Equals(ReportConstants.Common.MT_PRODUCT_ID) && item.EventCode.Equals(DLSActivityTypeCode.REC.ToString()))
                {
                    tranType = ReportConstants.Common.TRAN_TYPE_RECEIVE;
                }
                else if (item.EventCode.Equals(DLSActivityTypeCode.RSN.ToString()))
                {
                    tranType = ReportConstants.Common.TRAN_TYPE_CANCEL;
                }
                else if (item.EventCode.Equals(DLSActivityTypeCode.RRC.ToString()))
                {
                    tranType = ReportConstants.Common.TRAN_TYPE_REVERSAL;
                }

                DataInfo.Add(ReportConstants.DailyTranSales.TRANSACTION_TYPE, tranType);
                DataInfo.Add(ReportConstants.Common.AMOUNT, (string.IsNullOrEmpty(item.FaceAmount)) ? "-" : string.Format(ReportConstants.Common.AMT_FORMAT, double.Parse(item.FaceAmount)));
                DataInfo.Add(ReportConstants.DailyTranSales.EXCHANGE_RATE, (string.IsNullOrEmpty(item.FxConsumerRate)) ? "-" : item.FxConsumerRate);
                DataInfo.Add(ReportConstants.Common.FEE, (string.IsNullOrEmpty(item.FeeAmount)) ? "-" : string.Format(ReportConstants.Common.AMT_FORMAT, double.Parse(item.FeeAmount)));
                DataInfo.Add(ReportConstants.DailyTranSales.SENDER, (string.IsNullOrEmpty(item.SenderName)) ? "-" : item.SenderName);

                //Get user based on mainofficeid and operatorid
                var    operatorId = (string.IsNullOrEmpty(item.OperatorId)) ? "" : item.OperatorId.ToLower();
                string userId     = null;

                userId = string.IsNullOrEmpty(operatorId) ? "-" : operatorId;

                DataInfo.Add(ReportConstants.DailyTranSales.USERNAME, (userId == null) ? "-" : userId);

                if (item.FeeAmount != null)
                {
                    var faceAmount = double.Parse(item.FaceAmount);
                    var fee        = double.Parse(item.FeeAmount);
                    var total      = faceAmount + fee;
                    DataInfo.Add(ReportConstants.DailyTranSales.TOTAL_AMOUNT, string.Format(ReportConstants.Common.AMT_FORMAT, total));
                }
                else
                {
                    DataInfo.Add(ReportConstants.DailyTranSales.TOTAL_AMOUNT, string.Format(ReportConstants.Common.AMT_FORMAT, double.Parse(item.FaceAmount)));
                }

                DataInfo.Add(ReportConstants.Common.POS_ID, posId);

                rpt.Rows.Add(DataInfo);
            }

            reportContainer.Reports.Add(rpt);

            return(reportContainer);
        }