Merge branch 'jhipster-generated'
This commit is contained in:
		@@ -30,15 +30,23 @@ public class Membership implements Serializable {
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    @NotNull
 | 
			
		||||
    @Column(name = "since_date", nullable = false)
 | 
			
		||||
    private LocalDate sinceDate;
 | 
			
		||||
    @Column(name = "document_date", nullable = false)
 | 
			
		||||
    private LocalDate documentDate;
 | 
			
		||||
 | 
			
		||||
    @Column(name = "until_date")
 | 
			
		||||
    private LocalDate untilDate;
 | 
			
		||||
    @NotNull
 | 
			
		||||
    @Column(name = "member_from", nullable = false)
 | 
			
		||||
    private LocalDate memberFrom;
 | 
			
		||||
 | 
			
		||||
    @OneToMany(mappedBy = "member")
 | 
			
		||||
    @Column(name = "member_until")
 | 
			
		||||
    private LocalDate memberUntil;
 | 
			
		||||
 | 
			
		||||
    @Size(max = 160)
 | 
			
		||||
    @Column(name = "remark", length = 160)
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
    @OneToMany(mappedBy = "membership")
 | 
			
		||||
    private Set<Share> shares = new HashSet<>();
 | 
			
		||||
    @OneToMany(mappedBy = "member")
 | 
			
		||||
    @OneToMany(mappedBy = "membership")
 | 
			
		||||
    private Set<Asset> assets = new HashSet<>();
 | 
			
		||||
    @ManyToOne(optional = false)
 | 
			
		||||
    @NotNull
 | 
			
		||||
@@ -54,30 +62,56 @@ public class Membership implements Serializable {
 | 
			
		||||
        this.id = id;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public LocalDate getSinceDate() {
 | 
			
		||||
        return sinceDate;
 | 
			
		||||
    public LocalDate getDocumentDate() {
 | 
			
		||||
        return documentDate;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Membership sinceDate(LocalDate sinceDate) {
 | 
			
		||||
        this.sinceDate = sinceDate;
 | 
			
		||||
    public Membership documentDate(LocalDate documentDate) {
 | 
			
		||||
        this.documentDate = documentDate;
 | 
			
		||||
        return this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setSinceDate(LocalDate sinceDate) {
 | 
			
		||||
        this.sinceDate = sinceDate;
 | 
			
		||||
    public void setDocumentDate(LocalDate documentDate) {
 | 
			
		||||
        this.documentDate = documentDate;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public LocalDate getUntilDate() {
 | 
			
		||||
        return untilDate;
 | 
			
		||||
    public LocalDate getMemberFrom() {
 | 
			
		||||
        return memberFrom;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Membership untilDate(LocalDate untilDate) {
 | 
			
		||||
        this.untilDate = untilDate;
 | 
			
		||||
    public Membership memberFrom(LocalDate memberFrom) {
 | 
			
		||||
        this.memberFrom = memberFrom;
 | 
			
		||||
        return this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setUntilDate(LocalDate untilDate) {
 | 
			
		||||
        this.untilDate = untilDate;
 | 
			
		||||
    public void setMemberFrom(LocalDate memberFrom) {
 | 
			
		||||
        this.memberFrom = memberFrom;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public LocalDate getMemberUntil() {
 | 
			
		||||
        return memberUntil;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Membership memberUntil(LocalDate memberUntil) {
 | 
			
		||||
        this.memberUntil = memberUntil;
 | 
			
		||||
        return this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setMemberUntil(LocalDate memberUntil) {
 | 
			
		||||
        this.memberUntil = memberUntil;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getRemark() {
 | 
			
		||||
        return remark;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Membership remark(String remark) {
 | 
			
		||||
        this.remark = remark;
 | 
			
		||||
        return this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setRemark(String remark) {
 | 
			
		||||
        this.remark = remark;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Set<Share> getShares() {
 | 
			
		||||
@@ -168,8 +202,10 @@ public class Membership implements Serializable {
 | 
			
		||||
    public String toString() {
 | 
			
		||||
        return "Membership{" +
 | 
			
		||||
            "id=" + getId() +
 | 
			
		||||
            ", sinceDate='" + getSinceDate() + "'" +
 | 
			
		||||
            ", untilDate='" + getUntilDate() + "'" +
 | 
			
		||||
            ", documentDate='" + getDocumentDate() + "'" +
 | 
			
		||||
            ", memberFrom='" + getMemberFrom() + "'" +
 | 
			
		||||
            ", memberUntil='" + getMemberUntil() + "'" +
 | 
			
		||||
            ", remark='" + getRemark() + "'" +
 | 
			
		||||
            "}";
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -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.to IS NULL")
 | 
			
		||||
        " FROM Membership m WHERE m.customer.id=:customerId AND m.memberUntil IS NULL")
 | 
			
		||||
    boolean hasUncancelledMembershipForCustomer(@Param("customerId") final long customerId);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,7 @@ public class MembershipValidator {
 | 
			
		||||
    private MembershipRepository membershipRepository;
 | 
			
		||||
 | 
			
		||||
    public void validate(final MembershipDTO membershipDTO) {
 | 
			
		||||
        if (membershipDTO.getTo() != null && !membershipDTO.getTo().isAfter(membershipDTO.getFrom())) {
 | 
			
		||||
        if (membershipDTO.getMemberUntil() != null && !membershipDTO.getMemberUntil().isAfter(membershipDTO.getMemberFrom())) {
 | 
			
		||||
            throw new BadRequestAlertException("Invalid untilDate", Membership.ENTITY_NAME, "untilDateMustBeAfterSinceDate");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -3,6 +3,7 @@ import java.time.LocalDate;
 | 
			
		||||
import javax.validation.constraints.*;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.Objects;
 | 
			
		||||
import java.util.function.Consumer;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * A DTO for the Membership entity.
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@
 | 
			
		||||
    <!--
 | 
			
		||||
        Added the entity Customer.
 | 
			
		||||
    -->
 | 
			
		||||
    <changeSet id="20190403083735-1" author="jhipster">
 | 
			
		||||
    <changeSet id="20190418143050-1" author="jhipster">
 | 
			
		||||
        <createTable tableName="customer">
 | 
			
		||||
            <column name="id" type="bigint" autoIncrement="${autoIncrement}">
 | 
			
		||||
                <constraints primaryKey="true" nullable="false"/>
 | 
			
		||||
@@ -16,7 +16,7 @@
 | 
			
		||||
    <!--
 | 
			
		||||
        Added the entity Membership.
 | 
			
		||||
    -->
 | 
			
		||||
    <changeSet id="20190403083738-1" author="jhipster">
 | 
			
		||||
    <changeSet id="20190418143051-1" author="jhipster">
 | 
			
		||||
        <createTable tableName="membership">
 | 
			
		||||
            <column name="id" type="bigint" autoIncrement="${autoIncrement}">
 | 
			
		||||
                <constraints primaryKey="true" nullable="false"/>
 | 
			
		||||
@@ -6,7 +6,7 @@
 | 
			
		||||
    <!--
 | 
			
		||||
        Added the constraints for entity Membership.
 | 
			
		||||
    -->
 | 
			
		||||
    <changeSet id="20190418073044-2" author="jhipster">
 | 
			
		||||
    <changeSet id="20190418143051-2" author="jhipster">
 | 
			
		||||
        
 | 
			
		||||
        <addForeignKeyConstraint baseColumnNames="customer_id"
 | 
			
		||||
                                 baseTableName="membership"
 | 
			
		||||
@@ -16,7 +16,7 @@
 | 
			
		||||
    <!--
 | 
			
		||||
        Added the entity Share.
 | 
			
		||||
    -->
 | 
			
		||||
    <changeSet id="20190418073045-1" author="jhipster">
 | 
			
		||||
    <changeSet id="20190418143052-1" author="jhipster">
 | 
			
		||||
        <createTable tableName="share">
 | 
			
		||||
            <column name="id" type="bigint" autoIncrement="${autoIncrement}">
 | 
			
		||||
                <constraints primaryKey="true" nullable="false"/>
 | 
			
		||||
@@ -6,7 +6,7 @@
 | 
			
		||||
    <!--
 | 
			
		||||
        Added the constraints for entity Share.
 | 
			
		||||
    -->
 | 
			
		||||
    <changeSet id="20190418073045-2" author="jhipster">
 | 
			
		||||
    <changeSet id="20190418143052-2" author="jhipster">
 | 
			
		||||
        
 | 
			
		||||
        <addForeignKeyConstraint baseColumnNames="membership_id"
 | 
			
		||||
                                 baseTableName="share"
 | 
			
		||||
@@ -16,7 +16,7 @@
 | 
			
		||||
    <!--
 | 
			
		||||
        Added the entity Asset.
 | 
			
		||||
    -->
 | 
			
		||||
    <changeSet id="20190418073046-1" author="jhipster">
 | 
			
		||||
    <changeSet id="20190418143053-1" author="jhipster">
 | 
			
		||||
        <createTable tableName="asset">
 | 
			
		||||
            <column name="id" type="bigint" autoIncrement="${autoIncrement}">
 | 
			
		||||
                <constraints primaryKey="true" nullable="false"/>
 | 
			
		||||
@@ -6,7 +6,7 @@
 | 
			
		||||
    <!--
 | 
			
		||||
        Added the constraints for entity Asset.
 | 
			
		||||
    -->
 | 
			
		||||
    <changeSet id="20190418073046-2" author="jhipster">
 | 
			
		||||
    <changeSet id="20190418143053-2" author="jhipster">
 | 
			
		||||
        
 | 
			
		||||
        <addForeignKeyConstraint baseColumnNames="membership_id"
 | 
			
		||||
                                 baseTableName="asset"
 | 
			
		||||
@@ -16,7 +16,7 @@
 | 
			
		||||
    <!--
 | 
			
		||||
        Added the entity SepaMandate.
 | 
			
		||||
    -->
 | 
			
		||||
    <changeSet id="20190418100951-1" author="jhipster">
 | 
			
		||||
    <changeSet id="20190418143054-1" author="jhipster">
 | 
			
		||||
        <createTable tableName="sepa_mandate">
 | 
			
		||||
            <column name="id" type="bigint" autoIncrement="${autoIncrement}">
 | 
			
		||||
                <constraints primaryKey="true" nullable="false"/>
 | 
			
		||||
@@ -0,0 +1,18 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<databaseChangeLog
 | 
			
		||||
    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
 | 
			
		||||
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 | 
			
		||||
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
 | 
			
		||||
    <!--
 | 
			
		||||
        Added the constraints for entity SepaMandate.
 | 
			
		||||
    -->
 | 
			
		||||
    <changeSet id="20190418143054-2" author="jhipster">
 | 
			
		||||
        
 | 
			
		||||
        <addForeignKeyConstraint baseColumnNames="customer_id"
 | 
			
		||||
                                 baseTableName="sepa_mandate"
 | 
			
		||||
                                 constraintName="fk_sepa_mandate_customer_id"
 | 
			
		||||
                                 referencedColumnNames="id"
 | 
			
		||||
                                 referencedTableName="customer"/>
 | 
			
		||||
 | 
			
		||||
    </changeSet>
 | 
			
		||||
</databaseChangeLog>
 | 
			
		||||
@@ -5,22 +5,15 @@
 | 
			
		||||
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
 | 
			
		||||
 | 
			
		||||
    <include file="config/liquibase/changelog/00000000000000_initial_schema.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <include file="config/liquibase/changelog/20190403083735_added_entity_Customer.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <include file="config/liquibase/changelog/20190403083736_added_entity_Contact.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <include file="config/liquibase/changelog/20190403083737_added_entity_CustomerContact.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <include file="config/liquibase/changelog/20190403083738_added_entity_Membership.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <include file="config/liquibase/changelog/20190403083739_added_entity_Share.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <include file="config/liquibase/changelog/20190403083740_added_entity_Asset.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <include file="config/liquibase/changelog/20190418100951_added_entity_SepaMandate.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <include file="config/liquibase/changelog/20190418143050_added_entity_Customer.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <include file="config/liquibase/changelog/20190418143051_added_entity_Membership.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <include file="config/liquibase/changelog/20190418143052_added_entity_Share.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <include file="config/liquibase/changelog/20190418143053_added_entity_Asset.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <include file="config/liquibase/changelog/20190418143054_added_entity_SepaMandate.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <!-- jhipster-needle-liquibase-add-changelog - JHipster will add liquibase changelogs here -->
 | 
			
		||||
    <include file="config/liquibase/changelog/20190403083737_added_entity_constraints_CustomerContact.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <include file="config/liquibase/changelog/20190403083738_added_entity_constraints_Membership.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <include file="config/liquibase/changelog/20190403083739_added_entity_constraints_Share.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <include file="config/liquibase/changelog/20190403083740_added_entity_constraints_Asset.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <include file="config/liquibase/changelog/20190418100951_added_entity_constraints_SepaMandate.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <include file="config/liquibase/changelog/20190418143051_added_entity_constraints_Membership.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <include file="config/liquibase/changelog/20190418143052_added_entity_constraints_Share.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <include file="config/liquibase/changelog/20190418143053_added_entity_constraints_Asset.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <include file="config/liquibase/changelog/20190418143054_added_entity_constraints_SepaMandate.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <!-- jhipster-needle-liquibase-add-constraints-changelog - JHipster will add liquibase constraints changelogs here -->
 | 
			
		||||
 | 
			
		||||
    <include file="config/liquibase/changelog/sample-data-Customer.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
    <include file="config/liquibase/changelog/sample-data-Membership.xml" relativeToChangelogFile="false"/>
 | 
			
		||||
 | 
			
		||||
</databaseChangeLog>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,49 +1,9 @@
 | 
			
		||||
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
 | 
			
		||||
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
 | 
			
		||||
import { RouterModule } from '@angular/router';
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
    imports: [
 | 
			
		||||
        RouterModule.forChild([
 | 
			
		||||
            {
 | 
			
		||||
                path: 'customer',
 | 
			
		||||
                loadChildren: './customer/customer.module#HsadminNgCustomerModule'
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                path: 'contact',
 | 
			
		||||
                loadChildren: './contact/contact.module#HsadminNgContactModule'
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                path: 'customer-contact',
 | 
			
		||||
                loadChildren: './customer-contact/customer-contact.module#HsadminNgCustomerContactModule'
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                path: 'membership',
 | 
			
		||||
                loadChildren: './membership/membership.module#HsadminNgMembershipModule'
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                path: 'share',
 | 
			
		||||
                loadChildren: './share/share.module#HsadminNgShareModule'
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                path: 'asset',
 | 
			
		||||
                loadChildren: './asset/asset.module#HsadminNgAssetModule'
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                path: 'customer',
 | 
			
		||||
                loadChildren: './customer/customer.module#HsadminNgCustomerModule'
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                path: 'membership',
 | 
			
		||||
                loadChildren: './membership/membership.module#HsadminNgMembershipModule'
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                path: 'share',
 | 
			
		||||
                loadChildren: './share/share.module#HsadminNgShareModule'
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                path: 'asset',
 | 
			
		||||
                loadChildren: './asset/asset.module#HsadminNgAssetModule'
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                path: 'customer',
 | 
			
		||||
                loadChildren: './customer/customer.module#HsadminNgCustomerModule'
 | 
			
		||||
 
 | 
			
		||||
@@ -19,11 +19,11 @@ export class SepaMandateUpdateComponent implements OnInit {
 | 
			
		||||
    isSaving: boolean;
 | 
			
		||||
 | 
			
		||||
    customers: ICustomer[];
 | 
			
		||||
    createdDp: any;
 | 
			
		||||
    documentDateDp: any;
 | 
			
		||||
    validFromDp: any;
 | 
			
		||||
    validToDp: any;
 | 
			
		||||
    validUntilDp: any;
 | 
			
		||||
    lastUsedDp: any;
 | 
			
		||||
    cancelledDp: any;
 | 
			
		||||
    cancellationDateDp: any;
 | 
			
		||||
 | 
			
		||||
    constructor(
 | 
			
		||||
        protected jhiAlertService: JhiAlertService,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user