Subversion Repositories SmartDukaan

Rev

Rev 35463 | Rev 35961 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
22653 ashik.ali 1
package com.spice.profitmandi.dao.entity.fofo;
22418 ashik.ali 2
 
35323 amit 3
import com.fasterxml.jackson.annotation.JsonIgnore;
30046 tejbeer 4
import com.spice.profitmandi.common.enumuration.ActivationType;
29936 amit.gupta 5
import com.spice.profitmandi.common.enumuration.CounterSize;
6
import com.spice.profitmandi.common.enumuration.FofoType;
35323 amit 7
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
29936 amit.gupta 8
import com.spice.profitmandi.dao.entity.user.Address;
9
 
10
import javax.persistence.*;
22418 ashik.ali 11
import java.io.Serializable;
24349 amit.gupta 12
import java.time.LocalDate;
28166 tejbeer 13
import java.time.LocalDateTime;
35079 vikas 14
import java.util.Objects;
22418 ashik.ali 15
 
16
/**
17
 * This class basically contains store code details
32615 raveendra. 18
 *
22418 ashik.ali 19
 * @author ashikali
20
 */
21
@Entity
31730 tejbeer 22
@Table(name = "fofo.fofo_store")
27556 tejbeer 23
 
24
@NamedQueries({
25
 
32615 raveendra. 26
        @NamedQuery(name = "FofoStore.selectAllDtrUserIds", query = "select ua.userId from FofoStore fs join UserAccount ua on fs.id=ua.accountKey "
27
                + "where ua.type='saholic' and fs.internal=false and fs.active=true"),
29926 amit.gupta 28
 
32615 raveendra. 29
        @NamedQuery(name = "FofoStore.selectGroupByBrandWarehousePartnerSale", query = "select new com.spice.profitmandi.dao.model.BrandWisePartnerSaleModel(foi.brand, "
35463 amit 30
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then CAST(foi.quantity*foi.mop  AS integer ) else 0 end),"
31
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then foi.quantity  else 0 end),"
32
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then CAST(foi.quantity*foi.mop  AS integer ) else 0 end),"
33
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then foi.quantity else 0 end), "
34
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
35
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then foi.quantity else 0 end))"
32615 raveendra. 36
                + " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId join FofoOrderItem foi on foi.orderId = fo.id  join Item i on i.id = foi.itemId  where fo.cancelledTimestamp is null and fs.active = true "
37
                + "and foi.createTimestamp >= :lmtdStartDate and i.categoryId = :categoryId and fs.id in :fofoId"
38
                + " group by foi.brand"),
35284 aman 39
        @NamedQuery(name = "FofoStore.selectGroupByBrandWarehousePartnerAccessoriesSale", query = "select new com.spice.profitmandi.dao.model.BrandWisePartnerSaleModel(foi.brand, "
35463 amit 40
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then CAST(foi.quantity*foi.mop  AS integer ) else 0 end),"
41
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then foi.quantity  else 0 end),"
42
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then CAST(foi.quantity*foi.mop  AS integer ) else 0 end),"
43
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then foi.quantity else 0 end), "
44
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
45
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then foi.quantity else 0 end))"
35284 aman 46
                + " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId join FofoOrderItem foi on foi.orderId = fo.id  join Item i on i.id = foi.itemId  where fo.cancelledTimestamp is null and fs.active = true "
47
                + "and foi.createTimestamp >= :lmtdStartDate and i.categoryId != :categoryId and fs.id in :fofoId"),
27594 tejbeer 48
 
32615 raveendra. 49
        @NamedQuery(name = "FofoStore.selectGroupByWarehouseBrandWisePartnerSale", query = "select new com.spice.profitmandi.dao.model.WarehouseWiseBrandSaleModel("
50
                + "(case when a.city in ('Noida', 'Ghaziabad')  and foi.brand = 'Vivo' then 7573 else fs.warehouseId end) AS col_0_0_,"
35463 amit 51
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
52
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then foi.quantity  else 0 end),"
53
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
54
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then foi.quantity else 0 end), "
55
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
56
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then foi.quantity else 0 end))"
32615 raveendra. 57
                + " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId join FofoOrderItem foi on foi.orderId = fo.id  join Item i on i.id = foi.itemId"
58
                + " join com.spice.profitmandi.dao.entity.user.User u on u.id = fs.id join Address a on a.id = u.addressId"
59
                + " where fo.cancelledTimestamp is null and fs.active = true"
60
                + " and foi.createTimestamp >= :lmtdStartDate and foi.brand = :brand and i.categoryId = :categoryId and fs.id in :fofoId"
61
                + " group by col_0_0_"),
27556 tejbeer 62
 
32615 raveendra. 63
        @NamedQuery(name = "FofoStore.selectWarehouseBrandItemSale", query = "select new com.spice.profitmandi.dao.model.WarehouseBrandWiseItemSaleModel(fs.warehouseId,i.id, i.brand, i.modelName, i.modelNumber,i.color,"
35463 amit 64
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
65
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then foi.quantity  else 0 end),"
66
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
67
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then foi.quantity else 0 end), "
68
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
69
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then foi.quantity else 0 end))"
32615 raveendra. 70
                + " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId join FofoOrderItem foi on foi.orderId = fo.id  join Item i on i.id = foi.itemId  where fo.cancelledTimestamp is null and fs.active = true"
71
                + " and  foi.createTimestamp >= :lmtdStartDate and fs.warehouseId in :warehouseId and i.brand = :brand and i.categoryId = :categoryId and fs.id in :fofoId group by i.id"),
27594 tejbeer 72
 
32615 raveendra. 73
        @NamedQuery(name = "FofoStore.selectGroupByBrandAccesoriesWarehousePartnerSale", query = "select new com.spice.profitmandi.dao.model.BrandWisePartnerSaleModel(foi.brand, "
35463 amit 74
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
75
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then foi.quantity  else 0 end),"
76
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
77
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then foi.quantity else 0 end), "
78
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
79
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then foi.quantity else 0 end))"
32615 raveendra. 80
                + " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId join FofoOrderItem foi on foi.orderId = fo.id  join Item i on i.id = foi.itemId  where fo.cancelledTimestamp is null and fs.active = true "
81
                + "and foi.createTimestamp >= :lmtdStartDate and i.categoryId != :categoryId and fs.id in :fofoId"
82
                + " group by foi.brand"),
27556 tejbeer 83
 
32615 raveendra. 84
        @NamedQuery(name = "FofoStore.selectGroupByWarehouseAccesoriesBrandWisePartnerSale", query = "select new com.spice.profitmandi.dao.model.WarehouseWiseBrandSaleModel(fs.warehouseId,"
35463 amit 85
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
86
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then foi.quantity  else 0 end),"
87
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
88
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then foi.quantity else 0 end), "
89
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
90
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then foi.quantity else 0 end))"
32615 raveendra. 91
                + " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId join FofoOrderItem foi on foi.orderId = fo.id  join Item i on i.id = foi.itemId  where fo.cancelledTimestamp is null and fs.active = true"
92
                + " and foi.createTimestamp >= :lmtdStartDate and foi.brand = :brand and i.categoryId != :categoryId and fs.id in :fofoId"
93
                + " group by fs.warehouseId"),
27592 tejbeer 94
 
32615 raveendra. 95
        @NamedQuery(name = "FofoStore.selectWarehouseAccesoriesBrandItemSale", query = "select new com.spice.profitmandi.dao.model.WarehouseBrandWiseItemSaleModel(fs.warehouseId,i.id, i.brand, i.modelName, i.modelNumber,i.color,"
35463 amit 96
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
97
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then foi.quantity  else 0 end),"
98
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
99
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then foi.quantity else 0 end), "
100
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
101
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then foi.quantity else 0 end))"
32615 raveendra. 102
                + " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId join FofoOrderItem foi on foi.orderId = fo.id  join Item i on i.id = foi.itemId  where fo.cancelledTimestamp is null and fs.active = true"
103
                + " and  foi.createTimestamp >= :lmtdStartDate and fs.warehouseId in :warehouseId and i.brand = :brand and i.categoryId != :categoryId  and fs.id in :fofoId group by i.id"),
27556 tejbeer 104
 
32615 raveendra. 105
        @NamedQuery(name = "FofoStore.selectPartnerPendingIndentItem", query = "select new com.spice.profitmandi.dao.model.PartnerPendingIndentItemModel(o.retailerName,"
106
                + " li.quantity, li.totalPrice)"
107
                + " from FofoStore fs join Order o on fs.id = o.retailerId join  LineItem li on li.orderId = o.id "
108
                + " where li.itemId = :itemId and fs.warehouseId = :warehouseId and o.status = 3"),
27599 tejbeer 109
 
32615 raveendra. 110
        @NamedQuery(name = "FofoStore.selectUnbilledActivateStockGroupByBrand", query = "select new com.spice.profitmandi.dao.model.BrandWiseUnbilledActivateStockModel(i.brand,"
35463 amit 111
                + "  sum(case when ai.activationTimestamp >= :almtdStartDate AND ai.activationTimestamp < :almtdEndDate then 1 else 0 end),"
112
                + "  sum(case when ai.activationTimestamp >= :almtdStartDate AND ai.activationTimestamp < :almtdEndDate then CAST(tl.sellingPrice  AS int) else 0 end))"
32615 raveendra. 113
                + " from FofoStore fs join InventoryItem ii on fs.id = ii.fofoId join ActivatedImei ai on ai.serialNumber = ii.serialNumber join Item i on i.id = ii.itemId join TagListing tl on tl.itemId = i.id"
114
                + " where fs.active = true and ii.goodQuantity >= 1 and fs.id in :fofoId group by i.brand"),
27670 tejbeer 115
 
32615 raveendra. 116
        @NamedQuery(name = "FofoStore.selectUnbilledActivateStockGroupByWarehouse", query = "select new com.spice.profitmandi.dao.model.WarehouseWiseBrandUnbilledActivatedModel(fs.warehouseId,"
35463 amit 117
                + "  sum(case when ai.activationTimestamp >= :almtdStartDate AND ai.activationTimestamp < :almtdEndDate then 1 else 0 end),"
118
                + "  sum(case when ai.activationTimestamp >= :almtdStartDate AND ai.activationTimestamp < :almtdEndDate then CAST(tl.sellingPrice  AS int) else 0 end))"
32615 raveendra. 119
                + " from FofoStore fs join InventoryItem ii on fs.id = ii.fofoId join ActivatedImei ai on ai.serialNumber = ii.serialNumber join Item i on i.id = ii.itemId join TagListing tl on tl.itemId = i.id"
120
                + " where fs.active = true and ii.goodQuantity >= 1 and i.brand = :brand and fs.id in :fofoId group by fs.warehouseId"),
27670 tejbeer 121
 
32615 raveendra. 122
        @NamedQuery(name = "FofoStore.selectWarehouseBrandItemUnbilledActivateStock", query = "select new com.spice.profitmandi.dao.model.WarehouseBrandItemUnbilledActivatedModel(fs.warehouseId,i.id, i.brand, i.modelName, i.modelNumber,i.color,"
35463 amit 123
                + "  sum(case when ai.activationTimestamp >= :almtdStartDate AND ai.activationTimestamp < :almtdEndDate then 1 else 0 end),"
124
                + "  sum(case when ai.activationTimestamp >= :almtdStartDate AND ai.activationTimestamp < :almtdEndDate then CAST(tl.sellingPrice  AS int) else 0 end))"
32615 raveendra. 125
                + " from FofoStore fs join InventoryItem ii on fs.id = ii.fofoId join ActivatedImei ai on ai.serialNumber = ii.serialNumber join Item i on i.id = ii.itemId join TagListing tl on tl.itemId = i.id"
126
                + " where fs.active = true and ii.goodQuantity >= 1 and i.brand = :brand and fs.warehouseId in :warehouseId and fs.id in :fofoId  group by i.id"),
27670 tejbeer 127
 
32615 raveendra. 128
        @NamedQuery(name = "FofoStore.selectGroupByBrandLms", query = "select new com.spice.profitmandi.dao.model.BrandWiseModel(foi.brand, DATE_FORMAT(fo.createTimestamp, :groupParameter),sum(cast(foi.mop*foi.quantity As int)))"
129
                + " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId join FofoOrderItem foi on foi.orderId = fo.id  join Item i on i.id = foi.itemId  where fo.cancelledTimestamp is null and fs.active = true "
130
                + " and (foi.createTimestamp between :lmsStartDate and :endDate) and i.categoryId = :categoryId and fs.id in :fofoId and fs.warehouseId in :warehouseId"
131
                + " group by foi.brand,DATE_FORMAT(fo.createTimestamp, :groupParameter)"),})
27599 tejbeer 132
 
27556 tejbeer 133
public class FofoStore implements Serializable {
134
 
32615 raveendra. 135
    private static final long serialVersionUID = 1L;
136
    @Id
137
    @Column(name = "id", unique = true, updatable = false)
138
    private int id;
139
    private int codeInt;
140
    @Column(name = "code", unique = true)
141
    private String code;
142
    @Column(name = "latitude")
143
    private String latitude;
144
    @Column(name = "longitude")
145
    private String longitude;
146
    @Column(name = "counter_size")
147
    @Enumerated(EnumType.STRING)
148
    private CounterSize counterSize = CounterSize.TEN_LAC;
149
    @Column(name = "counter_potential")
150
    private float counterPotential;
151
    @Column(name = "warehouse_id")
152
    private int warehouseId;
153
    @Column(name = "minimum_investment")
154
    private float minimumInvestment;
155
    @Column(name = "grace_date")
156
    private LocalDate graceDate;
157
    @Column(name = "investment_ok")
158
    private boolean investmentOk;
159
    @Column
160
    private boolean active = true;
161
    @Column
162
    private String pan;
163
    @Transient
164
    private Address userAddress;
165
    @Column(name = "internal")
166
    private boolean internal;
167
    @Column(name = "bags_last_credited")
168
    private LocalDateTime bagsLastCredited;
169
    @Column(name = "fofo_type")
170
    @Enumerated(EnumType.STRING)
171
    private FofoType fofoType;
172
    @Column(name = "activation_type")
173
    @Enumerated(EnumType.STRING)
174
    private ActivationType activationType = ActivationType.BILLING_PENDING;
175
    @Column(name = "active_timestamp")
176
    private LocalDateTime activeTimeStamp;
177
    @Column(name = "target")
178
    private int target;
179
    @Column(name = "grace_count")
180
    private int graceCount;
33124 ranu 181
    @Column(name = "astId")
182
    private int astId;
35297 amit 183
 
35079 vikas 184
    @Column(name = "gst_number")
185
    private String gstNumber;
27556 tejbeer 186
 
35289 amit 187
    @Column(name = "trial")
188
    private boolean trial = false;
189
 
190
    @Column(name = "trial_start")
191
    private LocalDate trialStart;
192
 
193
    @Column(name = "trial_end")
194
    private LocalDate trialEnd;
195
 
32615 raveendra. 196
    public FofoStore() {
197
    }
27556 tejbeer 198
 
33124 ranu 199
    public int getAstId() {
200
        return astId;
201
    }
202
 
203
    public void setAstId(int astId) {
204
        this.astId = astId;
205
    }
206
 
32615 raveendra. 207
    public int getCodeInt() {
208
        return codeInt;
209
    }
27556 tejbeer 210
 
32615 raveendra. 211
    public void setCodeInt(int codeInt) {
212
        this.codeInt = codeInt;
213
    }
27556 tejbeer 214
 
32615 raveendra. 215
    public int getTarget() {
216
        return target;
217
    }
27556 tejbeer 218
 
32615 raveendra. 219
    public void setTarget(int target) {
220
        this.target = target;
221
    }
27556 tejbeer 222
 
32615 raveendra. 223
    public ActivationType getActivationType() {
224
        return activationType;
225
    }
27556 tejbeer 226
 
32615 raveendra. 227
    public void setActivationType(ActivationType activationType) {
228
        this.activationType = activationType;
229
    }
31730 tejbeer 230
 
32615 raveendra. 231
    public float getCounterPotential() {
232
        return counterPotential;
233
    }
27556 tejbeer 234
 
32615 raveendra. 235
    public void setCounterPotential(float counterPotential) {
236
        this.counterPotential = counterPotential;
237
    }
27556 tejbeer 238
 
32615 raveendra. 239
    public LocalDateTime getBagsLastCredited() {
240
        return bagsLastCredited;
241
    }
27556 tejbeer 242
 
32615 raveendra. 243
    public void setBagsLastCredited(LocalDateTime bagsLastCredited) {
244
        this.bagsLastCredited = bagsLastCredited;
245
    }
27556 tejbeer 246
 
32615 raveendra. 247
    public boolean isInternal() {
248
        return internal;
249
    }
27903 tejbeer 250
 
32615 raveendra. 251
    public void setInternal(boolean internal) {
252
        this.internal = internal;
253
    }
29497 amit.gupta 254
 
32615 raveendra. 255
    public int getWarehouseId() {
256
        return warehouseId;
257
    }
30046 tejbeer 258
 
32615 raveendra. 259
    public void setWarehouseId(int warehouseId) {
260
        this.warehouseId = warehouseId;
261
    }
27903 tejbeer 262
 
32615 raveendra. 263
    public boolean isInvestmentOk() {
264
        return investmentOk;
265
    }
28825 tejbeer 266
 
32615 raveendra. 267
    public void setInvestmentOk(boolean investmentOk) {
268
        this.investmentOk = investmentOk;
269
    }
28825 tejbeer 270
 
32615 raveendra. 271
    public String getPan() {
272
        return pan;
273
    }
30046 tejbeer 274
 
32615 raveendra. 275
    public void setPan(String pan) {
276
        this.pan = pan;
277
    }
28166 tejbeer 278
 
32615 raveendra. 279
    public int getGraceCount() {
280
        return graceCount;
281
    }
32308 amit.gupta 282
 
32615 raveendra. 283
    public void setGraceCount(int graceCount) {
284
        this.graceCount = graceCount;
285
    }
32308 amit.gupta 286
 
32615 raveendra. 287
    public boolean isActive() {
288
        return active;
289
    }
32308 amit.gupta 290
 
32615 raveendra. 291
    public void setActive(boolean active) {
292
        this.active = active;
293
    }
30046 tejbeer 294
 
32615 raveendra. 295
    public LocalDate getGraceDate() {
296
        return graceDate;
297
    }
31730 tejbeer 298
 
32615 raveendra. 299
    public void setGraceDate(LocalDate graceDate) {
300
        this.graceDate = graceDate;
301
    }
31730 tejbeer 302
 
32615 raveendra. 303
    public float getMinimumInvestment() {
304
        return minimumInvestment;
305
    }
30046 tejbeer 306
 
32615 raveendra. 307
    public void setMinimumInvestment(float minimumInvestment) {
308
        this.minimumInvestment = minimumInvestment;
309
    }
28166 tejbeer 310
 
32615 raveendra. 311
    /*
312
     * public int getCreditCycle() { return creditCycle; } public void
313
     * setCreditCycle(int creditCycle) { this.creditCycle = creditCycle; }
314
     */
315
    public CounterSize getCounterSize() {
316
        return counterSize;
317
    }
28166 tejbeer 318
 
32615 raveendra. 319
    public void setCounterSize(CounterSize counterSize) {
320
        this.counterSize = counterSize;
321
    }
27903 tejbeer 322
 
32615 raveendra. 323
    public int getId() {
324
        return id;
325
    }
27903 tejbeer 326
 
32615 raveendra. 327
    public void setId(int id) {
328
        this.id = id;
329
    }
27903 tejbeer 330
 
32615 raveendra. 331
    public String getCode() {
332
        return code;
333
    }
27903 tejbeer 334
 
32615 raveendra. 335
    public void setCode(String code) {
336
        this.code = code;
337
    }
27556 tejbeer 338
 
32615 raveendra. 339
    public String getLatitude() {
340
        return latitude;
341
    }
25276 amit.gupta 342
 
32615 raveendra. 343
    public void setLatitude(String latitude) {
344
        this.latitude = latitude;
345
    }
24843 govind 346
 
32615 raveendra. 347
    public String getLongitude() {
348
        return longitude;
349
    }
29497 amit.gupta 350
 
32615 raveendra. 351
    public void setLongitude(String longitude) {
352
        this.longitude = longitude;
353
    }
29497 amit.gupta 354
 
32615 raveendra. 355
    public Address getUserAddress() {
356
        return userAddress;
357
    }
27556 tejbeer 358
 
32615 raveendra. 359
    public void setUserAddress(Address userAddress) {
360
        this.userAddress = userAddress;
361
    }
27556 tejbeer 362
 
32615 raveendra. 363
    public LocalDateTime getActiveTimeStamp() {
364
        return activeTimeStamp;
365
    }
27556 tejbeer 366
 
32615 raveendra. 367
    public void setActiveTimeStamp(LocalDateTime activeTimeStamp) {
368
        this.activeTimeStamp = activeTimeStamp;
369
    }
27556 tejbeer 370
 
32615 raveendra. 371
    public FofoType getFofoType() {
372
        return fofoType;
373
    }
27556 tejbeer 374
 
32615 raveendra. 375
    public void setFofoType(FofoType fofoType) {
376
        this.fofoType = fofoType;
377
    }
27556 tejbeer 378
 
35079 vikas 379
    public String getGstNumber() {
380
        return gstNumber;
381
    }
382
 
383
    public void setGstNumber(String gstNumber) {
384
        this.gstNumber = gstNumber;
385
    }
386
 
35289 amit 387
    public boolean isTrial() {
388
        return trial;
389
    }
390
 
391
    public void setTrial(boolean trial) {
392
        this.trial = trial;
393
    }
394
 
395
    public LocalDate getTrialStart() {
396
        return trialStart;
397
    }
398
 
399
    public void setTrialStart(LocalDate trialStart) {
400
        this.trialStart = trialStart;
401
    }
402
 
403
    public LocalDate getTrialEnd() {
404
        return trialEnd;
405
    }
406
 
407
    public void setTrialEnd(LocalDate trialEnd) {
408
        this.trialEnd = trialEnd;
409
    }
410
 
32615 raveendra. 411
    @Override
35079 vikas 412
    public boolean equals(Object o) {
35297 amit 413
        if (o == null || getClass() != o.getClass()) return false;
35079 vikas 414
        FofoStore fofoStore = (FofoStore) o;
35848 amit 415
        return id == fofoStore.id && codeInt == fofoStore.codeInt && Float.compare(counterPotential, fofoStore.counterPotential) == 0 && warehouseId == fofoStore.warehouseId && Float.compare(minimumInvestment, fofoStore.minimumInvestment) == 0 && investmentOk == fofoStore.investmentOk && active == fofoStore.active && internal == fofoStore.internal && target == fofoStore.target && graceCount == fofoStore.graceCount && astId == fofoStore.astId && trial == fofoStore.trial && Objects.equals(code, fofoStore.code) && Objects.equals(latitude, fofoStore.latitude) && Objects.equals(longitude, fofoStore.longitude) && counterSize == fofoStore.counterSize && Objects.equals(graceDate, fofoStore.graceDate) && Objects.equals(pan, fofoStore.pan) && Objects.equals(userAddress, fofoStore.userAddress) && Objects.equals(bagsLastCredited, fofoStore.bagsLastCredited) && fofoType == fofoStore.fofoType && activationType == fofoStore.activationType && Objects.equals(activeTimeStamp, fofoStore.activeTimeStamp) && Objects.equals(gstNumber, fofoStore.gstNumber) && Objects.equals(trialStart, fofoStore.trialStart) && Objects.equals(trialEnd, fofoStore.trialEnd);
32615 raveendra. 416
    }
27556 tejbeer 417
 
32615 raveendra. 418
    @Override
35079 vikas 419
    public int hashCode() {
35848 amit 420
        return Objects.hash(id, codeInt, code, latitude, longitude, counterSize, counterPotential, warehouseId, minimumInvestment, graceDate, investmentOk, active, pan, userAddress, internal, bagsLastCredited, fofoType, activationType, activeTimeStamp, target, graceCount, astId, gstNumber, trial, trialStart, trialEnd);
32615 raveendra. 421
    }
23884 amit.gupta 422
 
32615 raveendra. 423
    @Override
424
    public String toString() {
35079 vikas 425
        return "FofoStore{" +
426
                "id=" + id +
427
                ", codeInt=" + codeInt +
428
                ", code='" + code + '\'' +
429
                ", latitude='" + latitude + '\'' +
430
                ", longitude='" + longitude + '\'' +
431
                ", counterSize=" + counterSize +
432
                ", counterPotential=" + counterPotential +
433
                ", warehouseId=" + warehouseId +
434
                ", minimumInvestment=" + minimumInvestment +
435
                ", graceDate=" + graceDate +
436
                ", investmentOk=" + investmentOk +
437
                ", active=" + active +
438
                ", pan='" + pan + '\'' +
439
                ", userAddress=" + userAddress +
440
                ", internal=" + internal +
441
                ", bagsLastCredited=" + bagsLastCredited +
442
                ", fofoType=" + fofoType +
443
                ", activationType=" + activationType +
444
                ", activeTimeStamp=" + activeTimeStamp +
445
                ", target=" + target +
446
                ", graceCount=" + graceCount +
447
                ", astId=" + astId +
448
                ", gstNumber='" + gstNumber + '\'' +
35297 amit 449
                ", trial=" + trial +
450
                ", trialStart=" + trialStart +
451
                ", trialEnd=" + trialEnd +
35079 vikas 452
                '}';
32615 raveendra. 453
    }
35297 amit 454
 
35323 amit 455
    @JsonIgnore
456
    public boolean isExpired() throws ProfitMandiBusinessException{
457
        if(isTrial()) return LocalDate.now().isAfter(trialEnd);
458
        else throw new ProfitMandiBusinessException("Not a trial user", "Not a trial user", "Not a trial user");
35297 amit 459
    }
22418 ashik.ali 460
}