Subversion Repositories SmartDukaan

Rev

Rev 25726 | Rev 30725 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 25726 Rev 29707
Line 21... Line 21...
21
 * 
21
 * 
22
 * @author ashikali
22
 * @author ashikali
23
 *
23
 *
24
 */
24
 */
25
@Entity
25
@Entity
26
@Table(name="dtr.insurance_policy", schema = "dtr")
26
@Table(name = "dtr.insurance_policy", schema = "dtr")
27
public class InsurancePolicy implements Serializable{
27
public class InsurancePolicy implements Serializable {
28
	
28
 
29
	private static final long serialVersionUID = 1L;
29
	private static final long serialVersionUID = 1L;
30
	
30
 
31
	public InsurancePolicy() {
31
	public InsurancePolicy() {
32
	}
32
	}
33
	
33
 
34
	@Id
34
	@Id
35
	@Column(name="id", unique=true, updatable=false)
35
	@Column(name = "id", unique = true, updatable = false)
36
	@GeneratedValue(strategy = GenerationType.IDENTITY)
36
	@GeneratedValue(strategy = GenerationType.IDENTITY)
37
	private int id;
37
	private int id;
38
	
38
 
39
	@Column(name = "invoice_number")
39
	@Column(name = "invoice_number")
40
	private String invoiceNumber;
40
	private String invoiceNumber;
41
	
41
 
42
	@Column(name="retailer_id")
42
	@Column(name = "retailer_id")
43
	private int retailerId;
43
	private int retailerId;
44
	
44
 
45
	@Column(name= "purchase_amount")
45
	@Column(name = "purchase_amount")
46
	private float purchaseAmount;
46
	private float purchaseAmount;
47
	
47
 
48
	@Column(name= "sale_amount")
48
	@Column(name = "sale_amount")
49
	private float saleAmount;
49
	private float saleAmount;
50
	
50
 
51
	@Column(name= "selling_price")
51
	@Column(name = "selling_price")
52
	private float sellingPrice;
52
	private float sellingPrice;
53
	
53
 
54
	@Column(name= "product_name")
54
	@Column(name = "product_name")
55
	private String productName;
55
	private String productName;
56
	
56
 
57
	public String getProductName() {
57
	public String getProductName() {
58
		return productName;
58
		return productName;
59
	}
59
	}
60
 
60
 
61
	public void setProductName(String productName) {
61
	public void setProductName(String productName) {
62
		this.productName = productName;
62
		this.productName = productName;
63
	}
63
	}
64
 
64
 
65
	@Column(name = "serial_number", unique = true)
65
	@Column(name = "serial_number", unique = true)
66
	private String serialNumber;
66
	private String serialNumber;
67
	
67
 
68
	@Column(name = "model_name")
68
	@Column(name = "model_name")
69
	private String modelName;
69
	private String modelName;
70
	
70
 
71
	@Column(name = "brand")
71
	@Column(name = "brand")
72
	private String brand;
72
	private String brand;
73
	
73
 
74
	@Column(name = "policy_number")
74
	@Column(name = "policy_number")
75
	private String policyNumber;
75
	private String policyNumber;
76
	
76
 
77
	@Column(name="provider_id")
77
	@Column(name = "provider_id")
78
	private int providerId;
78
	private int providerId;
79
	
79
 
80
	@Column(name = "customer_first_name")
80
	@Column(name = "customer_first_name")
81
	private String customerFirstName;
81
	private String customerFirstName;
82
	
82
 
83
	@Column(name = "customer_last_name")
83
	@Column(name = "customer_last_name")
84
	private String customerLastName;
84
	private String customerLastName;
85
	
85
 
86
	@Column(name = "customer_mobile_number")
86
	@Column(name = "customer_mobile_number")
87
	private String customerMobileNumber;
87
	private String customerMobileNumber;
88
	
88
 
89
	@Column(name = "customer_email_id")
89
	@Column(name = "customer_email_id")
90
	private String customerEmailId;
90
	private String customerEmailId;
91
	
91
 
92
	@Column(name = "customer_date_of_birth")
92
	@Column(name = "customer_date_of_birth")
93
	private LocalDate customerDateOfBirth = LocalDate.now();
93
	private LocalDate customerDateOfBirth = LocalDate.now();
94
	
94
 
95
	@Column(name = "customer_address1")
95
	@Column(name = "customer_address1")
96
	private String customerAddress1;
96
	private String customerAddress1;
97
	
97
 
98
	@Column(name = "customer_address2")
98
	@Column(name = "customer_address2")
99
	private String customerAddress2;
99
	private String customerAddress2;
100
	
100
 
101
	@Column(name = "customer_city")
101
	@Column(name = "customer_city")
102
	private String customerCity;
102
	private String customerCity;
103
	
103
 
104
	@Column(name = "customer_pin_code")
104
	@Column(name = "customer_pin_code")
105
	private String customerPinCode;
105
	private String customerPinCode;
106
	
106
 
107
	@Column(name = "customer_state")
107
	@Column(name = "customer_state")
108
	private String customerState;
108
	private String customerState;
-
 
109
 
-
 
110
	@Column(name = "device_invoice_number")
-
 
111
	private String deviceInvoiceNumber;
109
	
112
 
110
	@Column(name = "posted", columnDefinition = "tinyint(1) default 0")
113
	@Column(name = "posted", columnDefinition = "tinyint(1) default 0")
111
	private boolean posted;
114
	private boolean posted;
112
	
115
 
113
	@Transient
116
	@Transient
114
	private InsuranceProvider insuranceProvider;
117
	private InsuranceProvider insuranceProvider;
115
	
118
 
116
	@Convert(converter = LocalDateTimeAttributeConverter.class)
119
	@Convert(converter = LocalDateTimeAttributeConverter.class)
117
	@Column(name="create_timestamp", updatable = false)
120
	@Column(name = "create_timestamp", updatable = false)
118
	private LocalDateTime createTimestamp = LocalDateTime.now();
121
	private LocalDateTime createTimestamp = LocalDateTime.now();
119
	
122
 
120
	@Convert(converter = LocalDateTimeAttributeConverter.class)
123
	@Convert(converter = LocalDateTimeAttributeConverter.class)
121
	@Column(name="invoice_creation_timestamp")
124
	@Column(name = "invoice_creation_timestamp")
122
	private LocalDateTime invoiceCreationTimestamp = LocalDateTime.now();
125
	private LocalDateTime invoiceCreationTimestamp = LocalDateTime.now();
123
	
-
 
124
	
126
 
125
	@Transient 
127
	@Transient
126
	private String color;
128
	private String color;
127
	
129
 
128
	@Transient 
130
	@Transient
129
	private String coveragePeriod;
131
	private String coveragePeriod;
130
	
132
 
131
	@Transient 
133
	@Transient
132
	private int brandId;
134
	private int brandId;
133
	
-
 
134
	
-
 
135
	
-
 
136
 
135
 
137
	public int getBrandId() {
136
	public int getBrandId() {
138
		return brandId;
137
		return brandId;
139
	}
138
	}
140
 
139
 
141
	public void setBrandId(int brandId) {
140
	public void setBrandId(int brandId) {
142
		this.brandId = brandId;
141
		this.brandId = brandId;
143
	}
142
	}
144
 
143
 
-
 
144
	public String getDeviceInvoiceNumber() {
-
 
145
		return deviceInvoiceNumber;
-
 
146
	}
-
 
147
 
-
 
148
	public void setDeviceInvoiceNumber(String deviceInvoiceNumber) {
-
 
149
		this.deviceInvoiceNumber = deviceInvoiceNumber;
-
 
150
	}
-
 
151
 
145
	public String getCoveragePeriod() {
152
	public String getCoveragePeriod() {
146
		return coveragePeriod;
153
		return coveragePeriod;
147
	}
154
	}
148
 
155
 
149
	public void setCoveragePeriod(String coveragePeriod) {
156
	public void setCoveragePeriod(String coveragePeriod) {
Line 156... Line 163...
156
 
163
 
157
	public void setColor(String color) {
164
	public void setColor(String color) {
158
		this.color = color;
165
		this.color = color;
159
	}
166
	}
160
 
167
 
161
	public String getFormattedCreateTimestamp(){
168
	public String getFormattedCreateTimestamp() {
162
		if(createTimestamp == null){
169
		if (createTimestamp == null) {
163
			return null;
170
			return null;
164
		}
171
		}
165
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
172
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
166
		return createTimestamp.format(formatter);
173
		return createTimestamp.format(formatter);
167
    }
174
	}
168
	
175
 
169
	public int getId() {
176
	public int getId() {
170
		return id;
177
		return id;
171
	}
178
	}
172
 
179
 
173
	public void setId(int id) {
180
	public void setId(int id) {
Line 175... Line 182...
175
	}
182
	}
176
 
183
 
177
	public String getInvoiceNumber() {
184
	public String getInvoiceNumber() {
178
		return invoiceNumber;
185
		return invoiceNumber;
179
	}
186
	}
-
 
187
 
180
	public void setInvoiceNumber(String invoiceNumber) {
188
	public void setInvoiceNumber(String invoiceNumber) {
181
		this.invoiceNumber = invoiceNumber;
189
		this.invoiceNumber = invoiceNumber;
182
	}
190
	}
183
	
191
 
184
	public int getRetailerId() {
192
	public int getRetailerId() {
185
		return retailerId;
193
		return retailerId;
186
	}
194
	}
187
 
195
 
188
	public void setRetailerId(int retailerId) {
196
	public void setRetailerId(int retailerId) {
Line 190... Line 198...
190
	}
198
	}
191
 
199
 
192
	public float getPurchaseAmount() {
200
	public float getPurchaseAmount() {
193
		return purchaseAmount;
201
		return purchaseAmount;
194
	}
202
	}
195
	
203
 
196
	public void setPurchaseAmount(float purchaseAmount) {
204
	public void setPurchaseAmount(float purchaseAmount) {
197
		this.purchaseAmount = purchaseAmount;
205
		this.purchaseAmount = purchaseAmount;
198
	}
206
	}
199
	
207
 
200
	public float getSaleAmount() {
208
	public float getSaleAmount() {
201
		return saleAmount;
209
		return saleAmount;
202
	}
210
	}
203
	
211
 
204
	public void setSaleAmount(float saleAmount) {
212
	public void setSaleAmount(float saleAmount) {
205
		this.saleAmount = saleAmount;
213
		this.saleAmount = saleAmount;
206
	}
214
	}
207
 
215
 
208
	public float getSellingPrice() {
216
	public float getSellingPrice() {
Line 218... Line 226...
218
	}
226
	}
219
 
227
 
220
	public void setSerialNumber(String serialNumber) {
228
	public void setSerialNumber(String serialNumber) {
221
		this.serialNumber = serialNumber;
229
		this.serialNumber = serialNumber;
222
	}
230
	}
223
	
231
 
224
	public String getModelName() {
232
	public String getModelName() {
225
		return modelName;
233
		return modelName;
226
	}
234
	}
-
 
235
 
227
	public void setModelName(String modelName) {
236
	public void setModelName(String modelName) {
228
		this.modelName = modelName;
237
		this.modelName = modelName;
229
	}
238
	}
230
	
239
 
231
	public String getBrand() {
240
	public String getBrand() {
232
		return brand;
241
		return brand;
233
	}
242
	}
-
 
243
 
234
	public void setBrand(String brand) {
244
	public void setBrand(String brand) {
235
		this.brand = brand;
245
		this.brand = brand;
236
	}
246
	}
237
 
247
 
238
	public String getPolicyNumber() {
248
	public String getPolicyNumber() {
Line 248... Line 258...
248
	}
258
	}
249
 
259
 
250
	public void setProviderId(int providerId) {
260
	public void setProviderId(int providerId) {
251
		this.providerId = providerId;
261
		this.providerId = providerId;
252
	}
262
	}
253
	
263
 
254
	public String getCustomerFirstName() {
264
	public String getCustomerFirstName() {
255
		return customerFirstName;
265
		return customerFirstName;
256
	}
266
	}
-
 
267
 
257
	public void setCustomerFirstName(String customerFirstName) {
268
	public void setCustomerFirstName(String customerFirstName) {
258
		this.customerFirstName = customerFirstName;
269
		this.customerFirstName = customerFirstName;
259
	}
270
	}
-
 
271
 
260
	public String getCustomerLastName() {
272
	public String getCustomerLastName() {
261
		return customerLastName;
273
		return customerLastName;
262
	}
274
	}
-
 
275
 
263
	public void setCustomerLastName(String customerLastName) {
276
	public void setCustomerLastName(String customerLastName) {
264
		this.customerLastName = customerLastName;
277
		this.customerLastName = customerLastName;
265
	}
278
	}
-
 
279
 
266
	public String getCustomerMobileNumber() {
280
	public String getCustomerMobileNumber() {
267
		return customerMobileNumber;
281
		return customerMobileNumber;
268
	}
282
	}
-
 
283
 
269
	public void setCustomerMobileNumber(String customerMobileNumber) {
284
	public void setCustomerMobileNumber(String customerMobileNumber) {
270
		this.customerMobileNumber = customerMobileNumber;
285
		this.customerMobileNumber = customerMobileNumber;
271
	}
286
	}
-
 
287
 
272
	public String getCustomerEmailId() {
288
	public String getCustomerEmailId() {
273
		return customerEmailId;
289
		return customerEmailId;
274
	}
290
	}
-
 
291
 
275
	public void setCustomerEmailId(String customerEmailId) {
292
	public void setCustomerEmailId(String customerEmailId) {
276
		this.customerEmailId = customerEmailId;
293
		this.customerEmailId = customerEmailId;
277
	}
294
	}
-
 
295
 
278
	public LocalDate getCustomerDateOfBirth() {
296
	public LocalDate getCustomerDateOfBirth() {
279
		return customerDateOfBirth;
297
		return customerDateOfBirth;
280
	}
298
	}
-
 
299
 
281
	public void setCustomerDateOfBirth(LocalDate customerDateOfBirth) {
300
	public void setCustomerDateOfBirth(LocalDate customerDateOfBirth) {
282
		this.customerDateOfBirth = customerDateOfBirth;
301
		this.customerDateOfBirth = customerDateOfBirth;
283
	}
302
	}
-
 
303
 
284
	public String getCustomerAddress1() {
304
	public String getCustomerAddress1() {
285
		return customerAddress1;
305
		return customerAddress1;
286
	}
306
	}
-
 
307
 
287
	public void setCustomerAddress1(String customerAddress1) {
308
	public void setCustomerAddress1(String customerAddress1) {
288
		this.customerAddress1 = customerAddress1;
309
		this.customerAddress1 = customerAddress1;
289
	}
310
	}
-
 
311
 
290
	public String getCustomerAddress2() {
312
	public String getCustomerAddress2() {
291
		return customerAddress2;
313
		return customerAddress2;
292
	}
314
	}
-
 
315
 
293
	public void setCustomerAddress2(String customerAddress2) {
316
	public void setCustomerAddress2(String customerAddress2) {
294
		this.customerAddress2 = customerAddress2;
317
		this.customerAddress2 = customerAddress2;
295
	}
318
	}
-
 
319
 
296
	public String getCustomerCity() {
320
	public String getCustomerCity() {
297
		return customerCity;
321
		return customerCity;
298
	}
322
	}
-
 
323
 
299
	public void setCustomerCity(String customerCity) {
324
	public void setCustomerCity(String customerCity) {
300
		this.customerCity = customerCity;
325
		this.customerCity = customerCity;
301
	}
326
	}
-
 
327
 
302
	public String getCustomerPinCode() {
328
	public String getCustomerPinCode() {
303
		return customerPinCode;
329
		return customerPinCode;
304
	}
330
	}
-
 
331
 
305
	public void setCustomerPinCode(String customerPinCode) {
332
	public void setCustomerPinCode(String customerPinCode) {
306
		this.customerPinCode = customerPinCode;
333
		this.customerPinCode = customerPinCode;
307
	}
334
	}
-
 
335
 
308
	public String getCustomerState() {
336
	public String getCustomerState() {
309
		return customerState;
337
		return customerState;
310
	}
338
	}
-
 
339
 
311
	public void setCustomerState(String customerState) {
340
	public void setCustomerState(String customerState) {
312
		this.customerState = customerState;
341
		this.customerState = customerState;
313
	}
342
	}
314
 
343
 
315
	public boolean isPosted() {
344
	public boolean isPosted() {
316
		return posted;
345
		return posted;
317
	}
346
	}
318
	
347
 
319
	public void setPosted(boolean posted) {
348
	public void setPosted(boolean posted) {
320
		this.posted = posted;
349
		this.posted = posted;
321
	}
350
	}
322
	
351
 
323
	public InsuranceProvider getInsuranceProvider() {
352
	public InsuranceProvider getInsuranceProvider() {
324
		return insuranceProvider;
353
		return insuranceProvider;
325
	}
354
	}
326
	
355
 
327
	public void setInsuranceProvider(InsuranceProvider insuranceProvider) {
356
	public void setInsuranceProvider(InsuranceProvider insuranceProvider) {
328
		this.insuranceProvider = insuranceProvider;
357
		this.insuranceProvider = insuranceProvider;
329
	}
358
	}
330
	
359
 
331
	public LocalDateTime getCreateTimestamp() {
360
	public LocalDateTime getCreateTimestamp() {
332
		return createTimestamp;
361
		return createTimestamp;
333
	}
362
	}
334
 
363
 
335
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
364
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
Line 361... Line 390...
361
		result = prime * result + ((customerFirstName == null) ? 0 : customerFirstName.hashCode());
390
		result = prime * result + ((customerFirstName == null) ? 0 : customerFirstName.hashCode());
362
		result = prime * result + ((customerLastName == null) ? 0 : customerLastName.hashCode());
391
		result = prime * result + ((customerLastName == null) ? 0 : customerLastName.hashCode());
363
		result = prime * result + ((customerMobileNumber == null) ? 0 : customerMobileNumber.hashCode());
392
		result = prime * result + ((customerMobileNumber == null) ? 0 : customerMobileNumber.hashCode());
364
		result = prime * result + ((customerPinCode == null) ? 0 : customerPinCode.hashCode());
393
		result = prime * result + ((customerPinCode == null) ? 0 : customerPinCode.hashCode());
365
		result = prime * result + ((customerState == null) ? 0 : customerState.hashCode());
394
		result = prime * result + ((customerState == null) ? 0 : customerState.hashCode());
-
 
395
		result = prime * result + ((deviceInvoiceNumber == null) ? 0 : deviceInvoiceNumber.hashCode());
366
		result = prime * result + id;
396
		result = prime * result + id;
367
		result = prime * result + ((insuranceProvider == null) ? 0 : insuranceProvider.hashCode());
397
		result = prime * result + ((insuranceProvider == null) ? 0 : insuranceProvider.hashCode());
368
		result = prime * result + ((invoiceCreationTimestamp == null) ? 0 : invoiceCreationTimestamp.hashCode());
398
		result = prime * result + ((invoiceCreationTimestamp == null) ? 0 : invoiceCreationTimestamp.hashCode());
369
		result = prime * result + ((invoiceNumber == null) ? 0 : invoiceNumber.hashCode());
399
		result = prime * result + ((invoiceNumber == null) ? 0 : invoiceNumber.hashCode());
370
		result = prime * result + ((modelName == null) ? 0 : modelName.hashCode());
400
		result = prime * result + ((modelName == null) ? 0 : modelName.hashCode());
Line 459... Line 489...
459
		if (customerState == null) {
489
		if (customerState == null) {
460
			if (other.customerState != null)
490
			if (other.customerState != null)
461
				return false;
491
				return false;
462
		} else if (!customerState.equals(other.customerState))
492
		} else if (!customerState.equals(other.customerState))
463
			return false;
493
			return false;
-
 
494
		if (deviceInvoiceNumber == null) {
-
 
495
			if (other.deviceInvoiceNumber != null)
-
 
496
				return false;
-
 
497
		} else if (!deviceInvoiceNumber.equals(other.deviceInvoiceNumber))
-
 
498
			return false;
464
		if (id != other.id)
499
		if (id != other.id)
465
			return false;
500
			return false;
466
		if (insuranceProvider == null) {
501
		if (insuranceProvider == null) {
467
			if (other.insuranceProvider != null)
502
			if (other.insuranceProvider != null)
468
				return false;
503
				return false;
Line 521... Line 556...
521
				+ ", brand=" + brand + ", policyNumber=" + policyNumber + ", providerId=" + providerId
556
				+ ", brand=" + brand + ", policyNumber=" + policyNumber + ", providerId=" + providerId
522
				+ ", customerFirstName=" + customerFirstName + ", customerLastName=" + customerLastName
557
				+ ", customerFirstName=" + customerFirstName + ", customerLastName=" + customerLastName
523
				+ ", customerMobileNumber=" + customerMobileNumber + ", customerEmailId=" + customerEmailId
558
				+ ", customerMobileNumber=" + customerMobileNumber + ", customerEmailId=" + customerEmailId
524
				+ ", customerDateOfBirth=" + customerDateOfBirth + ", customerAddress1=" + customerAddress1
559
				+ ", customerDateOfBirth=" + customerDateOfBirth + ", customerAddress1=" + customerAddress1
525
				+ ", customerAddress2=" + customerAddress2 + ", customerCity=" + customerCity + ", customerPinCode="
560
				+ ", customerAddress2=" + customerAddress2 + ", customerCity=" + customerCity + ", customerPinCode="
526
				+ customerPinCode + ", customerState=" + customerState + ", posted=" + posted + ", insuranceProvider="
561
				+ customerPinCode + ", customerState=" + customerState + ", deviceInvoiceNumber=" + deviceInvoiceNumber
527
				+ insuranceProvider + ", createTimestamp=" + createTimestamp + ", invoiceCreationTimestamp="
562
				+ ", posted=" + posted + ", insuranceProvider=" + insuranceProvider + ", createTimestamp="
528
				+ invoiceCreationTimestamp + ", color=" + color + ", coveragePeriod=" + coveragePeriod + ", brandId="
563
				+ createTimestamp + ", invoiceCreationTimestamp=" + invoiceCreationTimestamp + ", color=" + color
529
				+ brandId + "]";
564
				+ ", coveragePeriod=" + coveragePeriod + ", brandId=" + brandId + "]";
530
	}
565
	}
531
 
566
 
532
	 
-
 
533
}
567
}
534
568