|
|
|
@ -1,11 +1,5 @@
|
|
|
|
|
package org.hostsharing.hsadminng.service.dto;
|
|
|
|
|
|
|
|
|
|
import org.hostsharing.hsadminng.service.CustomerService;
|
|
|
|
|
import org.hostsharing.hsadminng.service.SepaMandateService;
|
|
|
|
|
import org.hostsharing.hsadminng.service.accessfilter.*;
|
|
|
|
|
import org.springframework.boot.jackson.JsonComponent;
|
|
|
|
|
import org.springframework.context.ApplicationContext;
|
|
|
|
|
|
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
|
import javax.validation.constraints.Size;
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
@ -15,51 +9,38 @@ import java.util.Objects;
|
|
|
|
|
/**
|
|
|
|
|
* A DTO for the SepaMandate entity.
|
|
|
|
|
*/
|
|
|
|
|
public class SepaMandateDTO implements Serializable, AccessMappings {
|
|
|
|
|
public class SepaMandateDTO implements Serializable {
|
|
|
|
|
|
|
|
|
|
@SelfId(resolver = SepaMandateService.class)
|
|
|
|
|
@AccessFor(read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
|
|
|
|
|
private Long id;
|
|
|
|
|
|
|
|
|
|
@NotNull
|
|
|
|
|
@Size(max = 40)
|
|
|
|
|
@AccessFor(init = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT}, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
|
|
|
|
|
private String reference;
|
|
|
|
|
|
|
|
|
|
@Size(max = 34)
|
|
|
|
|
@AccessFor(init = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT}, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
|
|
|
|
|
private String iban;
|
|
|
|
|
|
|
|
|
|
@Size(max = 11)
|
|
|
|
|
@AccessFor(init = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT}, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
|
|
|
|
|
private String bic;
|
|
|
|
|
|
|
|
|
|
@NotNull
|
|
|
|
|
@AccessFor(init = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT}, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
|
|
|
|
|
private LocalDate grantingDocumentDate;
|
|
|
|
|
|
|
|
|
|
@AccessFor(init = Role.ADMIN, update = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT}, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
|
|
|
|
|
private LocalDate revokationDocumentDate;
|
|
|
|
|
|
|
|
|
|
@NotNull
|
|
|
|
|
@AccessFor(init = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT}, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
|
|
|
|
|
private LocalDate validFromDate;
|
|
|
|
|
|
|
|
|
|
@AccessFor(init = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT}, update = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT}, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
|
|
|
|
|
private LocalDate validUntilDate;
|
|
|
|
|
|
|
|
|
|
@AccessFor(init = Role.ADMIN, update = Role.ADMIN, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
|
|
|
|
|
private LocalDate lastUsedDate;
|
|
|
|
|
|
|
|
|
|
@Size(max = 160)
|
|
|
|
|
@AccessFor(init = Role.ADMIN, update = Role.SUPPORTER, read = Role.SUPPORTER)
|
|
|
|
|
private String remark;
|
|
|
|
|
|
|
|
|
|
@ParentId(resolver = CustomerService.class)
|
|
|
|
|
@AccessFor(init = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT}, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
|
|
|
|
|
|
|
|
|
|
private Long customerId;
|
|
|
|
|
|
|
|
|
|
@AccessFor(update = Role.IGNORED, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
|
|
|
|
|
private String customerPrefix;
|
|
|
|
|
|
|
|
|
|
public Long getId() {
|
|
|
|
@ -193,23 +174,7 @@ public class SepaMandateDTO implements Serializable, AccessMappings {
|
|
|
|
|
", lastUsedDate='" + getLastUsedDate() + "'" +
|
|
|
|
|
", remark='" + getRemark() + "'" +
|
|
|
|
|
", customer=" + getCustomerId() +
|
|
|
|
|
", customerPrefix='" + getCustomerPrefix() + "'" +
|
|
|
|
|
", customer='" + getCustomerPrefix() + "'" +
|
|
|
|
|
"}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@JsonComponent
|
|
|
|
|
public static class JsonSerializer extends JsonSerializerWithAccessFilter<SepaMandateDTO> {
|
|
|
|
|
|
|
|
|
|
public JsonSerializer(final ApplicationContext ctx) {
|
|
|
|
|
super(ctx);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@JsonComponent
|
|
|
|
|
public static class JsonDeserializer extends JsonDeserializerWithAccessFilter<SepaMandateDTO> {
|
|
|
|
|
|
|
|
|
|
public JsonDeserializer(final ApplicationContext ctx) {
|
|
|
|
|
super(ctx);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|