Exemple #1
0
        public void GetCustomerOnboard(Hyland.Unity.Application con, string customerDocument)
        {
            OnbaseSettings onbaseSettings = this.GetOnbaseSettings();
            var            logger         = new FileLogger("C:\\Temp\\OnbaseIntegration.log");

            var statusFilter = new string[]
            {
                "INREVISION"
            };

            try
            {
                var customerRepository         = new SimPaulOnbase.Infraestructure.ApiDataAccess.CustomerApiRepository(this.GetApiSettings());
                var onbaseConector             = new OnbaseInMemoryConector(con);
                var onbaseCustomerService      = new CustomerOnboardOnbaseService(onbaseSettings, onbaseConector, logger, customerRepository);
                var customerIntegrationUseCase = new CustomerOnboardIntegrationUseCase(customerRepository, onbaseCustomerService, logger);
                customerIntegrationUseCase.Handle(new CustomerIntegrationInput
                {
                    StatusFilter = statusFilter
                });
            }
            catch (System.Exception ex)
            {
                System.Diagnostics.Debug.Write(ex.ToString());
            }
        }
Exemple #2
0
        public void ExecuteIntegrations()
        {
            CustomerApiSettings apiSettings = new CustomerApiSettings
            {
                BaseUrl              = "https://dev-gapi.simpaul.com.br/",
                IncompletedResource  = "dev/backoffice/client/incomplete",
                ApproveResource      = "dev/backoffice/client/sinacor",
                ReproveResource      = "dev/backoffice/client/{id}/status",
                CustomerResource     = "dev/backoffice/client/onboarding",
                LoginResource        = "dev/backoffice/authentication",
                SuitabilityResource  = "dev/backoffice/client/{id}/suitability",
                RegisterAginResource = "dev/backoffice/client/reregister",
                UserLogin            = "******",
                PasswordLogin        = "******"
            };


            var customerRepository = new SimPaulOnbase.Infraestructure.ApiDataAccess.CustomerApiRepository(apiSettings);

            var customers = customerRepository.GetIncompleted()
                            .GetAwaiter()
                            .GetResult();

            var customersData = customerRepository
                                .GetCustomer()
                                .GetAwaiter()
                                .GetResult();


            var customer = customersData
                           .FirstOrDefault(cm => cm.SinacorAccounts == null || cm.SinacorAccounts.Length == 0);

            var aproveInput = new CustomerApproveInput
            {
                Id  = customer.Id,
                CPF = customer.Cpf
            };

            customerRepository.ApproveRegistration(aproveInput)
            .GetAwaiter()
            .GetResult();

            var reproveInput = new CustomerReproveInput
            {
                Id     = customer.Id,
                Status = "REPROVADO"
            };

            customerRepository.ReproveRegistration(reproveInput)
            .GetAwaiter()
            .GetResult();
        }
        private void ApproveRegistrationAgain(string cpfCliente, CustomerApiSettings apiSettings)
        {
            var customerRepository = new SimPaulOnbase.Infraestructure.ApiDataAccess.CustomerApiRepository(apiSettings);

            var output = customerRepository
                         .GetCustomer(cpfCliente)
                         .GetAwaiter()
                         .GetResult();

            var customer = output[0];

            var aproveInput = new CustomerApproveInput
            {
                Id  = customer.Id,
                CPF = customer.Cpf
            };

            customerRepository.ApproveRegistration(aproveInput)
            .GetAwaiter()
            .GetResult();
        }
Exemple #4
0
        public void Reprove(string customerDocument)
        {
            var customerRepository = new SimPaulOnbase.Infraestructure.ApiDataAccess.CustomerApiRepository(this.GetApiSettings());

            var output = customerRepository
                         .GetCustomer(customerDocument)
                         .GetAwaiter()
                         .GetResult();

            var customer = output.FirstOrDefault();

            var reproveInput = new CustomerReproveInput
            {
                Id     = customer.Id,
                Status = "BACKOFFICEDENIED"
            };

            customerRepository.ReproveRegistration(reproveInput)
            .GetAwaiter()
            .GetResult();
        }
Exemple #5
0
        public void Approve(string customerCPF)
        {
            var customerRepository = new SimPaulOnbase.Infraestructure.ApiDataAccess.CustomerApiRepository(this.GetApiSettings());

            var output = customerRepository
                         .GetCustomer(customerCPF)
                         .GetAwaiter()
                         .GetResult();

            var customer = output.FirstOrDefault();

            var aproveInput = new CustomerApproveInput
            {
                Id  = customer.Id,
                CPF = customer.Cpf
            };

            customerRepository.ApproveRegistration(aproveInput)
            .GetAwaiter()
            .GetResult();
        }
Exemple #6
0
        public void OnWorkflowScriptExecute(Hyland.Unity.Application app, Hyland.Unity.WorkflowEventArgs args)
        {
            var logger = new FileLogger("C:\\Temp\\OnbaseIntegration.log");

            OnbaseSettings onbaseSettings = new OnbaseSettings
            {
                CustomerDocumentType     = "BKO - Cadastro",
                CustomerDocumentFileType = "Unity Form",
                FormIntegrationID        = 117
            };

            CustomerApiSettings apiSettings = new CustomerApiSettings
            {
                BaseUrl              = "https://dev-gapi.simpaul.com.br/",
                IncompletedResource  = "dev/backoffice/client/incomplete",
                ApproveResource      = "dev/backoffice/client/sinacor",
                ReproveResource      = "dev/backoffice/client/{id}/status",
                CustomerResource     = "dev/backoffice/client/onboarding",
                LoginResource        = "dev/backoffice/authentication",
                RegisterAginResource = "dev/backoffice/client/reregister",
                UserLogin            = "******",
                PasswordLogin        = "******"
            };

            try
            {
                var customerRepository = new SimPaulOnbase.Infraestructure.ApiDataAccess.CustomerApiRepository(apiSettings);

                var onbaseConector             = new OnbaseInMemoryConector(app);
                var onbaseCustomerService      = new CustomerTransactionalOnbaseService(onbaseSettings, onbaseConector, logger);
                var customerIntegrationUseCase = new CustomerIncompledIntegrationUseCase(customerRepository, onbaseCustomerService, logger);
                customerIntegrationUseCase.Handle();
            }
            catch (System.Exception ex)
            {
                System.Diagnostics.Debug.Write(ex.ToString());
            }
        }
Exemple #7
0
        public void ExecuteIntegrations()
        {
            var customerRepository = new SimPaulOnbase.Infraestructure.ApiDataAccess.CustomerApiRepository(this.GetApiSettings());

            var customers = customerRepository.GetIncompleted()
                            .GetAwaiter()
                            .GetResult();

            var customersData = customerRepository
                                .GetCustomer()
                                .GetAwaiter()
                                .GetResult();


            var customer = customersData
                           .FirstOrDefault(cm => cm.SinacorAccounts == null || cm.SinacorAccounts.Length == 0);

            var aproveInput = new CustomerApproveInput
            {
                Id  = customer.Id,
                CPF = customer.Cpf
            };

            customerRepository.ApproveRegistration(aproveInput)
            .GetAwaiter()
            .GetResult();

            var reproveInput = new CustomerReproveInput
            {
                Id     = customer.Id,
                Status = "REPROVADO"
            };

            customerRepository.ReproveRegistration(reproveInput)
            .GetAwaiter()
            .GetResult();
        }
Exemple #8
0
        public void Approve()
        {
            CustomerApiSettings apiSettings = new CustomerApiSettings
            {
                BaseUrl              = "https://dev-gapi.simpaul.com.br/",
                IncompletedResource  = "dev/backoffice/client/incomplete",
                ApproveResource      = "dev/backoffice/client/sinacor",
                ReproveResource      = "dev/backoffice/client/{id}/status",
                CustomerResource     = "dev/backoffice/client/onboarding",
                LoginResource        = "dev/backoffice/authentication",
                SuitabilityResource  = "dev/backoffice/client/{id}/suitability",
                RegisterAginResource = "dev/backoffice/client/reregister",
                UserLogin            = "******",
                PasswordLogin        = "******"
            };


            var customerRepository = new SimPaulOnbase.Infraestructure.ApiDataAccess.CustomerApiRepository(apiSettings);

            var output = customerRepository
                         .GetCustomer("44433322288")
                         .GetAwaiter()
                         .GetResult();

            var customer = output.FirstOrDefault();

            var aproveInput = new CustomerApproveInput
            {
                Id  = customer.Id,
                CPF = customer.Cpf
            };

            customerRepository.ApproveRegistration(aproveInput)
            .GetAwaiter()
            .GetResult();
        }