killbill-memoizeit
Changes
account/src/main/java/org/killbill/billing/account/api/user/DefaultAccountCreationEvent.java 13(+13 -0)
account/src/test/java/org/killbill/billing/account/api/user/TestDefaultAccountUserApiWithMocks.java 3(+2 -1)
pom.xml 2(+1 -1)
Details
diff --git a/account/src/main/java/org/killbill/billing/account/api/DefaultAccount.java b/account/src/main/java/org/killbill/billing/account/api/DefaultAccount.java
index 637907d..0fcf194 100644
--- a/account/src/main/java/org/killbill/billing/account/api/DefaultAccount.java
+++ b/account/src/main/java/org/killbill/billing/account/api/DefaultAccount.java
@@ -52,6 +52,7 @@ public class DefaultAccount extends EntityBase implements Account {
private final String country;
private final String postalCode;
private final String phone;
+ private final String notes;
private final Boolean isMigrated;
private final Boolean isNotifiedForInvoices;
@@ -82,6 +83,7 @@ public class DefaultAccount extends EntityBase implements Account {
data.getCountry(),
data.getPostalCode(),
data.getPhone(),
+ data.getNotes(),
data.isMigrated(),
data.isNotifiedForInvoices());
}
@@ -94,7 +96,7 @@ public class DefaultAccount extends EntityBase implements Account {
final DateTimeZone timeZone, final String locale,
final String address1, final String address2, final String companyName,
final String city, final String stateOrProvince, final String country,
- final String postalCode, final String phone,
+ final String postalCode, final String phone, final String notes,
final Boolean isMigrated, final Boolean isNotifiedForInvoices) {
this(id,
null,
@@ -118,6 +120,7 @@ public class DefaultAccount extends EntityBase implements Account {
country,
postalCode,
phone,
+ notes,
isMigrated,
isNotifiedForInvoices);
}
@@ -130,7 +133,7 @@ public class DefaultAccount extends EntityBase implements Account {
final DateTimeZone timeZone, final String locale,
final String address1, final String address2, final String companyName,
final String city, final String stateOrProvince, final String country,
- final String postalCode, final String phone,
+ final String postalCode, final String phone, final String notes,
final Boolean isMigrated, final Boolean isNotifiedForInvoices) {
super(id, createdDate, updatedDate);
this.externalKey = externalKey;
@@ -152,6 +155,7 @@ public class DefaultAccount extends EntityBase implements Account {
this.postalCode = postalCode;
this.country = country;
this.phone = phone;
+ this.notes = notes;
this.isMigrated = isMigrated;
this.isNotifiedForInvoices = isNotifiedForInvoices;
}
@@ -179,6 +183,7 @@ public class DefaultAccount extends EntityBase implements Account {
accountModelDao.getCountry(),
accountModelDao.getPostalCode(),
accountModelDao.getPhone(),
+ accountModelDao.getNotes(),
accountModelDao.getMigrated(),
accountModelDao.getIsNotifiedForInvoices());
}
@@ -290,6 +295,11 @@ public class DefaultAccount extends EntityBase implements Account {
}
@Override
+ public String getNotes() {
+ return notes;
+ }
+
+ @Override
public MutableAccountData toMutableAccountData() {
return new DefaultMutableAccountData(this);
}
@@ -350,6 +360,7 @@ public class DefaultAccount extends EntityBase implements Account {
accountData.setCountry(country != null ? country : currentAccount.getCountry());
accountData.setPostalCode(postalCode != null ? postalCode : currentAccount.getPostalCode());
accountData.setPhone(phone != null ? phone : currentAccount.getPhone());
+ accountData.setNotes(notes != null ? notes : currentAccount.getNotes());
accountData.setParentAccountId(parentAccountId != null ? parentAccountId : currentAccount.getParentAccountId());
accountData.setIsPaymentDelegatedToParent(isPaymentDelegatedToParent != null ? isPaymentDelegatedToParent : currentAccount.isPaymentDelegatedToParent());
final Boolean isMigrated = this.isMigrated != null ? this.isMigrated : currentAccount.isMigrated();
@@ -399,6 +410,7 @@ public class DefaultAccount extends EntityBase implements Account {
", stateOrProvince=" + stateOrProvince +
", postalCode=" + postalCode +
", country=" + country +
+ ", notes=" + notes +
"]";
}
@@ -479,6 +491,9 @@ public class DefaultAccount extends EntityBase implements Account {
if (timeZone != null ? !timeZone.equals(that.timeZone) : that.timeZone != null) {
return false;
}
+ if (notes != null ? !notes.equals(that.notes) : that.notes != null) {
+ return false;
+ }
return true;
}
@@ -505,6 +520,7 @@ public class DefaultAccount extends EntityBase implements Account {
result = 31 * result + (country != null ? country.hashCode() : 0);
result = 31 * result + (postalCode != null ? postalCode.hashCode() : 0);
result = 31 * result + (phone != null ? phone.hashCode() : 0);
+ result = 31 * result + (notes != null ? notes.hashCode() : 0);
result = 31 * result + (isMigrated != null ? isMigrated.hashCode() : 0);
result = 31 * result + (isNotifiedForInvoices != null ? isNotifiedForInvoices.hashCode() : 0);
return result;
diff --git a/account/src/main/java/org/killbill/billing/account/api/DefaultMutableAccountData.java b/account/src/main/java/org/killbill/billing/account/api/DefaultMutableAccountData.java
index 63de386..1f1c6fc 100644
--- a/account/src/main/java/org/killbill/billing/account/api/DefaultMutableAccountData.java
+++ b/account/src/main/java/org/killbill/billing/account/api/DefaultMutableAccountData.java
@@ -47,6 +47,7 @@ public class DefaultMutableAccountData implements MutableAccountData {
private String country;
private String postalCode;
private String phone;
+ private String notes;
private Boolean isMigrated;
private Boolean isNotifiedForInvoices;
@@ -57,7 +58,7 @@ public class DefaultMutableAccountData implements MutableAccountData {
final String locale, final String address1, final String address2,
final String companyName, final String city, final String stateOrProvince,
final String country, final String postalCode, final String phone,
- final boolean isMigrated, final boolean isNotifiedForInvoices) {
+ final String notes, final boolean isMigrated, final boolean isNotifiedForInvoices) {
this.externalKey = externalKey;
this.email = email;
this.name = name;
@@ -77,6 +78,7 @@ public class DefaultMutableAccountData implements MutableAccountData {
this.country = country;
this.postalCode = postalCode;
this.phone = phone;
+ this.notes = notes;
this.isMigrated = isMigrated;
this.isNotifiedForInvoices = isNotifiedForInvoices;
}
@@ -101,6 +103,7 @@ public class DefaultMutableAccountData implements MutableAccountData {
this.country = accountData.getCountry();
this.postalCode = accountData.getPostalCode();
this.phone = accountData.getPhone();
+ this.notes = accountData.getNotes();
this.isMigrated = accountData.isMigrated();
this.isNotifiedForInvoices = accountData.isNotifiedForInvoices();
}
@@ -276,6 +279,16 @@ public class DefaultMutableAccountData implements MutableAccountData {
}
@Override
+ public String getNotes() {
+ return notes;
+ }
+
+ @Override
+ public void setNotes(final String notes) {
+ this.notes = notes;
+ }
+
+ @Override
public Boolean isMigrated() {
return isMigrated;
}
diff --git a/account/src/main/java/org/killbill/billing/account/api/user/DefaultAccountCreationEvent.java b/account/src/main/java/org/killbill/billing/account/api/user/DefaultAccountCreationEvent.java
index b4189b0..1ddfd15 100644
--- a/account/src/main/java/org/killbill/billing/account/api/user/DefaultAccountCreationEvent.java
+++ b/account/src/main/java/org/killbill/billing/account/api/user/DefaultAccountCreationEvent.java
@@ -123,6 +123,7 @@ public class DefaultAccountCreationEvent extends BusEventBase implements Account
private final String postalCode;
private final String country;
private final String phone;
+ private final String notes;
private final Boolean isMigrated;
private final Boolean isNotifiedForInvoices;
@@ -146,6 +147,7 @@ public class DefaultAccountCreationEvent extends BusEventBase implements Account
d.getPostalCode(),
d.getCountry(),
d.getPhone(),
+ d.getNotes(),
d.getMigrated(),
d.getIsNotifiedForInvoices());
}
@@ -170,6 +172,7 @@ public class DefaultAccountCreationEvent extends BusEventBase implements Account
@JsonProperty("postalCode") final String postalCode,
@JsonProperty("country") final String country,
@JsonProperty("phone") final String phone,
+ @JsonProperty("notes") final String notes,
@JsonProperty("isMigrated") final Boolean isMigrated,
@JsonProperty("isNotifiedForInvoices") final Boolean isNotifiedForInvoices) {
this.externalKey = externalKey;
@@ -191,6 +194,7 @@ public class DefaultAccountCreationEvent extends BusEventBase implements Account
this.postalCode = postalCode;
this.country = country;
this.phone = phone;
+ this.notes = notes;
this.isMigrated = isMigrated;
this.isNotifiedForInvoices = isNotifiedForInvoices;
}
@@ -301,6 +305,11 @@ public class DefaultAccountCreationEvent extends BusEventBase implements Account
}
@Override
+ public String getNotes() {
+ return notes;
+ }
+
+ @Override
public UUID getPaymentMethodId() {
return paymentMethodId;
}
@@ -396,6 +405,9 @@ public class DefaultAccountCreationEvent extends BusEventBase implements Account
if (phone != null ? !phone.equals(that.phone) : that.phone != null) {
return false;
}
+ if (notes != null ? !notes.equals(that.notes) : that.notes != null) {
+ return false;
+ }
if (postalCode != null ? !postalCode.equals(that.postalCode) : that.postalCode != null) {
return false;
}
@@ -430,6 +442,7 @@ public class DefaultAccountCreationEvent extends BusEventBase implements Account
result = 31 * result + (postalCode != null ? postalCode.hashCode() : 0);
result = 31 * result + (country != null ? country.hashCode() : 0);
result = 31 * result + (phone != null ? phone.hashCode() : 0);
+ result = 31 * result + (notes != null ? notes.hashCode() : 0);
result = 31 * result + (isMigrated != null ? isMigrated.hashCode() : 0);
result = 31 * result + (isNotifiedForInvoices != null ? isNotifiedForInvoices.hashCode() : 0);
return result;
diff --git a/account/src/main/java/org/killbill/billing/account/dao/AccountModelDao.java b/account/src/main/java/org/killbill/billing/account/dao/AccountModelDao.java
index 7ddf6cc..91fe1ce 100644
--- a/account/src/main/java/org/killbill/billing/account/dao/AccountModelDao.java
+++ b/account/src/main/java/org/killbill/billing/account/dao/AccountModelDao.java
@@ -57,6 +57,7 @@ public class AccountModelDao extends EntityModelDaoBase implements EntityModelDa
private String country;
private String postalCode;
private String phone;
+ private String notes;
private Boolean migrated;
private Boolean isNotifiedForInvoices;
@@ -69,7 +70,7 @@ public class AccountModelDao extends EntityModelDaoBase implements EntityModelDa
final int billingCycleDayLocal, final UUID paymentMethodId, final DateTimeZone timeZone,
final String locale, final String address1, final String address2, final String companyName,
final String city, final String stateOrProvince, final String country, final String postalCode,
- final String phone, final Boolean migrated, final Boolean notifiedForInvoices) {
+ final String phone, final String notes, final Boolean migrated, final Boolean notifiedForInvoices) {
super(id, createdDate, updatedDate);
this.externalKey = MoreObjects.firstNonNull(externalKey, id.toString());
this.email = email;
@@ -90,6 +91,7 @@ public class AccountModelDao extends EntityModelDaoBase implements EntityModelDa
this.country = country;
this.postalCode = postalCode;
this.phone = phone;
+ this.notes = notes;
this.migrated = migrated;
this.isNotifiedForInvoices = notifiedForInvoices;
}
@@ -117,6 +119,7 @@ public class AccountModelDao extends EntityModelDaoBase implements EntityModelDa
account.getCountry(),
account.getPostalCode(),
account.getPhone(),
+ account.getNotes(),
account.isMigrated(),
// There is a NOT NULL constraint on the is_notified_for_invoices column
MoreObjects.firstNonNull(account.isNotifiedForInvoices(), false));
@@ -282,6 +285,14 @@ public class AccountModelDao extends EntityModelDaoBase implements EntityModelDa
this.phone = phone;
}
+ public String getNotes() {
+ return notes;
+ }
+
+ public void setNotes(final String notes) {
+ this.notes = notes;
+ }
+
public Boolean getMigrated() {
return migrated;
}
@@ -323,6 +334,7 @@ public class AccountModelDao extends EntityModelDaoBase implements EntityModelDa
sb.append(", country='").append(country).append('\'');
sb.append(", postalCode='").append(postalCode).append('\'');
sb.append(", phone='").append(phone).append('\'');
+ sb.append(", notes='").append(notes).append('\'');
sb.append(", migrated=").append(migrated);
sb.append(", isNotifiedForInvoices=").append(isNotifiedForInvoices);
sb.append('}');
@@ -397,6 +409,9 @@ public class AccountModelDao extends EntityModelDaoBase implements EntityModelDa
if (phone != null ? !phone.equals(that.phone) : that.phone != null) {
return false;
}
+ if (notes != null ? !notes.equals(that.notes) : that.notes != null) {
+ return false;
+ }
if (postalCode != null ? !postalCode.equals(that.postalCode) : that.postalCode != null) {
return false;
}
@@ -432,6 +447,7 @@ public class AccountModelDao extends EntityModelDaoBase implements EntityModelDa
result = 31 * result + (country != null ? country.hashCode() : 0);
result = 31 * result + (postalCode != null ? postalCode.hashCode() : 0);
result = 31 * result + (phone != null ? phone.hashCode() : 0);
+ result = 31 * result + (notes != null ? notes.hashCode() : 0);
result = 31 * result + (migrated != null ? migrated.hashCode() : 0);
result = 31 * result + (isNotifiedForInvoices != null ? isNotifiedForInvoices.hashCode() : 0);
return result;
diff --git a/account/src/main/resources/org/killbill/billing/account/dao/AccountSqlDao.sql.stg b/account/src/main/resources/org/killbill/billing/account/dao/AccountSqlDao.sql.stg
index a2a86bb..d48a16b 100644
--- a/account/src/main/resources/org/killbill/billing/account/dao/AccountSqlDao.sql.stg
+++ b/account/src/main/resources/org/killbill/billing/account/dao/AccountSqlDao.sql.stg
@@ -24,6 +24,7 @@ tableFields(prefix) ::= <<
, <prefix>country
, <prefix>postal_code
, <prefix>phone
+, <prefix>notes
, <prefix>migrated
, <prefix>is_notified_for_invoices
, <prefix>created_by
@@ -52,6 +53,7 @@ tableValues() ::= <<
, :country
, :postalCode
, :phone
+, :notes
, :migrated
, :isNotifiedForInvoices
, :createdBy
@@ -70,7 +72,7 @@ update() ::= <<
currency = :currency, billing_cycle_day_local = :billingCycleDayLocal,
payment_method_id = :paymentMethodId, time_zone = :timeZone, locale = :locale,
address1 = :address1, address2 = :address2, company_name = :companyName, city = :city, state_or_province = :stateOrProvince,
- country = :country, postal_code = :postalCode, phone = :phone,
+ country = :country, postal_code = :postalCode, phone = :phone, notes = :notes,
is_notified_for_invoices = :isNotifiedForInvoices, updated_date = :updatedDate, updated_by = :updatedBy
WHERE id = :id <AND_CHECK_TENANT()>;
>>
diff --git a/account/src/main/resources/org/killbill/billing/account/ddl.sql b/account/src/main/resources/org/killbill/billing/account/ddl.sql
index 9699c67..b025697 100644
--- a/account/src/main/resources/org/killbill/billing/account/ddl.sql
+++ b/account/src/main/resources/org/killbill/billing/account/ddl.sql
@@ -23,6 +23,7 @@ CREATE TABLE accounts (
country varchar(50) DEFAULT NULL,
postal_code varchar(16) DEFAULT NULL,
phone varchar(25) DEFAULT NULL,
+ notes varchar(4096) DEFAULT NULL,
migrated boolean default false,
is_notified_for_invoices boolean NOT NULL,
created_date datetime NOT NULL,
@@ -60,6 +61,7 @@ CREATE TABLE account_history (
country varchar(50) DEFAULT NULL,
postal_code varchar(16) DEFAULT NULL,
phone varchar(25) DEFAULT NULL,
+ notes varchar(4096) DEFAULT NULL,
migrated boolean default false,
is_notified_for_invoices boolean NOT NULL,
change_type varchar(6) NOT NULL,
diff --git a/account/src/test/java/org/killbill/billing/account/AccountTestUtils.java b/account/src/test/java/org/killbill/billing/account/AccountTestUtils.java
index 61b1127..7934e12 100644
--- a/account/src/test/java/org/killbill/billing/account/AccountTestUtils.java
+++ b/account/src/test/java/org/killbill/billing/account/AccountTestUtils.java
@@ -101,10 +101,11 @@ public abstract class AccountTestUtils {
final String stateOrProvince = UUID.randomUUID().toString();
final String country = Locale.GERMANY.getCountry();
final String postalCode = UUID.randomUUID().toString().substring(0, 4);
+ final String notes = UUID.randomUUID().toString();
return new DefaultMutableAccountData(externalKey, email, name, firstNameLength, currency, null, false,
billCycleDayLocal, paymentMethodId, timeZone,
locale, address1, address2, companyName, city, stateOrProvince,
- country, postalCode, phone, false, true);
+ country, postalCode, phone, notes, false, true);
}
}
diff --git a/account/src/test/java/org/killbill/billing/account/api/TestDefaultAccount.java b/account/src/test/java/org/killbill/billing/account/api/TestDefaultAccount.java
index 1d8c654..f88b9e0 100644
--- a/account/src/test/java/org/killbill/billing/account/api/TestDefaultAccount.java
+++ b/account/src/test/java/org/killbill/billing/account/api/TestDefaultAccount.java
@@ -151,6 +151,7 @@ public class TestDefaultAccount extends AccountTestSuiteNoDB {
Assert.assertEquals(finalAccount.getCountry(), delegateAccount.getCountry());
Assert.assertEquals(finalAccount.getPostalCode(), delegateAccount.getPostalCode());
Assert.assertEquals(finalAccount.getPhone(), delegateAccount.getPhone());
+ Assert.assertEquals(finalAccount.getNotes(), delegateAccount.getNotes());
Assert.assertEquals(finalAccount.isMigrated(), delegateAccount.isMigrated());
Assert.assertEquals(finalAccount.isNotifiedForInvoices(), delegateAccount.isNotifiedForInvoices());
}
diff --git a/account/src/test/java/org/killbill/billing/account/api/user/TestDefaultAccountUserApi.java b/account/src/test/java/org/killbill/billing/account/api/user/TestDefaultAccountUserApi.java
index 05980b0..78df7a1 100644
--- a/account/src/test/java/org/killbill/billing/account/api/user/TestDefaultAccountUserApi.java
+++ b/account/src/test/java/org/killbill/billing/account/api/user/TestDefaultAccountUserApi.java
@@ -73,7 +73,7 @@ public class TestDefaultAccountUserApi extends AccountTestSuiteWithEmbeddedDB {
// Update the address and leave other fields null
final MutableAccountData mutableAccountData = new DefaultMutableAccountData(null, null, null, 0, null, null, false, 0, null,
null, null, null, null, null, null,
- null, null, null, null, false, false);
+ null, null, null, null, null, false, false);
final String newAddress1 = UUID.randomUUID().toString();
mutableAccountData.setAddress1(newAddress1);
diff --git a/account/src/test/java/org/killbill/billing/account/api/user/TestDefaultAccountUserApiWithMocks.java b/account/src/test/java/org/killbill/billing/account/api/user/TestDefaultAccountUserApiWithMocks.java
index 43bcb2f..793d689 100644
--- a/account/src/test/java/org/killbill/billing/account/api/user/TestDefaultAccountUserApiWithMocks.java
+++ b/account/src/test/java/org/killbill/billing/account/api/user/TestDefaultAccountUserApiWithMocks.java
@@ -76,11 +76,12 @@ public class TestDefaultAccountUserApiWithMocks extends AccountTestSuiteNoDB {
final String country = UUID.randomUUID().toString();
final String postalCode = UUID.randomUUID().toString();
final String phone = UUID.randomUUID().toString();
+ final String notes = UUID.randomUUID().toString();
final Boolean isMigrated = true;
final Boolean isNotifiedForInvoices = false;
final AccountData data = new DefaultAccount(id, externalKey, email, name, firstNameLength, currency, null, false, billCycleDay,
paymentMethodId, timeZone, locale, address1, address2, companyName,
- city, stateOrProvince, country, postalCode, phone, isMigrated, isNotifiedForInvoices);
+ city, stateOrProvince, country, postalCode, phone, notes, isMigrated, isNotifiedForInvoices);
accountUserApi.createAccount(data, callContext);
diff --git a/account/src/test/java/org/killbill/billing/account/api/user/TestEventJson.java b/account/src/test/java/org/killbill/billing/account/api/user/TestEventJson.java
index 26d49dc..c5176da 100644
--- a/account/src/test/java/org/killbill/billing/account/api/user/TestEventJson.java
+++ b/account/src/test/java/org/killbill/billing/account/api/user/TestEventJson.java
@@ -51,7 +51,7 @@ public class TestEventJson extends AccountTestSuiteNoDB {
@Test(groups = "fast", description="Test Account event serialization")
public void testAccountCreationEvent() throws Exception {
final DefaultAccountData data = new DefaultAccountData("dsfdsf", "bobo", 3, "bobo@yahoo.com", 12, "USD", null, false, UUID.randomUUID(),
- "UTC", "US", "21 avenue", "", "Gling", "San Franciso", "CA", "94110", "USA", "4126789887", false, false);
+ "UTC", "US", "21 avenue", "", "Gling", "San Franciso", "CA", "94110", "USA", "4126789887", "notes", false, false);
final DefaultAccountCreationEvent e = new DefaultAccountCreationEvent(data, UUID.randomUUID(), 1L, 2L, null);
final String json = mapper.writeValueAsString(e);
diff --git a/account/src/test/java/org/killbill/billing/account/dao/TestAccountDao.java b/account/src/test/java/org/killbill/billing/account/dao/TestAccountDao.java
index 70fbbba..237b8f5 100644
--- a/account/src/test/java/org/killbill/billing/account/dao/TestAccountDao.java
+++ b/account/src/test/java/org/killbill/billing/account/dao/TestAccountDao.java
@@ -65,7 +65,7 @@ public class TestAccountDao extends AccountTestSuiteWithEmbeddedDB {
final AccountData accountData = new DefaultMutableAccountData(null, email, name, 0, null, null, false,
0, null, null, null, null,
null, null, null, null, null,
- null, null, false, true);
+ null, null, null, false, true);
final AccountModelDao account = new AccountModelDao(UUID.randomUUID(), accountData);
accountDao.create(account, internalCallContext);
diff --git a/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/AccountJson.java b/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/AccountJson.java
index 58d0576..e3d3e80 100644
--- a/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/AccountJson.java
+++ b/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/AccountJson.java
@@ -62,6 +62,7 @@ public class AccountJson extends JsonBase {
private final String country;
private final String locale;
private final String phone;
+ private final String notes;
private final Boolean isMigrated;
private final Boolean isNotifiedForInvoices;
@@ -89,6 +90,7 @@ public class AccountJson extends JsonBase {
this.country = account.getCountry();
this.locale = account.getLocale();
this.phone = account.getPhone();
+ this.notes = account.getNotes();
this.isMigrated = account.isMigrated();
this.isNotifiedForInvoices = account.isNotifiedForInvoices();
}
@@ -114,6 +116,7 @@ public class AccountJson extends JsonBase {
@JsonProperty("country") final String country,
@JsonProperty("locale") final String locale,
@JsonProperty("phone") final String phone,
+ @JsonProperty("notes") final String notes,
@JsonProperty("isMigrated") final Boolean isMigrated,
@JsonProperty("isNotifiedForInvoices") final Boolean isNotifiedForInvoices,
@JsonProperty("accountBalance") final BigDecimal accountBalance,
@@ -141,6 +144,7 @@ public class AccountJson extends JsonBase {
this.country = country;
this.locale = locale;
this.phone = phone;
+ this.notes = notes;
this.isMigrated = isMigrated;
this.isNotifiedForInvoices = isNotifiedForInvoices;
this.accountCBA = accountCBA;
@@ -173,6 +177,11 @@ public class AccountJson extends JsonBase {
}
@Override
+ public String getNotes() {
+ return notes;
+ }
+
+ @Override
public Boolean isMigrated() {
return isMigrated;
}
@@ -360,6 +369,10 @@ public class AccountJson extends JsonBase {
return phone;
}
+ public String getNotes() {
+ return notes;
+ }
+
@JsonProperty("isMigrated")
public Boolean isMigrated() {
return isMigrated;
@@ -395,6 +408,7 @@ public class AccountJson extends JsonBase {
", country='" + country + '\'' +
", locale='" + locale + '\'' +
", phone='" + phone + '\'' +
+ ", notes='" + notes + '\'' +
", isMigrated=" + isMigrated +
", isNotifiedForInvoices=" + isNotifiedForInvoices +
'}';
@@ -474,6 +488,9 @@ public class AccountJson extends JsonBase {
if (phone != null ? !phone.equals(that.phone) : that.phone != null) {
return false;
}
+ if (notes != null ? !notes.equals(that.notes) : that.notes != null) {
+ return false;
+ }
if (postalCode != null ? !postalCode.equals(that.postalCode) : that.postalCode != null) {
return false;
}
@@ -511,6 +528,7 @@ public class AccountJson extends JsonBase {
result = 31 * result + (country != null ? country.hashCode() : 0);
result = 31 * result + (locale != null ? locale.hashCode() : 0);
result = 31 * result + (phone != null ? phone.hashCode() : 0);
+ result = 31 * result + (notes != null ? notes.hashCode() : 0);
result = 31 * result + (isMigrated != null ? isMigrated.hashCode() : 0);
result = 31 * result + (isNotifiedForInvoices != null ? isNotifiedForInvoices.hashCode() : 0);
return result;
diff --git a/jaxrs/src/test/java/org/killbill/billing/jaxrs/json/TestAccountJson.java b/jaxrs/src/test/java/org/killbill/billing/jaxrs/json/TestAccountJson.java
index 240b0eb..b601e7c 100644
--- a/jaxrs/src/test/java/org/killbill/billing/jaxrs/json/TestAccountJson.java
+++ b/jaxrs/src/test/java/org/killbill/billing/jaxrs/json/TestAccountJson.java
@@ -49,6 +49,7 @@ public class TestAccountJson extends JaxrsTestSuiteNoDB {
final String country = UUID.randomUUID().toString();
final String locale = UUID.randomUUID().toString();
final String phone = UUID.randomUUID().toString();
+ final String notes = UUID.randomUUID().toString();
final Boolean isMigrated = true;
final Boolean isNotifiedForInvoice = false;
final String parentAccountId = UUID.randomUUID().toString();
@@ -56,7 +57,7 @@ public class TestAccountJson extends JaxrsTestSuiteNoDB {
final AccountJson accountJson = new AccountJson(accountId, name, length, externalKey,
email, billCycleDayLocal, currency, parentAccountId, true, paymentMethodId,
timeZone, address1, address2, postalCode, company, city, state,
- country, locale, phone, isMigrated, isNotifiedForInvoice, null, null, null);
+ country, locale, phone, notes, isMigrated, isNotifiedForInvoice, null, null, null);
Assert.assertEquals(accountJson.getAccountId(), accountId);
Assert.assertEquals(accountJson.getName(), name);
Assert.assertEquals(accountJson.getFirstNameLength(), length);
@@ -75,6 +76,7 @@ public class TestAccountJson extends JaxrsTestSuiteNoDB {
Assert.assertEquals(accountJson.getCountry(), country);
Assert.assertEquals(accountJson.getLocale(), locale);
Assert.assertEquals(accountJson.getPhone(), phone);
+ Assert.assertEquals(accountJson.getNotes(), notes);
Assert.assertEquals(accountJson.isMigrated(), isMigrated);
Assert.assertEquals(accountJson.isNotifiedForInvoices(), isNotifiedForInvoice);
Assert.assertEquals(accountJson.getParentAccountId(), parentAccountId);
pom.xml 2(+1 -1)
diff --git a/pom.xml b/pom.xml
index 12119d8..03d6a18 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>killbill-oss-parent</artifactId>
<groupId>org.kill-bill.billing</groupId>
- <version>0.123</version>
+ <version>0.124-SNAPSHOT</version>
</parent>
<artifactId>killbill</artifactId>
<version>0.17.3-SNAPSHOT</version>
diff --git a/profiles/killbill/src/test/java/org/killbill/billing/jaxrs/KillbillClient.java b/profiles/killbill/src/test/java/org/killbill/billing/jaxrs/KillbillClient.java
index 1380883..4d31f12 100644
--- a/profiles/killbill/src/test/java/org/killbill/billing/jaxrs/KillbillClient.java
+++ b/profiles/killbill/src/test/java/org/killbill/billing/jaxrs/KillbillClient.java
@@ -203,11 +203,12 @@ public abstract class KillbillClient extends GuicyKillbillTestSuiteWithEmbeddedD
final String country = "France";
final String locale = "fr";
final String phone = "81 53 26 56";
+ final String notes = "notes";
final boolean isPaymentDelegatedToParent = parentAccountId != null;
// Note: the accountId payload is ignored on account creation
return new Account(accountId, name, length, externalKey, email, null, currency, parentAccountId, isPaymentDelegatedToParent, null, timeZone,
- address1, address2, postalCode, company, city, state, country, locale, phone, false, false, null, null);
+ address1, address2, postalCode, company, city, state, country, locale, phone, notes, false, false, null, null);
}
/**
diff --git a/profiles/killbill/src/test/java/org/killbill/billing/jaxrs/TestAccount.java b/profiles/killbill/src/test/java/org/killbill/billing/jaxrs/TestAccount.java
index f1a2074..d714352 100644
--- a/profiles/killbill/src/test/java/org/killbill/billing/jaxrs/TestAccount.java
+++ b/profiles/killbill/src/test/java/org/killbill/billing/jaxrs/TestAccount.java
@@ -118,7 +118,7 @@ public class TestAccount extends TestJaxrsBase {
"zozo", 4, input.getExternalKey(), "rr@google.com", 18,
"USD", null, false, null, "UTC",
"bl1", "bh2", "", "", "ca", "San Francisco", "usa", "en", "415-255-2991",
- false, false, null, null);
+ "notes", false, false, null, null);
final Account updatedAccount = killBillClient.updateAccount(newInput, createdBy, reason, comment);
Assert.assertTrue(updatedAccount.equals(newInput));
diff --git a/util/src/test/java/org/killbill/billing/mock/api/MockAccountUserApi.java b/util/src/test/java/org/killbill/billing/mock/api/MockAccountUserApi.java
index 38f93a1..d6798fc 100644
--- a/util/src/test/java/org/killbill/billing/mock/api/MockAccountUserApi.java
+++ b/util/src/test/java/org/killbill/billing/mock/api/MockAccountUserApi.java
@@ -57,7 +57,8 @@ public class MockAccountUserApi implements AccountUserApi {
final String stateOrProvince,
final String country,
final String postalCode,
- final String phone) {
+ final String phone,
+ final String notes) {
final Account result = new MockAccountBuilder(id)
.externalKey(externalKey)
.email(email)
@@ -75,6 +76,7 @@ public class MockAccountUserApi implements AccountUserApi {
.country(country)
.postalCode(postalCode)
.phone(phone)
+ .notes(notes)
.isNotifiedForInvoices(false)
.build();
accounts.add(result);
diff --git a/util/src/test/java/org/killbill/billing/mock/MockAccountBuilder.java b/util/src/test/java/org/killbill/billing/mock/MockAccountBuilder.java
index 3058afa..36975d9 100644
--- a/util/src/test/java/org/killbill/billing/mock/MockAccountBuilder.java
+++ b/util/src/test/java/org/killbill/billing/mock/MockAccountBuilder.java
@@ -48,6 +48,7 @@ public class MockAccountBuilder {
private String country = "";
private String postalCode = "";
private String phone = "";
+ private String notes = "";
private boolean migrated;
private boolean isNotifiedForInvoices;
private DateTime createdDate = new DateTime(DateTimeZone.UTC);
@@ -80,6 +81,7 @@ public class MockAccountBuilder {
this.name(data.getName());
this.paymentMethodId(data.getPaymentMethodId());
this.phone(data.getPhone());
+ this.notes(data.getNotes());
this.postalCode(data.getPostalCode());
this.stateOrProvince(data.getStateOrProvince());
this.timeZone(data.getTimeZone());
@@ -187,6 +189,11 @@ public class MockAccountBuilder {
return this;
}
+ public MockAccountBuilder notes(final String notes) {
+ this.notes = notes;
+ return this;
+ }
+
public MockAccountBuilder migrated(final boolean migrated) {
this.migrated = migrated;
return this;
@@ -315,6 +322,11 @@ public class MockAccountBuilder {
}
@Override
+ public String getNotes() {
+ return notes;
+ }
+
+ @Override
public Boolean isMigrated() {
return migrated;
}