merging from master
This commit is contained in:
@ -2,17 +2,16 @@ package org.hostsharing.hsadminng.domain;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import org.hostsharing.hsadminng.domain.enumeration.AssetAction;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.hostsharing.hsadminng.domain.enumeration.AssetAction;
|
||||
|
||||
/**
|
||||
* A Asset.
|
||||
*/
|
||||
@ -21,6 +20,8 @@ import org.hostsharing.hsadminng.domain.enumeration.AssetAction;
|
||||
public class Asset implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String ENTITY_NAME = "asset";
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
|
||||
@ -48,8 +49,8 @@ public class Asset implements Serializable {
|
||||
@Column(name = "remark", length = 160)
|
||||
private String remark;
|
||||
|
||||
@NotNull
|
||||
@ManyToOne(optional = false)
|
||||
@NotNull
|
||||
@JsonIgnoreProperties("assets")
|
||||
private Membership membership;
|
||||
|
||||
|
@ -1,9 +1,13 @@
|
||||
package org.hostsharing.hsadminng.domain;
|
||||
|
||||
|
||||
import org.hostsharing.hsadminng.domain.enumeration.CustomerKind;
|
||||
import org.hostsharing.hsadminng.domain.enumeration.VatRegion;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
@ -39,6 +43,35 @@ public class Customer implements Serializable {
|
||||
@Column(name = "name", length = 80, nullable = false)
|
||||
private String name;
|
||||
|
||||
@NotNull
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "kind", nullable = false)
|
||||
private CustomerKind kind;
|
||||
|
||||
@Column(name = "birth_date")
|
||||
private LocalDate birthDate;
|
||||
|
||||
@Size(max = 80)
|
||||
@Column(name = "birth_place", length = 80)
|
||||
private String birthPlace;
|
||||
|
||||
@Size(max = 80)
|
||||
@Column(name = "registration_court", length = 80)
|
||||
private String registrationCourt;
|
||||
|
||||
@Size(max = 80)
|
||||
@Column(name = "registration_number", length = 80)
|
||||
private String registrationNumber;
|
||||
|
||||
@NotNull
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "vat_region", nullable = false)
|
||||
private VatRegion vatRegion;
|
||||
|
||||
@Size(max = 40)
|
||||
@Column(name = "vat_number", length = 40)
|
||||
private String vatNumber;
|
||||
|
||||
@Size(max = 80)
|
||||
@Column(name = "contractual_salutation", length = 80)
|
||||
private String contractualSalutation;
|
||||
@ -120,6 +153,97 @@ public class Customer implements Serializable {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public CustomerKind getKind() {
|
||||
return kind;
|
||||
}
|
||||
|
||||
public Customer kind(CustomerKind kind) {
|
||||
this.kind = kind;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setKind(CustomerKind kind) {
|
||||
this.kind = kind;
|
||||
}
|
||||
|
||||
public LocalDate getBirthDate() {
|
||||
return birthDate;
|
||||
}
|
||||
|
||||
public Customer birthDate(LocalDate birthDate) {
|
||||
this.birthDate = birthDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setBirthDate(LocalDate birthDate) {
|
||||
this.birthDate = birthDate;
|
||||
}
|
||||
|
||||
public String getBirthPlace() {
|
||||
return birthPlace;
|
||||
}
|
||||
|
||||
public Customer birthPlace(String birthPlace) {
|
||||
this.birthPlace = birthPlace;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setBirthPlace(String birthPlace) {
|
||||
this.birthPlace = birthPlace;
|
||||
}
|
||||
|
||||
public String getRegistrationCourt() {
|
||||
return registrationCourt;
|
||||
}
|
||||
|
||||
public Customer registrationCourt(String registrationCourt) {
|
||||
this.registrationCourt = registrationCourt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setRegistrationCourt(String registrationCourt) {
|
||||
this.registrationCourt = registrationCourt;
|
||||
}
|
||||
|
||||
public String getRegistrationNumber() {
|
||||
return registrationNumber;
|
||||
}
|
||||
|
||||
public Customer registrationNumber(String registrationNumber) {
|
||||
this.registrationNumber = registrationNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setRegistrationNumber(String registrationNumber) {
|
||||
this.registrationNumber = registrationNumber;
|
||||
}
|
||||
|
||||
public VatRegion getVatRegion() {
|
||||
return vatRegion;
|
||||
}
|
||||
|
||||
public Customer vatRegion(VatRegion vatRegion) {
|
||||
this.vatRegion = vatRegion;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setVatRegion(VatRegion vatRegion) {
|
||||
this.vatRegion = vatRegion;
|
||||
}
|
||||
|
||||
public String getVatNumber() {
|
||||
return vatNumber;
|
||||
}
|
||||
|
||||
public Customer vatNumber(String vatNumber) {
|
||||
this.vatNumber = vatNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setVatNumber(String vatNumber) {
|
||||
this.vatNumber = vatNumber;
|
||||
}
|
||||
|
||||
public String getContractualSalutation() {
|
||||
return contractualSalutation;
|
||||
}
|
||||
@ -264,6 +388,13 @@ public class Customer implements Serializable {
|
||||
", reference=" + getReference() +
|
||||
", prefix='" + getPrefix() + "'" +
|
||||
", name='" + getName() + "'" +
|
||||
", kind='" + getKind() + "'" +
|
||||
", birthDate='" + getBirthDate() + "'" +
|
||||
", birthPlace='" + getBirthPlace() + "'" +
|
||||
", registrationCourt='" + getRegistrationCourt() + "'" +
|
||||
", registrationNumber='" + getRegistrationNumber() + "'" +
|
||||
", vatRegion='" + getVatRegion() + "'" +
|
||||
", vatNumber='" + getVatNumber() + "'" +
|
||||
", contractualSalutation='" + getContractualSalutation() + "'" +
|
||||
", contractualAddress='" + getContractualAddress() + "'" +
|
||||
", billingSalutation='" + getBillingSalutation() + "'" +
|
||||
|
@ -29,15 +29,18 @@ public class Membership implements Serializable {
|
||||
private Long id;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "document_date", nullable = false)
|
||||
private LocalDate documentDate;
|
||||
@Column(name = "admission_document_date", nullable = false)
|
||||
private LocalDate admissionDocumentDate;
|
||||
|
||||
@Column(name = "cancellation_document_date")
|
||||
private LocalDate cancellationDocumentDate;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "member_from", nullable = false)
|
||||
private LocalDate memberFrom;
|
||||
@Column(name = "member_from_date", nullable = false)
|
||||
private LocalDate memberFromDate;
|
||||
|
||||
@Column(name = "member_until")
|
||||
private LocalDate memberUntil;
|
||||
@Column(name = "member_until_date")
|
||||
private LocalDate memberUntilDate;
|
||||
|
||||
@Size(max = 160)
|
||||
@Column(name = "remark", length = 160)
|
||||
@ -69,43 +72,56 @@ public class Membership implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public LocalDate getDocumentDate() {
|
||||
return documentDate;
|
||||
public LocalDate getAdmissionDocumentDate() {
|
||||
return admissionDocumentDate;
|
||||
}
|
||||
|
||||
public Membership documentDate(LocalDate documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
public Membership admissionDocumentDate(LocalDate admissionDocumentDate) {
|
||||
this.admissionDocumentDate = admissionDocumentDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setDocumentDate(LocalDate documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
public void setAdmissionDocumentDate(LocalDate admissionDocumentDate) {
|
||||
this.admissionDocumentDate = admissionDocumentDate;
|
||||
}
|
||||
|
||||
public LocalDate getMemberFrom() {
|
||||
return memberFrom;
|
||||
public LocalDate getCancellationDocumentDate() {
|
||||
return cancellationDocumentDate;
|
||||
}
|
||||
|
||||
public Membership memberFrom(LocalDate memberFrom) {
|
||||
this.memberFrom = memberFrom;
|
||||
public Membership cancellationDocumentDate(LocalDate cancellationDocumentDate) {
|
||||
this.cancellationDocumentDate = cancellationDocumentDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setMemberFrom(LocalDate memberFrom) {
|
||||
this.memberFrom = memberFrom;
|
||||
public void setCancellationDocumentDate(LocalDate cancellationDocumentDate) {
|
||||
this.cancellationDocumentDate = cancellationDocumentDate;
|
||||
}
|
||||
|
||||
public LocalDate getMemberUntil() {
|
||||
return memberUntil;
|
||||
public LocalDate getMemberFromDate() {
|
||||
return memberFromDate;
|
||||
}
|
||||
|
||||
public Membership memberUntil(LocalDate memberUntil) {
|
||||
this.memberUntil = memberUntil;
|
||||
public Membership memberFromDate(LocalDate memberFromDate) {
|
||||
this.memberFromDate = memberFromDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setMemberUntil(LocalDate memberUntil) {
|
||||
this.memberUntil = memberUntil;
|
||||
public void setMemberFromDate(LocalDate memberFromDate) {
|
||||
this.memberFromDate = memberFromDate;
|
||||
}
|
||||
|
||||
public LocalDate getMemberUntilDate() {
|
||||
return memberUntilDate;
|
||||
}
|
||||
|
||||
public Membership memberUntilDate(LocalDate memberUntilDate) {
|
||||
this.memberUntilDate = memberUntilDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setMemberUntilDate(LocalDate memberUntilDate) {
|
||||
this.memberUntilDate = memberUntilDate;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
@ -210,9 +226,10 @@ public class Membership implements Serializable {
|
||||
public String toString() {
|
||||
return "Membership{" +
|
||||
"id=" + getId() +
|
||||
", documentDate='" + getDocumentDate() + "'" +
|
||||
", memberFrom='" + getMemberFrom() + "'" +
|
||||
", memberUntil='" + getMemberUntil() + "'" +
|
||||
", admissionDocumentDate='" + getAdmissionDocumentDate() + "'" +
|
||||
", cancellationDocumentDate='" + getCancellationDocumentDate() + "'" +
|
||||
", memberFromDate='" + getMemberFromDate() + "'" +
|
||||
", memberUntilDate='" + getMemberUntilDate() + "'" +
|
||||
", remark='" + getRemark() + "'" +
|
||||
"}";
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ package org.hostsharing.hsadminng.domain;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
@ -38,21 +38,21 @@ public class SepaMandate implements Serializable {
|
||||
private String bic;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "document_date", nullable = false)
|
||||
private LocalDate documentDate;
|
||||
@Column(name = "granting_document_date", nullable = false)
|
||||
private LocalDate grantingDocumentDate;
|
||||
|
||||
@Column(name = "revokation_document_date")
|
||||
private LocalDate revokationDocumentDate;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "valid_from", nullable = false)
|
||||
private LocalDate validFrom;
|
||||
@Column(name = "valid_from_date", nullable = false)
|
||||
private LocalDate validFromDate;
|
||||
|
||||
@Column(name = "valid_until")
|
||||
private LocalDate validUntil;
|
||||
@Column(name = "valid_until_date")
|
||||
private LocalDate validUntilDate;
|
||||
|
||||
@Column(name = "last_used")
|
||||
private LocalDate lastUsed;
|
||||
|
||||
@Column(name = "cancellation_date")
|
||||
private LocalDate cancellationDate;
|
||||
@Column(name = "last_used_date")
|
||||
private LocalDate lastUsedDate;
|
||||
|
||||
@Size(max = 160)
|
||||
@Column(name = "remark", length = 160)
|
||||
@ -111,69 +111,69 @@ public class SepaMandate implements Serializable {
|
||||
this.bic = bic;
|
||||
}
|
||||
|
||||
public LocalDate getDocumentDate() {
|
||||
return documentDate;
|
||||
public LocalDate getGrantingDocumentDate() {
|
||||
return grantingDocumentDate;
|
||||
}
|
||||
|
||||
public SepaMandate documentDate(LocalDate documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
public SepaMandate grantingDocumentDate(LocalDate grantingDocumentDate) {
|
||||
this.grantingDocumentDate = grantingDocumentDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setDocumentDate(LocalDate documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
public void setGrantingDocumentDate(LocalDate grantingDocumentDate) {
|
||||
this.grantingDocumentDate = grantingDocumentDate;
|
||||
}
|
||||
|
||||
public LocalDate getValidFrom() {
|
||||
return validFrom;
|
||||
public LocalDate getRevokationDocumentDate() {
|
||||
return revokationDocumentDate;
|
||||
}
|
||||
|
||||
public SepaMandate validFrom(LocalDate validFrom) {
|
||||
this.validFrom = validFrom;
|
||||
public SepaMandate revokationDocumentDate(LocalDate revokationDocumentDate) {
|
||||
this.revokationDocumentDate = revokationDocumentDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setValidFrom(LocalDate validFrom) {
|
||||
this.validFrom = validFrom;
|
||||
public void setRevokationDocumentDate(LocalDate revokationDocumentDate) {
|
||||
this.revokationDocumentDate = revokationDocumentDate;
|
||||
}
|
||||
|
||||
public LocalDate getValidUntil() {
|
||||
return validUntil;
|
||||
public LocalDate getValidFromDate() {
|
||||
return validFromDate;
|
||||
}
|
||||
|
||||
public SepaMandate validUntil(LocalDate validUntil) {
|
||||
this.validUntil = validUntil;
|
||||
public SepaMandate validFromDate(LocalDate validFromDate) {
|
||||
this.validFromDate = validFromDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setValidUntil(LocalDate validUntil) {
|
||||
this.validUntil = validUntil;
|
||||
public void setValidFromDate(LocalDate validFromDate) {
|
||||
this.validFromDate = validFromDate;
|
||||
}
|
||||
|
||||
public LocalDate getLastUsed() {
|
||||
return lastUsed;
|
||||
public LocalDate getValidUntilDate() {
|
||||
return validUntilDate;
|
||||
}
|
||||
|
||||
public SepaMandate lastUsed(LocalDate lastUsed) {
|
||||
this.lastUsed = lastUsed;
|
||||
public SepaMandate validUntilDate(LocalDate validUntilDate) {
|
||||
this.validUntilDate = validUntilDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setLastUsed(LocalDate lastUsed) {
|
||||
this.lastUsed = lastUsed;
|
||||
public void setValidUntilDate(LocalDate validUntilDate) {
|
||||
this.validUntilDate = validUntilDate;
|
||||
}
|
||||
|
||||
public LocalDate getCancellationDate() {
|
||||
return cancellationDate;
|
||||
public LocalDate getLastUsedDate() {
|
||||
return lastUsedDate;
|
||||
}
|
||||
|
||||
public SepaMandate cancellationDate(LocalDate cancellationDate) {
|
||||
this.cancellationDate = cancellationDate;
|
||||
public SepaMandate lastUsedDate(LocalDate lastUsedDate) {
|
||||
this.lastUsedDate = lastUsedDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setCancellationDate(LocalDate cancellationDate) {
|
||||
this.cancellationDate = cancellationDate;
|
||||
public void setLastUsedDate(LocalDate lastUsedDate) {
|
||||
this.lastUsedDate = lastUsedDate;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
@ -230,11 +230,11 @@ public class SepaMandate implements Serializable {
|
||||
", reference='" + getReference() + "'" +
|
||||
", iban='" + getIban() + "'" +
|
||||
", bic='" + getBic() + "'" +
|
||||
", documentDate='" + getDocumentDate() + "'" +
|
||||
", validFrom='" + getValidFrom() + "'" +
|
||||
", validUntil='" + getValidUntil() + "'" +
|
||||
", lastUsed='" + getLastUsed() + "'" +
|
||||
", cancellationDate='" + getCancellationDate() + "'" +
|
||||
", grantingDocumentDate='" + getGrantingDocumentDate() + "'" +
|
||||
", revokationDocumentDate='" + getRevokationDocumentDate() + "'" +
|
||||
", validFromDate='" + getValidFromDate() + "'" +
|
||||
", validUntilDate='" + getValidUntilDate() + "'" +
|
||||
", lastUsedDate='" + getLastUsedDate() + "'" +
|
||||
", remark='" + getRemark() + "'" +
|
||||
"}";
|
||||
}
|
||||
|
@ -2,16 +2,15 @@ package org.hostsharing.hsadminng.domain;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import org.hostsharing.hsadminng.domain.enumeration.ShareAction;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.hostsharing.hsadminng.domain.enumeration.ShareAction;
|
||||
|
||||
/**
|
||||
* A Share.
|
||||
*/
|
||||
@ -49,8 +48,8 @@ public class Share implements Serializable {
|
||||
@Column(name = "remark", length = 160)
|
||||
private String remark;
|
||||
|
||||
@NotNull
|
||||
@ManyToOne(optional = false)
|
||||
@NotNull
|
||||
@JsonIgnoreProperties("shares")
|
||||
private Membership membership;
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
package org.hostsharing.hsadminng.domain.enumeration;
|
||||
|
||||
/**
|
||||
* The CustomerKind enumeration.
|
||||
*/
|
||||
public enum CustomerKind {
|
||||
NATURAL, LEGAL
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package org.hostsharing.hsadminng.domain.enumeration;
|
||||
|
||||
/**
|
||||
* The VatRegion enumeration.
|
||||
*/
|
||||
public enum VatRegion {
|
||||
DOMESTIC, EU, OTHER
|
||||
}
|
@ -16,6 +16,6 @@ import org.springframework.stereotype.Repository;
|
||||
public interface MembershipRepository extends JpaRepository<Membership, Long>, JpaSpecificationExecutor<Membership> {
|
||||
|
||||
@Query("SELECT CASE WHEN COUNT(m)> 0 THEN TRUE ELSE FALSE END " +
|
||||
" FROM Membership m WHERE m.customer.id=:customerId AND m.memberUntil IS NULL")
|
||||
" FROM Membership m WHERE m.customer.id=:customerId AND m.memberUntilDate IS NULL")
|
||||
boolean hasUncancelledMembershipForCustomer(@Param("customerId") final long customerId);
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ import org.hostsharing.hsadminng.service.dto.AssetDTO;
|
||||
import org.hostsharing.hsadminng.service.mapper.AssetMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -26,10 +25,12 @@ public class AssetService {
|
||||
private final AssetRepository assetRepository;
|
||||
|
||||
private final AssetMapper assetMapper;
|
||||
private final AssetValidator assetValidator;
|
||||
|
||||
public AssetService(AssetRepository assetRepository, AssetMapper assetMapper) {
|
||||
public AssetService(AssetRepository assetRepository, AssetMapper assetMapper, AssetValidator assetValidator ) {
|
||||
this.assetRepository = assetRepository;
|
||||
this.assetMapper = assetMapper;
|
||||
this.assetValidator = assetValidator;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -40,6 +41,7 @@ public class AssetService {
|
||||
*/
|
||||
public AssetDTO save(AssetDTO assetDTO) {
|
||||
log.debug("Request to save Asset : {}", assetDTO);
|
||||
assetValidator.validate(assetDTO);
|
||||
Asset asset = assetMapper.toEntity(assetDTO);
|
||||
asset = assetRepository.save(asset);
|
||||
return assetMapper.toDto(asset);
|
||||
|
@ -0,0 +1,43 @@
|
||||
package org.hostsharing.hsadminng.service;
|
||||
|
||||
import org.hostsharing.hsadminng.domain.Asset;
|
||||
import org.hostsharing.hsadminng.domain.enumeration.AssetAction;
|
||||
import org.hostsharing.hsadminng.service.dto.AssetDTO;
|
||||
import org.hostsharing.hsadminng.web.rest.errors.BadRequestAlertException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Service
|
||||
public class AssetValidator {
|
||||
public void validate(final AssetDTO assetDTO) {
|
||||
if (assetDTO.getId() != null) {
|
||||
throw new BadRequestAlertException("Asset transactions are immutable", Asset.ENTITY_NAME, "assetTransactionImmutable");
|
||||
}
|
||||
|
||||
if (assetDTO.getDocumentDate().isAfter(assetDTO.getValueDate())) {
|
||||
throw new BadRequestAlertException("Document date may not be after value date", Asset.ENTITY_NAME, "documentDateMayNotBeAfterValueDate");
|
||||
}
|
||||
|
||||
if ((assetDTO.getAction() == AssetAction.PAYMENT) && (assetDTO.getAmount().compareTo(BigDecimal.valueOf(0)) <= 0)) {
|
||||
throw new BadRequestAlertException("Asset payments require a positive amount", Asset.ENTITY_NAME, "assetPaymentsPositiveAmount");
|
||||
}
|
||||
if ((assetDTO.getAction() == AssetAction.ADOPTION) && (assetDTO.getAmount().compareTo(BigDecimal.valueOf(0)) <= 0)) {
|
||||
throw new BadRequestAlertException("Asset adoptions require a positive amount", Asset.ENTITY_NAME, "assetAdoptionsPositiveAmount");
|
||||
}
|
||||
|
||||
if ((assetDTO.getAction() == AssetAction.PAYBACK) && (assetDTO.getAmount().compareTo(BigDecimal.valueOf(0)) >= 0)) {
|
||||
throw new BadRequestAlertException("Asset paybacks require a negative amount", Asset.ENTITY_NAME, "assetPaybacksNegativeAmount");
|
||||
}
|
||||
if ((assetDTO.getAction() == AssetAction.HANDOVER) && (assetDTO.getAmount().compareTo(BigDecimal.valueOf(0)) >= 0)) {
|
||||
throw new BadRequestAlertException("Asset handovers require a negative amount", Asset.ENTITY_NAME, "assetHandoversNegativeAmount");
|
||||
}
|
||||
if ((assetDTO.getAction() == AssetAction.LOSS) && (assetDTO.getAmount().compareTo(BigDecimal.valueOf(0)) >= 0)) {
|
||||
throw new BadRequestAlertException("Asset losses require a negative amount", Asset.ENTITY_NAME, "assetLossesNegativeAmount");
|
||||
}
|
||||
if ((assetDTO.getAction() == AssetAction.CLEARING) && (assetDTO.getAmount().compareTo(BigDecimal.valueOf(0)) >= 0)) {
|
||||
throw new BadRequestAlertException("Asset clearings require a negative amount", Asset.ENTITY_NAME, "assetClearingsNegativeAmount");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,9 +1,14 @@
|
||||
package org.hostsharing.hsadminng.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.criteria.JoinType;
|
||||
|
||||
import io.github.jhipster.service.QueryService;
|
||||
import org.hostsharing.hsadminng.domain.Customer;
|
||||
import org.hostsharing.hsadminng.domain.Customer_;
|
||||
import org.hostsharing.hsadminng.domain.Membership_;
|
||||
import org.hostsharing.hsadminng.domain.SepaMandate_;
|
||||
import org.hostsharing.hsadminng.repository.CustomerRepository;
|
||||
import org.hostsharing.hsadminng.service.dto.CustomerCriteria;
|
||||
import org.hostsharing.hsadminng.service.dto.CustomerDTO;
|
||||
import org.hostsharing.hsadminng.service.mapper.CustomerMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.domain.Page;
|
||||
@ -12,14 +17,8 @@ import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import io.github.jhipster.service.QueryService;
|
||||
|
||||
import org.hostsharing.hsadminng.domain.Customer;
|
||||
import org.hostsharing.hsadminng.domain.*; // for static metamodels
|
||||
import org.hostsharing.hsadminng.repository.CustomerRepository;
|
||||
import org.hostsharing.hsadminng.service.dto.CustomerCriteria;
|
||||
import org.hostsharing.hsadminng.service.dto.CustomerDTO;
|
||||
import org.hostsharing.hsadminng.service.mapper.CustomerMapper;
|
||||
import javax.persistence.criteria.JoinType;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Service for executing complex queries for Customer entities in the database.
|
||||
@ -98,6 +97,27 @@ public class CustomerQueryService extends QueryService<Customer> {
|
||||
if (criteria.getName() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getName(), Customer_.name));
|
||||
}
|
||||
if (criteria.getKind() != null) {
|
||||
specification = specification.and(buildSpecification(criteria.getKind(), Customer_.kind));
|
||||
}
|
||||
if (criteria.getBirthDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getBirthDate(), Customer_.birthDate));
|
||||
}
|
||||
if (criteria.getBirthPlace() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getBirthPlace(), Customer_.birthPlace));
|
||||
}
|
||||
if (criteria.getRegistrationCourt() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getRegistrationCourt(), Customer_.registrationCourt));
|
||||
}
|
||||
if (criteria.getRegistrationNumber() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getRegistrationNumber(), Customer_.registrationNumber));
|
||||
}
|
||||
if (criteria.getVatRegion() != null) {
|
||||
specification = specification.and(buildSpecification(criteria.getVatRegion(), Customer_.vatRegion));
|
||||
}
|
||||
if (criteria.getVatNumber() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getVatNumber(), Customer_.vatNumber));
|
||||
}
|
||||
if (criteria.getContractualSalutation() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getContractualSalutation(), Customer_.contractualSalutation));
|
||||
}
|
||||
|
@ -1,9 +1,11 @@
|
||||
package org.hostsharing.hsadminng.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.criteria.JoinType;
|
||||
|
||||
import io.github.jhipster.service.QueryService;
|
||||
import org.hostsharing.hsadminng.domain.*;
|
||||
import org.hostsharing.hsadminng.repository.MembershipRepository;
|
||||
import org.hostsharing.hsadminng.service.dto.MembershipCriteria;
|
||||
import org.hostsharing.hsadminng.service.dto.MembershipDTO;
|
||||
import org.hostsharing.hsadminng.service.mapper.MembershipMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.domain.Page;
|
||||
@ -12,14 +14,8 @@ import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import io.github.jhipster.service.QueryService;
|
||||
|
||||
import org.hostsharing.hsadminng.domain.Membership;
|
||||
import org.hostsharing.hsadminng.domain.*; // for static metamodels
|
||||
import org.hostsharing.hsadminng.repository.MembershipRepository;
|
||||
import org.hostsharing.hsadminng.service.dto.MembershipCriteria;
|
||||
import org.hostsharing.hsadminng.service.dto.MembershipDTO;
|
||||
import org.hostsharing.hsadminng.service.mapper.MembershipMapper;
|
||||
import javax.persistence.criteria.JoinType;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Service for executing complex queries for Membership entities in the database.
|
||||
@ -89,14 +85,17 @@ public class MembershipQueryService extends QueryService<Membership> {
|
||||
if (criteria.getId() != null) {
|
||||
specification = specification.and(buildSpecification(criteria.getId(), Membership_.id));
|
||||
}
|
||||
if (criteria.getDocumentDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getDocumentDate(), Membership_.documentDate));
|
||||
if (criteria.getAdmissionDocumentDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getAdmissionDocumentDate(), Membership_.admissionDocumentDate));
|
||||
}
|
||||
if (criteria.getMemberFrom() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getMemberFrom(), Membership_.memberFrom));
|
||||
if (criteria.getCancellationDocumentDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getCancellationDocumentDate(), Membership_.cancellationDocumentDate));
|
||||
}
|
||||
if (criteria.getMemberUntil() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getMemberUntil(), Membership_.memberUntil));
|
||||
if (criteria.getMemberFromDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getMemberFromDate(), Membership_.memberFromDate));
|
||||
}
|
||||
if (criteria.getMemberUntilDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getMemberUntilDate(), Membership_.memberUntilDate));
|
||||
}
|
||||
if (criteria.getRemark() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getRemark(), Membership_.remark));
|
||||
|
@ -14,7 +14,7 @@ public class MembershipValidator {
|
||||
private MembershipRepository membershipRepository;
|
||||
|
||||
public void validate(final MembershipDTO membershipDTO) {
|
||||
if (membershipDTO.getMemberUntil() != null && !membershipDTO.getMemberUntil().isAfter(membershipDTO.getMemberFrom())) {
|
||||
if (membershipDTO.getMemberUntilDate() != null && !membershipDTO.getMemberUntilDate().isAfter(membershipDTO.getMemberFromDate())) {
|
||||
throw new BadRequestAlertException("Invalid untilDate", Membership.ENTITY_NAME, "untilDateMustBeAfterSinceDate");
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,13 @@
|
||||
package org.hostsharing.hsadminng.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.criteria.JoinType;
|
||||
|
||||
import io.github.jhipster.service.QueryService;
|
||||
import org.hostsharing.hsadminng.domain.Customer_;
|
||||
import org.hostsharing.hsadminng.domain.SepaMandate;
|
||||
import org.hostsharing.hsadminng.domain.SepaMandate_;
|
||||
import org.hostsharing.hsadminng.repository.SepaMandateRepository;
|
||||
import org.hostsharing.hsadminng.service.dto.SepaMandateCriteria;
|
||||
import org.hostsharing.hsadminng.service.dto.SepaMandateDTO;
|
||||
import org.hostsharing.hsadminng.service.mapper.SepaMandateMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.domain.Page;
|
||||
@ -12,14 +16,8 @@ import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import io.github.jhipster.service.QueryService;
|
||||
|
||||
import org.hostsharing.hsadminng.domain.SepaMandate;
|
||||
import org.hostsharing.hsadminng.domain.*; // for static metamodels
|
||||
import org.hostsharing.hsadminng.repository.SepaMandateRepository;
|
||||
import org.hostsharing.hsadminng.service.dto.SepaMandateCriteria;
|
||||
import org.hostsharing.hsadminng.service.dto.SepaMandateDTO;
|
||||
import org.hostsharing.hsadminng.service.mapper.SepaMandateMapper;
|
||||
import javax.persistence.criteria.JoinType;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Service for executing complex queries for SepaMandate entities in the database.
|
||||
@ -98,20 +96,20 @@ public class SepaMandateQueryService extends QueryService<SepaMandate> {
|
||||
if (criteria.getBic() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getBic(), SepaMandate_.bic));
|
||||
}
|
||||
if (criteria.getDocumentDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getDocumentDate(), SepaMandate_.documentDate));
|
||||
if (criteria.getGrantingDocumentDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getGrantingDocumentDate(), SepaMandate_.grantingDocumentDate));
|
||||
}
|
||||
if (criteria.getValidFrom() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getValidFrom(), SepaMandate_.validFrom));
|
||||
if (criteria.getRevokationDocumentDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getRevokationDocumentDate(), SepaMandate_.revokationDocumentDate));
|
||||
}
|
||||
if (criteria.getValidUntil() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getValidUntil(), SepaMandate_.validUntil));
|
||||
if (criteria.getValidFromDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getValidFromDate(), SepaMandate_.validFromDate));
|
||||
}
|
||||
if (criteria.getLastUsed() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getLastUsed(), SepaMandate_.lastUsed));
|
||||
if (criteria.getValidUntilDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getValidUntilDate(), SepaMandate_.validUntilDate));
|
||||
}
|
||||
if (criteria.getCancellationDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getCancellationDate(), SepaMandate_.cancellationDate));
|
||||
if (criteria.getLastUsedDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getLastUsedDate(), SepaMandate_.lastUsedDate));
|
||||
}
|
||||
if (criteria.getRemark() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getRemark(), SepaMandate_.remark));
|
||||
|
@ -1,7 +1,6 @@
|
||||
package org.hostsharing.hsadminng.service;
|
||||
|
||||
import org.hostsharing.hsadminng.domain.Share;
|
||||
import org.hostsharing.hsadminng.domain.enumeration.ShareAction;
|
||||
import org.hostsharing.hsadminng.repository.ShareRepository;
|
||||
import org.hostsharing.hsadminng.service.dto.ShareDTO;
|
||||
import org.hostsharing.hsadminng.service.mapper.ShareMapper;
|
||||
@ -28,9 +27,12 @@ public class ShareService {
|
||||
|
||||
private final ShareMapper shareMapper;
|
||||
|
||||
public ShareService(ShareRepository shareRepository, ShareMapper shareMapper) {
|
||||
private final ShareValidator shareValidator;
|
||||
|
||||
public ShareService(ShareRepository shareRepository, ShareMapper shareMapper, ShareValidator shareValidator) {
|
||||
this.shareRepository = shareRepository;
|
||||
this.shareMapper = shareMapper;
|
||||
this.shareValidator = shareValidator;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -42,16 +44,8 @@ public class ShareService {
|
||||
public ShareDTO save(ShareDTO shareDTO) {
|
||||
log.debug("Request to save Share : {}", shareDTO);
|
||||
|
||||
if (shareDTO.getId() != null) {
|
||||
throw new BadRequestAlertException("Share transactions are immutable", Share.ENTITY_NAME, "shareTransactionImmutable");
|
||||
}
|
||||
shareValidator.validate(shareDTO);
|
||||
|
||||
if((shareDTO.getAction() == ShareAction.SUBSCRIPTION) && (shareDTO.getQuantity() <= 0)) {
|
||||
throw new BadRequestAlertException("Share subscriptions require a positive quantity", Share.ENTITY_NAME, "shareSubscriptionPositivQuantity");
|
||||
}
|
||||
if((shareDTO.getAction() == ShareAction.CANCELLATION) && (shareDTO.getQuantity() >= 0)) {
|
||||
throw new BadRequestAlertException("Share cancellations require a negative quantity", Share.ENTITY_NAME, "shareCancellationNegativeQuantity");
|
||||
}
|
||||
Share share = shareMapper.toEntity(shareDTO);
|
||||
share = shareRepository.save(share);
|
||||
return shareMapper.toDto(share);
|
||||
|
@ -0,0 +1,30 @@
|
||||
package org.hostsharing.hsadminng.service;
|
||||
|
||||
import org.hostsharing.hsadminng.domain.Share;
|
||||
import org.hostsharing.hsadminng.domain.enumeration.ShareAction;
|
||||
import org.hostsharing.hsadminng.service.dto.ShareDTO;
|
||||
import org.hostsharing.hsadminng.web.rest.errors.BadRequestAlertException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ShareValidator {
|
||||
|
||||
public void validate(final ShareDTO shareDTO) {
|
||||
if (shareDTO.getId() != null) {
|
||||
throw new BadRequestAlertException("Share transactions are immutable", Share.ENTITY_NAME, "shareTransactionImmutable");
|
||||
}
|
||||
|
||||
if (shareDTO.getDocumentDate().isAfter(shareDTO.getValueDate())) {
|
||||
throw new BadRequestAlertException("Document date may not be after value date", Share.ENTITY_NAME, "documentDateMayNotBeAfterValueDate");
|
||||
}
|
||||
|
||||
if ((shareDTO.getAction() == ShareAction.SUBSCRIPTION) && (shareDTO.getQuantity() <= 0)) {
|
||||
throw new BadRequestAlertException("Share subscriptions require a positive quantity", Share.ENTITY_NAME, "shareSubscriptionPositiveQuantity");
|
||||
}
|
||||
|
||||
if ((shareDTO.getAction() == ShareAction.CANCELLATION) && (shareDTO.getQuantity() >= 0)) {
|
||||
throw new BadRequestAlertException("Share cancellations require a negative quantity", Share.ENTITY_NAME, "shareCancellationNegativeQuantity");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,10 +1,13 @@
|
||||
package org.hostsharing.hsadminng.service.dto;
|
||||
import java.time.LocalDate;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import org.hostsharing.hsadminng.domain.enumeration.AssetAction;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
import org.hostsharing.hsadminng.domain.enumeration.AssetAction;
|
||||
|
||||
/**
|
||||
* A DTO for the Asset entity.
|
||||
@ -31,7 +34,7 @@ public class AssetDTO implements Serializable {
|
||||
|
||||
private Long membershipId;
|
||||
|
||||
private String membershipDocumentDate;
|
||||
private String membershipAdmissionDocumentDate;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -89,12 +92,12 @@ public class AssetDTO implements Serializable {
|
||||
this.membershipId = membershipId;
|
||||
}
|
||||
|
||||
public String getMembershipDocumentDate() {
|
||||
return membershipDocumentDate;
|
||||
public String getMembershipAdmissionDocumentDate() {
|
||||
return membershipAdmissionDocumentDate;
|
||||
}
|
||||
|
||||
public void setMembershipDocumentDate(String membershipDocumentDate) {
|
||||
this.membershipDocumentDate = membershipDocumentDate;
|
||||
public void setMembershipAdmissionDocumentDate(String membershipAdmissionDocumentDate) {
|
||||
this.membershipAdmissionDocumentDate = membershipAdmissionDocumentDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -128,7 +131,7 @@ public class AssetDTO implements Serializable {
|
||||
", amount=" + getAmount() +
|
||||
", remark='" + getRemark() + "'" +
|
||||
", membership=" + getMembershipId() +
|
||||
", membership='" + getMembershipDocumentDate() + "'" +
|
||||
", membership='" + getMembershipAdmissionDocumentDate() + "'" +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +1,11 @@
|
||||
package org.hostsharing.hsadminng.service.dto;
|
||||
|
||||
import io.github.jhipster.service.filter.*;
|
||||
import org.hostsharing.hsadminng.domain.enumeration.CustomerKind;
|
||||
import org.hostsharing.hsadminng.domain.enumeration.VatRegion;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
import io.github.jhipster.service.filter.BooleanFilter;
|
||||
import io.github.jhipster.service.filter.DoubleFilter;
|
||||
import io.github.jhipster.service.filter.Filter;
|
||||
import io.github.jhipster.service.filter.FloatFilter;
|
||||
import io.github.jhipster.service.filter.IntegerFilter;
|
||||
import io.github.jhipster.service.filter.LongFilter;
|
||||
import io.github.jhipster.service.filter.StringFilter;
|
||||
|
||||
/**
|
||||
* Criteria class for the Customer entity. This class is used in CustomerResource to
|
||||
@ -19,6 +16,16 @@ import io.github.jhipster.service.filter.StringFilter;
|
||||
* fix type specific filters.
|
||||
*/
|
||||
public class CustomerCriteria implements Serializable {
|
||||
/**
|
||||
* Class for filtering CustomerKind
|
||||
*/
|
||||
public static class CustomerKindFilter extends Filter<CustomerKind> {
|
||||
}
|
||||
/**
|
||||
* Class for filtering VatRegion
|
||||
*/
|
||||
public static class VatRegionFilter extends Filter<VatRegion> {
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -30,6 +37,20 @@ public class CustomerCriteria implements Serializable {
|
||||
|
||||
private StringFilter name;
|
||||
|
||||
private CustomerKindFilter kind;
|
||||
|
||||
private LocalDateFilter birthDate;
|
||||
|
||||
private StringFilter birthPlace;
|
||||
|
||||
private StringFilter registrationCourt;
|
||||
|
||||
private StringFilter registrationNumber;
|
||||
|
||||
private VatRegionFilter vatRegion;
|
||||
|
||||
private StringFilter vatNumber;
|
||||
|
||||
private StringFilter contractualSalutation;
|
||||
|
||||
private StringFilter contractualAddress;
|
||||
@ -76,6 +97,62 @@ public class CustomerCriteria implements Serializable {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public CustomerKindFilter getKind() {
|
||||
return kind;
|
||||
}
|
||||
|
||||
public void setKind(CustomerKindFilter kind) {
|
||||
this.kind = kind;
|
||||
}
|
||||
|
||||
public LocalDateFilter getBirthDate() {
|
||||
return birthDate;
|
||||
}
|
||||
|
||||
public void setBirthDate(LocalDateFilter birthDate) {
|
||||
this.birthDate = birthDate;
|
||||
}
|
||||
|
||||
public StringFilter getBirthPlace() {
|
||||
return birthPlace;
|
||||
}
|
||||
|
||||
public void setBirthPlace(StringFilter birthPlace) {
|
||||
this.birthPlace = birthPlace;
|
||||
}
|
||||
|
||||
public StringFilter getRegistrationCourt() {
|
||||
return registrationCourt;
|
||||
}
|
||||
|
||||
public void setRegistrationCourt(StringFilter registrationCourt) {
|
||||
this.registrationCourt = registrationCourt;
|
||||
}
|
||||
|
||||
public StringFilter getRegistrationNumber() {
|
||||
return registrationNumber;
|
||||
}
|
||||
|
||||
public void setRegistrationNumber(StringFilter registrationNumber) {
|
||||
this.registrationNumber = registrationNumber;
|
||||
}
|
||||
|
||||
public VatRegionFilter getVatRegion() {
|
||||
return vatRegion;
|
||||
}
|
||||
|
||||
public void setVatRegion(VatRegionFilter vatRegion) {
|
||||
this.vatRegion = vatRegion;
|
||||
}
|
||||
|
||||
public StringFilter getVatNumber() {
|
||||
return vatNumber;
|
||||
}
|
||||
|
||||
public void setVatNumber(StringFilter vatNumber) {
|
||||
this.vatNumber = vatNumber;
|
||||
}
|
||||
|
||||
public StringFilter getContractualSalutation() {
|
||||
return contractualSalutation;
|
||||
}
|
||||
@ -147,6 +224,13 @@ public class CustomerCriteria implements Serializable {
|
||||
Objects.equals(reference, that.reference) &&
|
||||
Objects.equals(prefix, that.prefix) &&
|
||||
Objects.equals(name, that.name) &&
|
||||
Objects.equals(kind, that.kind) &&
|
||||
Objects.equals(birthDate, that.birthDate) &&
|
||||
Objects.equals(birthPlace, that.birthPlace) &&
|
||||
Objects.equals(registrationCourt, that.registrationCourt) &&
|
||||
Objects.equals(registrationNumber, that.registrationNumber) &&
|
||||
Objects.equals(vatRegion, that.vatRegion) &&
|
||||
Objects.equals(vatNumber, that.vatNumber) &&
|
||||
Objects.equals(contractualSalutation, that.contractualSalutation) &&
|
||||
Objects.equals(contractualAddress, that.contractualAddress) &&
|
||||
Objects.equals(billingSalutation, that.billingSalutation) &&
|
||||
@ -163,6 +247,13 @@ public class CustomerCriteria implements Serializable {
|
||||
reference,
|
||||
prefix,
|
||||
name,
|
||||
kind,
|
||||
birthDate,
|
||||
birthPlace,
|
||||
registrationCourt,
|
||||
registrationNumber,
|
||||
vatRegion,
|
||||
vatNumber,
|
||||
contractualSalutation,
|
||||
contractualAddress,
|
||||
billingSalutation,
|
||||
@ -180,6 +271,13 @@ public class CustomerCriteria implements Serializable {
|
||||
(reference != null ? "reference=" + reference + ", " : "") +
|
||||
(prefix != null ? "prefix=" + prefix + ", " : "") +
|
||||
(name != null ? "name=" + name + ", " : "") +
|
||||
(kind != null ? "kind=" + kind + ", " : "") +
|
||||
(birthDate != null ? "birthDate=" + birthDate + ", " : "") +
|
||||
(birthPlace != null ? "birthPlace=" + birthPlace + ", " : "") +
|
||||
(registrationCourt != null ? "registrationCourt=" + registrationCourt + ", " : "") +
|
||||
(registrationNumber != null ? "registrationNumber=" + registrationNumber + ", " : "") +
|
||||
(vatRegion != null ? "vatRegion=" + vatRegion + ", " : "") +
|
||||
(vatNumber != null ? "vatNumber=" + vatNumber + ", " : "") +
|
||||
(contractualSalutation != null ? "contractualSalutation=" + contractualSalutation + ", " : "") +
|
||||
(contractualAddress != null ? "contractualAddress=" + contractualAddress + ", " : "") +
|
||||
(billingSalutation != null ? "billingSalutation=" + billingSalutation + ", " : "") +
|
||||
|
@ -6,6 +6,8 @@ import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||
import com.fasterxml.jackson.databind.JsonSerializer;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import org.hostsharing.hsadminng.domain.enumeration.CustomerKind;
|
||||
import org.hostsharing.hsadminng.domain.enumeration.VatRegion;
|
||||
import org.hostsharing.hsadminng.service.accessfilter.*;
|
||||
import org.springframework.boot.jackson.JsonComponent;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
@ -13,6 +15,7 @@ import org.springframework.context.ApplicationContext;
|
||||
import javax.validation.constraints.*;
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@ -41,6 +44,26 @@ public class CustomerDTO implements Serializable {
|
||||
@AccessFor(init = Role.ADMIN, read = Role.ANY_CUSTOMER_USER)
|
||||
private String name;
|
||||
|
||||
@NotNull
|
||||
private CustomerKind kind;
|
||||
|
||||
private LocalDate birthDate;
|
||||
|
||||
@Size(max = 80)
|
||||
private String birthPlace;
|
||||
|
||||
@Size(max = 80)
|
||||
private String registrationCourt;
|
||||
|
||||
@Size(max = 80)
|
||||
private String registrationNumber;
|
||||
|
||||
@NotNull
|
||||
private VatRegion vatRegion;
|
||||
|
||||
@Size(max = 40)
|
||||
private String vatNumber;
|
||||
|
||||
@Size(max = 80)
|
||||
@AccessFor(init = Role.ADMIN, update = Role.CONTRACTUAL_CONTACT, read = Role.ANY_CUSTOMER_CONTACT)
|
||||
private String contractualSalutation;
|
||||
@ -94,6 +117,62 @@ public class CustomerDTO implements Serializable {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public CustomerKind getKind() {
|
||||
return kind;
|
||||
}
|
||||
|
||||
public void setKind(CustomerKind kind) {
|
||||
this.kind = kind;
|
||||
}
|
||||
|
||||
public LocalDate getBirthDate() {
|
||||
return birthDate;
|
||||
}
|
||||
|
||||
public void setBirthDate(LocalDate birthDate) {
|
||||
this.birthDate = birthDate;
|
||||
}
|
||||
|
||||
public String getBirthPlace() {
|
||||
return birthPlace;
|
||||
}
|
||||
|
||||
public void setBirthPlace(String birthPlace) {
|
||||
this.birthPlace = birthPlace;
|
||||
}
|
||||
|
||||
public String getRegistrationCourt() {
|
||||
return registrationCourt;
|
||||
}
|
||||
|
||||
public void setRegistrationCourt(String registrationCourt) {
|
||||
this.registrationCourt = registrationCourt;
|
||||
}
|
||||
|
||||
public String getRegistrationNumber() {
|
||||
return registrationNumber;
|
||||
}
|
||||
|
||||
public void setRegistrationNumber(String registrationNumber) {
|
||||
this.registrationNumber = registrationNumber;
|
||||
}
|
||||
|
||||
public VatRegion getVatRegion() {
|
||||
return vatRegion;
|
||||
}
|
||||
|
||||
public void setVatRegion(VatRegion vatRegion) {
|
||||
this.vatRegion = vatRegion;
|
||||
}
|
||||
|
||||
public String getVatNumber() {
|
||||
return vatNumber;
|
||||
}
|
||||
|
||||
public void setVatNumber(String vatNumber) {
|
||||
this.vatNumber = vatNumber;
|
||||
}
|
||||
|
||||
public String getContractualSalutation() {
|
||||
return contractualSalutation;
|
||||
}
|
||||
@ -162,6 +241,13 @@ public class CustomerDTO implements Serializable {
|
||||
", reference=" + getReference() +
|
||||
", prefix='" + getPrefix() + "'" +
|
||||
", name='" + getName() + "'" +
|
||||
", kind='" + getKind() + "'" +
|
||||
", birthDate='" + getBirthDate() + "'" +
|
||||
", birthPlace='" + getBirthPlace() + "'" +
|
||||
", registrationCourt='" + getRegistrationCourt() + "'" +
|
||||
", registrationNumber='" + getRegistrationNumber() + "'" +
|
||||
", vatRegion='" + getVatRegion() + "'" +
|
||||
", vatNumber='" + getVatNumber() + "'" +
|
||||
", contractualSalutation='" + getContractualSalutation() + "'" +
|
||||
", contractualAddress='" + getContractualAddress() + "'" +
|
||||
", billingSalutation='" + getBillingSalutation() + "'" +
|
||||
|
@ -1,15 +1,12 @@
|
||||
package org.hostsharing.hsadminng.service.dto;
|
||||
|
||||
import io.github.jhipster.service.filter.Filter;
|
||||
import io.github.jhipster.service.filter.LocalDateFilter;
|
||||
import io.github.jhipster.service.filter.LongFilter;
|
||||
import io.github.jhipster.service.filter.StringFilter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
import io.github.jhipster.service.filter.BooleanFilter;
|
||||
import io.github.jhipster.service.filter.DoubleFilter;
|
||||
import io.github.jhipster.service.filter.Filter;
|
||||
import io.github.jhipster.service.filter.FloatFilter;
|
||||
import io.github.jhipster.service.filter.IntegerFilter;
|
||||
import io.github.jhipster.service.filter.LongFilter;
|
||||
import io.github.jhipster.service.filter.StringFilter;
|
||||
import io.github.jhipster.service.filter.LocalDateFilter;
|
||||
|
||||
/**
|
||||
* Criteria class for the Membership entity. This class is used in MembershipResource to
|
||||
@ -25,11 +22,13 @@ public class MembershipCriteria implements Serializable {
|
||||
|
||||
private LongFilter id;
|
||||
|
||||
private LocalDateFilter documentDate;
|
||||
private LocalDateFilter admissionDocumentDate;
|
||||
|
||||
private LocalDateFilter memberFrom;
|
||||
private LocalDateFilter cancellationDocumentDate;
|
||||
|
||||
private LocalDateFilter memberUntil;
|
||||
private LocalDateFilter memberFromDate;
|
||||
|
||||
private LocalDateFilter memberUntilDate;
|
||||
|
||||
private StringFilter remark;
|
||||
|
||||
@ -47,28 +46,36 @@ public class MembershipCriteria implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public LocalDateFilter getDocumentDate() {
|
||||
return documentDate;
|
||||
public LocalDateFilter getAdmissionDocumentDate() {
|
||||
return admissionDocumentDate;
|
||||
}
|
||||
|
||||
public void setDocumentDate(LocalDateFilter documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
public void setAdmissionDocumentDate(LocalDateFilter admissionDocumentDate) {
|
||||
this.admissionDocumentDate = admissionDocumentDate;
|
||||
}
|
||||
|
||||
public LocalDateFilter getMemberFrom() {
|
||||
return memberFrom;
|
||||
public LocalDateFilter getCancellationDocumentDate() {
|
||||
return cancellationDocumentDate;
|
||||
}
|
||||
|
||||
public void setMemberFrom(LocalDateFilter memberFrom) {
|
||||
this.memberFrom = memberFrom;
|
||||
public void setCancellationDocumentDate(LocalDateFilter cancellationDocumentDate) {
|
||||
this.cancellationDocumentDate = cancellationDocumentDate;
|
||||
}
|
||||
|
||||
public LocalDateFilter getMemberUntil() {
|
||||
return memberUntil;
|
||||
public LocalDateFilter getMemberFromDate() {
|
||||
return memberFromDate;
|
||||
}
|
||||
|
||||
public void setMemberUntil(LocalDateFilter memberUntil) {
|
||||
this.memberUntil = memberUntil;
|
||||
public void setMemberFromDate(LocalDateFilter memberFromDate) {
|
||||
this.memberFromDate = memberFromDate;
|
||||
}
|
||||
|
||||
public LocalDateFilter getMemberUntilDate() {
|
||||
return memberUntilDate;
|
||||
}
|
||||
|
||||
public void setMemberUntilDate(LocalDateFilter memberUntilDate) {
|
||||
this.memberUntilDate = memberUntilDate;
|
||||
}
|
||||
|
||||
public StringFilter getRemark() {
|
||||
@ -115,9 +122,10 @@ public class MembershipCriteria implements Serializable {
|
||||
final MembershipCriteria that = (MembershipCriteria) o;
|
||||
return
|
||||
Objects.equals(id, that.id) &&
|
||||
Objects.equals(documentDate, that.documentDate) &&
|
||||
Objects.equals(memberFrom, that.memberFrom) &&
|
||||
Objects.equals(memberUntil, that.memberUntil) &&
|
||||
Objects.equals(admissionDocumentDate, that.admissionDocumentDate) &&
|
||||
Objects.equals(cancellationDocumentDate, that.cancellationDocumentDate) &&
|
||||
Objects.equals(memberFromDate, that.memberFromDate) &&
|
||||
Objects.equals(memberUntilDate, that.memberUntilDate) &&
|
||||
Objects.equals(remark, that.remark) &&
|
||||
Objects.equals(shareId, that.shareId) &&
|
||||
Objects.equals(assetId, that.assetId) &&
|
||||
@ -128,9 +136,10 @@ public class MembershipCriteria implements Serializable {
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
id,
|
||||
documentDate,
|
||||
memberFrom,
|
||||
memberUntil,
|
||||
admissionDocumentDate,
|
||||
cancellationDocumentDate,
|
||||
memberFromDate,
|
||||
memberUntilDate,
|
||||
remark,
|
||||
shareId,
|
||||
assetId,
|
||||
@ -142,9 +151,10 @@ public class MembershipCriteria implements Serializable {
|
||||
public String toString() {
|
||||
return "MembershipCriteria{" +
|
||||
(id != null ? "id=" + id + ", " : "") +
|
||||
(documentDate != null ? "documentDate=" + documentDate + ", " : "") +
|
||||
(memberFrom != null ? "memberFrom=" + memberFrom + ", " : "") +
|
||||
(memberUntil != null ? "memberUntil=" + memberUntil + ", " : "") +
|
||||
(admissionDocumentDate != null ? "admissionDocumentDate=" + admissionDocumentDate + ", " : "") +
|
||||
(cancellationDocumentDate != null ? "cancellationDocumentDate=" + cancellationDocumentDate + ", " : "") +
|
||||
(memberFromDate != null ? "memberFromDate=" + memberFromDate + ", " : "") +
|
||||
(memberUntilDate != null ? "memberUntilDate=" + memberUntilDate + ", " : "") +
|
||||
(remark != null ? "remark=" + remark + ", " : "") +
|
||||
(shareId != null ? "shareId=" + shareId + ", " : "") +
|
||||
(assetId != null ? "assetId=" + assetId + ", " : "") +
|
||||
|
@ -24,14 +24,17 @@ public class MembershipDTO implements Serializable {
|
||||
|
||||
@NotNull
|
||||
@AccessFor(init = Role.ADMIN, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
|
||||
private LocalDate documentDate;
|
||||
private LocalDate admissionDocumentDate;
|
||||
|
||||
@AccessFor(init = Role.ADMIN, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
|
||||
private LocalDate cancellationDocumentDate;
|
||||
|
||||
@NotNull
|
||||
@AccessFor(init = Role.ADMIN, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
|
||||
private LocalDate memberFrom;
|
||||
private LocalDate memberFromDate;
|
||||
|
||||
@AccessFor(init = Role.ADMIN, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
|
||||
private LocalDate memberUntil;
|
||||
private LocalDate memberUntilDate;
|
||||
|
||||
@Size(max = 160)
|
||||
@AccessFor(init = Role.ADMIN, read = Role.SUPPORTER)
|
||||
@ -58,28 +61,36 @@ public class MembershipDTO implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public LocalDate getDocumentDate() {
|
||||
return documentDate;
|
||||
public LocalDate getAdmissionDocumentDate() {
|
||||
return admissionDocumentDate;
|
||||
}
|
||||
|
||||
public void setDocumentDate(LocalDate documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
public void setAdmissionDocumentDate(LocalDate admissionDocumentDate) {
|
||||
this.admissionDocumentDate = admissionDocumentDate;
|
||||
}
|
||||
|
||||
public LocalDate getMemberFrom() {
|
||||
return memberFrom;
|
||||
public LocalDate getCancellationDocumentDate() {
|
||||
return cancellationDocumentDate;
|
||||
}
|
||||
|
||||
public void setMemberFrom(LocalDate memberFrom) {
|
||||
this.memberFrom = memberFrom;
|
||||
public void setCancellationDocumentDate(LocalDate cancellationDocumentDate) {
|
||||
this.cancellationDocumentDate = cancellationDocumentDate;
|
||||
}
|
||||
|
||||
public LocalDate getMemberUntil() {
|
||||
return memberUntil;
|
||||
public LocalDate getMemberFromDate() {
|
||||
return memberFromDate;
|
||||
}
|
||||
|
||||
public void setMemberUntil(LocalDate memberUntil) {
|
||||
this.memberUntil = memberUntil;
|
||||
public void setMemberFromDate(LocalDate memberFromDate) {
|
||||
this.memberFromDate = memberFromDate;
|
||||
}
|
||||
|
||||
public LocalDate getMemberUntilDate() {
|
||||
return memberUntilDate;
|
||||
}
|
||||
|
||||
public void setMemberUntilDate(LocalDate memberUntilDate) {
|
||||
this.memberUntilDate = memberUntilDate;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
@ -131,9 +142,10 @@ public class MembershipDTO implements Serializable {
|
||||
public String toString() {
|
||||
return "MembershipDTO{" +
|
||||
"id=" + getId() +
|
||||
", documentDate='" + getDocumentDate() + "'" +
|
||||
", memberFrom='" + getMemberFrom() + "'" +
|
||||
", memberUntil='" + getMemberUntil() + "'" +
|
||||
", admissionDocumentDate='" + getAdmissionDocumentDate() + "'" +
|
||||
", cancellationDocumentDate='" + getCancellationDocumentDate() + "'" +
|
||||
", memberFromDate='" + getMemberFromDate() + "'" +
|
||||
", memberUntilDate='" + getMemberUntilDate() + "'" +
|
||||
", remark='" + getRemark() + "'" +
|
||||
", customer=" + getCustomerId() +
|
||||
", customer='" + getCustomerPrefix() + "'" +
|
||||
|
@ -1,15 +1,12 @@
|
||||
package org.hostsharing.hsadminng.service.dto;
|
||||
|
||||
import io.github.jhipster.service.filter.Filter;
|
||||
import io.github.jhipster.service.filter.LocalDateFilter;
|
||||
import io.github.jhipster.service.filter.LongFilter;
|
||||
import io.github.jhipster.service.filter.StringFilter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
import io.github.jhipster.service.filter.BooleanFilter;
|
||||
import io.github.jhipster.service.filter.DoubleFilter;
|
||||
import io.github.jhipster.service.filter.Filter;
|
||||
import io.github.jhipster.service.filter.FloatFilter;
|
||||
import io.github.jhipster.service.filter.IntegerFilter;
|
||||
import io.github.jhipster.service.filter.LongFilter;
|
||||
import io.github.jhipster.service.filter.StringFilter;
|
||||
import io.github.jhipster.service.filter.LocalDateFilter;
|
||||
|
||||
/**
|
||||
* Criteria class for the SepaMandate entity. This class is used in SepaMandateResource to
|
||||
@ -31,15 +28,15 @@ public class SepaMandateCriteria implements Serializable {
|
||||
|
||||
private StringFilter bic;
|
||||
|
||||
private LocalDateFilter documentDate;
|
||||
private LocalDateFilter grantingDocumentDate;
|
||||
|
||||
private LocalDateFilter validFrom;
|
||||
private LocalDateFilter revokationDocumentDate;
|
||||
|
||||
private LocalDateFilter validUntil;
|
||||
private LocalDateFilter validFromDate;
|
||||
|
||||
private LocalDateFilter lastUsed;
|
||||
private LocalDateFilter validUntilDate;
|
||||
|
||||
private LocalDateFilter cancellationDate;
|
||||
private LocalDateFilter lastUsedDate;
|
||||
|
||||
private StringFilter remark;
|
||||
|
||||
@ -77,44 +74,44 @@ public class SepaMandateCriteria implements Serializable {
|
||||
this.bic = bic;
|
||||
}
|
||||
|
||||
public LocalDateFilter getDocumentDate() {
|
||||
return documentDate;
|
||||
public LocalDateFilter getGrantingDocumentDate() {
|
||||
return grantingDocumentDate;
|
||||
}
|
||||
|
||||
public void setDocumentDate(LocalDateFilter documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
public void setGrantingDocumentDate(LocalDateFilter grantingDocumentDate) {
|
||||
this.grantingDocumentDate = grantingDocumentDate;
|
||||
}
|
||||
|
||||
public LocalDateFilter getValidFrom() {
|
||||
return validFrom;
|
||||
public LocalDateFilter getRevokationDocumentDate() {
|
||||
return revokationDocumentDate;
|
||||
}
|
||||
|
||||
public void setValidFrom(LocalDateFilter validFrom) {
|
||||
this.validFrom = validFrom;
|
||||
public void setRevokationDocumentDate(LocalDateFilter revokationDocumentDate) {
|
||||
this.revokationDocumentDate = revokationDocumentDate;
|
||||
}
|
||||
|
||||
public LocalDateFilter getValidUntil() {
|
||||
return validUntil;
|
||||
public LocalDateFilter getValidFromDate() {
|
||||
return validFromDate;
|
||||
}
|
||||
|
||||
public void setValidUntil(LocalDateFilter validUntil) {
|
||||
this.validUntil = validUntil;
|
||||
public void setValidFromDate(LocalDateFilter validFromDate) {
|
||||
this.validFromDate = validFromDate;
|
||||
}
|
||||
|
||||
public LocalDateFilter getLastUsed() {
|
||||
return lastUsed;
|
||||
public LocalDateFilter getValidUntilDate() {
|
||||
return validUntilDate;
|
||||
}
|
||||
|
||||
public void setLastUsed(LocalDateFilter lastUsed) {
|
||||
this.lastUsed = lastUsed;
|
||||
public void setValidUntilDate(LocalDateFilter validUntilDate) {
|
||||
this.validUntilDate = validUntilDate;
|
||||
}
|
||||
|
||||
public LocalDateFilter getCancellationDate() {
|
||||
return cancellationDate;
|
||||
public LocalDateFilter getLastUsedDate() {
|
||||
return lastUsedDate;
|
||||
}
|
||||
|
||||
public void setCancellationDate(LocalDateFilter cancellationDate) {
|
||||
this.cancellationDate = cancellationDate;
|
||||
public void setLastUsedDate(LocalDateFilter lastUsedDate) {
|
||||
this.lastUsedDate = lastUsedDate;
|
||||
}
|
||||
|
||||
public StringFilter getRemark() {
|
||||
@ -148,11 +145,11 @@ public class SepaMandateCriteria implements Serializable {
|
||||
Objects.equals(reference, that.reference) &&
|
||||
Objects.equals(iban, that.iban) &&
|
||||
Objects.equals(bic, that.bic) &&
|
||||
Objects.equals(documentDate, that.documentDate) &&
|
||||
Objects.equals(validFrom, that.validFrom) &&
|
||||
Objects.equals(validUntil, that.validUntil) &&
|
||||
Objects.equals(lastUsed, that.lastUsed) &&
|
||||
Objects.equals(cancellationDate, that.cancellationDate) &&
|
||||
Objects.equals(grantingDocumentDate, that.grantingDocumentDate) &&
|
||||
Objects.equals(revokationDocumentDate, that.revokationDocumentDate) &&
|
||||
Objects.equals(validFromDate, that.validFromDate) &&
|
||||
Objects.equals(validUntilDate, that.validUntilDate) &&
|
||||
Objects.equals(lastUsedDate, that.lastUsedDate) &&
|
||||
Objects.equals(remark, that.remark) &&
|
||||
Objects.equals(customerId, that.customerId);
|
||||
}
|
||||
@ -164,11 +161,11 @@ public class SepaMandateCriteria implements Serializable {
|
||||
reference,
|
||||
iban,
|
||||
bic,
|
||||
documentDate,
|
||||
validFrom,
|
||||
validUntil,
|
||||
lastUsed,
|
||||
cancellationDate,
|
||||
grantingDocumentDate,
|
||||
revokationDocumentDate,
|
||||
validFromDate,
|
||||
validUntilDate,
|
||||
lastUsedDate,
|
||||
remark,
|
||||
customerId
|
||||
);
|
||||
@ -181,11 +178,11 @@ public class SepaMandateCriteria implements Serializable {
|
||||
(reference != null ? "reference=" + reference + ", " : "") +
|
||||
(iban != null ? "iban=" + iban + ", " : "") +
|
||||
(bic != null ? "bic=" + bic + ", " : "") +
|
||||
(documentDate != null ? "documentDate=" + documentDate + ", " : "") +
|
||||
(validFrom != null ? "validFrom=" + validFrom + ", " : "") +
|
||||
(validUntil != null ? "validUntil=" + validUntil + ", " : "") +
|
||||
(lastUsed != null ? "lastUsed=" + lastUsed + ", " : "") +
|
||||
(cancellationDate != null ? "cancellationDate=" + cancellationDate + ", " : "") +
|
||||
(grantingDocumentDate != null ? "grantingDocumentDate=" + grantingDocumentDate + ", " : "") +
|
||||
(revokationDocumentDate != null ? "revokationDocumentDate=" + revokationDocumentDate + ", " : "") +
|
||||
(validFromDate != null ? "validFromDate=" + validFromDate + ", " : "") +
|
||||
(validUntilDate != null ? "validUntilDate=" + validUntilDate + ", " : "") +
|
||||
(lastUsedDate != null ? "lastUsedDate=" + lastUsedDate + ", " : "") +
|
||||
(remark != null ? "remark=" + remark + ", " : "") +
|
||||
(customerId != null ? "customerId=" + customerId + ", " : "") +
|
||||
"}";
|
||||
|
@ -1,7 +1,9 @@
|
||||
package org.hostsharing.hsadminng.service.dto;
|
||||
import java.time.LocalDate;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@ -22,16 +24,16 @@ public class SepaMandateDTO implements Serializable {
|
||||
private String bic;
|
||||
|
||||
@NotNull
|
||||
private LocalDate documentDate;
|
||||
private LocalDate grantingDocumentDate;
|
||||
|
||||
private LocalDate revokationDocumentDate;
|
||||
|
||||
@NotNull
|
||||
private LocalDate validFrom;
|
||||
private LocalDate validFromDate;
|
||||
|
||||
private LocalDate validUntil;
|
||||
private LocalDate validUntilDate;
|
||||
|
||||
private LocalDate lastUsed;
|
||||
|
||||
private LocalDate cancellationDate;
|
||||
private LocalDate lastUsedDate;
|
||||
|
||||
@Size(max = 160)
|
||||
private String remark;
|
||||
@ -73,44 +75,44 @@ public class SepaMandateDTO implements Serializable {
|
||||
this.bic = bic;
|
||||
}
|
||||
|
||||
public LocalDate getDocumentDate() {
|
||||
return documentDate;
|
||||
public LocalDate getGrantingDocumentDate() {
|
||||
return grantingDocumentDate;
|
||||
}
|
||||
|
||||
public void setDocumentDate(LocalDate documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
public void setGrantingDocumentDate(LocalDate grantingDocumentDate) {
|
||||
this.grantingDocumentDate = grantingDocumentDate;
|
||||
}
|
||||
|
||||
public LocalDate getValidFrom() {
|
||||
return validFrom;
|
||||
public LocalDate getRevokationDocumentDate() {
|
||||
return revokationDocumentDate;
|
||||
}
|
||||
|
||||
public void setValidFrom(LocalDate validFrom) {
|
||||
this.validFrom = validFrom;
|
||||
public void setRevokationDocumentDate(LocalDate revokationDocumentDate) {
|
||||
this.revokationDocumentDate = revokationDocumentDate;
|
||||
}
|
||||
|
||||
public LocalDate getValidUntil() {
|
||||
return validUntil;
|
||||
public LocalDate getValidFromDate() {
|
||||
return validFromDate;
|
||||
}
|
||||
|
||||
public void setValidUntil(LocalDate validUntil) {
|
||||
this.validUntil = validUntil;
|
||||
public void setValidFromDate(LocalDate validFromDate) {
|
||||
this.validFromDate = validFromDate;
|
||||
}
|
||||
|
||||
public LocalDate getLastUsed() {
|
||||
return lastUsed;
|
||||
public LocalDate getValidUntilDate() {
|
||||
return validUntilDate;
|
||||
}
|
||||
|
||||
public void setLastUsed(LocalDate lastUsed) {
|
||||
this.lastUsed = lastUsed;
|
||||
public void setValidUntilDate(LocalDate validUntilDate) {
|
||||
this.validUntilDate = validUntilDate;
|
||||
}
|
||||
|
||||
public LocalDate getCancellationDate() {
|
||||
return cancellationDate;
|
||||
public LocalDate getLastUsedDate() {
|
||||
return lastUsedDate;
|
||||
}
|
||||
|
||||
public void setCancellationDate(LocalDate cancellationDate) {
|
||||
this.cancellationDate = cancellationDate;
|
||||
public void setLastUsedDate(LocalDate lastUsedDate) {
|
||||
this.lastUsedDate = lastUsedDate;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
@ -165,11 +167,11 @@ public class SepaMandateDTO implements Serializable {
|
||||
", reference='" + getReference() + "'" +
|
||||
", iban='" + getIban() + "'" +
|
||||
", bic='" + getBic() + "'" +
|
||||
", documentDate='" + getDocumentDate() + "'" +
|
||||
", validFrom='" + getValidFrom() + "'" +
|
||||
", validUntil='" + getValidUntil() + "'" +
|
||||
", lastUsed='" + getLastUsed() + "'" +
|
||||
", cancellationDate='" + getCancellationDate() + "'" +
|
||||
", grantingDocumentDate='" + getGrantingDocumentDate() + "'" +
|
||||
", revokationDocumentDate='" + getRevokationDocumentDate() + "'" +
|
||||
", validFromDate='" + getValidFromDate() + "'" +
|
||||
", validUntilDate='" + getValidUntilDate() + "'" +
|
||||
", lastUsedDate='" + getLastUsedDate() + "'" +
|
||||
", remark='" + getRemark() + "'" +
|
||||
", customer=" + getCustomerId() +
|
||||
", customer='" + getCustomerPrefix() + "'" +
|
||||
|
@ -1,12 +1,5 @@
|
||||
package org.hostsharing.hsadminng.service.dto;
|
||||
|
||||
import org.hostsharing.hsadminng.domain.enumeration.ShareAction;
|
||||
import org.hostsharing.hsadminng.service.MembershipService;
|
||||
import org.hostsharing.hsadminng.service.accessfilter.AccessFor;
|
||||
import org.hostsharing.hsadminng.service.accessfilter.ParentId;
|
||||
import org.hostsharing.hsadminng.service.accessfilter.Role;
|
||||
import org.hostsharing.hsadminng.service.accessfilter.SelfId;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
@ -24,10 +17,12 @@ public class ShareDTO implements Serializable {
|
||||
|
||||
@NotNull
|
||||
@AccessFor(init = Role.ADMIN, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
|
||||
@AccessFor(init = Role.ADMIN, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
|
||||
private LocalDate documentDate;
|
||||
|
||||
@NotNull
|
||||
@AccessFor(init = Role.ADMIN, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
|
||||
@AccessFor(init = Role.ADMIN, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
|
||||
private LocalDate valueDate;
|
||||
|
||||
@NotNull
|
||||
@ -47,7 +42,7 @@ public class ShareDTO implements Serializable {
|
||||
private Long membershipId;
|
||||
|
||||
@AccessFor(init = Role.ADMIN, read = Role.SUPPORTER)
|
||||
private String membershipDocumentDate;
|
||||
private String membershipAdmissionDocumentDate;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -105,12 +100,12 @@ public class ShareDTO implements Serializable {
|
||||
this.membershipId = membershipId;
|
||||
}
|
||||
|
||||
public String getMembershipDocumentDate() {
|
||||
return membershipDocumentDate;
|
||||
public String getMembershipAdmissionDocumentDate() {
|
||||
return membershipAdmissionDocumentDate;
|
||||
}
|
||||
|
||||
public void setMembershipDocumentDate(String membershipDocumentDate) {
|
||||
this.membershipDocumentDate = membershipDocumentDate;
|
||||
public void setMembershipAdmissionDocumentDate(String membershipAdmissionDocumentDate) {
|
||||
this.membershipAdmissionDocumentDate = membershipAdmissionDocumentDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -144,7 +139,7 @@ public class ShareDTO implements Serializable {
|
||||
", quantity=" + getQuantity() +
|
||||
", remark='" + getRemark() + "'" +
|
||||
", membership=" + getMembershipId() +
|
||||
", membership='" + getMembershipDocumentDate() + "'" +
|
||||
", membership='" + getMembershipAdmissionDocumentDate() + "'" +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
package org.hostsharing.hsadminng.service.mapper;
|
||||
|
||||
import org.hostsharing.hsadminng.domain.*;
|
||||
import org.hostsharing.hsadminng.domain.Asset;
|
||||
import org.hostsharing.hsadminng.service.dto.AssetDTO;
|
||||
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
/**
|
||||
* Mapper for the entity Asset and its DTO AssetDTO.
|
||||
@ -12,7 +12,7 @@ import org.mapstruct.*;
|
||||
public interface AssetMapper extends EntityMapper<AssetDTO, Asset> {
|
||||
|
||||
@Mapping(source = "membership.id", target = "membershipId")
|
||||
@Mapping(source = "membership.documentDate", target = "membershipDocumentDate")
|
||||
@Mapping(source = "membership.admissionDocumentDate", target = "membershipAdmissionDocumentDate")
|
||||
AssetDTO toDto(Asset asset);
|
||||
|
||||
@Mapping(source = "membershipId", target = "membership")
|
||||
|
@ -1,9 +1,9 @@
|
||||
package org.hostsharing.hsadminng.service.mapper;
|
||||
|
||||
import org.hostsharing.hsadminng.domain.*;
|
||||
import org.hostsharing.hsadminng.domain.Share;
|
||||
import org.hostsharing.hsadminng.service.dto.ShareDTO;
|
||||
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
/**
|
||||
* Mapper for the entity Share and its DTO ShareDTO.
|
||||
@ -12,7 +12,7 @@ import org.mapstruct.*;
|
||||
public interface ShareMapper extends EntityMapper<ShareDTO, Share> {
|
||||
|
||||
@Mapping(source = "membership.id", target = "membershipId")
|
||||
@Mapping(source = "membership.documentDate", target = "membershipDocumentDate")
|
||||
@Mapping(source = "membership.admissionDocumentDate", target = "membershipAdmissionDocumentDate")
|
||||
ShareDTO toDto(Share share);
|
||||
|
||||
@Mapping(source = "membershipId", target = "membership")
|
||||
|
@ -1,25 +1,24 @@
|
||||
package org.hostsharing.hsadminng.web.rest;
|
||||
|
||||
import io.github.jhipster.web.util.ResponseUtil;
|
||||
import org.hostsharing.hsadminng.service.AssetQueryService;
|
||||
import org.hostsharing.hsadminng.service.AssetService;
|
||||
import org.hostsharing.hsadminng.service.dto.AssetCriteria;
|
||||
import org.hostsharing.hsadminng.service.dto.AssetDTO;
|
||||
import org.hostsharing.hsadminng.web.rest.errors.BadRequestAlertException;
|
||||
import org.hostsharing.hsadminng.web.rest.util.HeaderUtil;
|
||||
import org.hostsharing.hsadminng.web.rest.util.PaginationUtil;
|
||||
import org.hostsharing.hsadminng.service.dto.AssetDTO;
|
||||
import org.hostsharing.hsadminng.service.dto.AssetCriteria;
|
||||
import org.hostsharing.hsadminng.service.AssetQueryService;
|
||||
import io.github.jhipster.web.util.ResponseUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@ -74,13 +73,8 @@ public class AssetResource {
|
||||
@PutMapping("/assets")
|
||||
public ResponseEntity<AssetDTO> updateAsset(@Valid @RequestBody AssetDTO assetDTO) throws URISyntaxException {
|
||||
log.debug("REST request to update Asset : {}", assetDTO);
|
||||
if (assetDTO.getId() == null) {
|
||||
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
|
||||
}
|
||||
AssetDTO result = assetService.save(assetDTO);
|
||||
return ResponseEntity.ok()
|
||||
.headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, assetDTO.getId().toString()))
|
||||
.body(result);
|
||||
// TODO mhoennig: Rather completely remove the endpoint?
|
||||
throw new BadRequestAlertException("Assets are immutable", ENTITY_NAME, "assetTransactionImmutable");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -132,7 +126,7 @@ public class AssetResource {
|
||||
@DeleteMapping("/assets/{id}")
|
||||
public ResponseEntity<Void> deleteAsset(@PathVariable Long id) {
|
||||
log.debug("REST request to delete Asset : {}", id);
|
||||
assetService.delete(id);
|
||||
return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();
|
||||
// TODO mhoennig: Rather completely remove the endpoint?
|
||||
throw new BadRequestAlertException("Asset are immutable", ENTITY_NAME, "assetTransactionImmutable");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user