Subversion Repositories SmartDukaan

Rev

Rev 32417 | Rev 32445 | Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.spice.profitmandi.dao.model;

import com.spice.profitmandi.dao.enumuration.fofo.Milestone;

import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
import java.util.Objects;

public class PartnerMonthlySaleModel {

        private int fofoId;
        private String yearMonth;
        private long amount;
        private static final DateTimeFormatter yearMonthFormatter = DateTimeFormatter.ofPattern("MM-yyyy");
        private long pendingAmount;
        private Milestone billedMilestone;
        private String state;
        private String rbms;

        public PartnerMonthlySaleModel(int fofoId, String yearMonth, long amount) {
                super();
                this.fofoId = fofoId;
                this.yearMonth = yearMonth;
                this.amount = amount;
        }

    public YearMonth getYearMonthObj() {
        return YearMonth.parse(this.yearMonth, yearMonthFormatter);
    }

        public void setYearMonthObj(YearMonth yearMonth) {
                this.yearMonth = yearMonthFormatter.format(yearMonth);
        }

        public int getFofoId() {
                return fofoId;
        }

        public void setFofoId(int fofoId) {
                this.fofoId = fofoId;
        }

        public String getYearMonth() {
                return yearMonth;
        }

        public void setYearMonth(String yearMonth) {
                this.yearMonth = yearMonth;
        }

        public long getAmount() {
                return amount;
        }

        public void setAmount(long amount) {
                this.amount = amount;
        }

        public long getPendingAmount() {
                return pendingAmount;
        }

        public void setPendingAmount(long pendingAmount) {
                this.pendingAmount = pendingAmount;
        }

        public String getRbms() {
                return rbms;
        }

        public void setRbms(String rbms) {
                this.rbms = rbms;
        }

        @Override
        public boolean equals(Object o) {
                if (this == o) return true;
                if (o == null || getClass() != o.getClass()) return false;
                PartnerMonthlySaleModel that = (PartnerMonthlySaleModel) o;
                return fofoId == that.fofoId && amount == that.amount && pendingAmount == that.pendingAmount && Objects.equals(yearMonth, that.yearMonth) && billedMilestone == that.billedMilestone && Objects.equals(state, that.state) && Objects.equals(rbms, that.rbms);
        }

        @Override
        public int hashCode() {
                return Objects.hash(fofoId, yearMonth, amount, pendingAmount, billedMilestone, state, rbms);
        }

        public Milestone getBilledMilestone() {
                return billedMilestone;
        }

        public void setBilledMilestone(Milestone billedMilestone) {
                this.billedMilestone = billedMilestone;
        }

        public String getState() {
                return state;
        }

        public void setState(String state) {
                this.state = state;
        }

        @Override
        public String toString() {
                return "PartnerMonthlySaleModel{" +
                                "fofoId=" + fofoId +
                                ", yearMonth='" + yearMonth + '\'' +
                                ", amount=" + amount +
                                ", pendingAmount=" + pendingAmount +
                                ", billedMilestone=" + billedMilestone +
                                ", state='" + state + '\'' +
                                '}';
        }
}