package com.creatubbles.api.model.user;

import android.support.annotation.NonNull;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.jasminb.jsonapi.annotations.Id;
import com.github.jasminb.jsonapi.annotations.Type;
import com.github.jasminb.jsonapi.models.EmptyRelationship;

@Type("user")
public class NewUser extends EmptyRelationship {

    @Id
    private String id; // this is unused field required by jsonapi-converter

    private String name;

    @JsonProperty("display_name")
    private String displayName;

    @JsonProperty("birth_year")
    private Integer birthYear;

    @JsonProperty("birth_month")
    private Integer birthMonth;

    private String country;

    @SuppressWarnings("WeakerAccess")
    NewUser(Builder builder) {
        this.name = builder.name;
        this.displayName = builder.displayName;
        this.birthMonth = builder.birthMonth;
        this.birthYear = builder.birthYear;
        this.country = builder.country;
    }

    public static class Builder {

        final String name;
        String displayName;
        Integer birthYear;
        Integer birthMonth;
        String country;

        public Builder(@NonNull String name) {
            this.name = name;
        }

        @NonNull
        public Builder displayName(@NonNull String displayName) {
            this.displayName = displayName;
            return this;
        }

        @NonNull
        public Builder birthYear(int birthYear) {
            this.birthYear = birthYear;
            return this;
        }

        @NonNull
        public Builder birthMonth(int birthMonth) {
            this.birthMonth = birthMonth;
            return this;
        }

        @NonNull
        public Builder country(String country) {
            this.country = country;
            return this;
        }

        @NonNull
        public NewUser build() {
            return new NewUser(this);
        }
    }

    public String getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getDisplayName() {
        return displayName;
    }

    public Integer getBirthYear() {
        return birthYear;
    }

    public Integer getBirthMonth() {
        return birthMonth;
    }

    public String getCountry() {
        return country;
    }

    @Override
    public String toString() {
        return "NewUser{" +
                "name='" + name + '\'' +
                ", displayName='" + displayName + '\'' +
                ", birthYear=" + birthYear +
                ", birthMonth=" + birthMonth +
                ", country='" + country + '\'' +
                '}';
    }
}

@@ -295,16 +295,40 @@
 nship;%0A%0A
+import java.util.List;%0A%0A
 @Type(%22u
@@ -717,24 +717,179 @@
 g country;%0A%0A
+    @JsonProperty(%22personalized_avatar_source_url%22)%0A    private String avatarUrl;%0A%0A    @JsonProperty(%22interest_list%22)%0A    private List%3CString%3E interests;%0A%0A
     @Suppres
@@ -1149,32 +1149,120 @@
 uilder.country;%0A
+        this.avatarUrl = builder.avatarUrl;%0A        this.interests = builder.interests;%0A
     %7D%0A%0A    publi
@@ -1416,24 +1416,82 @@
 ing country;
+%0A        String avatarUrl;%0A        List%3CString%3E interests;
 %0A%0A        pu
@@ -2151,32 +2151,333 @@
 his;%0A        %7D%0A%0A
+        @NonNull%0A        public Builder avatarUrl(String avatarUrl) %7B%0A            this.avatarUrl = avatarUrl;%0A            return this;%0A        %7D%0A%0A        @NonNull%0A        public Builder setInterests(List%3CString%3E interests) %7B%0A            this.interests = interests;%0A            return this;%0A        %7D%0A%0A
         @NonNull
@@ -2918,24 +2918,24 @@
 Country() %7B%0A
-
         retu
@@ -2949,24 +2949,166 @@
 try;%0A    %7D%0A%0A
+    public List%3CString%3E getInterests() %7B%0A        return interests;%0A    %7D%0A%0A    public String getAvatarUrl() %7B%0A        return avatarUrl;%0A    %7D%0A%0A
     @Overrid

Add new fields to new user model