Subversion Repositories SmartDukaan

Rev

Rev 29707 | Rev 31044 | Go to most recent revision | 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
29707 tejbeer 19
@Table(name = "dtr.insurance_policy", schema = "dtr")
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
 
123
	@Transient
25726 amit.gupta 124
	private String color;
29707 tejbeer 125
 
126
	@Transient
25726 amit.gupta 127
	private String coveragePeriod;
29707 tejbeer 128
 
129
	@Transient
25726 amit.gupta 130
	private int brandId;
22216 ashik.ali 131
 
25726 amit.gupta 132
	public int getBrandId() {
133
		return brandId;
134
	}
135
 
136
	public void setBrandId(int brandId) {
137
		this.brandId = brandId;
138
	}
139
 
29707 tejbeer 140
	public String getDeviceInvoiceNumber() {
141
		return deviceInvoiceNumber;
142
	}
143
 
144
	public void setDeviceInvoiceNumber(String deviceInvoiceNumber) {
145
		this.deviceInvoiceNumber = deviceInvoiceNumber;
146
	}
147
 
25726 amit.gupta 148
	public String getCoveragePeriod() {
149
		return coveragePeriod;
150
	}
151
 
152
	public void setCoveragePeriod(String coveragePeriod) {
153
		this.coveragePeriod = coveragePeriod;
154
	}
155
 
156
	public String getColor() {
157
		return color;
158
	}
159
 
160
	public void setColor(String color) {
161
		this.color = color;
162
	}
163
 
29707 tejbeer 164
	public String getFormattedCreateTimestamp() {
165
		if (createTimestamp == null) {
24880 govind 166
			return null;
167
		}
168
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
169
		return createTimestamp.format(formatter);
29707 tejbeer 170
	}
171
 
22216 ashik.ali 172
	public int getId() {
173
		return id;
174
	}
175
 
176
	public void setId(int id) {
177
		this.id = id;
178
	}
179
 
180
	public String getInvoiceNumber() {
181
		return invoiceNumber;
182
	}
29707 tejbeer 183
 
22216 ashik.ali 184
	public void setInvoiceNumber(String invoiceNumber) {
185
		this.invoiceNumber = invoiceNumber;
186
	}
29707 tejbeer 187
 
22216 ashik.ali 188
	public int getRetailerId() {
189
		return retailerId;
190
	}
191
 
192
	public void setRetailerId(int retailerId) {
193
		this.retailerId = retailerId;
194
	}
195
 
196
	public float getPurchaseAmount() {
197
		return purchaseAmount;
198
	}
29707 tejbeer 199
 
22216 ashik.ali 200
	public void setPurchaseAmount(float purchaseAmount) {
201
		this.purchaseAmount = purchaseAmount;
202
	}
29707 tejbeer 203
 
22216 ashik.ali 204
	public float getSaleAmount() {
205
		return saleAmount;
206
	}
29707 tejbeer 207
 
22216 ashik.ali 208
	public void setSaleAmount(float saleAmount) {
209
		this.saleAmount = saleAmount;
210
	}
211
 
212
	public float getSellingPrice() {
213
		return sellingPrice;
214
	}
215
 
216
	public void setSellingPrice(float sellingPrice) {
217
		this.sellingPrice = sellingPrice;
218
	}
219
 
220
	public String getSerialNumber() {
221
		return serialNumber;
222
	}
223
 
224
	public void setSerialNumber(String serialNumber) {
225
		this.serialNumber = serialNumber;
226
	}
29707 tejbeer 227
 
22216 ashik.ali 228
	public String getModelName() {
229
		return modelName;
230
	}
29707 tejbeer 231
 
22216 ashik.ali 232
	public void setModelName(String modelName) {
233
		this.modelName = modelName;
234
	}
29707 tejbeer 235
 
22216 ashik.ali 236
	public String getBrand() {
237
		return brand;
238
	}
29707 tejbeer 239
 
22216 ashik.ali 240
	public void setBrand(String brand) {
241
		this.brand = brand;
242
	}
243
 
244
	public String getPolicyNumber() {
245
		return policyNumber;
246
	}
247
 
248
	public void setPolicyNumber(String policyNumber) {
249
		this.policyNumber = policyNumber;
250
	}
251
 
252
	public int getProviderId() {
253
		return providerId;
254
	}
255
 
256
	public void setProviderId(int providerId) {
257
		this.providerId = providerId;
258
	}
29707 tejbeer 259
 
22243 ashik.ali 260
	public String getCustomerFirstName() {
261
		return customerFirstName;
262
	}
29707 tejbeer 263
 
22243 ashik.ali 264
	public void setCustomerFirstName(String customerFirstName) {
265
		this.customerFirstName = customerFirstName;
266
	}
29707 tejbeer 267
 
22243 ashik.ali 268
	public String getCustomerLastName() {
269
		return customerLastName;
270
	}
29707 tejbeer 271
 
22243 ashik.ali 272
	public void setCustomerLastName(String customerLastName) {
273
		this.customerLastName = customerLastName;
274
	}
29707 tejbeer 275
 
22243 ashik.ali 276
	public String getCustomerMobileNumber() {
277
		return customerMobileNumber;
278
	}
29707 tejbeer 279
 
22243 ashik.ali 280
	public void setCustomerMobileNumber(String customerMobileNumber) {
281
		this.customerMobileNumber = customerMobileNumber;
282
	}
29707 tejbeer 283
 
22243 ashik.ali 284
	public String getCustomerEmailId() {
285
		return customerEmailId;
286
	}
29707 tejbeer 287
 
22243 ashik.ali 288
	public void setCustomerEmailId(String customerEmailId) {
289
		this.customerEmailId = customerEmailId;
290
	}
29707 tejbeer 291
 
22243 ashik.ali 292
	public LocalDate getCustomerDateOfBirth() {
293
		return customerDateOfBirth;
294
	}
29707 tejbeer 295
 
22243 ashik.ali 296
	public void setCustomerDateOfBirth(LocalDate customerDateOfBirth) {
297
		this.customerDateOfBirth = customerDateOfBirth;
298
	}
29707 tejbeer 299
 
22243 ashik.ali 300
	public String getCustomerAddress1() {
301
		return customerAddress1;
302
	}
29707 tejbeer 303
 
22243 ashik.ali 304
	public void setCustomerAddress1(String customerAddress1) {
305
		this.customerAddress1 = customerAddress1;
306
	}
29707 tejbeer 307
 
22243 ashik.ali 308
	public String getCustomerAddress2() {
309
		return customerAddress2;
310
	}
29707 tejbeer 311
 
22243 ashik.ali 312
	public void setCustomerAddress2(String customerAddress2) {
313
		this.customerAddress2 = customerAddress2;
314
	}
29707 tejbeer 315
 
22243 ashik.ali 316
	public String getCustomerCity() {
317
		return customerCity;
318
	}
29707 tejbeer 319
 
22243 ashik.ali 320
	public void setCustomerCity(String customerCity) {
321
		this.customerCity = customerCity;
322
	}
29707 tejbeer 323
 
22243 ashik.ali 324
	public String getCustomerPinCode() {
325
		return customerPinCode;
326
	}
29707 tejbeer 327
 
22243 ashik.ali 328
	public void setCustomerPinCode(String customerPinCode) {
329
		this.customerPinCode = customerPinCode;
330
	}
29707 tejbeer 331
 
22243 ashik.ali 332
	public String getCustomerState() {
333
		return customerState;
334
	}
29707 tejbeer 335
 
22243 ashik.ali 336
	public void setCustomerState(String customerState) {
337
		this.customerState = customerState;
338
	}
22216 ashik.ali 339
 
22243 ashik.ali 340
	public boolean isPosted() {
341
		return posted;
342
	}
29707 tejbeer 343
 
22243 ashik.ali 344
	public void setPosted(boolean posted) {
345
		this.posted = posted;
346
	}
29707 tejbeer 347
 
23344 ashik.ali 348
	public InsuranceProvider getInsuranceProvider() {
349
		return insuranceProvider;
350
	}
29707 tejbeer 351
 
23344 ashik.ali 352
	public void setInsuranceProvider(InsuranceProvider insuranceProvider) {
353
		this.insuranceProvider = insuranceProvider;
354
	}
29707 tejbeer 355
 
22216 ashik.ali 356
	public LocalDateTime getCreateTimestamp() {
357
		return createTimestamp;
358
	}
359
 
360
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
361
		this.createTimestamp = createTimestamp;
362
	}
363
 
364
	public LocalDateTime getInvoiceCreationTimestamp() {
365
		return invoiceCreationTimestamp;
366
	}
367
 
368
	public void setInvoiceCreationTimestamp(LocalDateTime invoiceCreationTimestamp) {
369
		this.invoiceCreationTimestamp = invoiceCreationTimestamp;
370
	}
371
 
30725 amit.gupta 372
	public String getPolicyPlan() {
373
		return policyPlan;
374
	}
375
 
376
	public void setPolicyPlan(String policyPlan) {
377
		this.policyPlan = policyPlan;
378
	}
379
 
22216 ashik.ali 380
	@Override
30725 amit.gupta 381
	public boolean equals(Object o) {
382
		if (this == o) return true;
383
		if (o == null || getClass() != o.getClass()) return false;
384
		InsurancePolicy that = (InsurancePolicy) o;
385
		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 && policyPlan == that.policyPlan && 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(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(color, that.color) && Objects.equals(coveragePeriod, that.coveragePeriod);
22216 ashik.ali 386
	}
387
 
388
	@Override
30725 amit.gupta 389
	public int hashCode() {
390
		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, color, coveragePeriod, brandId);
22216 ashik.ali 391
	}
392
 
393
	@Override
394
	public String toString() {
395
		return "InsurancePolicy [id=" + id + ", invoiceNumber=" + invoiceNumber + ", retailerId=" + retailerId
396
				+ ", purchaseAmount=" + purchaseAmount + ", saleAmount=" + saleAmount + ", sellingPrice=" + sellingPrice
24440 amit.gupta 397
				+ ", productName=" + productName + ", serialNumber=" + serialNumber + ", modelName=" + modelName
398
				+ ", brand=" + brand + ", policyNumber=" + policyNumber + ", providerId=" + providerId
399
				+ ", customerFirstName=" + customerFirstName + ", customerLastName=" + customerLastName
400
				+ ", customerMobileNumber=" + customerMobileNumber + ", customerEmailId=" + customerEmailId
401
				+ ", customerDateOfBirth=" + customerDateOfBirth + ", customerAddress1=" + customerAddress1
402
				+ ", customerAddress2=" + customerAddress2 + ", customerCity=" + customerCity + ", customerPinCode="
29707 tejbeer 403
				+ customerPinCode + ", customerState=" + customerState + ", deviceInvoiceNumber=" + deviceInvoiceNumber
404
				+ ", posted=" + posted + ", insuranceProvider=" + insuranceProvider + ", createTimestamp="
405
				+ createTimestamp + ", invoiceCreationTimestamp=" + invoiceCreationTimestamp + ", color=" + color
406
				+ ", coveragePeriod=" + coveragePeriod + ", brandId=" + brandId + "]";
22216 ashik.ali 407
	}
408
 
409
}