private static void ParseLookup(IQuery query, TransactionLookupData searchData)
        {
            switch (searchData.LookupType)
            {
            case Symbols.COVERAGE:
                ParseCoverage(query, searchData);
                break;

            case Symbols.CREDIT_CARD:
                ParseCreditCard(query, searchData);
                break;

            case Symbols.WHOLESALE:
                ParseWholesale(query, searchData);
                break;

            case Symbols.SHOP:
                ParseShop(query, searchData);
                break;

            case Symbols.GENERIC:
                ParseGeneric(query, searchData);
                break;
            }
        }
Пример #2
0
        /// <summary>
        /// Given raw form data with fields matching <see
        /// cref="HubPortal.Api.Models.TransactionLookupData"/>, this call will return a list of
        /// transactions that satisfy the criteria specified in the posted form.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public JsonResult PostData([FromBody] TransactionLookupData data)
        {
            List <Transaction> transactions = TransactionLookupRequestParser.GetTransactions(data).ToList();

            transactions.RemoveAll(transaction => transaction == null);
            Logger.LogDummyData();
            return(Json(transactions));
        }
 private static void ParseCreditCard(IQuery query, TransactionLookupData searchData)
 {
     ParseRefinement(query, Symbols.CREDIT_CARD_NUMBER, searchData.CreditCardNumber);
     ParseRefinement(query, Symbols.AMOUNT, searchData.Amount);
     ParseRefinement(query, Symbols.CTU, searchData.CTU);
     ParseRefinement(query, Symbols.WORK_ORDER_NUMBER, searchData.WorkOrderNumber);
     ParseRefinement(query, Symbols.AUTHORIZATION_CODE, searchData.AuthorizationCode);
     ParseRefinement(query, Symbols.WORK_ORDER_ID, searchData.WorkOrderID);
 }
        public TransactionLookupData TransactionLookupForSendReversal(SendReversalData sendReversalData)
        {
            var transactionLookupData = new TransactionLookupData();
            var req = TransactionLookupRequestFactory.TransanctionLookupRequestForSendReversal(sendReversalData.SendReversalRequest.ReferenceNumber);

            req.AgentID       = sendReversalData.SendReversalRequest.AgentId;
            req.AgentSequence = sendReversalData.SendReversalRequest.AgentPos;
            transactionLookupData.Set(req);
            transactionLookupData.Set(_acIntegration.TransactionLookup(transactionLookupData.TransactionLookupReq));
            return(transactionLookupData);
        }
        public TransactionLookupData TransactionLookupForStatus(string agentId, string agentPos, string refNum)
        {
            var transactionLookupData = new TransactionLookupData();
            var req = TransactionLookupRequestFactory.TransanctionLookupRequestForStatus(refNum);

            req.AgentID       = agentId;
            req.AgentSequence = agentPos;
            transactionLookupData.Set(req);
            transactionLookupData.Set(_acIntegration.TransactionLookup(transactionLookupData.TransactionLookupReq));
            return(transactionLookupData);
        }
        public TransactionLookupData TransanctionLookupRequestForStagedReceive(SendData sendData)
        {
            var transactionLookupData = new TransactionLookupData();
            var req = TransactionLookupRequestFactory.TransanctionLookupRequestForReceiveCompletion(sendData.CompleteSessionResp.Payload.ReferenceNumber);

            req.AgentID       = sendData.SendRequest.AgentId;
            req.AgentSequence = sendData.SendRequest.AgentPos;
            transactionLookupData.Set(req);
            transactionLookupData.Set(_acIntegration.TransactionLookup(transactionLookupData.TransactionLookupReq));
            return(transactionLookupData);
        }
        public TransactionLookupData TransanctionLookupRequestForReceive(ReceiveData receiveData)
        {
            var transactionLookupData = new TransactionLookupData();
            var req = TransactionLookupRequestFactory.TransanctionLookupRequestForReceive(receiveData.CompleteSessionResponse.Payload.ReferenceNumber);

            req.AgentID       = receiveData.ReceiveRequest.AgentId;
            req.AgentSequence = receiveData.ReceiveRequest.AgentPos;
            transactionLookupData.Set(req);
            transactionLookupData.Set(transactionLookupData.TransactionLookupReq);
            return(transactionLookupData);
        }
        public TransactionLookupData TransactionLookupForReceiveReversal(ReceiveReversalData receiveReversalData)
        {
            var transactionLookupData = new TransactionLookupData();
            var req = TransactionLookupRequestFactory.TransactionLookupRequestForReceiveReversal(receiveReversalData.ReceiveReversalOperationRequest.ReferenceNumber);

            req.AgentID       = receiveReversalData.ReceiveReversalOperationRequest.AgentId;
            req.AgentSequence = receiveReversalData.ReceiveReversalOperationRequest.AgentPos;
            transactionLookupData.Set(req);
            transactionLookupData.Set(_acIntegration.TransactionLookup(transactionLookupData.TransactionLookupReq));
            return(transactionLookupData);
        }
 private static void ParseTransactionDetails(IQuery query, TransactionLookupData searchData)
 {
     ParseRefinement(query, Symbols.START_TIME, searchData.StartTime);
     ParseRefinement(query, Symbols.END_TIME, searchData.EndTime);
     ParseRefinement(query, Symbols.MIN_TIME, searchData.MinTime);
     ParseRefinement(query, Symbols.MAX_TIME, searchData.MaxTime);
     ParseRefinement(query, Symbols.PING_OPTION, searchData.PingOptions);
     ParseRefinement(query, Symbols.FAILED, searchData.Failed);
     ParseRefinement(query, Symbols.SERVER_NAME, searchData.ServerName);
     ParseRefinement(query, Symbols.SESSION_ID, searchData.SessionID);
 }
        public TransactionLookupData TransactionLookupForAmend(AmendData amendData)
        {
            var transactionLookupData = new TransactionLookupData();

            transactionLookupData.Set(TransactionLookupRequestFactory.TransanctionLookupRequestForAmend(amendData.AmendOperationRequest.ReferenceNumber));
            var req = TransactionLookupRequestFactory.TransanctionLookupRequestForAmend(amendData.AmendOperationRequest.ReferenceNumber);

            req.AgentID       = amendData.AmendOperationRequest.AgentId;
            req.AgentSequence = amendData.AmendOperationRequest.AgentPos;
            transactionLookupData.Set(req);
            transactionLookupData.Set(_acIntegration.TransactionLookup(transactionLookupData.TransactionLookupReq));
            return(transactionLookupData);
        }
 private static void ParseCoverage(IQuery query, TransactionLookupData searchData)
 {
     ParseRefinement(query, Symbols.POLICY_NUMBER, searchData.PolicyNumber);
     ParseRefinement(query, Symbols.CLAIM_NUMBER, searchData.ClaimNumber);
     ParseRefinement(query, Symbols.REFERRAL_NUMBER, searchData.ReferralNumber);
     ParseRefinement(query, Symbols.FNOL_NUMBER, searchData.FNOLNumber);
     ParseRefinement(query, Symbols.CSR, searchData.CSR);
     ParseRefinement(query, Symbols.SUB_COMPANY, searchData.SubCompany);
     ParseRefinement(query, Symbols.REFERRAL_DATE, searchData.ReferralDate);
     ParseRefinement(query, Symbols.PART_NUMBER, searchData.PartNumber);
     ParseRefinement(query, Symbols.ZIP_CODE, searchData.ZipCode);
     ParseRefinement(query, Symbols.CAR_ID, searchData.CarID);
     ParseRefinement(query, Symbols.PROMO_CODE, searchData.PromoCode);
 }
        /// <summary>
        /// Given the raw <see cref="HubPortal.Api.Models.TransactionLookupData"/> posted by the
        /// client, will return a list of transactions that satisfy those criteria.
        /// </summary>
        /// <param name="searchData">Raw data from client's post request</param>
        /// <returns>List of transactions</returns>
        public static IEnumerable <Transaction> GetTransactions(TransactionLookupData searchData)
        {
            if (searchData.SearchType == "" || searchData.SearchType == null)
            {
                throw new Exception("Search Type not defined");
            }

            IEnumerable <Transaction> transactions = new List <Transaction>();
            IQuery query = QueryBuilder.GetQuery(Symbols.FINDALL, Symbols.TRANSACTION);

            ParseSearchType(query, searchData);
            ParseTransactionDetails(query, searchData);
            ParseLookup(query, searchData);

            return(TransactionEngine.GetTransactions(query));
        }
        private static void ParseSearchType(IQuery query, TransactionLookupData searchData)
        {
            switch (searchData.SearchType)
            {
            case Symbols.PROCESS:
                ParseRefinement(query, Symbols.PROCESS_NAME, searchData.Process);
                break;

            case Symbols.CLIENT:
                ParseRefinement(query, Symbols.CLIENT_NAME, searchData.Client);
                break;

            case Symbols.SOURCE:
                ParseRefinement(query, Symbols.SOURCE, searchData.Source);
                ParseRefinement(query, Symbols.DESTINATION, searchData.Destination);
                ParseRefinement(query, Symbols.TRANSACTION_TYPE, searchData.TransactionType);
                break;

            default:
                break;
            }
        }
 private static void ParseGeneric(IQuery query, TransactionLookupData searchData)
 {
     ParseRefinement(query, Symbols.GENERIC_SEARCH_STRING, searchData.GenericSearchString);
     ParseRefinement(query, Symbols.CHECKPOINT, searchData.Checkpoint);
 }
Пример #15
0
 public void Set(TransactionLookupData transactionLookupData)
 {
     TransactionLookup = transactionLookupData;
     SetExecutionOrder(nameof(TransactionLookup));
 }
 private static void ParseWholesale(IQuery query, TransactionLookupData searchData)
 {
     ParseRefinement(query, Symbols.ACCOUNT_NUMBER, searchData.AccountNumber);
     ParseRefinement(query, Symbols.WAREHOUSE_NUMBER, searchData.WarehouseNumber);
     ParseRefinement(query, Symbols.ORDER_ID, searchData.OrderID);
 }
 private static void ParseShop(IQuery query, TransactionLookupData searchData)
 {
     ParseRefinement(query, Symbols.INVOICE_NUMBER, searchData.InvoiceNumber);
     ParseRefinement(query, Symbols.SHOP_NUMBER, searchData.ShopNumber);
 }