// Path: src/main/java/io/pivotal/web/domain/RegistrationRequest.java
// @Data
// public class RegistrationRequest {
// 
//     @NotNull
//     @NotEmpty
//     private String givenNames;
// 
//     private String surname;
// 
//     @NotNull
//     @NotEmpty
//     @Email
//     private String email;
// 
//     @NotEmpty
//     @NotNull
//     //TODO - more complex validation on password
//     private String password;
// 
//     @NotEmpty
//     @NotNull
//     //TODO - more complex validation on password
//     private String confirmPassword;
// }
// 
// Path: src/main/java/io/pivotal/web/domain/User.java
// @Data
// public class User implements Serializable {
// 
//     private String id;
//     private String email;
//     private String givenNames;
//     private String surname;
//     private DateTime createdDate;
//     private String jwt;
// }


import com.newrelic.api.agent.Trace;
import io.pivotal.web.domain.RegistrationRequest;
import io.pivotal.web.domain.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.http.MediaType;
import org.springframework.security.oauth2.client.OAuth2AuthorizedClient;
import org.springframework.security.oauth2.core.oidc.user.DefaultOidcUser;
import org.springframework.security.oauth2.core.oidc.user.OidcUser;
import org.springframework.security.oauth2.core.user.OAuth2User;
import org.springframework.stereotype.Service;
import org.springframework.web.reactive.function.client.WebClient;
import static org.springframework.security.oauth2.client.web.reactive.function.client.ServletOAuth2AuthorizedClientExchangeFilterFunction.oauth2AuthorizedClient;
package io.pivotal.web.service;



@Service
@RefreshScope
@Slf4j
public class UserService {

    @Autowired(required = false)
    private WebClient webClient;

    @Value("${pivotal.userService.name}")
    private String userService;


    @Trace(async = true)
// Path: src/main/java/io/pivotal/web/domain/RegistrationRequest.java
// @Data
// public class RegistrationRequest {
// 
//     @NotNull
//     @NotEmpty
//     private String givenNames;
// 
//     private String surname;
// 
//     @NotNull
//     @NotEmpty
//     @Email
//     private String email;
// 
//     @NotEmpty
//     @NotNull
//     //TODO - more complex validation on password
//     private String password;
// 
//     @NotEmpty
//     @NotNull
//     //TODO - more complex validation on password
//     private String confirmPassword;
// }
// 
// Path: src/main/java/io/pivotal/web/domain/User.java
// @Data
// public class User implements Serializable {
// 
//     private String id;
//     private String email;
//     private String givenNames;
//     private String surname;
//     private DateTime createdDate;
//     private String jwt;
// }


// Path: src/main/java/io/pivotal/web/service/UserService.java
import com.newrelic.api.agent.Trace;
import io.pivotal.web.domain.RegistrationRequest;
import io.pivotal.web.domain.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.http.MediaType;
import org.springframework.security.oauth2.client.OAuth2AuthorizedClient;
import org.springframework.security.oauth2.core.oidc.user.DefaultOidcUser;
import org.springframework.security.oauth2.core.oidc.user.OidcUser;
import org.springframework.security.oauth2.core.user.OAuth2User;
import org.springframework.stereotype.Service;
import org.springframework.web.reactive.function.client.WebClient;
import static org.springframework.security.oauth2.client.web.reactive.function.client.ServletOAuth2AuthorizedClientExchangeFilterFunction.oauth2AuthorizedClient;

package io.pivotal.web.service;



@Service
@RefreshScope
@Slf4j
public class UserService {

    @Autowired(required = false)
    private WebClient webClient;

    @Value("${pivotal.userService.name}")
    private String userService;


    @Trace(async = true)
    public void registerUser(RegistrationRequest registrationRequest) {