Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

package com.spice.profitmandi.web.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;

/**
 * Matches the JSON produced by emi_world_scraper.py --json.
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class EmiOfferImportDTO {

    @JsonProperty("generated_at")
    private String generatedAt;
    @JsonProperty("product_count")
    private int productCount;
    @JsonProperty("offer_row_count")
    private int offerRowCount;
    private List<Product> products;

    public String getGeneratedAt() {
        return generatedAt;
    }

    public void setGeneratedAt(String generatedAt) {
        this.generatedAt = generatedAt;
    }

    public int getProductCount() {
        return productCount;
    }

    public void setProductCount(int productCount) {
        this.productCount = productCount;
    }

    public int getOfferRowCount() {
        return offerRowCount;
    }

    public void setOfferRowCount(int offerRowCount) {
        this.offerRowCount = offerRowCount;
    }

    public List<Product> getProducts() {
        return products;
    }

    public void setProducts(List<Product> products) {
        this.products = products;
    }

    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class Product {
        private String brand;
        @JsonProperty("brand_tag")
        private String brandTag;
        @JsonProperty("product_name")
        private String productName;
        private String sku;
        private String price;
        @JsonProperty("card_types")
        private List<CardType> cardTypes;

        public String getBrand() {
            return brand;
        }

        public void setBrand(String brand) {
            this.brand = brand;
        }

        public String getBrandTag() {
            return brandTag;
        }

        public void setBrandTag(String brandTag) {
            this.brandTag = brandTag;
        }

        public String getProductName() {
            return productName;
        }

        public void setProductName(String productName) {
            this.productName = productName;
        }

        public String getSku() {
            return sku;
        }

        public void setSku(String sku) {
            this.sku = sku;
        }

        public String getPrice() {
            return price;
        }

        public void setPrice(String price) {
            this.price = price;
        }

        public List<CardType> getCardTypes() {
            return cardTypes;
        }

        public void setCardTypes(List<CardType> cardTypes) {
            this.cardTypes = cardTypes;
        }
    }

    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class CardType {
        @JsonProperty("card_type")
        private String cardType;
        private List<Bank> banks;

        public String getCardType() {
            return cardType;
        }

        public void setCardType(String cardType) {
            this.cardType = cardType;
        }

        public List<Bank> getBanks() {
            return banks;
        }

        public void setBanks(List<Bank> banks) {
            this.banks = banks;
        }
    }

    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class Bank {
        @JsonProperty("bank_name")
        private String bankName;
        private List<Plan> plans;

        public String getBankName() {
            return bankName;
        }

        public void setBankName(String bankName) {
            this.bankName = bankName;
        }

        public List<Plan> getPlans() {
            return plans;
        }

        public void setPlans(List<Plan> plans) {
            this.plans = plans;
        }
    }

    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class Plan {
        private String tenure;
        @JsonProperty("emi_amount")
        private String emiAmount;
        @JsonProperty("offer_type")
        private String offerType;
        @JsonProperty("total_cost")
        private String totalCost;
        @JsonProperty("interest_rate")
        private String interestRate;
        @JsonProperty("interest_amount")
        private String interestAmount;
        private String discount;
        private String raw;

        public String getTenure() {
            return tenure;
        }

        public void setTenure(String tenure) {
            this.tenure = tenure;
        }

        public String getEmiAmount() {
            return emiAmount;
        }

        public void setEmiAmount(String emiAmount) {
            this.emiAmount = emiAmount;
        }

        public String getOfferType() {
            return offerType;
        }

        public void setOfferType(String offerType) {
            this.offerType = offerType;
        }

        public String getTotalCost() {
            return totalCost;
        }

        public void setTotalCost(String totalCost) {
            this.totalCost = totalCost;
        }

        public String getInterestRate() {
            return interestRate;
        }

        public void setInterestRate(String interestRate) {
            this.interestRate = interestRate;
        }

        public String getInterestAmount() {
            return interestAmount;
        }

        public void setInterestAmount(String interestAmount) {
            this.interestAmount = interestAmount;
        }

        public String getDiscount() {
            return discount;
        }

        public void setDiscount(String discount) {
            this.discount = discount;
        }

        public String getRaw() {
            return raw;
        }

        public void setRaw(String raw) {
            this.raw = raw;
        }
    }
}