예제 #1
0
        public IHttpActionResult GetAllFields([FromBody] GetAllFieldsRequest getAllFieldsRequest)
        {
            getAllFieldsRequest.TransactionType = GetAllFieldsTransactionType.Receive;

            var respVm = _lookupBusiness.GetAllFields(getAllFieldsRequest);

            return(Ok(respVm));
        }
        public GetAllFieldsResponse GetAllFields(GetAllFieldsRequest req)
        {
            var agent    = AuthIntegration.GetAgent();
            var response = _agentConnect.GetAllFields(agent, req);

            CheckFlagsForDataChange(response.Payload?.Flags, agent);
            return(response);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="location">Physical location of the agent - MN, NY, CAN, MEX etc</param>
        /// <param name="req"></param>
        /// <returns></returns>
        public GetAllFieldsResponse GetAllFields(GetAllFieldsRequest req)
        {
            var agent = _agents.GetAgent(req.AgentID, req.AgentSequence);

            _agentConnectConfig.DecorateRequest(req);
            var response = _testRunner.AgentConnect.GetAllFields(agent, req);

            return(response);
        }
예제 #4
0
        public AcApiResponse <GetAllFieldsResponse, ApiData> GetAllFields(GetAllFieldsRequest req)
        {
            var resp = _agentConnectIntegration.GetAllFields(req);

            var apiResp = new AcApiResponse <GetAllFieldsResponse, ApiData>
            {
                BusinessMetadata = MapperHelper.SetResponseProperties(resp.Payload?.Flags, DataSource.AgentConnect),
                ResponseData     = resp
            };

            return(apiResp);
        }
예제 #5
0
        public override GetAllFieldsResponse GetAllFields(Agent agent, GetAllFieldsRequest getAllFieldsRequest)
        {
            // GetAllFields key is TransactionType+Language+Target Audience
            // Product - GetAllFieldsRequest.TransactionType
            // Language - Request.Language
            // Target Audience - Request.TargetAudience (AGENT_FACING, CONSUMER_FACING, SERVICING)
            GetAllFieldsResponse allFieldsResponse;
            var allFieldsKeyFormatted = string.Format(CacheKeys.GETALLFIELDSKEY, getAllFieldsRequest.TransactionType, agent.Language, getAllFieldsRequest.TargetAudience);
            var result = _cacheManager.Contains <CachedObjectResponseContainer <GetAllFieldsResponse> >(allFieldsKeyFormatted, CacheRegion.Global);

            Func <GetAllFieldsResponse> allFieldsCacheSaveFunction = delegate()
            {
                var version = getAllFieldsRequest.CachedVersion;
                getAllFieldsRequest.CachedVersion = null;

                allFieldsResponse = base.GetAllFields(agent, getAllFieldsRequest);
                var CachedContainer = CacheAheadHelper.PopulateCacheMetadata <GetAllFieldsResponse>(allFieldsResponse, CachePolicies.FullWeek);
                if (!string.IsNullOrEmpty(allFieldsResponse.Payload.Version) && allFieldsResponse.Payload.Infos.Any())
                {
                    _cacheManager.Save(allFieldsKeyFormatted, CachedContainer, CacheRegion.Global, CachePolicies.FullWeek);
                }

                getAllFieldsRequest.CachedVersion = version;
                return(allFieldsResponse);
            };

            if (result.Exists)
            {
                CacheAheadHelper.ExecuteCacheAheadProcess <GetAllFieldsResponse>(allFieldsCacheSaveFunction, result.CachedObj.CacheMetadata);
                if (getAllFieldsRequest.CachedVersion != result.CachedObj.DataObject.Payload.Version)
                {
                    allFieldsResponse = result.CachedObj.DataObject;
                }
                else
                {
                    allFieldsResponse = new GetAllFieldsResponse {
                        Payload = new GetAllFieldsResponsePayload {
                            Version = getAllFieldsRequest.CachedVersion
                        }
                    };
                }
            }
            else
            {
                allFieldsResponse = allFieldsCacheSaveFunction();
            }
            return(allFieldsResponse);
        }
예제 #6
0
 public virtual async Task <GetAllFieldsResponse> GetAllFieldsAsync(Agent agent, GetAllFieldsRequest getAllFieldsRequest)
 {
     return(await AgentConnect.GetAllFieldsAsync(agent, getAllFieldsRequest));
 }
예제 #7
0
 public virtual GetAllFieldsResponse GetAllFields(Agent agent, GetAllFieldsRequest getAllFieldsRequest)
 {
     return(AgentConnect.GetAllFields(agent, getAllFieldsRequest));
 }