Skip to content

Commit 54b7c12

Browse files
killbill/killbill/#459 adding new json properties to Invoice/InvoiceItem
1 parent bdd97e5 commit 54b7c12

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/main/java/org/killbill/billing/client/model/Invoice.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public class Invoice extends KillBillObject {
4444
private String bundleKeys;
4545
private List<Credit> credits;
4646
private String status;
47+
private Boolean isParentInvoice;
4748

4849
public Invoice() {}
4950

@@ -62,6 +63,7 @@ public Invoice(@JsonProperty("amount") final BigDecimal amount,
6263
@JsonProperty("status") final String status,
6364
@JsonProperty("credits") final List<Credit> credits,
6465
@JsonProperty("items") final List<InvoiceItem> items,
66+
@JsonProperty("isParentInvoice") final Boolean isParentInvoice,
6567
@JsonProperty("auditLogs") @Nullable final List<AuditLog> auditLogs) {
6668
super(auditLogs);
6769
this.amount = amount;
@@ -78,6 +80,7 @@ public Invoice(@JsonProperty("amount") final BigDecimal amount,
7880
this.credits = credits;
7981
this.items = items;
8082
this.status = status;
83+
this.isParentInvoice = isParentInvoice;
8184
}
8285

8386
public BigDecimal getAmount() {
@@ -192,6 +195,14 @@ public void setStatus(final String status) {
192195
this.status = status;
193196
}
194197

198+
public Boolean getIsParentInvoice() {
199+
return isParentInvoice;
200+
}
201+
202+
public void setIsParentInvoice(final Boolean isParentInvoice) {
203+
this.isParentInvoice = isParentInvoice;
204+
}
205+
195206
@Override
196207
public String toString() {
197208
final StringBuilder sb = new StringBuilder("Invoice{");
@@ -209,6 +220,7 @@ public String toString() {
209220
sb.append(", bundleKeys='").append(bundleKeys).append('\'');
210221
sb.append(", credits=").append(credits);
211222
sb.append(", status=").append(status);
223+
sb.append(", isParentInvoice=").append(isParentInvoice);
212224
sb.append('}');
213225
return sb.toString();
214226
}
@@ -266,6 +278,9 @@ public boolean equals(final Object o) {
266278
if (status != null ? !status.equals(invoice.status) : invoice.status != null) {
267279
return false;
268280
}
281+
if (isParentInvoice != null ? !isParentInvoice.equals(invoice.isParentInvoice) : invoice.isParentInvoice != null) {
282+
return false;
283+
}
269284

270285
return true;
271286
}
@@ -286,6 +301,7 @@ public int hashCode() {
286301
result = 31 * result + (bundleKeys != null ? bundleKeys.hashCode() : 0);
287302
result = 31 * result + (credits != null ? credits.hashCode() : 0);
288303
result = 31 * result + (status != null ? status.hashCode() : 0);
304+
result = 31 * result + (isParentInvoice != null ? isParentInvoice.hashCode() : 0);
289305
return result;
290306
}
291307
}

src/main/java/org/killbill/billing/client/model/InvoiceItem.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class InvoiceItem extends KillBillObject {
3434
private UUID invoiceId;
3535
private UUID linkedInvoiceItemId;
3636
private UUID accountId;
37+
private UUID childAccountId;
3738
private UUID bundleId;
3839
private UUID subscriptionId;
3940
private String planName;
@@ -53,6 +54,7 @@ public InvoiceItem(@JsonProperty("invoiceItemId") final UUID invoiceItemId,
5354
@JsonProperty("invoiceId") final UUID invoiceId,
5455
@JsonProperty("linkedInvoiceItemId") final UUID linkedInvoiceItemId,
5556
@JsonProperty("accountId") final UUID accountId,
57+
@JsonProperty("childAccountId") final UUID childAccountId,
5658
@JsonProperty("bundleId") final UUID bundleId,
5759
@JsonProperty("subscriptionId") final UUID subscriptionId,
5860
@JsonProperty("planName") final String planName,
@@ -70,6 +72,7 @@ public InvoiceItem(@JsonProperty("invoiceItemId") final UUID invoiceItemId,
7072
this.invoiceId = invoiceId;
7173
this.linkedInvoiceItemId = linkedInvoiceItemId;
7274
this.accountId = accountId;
75+
this.childAccountId = childAccountId;
7376
this.bundleId = bundleId;
7477
this.subscriptionId = subscriptionId;
7578
this.planName = planName;
@@ -114,6 +117,14 @@ public void setAccountId(final UUID accountId) {
114117
this.accountId = accountId;
115118
}
116119

120+
public UUID getChildAccountId() {
121+
return childAccountId;
122+
}
123+
124+
public void setChildAccountId(final UUID childAccountId) {
125+
this.childAccountId = childAccountId;
126+
}
127+
117128
public UUID getBundleId() {
118129
return bundleId;
119130
}
@@ -216,6 +227,9 @@ public boolean equals(final Object o) {
216227
if (accountId != null ? !accountId.equals(that.accountId) : that.accountId != null) {
217228
return false;
218229
}
230+
if (childAccountId != null ? !childAccountId.equals(that.childAccountId) : that.childAccountId != null) {
231+
return false;
232+
}
219233
if (amount != null ? amount.compareTo(that.amount) != 0 : that.amount != null) {
220234
return false;
221235
}
@@ -268,6 +282,7 @@ public int hashCode() {
268282
result = 31 * result + (invoiceId != null ? invoiceId.hashCode() : 0);
269283
result = 31 * result + (linkedInvoiceItemId != null ? linkedInvoiceItemId.hashCode() : 0);
270284
result = 31 * result + (accountId != null ? accountId.hashCode() : 0);
285+
result = 31 * result + (childAccountId != null ? childAccountId.hashCode() : 0);
271286
result = 31 * result + (bundleId != null ? bundleId.hashCode() : 0);
272287
result = 31 * result + (subscriptionId != null ? subscriptionId.hashCode() : 0);
273288
result = 31 * result + (planName != null ? planName.hashCode() : 0);

0 commit comments

Comments
 (0)