Revert "better display labels and less columns in tables (deliberately not yet in SepaMandate*)"
This reverts commit d81b71cd3a.
			
			
This commit is contained in:
		@@ -4,7 +4,6 @@ import org.hostsharing.hsadminng.domain.Asset;
 | 
				
			|||||||
import org.hostsharing.hsadminng.repository.AssetRepository;
 | 
					import org.hostsharing.hsadminng.repository.AssetRepository;
 | 
				
			||||||
import org.hostsharing.hsadminng.service.dto.AssetDTO;
 | 
					import org.hostsharing.hsadminng.service.dto.AssetDTO;
 | 
				
			||||||
import org.hostsharing.hsadminng.service.mapper.AssetMapper;
 | 
					import org.hostsharing.hsadminng.service.mapper.AssetMapper;
 | 
				
			||||||
import org.hostsharing.hsadminng.web.rest.errors.BadRequestAlertException;
 | 
					 | 
				
			||||||
import org.slf4j.Logger;
 | 
					import org.slf4j.Logger;
 | 
				
			||||||
import org.slf4j.LoggerFactory;
 | 
					import org.slf4j.LoggerFactory;
 | 
				
			||||||
import org.springframework.data.domain.Page;
 | 
					import org.springframework.data.domain.Page;
 | 
				
			||||||
@@ -24,12 +23,11 @@ public class AssetService {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    private final Logger log = LoggerFactory.getLogger(AssetService.class);
 | 
					    private final Logger log = LoggerFactory.getLogger(AssetService.class);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private final EntityManager em;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private final AssetRepository assetRepository;
 | 
					    private final AssetRepository assetRepository;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private final AssetMapper assetMapper;
 | 
					    private final AssetMapper assetMapper;
 | 
				
			||||||
    private final AssetValidator assetValidator;
 | 
					    private final AssetValidator assetValidator;
 | 
				
			||||||
 | 
					    private final EntityManager em;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public AssetService(final EntityManager em, final AssetRepository assetRepository, final AssetMapper assetMapper, final AssetValidator assetValidator) {
 | 
					    public AssetService(final EntityManager em, final AssetRepository assetRepository, final AssetMapper assetMapper, final AssetValidator assetValidator) {
 | 
				
			||||||
        this.em = em;
 | 
					        this.em = em;
 | 
				
			||||||
@@ -88,7 +86,6 @@ public class AssetService {
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    public void delete(Long id) {
 | 
					    public void delete(Long id) {
 | 
				
			||||||
        log.debug("Request to delete Asset : {}", id);
 | 
					        log.debug("Request to delete Asset : {}", id);
 | 
				
			||||||
 | 
					        assetRepository.deleteById(id);
 | 
				
			||||||
        throw new BadRequestAlertException("Asset transactions are immutable", Asset.ENTITY_NAME, "assetTransactionImmutable");
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,7 +12,6 @@ import org.springframework.data.domain.Pageable;
 | 
				
			|||||||
import org.springframework.stereotype.Service;
 | 
					import org.springframework.stereotype.Service;
 | 
				
			||||||
import org.springframework.transaction.annotation.Transactional;
 | 
					import org.springframework.transaction.annotation.Transactional;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import javax.persistence.EntityManager;
 | 
					 | 
				
			||||||
import java.util.Optional;
 | 
					import java.util.Optional;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
@@ -24,19 +23,15 @@ public class MembershipService implements IdToDtoResolver<MembershipDTO> {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    private final Logger log = LoggerFactory.getLogger(MembershipService.class);
 | 
					    private final Logger log = LoggerFactory.getLogger(MembershipService.class);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private final EntityManager em;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private final MembershipValidator membershipValidator;
 | 
					    private final MembershipValidator membershipValidator;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private final MembershipRepository membershipRepository;
 | 
					    private final MembershipRepository membershipRepository;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private final MembershipMapper membershipMapper;
 | 
					    private final MembershipMapper membershipMapper;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public MembershipService(final EntityManager em,
 | 
					    public MembershipService(final MembershipValidator membershipValidator,
 | 
				
			||||||
                             final MembershipValidator membershipValidator,
 | 
					 | 
				
			||||||
                             final MembershipRepository membershipRepository,
 | 
					                             final MembershipRepository membershipRepository,
 | 
				
			||||||
                             final MembershipMapper membershipMapper) {
 | 
					                             final MembershipMapper membershipMapper) {
 | 
				
			||||||
        this.em = em;
 | 
					 | 
				
			||||||
        this.membershipValidator = membershipValidator;
 | 
					        this.membershipValidator = membershipValidator;
 | 
				
			||||||
        this.membershipRepository = membershipRepository;
 | 
					        this.membershipRepository = membershipRepository;
 | 
				
			||||||
        this.membershipMapper = membershipMapper;
 | 
					        this.membershipMapper = membershipMapper;
 | 
				
			||||||
@@ -55,8 +50,6 @@ public class MembershipService implements IdToDtoResolver<MembershipDTO> {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        Membership membership = membershipMapper.toEntity(membershipDTO);
 | 
					        Membership membership = membershipMapper.toEntity(membershipDTO);
 | 
				
			||||||
        membership = membershipRepository.save(membership);
 | 
					        membership = membershipRepository.save(membership);
 | 
				
			||||||
        em.flush();
 | 
					 | 
				
			||||||
        em.refresh(membership);
 | 
					 | 
				
			||||||
        return membershipMapper.toDto(membership);
 | 
					        return membershipMapper.toDto(membership);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,7 +12,6 @@ import org.springframework.data.domain.Pageable;
 | 
				
			|||||||
import org.springframework.stereotype.Service;
 | 
					import org.springframework.stereotype.Service;
 | 
				
			||||||
import org.springframework.transaction.annotation.Transactional;
 | 
					import org.springframework.transaction.annotation.Transactional;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import javax.persistence.EntityManager;
 | 
					 | 
				
			||||||
import java.util.Optional;
 | 
					import java.util.Optional;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
@@ -24,16 +23,13 @@ public class ShareService implements IdToDtoResolver<ShareDTO> {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    private final Logger log = LoggerFactory.getLogger(ShareService.class);
 | 
					    private final Logger log = LoggerFactory.getLogger(ShareService.class);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private final EntityManager em;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private final ShareRepository shareRepository;
 | 
					    private final ShareRepository shareRepository;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private final ShareMapper shareMapper;
 | 
					    private final ShareMapper shareMapper;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private final ShareValidator shareValidator;
 | 
					    private final ShareValidator shareValidator;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public ShareService(final EntityManager em, final ShareRepository shareRepository, final ShareMapper shareMapper, final ShareValidator shareValidator) {
 | 
					    public ShareService(ShareRepository shareRepository, ShareMapper shareMapper, ShareValidator shareValidator) {
 | 
				
			||||||
        this.em = em;
 | 
					 | 
				
			||||||
        this.shareRepository = shareRepository;
 | 
					        this.shareRepository = shareRepository;
 | 
				
			||||||
        this.shareMapper = shareMapper;
 | 
					        this.shareMapper = shareMapper;
 | 
				
			||||||
        this.shareValidator = shareValidator;
 | 
					        this.shareValidator = shareValidator;
 | 
				
			||||||
@@ -52,8 +48,6 @@ public class ShareService implements IdToDtoResolver<ShareDTO> {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        Share share = shareMapper.toEntity(shareDTO);
 | 
					        Share share = shareMapper.toEntity(shareDTO);
 | 
				
			||||||
        share = shareRepository.save(share);
 | 
					        share = shareRepository.save(share);
 | 
				
			||||||
        em.flush();
 | 
					 | 
				
			||||||
        em.refresh(share);
 | 
					 | 
				
			||||||
        return shareMapper.toDto(share);
 | 
					        return shareMapper.toDto(share);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -47,7 +47,7 @@ public class AssetDTO implements Serializable, AccessMappings {
 | 
				
			|||||||
    private Long membershipId;
 | 
					    private Long membershipId;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @AccessFor(init=Role.ANYBODY, update=Role.ANYBODY, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
 | 
					    @AccessFor(init=Role.ANYBODY, update=Role.ANYBODY, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
 | 
				
			||||||
    private String membershipDisplayLabel;
 | 
					    private String membershipDisplayReference;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public Long getId() {
 | 
					    public Long getId() {
 | 
				
			||||||
        return id;
 | 
					        return id;
 | 
				
			||||||
@@ -105,12 +105,12 @@ public class AssetDTO implements Serializable, AccessMappings {
 | 
				
			|||||||
        this.membershipId = membershipId;
 | 
					        this.membershipId = membershipId;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public String getMembershipDisplayLabel() {
 | 
					    public String getMembershipDisplayReference() {
 | 
				
			||||||
        return membershipDisplayLabel;
 | 
					        return membershipDisplayReference;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public void setMembershipDisplayLabel(String membershipDisplayLabel) {
 | 
					    public void setMembershipDisplayReference(String membershipDisplayReference) {
 | 
				
			||||||
        this.membershipDisplayLabel = membershipDisplayLabel;
 | 
					        this.membershipDisplayReference = membershipDisplayReference;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
@@ -144,7 +144,7 @@ public class AssetDTO implements Serializable, AccessMappings {
 | 
				
			|||||||
            ", amount=" + getAmount() +
 | 
					            ", amount=" + getAmount() +
 | 
				
			||||||
            ", remark='" + getRemark() + "'" +
 | 
					            ", remark='" + getRemark() + "'" +
 | 
				
			||||||
            ", membership=" + getMembershipId() +
 | 
					            ", membership=" + getMembershipId() +
 | 
				
			||||||
            ", membership='" + getMembershipDisplayLabel() + "'" +
 | 
					            ", membership='" + getMembershipDisplayReference() + "'" +
 | 
				
			||||||
            "}";
 | 
					            "}";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -85,9 +85,6 @@ public class CustomerDTO extends FluentBuilder<CustomerDTO> implements AccessMap
 | 
				
			|||||||
    @AccessFor(init = Role.ADMIN, update = Role.SUPPORTER, read = Role.SUPPORTER)
 | 
					    @AccessFor(init = Role.ADMIN, update = Role.SUPPORTER, read = Role.SUPPORTER)
 | 
				
			||||||
    private String remark;
 | 
					    private String remark;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @AccessFor(init=Role.ANYBODY, update=Role.ANYBODY, read = Role.ANY_CUSTOMER_USER)
 | 
					 | 
				
			||||||
    private String displayLabel;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public Long getId() {
 | 
					    public Long getId() {
 | 
				
			||||||
        return id;
 | 
					        return id;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -216,14 +213,6 @@ public class CustomerDTO extends FluentBuilder<CustomerDTO> implements AccessMap
 | 
				
			|||||||
        this.remark = remark;
 | 
					        this.remark = remark;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public String getDisplayLabel() {
 | 
					 | 
				
			||||||
        return displayLabel;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public void setDisplayLabel(final String displayLabel) {
 | 
					 | 
				
			||||||
        this.displayLabel = displayLabel;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public boolean equals(Object o) {
 | 
					    public boolean equals(Object o) {
 | 
				
			||||||
        if (this == o) {
 | 
					        if (this == o) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -25,18 +25,18 @@ public class MembershipDTO extends FluentBuilder<MembershipDTO> implements Seria
 | 
				
			|||||||
    @AccessFor(init = Role.ADMIN, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
 | 
					    @AccessFor(init = Role.ADMIN, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
 | 
				
			||||||
    private LocalDate admissionDocumentDate;
 | 
					    private LocalDate admissionDocumentDate;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @AccessFor(init = Role.ADMIN, update = Role.ADMIN, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
 | 
					    @AccessFor(init = Role.ADMIN, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
 | 
				
			||||||
    private LocalDate cancellationDocumentDate;
 | 
					    private LocalDate cancellationDocumentDate;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @NotNull
 | 
					    @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 memberFromDate;
 | 
					    private LocalDate memberFromDate;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @AccessFor(init = Role.ADMIN, update = Role.ADMIN, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
 | 
					    @AccessFor(init = Role.ADMIN, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
 | 
				
			||||||
    private LocalDate memberUntilDate;
 | 
					    private LocalDate memberUntilDate;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Size(max = 160)
 | 
					    @Size(max = 160)
 | 
				
			||||||
    @AccessFor(init = Role.ADMIN,update = Role.ADMIN,  read = Role.SUPPORTER)
 | 
					    @AccessFor(init = Role.ADMIN, read = Role.SUPPORTER)
 | 
				
			||||||
    private String remark;
 | 
					    private String remark;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @ParentId(resolver = CustomerService.class)
 | 
					    @ParentId(resolver = CustomerService.class)
 | 
				
			||||||
@@ -46,11 +46,8 @@ public class MembershipDTO extends FluentBuilder<MembershipDTO> implements Seria
 | 
				
			|||||||
    @AccessFor(init = Role.ADMIN, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
 | 
					    @AccessFor(init = Role.ADMIN, read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
 | 
				
			||||||
    private String customerPrefix;
 | 
					    private String customerPrefix;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @AccessFor(init = Role.ANYBODY, update = Role.ANYBODY, read = Role.FINANCIAL_CONTACT)
 | 
					    @AccessFor(read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
 | 
				
			||||||
    private String displayLabel;
 | 
					    private String membershipDisplayReference;
 | 
				
			||||||
 | 
					 | 
				
			||||||
    @AccessFor(init = Role.ANYBODY, update = Role.ANYBODY, read = Role.FINANCIAL_CONTACT)
 | 
					 | 
				
			||||||
    private String customerDisplayLabel;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public Long getId() {
 | 
					    public Long getId() {
 | 
				
			||||||
        return id;
 | 
					        return id;
 | 
				
			||||||
@@ -116,20 +113,12 @@ public class MembershipDTO extends FluentBuilder<MembershipDTO> implements Seria
 | 
				
			|||||||
        this.customerPrefix = customerPrefix;
 | 
					        this.customerPrefix = customerPrefix;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public String getDisplayLabel() {
 | 
					    private String getMembershipDisplayReference() {
 | 
				
			||||||
        return displayLabel;
 | 
					        return membershipDisplayReference;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public void setDisplayLabel(final String displayLabel) {
 | 
					    public void setMembershipDisplayReference(final String membershipDisplayReference) {
 | 
				
			||||||
        this.displayLabel = displayLabel;
 | 
					        this.membershipDisplayReference = membershipDisplayReference;
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public String getCustomerDisplayLabel() {
 | 
					 | 
				
			||||||
        return customerDisplayLabel;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public void setCustomerDisplayLabel(final String customerDisplayLabel) {
 | 
					 | 
				
			||||||
        this.customerDisplayLabel = customerDisplayLabel;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -48,7 +48,7 @@ public class ShareDTO implements Serializable {
 | 
				
			|||||||
    private Long membershipId;
 | 
					    private Long membershipId;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @AccessFor(read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
 | 
					    @AccessFor(read = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT})
 | 
				
			||||||
    private String membershipDisplayLabel;
 | 
					    private String membershipDisplayReference;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public Long getId() {
 | 
					    public Long getId() {
 | 
				
			||||||
        return id;
 | 
					        return id;
 | 
				
			||||||
@@ -106,12 +106,12 @@ public class ShareDTO implements Serializable {
 | 
				
			|||||||
        this.membershipId = membershipId;
 | 
					        this.membershipId = membershipId;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public String getMembershipDisplayLabel() {
 | 
					    public String getMembershipDisplayReference() {
 | 
				
			||||||
        return membershipDisplayLabel;
 | 
					        return membershipDisplayReference;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public void setMembershipDisplayLabel(String membershipDisplayLabel) {
 | 
					    public void setMembershipDisplayReference(String membershipDisplayReference) {
 | 
				
			||||||
        this.membershipDisplayLabel = membershipDisplayLabel;
 | 
					        this.membershipDisplayReference = membershipDisplayReference;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
@@ -145,7 +145,7 @@ public class ShareDTO implements Serializable {
 | 
				
			|||||||
            ", quantity=" + getQuantity() +
 | 
					            ", quantity=" + getQuantity() +
 | 
				
			||||||
            ", remark='" + getRemark() + "'" +
 | 
					            ", remark='" + getRemark() + "'" +
 | 
				
			||||||
            ", membership=" + getMembershipId() +
 | 
					            ", membership=" + getMembershipId() +
 | 
				
			||||||
            ", membership='" + getMembershipDisplayLabel() + "'" +
 | 
					            ", membership='" + getMembershipDisplayReference() + "'" +
 | 
				
			||||||
            "}";
 | 
					            "}";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,12 +1,16 @@
 | 
				
			|||||||
package org.hostsharing.hsadminng.service.mapper;
 | 
					package org.hostsharing.hsadminng.service.mapper;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import org.hostsharing.hsadminng.domain.Asset;
 | 
					import org.hostsharing.hsadminng.domain.Asset;
 | 
				
			||||||
 | 
					import org.hostsharing.hsadminng.domain.Customer;
 | 
				
			||||||
 | 
					import org.hostsharing.hsadminng.domain.Membership;
 | 
				
			||||||
import org.hostsharing.hsadminng.service.dto.AssetDTO;
 | 
					import org.hostsharing.hsadminng.service.dto.AssetDTO;
 | 
				
			||||||
import org.mapstruct.AfterMapping;
 | 
					import org.mapstruct.AfterMapping;
 | 
				
			||||||
import org.mapstruct.Mapper;
 | 
					import org.mapstruct.Mapper;
 | 
				
			||||||
import org.mapstruct.Mapping;
 | 
					import org.mapstruct.Mapping;
 | 
				
			||||||
import org.mapstruct.MappingTarget;
 | 
					import org.mapstruct.MappingTarget;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.util.Objects;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Mapper for the entity Asset and its DTO AssetDTO.
 | 
					 * Mapper for the entity Asset and its DTO AssetDTO.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
@@ -14,12 +18,19 @@ import org.mapstruct.MappingTarget;
 | 
				
			|||||||
public interface AssetMapper extends EntityMapper<AssetDTO, Asset> {
 | 
					public interface AssetMapper extends EntityMapper<AssetDTO, Asset> {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Mapping(source = "membership.id", target = "membershipId")
 | 
					    @Mapping(source = "membership.id", target = "membershipId")
 | 
				
			||||||
    @Mapping(target = "membershipDisplayLabel", ignore = true)
 | 
					    @Mapping(target = "membershipDisplayReference", ignore = true)
 | 
				
			||||||
    AssetDTO toDto(Asset asset);
 | 
					    AssetDTO toDto(Asset asset);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @AfterMapping
 | 
					    @AfterMapping
 | 
				
			||||||
    default void setMembershipDisplayLabel(final @MappingTarget AssetDTO dto, final Asset entity) {
 | 
					    default void setMembershipDisplayReference(final @MappingTarget AssetDTO dto, final Asset entity) {
 | 
				
			||||||
        dto.setMembershipDisplayLabel(MembershipMapper.displayLabel(entity.getMembership()));
 | 
					        // TODO: rather use method extracted from MembershipMaper.setMembershipDisplayReference() to avoid duplicate code
 | 
				
			||||||
 | 
					        final Membership membership = entity.getMembership();
 | 
				
			||||||
 | 
					        final Customer customer = membership.getCustomer();
 | 
				
			||||||
 | 
					        dto.setMembershipDisplayReference(customer.getReference()
 | 
				
			||||||
 | 
					            + ":" + customer.getPrefix()
 | 
				
			||||||
 | 
					            + " [" + customer.getName() + "] "
 | 
				
			||||||
 | 
					            + membership.getAdmissionDocumentDate().toString() + " - "
 | 
				
			||||||
 | 
					            + Objects.toString(membership.getCancellationDocumentDate(), ""));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Mapping(source = "membershipId", target = "membership")
 | 
					    @Mapping(source = "membershipId", target = "membership")
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,11 +1,9 @@
 | 
				
			|||||||
package org.hostsharing.hsadminng.service.mapper;
 | 
					package org.hostsharing.hsadminng.service.mapper;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import org.hostsharing.hsadminng.domain.Customer;
 | 
					import org.hostsharing.hsadminng.domain.*;
 | 
				
			||||||
import org.hostsharing.hsadminng.service.dto.CustomerDTO;
 | 
					import org.hostsharing.hsadminng.service.dto.CustomerDTO;
 | 
				
			||||||
import org.mapstruct.AfterMapping;
 | 
					
 | 
				
			||||||
import org.mapstruct.Mapper;
 | 
					import org.mapstruct.*;
 | 
				
			||||||
import org.mapstruct.Mapping;
 | 
					 | 
				
			||||||
import org.mapstruct.MappingTarget;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Mapper for the entity Customer and its DTO CustomerDTO.
 | 
					 * Mapper for the entity Customer and its DTO CustomerDTO.
 | 
				
			||||||
@@ -13,18 +11,6 @@ import org.mapstruct.MappingTarget;
 | 
				
			|||||||
@Mapper(componentModel = "spring", uses = {})
 | 
					@Mapper(componentModel = "spring", uses = {})
 | 
				
			||||||
public interface CustomerMapper extends EntityMapper<CustomerDTO, Customer> {
 | 
					public interface CustomerMapper extends EntityMapper<CustomerDTO, Customer> {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    static String displayLabel(Customer customer) {
 | 
					 | 
				
			||||||
        return  customer.getName()
 | 
					 | 
				
			||||||
            + " [" + customer.getReference() + ":" + customer.getPrefix() +"]";
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @Mapping(target = "displayLabel", ignore = true)
 | 
					 | 
				
			||||||
    CustomerDTO toDto(Customer customer);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @AfterMapping
 | 
					 | 
				
			||||||
    default void setDisplayLabel(final @MappingTarget CustomerDTO dto, final Customer entity) {
 | 
					 | 
				
			||||||
        dto.setDisplayLabel(displayLabel(entity));
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Mapping(target = "memberships", ignore = true)
 | 
					    @Mapping(target = "memberships", ignore = true)
 | 
				
			||||||
    @Mapping(target = "sepamandates", ignore = true)
 | 
					    @Mapping(target = "sepamandates", ignore = true)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,25 +16,21 @@ import java.util.Objects;
 | 
				
			|||||||
@Mapper(componentModel = "spring", uses = {CustomerMapper.class})
 | 
					@Mapper(componentModel = "spring", uses = {CustomerMapper.class})
 | 
				
			||||||
public interface MembershipMapper extends EntityMapper<MembershipDTO, Membership> {
 | 
					public interface MembershipMapper extends EntityMapper<MembershipDTO, Membership> {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    static String displayLabel(final Membership entity) {
 | 
					 | 
				
			||||||
        final Customer customer = entity.getCustomer();
 | 
					 | 
				
			||||||
        return CustomerMapper.displayLabel(customer) + " "
 | 
					 | 
				
			||||||
            + Objects.toString(entity.getAdmissionDocumentDate(), "") + " - "
 | 
					 | 
				
			||||||
            + Objects.toString(entity.getCancellationDocumentDate(), "...");
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @Mapping(source = "customer.id", target = "customerId")
 | 
					    @Mapping(source = "customer.id", target = "customerId")
 | 
				
			||||||
    @Mapping(source = "customer.prefix", target = "customerPrefix")
 | 
					    @Mapping(source = "customer.prefix", target = "customerPrefix")
 | 
				
			||||||
    @Mapping(target = "displayLabel", ignore = true)
 | 
					    @Mapping(target = "membershipDisplayReference", ignore = true)
 | 
				
			||||||
    @Mapping(target = "customerDisplayLabel", ignore = true)
 | 
					 | 
				
			||||||
    MembershipDTO toDto(Membership membership);
 | 
					    MembershipDTO toDto(Membership membership);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // TODO BLOG HOWTO: multi-field display reference for selection lists
 | 
					    // TODO BLOG HOWTO: multi-field display reference for selection lists
 | 
				
			||||||
    //  also change the filed in the option list in *-update.html
 | 
					    //  also change the filed in the option list in *-update.html
 | 
				
			||||||
    @AfterMapping
 | 
					    @AfterMapping
 | 
				
			||||||
    default void setMembershipDisplayLabel(final @MappingTarget MembershipDTO dto, final Membership entity) {
 | 
					    default void setMembershipDisplayReference(final @MappingTarget MembershipDTO dto, final Membership entity) {
 | 
				
			||||||
        dto.setDisplayLabel(displayLabel(entity));
 | 
					        final Customer customer = entity.getCustomer();
 | 
				
			||||||
        dto.setCustomerDisplayLabel(CustomerMapper.displayLabel(entity.getCustomer()));
 | 
					        dto.setMembershipDisplayReference(customer.getReference()
 | 
				
			||||||
 | 
					            + ":" + customer.getPrefix()
 | 
				
			||||||
 | 
					            + " [" + customer.getName() + "] "
 | 
				
			||||||
 | 
					            + entity.getAdmissionDocumentDate().toString() + " - "
 | 
				
			||||||
 | 
					            + Objects.toString(entity.getCancellationDocumentDate(), ""));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Mapping(target = "shares", ignore = true)
 | 
					    @Mapping(target = "shares", ignore = true)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,10 +2,8 @@ package org.hostsharing.hsadminng.service.mapper;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import org.hostsharing.hsadminng.domain.Share;
 | 
					import org.hostsharing.hsadminng.domain.Share;
 | 
				
			||||||
import org.hostsharing.hsadminng.service.dto.ShareDTO;
 | 
					import org.hostsharing.hsadminng.service.dto.ShareDTO;
 | 
				
			||||||
import org.mapstruct.AfterMapping;
 | 
					 | 
				
			||||||
import org.mapstruct.Mapper;
 | 
					import org.mapstruct.Mapper;
 | 
				
			||||||
import org.mapstruct.Mapping;
 | 
					import org.mapstruct.Mapping;
 | 
				
			||||||
import org.mapstruct.MappingTarget;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Mapper for the entity Share and its DTO ShareDTO.
 | 
					 * Mapper for the entity Share and its DTO ShareDTO.
 | 
				
			||||||
@@ -14,14 +12,9 @@ import org.mapstruct.MappingTarget;
 | 
				
			|||||||
public interface ShareMapper extends EntityMapper<ShareDTO, Share> {
 | 
					public interface ShareMapper extends EntityMapper<ShareDTO, Share> {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Mapping(source = "membership.id", target = "membershipId")
 | 
					    @Mapping(source = "membership.id", target = "membershipId")
 | 
				
			||||||
    @Mapping(target = "membershipDisplayLabel", ignore = true)
 | 
					    @Mapping(source = "membership.admissionDocumentDate", target = "membershipDisplayReference")
 | 
				
			||||||
    ShareDTO toDto(Share share);
 | 
					    ShareDTO toDto(Share share);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @AfterMapping
 | 
					 | 
				
			||||||
    default void setMembershipDisplayLabel(final @MappingTarget ShareDTO dto, final Share entity) {
 | 
					 | 
				
			||||||
        dto.setMembershipDisplayLabel(MembershipMapper.displayLabel(entity.getMembership()));
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @Mapping(source = "membershipId", target = "membership")
 | 
					    @Mapping(source = "membershipId", target = "membership")
 | 
				
			||||||
    Share toEntity(ShareDTO shareDTO);
 | 
					    Share toEntity(ShareDTO shareDTO);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
<div class="row justify-content-center">
 | 
					<div class="row justify-content-center">
 | 
				
			||||||
    <div class="col-8">
 | 
					    <div class="col-8">
 | 
				
			||||||
        <div *ngIf="asset">
 | 
					        <div *ngIf="asset">
 | 
				
			||||||
            <h2><span jhiTranslate="hsadminNgApp.asset.detail.title">Asset</span>: #{{asset.id}} - {{asset.membershipDisplayLabel}}</h2>
 | 
					            <h2><span jhiTranslate="hsadminNgApp.asset.detail.title">Asset</span> {{asset.id}}</h2>
 | 
				
			||||||
            <hr>
 | 
					            <hr>
 | 
				
			||||||
            <jhi-alert-error></jhi-alert-error>
 | 
					            <jhi-alert-error></jhi-alert-error>
 | 
				
			||||||
            <dl class="row-md jh-entity-details">
 | 
					            <dl class="row-md jh-entity-details">
 | 
				
			||||||
@@ -28,7 +28,7 @@
 | 
				
			|||||||
                <dt><span jhiTranslate="hsadminNgApp.asset.membership">Membership</span></dt>
 | 
					                <dt><span jhiTranslate="hsadminNgApp.asset.membership">Membership</span></dt>
 | 
				
			||||||
                <dd>
 | 
					                <dd>
 | 
				
			||||||
                    <div *ngIf="asset.membershipId">
 | 
					                    <div *ngIf="asset.membershipId">
 | 
				
			||||||
                        <a [routerLink]="['/membership', asset.membershipId, 'view']">{{asset.membershipDisplayLabel}}</a>
 | 
					                        <a [routerLink]="['/membership', asset.membershipId, 'view']">{{asset.membershipDisplayReference}}</a>
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
                </dd>
 | 
					                </dd>
 | 
				
			||||||
            </dl>
 | 
					            </dl>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -89,7 +89,7 @@
 | 
				
			|||||||
                    <label class="form-control-label" jhiTranslate="hsadminNgApp.asset.membership" for="field_membership">Membership</label>
 | 
					                    <label class="form-control-label" jhiTranslate="hsadminNgApp.asset.membership" for="field_membership">Membership</label>
 | 
				
			||||||
                    <select class="form-control" id="field_membership" name="membership" [(ngModel)]="asset.membershipId"  required>
 | 
					                    <select class="form-control" id="field_membership" name="membership" [(ngModel)]="asset.membershipId"  required>
 | 
				
			||||||
                        <option *ngIf="!editForm.value.membership" [ngValue]="null" selected></option>
 | 
					                        <option *ngIf="!editForm.value.membership" [ngValue]="null" selected></option>
 | 
				
			||||||
                        <option [ngValue]="membershipOption.id" *ngFor="let membershipOption of memberships; trackBy: trackMembershipById">{{membershipOption.displayLabel}}</option>
 | 
					                        <option [ngValue]="membershipOption.id" *ngFor="let membershipOption of memberships; trackBy: trackMembershipById">{{membershipOption.membershipDisplayReference}}</option>
 | 
				
			||||||
                    </select>
 | 
					                    </select>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <div [hidden]="!(editForm.controls.membership?.dirty && editForm.controls.membership?.invalid)">
 | 
					                <div [hidden]="!(editForm.controls.membership?.dirty && editForm.controls.membership?.invalid)">
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,7 +19,8 @@
 | 
				
			|||||||
            <th jhiSortBy="valueDate"><span jhiTranslate="hsadminNgApp.asset.valueDate">Value Date</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
					            <th jhiSortBy="valueDate"><span jhiTranslate="hsadminNgApp.asset.valueDate">Value Date</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
            <th jhiSortBy="action"><span jhiTranslate="hsadminNgApp.asset.action">Action</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
					            <th jhiSortBy="action"><span jhiTranslate="hsadminNgApp.asset.action">Action</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
            <th jhiSortBy="amount"><span jhiTranslate="hsadminNgApp.asset.amount">Amount</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
					            <th jhiSortBy="amount"><span jhiTranslate="hsadminNgApp.asset.amount">Amount</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
            <th jhiSortBy="membershipDisplayLabel"><span jhiTranslate="hsadminNgApp.asset.membership">Membership</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
					            <th jhiSortBy="remark"><span jhiTranslate="hsadminNgApp.asset.remark">Remark</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
 | 
					            <th jhiSortBy="membershipDisplayReference"><span jhiTranslate="hsadminNgApp.asset.membership">Membership</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
            <th></th>
 | 
					            <th></th>
 | 
				
			||||||
            </tr>
 | 
					            </tr>
 | 
				
			||||||
            </thead>
 | 
					            </thead>
 | 
				
			||||||
@@ -30,9 +31,10 @@
 | 
				
			|||||||
                <td>{{asset.valueDate | date:'mediumDate'}}</td>
 | 
					                <td>{{asset.valueDate | date:'mediumDate'}}</td>
 | 
				
			||||||
                <td jhiTranslate="{{'hsadminNgApp.AssetAction.' + asset.action}}">{{asset.action}}</td>
 | 
					                <td jhiTranslate="{{'hsadminNgApp.AssetAction.' + asset.action}}">{{asset.action}}</td>
 | 
				
			||||||
                <td>{{asset.amount}}</td>
 | 
					                <td>{{asset.amount}}</td>
 | 
				
			||||||
 | 
					                <td>{{asset.remark}}</td>
 | 
				
			||||||
                <td>
 | 
					                <td>
 | 
				
			||||||
                    <div *ngIf="asset.membershipId">
 | 
					                    <div *ngIf="asset.membershipId">
 | 
				
			||||||
                        <a [routerLink]="['../membership', asset.membershipId , 'view' ]" >{{asset.membershipDisplayLabel}}</a>
 | 
					                        <a [routerLink]="['../membership', asset.membershipId , 'view' ]" >{{asset.membershipDisplayReference}}</a>
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
                </td>
 | 
					                </td>
 | 
				
			||||||
                <td class="text-right">
 | 
					                <td class="text-right">
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
<div class="row justify-content-center">
 | 
					<div class="row justify-content-center">
 | 
				
			||||||
    <div class="col-8">
 | 
					    <div class="col-8">
 | 
				
			||||||
        <div *ngIf="customer">
 | 
					        <div *ngIf="customer">
 | 
				
			||||||
            <h2><span jhiTranslate="hsadminNgApp.customer.detail.title">Customer</span>: {{customer.displayLabel}}</h2>
 | 
					            <h2><span jhiTranslate="hsadminNgApp.customer.detail.title">Customer</span> {{customer.id}}</h2>
 | 
				
			||||||
            <hr>
 | 
					            <hr>
 | 
				
			||||||
            <jhi-alert-error></jhi-alert-error>
 | 
					            <jhi-alert-error></jhi-alert-error>
 | 
				
			||||||
            <dl class="row-md jh-entity-details">
 | 
					            <dl class="row-md jh-entity-details">
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,7 +18,18 @@
 | 
				
			|||||||
            <th jhiSortBy="reference"><span jhiTranslate="hsadminNgApp.customer.reference">Reference</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
					            <th jhiSortBy="reference"><span jhiTranslate="hsadminNgApp.customer.reference">Reference</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
            <th jhiSortBy="prefix"><span jhiTranslate="hsadminNgApp.customer.prefix">Prefix</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
					            <th jhiSortBy="prefix"><span jhiTranslate="hsadminNgApp.customer.prefix">Prefix</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
            <th jhiSortBy="name"><span jhiTranslate="hsadminNgApp.customer.name">Name</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
					            <th jhiSortBy="name"><span jhiTranslate="hsadminNgApp.customer.name">Name</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
            <th jhiSortBy="kind"><span jhiTranslate="hsadminNgApp.customer.kind">Kind</span> <fa-icon [icon]="'sort'"></fa-icon></thn></th>
 | 
					            <th jhiSortBy="kind"><span jhiTranslate="hsadminNgApp.customer.kind">Kind</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
 | 
					            <th jhiSortBy="birthDate"><span jhiTranslate="hsadminNgApp.customer.birthDate">Birth Date</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
 | 
					            <th jhiSortBy="birthPlace"><span jhiTranslate="hsadminNgApp.customer.birthPlace">Birth Place</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
 | 
					            <th jhiSortBy="registrationCourt"><span jhiTranslate="hsadminNgApp.customer.registrationCourt">Registration Court</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
 | 
					            <th jhiSortBy="registrationNumber"><span jhiTranslate="hsadminNgApp.customer.registrationNumber">Registration Number</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
 | 
					            <th jhiSortBy="vatRegion"><span jhiTranslate="hsadminNgApp.customer.vatRegion">Vat Region</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
 | 
					            <th jhiSortBy="vatNumber"><span jhiTranslate="hsadminNgApp.customer.vatNumber">Vat Number</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
 | 
					            <th jhiSortBy="contractualSalutation"><span jhiTranslate="hsadminNgApp.customer.contractualSalutation">Contractual Salutation</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
 | 
					            <th jhiSortBy="contractualAddress"><span jhiTranslate="hsadminNgApp.customer.contractualAddress">Contractual Address</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
 | 
					            <th jhiSortBy="billingSalutation"><span jhiTranslate="hsadminNgApp.customer.billingSalutation">Billing Salutation</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
 | 
					            <th jhiSortBy="billingAddress"><span jhiTranslate="hsadminNgApp.customer.billingAddress">Billing Address</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
 | 
					            <th jhiSortBy="remark"><span jhiTranslate="hsadminNgApp.customer.remark">Remark</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
            <th></th>
 | 
					            <th></th>
 | 
				
			||||||
            </tr>
 | 
					            </tr>
 | 
				
			||||||
            </thead>
 | 
					            </thead>
 | 
				
			||||||
@@ -29,6 +40,17 @@
 | 
				
			|||||||
                <td>{{customer.prefix}}</td>
 | 
					                <td>{{customer.prefix}}</td>
 | 
				
			||||||
                <td>{{customer.name}}</td>
 | 
					                <td>{{customer.name}}</td>
 | 
				
			||||||
                <td jhiTranslate="{{'hsadminNgApp.CustomerKind.' + customer.kind}}">{{customer.kind}}</td>
 | 
					                <td jhiTranslate="{{'hsadminNgApp.CustomerKind.' + customer.kind}}">{{customer.kind}}</td>
 | 
				
			||||||
 | 
					                <td>{{customer.birthDate | date:'mediumDate'}}</td>
 | 
				
			||||||
 | 
					                <td>{{customer.birthPlace}}</td>
 | 
				
			||||||
 | 
					                <td>{{customer.registrationCourt}}</td>
 | 
				
			||||||
 | 
					                <td>{{customer.registrationNumber}}</td>
 | 
				
			||||||
 | 
					                <td jhiTranslate="{{'hsadminNgApp.VatRegion.' + customer.vatRegion}}">{{customer.vatRegion}}</td>
 | 
				
			||||||
 | 
					                <td>{{customer.vatNumber}}</td>
 | 
				
			||||||
 | 
					                <td>{{customer.contractualSalutation}}</td>
 | 
				
			||||||
 | 
					                <td>{{customer.contractualAddress}}</td>
 | 
				
			||||||
 | 
					                <td>{{customer.billingSalutation}}</td>
 | 
				
			||||||
 | 
					                <td>{{customer.billingAddress}}</td>
 | 
				
			||||||
 | 
					                <td>{{customer.remark}}</td>
 | 
				
			||||||
                <td class="text-right">
 | 
					                <td class="text-right">
 | 
				
			||||||
                    <div class="btn-group flex-btn-group-container">
 | 
					                    <div class="btn-group flex-btn-group-container">
 | 
				
			||||||
                        <button type="submit"
 | 
					                        <button type="submit"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
<div class="row justify-content-center">
 | 
					<div class="row justify-content-center">
 | 
				
			||||||
    <div class="col-8">
 | 
					    <div class="col-8">
 | 
				
			||||||
        <div *ngIf="membership">
 | 
					        <div *ngIf="membership">
 | 
				
			||||||
            <h2><span jhiTranslate="hsadminNgApp.membership.detail.title">Membership</span>: {{membership.displayLabel}}</h2>
 | 
					            <h2><span jhiTranslate="hsadminNgApp.membership.detail.title">Membership</span> {{membership.id}}</h2>
 | 
				
			||||||
            <hr>
 | 
					            <hr>
 | 
				
			||||||
            <jhi-alert-error></jhi-alert-error>
 | 
					            <jhi-alert-error></jhi-alert-error>
 | 
				
			||||||
            <dl class="row-md jh-entity-details">
 | 
					            <dl class="row-md jh-entity-details">
 | 
				
			||||||
@@ -28,7 +28,7 @@
 | 
				
			|||||||
                <dt><span jhiTranslate="hsadminNgApp.membership.customer">Customer</span></dt>
 | 
					                <dt><span jhiTranslate="hsadminNgApp.membership.customer">Customer</span></dt>
 | 
				
			||||||
                <dd>
 | 
					                <dd>
 | 
				
			||||||
                    <div *ngIf="membership.customerId">
 | 
					                    <div *ngIf="membership.customerId">
 | 
				
			||||||
                        <a [routerLink]="['/customer', membership.customerId, 'view']">{{membership.customerDisplayLabel}}</a>
 | 
					                        <a [routerLink]="['/customer', membership.customerId, 'view']">{{membership.customerPrefix}}</a>
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
                </dd>
 | 
					                </dd>
 | 
				
			||||||
            </dl>
 | 
					            </dl>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -77,7 +77,7 @@
 | 
				
			|||||||
                    <label class="form-control-label" jhiTranslate="hsadminNgApp.membership.customer" for="field_customer">Customer</label>
 | 
					                    <label class="form-control-label" jhiTranslate="hsadminNgApp.membership.customer" for="field_customer">Customer</label>
 | 
				
			||||||
                    <select class="form-control" id="field_customer" name="customer" [(ngModel)]="membership.customerId"  required>
 | 
					                    <select class="form-control" id="field_customer" name="customer" [(ngModel)]="membership.customerId"  required>
 | 
				
			||||||
                        <option *ngIf="!editForm.value.customer" [ngValue]="null" selected></option>
 | 
					                        <option *ngIf="!editForm.value.customer" [ngValue]="null" selected></option>
 | 
				
			||||||
                        <option [ngValue]="customerOption.id" *ngFor="let customerOption of customers; trackBy: trackCustomerById">{{customerOption.displayLabel}}</option>
 | 
					                        <option [ngValue]="customerOption.id" *ngFor="let customerOption of customers; trackBy: trackCustomerById">{{customerOption.prefix}}</option>
 | 
				
			||||||
                    </select>
 | 
					                    </select>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <div [hidden]="!(editForm.controls.customer?.dirty && editForm.controls.customer?.invalid)">
 | 
					                <div [hidden]="!(editForm.controls.customer?.dirty && editForm.controls.customer?.invalid)">
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,6 +19,7 @@
 | 
				
			|||||||
            <th jhiSortBy="cancellationDocumentDate"><span jhiTranslate="hsadminNgApp.membership.cancellationDocumentDate">Cancellation Document Date</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
					            <th jhiSortBy="cancellationDocumentDate"><span jhiTranslate="hsadminNgApp.membership.cancellationDocumentDate">Cancellation Document Date</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
            <th jhiSortBy="memberFromDate"><span jhiTranslate="hsadminNgApp.membership.memberFromDate">Member From Date</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
					            <th jhiSortBy="memberFromDate"><span jhiTranslate="hsadminNgApp.membership.memberFromDate">Member From Date</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
            <th jhiSortBy="memberUntilDate"><span jhiTranslate="hsadminNgApp.membership.memberUntilDate">Member Until Date</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
					            <th jhiSortBy="memberUntilDate"><span jhiTranslate="hsadminNgApp.membership.memberUntilDate">Member Until Date</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
 | 
					            <th jhiSortBy="remark"><span jhiTranslate="hsadminNgApp.membership.remark">Remark</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
            <th jhiSortBy="customerPrefix"><span jhiTranslate="hsadminNgApp.membership.customer">Customer</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
					            <th jhiSortBy="customerPrefix"><span jhiTranslate="hsadminNgApp.membership.customer">Customer</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
            <th></th>
 | 
					            <th></th>
 | 
				
			||||||
            </tr>
 | 
					            </tr>
 | 
				
			||||||
@@ -27,12 +28,13 @@
 | 
				
			|||||||
            <tr *ngFor="let membership of memberships ;trackBy: trackId">
 | 
					            <tr *ngFor="let membership of memberships ;trackBy: trackId">
 | 
				
			||||||
                <td><a [routerLink]="['/membership', membership.id, 'view' ]">{{membership.id}}</a></td>
 | 
					                <td><a [routerLink]="['/membership', membership.id, 'view' ]">{{membership.id}}</a></td>
 | 
				
			||||||
                <td>{{membership.admissionDocumentDate | date:'mediumDate'}}</td>
 | 
					                <td>{{membership.admissionDocumentDate | date:'mediumDate'}}</td>
 | 
				
			||||||
                <td>{{membership.cancellationDocumentDate | date:'mediumDsate'}}</td>
 | 
					                <td>{{membership.cancellationDocumentDate | date:'mediumDate'}}</td>
 | 
				
			||||||
                <td>{{membership.memberFromDate | date:'mediumDate'}}</td>
 | 
					                <td>{{membership.memberFromDate | date:'mediumDate'}}</td>
 | 
				
			||||||
                <td>{{membership.memberUntilDate | date:'mediumDate'}}</td>
 | 
					                <td>{{membership.memberUntilDate | date:'mediumDate'}}</td>
 | 
				
			||||||
 | 
					                <td>{{membership.remark}}</td>
 | 
				
			||||||
                <td>
 | 
					                <td>
 | 
				
			||||||
                    <div *ngIf="membership.customerId">
 | 
					                    <div *ngIf="membership.customerId">
 | 
				
			||||||
                        <a [routerLink]="['../customer', membership.customerId , 'view' ]" >{{membership.customerDisplayLabel}}</a>
 | 
					                        <a [routerLink]="['../customer', membership.customerId , 'view' ]" >{{membership.customerPrefix}}</a>
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
                </td>
 | 
					                </td>
 | 
				
			||||||
                <td class="text-right">
 | 
					                <td class="text-right">
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
<div class="row justify-content-center">
 | 
					<div class="row justify-content-center">
 | 
				
			||||||
    <div class="col-8">
 | 
					    <div class="col-8">
 | 
				
			||||||
        <div *ngIf="share">
 | 
					        <div *ngIf="share">
 | 
				
			||||||
            <h2><span jhiTranslate="hsadminNgApp.share.detail.title">Share</span>: #{{share.id}} - {{share.membershipDisplayLabel}}</h2>
 | 
					            <h2><span jhiTranslate="hsadminNgApp.share.detail.title">Share</span> {{share.id}}</h2>
 | 
				
			||||||
            <hr>
 | 
					            <hr>
 | 
				
			||||||
            <jhi-alert-error></jhi-alert-error>
 | 
					            <jhi-alert-error></jhi-alert-error>
 | 
				
			||||||
            <dl class="row-md jh-entity-details">
 | 
					            <dl class="row-md jh-entity-details">
 | 
				
			||||||
@@ -28,7 +28,7 @@
 | 
				
			|||||||
                <dt><span jhiTranslate="hsadminNgApp.share.membership">Membership</span></dt>
 | 
					                <dt><span jhiTranslate="hsadminNgApp.share.membership">Membership</span></dt>
 | 
				
			||||||
                <dd>
 | 
					                <dd>
 | 
				
			||||||
                    <div *ngIf="share.membershipId">
 | 
					                    <div *ngIf="share.membershipId">
 | 
				
			||||||
                        <a [routerLink]="['/membership', share.membershipId, 'view']">{{share.membershipDisplayLabel}}</a>
 | 
					                        <a [routerLink]="['/membership', share.membershipId, 'view']">{{share.membershipDisplayReference}}</a>
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
                </dd>
 | 
					                </dd>
 | 
				
			||||||
            </dl>
 | 
					            </dl>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -85,7 +85,7 @@
 | 
				
			|||||||
                    <label class="form-control-label" jhiTranslate="hsadminNgApp.share.membership" for="field_membership">Membership</label>
 | 
					                    <label class="form-control-label" jhiTranslate="hsadminNgApp.share.membership" for="field_membership">Membership</label>
 | 
				
			||||||
                    <select class="form-control" id="field_membership" name="membership" [(ngModel)]="share.membershipId"  required>
 | 
					                    <select class="form-control" id="field_membership" name="membership" [(ngModel)]="share.membershipId"  required>
 | 
				
			||||||
                        <option *ngIf="!editForm.value.membership" [ngValue]="null" selected></option>
 | 
					                        <option *ngIf="!editForm.value.membership" [ngValue]="null" selected></option>
 | 
				
			||||||
                        <option [ngValue]="membershipOption.id" *ngFor="let membershipOption of memberships; trackBy: trackMembershipById">{{membershipOption.displayLabel}}</option>
 | 
					                        <option [ngValue]="membershipOption.id" *ngFor="let membershipOption of memberships; trackBy: trackMembershipById">{{membershipOption.admissionDocumentDate}}</option>
 | 
				
			||||||
                    </select>
 | 
					                    </select>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <div [hidden]="!(editForm.controls.membership?.dirty && editForm.controls.membership?.invalid)">
 | 
					                <div [hidden]="!(editForm.controls.membership?.dirty && editForm.controls.membership?.invalid)">
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,7 +19,8 @@
 | 
				
			|||||||
            <th jhiSortBy="valueDate"><span jhiTranslate="hsadminNgApp.share.valueDate">Value Date</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
					            <th jhiSortBy="valueDate"><span jhiTranslate="hsadminNgApp.share.valueDate">Value Date</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
            <th jhiSortBy="action"><span jhiTranslate="hsadminNgApp.share.action">Action</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
					            <th jhiSortBy="action"><span jhiTranslate="hsadminNgApp.share.action">Action</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
            <th jhiSortBy="quantity"><span jhiTranslate="hsadminNgApp.share.quantity">Quantity</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
					            <th jhiSortBy="quantity"><span jhiTranslate="hsadminNgApp.share.quantity">Quantity</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
            <th jhiSortBy="membershipDisplayLabel"><span jhiTranslate="hsadminNgApp.share.membership">Membership</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
					            <th jhiSortBy="remark"><span jhiTranslate="hsadminNgApp.share.remark">Remark</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
 | 
					            <th jhiSortBy="membershipDisplayReference"><span jhiTranslate="hsadminNgApp.share.membership">Membership</span> <fa-icon [icon]="'sort'"></fa-icon></th>
 | 
				
			||||||
            <th></th>
 | 
					            <th></th>
 | 
				
			||||||
            </tr>
 | 
					            </tr>
 | 
				
			||||||
            </thead>
 | 
					            </thead>
 | 
				
			||||||
@@ -30,9 +31,10 @@
 | 
				
			|||||||
                <td>{{share.valueDate | date:'mediumDate'}}</td>
 | 
					                <td>{{share.valueDate | date:'mediumDate'}}</td>
 | 
				
			||||||
                <td jhiTranslate="{{'hsadminNgApp.ShareAction.' + share.action}}">{{share.action}}</td>
 | 
					                <td jhiTranslate="{{'hsadminNgApp.ShareAction.' + share.action}}">{{share.action}}</td>
 | 
				
			||||||
                <td>{{share.quantity}}</td>
 | 
					                <td>{{share.quantity}}</td>
 | 
				
			||||||
 | 
					                <td>{{share.remark}}</td>
 | 
				
			||||||
                <td>
 | 
					                <td>
 | 
				
			||||||
                    <div *ngIf="share.membershipId">
 | 
					                    <div *ngIf="share.membershipId">
 | 
				
			||||||
                        <a [routerLink]="['../membership', share.membershipId , 'view' ]" >{{share.membershipDisplayLabel}}</a>
 | 
					                        <a [routerLink]="['../membership', share.membershipId , 'view' ]" >{{share.membershipDisplayReference}}</a>
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
                </td>
 | 
					                </td>
 | 
				
			||||||
                <td class="text-right">
 | 
					                <td class="text-right">
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,8 +16,8 @@ export interface IAsset {
 | 
				
			|||||||
    action?: AssetAction;
 | 
					    action?: AssetAction;
 | 
				
			||||||
    amount?: number;
 | 
					    amount?: number;
 | 
				
			||||||
    remark?: string;
 | 
					    remark?: string;
 | 
				
			||||||
 | 
					    membershipDisplayReference?: string;
 | 
				
			||||||
    membershipId?: number;
 | 
					    membershipId?: number;
 | 
				
			||||||
    membershipDisplayLabel?: string;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export class Asset implements IAsset {
 | 
					export class Asset implements IAsset {
 | 
				
			||||||
@@ -28,7 +28,7 @@ export class Asset implements IAsset {
 | 
				
			|||||||
        public action?: AssetAction,
 | 
					        public action?: AssetAction,
 | 
				
			||||||
        public amount?: number,
 | 
					        public amount?: number,
 | 
				
			||||||
        public remark?: string,
 | 
					        public remark?: string,
 | 
				
			||||||
        public membershipId?: number,
 | 
					        public membershipDisplayReference?: string,
 | 
				
			||||||
        public membershipDisplayLabel?: string
 | 
					        public membershipId?: number
 | 
				
			||||||
    ) {}
 | 
					    ) {}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -32,7 +32,6 @@ export interface ICustomer {
 | 
				
			|||||||
    remark?: string;
 | 
					    remark?: string;
 | 
				
			||||||
    memberships?: IMembership[];
 | 
					    memberships?: IMembership[];
 | 
				
			||||||
    sepamandates?: ISepaMandate[];
 | 
					    sepamandates?: ISepaMandate[];
 | 
				
			||||||
    displayLabel?: string;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export class Customer implements ICustomer {
 | 
					export class Customer implements ICustomer {
 | 
				
			||||||
@@ -54,7 +53,6 @@ export class Customer implements ICustomer {
 | 
				
			|||||||
        public billingAddress?: string,
 | 
					        public billingAddress?: string,
 | 
				
			||||||
        public remark?: string,
 | 
					        public remark?: string,
 | 
				
			||||||
        public memberships?: IMembership[],
 | 
					        public memberships?: IMembership[],
 | 
				
			||||||
        public sepamandates?: ISepaMandate[],
 | 
					        public sepamandates?: ISepaMandate[]
 | 
				
			||||||
        public displayLabel?: string
 | 
					 | 
				
			||||||
    ) {}
 | 
					    ) {}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,8 +13,7 @@ export interface IMembership {
 | 
				
			|||||||
    assets?: IAsset[];
 | 
					    assets?: IAsset[];
 | 
				
			||||||
    customerPrefix?: string;
 | 
					    customerPrefix?: string;
 | 
				
			||||||
    customerId?: number;
 | 
					    customerId?: number;
 | 
				
			||||||
    membershipDisplayLabel?: string;
 | 
					    membershipDisplayReference?: string;
 | 
				
			||||||
    displayLabel?: string;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export class Membership implements IMembership {
 | 
					export class Membership implements IMembership {
 | 
				
			||||||
@@ -29,7 +28,6 @@ export class Membership implements IMembership {
 | 
				
			|||||||
        public assets?: IAsset[],
 | 
					        public assets?: IAsset[],
 | 
				
			||||||
        public customerPrefix?: string,
 | 
					        public customerPrefix?: string,
 | 
				
			||||||
        public customerId?: number,
 | 
					        public customerId?: number,
 | 
				
			||||||
        public displayLabel?: string,
 | 
					        public membershipDisplayReference?: string
 | 
				
			||||||
        public membershipDisplayLabel?: string
 | 
					 | 
				
			||||||
    ) {}
 | 
					    ) {}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,7 +12,7 @@ export interface IShare {
 | 
				
			|||||||
    action?: ShareAction;
 | 
					    action?: ShareAction;
 | 
				
			||||||
    quantity?: number;
 | 
					    quantity?: number;
 | 
				
			||||||
    remark?: string;
 | 
					    remark?: string;
 | 
				
			||||||
    membershipDisplayLabel?: string;
 | 
					    membershipDisplayReference?: string;
 | 
				
			||||||
    membershipId?: number;
 | 
					    membershipId?: number;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -24,7 +24,7 @@ export class Share implements IShare {
 | 
				
			|||||||
        public action?: ShareAction,
 | 
					        public action?: ShareAction,
 | 
				
			||||||
        public quantity?: number,
 | 
					        public quantity?: number,
 | 
				
			||||||
        public remark?: string,
 | 
					        public remark?: string,
 | 
				
			||||||
        public membershipDisplayLabel?: string,
 | 
					        public membershipDisplayReference?: string,
 | 
				
			||||||
        public membershipId?: number
 | 
					        public membershipId?: number
 | 
				
			||||||
    ) {}
 | 
					    ) {}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,167 +0,0 @@
 | 
				
			|||||||
package org.hostsharing.hsadminng.service;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import org.apache.commons.lang3.RandomUtils;
 | 
					 | 
				
			||||||
import org.hostsharing.hsadminng.domain.Asset;
 | 
					 | 
				
			||||||
import org.hostsharing.hsadminng.domain.enumeration.AssetAction;
 | 
					 | 
				
			||||||
import org.hostsharing.hsadminng.repository.AssetRepository;
 | 
					 | 
				
			||||||
import org.hostsharing.hsadminng.service.dto.AssetDTO;
 | 
					 | 
				
			||||||
import org.hostsharing.hsadminng.service.mapper.AssetMapper;
 | 
					 | 
				
			||||||
import org.hostsharing.hsadminng.web.rest.errors.BadRequestAlertException;
 | 
					 | 
				
			||||||
import org.junit.Rule;
 | 
					 | 
				
			||||||
import org.junit.Test;
 | 
					 | 
				
			||||||
import org.mockito.InjectMocks;
 | 
					 | 
				
			||||||
import org.mockito.Mock;
 | 
					 | 
				
			||||||
import org.mockito.Mockito;
 | 
					 | 
				
			||||||
import org.mockito.junit.MockitoJUnit;
 | 
					 | 
				
			||||||
import org.mockito.junit.MockitoRule;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import javax.persistence.EntityManager;
 | 
					 | 
				
			||||||
import java.math.BigDecimal;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import static org.assertj.core.api.Assertions.assertThat;
 | 
					 | 
				
			||||||
import static org.assertj.core.api.Assertions.catchThrowableOfType;
 | 
					 | 
				
			||||||
import static org.mockito.ArgumentMatchers.same;
 | 
					 | 
				
			||||||
import static org.mockito.BDDMockito.given;
 | 
					 | 
				
			||||||
import static org.mockito.Mockito.*;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// HINT: In IntelliJ IDEA such unit test classes can be created with Shift-Ctrl-T.
 | 
					 | 
				
			||||||
// Do not forget to amend the class name (.e.g. ...UnitTest / ...IntTest)!
 | 
					 | 
				
			||||||
public class AssetServiceUnitTest {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @Rule
 | 
					 | 
				
			||||||
    public MockitoRule mockitoRule = MockitoJUnit.rule();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @Mock
 | 
					 | 
				
			||||||
    private EntityManager em;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @Mock
 | 
					 | 
				
			||||||
    private AssetRepository assetRepository;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @Mock
 | 
					 | 
				
			||||||
    private AssetValidator assetValidator; // needed for @InjectMocks assetService
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @Mock
 | 
					 | 
				
			||||||
    private AssetMapper assetMapper;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @InjectMocks
 | 
					 | 
				
			||||||
    private AssetService assetService;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // HINT: Click outside of any test method (e.g. here) and use Ctrl-Shift-F10
 | 
					 | 
				
			||||||
    // to run all tests from this test class. Use Ctrl-F5 to run the last execution again;
 | 
					 | 
				
			||||||
    // 'execution' here can also apply to running the application, whatever ran last.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // HINT: In IntelliJ IDEA such test methods can be created with Alt-Insert.
 | 
					 | 
				
			||||||
    @Test
 | 
					 | 
				
			||||||
    public void deleteIsRejectedForAssetTransactions() {
 | 
					 | 
				
			||||||
        // when
 | 
					 | 
				
			||||||
        final Throwable throwException = catchThrowableOfType(() -> assetService.delete(RandomUtils.nextLong()), BadRequestAlertException.class);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // then
 | 
					 | 
				
			||||||
        // HINT: When using auto-import for assertions (e.g. via Alt-Enter in IntelliJ IDEA),
 | 
					 | 
				
			||||||
        // beware to use the correct candidate from org.assertj.core.api.Assertions.
 | 
					 | 
				
			||||||
        assertThat(throwException).isEqualToComparingFieldByField(
 | 
					 | 
				
			||||||
            new BadRequestAlertException("Asset transactions are immutable", "asset", "assetTransactionImmutable"));
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @Test
 | 
					 | 
				
			||||||
    public void saveShouldPersistValidTransactions() {
 | 
					 | 
				
			||||||
        // given
 | 
					 | 
				
			||||||
        final AssetDTO givenAssetDTO = givenAssetDTO(null, AssetAction.PAYMENT, anyPositiveAmout());
 | 
					 | 
				
			||||||
        // HINT: given(...)...will...() can't be used for void methods, in that case use Mockito's do...() methods
 | 
					 | 
				
			||||||
        doNothing().when(assetValidator).validate(givenAssetDTO);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // when
 | 
					 | 
				
			||||||
        final AssetDTO returnedAssetDto = assetService.save(givenAssetDTO);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // then
 | 
					 | 
				
			||||||
        verify(em).flush();
 | 
					 | 
				
			||||||
        verify(em).refresh(any(Asset.class));
 | 
					 | 
				
			||||||
        assertThat(returnedAssetDto).isEqualToIgnoringGivenFields(givenAssetDTO, "id");
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @Test
 | 
					 | 
				
			||||||
    public void saveShouldNotPersistInvalidTransactions() {
 | 
					 | 
				
			||||||
        // given
 | 
					 | 
				
			||||||
        final AssetDTO givenAssetDTO = givenAssetDTO(null, AssetAction.PAYMENT, anyNegativeAmount());
 | 
					 | 
				
			||||||
        doThrow(new BadRequestAlertException("Some Dummy Test Violation", "asset", "assetInvalidTestDummy")).when(assetValidator).validate(givenAssetDTO);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // when
 | 
					 | 
				
			||||||
        final Throwable throwException = catchThrowableOfType(() -> assetService.save(givenAssetDTO), BadRequestAlertException.class);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // then
 | 
					 | 
				
			||||||
        assertThat(throwException).isEqualToComparingFieldByField(
 | 
					 | 
				
			||||||
            new BadRequestAlertException("Some Dummy Test Violation", "asset", "assetInvalidTestDummy"));
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @Test
 | 
					 | 
				
			||||||
    public void saveShouldUpdateValidTransactions() {
 | 
					 | 
				
			||||||
        // given
 | 
					 | 
				
			||||||
        final AssetDTO givenAssetDTO = givenAssetDTO(anyNonNullId(), AssetAction.PAYMENT, anyPositiveAmout());
 | 
					 | 
				
			||||||
        doNothing().when(assetValidator).validate(givenAssetDTO);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // when
 | 
					 | 
				
			||||||
        final AssetDTO returnedAssetDto = assetService.save(givenAssetDTO);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // then
 | 
					 | 
				
			||||||
        verify(em).flush();
 | 
					 | 
				
			||||||
        verify(em).refresh(any(Asset.class));
 | 
					 | 
				
			||||||
        assertThat(returnedAssetDto).isEqualToIgnoringGivenFields(givenAssetDTO, "id");
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @Test
 | 
					 | 
				
			||||||
    public void saveShouldNotUpdateInvalidTransactions() {
 | 
					 | 
				
			||||||
        // given
 | 
					 | 
				
			||||||
        final AssetDTO givenAssetDTO = givenAssetDTO(anyNonNullId(), AssetAction.PAYMENT, anyNegativeAmount());
 | 
					 | 
				
			||||||
        // HINT: given(...) can't be used for void methods, in that case use Mockito's do...() methods
 | 
					 | 
				
			||||||
        doThrow(new BadRequestAlertException("Some Dummy Test Violation", "asset", "assetInvalidTestDummy")).when(assetValidator).validate(givenAssetDTO);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // when
 | 
					 | 
				
			||||||
        final Throwable throwException = catchThrowableOfType(() -> assetService.save(givenAssetDTO), BadRequestAlertException.class);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // then
 | 
					 | 
				
			||||||
        assertThat(throwException).isEqualToComparingFieldByField(
 | 
					 | 
				
			||||||
            new BadRequestAlertException("Some Dummy Test Violation", "asset", "assetInvalidTestDummy"));
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // --- only test fixture code below ---
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private long anyNonNullId() {
 | 
					 | 
				
			||||||
        return RandomUtils.nextInt();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // HINT: This rather complicated setup indicates that the method AssetService::save breaks the single responsibility principle.
 | 
					 | 
				
			||||||
    private AssetDTO givenAssetDTO(final Long id, final AssetAction givenAction, final BigDecimal givenQuantity) {
 | 
					 | 
				
			||||||
        final AssetDTO givenAssetDTO = createAssetDTO(id, givenAction, givenQuantity);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // dto -> entity
 | 
					 | 
				
			||||||
        final Asset givenAssetEntity = Mockito.mock(Asset.class);
 | 
					 | 
				
			||||||
        given(assetMapper.toEntity(same(givenAssetDTO))).willReturn(givenAssetEntity);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // assetRepository.save(entity);
 | 
					 | 
				
			||||||
        final Asset persistedAssetEntity = Mockito.mock(Asset.class);
 | 
					 | 
				
			||||||
        given(assetRepository.save(same(givenAssetEntity))).willReturn(persistedAssetEntity);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // entity -> dto
 | 
					 | 
				
			||||||
        AssetDTO persistedAssetDTO = createAssetDTO(id == null ? RandomUtils.nextLong() : id, givenAction, givenQuantity);
 | 
					 | 
				
			||||||
        given(assetMapper.toDto(same(persistedAssetEntity))).willReturn(persistedAssetDTO);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return givenAssetDTO;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private AssetDTO createAssetDTO(Long id, AssetAction givenAction, BigDecimal givenAmount) {
 | 
					 | 
				
			||||||
        final AssetDTO givenAssetDTO = new AssetDTO();
 | 
					 | 
				
			||||||
        givenAssetDTO.setId(id);
 | 
					 | 
				
			||||||
        givenAssetDTO.setAction(givenAction);
 | 
					 | 
				
			||||||
        givenAssetDTO.setAmount(givenAmount);
 | 
					 | 
				
			||||||
        return givenAssetDTO;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private BigDecimal anyPositiveAmout() {
 | 
					 | 
				
			||||||
        return BigDecimal.valueOf(RandomUtils.nextInt()).add(new BigDecimal("0.1"));
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private BigDecimal anyNegativeAmount() {
 | 
					 | 
				
			||||||
        return anyPositiveAmout().negate();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@@ -15,13 +15,12 @@ import org.mockito.Mockito;
 | 
				
			|||||||
import org.mockito.junit.MockitoJUnit;
 | 
					import org.mockito.junit.MockitoJUnit;
 | 
				
			||||||
import org.mockito.junit.MockitoRule;
 | 
					import org.mockito.junit.MockitoRule;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import javax.persistence.EntityManager;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import static org.assertj.core.api.Assertions.assertThat;
 | 
					import static org.assertj.core.api.Assertions.assertThat;
 | 
				
			||||||
import static org.assertj.core.api.Assertions.catchThrowableOfType;
 | 
					import static org.assertj.core.api.Assertions.catchThrowableOfType;
 | 
				
			||||||
import static org.mockito.ArgumentMatchers.same;
 | 
					import static org.mockito.ArgumentMatchers.same;
 | 
				
			||||||
import static org.mockito.BDDMockito.given;
 | 
					import static org.mockito.BDDMockito.given;
 | 
				
			||||||
import static org.mockito.Mockito.*;
 | 
					import static org.mockito.Mockito.doNothing;
 | 
				
			||||||
 | 
					import static org.mockito.Mockito.doThrow;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// HINT: In IntelliJ IDEA such unit test classes can be created with Shift-Ctrl-T.
 | 
					// HINT: In IntelliJ IDEA such unit test classes can be created with Shift-Ctrl-T.
 | 
				
			||||||
@@ -31,9 +30,6 @@ public class ShareServiceUnitTest {
 | 
				
			|||||||
    @Rule
 | 
					    @Rule
 | 
				
			||||||
    public MockitoRule mockitoRule = MockitoJUnit.rule();
 | 
					    public MockitoRule mockitoRule = MockitoJUnit.rule();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Mock
 | 
					 | 
				
			||||||
    private EntityManager em;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @Mock
 | 
					    @Mock
 | 
				
			||||||
    private ShareRepository shareRepository;
 | 
					    private ShareRepository shareRepository;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -74,8 +70,6 @@ public class ShareServiceUnitTest {
 | 
				
			|||||||
        final ShareDTO returnedShareDto = shareService.save(givenShareDTO);
 | 
					        final ShareDTO returnedShareDto = shareService.save(givenShareDTO);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // then
 | 
					        // then
 | 
				
			||||||
        verify(em).flush();
 | 
					 | 
				
			||||||
        verify(em).refresh(any(Share.class));
 | 
					 | 
				
			||||||
        assertThat(returnedShareDto).isEqualToIgnoringGivenFields(givenShareDTO, "id");
 | 
					        assertThat(returnedShareDto).isEqualToIgnoringGivenFields(givenShareDTO, "id");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -103,8 +97,6 @@ public class ShareServiceUnitTest {
 | 
				
			|||||||
        final ShareDTO returnedShareDto = shareService.save(givenShareDTO);
 | 
					        final ShareDTO returnedShareDto = shareService.save(givenShareDTO);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // then
 | 
					        // then
 | 
				
			||||||
        verify(em).flush();
 | 
					 | 
				
			||||||
        verify(em).refresh(any(Share.class));
 | 
					 | 
				
			||||||
        assertThat(returnedShareDto).isEqualToIgnoringGivenFields(givenShareDTO, "id");
 | 
					        assertThat(returnedShareDto).isEqualToIgnoringGivenFields(givenShareDTO, "id");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -82,8 +82,7 @@ public class CustomerDTOUnitTest {
 | 
				
			|||||||
            toJSonFieldDefinition("id", given.getId()) + "," +
 | 
					            toJSonFieldDefinition("id", given.getId()) + "," +
 | 
				
			||||||
            toJSonFieldDefinition("reference", given.getReference()) + "," +
 | 
					            toJSonFieldDefinition("reference", given.getReference()) + "," +
 | 
				
			||||||
            toJSonFieldDefinition("prefix", given.getPrefix()) + "," +
 | 
					            toJSonFieldDefinition("prefix", given.getPrefix()) + "," +
 | 
				
			||||||
            toJSonFieldDefinition("name", given.getName()) + "," +
 | 
					            toJSonFieldDefinition("name", given.getName()) +
 | 
				
			||||||
            toJSonFieldDefinition("displayLabel", given.getDisplayLabel()) +
 | 
					 | 
				
			||||||
            "}";
 | 
					            "}";
 | 
				
			||||||
        assertEquals(expectedJSon, actual);
 | 
					        assertEquals(expectedJSon, actual);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -119,7 +118,7 @@ public class CustomerDTOUnitTest {
 | 
				
			|||||||
        expected.setId(1234L);
 | 
					        expected.setId(1234L);
 | 
				
			||||||
        expected.setContractualSalutation("Hallo Updated");
 | 
					        expected.setContractualSalutation("Hallo Updated");
 | 
				
			||||||
        expected.setBillingSalutation("Moin Updated");
 | 
					        expected.setBillingSalutation("Moin Updated");
 | 
				
			||||||
        assertThat(actual).isEqualToIgnoringGivenFields(expected, "displayLabel");
 | 
					        assertThat(actual).isEqualToComparingFieldByField(expected);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // --- only test fixture below ---
 | 
					    // --- only test fixture below ---
 | 
				
			||||||
@@ -141,11 +140,12 @@ public class CustomerDTOUnitTest {
 | 
				
			|||||||
                toJSonFieldDefinitionIfPresent("contractualAddress", dto.getContractualAddress()) +
 | 
					                toJSonFieldDefinitionIfPresent("contractualAddress", dto.getContractualAddress()) +
 | 
				
			||||||
                toJSonFieldDefinitionIfPresent("billingSalutation", dto.getBillingSalutation()) +
 | 
					                toJSonFieldDefinitionIfPresent("billingSalutation", dto.getBillingSalutation()) +
 | 
				
			||||||
                toJSonFieldDefinitionIfPresent("billingAddress", dto.getBillingAddress()) +
 | 
					                toJSonFieldDefinitionIfPresent("billingAddress", dto.getBillingAddress()) +
 | 
				
			||||||
                toJSonFieldDefinitionIfPresent("remark", dto.getRemark()) +
 | 
					                toJSonFieldDefinitionIfPresent("remark", dto.getRemark());
 | 
				
			||||||
                toJSonFieldDefinitionIfPresent("displayLabel", dto.getDisplayLabel());
 | 
					 | 
				
			||||||
        return "{" + json.substring(0, json.length() - 1) + "}";
 | 
					        return "{" + json.substring(0, json.length() - 1) + "}";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private String toJSonFieldDefinition(String name, String value) {
 | 
					    private String toJSonFieldDefinition(String name, String value) {
 | 
				
			||||||
        return inQuotes(name) + ":" + (value != null ? inQuotes(value) : "null");
 | 
					        return inQuotes(name) + ":" + (value != null ? inQuotes(value) : "null");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -186,7 +186,6 @@ public class CustomerDTOUnitTest {
 | 
				
			|||||||
        given.setBillingAddress("Noch eine Adresse");
 | 
					        given.setBillingAddress("Noch eine Adresse");
 | 
				
			||||||
        given.setBillingSalutation("Moin");
 | 
					        given.setBillingSalutation("Moin");
 | 
				
			||||||
        given.setRemark("Eine Bemerkung");
 | 
					        given.setRemark("Eine Bemerkung");
 | 
				
			||||||
        given.setDisplayLabel("Display Label");
 | 
					 | 
				
			||||||
        return given;
 | 
					        return given;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -154,7 +154,7 @@ public class ShareDTOUnitTest {
 | 
				
			|||||||
        givenDTO.setAction(ShareAction.SUBSCRIPTION);
 | 
					        givenDTO.setAction(ShareAction.SUBSCRIPTION);
 | 
				
			||||||
        givenDTO.setQuantity(3);
 | 
					        givenDTO.setQuantity(3);
 | 
				
			||||||
        givenDTO.setDocumentDate(LocalDate.parse("2019-04-22"));
 | 
					        givenDTO.setDocumentDate(LocalDate.parse("2019-04-22"));
 | 
				
			||||||
        givenDTO.setMembershipDisplayLabel("2019-04-21"); // TODO: why is this not a LocalDate?
 | 
					        givenDTO.setMembershipDisplayReference("2019-04-21"); // TODO: why is this not a LocalDate?
 | 
				
			||||||
        givenDTO.setValueDate(LocalDate.parse("2019-04-30"));
 | 
					        givenDTO.setValueDate(LocalDate.parse("2019-04-30"));
 | 
				
			||||||
        givenDTO.setRemark("Some Remark");
 | 
					        givenDTO.setRemark("Some Remark");
 | 
				
			||||||
        return givenDTO;
 | 
					        return givenDTO;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -248,7 +248,7 @@ public class MembershipResourceIntTest {
 | 
				
			|||||||
            .andExpect(jsonPath("$.[*].cancellationDocumentDate").value(hasItem(DEFAULT_CANCELLATION_DOCUMENT_DATE.toString())))
 | 
					            .andExpect(jsonPath("$.[*].cancellationDocumentDate").value(hasItem(DEFAULT_CANCELLATION_DOCUMENT_DATE.toString())))
 | 
				
			||||||
            .andExpect(jsonPath("$.[*].memberFromDate").value(hasItem(DEFAULT_MEMBER_FROM_DATE.toString())))
 | 
					            .andExpect(jsonPath("$.[*].memberFromDate").value(hasItem(DEFAULT_MEMBER_FROM_DATE.toString())))
 | 
				
			||||||
            .andExpect(jsonPath("$.[*].memberUntilDate").value(hasItem(DEFAULT_MEMBER_UNTIL_DATE.toString())))
 | 
					            .andExpect(jsonPath("$.[*].memberUntilDate").value(hasItem(DEFAULT_MEMBER_UNTIL_DATE.toString())))
 | 
				
			||||||
            .andExpect(jsonPath("$.[*].remark").value(hasItem(DEFAULT_REMARK)));
 | 
					            .andExpect(jsonPath("$.[*].remark").value(hasItem(DEFAULT_REMARK.toString())));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Test
 | 
					    @Test
 | 
				
			||||||
@@ -266,7 +266,7 @@ public class MembershipResourceIntTest {
 | 
				
			|||||||
            .andExpect(jsonPath("$.cancellationDocumentDate").value(DEFAULT_CANCELLATION_DOCUMENT_DATE.toString()))
 | 
					            .andExpect(jsonPath("$.cancellationDocumentDate").value(DEFAULT_CANCELLATION_DOCUMENT_DATE.toString()))
 | 
				
			||||||
            .andExpect(jsonPath("$.memberFromDate").value(DEFAULT_MEMBER_FROM_DATE.toString()))
 | 
					            .andExpect(jsonPath("$.memberFromDate").value(DEFAULT_MEMBER_FROM_DATE.toString()))
 | 
				
			||||||
            .andExpect(jsonPath("$.memberUntilDate").value(DEFAULT_MEMBER_UNTIL_DATE.toString()))
 | 
					            .andExpect(jsonPath("$.memberUntilDate").value(DEFAULT_MEMBER_UNTIL_DATE.toString()))
 | 
				
			||||||
            .andExpect(jsonPath("$.remark").value(DEFAULT_REMARK));
 | 
					            .andExpect(jsonPath("$.remark").value(DEFAULT_REMARK.toString()));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Test
 | 
					    @Test
 | 
				
			||||||
@@ -682,7 +682,9 @@ public class MembershipResourceIntTest {
 | 
				
			|||||||
        // Disconnect from session so that the updates on updatedMembership are not directly saved in db
 | 
					        // Disconnect from session so that the updates on updatedMembership are not directly saved in db
 | 
				
			||||||
        em.detach(updatedMembership);
 | 
					        em.detach(updatedMembership);
 | 
				
			||||||
        updatedMembership
 | 
					        updatedMembership
 | 
				
			||||||
 | 
					            .admissionDocumentDate(UPDATED_ADMISSION_DOCUMENT_DATE)
 | 
				
			||||||
            .cancellationDocumentDate(UPDATED_CANCELLATION_DOCUMENT_DATE)
 | 
					            .cancellationDocumentDate(UPDATED_CANCELLATION_DOCUMENT_DATE)
 | 
				
			||||||
 | 
					            .memberFromDate(UPDATED_MEMBER_FROM_DATE)
 | 
				
			||||||
            .memberUntilDate(UPDATED_MEMBER_UNTIL_DATE)
 | 
					            .memberUntilDate(UPDATED_MEMBER_UNTIL_DATE)
 | 
				
			||||||
            .remark(UPDATED_REMARK);
 | 
					            .remark(UPDATED_REMARK);
 | 
				
			||||||
        MembershipDTO membershipDTO = membershipMapper.toDto(updatedMembership);
 | 
					        MembershipDTO membershipDTO = membershipMapper.toDto(updatedMembership);
 | 
				
			||||||
@@ -696,9 +698,9 @@ public class MembershipResourceIntTest {
 | 
				
			|||||||
        List<Membership> membershipList = membershipRepository.findAll();
 | 
					        List<Membership> membershipList = membershipRepository.findAll();
 | 
				
			||||||
        assertThat(membershipList).hasSize(databaseSizeBeforeUpdate);
 | 
					        assertThat(membershipList).hasSize(databaseSizeBeforeUpdate);
 | 
				
			||||||
        Membership testMembership = membershipList.get(membershipList.size() - 1);
 | 
					        Membership testMembership = membershipList.get(membershipList.size() - 1);
 | 
				
			||||||
        assertThat(testMembership.getAdmissionDocumentDate()).isEqualTo(DEFAULT_ADMISSION_DOCUMENT_DATE);
 | 
					        assertThat(testMembership.getAdmissionDocumentDate()).isEqualTo(UPDATED_ADMISSION_DOCUMENT_DATE);
 | 
				
			||||||
        assertThat(testMembership.getCancellationDocumentDate()).isEqualTo(UPDATED_CANCELLATION_DOCUMENT_DATE);
 | 
					        assertThat(testMembership.getCancellationDocumentDate()).isEqualTo(UPDATED_CANCELLATION_DOCUMENT_DATE);
 | 
				
			||||||
        assertThat(testMembership.getMemberFromDate()).isEqualTo(DEFAULT_MEMBER_FROM_DATE);
 | 
					        assertThat(testMembership.getMemberFromDate()).isEqualTo(UPDATED_MEMBER_FROM_DATE);
 | 
				
			||||||
        assertThat(testMembership.getMemberUntilDate()).isEqualTo(UPDATED_MEMBER_UNTIL_DATE);
 | 
					        assertThat(testMembership.getMemberUntilDate()).isEqualTo(UPDATED_MEMBER_UNTIL_DATE);
 | 
				
			||||||
        assertThat(testMembership.getRemark()).isEqualTo(UPDATED_REMARK);
 | 
					        assertThat(testMembership.getRemark()).isEqualTo(UPDATED_REMARK);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user