required fields added, respond result enum created

This commit is contained in:
Ivan Nikolaev-Axenov 2024-08-12 14:49:08 +03:00
parent 865d0674a0
commit b15e30c3c0
10 changed files with 74 additions and 14 deletions

View file

@ -1,6 +1,7 @@
package ru.spcex.clearing.xml.importer.logic.data.tags.accountlist.accounttags; package ru.spcex.clearing.xml.importer.logic.data.tags.accountlist.accounttags;
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import java.util.Objects; import java.util.Objects;
@ -26,22 +27,30 @@ public class ForeignCurrencyAccountTag {
@JsonCreator @JsonCreator
public ForeignCurrencyAccountTag(@JacksonXmlProperty(isAttribute = true, localName = "CURRENCY") public ForeignCurrencyAccountTag(@JacksonXmlProperty(isAttribute = true, localName = "CURRENCY")
@JsonProperty(required = true)
String currency, String currency,
@JacksonXmlProperty(isAttribute = true, localName = "BENEFICIARY_NAME") @JacksonXmlProperty(isAttribute = true, localName = "BENEFICIARY_NAME")
@JsonProperty(required = true)
String beneficiaryName, String beneficiaryName,
@JacksonXmlProperty(isAttribute = true, localName = "BENEFICIARY_SWIFT") @JacksonXmlProperty(isAttribute = true, localName = "BENEFICIARY_SWIFT")
String beneficiarySwift, String beneficiarySwift,
@JacksonXmlProperty(isAttribute = true, localName = "LOCATION") @JacksonXmlProperty(isAttribute = true, localName = "LOCATION")
@JsonProperty(required = true)
String location, String location,
@JacksonXmlProperty(isAttribute = true, localName = "ACCOUNT_NUMBER") @JacksonXmlProperty(isAttribute = true, localName = "ACCOUNT_NUMBER")
@JsonProperty(required = true)
String accountNumber, String accountNumber,
@JacksonXmlProperty(isAttribute = true, localName = "BANK_TITLE") @JacksonXmlProperty(isAttribute = true, localName = "BANK_TITLE")
@JsonProperty(required = true)
String bankTitle, String bankTitle,
@JacksonXmlProperty(isAttribute = true, localName = "BANK_LOCATION") @JacksonXmlProperty(isAttribute = true, localName = "BANK_LOCATION")
@JsonProperty(required = true)
String bankLocation, String bankLocation,
@JacksonXmlProperty(isAttribute = true, localName = "BANK_SWIFT") @JacksonXmlProperty(isAttribute = true, localName = "BANK_SWIFT")
@JsonProperty(required = true)
String bankSwift, String bankSwift,
@JacksonXmlProperty(isAttribute = true, localName = "BANK_ACCOUNT_NUMBER") @JacksonXmlProperty(isAttribute = true, localName = "BANK_ACCOUNT_NUMBER")
@JsonProperty(required = true)
String bankAccountNumber, String bankAccountNumber,
@JacksonXmlProperty(isAttribute = true, localName = "INTERMEDIARY_BANK_TITLE_1") @JacksonXmlProperty(isAttribute = true, localName = "INTERMEDIARY_BANK_TITLE_1")
String intermediaryBankTitle1, String intermediaryBankTitle1,
@ -60,6 +69,7 @@ public class ForeignCurrencyAccountTag {
@JacksonXmlProperty(isAttribute = true, localName = "INTERMEDIARY_BANK_ACCOUNT_NUMBER_2") @JacksonXmlProperty(isAttribute = true, localName = "INTERMEDIARY_BANK_ACCOUNT_NUMBER_2")
String intermediaryBankAccountNumber2, String intermediaryBankAccountNumber2,
@JacksonXmlProperty(isAttribute = true, localName = "REASON") @JacksonXmlProperty(isAttribute = true, localName = "REASON")
@JsonProperty(required = true)
String reason) { String reason) {
this.currency = currency; this.currency = currency;
this.beneficiaryName = beneficiaryName; this.beneficiaryName = beneficiaryName;

View file

@ -1,6 +1,7 @@
package ru.spcex.clearing.xml.importer.logic.data.tags.accountlist.accounttags; package ru.spcex.clearing.xml.importer.logic.data.tags.accountlist.accounttags;
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import java.util.Objects; import java.util.Objects;
@ -18,14 +19,18 @@ public class ForeignCurrencyDebitingAccountTag {
@JsonCreator @JsonCreator
public ForeignCurrencyDebitingAccountTag(@JacksonXmlProperty(isAttribute = true, localName = "CURRENCY") public ForeignCurrencyDebitingAccountTag(@JacksonXmlProperty(isAttribute = true, localName = "CURRENCY")
@JsonProperty(required = true)
String currency, String currency,
@JacksonXmlProperty(isAttribute = true, localName = "BENEFICIARY_SWIFT") @JacksonXmlProperty(isAttribute = true, localName = "BENEFICIARY_SWIFT")
String beneficiarySwift, String beneficiarySwift,
@JacksonXmlProperty(isAttribute = true, localName = "ACCOUNT_NUMBER") @JacksonXmlProperty(isAttribute = true, localName = "ACCOUNT_NUMBER")
@JsonProperty(required = true)
String accountNumber, String accountNumber,
@JacksonXmlProperty(isAttribute = true, localName = "BANK_SWIFT") @JacksonXmlProperty(isAttribute = true, localName = "BANK_SWIFT")
@JsonProperty(required = true)
String bankSwift, String bankSwift,
@JacksonXmlProperty(isAttribute = true, localName = "BANK_ACCOUNT_NUMBER") @JacksonXmlProperty(isAttribute = true, localName = "BANK_ACCOUNT_NUMBER")
@JsonProperty(required = true)
String bankAccountNumber, String bankAccountNumber,
@JacksonXmlProperty(isAttribute = true, localName = "INTERMEDIARY_BANK_SWIFT_1") @JacksonXmlProperty(isAttribute = true, localName = "INTERMEDIARY_BANK_SWIFT_1")
String intermediaryBankSwift1, String intermediaryBankSwift1,
@ -36,6 +41,7 @@ public class ForeignCurrencyDebitingAccountTag {
@JacksonXmlProperty(isAttribute = true, localName = "INTERMEDIARY_BANK_ACCOUNT_NUMBER_2") @JacksonXmlProperty(isAttribute = true, localName = "INTERMEDIARY_BANK_ACCOUNT_NUMBER_2")
String intermediaryBankAccountNumber2, String intermediaryBankAccountNumber2,
@JacksonXmlProperty(isAttribute = true, localName = "REASON") @JacksonXmlProperty(isAttribute = true, localName = "REASON")
@JsonProperty(required = true)
String reason) { String reason) {
this.currency = currency; this.currency = currency;
this.beneficiarySwift = beneficiarySwift; this.beneficiarySwift = beneficiarySwift;

View file

@ -1,8 +1,10 @@
package ru.spcex.clearing.xml.importer.logic.data.tags.accountlist.accounttags; package ru.spcex.clearing.xml.importer.logic.data.tags.accountlist.accounttags;
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import java.time.LocalDate;
import java.util.Objects; import java.util.Objects;
public class RubleAccountTag { public class RubleAccountTag {
@ -19,7 +21,7 @@ public class RubleAccountTag {
private final String bik; private final String bik;
private final String correspondentAccountNumber; private final String correspondentAccountNumber;
private final String reason; private final String reason;
private final String exclusionDate; private final LocalDate exclusionDate;
@JsonCreator @JsonCreator
public RubleAccountTag(@JacksonXmlProperty(isAttribute = true, localName = "CURRENCY") public RubleAccountTag(@JacksonXmlProperty(isAttribute = true, localName = "CURRENCY")
@ -57,7 +59,8 @@ public class RubleAccountTag {
@JsonProperty(required = true) @JsonProperty(required = true)
String reason, String reason,
@JacksonXmlProperty(isAttribute = true, localName = "EXCLUSION_DATE") @JacksonXmlProperty(isAttribute = true, localName = "EXCLUSION_DATE")
String exclusionDate) { @JsonFormat(pattern = "dd.MM.yyyy")
LocalDate exclusionDate) {
this.currency = currency; this.currency = currency;
this.beneficiaryName = beneficiaryName; this.beneficiaryName = beneficiaryName;
this.beneficiaryAccount = beneficiaryAccount; this.beneficiaryAccount = beneficiaryAccount;
@ -89,7 +92,7 @@ public class RubleAccountTag {
@Override @Override
public String toString() { public String toString() {
return "AccountTag{" + return "RubleAccountTag{" +
"currency='" + currency + '\'' + "currency='" + currency + '\'' +
", beneficiaryName='" + beneficiaryName + '\'' + ", beneficiaryName='" + beneficiaryName + '\'' +
", beneficiaryAccount='" + beneficiaryAccount + '\'' + ", beneficiaryAccount='" + beneficiaryAccount + '\'' +
@ -103,7 +106,7 @@ public class RubleAccountTag {
", bik='" + bik + '\'' + ", bik='" + bik + '\'' +
", correspondentAccountNumber='" + correspondentAccountNumber + '\'' + ", correspondentAccountNumber='" + correspondentAccountNumber + '\'' +
", reason='" + reason + '\'' + ", reason='" + reason + '\'' +
", exclusionDate='" + exclusionDate + '\'' + ", exclusionDate=" + exclusionDate +
'}'; '}';
} }
} }

View file

@ -1,6 +1,7 @@
package ru.spcex.clearing.xml.importer.logic.data.tags.accountlist.accounttags; package ru.spcex.clearing.xml.importer.logic.data.tags.accountlist.accounttags;
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import java.util.Objects; import java.util.Objects;
@ -14,16 +15,20 @@ public class RubleDebitingAccountTag {
@JsonCreator @JsonCreator
public RubleDebitingAccountTag(@JacksonXmlProperty(isAttribute = true, localName = "AMOUNT") public RubleDebitingAccountTag(@JacksonXmlProperty(isAttribute = true, localName = "AMOUNT")
@JsonProperty(required = true)
String amount, String amount,
@JacksonXmlProperty(isAttribute = true, localName = "CURRENCY") @JacksonXmlProperty(isAttribute = true, localName = "CURRENCY")
@JsonProperty(required = true)
String currency, String currency,
@JacksonXmlProperty(isAttribute = true, localName = "INN") @JacksonXmlProperty(isAttribute = true, localName = "INN")
String inn, String inn,
@JacksonXmlProperty(isAttribute = true, localName = "BENEFICIARY_ACCOUNT_NUMBER") @JacksonXmlProperty(isAttribute = true, localName = "BENEFICIARY_ACCOUNT_NUMBER")
String beneficiaryAccountNumber, String beneficiaryAccountNumber,
@JacksonXmlProperty(isAttribute = true, localName = "BIK") @JacksonXmlProperty(isAttribute = true, localName = "BIK")
@JsonProperty(required = true)
String bik, String bik,
@JacksonXmlProperty(isAttribute = true, localName = "BANK_CORRESPONDENT_ACCOUNT_NUMBER") @JacksonXmlProperty(isAttribute = true, localName = "BANK_CORRESPONDENT_ACCOUNT_NUMBER")
@JsonProperty(required = true)
String bankCorrespondentAccountNumber) { String bankCorrespondentAccountNumber) {
this.amount = amount; this.amount = amount;
this.currency = currency; this.currency = currency;

View file

@ -1,6 +1,7 @@
package ru.spcex.clearing.xml.importer.logic.data.tags.accountlist.clienttags; package ru.spcex.clearing.xml.importer.logic.data.tags.accountlist.clienttags;
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import java.util.Objects; import java.util.Objects;
@ -10,8 +11,10 @@ public class ForeignCurrencyDebitingClientTag {
@JsonCreator @JsonCreator
public ForeignCurrencyDebitingClientTag(@JacksonXmlProperty(isAttribute = true, localName = "CLIENT_NAME") public ForeignCurrencyDebitingClientTag(@JacksonXmlProperty(isAttribute = true, localName = "CLIENT_NAME")
@JsonProperty(required = true)
String clientName, String clientName,
@JacksonXmlProperty(isAttribute = true, localName = "DEBITING_AMOUNT") @JacksonXmlProperty(isAttribute = true, localName = "DEBITING_AMOUNT")
@JsonProperty(required = true)
String debitingAmount) { String debitingAmount) {
this.clientName = clientName; this.clientName = clientName;
this.debitingAmount = debitingAmount; this.debitingAmount = debitingAmount;

View file

@ -1,6 +1,7 @@
package ru.spcex.clearing.xml.importer.logic.data.tags.accountlist.documenttags; package ru.spcex.clearing.xml.importer.logic.data.tags.accountlist.documenttags;
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import java.time.LocalDate; import java.time.LocalDate;
@ -15,20 +16,22 @@ public class DocumentTag {
private final String documentId; private final String documentId;
@JsonCreator @JsonCreator
public DocumentTag(@JsonProperty(required = true) public DocumentTag(@JacksonXmlProperty(isAttribute = true, localName = "AUTHOR")
@JacksonXmlProperty(isAttribute = true, localName = "AUTHOR") @JsonProperty(required = true)
String author, String author,
@JsonProperty(required = true)
@JacksonXmlProperty(isAttribute = true, localName = "TIME") @JacksonXmlProperty(isAttribute = true, localName = "TIME")
@JsonProperty(required = true)
@JsonFormat(pattern = "HH:mm:ss")
LocalTime time, LocalTime time,
@JsonProperty(required = true)
@JacksonXmlProperty(isAttribute = true, localName = "DATE") @JacksonXmlProperty(isAttribute = true, localName = "DATE")
@JsonProperty(required = true)
@JsonFormat(pattern = "dd.MM.yyyy")
LocalDate date, LocalDate date,
@JsonProperty(required = true)
@JacksonXmlProperty(isAttribute = true, localName = "NAME") @JacksonXmlProperty(isAttribute = true, localName = "NAME")
String name,
@JsonProperty(required = true) @JsonProperty(required = true)
String name,
@JacksonXmlProperty(isAttribute = true, localName = "DOCUMENT_ID") @JacksonXmlProperty(isAttribute = true, localName = "DOCUMENT_ID")
@JsonProperty(required = true)
String documentId) { String documentId) {
this.author = author; this.author = author;
this.time = time; this.time = time;

View file

@ -1,6 +1,8 @@
package ru.spcex.clearing.xml.importer.logic.data.tags.accountlist.documenttags; package ru.spcex.clearing.xml.importer.logic.data.tags.accountlist.documenttags;
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.Objects; import java.util.Objects;
@ -11,8 +13,11 @@ public class ForeignCurrencyDebitingDocumentTag {
@JsonCreator @JsonCreator
public ForeignCurrencyDebitingDocumentTag(@JacksonXmlProperty(isAttribute = true, localName = "DOCUMENT_ID") public ForeignCurrencyDebitingDocumentTag(@JacksonXmlProperty(isAttribute = true, localName = "DOCUMENT_ID")
@JsonProperty(required = true)
String documentId, String documentId,
@JacksonXmlProperty(isAttribute = true, localName = "DATE") @JacksonXmlProperty(isAttribute = true, localName = "DATE")
@JsonProperty(required = true)
@JsonFormat(pattern = "dd.MM.yyyy")
LocalDate date) { LocalDate date) {
this.documentId = documentId; this.documentId = documentId;
this.date = date; this.date = date;

View file

@ -12,8 +12,10 @@ public class DebitingRegistratorTag {
@JsonCreator @JsonCreator
public DebitingRegistratorTag(@JacksonXmlProperty(isAttribute = true, localName = "FIRMID") public DebitingRegistratorTag(@JacksonXmlProperty(isAttribute = true, localName = "FIRMID")
@JsonProperty(required = true)
String firmId, String firmId,
@JacksonXmlProperty(isAttribute = true, localName = "NAME") @JacksonXmlProperty(isAttribute = true, localName = "NAME")
@JsonProperty(required = true)
String name, String name,
@JacksonXmlProperty(isAttribute = true, localName = "TKR") @JacksonXmlProperty(isAttribute = true, localName = "TKR")
@JsonProperty(required = true) @JsonProperty(required = true)

View file

@ -1,20 +1,24 @@
package ru.spcex.clearing.xml.importer.logic.data.tags.accountlist.respondtags; package ru.spcex.clearing.xml.importer.logic.data.tags.accountlist.respondtags;
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.Objects; import java.util.Objects;
public class DebitingRespondTag { public class DebitingRespondTag {
private final LocalDate date; private final LocalDate date;
private final String respondResult; private final RespondResult respondResult;
private final String reason; private final String reason;
@JsonCreator @JsonCreator
public DebitingRespondTag(@JacksonXmlProperty(isAttribute = true, localName = "DATE") public DebitingRespondTag(@JacksonXmlProperty(isAttribute = true, localName = "DATE")
@JsonProperty(required = true)
@JsonFormat(pattern = "dd.MM.yyyy")
LocalDate date, LocalDate date,
@JacksonXmlProperty(isAttribute = true, localName = "RESPOND_RESULT") @JacksonXmlProperty(isAttribute = true, localName = "RESPOND_RESULT")
String respondResult, RespondResult respondResult,
@JacksonXmlProperty(isAttribute = true, localName = "REASON") @JacksonXmlProperty(isAttribute = true, localName = "REASON")
String reason) { String reason) {
this.date = date; this.date = date;
@ -27,7 +31,7 @@ public class DebitingRespondTag {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
DebitingRespondTag that = (DebitingRespondTag) o; DebitingRespondTag that = (DebitingRespondTag) o;
return Objects.equals(date, that.date) && Objects.equals(respondResult, that.respondResult) && Objects.equals(reason, that.reason); return Objects.equals(date, that.date) && respondResult == that.respondResult && Objects.equals(reason, that.reason);
} }
@Override @Override
@ -39,7 +43,7 @@ public class DebitingRespondTag {
public String toString() { public String toString() {
return "DebitingRespondTag{" + return "DebitingRespondTag{" +
"date=" + date + "date=" + date +
", respondResult='" + respondResult + '\'' + ", respondResult=" + respondResult +
", reason='" + reason + '\'' + ", reason='" + reason + '\'' +
'}'; '}';
} }

View file

@ -0,0 +1,19 @@
package ru.spcex.clearing.xml.importer.logic.data.tags.accountlist.respondtags;
import com.fasterxml.jackson.annotation.JsonValue;
public enum RespondResult {
ACCEPTED("A"),
REJECTED("R");
private String value;
RespondResult(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
}