Subversion Repositories SmartDukaan

Rev

Rev 31044 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
22216 ashik.ali 1
package com.spice.profitmandi.dao.entity.dtr;
2
 
30725 amit.gupta 3
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
4
 
5
import javax.persistence.*;
22216 ashik.ali 6
import java.io.Serializable;
22243 ashik.ali 7
import java.time.LocalDate;
22216 ashik.ali 8
import java.time.LocalDateTime;
24880 govind 9
import java.time.format.DateTimeFormatter;
30725 amit.gupta 10
import java.util.Objects;
22216 ashik.ali 11
 
12
/**
13
 * This class basically contains insurance details
14
 * 
15
 * @author ashikali
16
 *
17
 */
18
@Entity
31860 tejbeer 19
@Table(name = "dtr.insurance_policy")
29707 tejbeer 20
public class InsurancePolicy implements Serializable {
21
 
22216 ashik.ali 22
	private static final long serialVersionUID = 1L;
29707 tejbeer 23
 
22216 ashik.ali 24
	public InsurancePolicy() {
25
	}
29707 tejbeer 26
 
22216 ashik.ali 27
	@Id
29707 tejbeer 28
	@Column(name = "id", unique = true, updatable = false)
22216 ashik.ali 29
	@GeneratedValue(strategy = GenerationType.IDENTITY)
30
	private int id;
29707 tejbeer 31
 
22216 ashik.ali 32
	@Column(name = "invoice_number")
33
	private String invoiceNumber;
29707 tejbeer 34
 
35
	@Column(name = "retailer_id")
22216 ashik.ali 36
	private int retailerId;
29707 tejbeer 37
 
38
	@Column(name = "purchase_amount")
22216 ashik.ali 39
	private float purchaseAmount;
29707 tejbeer 40
 
41
	@Column(name = "sale_amount")
22216 ashik.ali 42
	private float saleAmount;
29707 tejbeer 43
 
44
	@Column(name = "selling_price")
22216 ashik.ali 45
	private float sellingPrice;
29707 tejbeer 46
 
47
	@Column(name = "product_name")
24440 amit.gupta 48
	private String productName;
29707 tejbeer 49
 
24440 amit.gupta 50
	public String getProductName() {
51
		return productName;
52
	}
53
 
54
	public void setProductName(String productName) {
55
		this.productName = productName;
56
	}
57
 
22216 ashik.ali 58
	@Column(name = "serial_number", unique = true)
59
	private String serialNumber;
29707 tejbeer 60
 
22216 ashik.ali 61
	@Column(name = "model_name")
62
	private String modelName;
29707 tejbeer 63
 
22216 ashik.ali 64
	@Column(name = "brand")
65
	private String brand;
29707 tejbeer 66
 
22216 ashik.ali 67
	@Column(name = "policy_number")
68
	private String policyNumber;
29707 tejbeer 69
 
30725 amit.gupta 70
	@Column(name = "policy_plan")
71
	private String policyPlan;
72
 
29707 tejbeer 73
	@Column(name = "provider_id")
22216 ashik.ali 74
	private int providerId;
29707 tejbeer 75
 
22243 ashik.ali 76
	@Column(name = "customer_first_name")
77
	private String customerFirstName;
29707 tejbeer 78
 
22243 ashik.ali 79
	@Column(name = "customer_last_name")
80
	private String customerLastName;
29707 tejbeer 81
 
22243 ashik.ali 82
	@Column(name = "customer_mobile_number")
83
	private String customerMobileNumber;
29707 tejbeer 84
 
22243 ashik.ali 85
	@Column(name = "customer_email_id")
86
	private String customerEmailId;
29707 tejbeer 87
 
22243 ashik.ali 88
	@Column(name = "customer_date_of_birth")
89
	private LocalDate customerDateOfBirth = LocalDate.now();
29707 tejbeer 90
 
22243 ashik.ali 91
	@Column(name = "customer_address1")
92
	private String customerAddress1;
29707 tejbeer 93
 
22243 ashik.ali 94
	@Column(name = "customer_address2")
95
	private String customerAddress2;
29707 tejbeer 96
 
22243 ashik.ali 97
	@Column(name = "customer_city")
98
	private String customerCity;
29707 tejbeer 99
 
22243 ashik.ali 100
	@Column(name = "customer_pin_code")
101
	private String customerPinCode;
29707 tejbeer 102
 
22243 ashik.ali 103
	@Column(name = "customer_state")
104
	private String customerState;
29707 tejbeer 105
 
106
	@Column(name = "device_invoice_number")
107
	private String deviceInvoiceNumber;
108
 
22243 ashik.ali 109
	@Column(name = "posted", columnDefinition = "tinyint(1) default 0")
110
	private boolean posted;
29707 tejbeer 111
 
23344 ashik.ali 112
	@Transient
113
	private InsuranceProvider insuranceProvider;
29707 tejbeer 114
 
22216 ashik.ali 115
	@Convert(converter = LocalDateTimeAttributeConverter.class)
29707 tejbeer 116
	@Column(name = "create_timestamp", updatable = false)
22216 ashik.ali 117
	private LocalDateTime createTimestamp = LocalDateTime.now();
29707 tejbeer 118
 
22216 ashik.ali 119
	@Convert(converter = LocalDateTimeAttributeConverter.class)
29707 tejbeer 120
	@Column(name = "invoice_creation_timestamp")
22216 ashik.ali 121
	private LocalDateTime invoiceCreationTimestamp = LocalDateTime.now();
29707 tejbeer 122
 
31044 amit.gupta 123
	@Column(name = "cancel_timestamp")
124
	private LocalDateTime cancelledOn;
125
 
29707 tejbeer 126
	@Transient
25726 amit.gupta 127
	private String color;
29707 tejbeer 128
 
129
	@Transient
25726 amit.gupta 130
	private String coveragePeriod;
29707 tejbeer 131
 
132
	@Transient
25726 amit.gupta 133
	private int brandId;
22216 ashik.ali 134
 
25726 amit.gupta 135
	public int getBrandId() {
136
		return brandId;
137
	}
138
 
139
	public void setBrandId(int brandId) {
140
		this.brandId = brandId;
141
	}
142
 
29707 tejbeer 143
	public String getDeviceInvoiceNumber() {
144
		return deviceInvoiceNumber;
145
	}
146
 
147
	public void setDeviceInvoiceNumber(String deviceInvoiceNumber) {
148
		this.deviceInvoiceNumber = deviceInvoiceNumber;
149
	}
150
 
31044 amit.gupta 151
	public LocalDateTime getCancelledOn() {
152
		return cancelledOn;
153
	}
154
 
155
	public void setCancelledOn(LocalDateTime cancelledOn) {
156
		this.cancelledOn = cancelledOn;
157
	}
158
 
159
	@Override
160
	public boolean equals(Object o) {
161
		if (this == o) return true;
162
		if (o == null || getClass() != o.getClass()) return false;
163
		InsurancePolicy that = (InsurancePolicy) o;
164
		return id == that.id && retailerId == that.retailerId && Float.compare(that.purchaseAmount, purchaseAmount) == 0 && Float.compare(that.saleAmount, saleAmount) == 0 && Float.compare(that.sellingPrice, sellingPrice) == 0 && providerId == that.providerId && posted == that.posted && brandId == that.brandId && Objects.equals(invoiceNumber, that.invoiceNumber) && Objects.equals(productName, that.productName) && Objects.equals(serialNumber, that.serialNumber) && Objects.equals(modelName, that.modelName) && Objects.equals(brand, that.brand) && Objects.equals(policyNumber, that.policyNumber) && Objects.equals(policyPlan, that.policyPlan) && Objects.equals(customerFirstName, that.customerFirstName) && Objects.equals(customerLastName, that.customerLastName) && Objects.equals(customerMobileNumber, that.customerMobileNumber) && Objects.equals(customerEmailId, that.customerEmailId) && Objects.equals(customerDateOfBirth, that.customerDateOfBirth) && Objects.equals(customerAddress1, that.customerAddress1) && Objects.equals(customerAddress2, that.customerAddress2) && Objects.equals(customerCity, that.customerCity) && Objects.equals(customerPinCode, that.customerPinCode) && Objects.equals(customerState, that.customerState) && Objects.equals(deviceInvoiceNumber, that.deviceInvoiceNumber) && Objects.equals(insuranceProvider, that.insuranceProvider) && Objects.equals(createTimestamp, that.createTimestamp) && Objects.equals(invoiceCreationTimestamp, that.invoiceCreationTimestamp) && Objects.equals(cancelledOn, that.cancelledOn) && Objects.equals(color, that.color) && Objects.equals(coveragePeriod, that.coveragePeriod);
165
	}
166
 
167
	@Override
168
	public int hashCode() {
169
		return Objects.hash(id, invoiceNumber, retailerId, purchaseAmount, saleAmount, sellingPrice, productName, serialNumber, modelName, brand, policyNumber, policyPlan, providerId, customerFirstName, customerLastName, customerMobileNumber, customerEmailId, customerDateOfBirth, customerAddress1, customerAddress2, customerCity, customerPinCode, customerState, deviceInvoiceNumber, posted, insuranceProvider, createTimestamp, invoiceCreationTimestamp, cancelledOn, color, coveragePeriod, brandId);
170
	}
171
 
25726 amit.gupta 172
	public String getCoveragePeriod() {
173
		return coveragePeriod;
174
	}
175
 
176
	public void setCoveragePeriod(String coveragePeriod) {
177
		this.coveragePeriod = coveragePeriod;
178
	}
179
 
180
	public String getColor() {
181
		return color;
182
	}
183
 
184
	public void setColor(String color) {
185
		this.color = color;
186
	}
187
 
29707 tejbeer 188
	public String getFormattedCreateTimestamp() {
189
		if (createTimestamp == null) {
24880 govind 190
			return null;
191
		}
192
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
193
		return createTimestamp.format(formatter);
29707 tejbeer 194
	}
195
 
22216 ashik.ali 196
	public int getId() {
197
		return id;
198
	}
199
 
200
	public void setId(int id) {
201
		this.id = id;
202
	}
203
 
204
	public String getInvoiceNumber() {
205
		return invoiceNumber;
206
	}
29707 tejbeer 207
 
22216 ashik.ali 208
	public void setInvoiceNumber(String invoiceNumber) {
209
		this.invoiceNumber = invoiceNumber;
210
	}
29707 tejbeer 211
 
22216 ashik.ali 212
	public int getRetailerId() {
213
		return retailerId;
214
	}
215
 
216
	public void setRetailerId(int retailerId) {
217
		this.retailerId = retailerId;
218
	}
219
 
220
	public float getPurchaseAmount() {
221
		return purchaseAmount;
222
	}
29707 tejbeer 223
 
22216 ashik.ali 224
	public void setPurchaseAmount(float purchaseAmount) {
225
		this.purchaseAmount = purchaseAmount;
226
	}
29707 tejbeer 227
 
22216 ashik.ali 228
	public float getSaleAmount() {
229
		return saleAmount;
230
	}
29707 tejbeer 231
 
22216 ashik.ali 232
	public void setSaleAmount(float saleAmount) {
233
		this.saleAmount = saleAmount;
234
	}
235
 
236
	public float getSellingPrice() {
237
		return sellingPrice;
238
	}
239
 
240
	public void setSellingPrice(float sellingPrice) {
241
		this.sellingPrice = sellingPrice;
242
	}
243
 
244
	public String getSerialNumber() {
245
		return serialNumber;
246
	}
247
 
248
	public void setSerialNumber(String serialNumber) {
249
		this.serialNumber = serialNumber;
250
	}
29707 tejbeer 251
 
22216 ashik.ali 252
	public String getModelName() {
253
		return modelName;
254
	}
29707 tejbeer 255
 
22216 ashik.ali 256
	public void setModelName(String modelName) {
257
		this.modelName = modelName;
258
	}
29707 tejbeer 259
 
22216 ashik.ali 260
	public String getBrand() {
261
		return brand;
262
	}
29707 tejbeer 263
 
22216 ashik.ali 264
	public void setBrand(String brand) {
265
		this.brand = brand;
266
	}
267
 
268
	public String getPolicyNumber() {
269
		return policyNumber;
270
	}
271
 
272
	public void setPolicyNumber(String policyNumber) {
273
		this.policyNumber = policyNumber;
274
	}
275
 
276
	public int getProviderId() {
277
		return providerId;
278
	}
279
 
280
	public void setProviderId(int providerId) {
281
		this.providerId = providerId;
282
	}
29707 tejbeer 283
 
22243 ashik.ali 284
	public String getCustomerFirstName() {
285
		return customerFirstName;
286
	}
29707 tejbeer 287
 
22243 ashik.ali 288
	public void setCustomerFirstName(String customerFirstName) {
289
		this.customerFirstName = customerFirstName;
290
	}
29707 tejbeer 291
 
22243 ashik.ali 292
	public String getCustomerLastName() {
293
		return customerLastName;
294
	}
29707 tejbeer 295
 
22243 ashik.ali 296
	public void setCustomerLastName(String customerLastName) {
297
		this.customerLastName = customerLastName;
298
	}
29707 tejbeer 299
 
22243 ashik.ali 300
	public String getCustomerMobileNumber() {
301
		return customerMobileNumber;
302
	}
29707 tejbeer 303
 
22243 ashik.ali 304
	public void setCustomerMobileNumber(String customerMobileNumber) {
305
		this.customerMobileNumber = customerMobileNumber;
306
	}
29707 tejbeer 307
 
22243 ashik.ali 308
	public String getCustomerEmailId() {
309
		return customerEmailId;
310
	}
29707 tejbeer 311
 
22243 ashik.ali 312
	public void setCustomerEmailId(String customerEmailId) {
313
		this.customerEmailId = customerEmailId;
314
	}
29707 tejbeer 315
 
22243 ashik.ali 316
	public LocalDate getCustomerDateOfBirth() {
317
		return customerDateOfBirth;
318
	}
29707 tejbeer 319
 
22243 ashik.ali 320
	public void setCustomerDateOfBirth(LocalDate customerDateOfBirth) {
321
		this.customerDateOfBirth = customerDateOfBirth;
322
	}
29707 tejbeer 323
 
22243 ashik.ali 324
	public String getCustomerAddress1() {
325
		return customerAddress1;
326
	}
29707 tejbeer 327
 
22243 ashik.ali 328
	public void setCustomerAddress1(String customerAddress1) {
329
		this.customerAddress1 = customerAddress1;
330
	}
29707 tejbeer 331
 
22243 ashik.ali 332
	public String getCustomerAddress2() {
333
		return customerAddress2;
334
	}
29707 tejbeer 335
 
22243 ashik.ali 336
	public void setCustomerAddress2(String customerAddress2) {
337
		this.customerAddress2 = customerAddress2;
338
	}
29707 tejbeer 339
 
22243 ashik.ali 340
	public String getCustomerCity() {
341
		return customerCity;
342
	}
29707 tejbeer 343
 
22243 ashik.ali 344
	public void setCustomerCity(String customerCity) {
345
		this.customerCity = customerCity;
346
	}
29707 tejbeer 347
 
22243 ashik.ali 348
	public String getCustomerPinCode() {
349
		return customerPinCode;
350
	}
29707 tejbeer 351
 
22243 ashik.ali 352
	public void setCustomerPinCode(String customerPinCode) {
353
		this.customerPinCode = customerPinCode;
354
	}
29707 tejbeer 355
 
22243 ashik.ali 356
	public String getCustomerState() {
357
		return customerState;
358
	}
29707 tejbeer 359
 
22243 ashik.ali 360
	public void setCustomerState(String customerState) {
361
		this.customerState = customerState;
362
	}
22216 ashik.ali 363
 
22243 ashik.ali 364
	public boolean isPosted() {
365
		return posted;
366
	}
29707 tejbeer 367
 
22243 ashik.ali 368
	public void setPosted(boolean posted) {
369
		this.posted = posted;
370
	}
29707 tejbeer 371
 
23344 ashik.ali 372
	public InsuranceProvider getInsuranceProvider() {
373
		return insuranceProvider;
374
	}
29707 tejbeer 375
 
23344 ashik.ali 376
	public void setInsuranceProvider(InsuranceProvider insuranceProvider) {
377
		this.insuranceProvider = insuranceProvider;
378
	}
29707 tejbeer 379
 
22216 ashik.ali 380
	public LocalDateTime getCreateTimestamp() {
381
		return createTimestamp;
382
	}
383
 
384
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
385
		this.createTimestamp = createTimestamp;
386
	}
387
 
388
	public LocalDateTime getInvoiceCreationTimestamp() {
389
		return invoiceCreationTimestamp;
390
	}
391
 
392
	public void setInvoiceCreationTimestamp(LocalDateTime invoiceCreationTimestamp) {
393
		this.invoiceCreationTimestamp = invoiceCreationTimestamp;
394
	}
395
 
30725 amit.gupta 396
	public String getPolicyPlan() {
397
		return policyPlan;
398
	}
399
 
400
	public void setPolicyPlan(String policyPlan) {
401
		this.policyPlan = policyPlan;
402
	}
403
 
22216 ashik.ali 404
	@Override
405
	public String toString() {
406
		return "InsurancePolicy [id=" + id + ", invoiceNumber=" + invoiceNumber + ", retailerId=" + retailerId
407
				+ ", purchaseAmount=" + purchaseAmount + ", saleAmount=" + saleAmount + ", sellingPrice=" + sellingPrice
24440 amit.gupta 408
				+ ", productName=" + productName + ", serialNumber=" + serialNumber + ", modelName=" + modelName
409
				+ ", brand=" + brand + ", policyNumber=" + policyNumber + ", providerId=" + providerId
410
				+ ", customerFirstName=" + customerFirstName + ", customerLastName=" + customerLastName
411
				+ ", customerMobileNumber=" + customerMobileNumber + ", customerEmailId=" + customerEmailId
412
				+ ", customerDateOfBirth=" + customerDateOfBirth + ", customerAddress1=" + customerAddress1
413
				+ ", customerAddress2=" + customerAddress2 + ", customerCity=" + customerCity + ", customerPinCode="
29707 tejbeer 414
				+ customerPinCode + ", customerState=" + customerState + ", deviceInvoiceNumber=" + deviceInvoiceNumber
415
				+ ", posted=" + posted + ", insuranceProvider=" + insuranceProvider + ", createTimestamp="
416
				+ createTimestamp + ", invoiceCreationTimestamp=" + invoiceCreationTimestamp + ", color=" + color
417
				+ ", coveragePeriod=" + coveragePeriod + ", brandId=" + brandId + "]";
22216 ashik.ali 418
	}
419
 
420
}