private List <AgentVm> GetAgents(LocationRequest locRequest)
        {
            var req                = new AgentsRequest();
            var header             = new MoneyGram.PartnerService.DomainModel.Header();
            var processInstruction = new MoneyGram.PartnerService.DomainModel.ProcessingInstruction();

            req.header = header;
            req.header.ProcessingInstruction = processInstruction;

            req.AgentId = Convert.ToDecimal(locRequest.StoreNameNumberAgentId);
            req.header.ProcessingInstruction.Action = "GetAgents";
            req.AgentIdSpecified = true;
            req.AgentName        = locRequest.AgentName ?? string.Empty;
            req.City             = locRequest.City ?? string.Empty;
            req.State            = locRequest.State ?? string.Empty;
            req.StateCode        = locRequest.StateCode ?? string.Empty;
            req.Country          = locRequest.Country ?? string.Empty;
            req.ZipCode          = locRequest.ZipCode ?? string.Empty;
            req.Phone            = locRequest.Phone ?? string.Empty;
            req.HierarchyLevel   = locRequest.HierarchyLevel;
            //req.HierarchyLevelSpecified = (locationReqVm.HierarchyLevelSpecified == null ? true : locationReqVm.HierarchyLevelSpecified);

            var contentAgentsResponse = _partnerIntegration.GetAgents(req);

            return(contentAgentsResponse.ToVm().Agents);
        }
        public static SERVICE.ProcessingInstruction ToService(this DOMAIN.ProcessingInstruction req)
        {
            var serviceModel = PsMapper.Map <DOMAIN.ProcessingInstruction, SERVICE.ProcessingInstruction>(req)
                               .AdditionalOperations();

            return(serviceModel);
        }
        private List <AgentVm> GetLocationsPerMainOffice()
        {
            var req = new AgentLocationMoRequest();
            var processInstruction = new MoneyGram.PartnerService.DomainModel.ProcessingInstruction();

            req.header = new MoneyGram.PartnerService.DomainModel.Header();
            req.header.ProcessingInstruction = processInstruction;
            req.AgentId = Convert.ToDecimal(_authUser.MainOfficeAgentId);

            req.header.ProcessingInstruction.Action = "GetAgentLocationMo";

            var contentAgentLocationMoResponse = _partnerIntegration.GetAgentLocationsForMo(req);

            return(contentAgentLocationMoResponse.ToVm().Agents);
        }
        public static TransactionExceedInfoRequest ToTransactionExceedRequestModel(this ReportRequest reportRequest)
        {
            var req                = new TransactionExceedInfoRequest();
            var header             = new MoneyGram.PartnerService.DomainModel.Header();
            var processInstruction = new MoneyGram.PartnerService.DomainModel.ProcessingInstruction();

            req.header = header;
            req.header.ProcessingInstruction = processInstruction;

            req.header.ProcessingInstruction.Action = "GetTransactionExceedInfo";
            //req.AgentId = System.Convert.ToDecimal(agentId); will be in the integration layer
            req.AgentIdFieldSpecified         = true;
            req.TransactionDate               = System.Convert.ToDateTime(reportRequest.StartDate);
            req.TransactionDateFieldSpecified = true;
            return(req);
        }
        public static UserReportsInfoRequest ToUserReportsRequestModel(this ReportRequest reportRequest)
        {
            var req                = new UserReportsInfoRequest();
            var header             = new MoneyGram.PartnerService.DomainModel.Header();
            var processInstruction = new MoneyGram.PartnerService.DomainModel.ProcessingInstruction();

            req.header = header;
            req.header.ProcessingInstruction        = processInstruction;
            req.header.ProcessingInstruction.Action = "GetUserReportsInfo";
            //req.MainOfficeId = System.Convert.ToDecimal(mainOfficeId); will be in the integration layer
            req.Locations         = reportRequest.Locations.Select(Convert.ToDecimal).ToArray();
            req.FromDate          = System.DateTime.Parse(reportRequest.StartDate);
            req.ToDate            = System.DateTime.Parse(reportRequest.EndDate);
            req.FromDateSpecified = true;
            req.ToDateSpecified   = true;
            return(req);
        }
        private List <AgentVm> GetLocationsForMo(LocationRequest poeLocRequest)
        {
            var req                = new LocationsForMoRequest();
            var header             = new MoneyGram.PartnerService.DomainModel.Header();
            var processInstruction = new MoneyGram.PartnerService.DomainModel.ProcessingInstruction();

            req.header = header;
            req.header.ProcessingInstruction = processInstruction;

            req.header.ProcessingInstruction.Action = "GetLocationsForMo";
            req.MainOfficeId           = poeLocRequest.MainOfficeId;
            req.StoreNameNumberAgentId = poeLocRequest.StoreNameNumberAgentId ?? string.Empty;
            req.SubLevelNameId         = poeLocRequest.SubLevelNameId ?? string.Empty;
            req.City          = poeLocRequest.City ?? string.Empty;
            req.StateProvince = poeLocRequest.StateProvince ?? string.Empty;
            req.Country       = poeLocRequest.Country ?? string.Empty;
            req.ZipCode       = poeLocRequest.ZipCode ?? string.Empty;

            var searchedLocationsResp = _partnerIntegration.GetLocationsForMo(req);

            return(searchedLocationsResp.ToVm().Agents);
        }
        public ApiResponse <PosResponse, ApiData> GetPosListForLocation(decimal locationId)
        {
            var req                = new PosDeviceRequest();
            var header             = new MoneyGram.PartnerService.DomainModel.Header();
            var processInstruction = new MoneyGram.PartnerService.DomainModel.ProcessingInstruction();

            req.header = header;
            req.header.ProcessingInstruction = processInstruction;

            req.header.ProcessingInstruction.Action = "GetPOSDevice";
            req.AgentId = locationId;
            // Partner Service will allow now to pass NULL for PoeCode
            // If NULL is passed, Partner Service will return the list of all POS types that are active
            //req.PoeCode = poeCode;

            var posDeviceResp   = _partnerIntegration.GetPOSById(req);
            var posDeviceRespVm = posDeviceResp.ToVm();

            return(new ApiResponse <PosResponse, ApiData>
            {
                ResponseData = posDeviceRespVm,
                BusinessMetadata = MapperHelper.SetResponseProperties(null, DataSource.PartnerService)
            });
        }
 public static DOMAIN.ProcessingInstruction AdditionalOperations(this DOMAIN.ProcessingInstruction dmModel)
 {
     DomainTransformExtensions.NullifyWhiteSpaceStrings(dmModel);
     return(dmModel);
 }