commit
7ab29fa38b
@ -0,0 +1,211 @@
|
||||
package au.com.royalpay.payment.manage.analysis.beans.ato;
|
||||
|
||||
import au.com.royalpay.payment.tools.merchants.beans.BalanceGroup;
|
||||
import org.joda.time.DateTime;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ConfigurationProperties(prefix = "app.atoreport")
|
||||
public class ATOCompanyConfig {
|
||||
private List<ATOCompany> companies;
|
||||
|
||||
public List<ATOCompany> getCompanies() {
|
||||
return companies;
|
||||
}
|
||||
|
||||
public ATOCompanyConfig setCompanies(List<ATOCompany> companies) {
|
||||
this.companies = companies;
|
||||
return this;
|
||||
}
|
||||
|
||||
public static class ATOCompany {
|
||||
private String[] balanceGroups;
|
||||
private String brand;
|
||||
private String referencePrefix;
|
||||
private String company;
|
||||
private String abn;
|
||||
private Contact contact;
|
||||
private Addr address;
|
||||
|
||||
public String reference() {
|
||||
return referencePrefix + DateTime.now().toString("yyyyMMddHHmm");
|
||||
}
|
||||
|
||||
public List<BalanceGroup> balanceGroups() {
|
||||
return Arrays.stream(balanceGroups).map(BalanceGroup::valueOf).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public String getReferencePrefix() {
|
||||
return referencePrefix;
|
||||
}
|
||||
|
||||
public ATOCompany setReferencePrefix(String referencePrefix) {
|
||||
this.referencePrefix = referencePrefix;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String[] getBalanceGroups() {
|
||||
return balanceGroups;
|
||||
}
|
||||
|
||||
public ATOCompany setBalanceGroups(String[] balanceGroups) {
|
||||
this.balanceGroups = balanceGroups;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBrand() {
|
||||
return brand;
|
||||
}
|
||||
|
||||
public ATOCompany setBrand(String brand) {
|
||||
this.brand = brand;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAbn() {
|
||||
return abn;
|
||||
}
|
||||
|
||||
public ATOCompany setAbn(String abn) {
|
||||
this.abn = abn;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Contact getContact() {
|
||||
return contact;
|
||||
}
|
||||
|
||||
public ContactInfo getContactInfo() {
|
||||
return contact.convert();
|
||||
}
|
||||
|
||||
public ATOCompany setContact(Contact contact) {
|
||||
this.contact = contact;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Addr getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public ATOCompany setAddress(Addr address) {
|
||||
this.address = address;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AddressInfo getAddressInfo() {
|
||||
return address.convert();
|
||||
}
|
||||
|
||||
public String getShortCompanyName() {
|
||||
return company.replace(" PTY LTD", "");
|
||||
}
|
||||
|
||||
public String getCompany() {
|
||||
return company;
|
||||
}
|
||||
|
||||
public ATOCompany setCompany(String company) {
|
||||
this.company = company;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Contact {
|
||||
private String name;
|
||||
private String phone;
|
||||
private String email;
|
||||
|
||||
public ContactInfo convert() {
|
||||
return new ContactInfo(name, phone, email);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Contact setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public Contact setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public Contact setEmail(String email) {
|
||||
this.email = email;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Addr {
|
||||
private String address;
|
||||
private String suburb;
|
||||
private String state;
|
||||
private String postcode;
|
||||
private String country;
|
||||
|
||||
public AddressInfo convert() {
|
||||
return new AddressInfo(address, suburb, state, postcode, country);
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public Addr setAddress(String address) {
|
||||
this.address = address;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSuburb() {
|
||||
return suburb;
|
||||
}
|
||||
|
||||
public Addr setSuburb(String suburb) {
|
||||
this.suburb = suburb;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public Addr setState(String state) {
|
||||
this.state = state;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPostcode() {
|
||||
return postcode;
|
||||
}
|
||||
|
||||
public Addr setPostcode(String postcode) {
|
||||
this.postcode = postcode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
public Addr setCountry(String country) {
|
||||
this.country = country;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package au.com.royalpay.payment.manage.analysis.core;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public interface ATOReportFinishedConsumer {
|
||||
void accept(String brand, String content) throws IOException;
|
||||
}
|
Loading…
Reference in new issue