rsanchez
2014-10-22 ddec2c5c7b7842536d6d705c2de20f96e16c8aa8
securis/src/main/java/net/curisit/securis/db/Pack.java
....@@ -74,7 +74,7 @@
7474 @Column(name = "num_licenses")
7575 @JsonProperty("num_licenses")
7676 private int numLicenses;
77
-
77
+
7878 @Column(name = "init_valid_date")
7979 @JsonProperty("init_valid_date")
8080 private Date initValidDate;
....@@ -155,7 +155,7 @@
155155 }
156156 int num = 0;
157157 for (License lic : licenses) {
158
- if (lic.getStatus() == License.Status.ACTIVE) {
158
+ if (lic.getStatus() == LicenseStatus.ACTIVE || lic.getStatus() == LicenseStatus.PRE_ACTIVE) {
159159 num++;
160160 }
161161 }
....@@ -176,7 +176,7 @@
176176 }
177177 int num = 0;
178178 for (License lic : licenses) {
179
- if (lic.getStatus() != License.Status.CANCELED) {
179
+ if (lic.getStatus() != LicenseStatus.CANCELLED) {
180180 num++;
181181 }
182182 }
....@@ -190,7 +190,7 @@
190190 */
191191 @JsonProperty("num_available")
192192 public int getNumAvailables() {
193
- return numLicenses - getNumCreations();
193
+ return numLicenses - getNumActivations();
194194 }
195195
196196 @JsonProperty("organization_name")
....@@ -250,11 +250,12 @@
250250
251251 @JsonProperty("created_by_name")
252252 public String getCreatedByname() {
253
- return createdBy == null ? null : String.format("%s %s (%s)", createdBy.getFirstName(), createdBy.getLastName() != null ? createdBy.getLastName() : "", createdBy.getUsername());
253
+ return createdBy == null ? null : String.format("%s %s (%s)", createdBy.getFirstName(),
254
+ createdBy.getLastName() != null ? createdBy.getLastName() : "", createdBy.getUsername());
254255 }
255256
256257 @JsonProperty("licensetype_code")
257
- public String getLicenseTypcode() {
258
+ public String getLicenseTypeCode() {
258259 return licenseType == null ? null : licenseType.getCode();
259260 }
260261
....@@ -310,13 +311,13 @@
310311 public boolean equals(Object obj) {
311312 if (!(obj instanceof Pack))
312313 return false;
313
- Pack other = (Pack)obj;
314
+ Pack other = (Pack) obj;
314315 return id.equals(other.id);
315316 }
316
-
317
+
317318 @Override
318319 public int hashCode() {
319
-
320
+
320321 return (id == null ? 0 : id.hashCode());
321322 }
322323 }