package net.somethingdreadful.MAL.api.MALModels.AnimeManga;

import net.somethingdreadful.MAL.api.BaseModels.Profile;

import java.io.Serializable;
import java.util.ArrayList;

import lombok.Getter;
import lombok.Setter;

public class Reviews implements Serializable {

    /**
     * The creation date of the review
     */
    @Setter
    @Getter
    private String date;

    /**
     * The rating given by the user
     */
    @Setter
    @Getter
    private int rating;

    /**
     * The username of the review creator
     */
    @Setter
    @Getter
    private String username;

    /**
     * The the number of the max episodes
     */
    @Setter
    @Getter
    private int episodes;

    /**
     * The number of watched episodes of the review creator
     */
    @Setter
    @Getter
    private int watchedEpisodes;

    /**
     * The number of the max chapters
     */
    @Setter
    @Getter
    private int chapters;

    /**
     * The number of read chapters of the review creator
     */
    @Setter
    @Getter
    private int chaptersRead;

    /**
     * The number of users who marked this review helpful
     */
    @Setter
    @Getter
    private int helpful;

    /**
     * The number of users who voted for helpful & not helpful
     */
    @Setter
    @Getter
    private int helpfulTotal;

    /**
     * The avatar URL of the review creator
     */
    @Setter
    @Getter
    private String avatarUrl;

    /**
     * The review content
     */
    @Setter
    @Getter
    private String review;

    public net.somethingdreadful.MAL.api.BaseModels.AnimeManga.Reviews createBaseModel() {
        net.somethingdreadful.MAL.api.BaseModels.AnimeManga.Reviews model = new net.somethingdreadful.MAL.api.BaseModels.AnimeManga.Reviews();
        model.setDate(getDate());
        model.setRating(getRating());
        Profile profile =  new Profile();
        profile.setUsername(getUsername());
        profile.setImageUrl(getAvatarUrl());
        model.setUser(profile);
        return model;
    }

    public static ArrayList<net.somethingdreadful.MAL.api.BaseModels.AnimeManga.Reviews> convertBaseArray(ArrayList<Reviews> MALArray){
        ArrayList<net.somethingdreadful.MAL.api.BaseModels.AnimeManga.Reviews> base = new ArrayList<>();
        for (Reviews reviews: MALArray) {
            base.add(reviews.createBaseModel());
        }
        return base;
    }
}

@@ -54,16 +54,68 @@
 Manga;%0A%0A
+import com.google.gson.annotations.SerializedName;%0A%0A
 import n
@@ -163,16 +163,16 @@
 rofile;%0A
-
 %0Aimport 
@@ -834,32 +834,72 @@
 ter%0A    @Getter%0A
+    @SerializedName(%22watched_episodes%22)%0A
     private int 
@@ -1110,32 +1110,69 @@
 ter%0A    @Getter%0A
+    @SerializedName(%22chapters_read%22)%0A
     private int 
@@ -1405,32 +1405,69 @@
 ter%0A    @Getter%0A
+    @SerializedName(%22helpful_total%22)%0A
     private int 
@@ -1557,32 +1557,66 @@
 ter%0A    @Getter%0A
+    @SerializedName(%22avatar_url%22)%0A
     private Stri
@@ -2026,24 +2026,62 @@
 tRating());%0A
+        model.setReview(getReview());%0A
         Prof
@@ -2150,24 +2150,24 @@
 sername());%0A
-
         prof
@@ -2196,16 +2196,93 @@
 tarUrl()
+ == null ? %22http://cdn.myanimelist.net/images/na_series.gif%22 : getAvatarUrl()
 );%0A     

Fix reviews caused by incompatible field names