Removing null constraint on affiliate id on application to get by registration and exposing a refresh affiliate function when application is submitted