Subversion Repositories SmartDukaan

Rev

Rev 35848 | Rev 36242 | 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
 
35961 amit 187
    @Column(name = "closed")
188
    private boolean closed = false;
189
 
190
    @Column(name = "closed_timestamp")
191
    private LocalDateTime closedTimestamp;
192
 
35289 amit 193
    @Column(name = "trial")
194
    private boolean trial = false;
195
 
196
    @Column(name = "trial_start")
197
    private LocalDate trialStart;
198
 
199
    @Column(name = "trial_end")
200
    private LocalDate trialEnd;
201
 
32615 raveendra. 202
    public FofoStore() {
203
    }
27556 tejbeer 204
 
33124 ranu 205
    public int getAstId() {
206
        return astId;
207
    }
208
 
209
    public void setAstId(int astId) {
210
        this.astId = astId;
211
    }
212
 
32615 raveendra. 213
    public int getCodeInt() {
214
        return codeInt;
215
    }
27556 tejbeer 216
 
32615 raveendra. 217
    public void setCodeInt(int codeInt) {
218
        this.codeInt = codeInt;
219
    }
27556 tejbeer 220
 
32615 raveendra. 221
    public int getTarget() {
222
        return target;
223
    }
27556 tejbeer 224
 
32615 raveendra. 225
    public void setTarget(int target) {
226
        this.target = target;
227
    }
27556 tejbeer 228
 
32615 raveendra. 229
    public ActivationType getActivationType() {
230
        return activationType;
231
    }
27556 tejbeer 232
 
32615 raveendra. 233
    public void setActivationType(ActivationType activationType) {
234
        this.activationType = activationType;
235
    }
31730 tejbeer 236
 
32615 raveendra. 237
    public float getCounterPotential() {
238
        return counterPotential;
239
    }
27556 tejbeer 240
 
32615 raveendra. 241
    public void setCounterPotential(float counterPotential) {
242
        this.counterPotential = counterPotential;
243
    }
27556 tejbeer 244
 
32615 raveendra. 245
    public LocalDateTime getBagsLastCredited() {
246
        return bagsLastCredited;
247
    }
27556 tejbeer 248
 
32615 raveendra. 249
    public void setBagsLastCredited(LocalDateTime bagsLastCredited) {
250
        this.bagsLastCredited = bagsLastCredited;
251
    }
27556 tejbeer 252
 
32615 raveendra. 253
    public boolean isInternal() {
254
        return internal;
255
    }
27903 tejbeer 256
 
32615 raveendra. 257
    public void setInternal(boolean internal) {
258
        this.internal = internal;
259
    }
29497 amit.gupta 260
 
32615 raveendra. 261
    public int getWarehouseId() {
262
        return warehouseId;
263
    }
30046 tejbeer 264
 
32615 raveendra. 265
    public void setWarehouseId(int warehouseId) {
266
        this.warehouseId = warehouseId;
267
    }
27903 tejbeer 268
 
32615 raveendra. 269
    public boolean isInvestmentOk() {
270
        return investmentOk;
271
    }
28825 tejbeer 272
 
32615 raveendra. 273
    public void setInvestmentOk(boolean investmentOk) {
274
        this.investmentOk = investmentOk;
275
    }
28825 tejbeer 276
 
32615 raveendra. 277
    public String getPan() {
278
        return pan;
279
    }
30046 tejbeer 280
 
32615 raveendra. 281
    public void setPan(String pan) {
282
        this.pan = pan;
283
    }
28166 tejbeer 284
 
32615 raveendra. 285
    public int getGraceCount() {
286
        return graceCount;
287
    }
32308 amit.gupta 288
 
32615 raveendra. 289
    public void setGraceCount(int graceCount) {
290
        this.graceCount = graceCount;
291
    }
32308 amit.gupta 292
 
32615 raveendra. 293
    public boolean isActive() {
294
        return active;
295
    }
32308 amit.gupta 296
 
32615 raveendra. 297
    public void setActive(boolean active) {
298
        this.active = active;
299
    }
30046 tejbeer 300
 
32615 raveendra. 301
    public LocalDate getGraceDate() {
302
        return graceDate;
303
    }
31730 tejbeer 304
 
32615 raveendra. 305
    public void setGraceDate(LocalDate graceDate) {
306
        this.graceDate = graceDate;
307
    }
31730 tejbeer 308
 
32615 raveendra. 309
    public float getMinimumInvestment() {
310
        return minimumInvestment;
311
    }
30046 tejbeer 312
 
32615 raveendra. 313
    public void setMinimumInvestment(float minimumInvestment) {
314
        this.minimumInvestment = minimumInvestment;
315
    }
28166 tejbeer 316
 
32615 raveendra. 317
    /*
318
     * public int getCreditCycle() { return creditCycle; } public void
319
     * setCreditCycle(int creditCycle) { this.creditCycle = creditCycle; }
320
     */
321
    public CounterSize getCounterSize() {
322
        return counterSize;
323
    }
28166 tejbeer 324
 
32615 raveendra. 325
    public void setCounterSize(CounterSize counterSize) {
326
        this.counterSize = counterSize;
327
    }
27903 tejbeer 328
 
32615 raveendra. 329
    public int getId() {
330
        return id;
331
    }
27903 tejbeer 332
 
32615 raveendra. 333
    public void setId(int id) {
334
        this.id = id;
335
    }
27903 tejbeer 336
 
32615 raveendra. 337
    public String getCode() {
338
        return code;
339
    }
27903 tejbeer 340
 
32615 raveendra. 341
    public void setCode(String code) {
342
        this.code = code;
343
    }
27556 tejbeer 344
 
32615 raveendra. 345
    public String getLatitude() {
346
        return latitude;
347
    }
25276 amit.gupta 348
 
32615 raveendra. 349
    public void setLatitude(String latitude) {
350
        this.latitude = latitude;
351
    }
24843 govind 352
 
32615 raveendra. 353
    public String getLongitude() {
354
        return longitude;
355
    }
29497 amit.gupta 356
 
32615 raveendra. 357
    public void setLongitude(String longitude) {
358
        this.longitude = longitude;
359
    }
29497 amit.gupta 360
 
32615 raveendra. 361
    public Address getUserAddress() {
362
        return userAddress;
363
    }
27556 tejbeer 364
 
32615 raveendra. 365
    public void setUserAddress(Address userAddress) {
366
        this.userAddress = userAddress;
367
    }
27556 tejbeer 368
 
32615 raveendra. 369
    public LocalDateTime getActiveTimeStamp() {
370
        return activeTimeStamp;
371
    }
27556 tejbeer 372
 
32615 raveendra. 373
    public void setActiveTimeStamp(LocalDateTime activeTimeStamp) {
374
        this.activeTimeStamp = activeTimeStamp;
375
    }
27556 tejbeer 376
 
32615 raveendra. 377
    public FofoType getFofoType() {
378
        return fofoType;
379
    }
27556 tejbeer 380
 
32615 raveendra. 381
    public void setFofoType(FofoType fofoType) {
382
        this.fofoType = fofoType;
383
    }
27556 tejbeer 384
 
35079 vikas 385
    public String getGstNumber() {
386
        return gstNumber;
387
    }
388
 
389
    public void setGstNumber(String gstNumber) {
390
        this.gstNumber = gstNumber;
391
    }
392
 
35961 amit 393
    public boolean isClosed() {
394
        return closed;
395
    }
396
 
397
    public void setClosed(boolean closed) {
398
        this.closed = closed;
399
    }
400
 
401
    public LocalDateTime getClosedTimestamp() {
402
        return closedTimestamp;
403
    }
404
 
405
    public void setClosedTimestamp(LocalDateTime closedTimestamp) {
406
        this.closedTimestamp = closedTimestamp;
407
    }
408
 
35289 amit 409
    public boolean isTrial() {
410
        return trial;
411
    }
412
 
413
    public void setTrial(boolean trial) {
414
        this.trial = trial;
415
    }
416
 
417
    public LocalDate getTrialStart() {
418
        return trialStart;
419
    }
420
 
421
    public void setTrialStart(LocalDate trialStart) {
422
        this.trialStart = trialStart;
423
    }
424
 
425
    public LocalDate getTrialEnd() {
426
        return trialEnd;
427
    }
428
 
429
    public void setTrialEnd(LocalDate trialEnd) {
430
        this.trialEnd = trialEnd;
431
    }
432
 
32615 raveendra. 433
    @Override
35079 vikas 434
    public boolean equals(Object o) {
35297 amit 435
        if (o == null || getClass() != o.getClass()) return false;
35079 vikas 436
        FofoStore fofoStore = (FofoStore) o;
35961 amit 437
        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 && closed == fofoStore.closed && 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(closedTimestamp, fofoStore.closedTimestamp) && Objects.equals(trialStart, fofoStore.trialStart) && Objects.equals(trialEnd, fofoStore.trialEnd);
32615 raveendra. 438
    }
27556 tejbeer 439
 
32615 raveendra. 440
    @Override
35079 vikas 441
    public int hashCode() {
35961 amit 442
        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, closed, closedTimestamp, trial, trialStart, trialEnd);
32615 raveendra. 443
    }
23884 amit.gupta 444
 
32615 raveendra. 445
    @Override
446
    public String toString() {
35079 vikas 447
        return "FofoStore{" +
448
                "id=" + id +
449
                ", codeInt=" + codeInt +
450
                ", code='" + code + '\'' +
451
                ", latitude='" + latitude + '\'' +
452
                ", longitude='" + longitude + '\'' +
453
                ", counterSize=" + counterSize +
454
                ", counterPotential=" + counterPotential +
455
                ", warehouseId=" + warehouseId +
456
                ", minimumInvestment=" + minimumInvestment +
457
                ", graceDate=" + graceDate +
458
                ", investmentOk=" + investmentOk +
459
                ", active=" + active +
460
                ", pan='" + pan + '\'' +
461
                ", userAddress=" + userAddress +
462
                ", internal=" + internal +
463
                ", bagsLastCredited=" + bagsLastCredited +
464
                ", fofoType=" + fofoType +
465
                ", activationType=" + activationType +
466
                ", activeTimeStamp=" + activeTimeStamp +
467
                ", target=" + target +
468
                ", graceCount=" + graceCount +
469
                ", astId=" + astId +
470
                ", gstNumber='" + gstNumber + '\'' +
35961 amit 471
                ", closed=" + closed +
472
                ", closedTimestamp=" + closedTimestamp +
35297 amit 473
                ", trial=" + trial +
474
                ", trialStart=" + trialStart +
475
                ", trialEnd=" + trialEnd +
35079 vikas 476
                '}';
32615 raveendra. 477
    }
35297 amit 478
 
35323 amit 479
    @JsonIgnore
480
    public boolean isExpired() throws ProfitMandiBusinessException{
481
        if(isTrial()) return LocalDate.now().isAfter(trialEnd);
482
        else throw new ProfitMandiBusinessException("Not a trial user", "Not a trial user", "Not a trial user");
35297 amit 483
    }
22418 ashik.ali 484
}