Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
35289 amit 1
package com.spice.profitmandi.dao.entity.fofo;
35275 aman 2
 
3
import com.spice.profitmandi.common.model.ProfitMandiConstants;
4
 
5
import javax.persistence.*;
6
import java.time.LocalDateTime;
35499 aman 7
import java.util.List;
35289 amit 8
import java.util.Objects;
35499 aman 9
import java.util.stream.Collectors;
35275 aman 10
 
11
@Entity
12
@Table(name = "fofo.trial_form")
35289 amit 13
public class TrialForm {
35275 aman 14
 
15
    @Id
16
    @GeneratedValue(strategy = GenerationType.IDENTITY)
17
    @Column(name = "id")
18
    private int id;
19
 
20
    @Column(name = "first_name", nullable = false, length = 50)
21
    private String firstName;
22
 
23
    @Column(name = "last_name", length = 50)
24
    private String lastName;
25
 
26
    @Column(name = "email", nullable = false, length = 100)
27
    private String email;
28
 
29
    @Column(name = "mobile", nullable = false, length = 10)
30
    private String mobile;
31
 
32
    @Column(name = "pan_document_id", nullable = false)
33
    private Integer panDocumentId;
34
 
35
    @Column(name = "aadhaar_document_id", nullable = false)
36
    private Integer aadhaarDocumentId;
37
 
35499 aman 38
    @Transient
39
    private List<Integer> shopImageDocumentIds;
40
 
41
    @Column(name = "shop_image_document_ids")
42
    private String shopImageDocumentIdsStr;
43
 
44
 
35275 aman 45
    @Column(name = "gst_number", nullable = false, length = 15)
46
    private String gstNumber;
47
 
48
    @Column(name = "business_name", nullable = false, length = 200)
49
    private String businessName;
50
 
51
    @Column(name = "address_line1", nullable = false, length = 255)
52
    private String addressLine1;
53
 
54
    @Column(name = "address_line2", length = 255)
55
    private String addressLine2;
56
 
57
    @Column(name = "city", nullable = false, length = 100)
58
    private String city;
59
 
60
    @Column(name = "state", nullable = false, length = 100)
61
    private String state;
62
 
63
    @Column(name = "pincode", nullable = false, length = 6)
64
    private String pincode;
65
 
35360 aman 66
    @Column(name = "asm_id")
67
    private Integer asmId;
35275 aman 68
 
35360 aman 69
    @Column(name = "bm_id")
70
    private Integer bmId;
71
 
72
    @Column(name = "refer_by_email")
73
    private String referByEmail;
74
 
35275 aman 75
    @Column(name = "status", length = 20)
35289 amit 76
    @Enumerated(EnumType.STRING)
77
    private ProfitMandiConstants.Status status;
35275 aman 78
 
35499 aman 79
    @Column(name = "remark")
80
    private String remark;
81
 
82
 
35275 aman 83
    @Column(name = "created_on")
84
    private LocalDateTime createdOn;
85
 
86
    @Column(name = "updated_on")
87
    private LocalDateTime updatedOn;
88
 
35289 amit 89
    public TrialForm() {
35275 aman 90
    }
91
 
35499 aman 92
    public TrialForm(int id, String firstName, String lastName, String email, String mobile, Integer panDocumentId, Integer aadhaarDocumentId, String shopImageDocumentIdsStr, String gstNumber, String businessName, String addressLine1, String addressLine2, String city, String state, String pincode, Integer asmId, Integer bmId, String referByEmail, ProfitMandiConstants.Status status, String remark, LocalDateTime createdOn, LocalDateTime updatedOn) {
35275 aman 93
        this.id = id;
94
        this.firstName = firstName;
95
        this.lastName = lastName;
96
        this.email = email;
97
        this.mobile = mobile;
98
        this.panDocumentId = panDocumentId;
99
        this.aadhaarDocumentId = aadhaarDocumentId;
35499 aman 100
        this.shopImageDocumentIdsStr = shopImageDocumentIdsStr;
35275 aman 101
        this.gstNumber = gstNumber;
102
        this.businessName = businessName;
103
        this.addressLine1 = addressLine1;
104
        this.addressLine2 = addressLine2;
105
        this.city = city;
106
        this.state = state;
107
        this.pincode = pincode;
35360 aman 108
        this.asmId = asmId;
109
        this.bmId = bmId;
110
        this.referByEmail = referByEmail;
35275 aman 111
        this.status = status;
35499 aman 112
        this.remark = remark;
35275 aman 113
        this.createdOn = createdOn;
114
        this.updatedOn = updatedOn;
115
    }
116
 
117
    public int getId() {
118
        return id;
119
    }
120
 
121
    public void setId(int id) {
122
        this.id = id;
123
    }
124
 
125
    public String getFirstName() {
126
        return firstName;
127
    }
128
 
129
    public void setFirstName(String firstName) {
130
        this.firstName = firstName;
131
    }
132
 
133
    public String getLastName() {
134
        return lastName;
135
    }
136
 
137
    public void setLastName(String lastName) {
138
        this.lastName = lastName;
139
    }
140
 
141
    public String getEmail() {
142
        return email;
143
    }
144
 
145
    public void setEmail(String email) {
146
        this.email = email;
147
    }
148
 
149
    public String getMobile() {
150
        return mobile;
151
    }
152
 
153
    public void setMobile(String mobile) {
154
        this.mobile = mobile;
155
    }
156
 
157
    public Integer getPanDocumentId() {
158
        return panDocumentId;
159
    }
160
 
161
    public void setPanDocumentId(Integer panDocumentId) {
162
        this.panDocumentId = panDocumentId;
163
    }
164
 
165
    public Integer getAadhaarDocumentId() {
166
        return aadhaarDocumentId;
167
    }
168
 
169
    public void setAadhaarDocumentId(Integer aadhaarDocumentId) {
170
        this.aadhaarDocumentId = aadhaarDocumentId;
171
    }
172
 
173
    public String getGstNumber() {
174
        return gstNumber;
175
    }
176
 
177
    public void setGstNumber(String gstNumber) {
178
        this.gstNumber = gstNumber;
179
    }
180
 
181
    public String getBusinessName() {
182
        return businessName;
183
    }
184
 
185
    public void setBusinessName(String businessName) {
186
        this.businessName = businessName;
187
    }
188
 
189
    public String getAddressLine1() {
190
        return addressLine1;
191
    }
192
 
193
    public void setAddressLine1(String addressLine1) {
194
        this.addressLine1 = addressLine1;
195
    }
196
 
197
    public String getAddressLine2() {
198
        return addressLine2;
199
    }
200
 
201
    public void setAddressLine2(String addressLine2) {
202
        this.addressLine2 = addressLine2;
203
    }
204
 
205
    public String getCity() {
206
        return city;
207
    }
208
 
209
    public void setCity(String city) {
210
        this.city = city;
211
    }
212
 
213
    public String getState() {
214
        return state;
215
    }
216
 
217
    public void setState(String state) {
218
        this.state = state;
219
    }
220
 
221
    public String getPincode() {
222
        return pincode;
223
    }
224
 
225
    public void setPincode(String pincode) {
226
        this.pincode = pincode;
227
    }
228
 
229
    public ProfitMandiConstants.Status getStatus() {
230
        return status;
231
    }
232
 
233
    public void setStatus(ProfitMandiConstants.Status status) {
234
        this.status = status;
235
    }
236
 
237
    public LocalDateTime getCreatedOn() {
238
        return createdOn;
239
    }
240
 
241
    public void setCreatedOn(LocalDateTime createdOn) {
242
        this.createdOn = createdOn;
243
    }
244
 
245
    public LocalDateTime getUpdatedOn() {
246
        return updatedOn;
247
    }
248
 
249
    public void setUpdatedOn(LocalDateTime updatedOn) {
250
        this.updatedOn = updatedOn;
251
    }
35289 amit 252
 
35360 aman 253
    public Integer getAsmId() {
254
        return asmId;
255
    }
256
 
257
    public void setAsmId(Integer asmId) {
258
        this.asmId = asmId;
259
    }
260
 
261
    public Integer getBmId() {
262
        return bmId;
263
    }
264
 
265
    public void setBmId(Integer bmId) {
266
        this.bmId = bmId;
267
    }
268
 
269
    public String getReferByEmail() {
270
        return referByEmail;
271
    }
272
 
273
    public void setReferByEmail(String referByEmail) {
274
        this.referByEmail = referByEmail;
275
    }
276
 
35499 aman 277
 
278
    public String getRemark() {
279
        return remark;
280
    }
281
 
282
    public void setRemark(String remark) {
283
        this.remark = remark;
284
    }
285
 
286
    public List<Integer> getShopImageDocumentIds() {
287
        if (shopImageDocumentIds != null) {
288
            return shopImageDocumentIds;
289
        }
290
 
291
        if (shopImageDocumentIdsStr == null || shopImageDocumentIdsStr.isEmpty()) {
292
            return null;
293
        }
294
 
295
        return java.util.Arrays.stream(shopImageDocumentIdsStr.split(","))
296
                .map(Integer::parseInt)
297
                .collect(Collectors.toList());
298
    }
299
 
300
 
301
    public void setShopImageDocumentIds(List<Integer> shopImageDocumentIds) {
302
        this.shopImageDocumentIds = shopImageDocumentIds;
303
        this.shopImageDocumentIdsStr = shopImageDocumentIds == null
304
                ? null
305
                : shopImageDocumentIds.stream()
306
                .map(String::valueOf)
307
                .collect(Collectors.joining(","));
308
    }
309
 
310
    public String getShopImageDocumentIdsStr() {
311
        return shopImageDocumentIdsStr;
312
    }
313
 
314
 
35289 amit 315
    @Override
316
    public String toString() {
317
        return "TrialForm{" +
318
                "id=" + id +
319
                ", firstName='" + firstName + '\'' +
320
                ", lastName='" + lastName + '\'' +
321
                ", email='" + email + '\'' +
322
                ", mobile='" + mobile + '\'' +
323
                ", panDocumentId=" + panDocumentId +
324
                ", aadhaarDocumentId=" + aadhaarDocumentId +
35499 aman 325
                ", shopImageDocumentIdsStr='" + shopImageDocumentIdsStr + '\'' +
35289 amit 326
                ", gstNumber='" + gstNumber + '\'' +
327
                ", businessName='" + businessName + '\'' +
328
                ", addressLine1='" + addressLine1 + '\'' +
329
                ", addressLine2='" + addressLine2 + '\'' +
330
                ", city='" + city + '\'' +
331
                ", state='" + state + '\'' +
332
                ", pincode='" + pincode + '\'' +
35360 aman 333
                ", asmId=" + asmId +
334
                ", bmId=" + bmId +
335
                ", referByEmail='" + referByEmail + '\'' +
35289 amit 336
                ", status=" + status +
35499 aman 337
                ", remark='" + remark + '\'' +
35289 amit 338
                ", createdOn=" + createdOn +
339
                ", updatedOn=" + updatedOn +
340
                '}';
341
    }
342
 
343
    @Override
344
    public boolean equals(Object o) {
345
        if (o == null || getClass() != o.getClass()) return false;
346
        TrialForm trialForm = (TrialForm) o;
35499 aman 347
        return id == trialForm.id && Objects.equals(firstName, trialForm.firstName) && Objects.equals(lastName, trialForm.lastName) && Objects.equals(email, trialForm.email) && Objects.equals(mobile, trialForm.mobile) && Objects.equals(panDocumentId, trialForm.panDocumentId) && Objects.equals(aadhaarDocumentId, trialForm.aadhaarDocumentId) && Objects.equals(shopImageDocumentIdsStr, trialForm.shopImageDocumentIdsStr) && Objects.equals(gstNumber, trialForm.gstNumber) && Objects.equals(businessName, trialForm.businessName) && Objects.equals(addressLine1, trialForm.addressLine1) && Objects.equals(addressLine2, trialForm.addressLine2) && Objects.equals(city, trialForm.city) && Objects.equals(state, trialForm.state) && Objects.equals(pincode, trialForm.pincode) && Objects.equals(asmId, trialForm.asmId) && Objects.equals(bmId, trialForm.bmId) && Objects.equals(referByEmail, trialForm.referByEmail) && status == trialForm.status && Objects.equals(remark, trialForm.remark) && Objects.equals(createdOn, trialForm.createdOn) && Objects.equals(updatedOn, trialForm.updatedOn);
35289 amit 348
    }
349
 
350
    @Override
351
    public int hashCode() {
35499 aman 352
        return Objects.hash(id, firstName, lastName, email, mobile, panDocumentId, aadhaarDocumentId, shopImageDocumentIdsStr, gstNumber, businessName, addressLine1, addressLine2, city, state, pincode, asmId, bmId, referByEmail, status, remark, createdOn, updatedOn);
35289 amit 353
    }
35275 aman 354
}