Subversion Repositories SmartDukaan

Rev

Rev 36439 | 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 "
36242 aman 47
                + "and foi.createTimestamp >= :lmtdStartDate and i.categoryId != :categoryId and fs.id in :fofoId"
48
                + " group by foi.brand"),
27594 tejbeer 49
 
32615 raveendra. 50
        @NamedQuery(name = "FofoStore.selectGroupByWarehouseBrandWisePartnerSale", query = "select new com.spice.profitmandi.dao.model.WarehouseWiseBrandSaleModel("
51
                + "(case when a.city in ('Noida', 'Ghaziabad')  and foi.brand = 'Vivo' then 7573 else fs.warehouseId end) AS col_0_0_,"
35463 amit 52
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
53
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then foi.quantity  else 0 end),"
54
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
55
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then foi.quantity else 0 end), "
56
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
57
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then foi.quantity else 0 end))"
32615 raveendra. 58
                + " 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"
59
                + " join com.spice.profitmandi.dao.entity.user.User u on u.id = fs.id join Address a on a.id = u.addressId"
60
                + " where fo.cancelledTimestamp is null and fs.active = true"
61
                + " and foi.createTimestamp >= :lmtdStartDate and foi.brand = :brand and i.categoryId = :categoryId and fs.id in :fofoId"
62
                + " group by col_0_0_"),
27556 tejbeer 63
 
32615 raveendra. 64
        @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 65
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
66
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then foi.quantity  else 0 end),"
67
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
68
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then foi.quantity else 0 end), "
69
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
70
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then foi.quantity else 0 end))"
32615 raveendra. 71
                + " 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"
72
                + " 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 73
 
32615 raveendra. 74
        @NamedQuery(name = "FofoStore.selectGroupByBrandAccesoriesWarehousePartnerSale", query = "select new com.spice.profitmandi.dao.model.BrandWisePartnerSaleModel(foi.brand, "
35463 amit 75
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
76
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then foi.quantity  else 0 end),"
77
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
78
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then foi.quantity else 0 end), "
79
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
80
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then foi.quantity else 0 end))"
32615 raveendra. 81
                + " 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 "
82
                + "and foi.createTimestamp >= :lmtdStartDate and i.categoryId != :categoryId and fs.id in :fofoId"
83
                + " group by foi.brand"),
27556 tejbeer 84
 
32615 raveendra. 85
        @NamedQuery(name = "FofoStore.selectGroupByWarehouseAccesoriesBrandWisePartnerSale", query = "select new com.spice.profitmandi.dao.model.WarehouseWiseBrandSaleModel(fs.warehouseId,"
35463 amit 86
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
87
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then foi.quantity  else 0 end),"
88
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
89
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then foi.quantity else 0 end), "
90
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
91
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then foi.quantity else 0 end))"
32615 raveendra. 92
                + " 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"
93
                + " and foi.createTimestamp >= :lmtdStartDate and foi.brand = :brand and i.categoryId != :categoryId and fs.id in :fofoId"
94
                + " group by fs.warehouseId"),
27592 tejbeer 95
 
32615 raveendra. 96
        @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 97
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
98
                + "sum(case when foi.createTimestamp >= :lmsStartDate AND foi.createTimestamp < :lmsEndDate then foi.quantity  else 0 end),"
99
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
100
                + "sum(case when foi.createTimestamp >= :mtdStartDate AND foi.createTimestamp < :mtdEndDate then foi.quantity else 0 end), "
101
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
102
                + "sum(case when foi.createTimestamp >= :lmtdStartDate AND foi.createTimestamp < :lmtdEndDate then foi.quantity else 0 end))"
32615 raveendra. 103
                + " 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"
104
                + " 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 105
 
32615 raveendra. 106
        @NamedQuery(name = "FofoStore.selectPartnerPendingIndentItem", query = "select new com.spice.profitmandi.dao.model.PartnerPendingIndentItemModel(o.retailerName,"
107
                + " li.quantity, li.totalPrice)"
108
                + " from FofoStore fs join Order o on fs.id = o.retailerId join  LineItem li on li.orderId = o.id "
109
                + " where li.itemId = :itemId and fs.warehouseId = :warehouseId and o.status = 3"),
27599 tejbeer 110
 
32615 raveendra. 111
        @NamedQuery(name = "FofoStore.selectUnbilledActivateStockGroupByBrand", query = "select new com.spice.profitmandi.dao.model.BrandWiseUnbilledActivateStockModel(i.brand,"
35463 amit 112
                + "  sum(case when ai.activationTimestamp >= :almtdStartDate AND ai.activationTimestamp < :almtdEndDate then 1 else 0 end),"
113
                + "  sum(case when ai.activationTimestamp >= :almtdStartDate AND ai.activationTimestamp < :almtdEndDate then CAST(tl.sellingPrice  AS int) else 0 end))"
32615 raveendra. 114
                + " 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"
115
                + " where fs.active = true and ii.goodQuantity >= 1 and fs.id in :fofoId group by i.brand"),
27670 tejbeer 116
 
32615 raveendra. 117
        @NamedQuery(name = "FofoStore.selectUnbilledActivateStockGroupByWarehouse", query = "select new com.spice.profitmandi.dao.model.WarehouseWiseBrandUnbilledActivatedModel(fs.warehouseId,"
35463 amit 118
                + "  sum(case when ai.activationTimestamp >= :almtdStartDate AND ai.activationTimestamp < :almtdEndDate then 1 else 0 end),"
119
                + "  sum(case when ai.activationTimestamp >= :almtdStartDate AND ai.activationTimestamp < :almtdEndDate then CAST(tl.sellingPrice  AS int) else 0 end))"
32615 raveendra. 120
                + " 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"
121
                + " where fs.active = true and ii.goodQuantity >= 1 and i.brand = :brand and fs.id in :fofoId group by fs.warehouseId"),
27670 tejbeer 122
 
32615 raveendra. 123
        @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 124
                + "  sum(case when ai.activationTimestamp >= :almtdStartDate AND ai.activationTimestamp < :almtdEndDate then 1 else 0 end),"
125
                + "  sum(case when ai.activationTimestamp >= :almtdStartDate AND ai.activationTimestamp < :almtdEndDate then CAST(tl.sellingPrice  AS int) else 0 end))"
32615 raveendra. 126
                + " 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"
127
                + " 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 128
 
32615 raveendra. 129
        @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)))"
130
                + " 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 "
131
                + " and (foi.createTimestamp between :lmsStartDate and :endDate) and i.categoryId = :categoryId and fs.id in :fofoId and fs.warehouseId in :warehouseId"
132
                + " group by foi.brand,DATE_FORMAT(fo.createTimestamp, :groupParameter)"),})
27599 tejbeer 133
 
27556 tejbeer 134
public class FofoStore implements Serializable {
135
 
32615 raveendra. 136
    private static final long serialVersionUID = 1L;
137
    @Id
138
    @Column(name = "id", unique = true, updatable = false)
139
    private int id;
140
    private int codeInt;
141
    @Column(name = "code", unique = true)
142
    private String code;
143
    @Column(name = "latitude")
144
    private String latitude;
145
    @Column(name = "longitude")
146
    private String longitude;
36727 ranu 147
    // Set by the lat/lng migration when a store has been processed (updated or
148
    // verified-kept). NULL = not yet processed by the migration.
149
    @Column(name = "lat_lng_updated_timestamp")
150
    private LocalDateTime latLngUpdatedTimestamp;
32615 raveendra. 151
    @Column(name = "counter_size")
152
    @Enumerated(EnumType.STRING)
153
    private CounterSize counterSize = CounterSize.TEN_LAC;
154
    @Column(name = "counter_potential")
155
    private float counterPotential;
156
    @Column(name = "warehouse_id")
157
    private int warehouseId;
158
    @Column(name = "minimum_investment")
159
    private float minimumInvestment;
160
    @Column(name = "grace_date")
161
    private LocalDate graceDate;
162
    @Column(name = "investment_ok")
163
    private boolean investmentOk;
164
    @Column
165
    private boolean active = true;
166
    @Column
167
    private String pan;
168
    @Transient
169
    private Address userAddress;
170
    @Column(name = "internal")
171
    private boolean internal;
172
    @Column(name = "bags_last_credited")
173
    private LocalDateTime bagsLastCredited;
174
    @Column(name = "fofo_type")
175
    @Enumerated(EnumType.STRING)
176
    private FofoType fofoType;
177
    @Column(name = "activation_type")
178
    @Enumerated(EnumType.STRING)
179
    private ActivationType activationType = ActivationType.BILLING_PENDING;
180
    @Column(name = "active_timestamp")
181
    private LocalDateTime activeTimeStamp;
182
    @Column(name = "target")
183
    private int target;
184
    @Column(name = "grace_count")
185
    private int graceCount;
33124 ranu 186
    @Column(name = "astId")
187
    private int astId;
35297 amit 188
 
35079 vikas 189
    @Column(name = "gst_number")
190
    private String gstNumber;
27556 tejbeer 191
 
36439 amit 192
    @Column(name = "outlet_name")
193
    private String outletName;
194
 
35961 amit 195
    @Column(name = "closed")
196
    private boolean closed = false;
197
 
198
    @Column(name = "closed_timestamp")
199
    private LocalDateTime closedTimestamp;
200
 
35289 amit 201
    @Column(name = "trial")
202
    private boolean trial = false;
203
 
204
    @Column(name = "trial_start")
205
    private LocalDate trialStart;
206
 
207
    @Column(name = "trial_end")
208
    private LocalDate trialEnd;
209
 
32615 raveendra. 210
    public FofoStore() {
211
    }
27556 tejbeer 212
 
33124 ranu 213
    public int getAstId() {
214
        return astId;
215
    }
216
 
217
    public void setAstId(int astId) {
218
        this.astId = astId;
219
    }
220
 
32615 raveendra. 221
    public int getCodeInt() {
222
        return codeInt;
223
    }
27556 tejbeer 224
 
32615 raveendra. 225
    public void setCodeInt(int codeInt) {
226
        this.codeInt = codeInt;
227
    }
27556 tejbeer 228
 
32615 raveendra. 229
    public int getTarget() {
230
        return target;
231
    }
27556 tejbeer 232
 
32615 raveendra. 233
    public void setTarget(int target) {
234
        this.target = target;
235
    }
27556 tejbeer 236
 
32615 raveendra. 237
    public ActivationType getActivationType() {
238
        return activationType;
239
    }
27556 tejbeer 240
 
32615 raveendra. 241
    public void setActivationType(ActivationType activationType) {
242
        this.activationType = activationType;
243
    }
31730 tejbeer 244
 
32615 raveendra. 245
    public float getCounterPotential() {
246
        return counterPotential;
247
    }
27556 tejbeer 248
 
32615 raveendra. 249
    public void setCounterPotential(float counterPotential) {
250
        this.counterPotential = counterPotential;
251
    }
27556 tejbeer 252
 
32615 raveendra. 253
    public LocalDateTime getBagsLastCredited() {
254
        return bagsLastCredited;
255
    }
27556 tejbeer 256
 
32615 raveendra. 257
    public void setBagsLastCredited(LocalDateTime bagsLastCredited) {
258
        this.bagsLastCredited = bagsLastCredited;
259
    }
27556 tejbeer 260
 
32615 raveendra. 261
    public boolean isInternal() {
262
        return internal;
263
    }
27903 tejbeer 264
 
32615 raveendra. 265
    public void setInternal(boolean internal) {
266
        this.internal = internal;
267
    }
29497 amit.gupta 268
 
32615 raveendra. 269
    public int getWarehouseId() {
270
        return warehouseId;
271
    }
30046 tejbeer 272
 
32615 raveendra. 273
    public void setWarehouseId(int warehouseId) {
274
        this.warehouseId = warehouseId;
275
    }
27903 tejbeer 276
 
32615 raveendra. 277
    public boolean isInvestmentOk() {
278
        return investmentOk;
279
    }
28825 tejbeer 280
 
32615 raveendra. 281
    public void setInvestmentOk(boolean investmentOk) {
282
        this.investmentOk = investmentOk;
283
    }
28825 tejbeer 284
 
32615 raveendra. 285
    public String getPan() {
286
        return pan;
287
    }
30046 tejbeer 288
 
32615 raveendra. 289
    public void setPan(String pan) {
290
        this.pan = pan;
291
    }
28166 tejbeer 292
 
32615 raveendra. 293
    public int getGraceCount() {
294
        return graceCount;
295
    }
32308 amit.gupta 296
 
32615 raveendra. 297
    public void setGraceCount(int graceCount) {
298
        this.graceCount = graceCount;
299
    }
32308 amit.gupta 300
 
32615 raveendra. 301
    public boolean isActive() {
302
        return active;
303
    }
32308 amit.gupta 304
 
32615 raveendra. 305
    public void setActive(boolean active) {
306
        this.active = active;
307
    }
30046 tejbeer 308
 
32615 raveendra. 309
    public LocalDate getGraceDate() {
310
        return graceDate;
311
    }
31730 tejbeer 312
 
32615 raveendra. 313
    public void setGraceDate(LocalDate graceDate) {
314
        this.graceDate = graceDate;
315
    }
31730 tejbeer 316
 
32615 raveendra. 317
    public float getMinimumInvestment() {
318
        return minimumInvestment;
319
    }
30046 tejbeer 320
 
32615 raveendra. 321
    public void setMinimumInvestment(float minimumInvestment) {
322
        this.minimumInvestment = minimumInvestment;
323
    }
28166 tejbeer 324
 
32615 raveendra. 325
    /*
326
     * public int getCreditCycle() { return creditCycle; } public void
327
     * setCreditCycle(int creditCycle) { this.creditCycle = creditCycle; }
328
     */
329
    public CounterSize getCounterSize() {
330
        return counterSize;
331
    }
28166 tejbeer 332
 
32615 raveendra. 333
    public void setCounterSize(CounterSize counterSize) {
334
        this.counterSize = counterSize;
335
    }
27903 tejbeer 336
 
32615 raveendra. 337
    public int getId() {
338
        return id;
339
    }
27903 tejbeer 340
 
32615 raveendra. 341
    public void setId(int id) {
342
        this.id = id;
343
    }
27903 tejbeer 344
 
32615 raveendra. 345
    public String getCode() {
346
        return code;
347
    }
27903 tejbeer 348
 
32615 raveendra. 349
    public void setCode(String code) {
350
        this.code = code;
351
    }
27556 tejbeer 352
 
32615 raveendra. 353
    public String getLatitude() {
354
        return latitude;
355
    }
25276 amit.gupta 356
 
32615 raveendra. 357
    public void setLatitude(String latitude) {
358
        this.latitude = latitude;
359
    }
24843 govind 360
 
32615 raveendra. 361
    public String getLongitude() {
362
        return longitude;
363
    }
29497 amit.gupta 364
 
32615 raveendra. 365
    public void setLongitude(String longitude) {
366
        this.longitude = longitude;
367
    }
29497 amit.gupta 368
 
36727 ranu 369
    public LocalDateTime getLatLngUpdatedTimestamp() {
370
        return latLngUpdatedTimestamp;
371
    }
372
 
373
    public void setLatLngUpdatedTimestamp(LocalDateTime latLngUpdatedTimestamp) {
374
        this.latLngUpdatedTimestamp = latLngUpdatedTimestamp;
375
    }
376
 
32615 raveendra. 377
    public Address getUserAddress() {
378
        return userAddress;
379
    }
27556 tejbeer 380
 
32615 raveendra. 381
    public void setUserAddress(Address userAddress) {
382
        this.userAddress = userAddress;
383
    }
27556 tejbeer 384
 
32615 raveendra. 385
    public LocalDateTime getActiveTimeStamp() {
386
        return activeTimeStamp;
387
    }
27556 tejbeer 388
 
32615 raveendra. 389
    public void setActiveTimeStamp(LocalDateTime activeTimeStamp) {
390
        this.activeTimeStamp = activeTimeStamp;
391
    }
27556 tejbeer 392
 
32615 raveendra. 393
    public FofoType getFofoType() {
394
        return fofoType;
395
    }
27556 tejbeer 396
 
32615 raveendra. 397
    public void setFofoType(FofoType fofoType) {
398
        this.fofoType = fofoType;
399
    }
27556 tejbeer 400
 
35079 vikas 401
    public String getGstNumber() {
402
        return gstNumber;
403
    }
404
 
405
    public void setGstNumber(String gstNumber) {
406
        this.gstNumber = gstNumber;
407
    }
408
 
36439 amit 409
    public String getOutletName() {
410
        return outletName;
411
    }
412
 
413
    public void setOutletName(String outletName) {
414
        this.outletName = outletName;
415
    }
416
 
35961 amit 417
    public boolean isClosed() {
418
        return closed;
419
    }
420
 
421
    public void setClosed(boolean closed) {
422
        this.closed = closed;
423
    }
424
 
425
    public LocalDateTime getClosedTimestamp() {
426
        return closedTimestamp;
427
    }
428
 
429
    public void setClosedTimestamp(LocalDateTime closedTimestamp) {
430
        this.closedTimestamp = closedTimestamp;
431
    }
432
 
35289 amit 433
    public boolean isTrial() {
434
        return trial;
435
    }
436
 
437
    public void setTrial(boolean trial) {
438
        this.trial = trial;
439
    }
440
 
441
    public LocalDate getTrialStart() {
442
        return trialStart;
443
    }
444
 
445
    public void setTrialStart(LocalDate trialStart) {
446
        this.trialStart = trialStart;
447
    }
448
 
449
    public LocalDate getTrialEnd() {
450
        return trialEnd;
451
    }
452
 
453
    public void setTrialEnd(LocalDate trialEnd) {
454
        this.trialEnd = trialEnd;
455
    }
456
 
32615 raveendra. 457
    @Override
35079 vikas 458
    public boolean equals(Object o) {
35297 amit 459
        if (o == null || getClass() != o.getClass()) return false;
35079 vikas 460
        FofoStore fofoStore = (FofoStore) o;
36439 amit 461
        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(outletName, fofoStore.outletName) && Objects.equals(closedTimestamp, fofoStore.closedTimestamp) && Objects.equals(trialStart, fofoStore.trialStart) && Objects.equals(trialEnd, fofoStore.trialEnd);
32615 raveendra. 462
    }
27556 tejbeer 463
 
32615 raveendra. 464
    @Override
35079 vikas 465
    public int hashCode() {
36439 amit 466
        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, outletName, closed, closedTimestamp, trial, trialStart, trialEnd);
32615 raveendra. 467
    }
23884 amit.gupta 468
 
32615 raveendra. 469
    @Override
470
    public String toString() {
35079 vikas 471
        return "FofoStore{" +
472
                "id=" + id +
473
                ", codeInt=" + codeInt +
474
                ", code='" + code + '\'' +
475
                ", latitude='" + latitude + '\'' +
476
                ", longitude='" + longitude + '\'' +
477
                ", counterSize=" + counterSize +
478
                ", counterPotential=" + counterPotential +
479
                ", warehouseId=" + warehouseId +
480
                ", minimumInvestment=" + minimumInvestment +
481
                ", graceDate=" + graceDate +
482
                ", investmentOk=" + investmentOk +
483
                ", active=" + active +
484
                ", pan='" + pan + '\'' +
485
                ", userAddress=" + userAddress +
486
                ", internal=" + internal +
487
                ", bagsLastCredited=" + bagsLastCredited +
488
                ", fofoType=" + fofoType +
489
                ", activationType=" + activationType +
490
                ", activeTimeStamp=" + activeTimeStamp +
491
                ", target=" + target +
492
                ", graceCount=" + graceCount +
493
                ", astId=" + astId +
494
                ", gstNumber='" + gstNumber + '\'' +
36439 amit 495
                ", outletName='" + outletName + '\'' +
35961 amit 496
                ", closed=" + closed +
497
                ", closedTimestamp=" + closedTimestamp +
35297 amit 498
                ", trial=" + trial +
499
                ", trialStart=" + trialStart +
500
                ", trialEnd=" + trialEnd +
35079 vikas 501
                '}';
32615 raveendra. 502
    }
35297 amit 503
 
35323 amit 504
    @JsonIgnore
505
    public boolean isExpired() throws ProfitMandiBusinessException{
506
        if(isTrial()) return LocalDate.now().isAfter(trialEnd);
507
        else throw new ProfitMandiBusinessException("Not a trial user", "Not a trial user", "Not a trial user");
35297 amit 508
    }
22418 ashik.ali 509
}