Skip to content

Commit 80bd265

Browse files
committed
Fix JournalLine properties and Account Type Enum
Found the JournalLine object was based off Invoice LineItem and was missing several properties Account Type is used for both Accounts and Journal Lines, therefore, moved AccountType into a seperate class for use by both Objects.
1 parent 0071624 commit 80bd265

5 files changed

Lines changed: 298 additions & 128 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Add the dependency to your pom.xml. Gradle, sbt and other build tools can be fo
7474
<dependency>
7575
<groupId>com.github.xeroapi</groupId>
7676
<artifactId>xero-java</artifactId>
77-
<version>2.2.4</version>
77+
<version>2.2.5</version>
7878
</dependency>
7979

8080

src/main/java/com/xero/api/JsonConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public String getAccessTokenUrl() {
132132

133133
@Override
134134
public String getUserAgent() {
135-
return USER_AGENT + " " + CONSUMER_KEY + " [Xero-Java-2.2.4]";
135+
return USER_AGENT + " " + CONSUMER_KEY + " [Xero-Java-2.2.5]";
136136
}
137137

138138
@Override

src/main/java/com/xero/models/accounting/Account.java

Lines changed: 7 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import com.fasterxml.jackson.annotation.JsonProperty;
1919
import com.fasterxml.jackson.annotation.JsonCreator;
2020
import com.fasterxml.jackson.annotation.JsonValue;
21+
import com.xero.models.accounting.AccountType;
2122
import com.xero.models.accounting.CurrencyCode;
2223
import com.xero.models.accounting.TaxType;
2324
import io.swagger.annotations.ApiModel;
@@ -44,84 +45,9 @@ public class Account {
4445
@JsonProperty("AccountID")
4546
private UUID accountID = null;
4647

47-
/**
48-
* See Account Types
49-
*/
50-
public enum TypeEnum {
51-
BANK("BANK"),
52-
53-
CURRENT("CURRENT"),
54-
55-
CURRLIAB("CURRLIAB"),
56-
57-
DEPRECIATN("DEPRECIATN"),
58-
59-
DIRECTCOSTS("DIRECTCOSTS"),
60-
61-
EQUITY("EQUITY"),
62-
63-
EXPENSE("EXPENSE"),
64-
65-
FIXED("FIXED"),
66-
67-
INVENTORY("INVENTORY"),
68-
69-
LIABILITY("LIABILITY"),
70-
71-
NONCURRENT("NONCURRENT"),
72-
73-
OTHERINCOME("OTHERINCOME"),
74-
75-
OVERHEADS("OVERHEADS"),
76-
77-
PREPAYMENT("PREPAYMENT"),
78-
79-
REVENUE("REVENUE"),
80-
81-
SALES("SALES"),
82-
83-
TERMLIAB("TERMLIAB"),
84-
85-
PAYGLIABILITY("PAYGLIABILITY"),
86-
87-
PAYG("PAYG"),
88-
89-
SUPERANNUATIONEXPENSE("SUPERANNUATIONEXPENSE"),
90-
91-
SUPERANNUATIONLIABILITY("SUPERANNUATIONLIABILITY"),
92-
93-
WAGESEXPENSE("WAGESEXPENSE");
94-
95-
private String value;
96-
97-
TypeEnum(String value) {
98-
this.value = value;
99-
}
100-
101-
@JsonValue
102-
public String getValue() {
103-
return value;
104-
}
105-
106-
@Override
107-
public String toString() {
108-
return String.valueOf(value);
109-
}
110-
111-
@JsonCreator
112-
public static TypeEnum fromValue(String text) {
113-
for (TypeEnum b : TypeEnum.values()) {
114-
if (String.valueOf(b.value).equals(text)) {
115-
return b;
116-
}
117-
}
118-
throw new IllegalArgumentException("Unexpected value '" + text + "'");
119-
}
120-
}
121-
12248

12349
@JsonProperty("Type")
124-
private TypeEnum type = null;
50+
private AccountType type = null;
12551

12652

12753
@JsonProperty("BankAccountNumber")
@@ -409,21 +335,21 @@ public void setAccountID(UUID accountID) {
409335
this.accountID = accountID;
410336
}
411337

412-
public Account type(TypeEnum type) {
338+
public Account type(AccountType type) {
413339
this.type = type;
414340
return this;
415341
}
416342

417343
/**
418-
* See Account Types
344+
* Get type
419345
* @return type
420346
**/
421-
@ApiModelProperty(value = "See Account Types")
422-
public TypeEnum getType() {
347+
@ApiModelProperty(value = "")
348+
public AccountType getType() {
423349
return type;
424350
}
425351

426-
public void setType(TypeEnum type) {
352+
public void setType(AccountType type) {
427353
this.type = type;
428354
}
429355

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/*
2+
* Accounting API
3+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4+
*
5+
* OpenAPI spec version: 2.0.0
6+
* Contact: api@xero.com
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
13+
14+
package com.xero.models.accounting;
15+
16+
import java.util.Objects;
17+
import java.util.Arrays;
18+
import io.swagger.annotations.ApiModel;
19+
20+
import com.fasterxml.jackson.annotation.JsonCreator;
21+
import com.fasterxml.jackson.annotation.JsonValue;
22+
23+
/**
24+
* See Account Types
25+
*/
26+
public enum AccountType {
27+
28+
BANK("BANK"),
29+
30+
CURRENT("CURRENT"),
31+
32+
CURRLIAB("CURRLIAB"),
33+
34+
DEPRECIATN("DEPRECIATN"),
35+
36+
DIRECTCOSTS("DIRECTCOSTS"),
37+
38+
EQUITY("EQUITY"),
39+
40+
EXPENSE("EXPENSE"),
41+
42+
FIXED("FIXED"),
43+
44+
INVENTORY("INVENTORY"),
45+
46+
LIABILITY("LIABILITY"),
47+
48+
NONCURRENT("NONCURRENT"),
49+
50+
OTHERINCOME("OTHERINCOME"),
51+
52+
OVERHEADS("OVERHEADS"),
53+
54+
PREPAYMENT("PREPAYMENT"),
55+
56+
REVENUE("REVENUE"),
57+
58+
SALES("SALES"),
59+
60+
TERMLIAB("TERMLIAB"),
61+
62+
PAYGLIABILITY("PAYGLIABILITY"),
63+
64+
PAYG("PAYG"),
65+
66+
SUPERANNUATIONEXPENSE("SUPERANNUATIONEXPENSE"),
67+
68+
SUPERANNUATIONLIABILITY("SUPERANNUATIONLIABILITY"),
69+
70+
WAGESEXPENSE("WAGESEXPENSE");
71+
72+
private String value;
73+
74+
AccountType(String value) {
75+
this.value = value;
76+
}
77+
78+
@JsonValue
79+
public String getValue() {
80+
return value;
81+
}
82+
83+
@Override
84+
public String toString() {
85+
return String.valueOf(value);
86+
}
87+
88+
@JsonCreator
89+
public static AccountType fromValue(String text) {
90+
for (AccountType b : AccountType.values()) {
91+
if (String.valueOf(b.value).equals(text)) {
92+
return b;
93+
}
94+
}
95+
throw new IllegalArgumentException("Unexpected value '" + text + "'");
96+
}
97+
}
98+

0 commit comments

Comments
 (0)