public SaveConsumerProfileDocumentResponse SaveConsumerProfileDocument(SaveConsumerProfileDocumentRequest req)
        {
            var agent    = AuthIntegration.GetAgent();
            var response = _agentConnect.SaveConsumerProfileDocument(agent, req);

            CheckFlagsForDataChange(response.Payload?.Flags, agent);
            return(response);
        }
示例#2
0
        public AcApiResponse <SaveConsumerProfileDocumentResponse, ApiData> SaveConsumerProfileDocument(ViewModels.Consumer.SaveConsumerProfileDocumentRequest req)
        {
            var imageItems = new List <ImageItemType>();

            foreach (var image in req.ConsumerProfileDocument.ImageItems)
            {
                if (!string.IsNullOrEmpty(image.Image)) //add only non-empty images
                {
                    imageItems.Add(new ImageItemType
                    {
                        Image = System.Convert.FromBase64String(image.Image).ToList(),
                        Label = image.Label
                    });
                }
            }

            if (imageItems.Count == 0) //photocopy flow
            {
                imageItems = null;
            }

            var consumerProfileDocument = new ConsumerProfileDocumentContentType
            {
                Identifier        = req.ConsumerProfileDocument.Identifier,
                DocumentIssueDate = req.ConsumerProfileDocument.DocumentIssueDate,
                MimeType          = req.ConsumerProfileDocument.MimeType,
                ImageItems        = imageItems
            };

            var request = new SaveConsumerProfileDocumentRequest
            {
                AgentID                 = req.AgentID,
                AgentSequence           = req.AgentSequence,
                ChannelType             = req.ChannelType,
                ClientSoftwareVersion   = req.ClientSoftwareVersion,
                ConsumerProfileID       = req.ConsumerProfileID,
                ConsumerProfileIDType   = req.ConsumerProfileIDType,
                Language                = req.Language,
                MgiSessionID            = req.MgiSessionID,
                OperatorName            = req.OperatorName,
                PoeCapabilities         = req.PoeCapabilities,
                PoeType                 = req.PoeType,
                TargetAudience          = req.TargetAudience,
                TimeStamp               = req.TimeStamp,
                UnitProfileID           = req.UnitProfileID,
                ConsumerProfileDocument = consumerProfileDocument,
            };

            var response = _agentConnectIntegration.SaveConsumerProfileDocument(request);

            var apiResponse = new AcApiResponse <SaveConsumerProfileDocumentResponse, ApiData>
            {
                BusinessMetadata = MapperHelper.SetResponseProperties(response.Payload?.Flags, DataSource.AgentConnect),
                ResponseData     = response
            };

            return(apiResponse);
        }
示例#3
0
 public virtual async Task <SaveConsumerProfileDocumentResponse> SaveConsumerProfileDocumentAsync(Agent agent, SaveConsumerProfileDocumentRequest saveConsumerProfileDocumentRequest)
 {
     return(await AgentConnect.SaveConsumerProfileDocumentAsync(agent, saveConsumerProfileDocumentRequest));
 }
示例#4
0
 public virtual SaveConsumerProfileDocumentResponse SaveConsumerProfileDocument(Agent agent, SaveConsumerProfileDocumentRequest saveConsumerProfileDocumentRequest)
 {
     return(AgentConnect.SaveConsumerProfileDocument(agent, saveConsumerProfileDocumentRequest));
 }