1 package com.dotmarketing.portlets.discountcode.model; 2 3 import java.util.List ; 4 5 import com.dotmarketing.beans.Inode; 6 import com.dotmarketing.factories.InodeFactory; 7 import com.dotmarketing.util.WebKeys; 8 import com.dotmarketing.portlets.product.model.ProductFormat; 9 10 public class DiscountCode extends Inode { 11 12 public static final int percentageDiscountType = 0; 13 public static final int amountDiscountType = 1; 14 15 private static final long serialVersionUID = 1L; 16 private int discountType; private java.util.Date startDate; private java.util.Date endDate; private String codeId; private String codeDescription; private boolean freeShipping; private boolean noBulkDisc; private float discountAmount; private int minOrder; 27 public DiscountCode(int discountType, java.util.Date startDate, java.util.Date endDate, String codeId, String codeDescription, boolean freeShipping, boolean noBulkDisc, int discountAmount, int minOrder) { 28 this.discountType = discountType; 29 this.startDate = startDate; 30 this.endDate = endDate; 31 this.codeId = codeId; 32 this.codeDescription = codeDescription; 33 this.freeShipping = freeShipping; 34 this.noBulkDisc = noBulkDisc; 35 this.discountAmount = discountAmount; 36 this.minOrder = minOrder; 37 } 38 39 public DiscountCode() { 40 } 41 42 46 50 public int getDiscountType() { 51 return this.discountType; 52 } 53 54 public void setDiscountType(int discountType) { 55 this.discountType = discountType; 56 } 57 public java.util.Date getStartDate() { 58 return this.startDate; 59 } 60 61 public void setStartDate(java.util.Date startDate) { 62 this.startDate = startDate; 63 } 64 public java.util.Date getEndDate() { 65 return this.endDate; 66 } 67 68 public void setEndDate(java.util.Date endDate) { 69 this.endDate = endDate; 70 } 71 public String getCodeId() { 72 return this.codeId; 73 } 74 75 public void setCodeId(String codeId) { 76 this.codeId = codeId; 77 } 78 public String getCodeDescription() { 79 return this.codeDescription; 80 } 81 82 public void setCodeDescription(String codeDescription) { 83 this.codeDescription = codeDescription; 84 } 85 public boolean getFreeShipping() { 86 return this.freeShipping; 87 } 88 89 public void setFreeShipping(boolean freeShipping) { 90 this.freeShipping = freeShipping; 91 } 92 public boolean getNoBulkDisc() { 93 return this.noBulkDisc; 94 } 95 96 public void setNoBulkDisc(boolean noBulkDisc) { 97 this.noBulkDisc = noBulkDisc; 98 } 99 public float getDiscountAmount() { 100 return this.discountAmount; 101 } 102 103 public void setDiscountAmount(float discountAmount) { 104 this.discountAmount = discountAmount; 105 } 106 public int getMinOrder() { 107 return this.minOrder; 108 } 109 110 public void setMinOrder(int minOrder) { 111 this.minOrder = minOrder; 112 } 113 114 public List <ProductFormat> getProductFormatApplicable() 115 { 116 return InodeFactory.getParentsOfClassByRelationType(this,ProductFormat.class,WebKeys.DISCOUNTCODE_PRODUCT_FORMAT); 117 } 118 119 @Override 120 public boolean equals(Object other) 121 { 122 DiscountCode otherDiscountCode = (DiscountCode) other; 123 boolean returnValue = (this.inode == otherDiscountCode.getInode() ? true : false); 124 return returnValue; 125 } 126 } 127 | Popular Tags |