Subversion Repositories SmartDukaan

Rev

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