Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

package com.spice.profitmandi.service.inventory;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * Consumer-facing EMI payload attached to {@link FofoCatalogResponse}.
 * <p>
 * Shape mirrors the Pine Labs scraper JSON so the front-end can render the
 * same tabs → banks → plans accordion we already built on the admin side.
 */
public class EmiOffersView implements Serializable {

    private static final long serialVersionUID = 1L;

    private String pineSku;
    private String brand;
    private String productName;
    private String priceDisplay;
    private BigDecimal priceRupees;
    private LocalDateTime scrapedAt;
    private List<CardTypeView> cardTypes = new ArrayList<>();

    public String getPineSku() {
        return pineSku;
    }

    public void setPineSku(String pineSku) {
        this.pineSku = pineSku;
    }

    public String getBrand() {
        return brand;
    }

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

    public String getProductName() {
        return productName;
    }

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

    public String getPriceDisplay() {
        return priceDisplay;
    }

    public void setPriceDisplay(String priceDisplay) {
        this.priceDisplay = priceDisplay;
    }

    public BigDecimal getPriceRupees() {
        return priceRupees;
    }

    public void setPriceRupees(BigDecimal priceRupees) {
        this.priceRupees = priceRupees;
    }

    public LocalDateTime getScrapedAt() {
        return scrapedAt;
    }

    public void setScrapedAt(LocalDateTime scrapedAt) {
        this.scrapedAt = scrapedAt;
    }

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

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

    public static class CardTypeView implements Serializable {
        private static final long serialVersionUID = 1L;
        private String cardType;
        private List<BankView> banks = new ArrayList<>();

        public String getCardType() {
            return cardType;
        }

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

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

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

    public static class BankView implements Serializable {
        private static final long serialVersionUID = 1L;
        private String bankName;
        private String dominantOffer;
        private int planCount;
        private List<PlanView> plans = new ArrayList<>();

        public String getBankName() {
            return bankName;
        }

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

        public String getDominantOffer() {
            return dominantOffer;
        }

        public void setDominantOffer(String dominantOffer) {
            this.dominantOffer = dominantOffer;
        }

        public int getPlanCount() {
            return planCount;
        }

        public void setPlanCount(int planCount) {
            this.planCount = planCount;
        }

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

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

    public static class PlanView implements Serializable {
        private static final long serialVersionUID = 1L;
        private String tenureLabel;
        private Integer tenureMonths;
        private BigDecimal emiAmountRupees;
        private String offerType;
        private BigDecimal totalCostRupees;
        private BigDecimal interestRatePct;
        private BigDecimal interestRupees;
        private BigDecimal discountRupees;

        public String getTenureLabel() {
            return tenureLabel;
        }

        public void setTenureLabel(String tenureLabel) {
            this.tenureLabel = tenureLabel;
        }

        public Integer getTenureMonths() {
            return tenureMonths;
        }

        public void setTenureMonths(Integer tenureMonths) {
            this.tenureMonths = tenureMonths;
        }

        public BigDecimal getEmiAmountRupees() {
            return emiAmountRupees;
        }

        public void setEmiAmountRupees(BigDecimal emiAmountRupees) {
            this.emiAmountRupees = emiAmountRupees;
        }

        public String getOfferType() {
            return offerType;
        }

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

        public BigDecimal getTotalCostRupees() {
            return totalCostRupees;
        }

        public void setTotalCostRupees(BigDecimal totalCostRupees) {
            this.totalCostRupees = totalCostRupees;
        }

        public BigDecimal getInterestRatePct() {
            return interestRatePct;
        }

        public void setInterestRatePct(BigDecimal interestRatePct) {
            this.interestRatePct = interestRatePct;
        }

        public BigDecimal getInterestRupees() {
            return interestRupees;
        }

        public void setInterestRupees(BigDecimal interestRupees) {
            this.interestRupees = interestRupees;
        }

        public BigDecimal getDiscountRupees() {
            return discountRupees;
        }

        public void setDiscountRupees(BigDecimal discountRupees) {
            this.discountRupees = discountRupees;
        }
    }
}