public static ResponseObject <EntityCreationResponse> UploadDocument(LoanApplicationTask task, string filePath,
                                                                             string fileName, UploadedDocumentCategory?uploadCategory,
                                                                             UploadedDocumentType docType)
        {
            var request = new CreateUploadedDocumentRequest();

            request.Description         = task.RequestMessage;
            request.Name                = task.Title;
            request.Type                = docType;
            request.Category            = uploadCategory;
            request.TaskGuid            = task.Guid;
            request.LoanApplicationGuid = task.LoanApplicationGuid;
            return(new TasksClient().UploadDocument(request, fileName, filePath, "multipart/form-data"));
        }
Exemple #2
0
        public static void VerbalVerification(string applicationGuid)
        {
            var filePath = AppDomain.CurrentDomain.BaseDirectory.ToString() + "Resources\\";
            var loanApplicationTasksClient = new LoanApplicationTasksClient();
            var resp         = loanApplicationTasksClient.GetTasksList(applicationGuid);
            var uploadClient = new LoanApplicationUploadedDocumentsClient();
            var request      = new CreateUploadedDocumentRequest();

            request.Category            = UploadedDocumentCategory.VerbalVerify;
            request.LoanApplicationGuid = (Guid?)new Guid(applicationGuid);
            request.Type        = UploadedDocumentType.VerbalVerificationRecording;
            request.Description = "Verbal Verify Recording";
            request.Name        = UploadedDocumentType.VerbalVerificationRecording.ToString();

            var uploadResponse = uploadClient.UploadDocument(request, "VerbalVerification.wav", filePath, "multipart/form-data");
            var note           = BuildNoteRequest(EntityType.UploadedDocument, uploadResponse.content.Guid, UploadedDocumentType.VerbalVerificationRecording.ToString(), true,
                                                  $"{UploadedDocumentType.VerbalVerificationRecording} Doc uploaded", AgentNoteCategory.DocumentUpload, AgentRole.UW,
                                                  $"{UploadedDocumentType.VerbalVerificationRecording.ToString()} Document uploaded.");
            var agents = GetAgentsByRole(note.CreatorRole.ToString());

            note.CreatedBy = (Guid)agents[new Random().Next(0, agents.Count)].agentGuid;
            var noteCreated = new LoanApplicationNotesClient().PostNote(note, applicationGuid);
            var disposition = new UploadedDocumentsClient().DocumentDisposition(uploadResponse.content.Guid.ToString(), "Reviewed");

            request.Type        = UploadedDocumentType.VerbalVerification;
            request.Description = "Verbal Verification";
            request.Name        = UploadedDocumentType.VerbalVerification.ToString();
            uploadResponse      = uploadClient.UploadDocument(request, "DivorceDecree.pdf", filePath, "multipart/form-data");
            note = BuildNoteRequest(EntityType.UploadedDocument, uploadResponse.content.Guid, UploadedDocumentType.VerbalVerification.ToString(), true,
                                    $"{UploadedDocumentType.VerbalVerification} Doc uploaded", AgentNoteCategory.DocumentUpload, AgentRole.UW,
                                    $"{UploadedDocumentType.VerbalVerification.ToString()} Document uploaded.");
            agents         = GetAgentsByRole(note.CreatorRole.ToString());
            note.CreatedBy = (Guid)agents[new Random().Next(0, agents.Count)].agentGuid;
            noteCreated    = new LoanApplicationNotesClient().PostNote(note, applicationGuid);
            disposition    = new UploadedDocumentsClient().DocumentDisposition(uploadResponse.content.Guid.ToString(), "Pass");
        }