public static void IncomeVerification(string applicationGuid, string filePath, string fileName, UploadedDocumentCategory?uploadCategory) { var loanApplicationTasksClient = new LoanApplicationTasksClient(); var docClient = new LoanApplicationUploadedDocumentsClient(); var resp = loanApplicationTasksClient.GetTasksList(applicationGuid); List <LoanApplicationTask> taskList = resp.content; List <LoanApplicationTask> incomeVerification = taskList.Where(task => task.Title == "W-2" || task.Title == "Pay Stub") .ToList(); UploadedDocumentType type; foreach (LoanApplicationTask l in incomeVerification) { type = l.Title.ToLower().Contains("w-2") ? UploadedDocumentType.W2 : UploadedDocumentType.PayStub; fileName = type == UploadedDocumentType.W2 ? "W2.pdf" : "PayStub.pdf"; var docUploadResponse = UploadDocument(l, filePath, fileName, UploadedDocumentCategory.Borrower, type); var note = BuildNoteRequest(EntityType.UploadedDocument, docUploadResponse.content.Guid, type.ToString(), true, $"{type} Doc uploaded", AgentNoteCategory.DocumentUpload, AgentRole.LLO, $"{type.ToString()} Document uploaded."); var agents = GetAgentsByRole(note.CreatorRole.ToString()); note.CreatedBy = (Guid)agents[new Random().Next(0, agents.Count)].agentGuid; CompleteDocUpload(note, l.LoanApplicationGuid.ToString(), l.Guid.ToString()); } }
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"); }