| .. | .. |
|---|
| 74 | 74 | @Column(name = "num_licenses") |
|---|
| 75 | 75 | @JsonProperty("num_licenses") |
|---|
| 76 | 76 | private int numLicenses; |
|---|
| 77 | | - |
|---|
| 77 | + |
|---|
| 78 | 78 | @Column(name = "init_valid_date") |
|---|
| 79 | 79 | @JsonProperty("init_valid_date") |
|---|
| 80 | 80 | private Date initValidDate; |
|---|
| .. | .. |
|---|
| 155 | 155 | } |
|---|
| 156 | 156 | int num = 0; |
|---|
| 157 | 157 | for (License lic : licenses) { |
|---|
| 158 | | - if (lic.getStatus() == License.Status.ACTIVE) { |
|---|
| 158 | + if (lic.getStatus() == LicenseStatus.ACTIVE || lic.getStatus() == LicenseStatus.PRE_ACTIVE) { |
|---|
| 159 | 159 | num++; |
|---|
| 160 | 160 | } |
|---|
| 161 | 161 | } |
|---|
| .. | .. |
|---|
| 176 | 176 | } |
|---|
| 177 | 177 | int num = 0; |
|---|
| 178 | 178 | for (License lic : licenses) { |
|---|
| 179 | | - if (lic.getStatus() != License.Status.CANCELED) { |
|---|
| 179 | + if (lic.getStatus() != LicenseStatus.CANCELLED) { |
|---|
| 180 | 180 | num++; |
|---|
| 181 | 181 | } |
|---|
| 182 | 182 | } |
|---|
| .. | .. |
|---|
| 190 | 190 | */ |
|---|
| 191 | 191 | @JsonProperty("num_available") |
|---|
| 192 | 192 | public int getNumAvailables() { |
|---|
| 193 | | - return numLicenses - getNumCreations(); |
|---|
| 193 | + return numLicenses - getNumActivations(); |
|---|
| 194 | 194 | } |
|---|
| 195 | 195 | |
|---|
| 196 | 196 | @JsonProperty("organization_name") |
|---|
| .. | .. |
|---|
| 250 | 250 | |
|---|
| 251 | 251 | @JsonProperty("created_by_name") |
|---|
| 252 | 252 | 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()); |
|---|
| 254 | 255 | } |
|---|
| 255 | 256 | |
|---|
| 256 | 257 | @JsonProperty("licensetype_code") |
|---|
| 257 | | - public String getLicenseTypcode() { |
|---|
| 258 | + public String getLicenseTypeCode() { |
|---|
| 258 | 259 | return licenseType == null ? null : licenseType.getCode(); |
|---|
| 259 | 260 | } |
|---|
| 260 | 261 | |
|---|
| .. | .. |
|---|
| 310 | 311 | public boolean equals(Object obj) { |
|---|
| 311 | 312 | if (!(obj instanceof Pack)) |
|---|
| 312 | 313 | return false; |
|---|
| 313 | | - Pack other = (Pack)obj; |
|---|
| 314 | + Pack other = (Pack) obj; |
|---|
| 314 | 315 | return id.equals(other.id); |
|---|
| 315 | 316 | } |
|---|
| 316 | | - |
|---|
| 317 | + |
|---|
| 317 | 318 | @Override |
|---|
| 318 | 319 | public int hashCode() { |
|---|
| 319 | | - |
|---|
| 320 | + |
|---|
| 320 | 321 | return (id == null ? 0 : id.hashCode()); |
|---|
| 321 | 322 | } |
|---|
| 322 | 323 | } |
|---|