several 'required' flags added to jdl and re-import
This commit is contained in:
		@@ -44,7 +44,7 @@ public class Asset implements Serializable {
 | 
			
		||||
    private String comment;
 | 
			
		||||
 | 
			
		||||
    @NotNull
 | 
			
		||||
    @ManyToOne
 | 
			
		||||
    @ManyToOne(optional = false)
 | 
			
		||||
    @JsonIgnoreProperties("assets")
 | 
			
		||||
    private Membership member;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,15 +1,12 @@
 | 
			
		||||
package org.hostsharing.hsadminng.domain;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonIgnore;
 | 
			
		||||
 | 
			
		||||
import javax.persistence.*;
 | 
			
		||||
import javax.validation.constraints.*;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.HashSet;
 | 
			
		||||
import java.util.Set;
 | 
			
		||||
import java.util.Objects;
 | 
			
		||||
import java.util.Set;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * A Customer.
 | 
			
		||||
@@ -58,10 +55,12 @@ public class Customer implements Serializable {
 | 
			
		||||
    @Column(name = "billing_salutation", length = 80)
 | 
			
		||||
    private String billingSalutation;
 | 
			
		||||
 | 
			
		||||
    @OneToMany(mappedBy = "customer")
 | 
			
		||||
    private Set<Membership> memberships = new HashSet<>();
 | 
			
		||||
    @OneToMany(mappedBy = "customer")
 | 
			
		||||
    private Set<CustomerContact> roles = new HashSet<>();
 | 
			
		||||
 | 
			
		||||
    @OneToMany(mappedBy = "customer")
 | 
			
		||||
    private Set<Membership> memberships = new HashSet<>();
 | 
			
		||||
 | 
			
		||||
    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
 | 
			
		||||
    public Long getId() {
 | 
			
		||||
        return id;
 | 
			
		||||
@@ -162,31 +161,6 @@ public class Customer implements Serializable {
 | 
			
		||||
        this.billingSalutation = billingSalutation;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Set<Membership> getMemberships() {
 | 
			
		||||
        return memberships;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Customer memberships(Set<Membership> memberships) {
 | 
			
		||||
        this.memberships = memberships;
 | 
			
		||||
        return this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Customer addMembership(Membership membership) {
 | 
			
		||||
        this.memberships.add(membership);
 | 
			
		||||
        membership.setCustomer(this);
 | 
			
		||||
        return this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Customer removeMembership(Membership membership) {
 | 
			
		||||
        this.memberships.remove(membership);
 | 
			
		||||
        membership.setCustomer(null);
 | 
			
		||||
        return this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setMemberships(Set<Membership> memberships) {
 | 
			
		||||
        this.memberships = memberships;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Set<CustomerContact> getRoles() {
 | 
			
		||||
        return roles;
 | 
			
		||||
    }
 | 
			
		||||
@@ -211,6 +185,31 @@ public class Customer implements Serializable {
 | 
			
		||||
    public void setRoles(Set<CustomerContact> customerContacts) {
 | 
			
		||||
        this.roles = customerContacts;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Set<Membership> getMemberships() {
 | 
			
		||||
        return memberships;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Customer memberships(Set<Membership> memberships) {
 | 
			
		||||
        this.memberships = memberships;
 | 
			
		||||
        return this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Customer addMembership(Membership membership) {
 | 
			
		||||
        this.memberships.add(membership);
 | 
			
		||||
        membership.setCustomer(this);
 | 
			
		||||
        return this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Customer removeMembership(Membership membership) {
 | 
			
		||||
        this.memberships.remove(membership);
 | 
			
		||||
        membership.setCustomer(null);
 | 
			
		||||
        return this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setMemberships(Set<Membership> memberships) {
 | 
			
		||||
        this.memberships = memberships;
 | 
			
		||||
    }
 | 
			
		||||
    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
 
 | 
			
		||||
@@ -41,7 +41,7 @@ public class Membership implements Serializable {
 | 
			
		||||
    private Set<Asset> assets = new HashSet<>();
 | 
			
		||||
 | 
			
		||||
    @NotNull
 | 
			
		||||
    @ManyToOne
 | 
			
		||||
    @ManyToOne(optional = false)
 | 
			
		||||
    @JsonIgnoreProperties("memberships")
 | 
			
		||||
    private Customer customer;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -45,7 +45,7 @@ public class Share implements Serializable {
 | 
			
		||||
    private String comment;
 | 
			
		||||
 | 
			
		||||
    @NotNull
 | 
			
		||||
    @ManyToOne
 | 
			
		||||
    @ManyToOne(optional = false)
 | 
			
		||||
    @JsonIgnoreProperties("shares")
 | 
			
		||||
    private Membership member;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,14 @@
 | 
			
		||||
package org.hostsharing.hsadminng.service;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
import javax.persistence.criteria.JoinType;
 | 
			
		||||
 | 
			
		||||
import io.github.jhipster.service.QueryService;
 | 
			
		||||
import org.hostsharing.hsadminng.domain.Customer;
 | 
			
		||||
import org.hostsharing.hsadminng.domain.CustomerContact_;
 | 
			
		||||
import org.hostsharing.hsadminng.domain.Customer_;
 | 
			
		||||
import org.hostsharing.hsadminng.domain.Membership_;
 | 
			
		||||
import org.hostsharing.hsadminng.repository.CustomerRepository;
 | 
			
		||||
import org.hostsharing.hsadminng.service.dto.CustomerCriteria;
 | 
			
		||||
import org.hostsharing.hsadminng.service.dto.CustomerDTO;
 | 
			
		||||
import org.hostsharing.hsadminng.service.mapper.CustomerMapper;
 | 
			
		||||
import org.slf4j.Logger;
 | 
			
		||||
import org.slf4j.LoggerFactory;
 | 
			
		||||
import org.springframework.data.domain.Page;
 | 
			
		||||
@@ -12,14 +17,8 @@ import org.springframework.data.jpa.domain.Specification;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import org.springframework.transaction.annotation.Transactional;
 | 
			
		||||
 | 
			
		||||
import io.github.jhipster.service.QueryService;
 | 
			
		||||
 | 
			
		||||
import org.hostsharing.hsadminng.domain.Customer;
 | 
			
		||||
import org.hostsharing.hsadminng.domain.*; // for static metamodels
 | 
			
		||||
import org.hostsharing.hsadminng.repository.CustomerRepository;
 | 
			
		||||
import org.hostsharing.hsadminng.service.dto.CustomerCriteria;
 | 
			
		||||
import org.hostsharing.hsadminng.service.dto.CustomerDTO;
 | 
			
		||||
import org.hostsharing.hsadminng.service.mapper.CustomerMapper;
 | 
			
		||||
import javax.persistence.criteria.JoinType;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Service for executing complex queries for Customer entities in the database.
 | 
			
		||||
@@ -110,14 +109,14 @@ public class CustomerQueryService extends QueryService<Customer> {
 | 
			
		||||
            if (criteria.getBillingSalutation() != null) {
 | 
			
		||||
                specification = specification.and(buildStringSpecification(criteria.getBillingSalutation(), Customer_.billingSalutation));
 | 
			
		||||
            }
 | 
			
		||||
            if (criteria.getMembershipId() != null) {
 | 
			
		||||
                specification = specification.and(buildSpecification(criteria.getMembershipId(),
 | 
			
		||||
                    root -> root.join(Customer_.memberships, JoinType.LEFT).get(Membership_.id)));
 | 
			
		||||
            }
 | 
			
		||||
            if (criteria.getRoleId() != null) {
 | 
			
		||||
                specification = specification.and(buildSpecification(criteria.getRoleId(),
 | 
			
		||||
                    root -> root.join(Customer_.roles, JoinType.LEFT).get(CustomerContact_.id)));
 | 
			
		||||
            }
 | 
			
		||||
            if (criteria.getMembershipId() != null) {
 | 
			
		||||
                specification = specification.and(buildSpecification(criteria.getMembershipId(),
 | 
			
		||||
                    root -> root.join(Customer_.memberships, JoinType.LEFT).get(Membership_.id)));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return specification;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,15 +1,13 @@
 | 
			
		||||
package org.hostsharing.hsadminng.service.dto;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.Objects;
 | 
			
		||||
import io.github.jhipster.service.filter.BooleanFilter;
 | 
			
		||||
import io.github.jhipster.service.filter.DoubleFilter;
 | 
			
		||||
import io.github.jhipster.service.filter.Filter;
 | 
			
		||||
import io.github.jhipster.service.filter.FloatFilter;
 | 
			
		||||
import io.github.jhipster.service.filter.IntegerFilter;
 | 
			
		||||
import io.github.jhipster.service.filter.LongFilter;
 | 
			
		||||
import io.github.jhipster.service.filter.StringFilter;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.Objects;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Criteria class for the Customer entity. This class is used in CustomerResource to
 | 
			
		||||
 * receive all the possible filtering options from the Http GET request parameters.
 | 
			
		||||
@@ -38,10 +36,10 @@ public class CustomerCriteria implements Serializable {
 | 
			
		||||
 | 
			
		||||
    private StringFilter billingSalutation;
 | 
			
		||||
 | 
			
		||||
    private LongFilter membershipId;
 | 
			
		||||
 | 
			
		||||
    private LongFilter roleId;
 | 
			
		||||
 | 
			
		||||
    private LongFilter membershipId;
 | 
			
		||||
 | 
			
		||||
    public LongFilter getId() {
 | 
			
		||||
        return id;
 | 
			
		||||
    }
 | 
			
		||||
@@ -106,14 +104,6 @@ public class CustomerCriteria implements Serializable {
 | 
			
		||||
        this.billingSalutation = billingSalutation;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public LongFilter getMembershipId() {
 | 
			
		||||
        return membershipId;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setMembershipId(LongFilter membershipId) {
 | 
			
		||||
        this.membershipId = membershipId;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public LongFilter getRoleId() {
 | 
			
		||||
        return roleId;
 | 
			
		||||
    }
 | 
			
		||||
@@ -122,6 +112,14 @@ public class CustomerCriteria implements Serializable {
 | 
			
		||||
        this.roleId = roleId;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public LongFilter getMembershipId() {
 | 
			
		||||
        return membershipId;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setMembershipId(LongFilter membershipId) {
 | 
			
		||||
        this.membershipId = membershipId;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public boolean equals(Object o) {
 | 
			
		||||
@@ -141,8 +139,8 @@ public class CustomerCriteria implements Serializable {
 | 
			
		||||
            Objects.equals(contractualSalutation, that.contractualSalutation) &&
 | 
			
		||||
            Objects.equals(billingAddress, that.billingAddress) &&
 | 
			
		||||
            Objects.equals(billingSalutation, that.billingSalutation) &&
 | 
			
		||||
            Objects.equals(membershipId, that.membershipId) &&
 | 
			
		||||
            Objects.equals(roleId, that.roleId);
 | 
			
		||||
                Objects.equals(roleId, that.roleId) &&
 | 
			
		||||
                Objects.equals(membershipId, that.membershipId);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
@@ -156,8 +154,8 @@ public class CustomerCriteria implements Serializable {
 | 
			
		||||
        contractualSalutation,
 | 
			
		||||
        billingAddress,
 | 
			
		||||
        billingSalutation,
 | 
			
		||||
        membershipId,
 | 
			
		||||
        roleId
 | 
			
		||||
            roleId,
 | 
			
		||||
            membershipId
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -172,8 +170,8 @@ public class CustomerCriteria implements Serializable {
 | 
			
		||||
                (contractualSalutation != null ? "contractualSalutation=" + contractualSalutation + ", " : "") +
 | 
			
		||||
                (billingAddress != null ? "billingAddress=" + billingAddress + ", " : "") +
 | 
			
		||||
                (billingSalutation != null ? "billingSalutation=" + billingSalutation + ", " : "") +
 | 
			
		||||
                (membershipId != null ? "membershipId=" + membershipId + ", " : "") +
 | 
			
		||||
                (roleId != null ? "roleId=" + roleId + ", " : "") +
 | 
			
		||||
            (membershipId != null ? "membershipId=" + membershipId + ", " : "") +
 | 
			
		||||
            "}";
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,9 @@
 | 
			
		||||
package org.hostsharing.hsadminng.service.mapper;
 | 
			
		||||
 | 
			
		||||
import org.hostsharing.hsadminng.domain.*;
 | 
			
		||||
import org.hostsharing.hsadminng.domain.Customer;
 | 
			
		||||
import org.hostsharing.hsadminng.service.dto.CustomerDTO;
 | 
			
		||||
 | 
			
		||||
import org.mapstruct.*;
 | 
			
		||||
import org.mapstruct.Mapper;
 | 
			
		||||
import org.mapstruct.Mapping;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Mapper for the entity Customer and its DTO CustomerDTO.
 | 
			
		||||
@@ -12,8 +12,8 @@ import org.mapstruct.*;
 | 
			
		||||
public interface CustomerMapper extends EntityMapper<CustomerDTO, Customer> {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Mapping(target = "memberships", ignore = true)
 | 
			
		||||
    @Mapping(target = "roles", ignore = true)
 | 
			
		||||
    @Mapping(target = "memberships", ignore = true)
 | 
			
		||||
    Customer toEntity(CustomerDTO customerDTO);
 | 
			
		||||
 | 
			
		||||
    default Customer fromId(Long id) {
 | 
			
		||||
 
 | 
			
		||||
@@ -63,13 +63,10 @@ entity Asset {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
relationship OneToMany {
 | 
			
		||||
  Customer to Membership{customer(prefix)},
 | 
			
		||||
  Membership to Share{member},
 | 
			
		||||
  Membership to Asset{member}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
relationship ManyToOne {
 | 
			
		||||
  CustomerContact{contact(email) required} to Contact{role},
 | 
			
		||||
  CustomerContact{customer(prefix) required} to Customer{role}
 | 
			
		||||
  Contact{role} to CustomerContact{contact(email) required},
 | 
			
		||||
  Customer{role} to CustomerContact{customer(prefix) required},
 | 
			
		||||
  Customer to Membership{customer(prefix) required},
 | 
			
		||||
  Membership to Share{member required},
 | 
			
		||||
  Membership to Asset{member required}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,8 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<databaseChangeLog
 | 
			
		||||
    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
 | 
			
		||||
    xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
 | 
			
		||||
    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
 | 
			
		||||
                        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
 | 
			
		||||
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
 | 
			
		||||
 | 
			
		||||
    <property name="now" value="now()" dbms="h2"/>
 | 
			
		||||
    
 | 
			
		||||
@@ -30,7 +28,7 @@
 | 
			
		||||
            </column>
 | 
			
		||||
 | 
			
		||||
            <column name="customer_id" type="bigint">
 | 
			
		||||
                <constraints nullable="true" />
 | 
			
		||||
                <constraints nullable="false"/>
 | 
			
		||||
            </column>
 | 
			
		||||
 | 
			
		||||
            <!-- jhipster-needle-liquibase-add-column - JHipster will add columns here, do not remove-->
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,8 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<databaseChangeLog
 | 
			
		||||
    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
 | 
			
		||||
    xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
 | 
			
		||||
    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
 | 
			
		||||
                        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
 | 
			
		||||
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
 | 
			
		||||
 | 
			
		||||
    <property name="now" value="now()" dbms="h2"/>
 | 
			
		||||
    
 | 
			
		||||
@@ -38,7 +36,7 @@
 | 
			
		||||
            </column>
 | 
			
		||||
 | 
			
		||||
            <column name="member_id" type="bigint">
 | 
			
		||||
                <constraints nullable="true" />
 | 
			
		||||
                <constraints nullable="false"/>
 | 
			
		||||
            </column>
 | 
			
		||||
 | 
			
		||||
            <!-- jhipster-needle-liquibase-add-column - JHipster will add columns here, do not remove-->
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,8 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<databaseChangeLog
 | 
			
		||||
    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
 | 
			
		||||
    xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
 | 
			
		||||
    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
 | 
			
		||||
                        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
 | 
			
		||||
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
 | 
			
		||||
 | 
			
		||||
    <property name="now" value="now()" dbms="h2"/>
 | 
			
		||||
    
 | 
			
		||||
@@ -38,7 +36,7 @@
 | 
			
		||||
            </column>
 | 
			
		||||
 | 
			
		||||
            <column name="member_id" type="bigint">
 | 
			
		||||
                <constraints nullable="true" />
 | 
			
		||||
                <constraints nullable="false"/>
 | 
			
		||||
            </column>
 | 
			
		||||
 | 
			
		||||
            <!-- jhipster-needle-liquibase-add-column - JHipster will add columns here, do not remove-->
 | 
			
		||||
 
 | 
			
		||||
@@ -71,11 +71,18 @@
 | 
			
		||||
 | 
			
		||||
                <div class="form-group">
 | 
			
		||||
                    <label class="form-control-label" jhiTranslate="hsadminNgApp.asset.member" for="field_member">Member</label>
 | 
			
		||||
                    <select class="form-control" id="field_member" name="member" [(ngModel)]="asset.memberId" >
 | 
			
		||||
                        <option [ngValue]="null"></option>
 | 
			
		||||
                    <select class="form-control" id="field_member" name="member" [(ngModel)]="asset.memberId" required>
 | 
			
		||||
                        <option *ngIf="!editForm.value.member" [ngValue]="null" selected></option>
 | 
			
		||||
                        <option [ngValue]="membershipOption.id" *ngFor="let membershipOption of memberships; trackBy: trackMembershipById">{{membershipOption.id}}</option>
 | 
			
		||||
                    </select>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div [hidden]="!(editForm.controls.member?.dirty && editForm.controls.member?.invalid)">
 | 
			
		||||
                    <small class="form-text text-danger"
 | 
			
		||||
                           [hidden]="!editForm.controls.member?.errors?.required"
 | 
			
		||||
                           jhiTranslate="entity.validation.required">
 | 
			
		||||
                        This field is required.
 | 
			
		||||
                    </small>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div>
 | 
			
		||||
                <button type="button" id="cancel-save" class="btn btn-secondary"  (click)="previousState()">
 | 
			
		||||
 
 | 
			
		||||
@@ -64,7 +64,7 @@
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="form-group">
 | 
			
		||||
                    <label class="form-control-label" jhiTranslate="hsadminNgApp.customer.contractualAddress"
 | 
			
		||||
                           for="field_contractualAddress">Contractual Address X</label>
 | 
			
		||||
                           for="field_contractualAddress">Contractual Address</label>
 | 
			
		||||
                    <textarea class="form-control" name="contractualAddress" id="field_contractualAddress" rows="3"
 | 
			
		||||
                              [(ngModel)]="customer.contractualAddress" required maxlength="400"></textarea>
 | 
			
		||||
                    <div [hidden]="!(editForm.controls.contractualAddress?.dirty && editForm.controls.contractualAddress?.invalid)">
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
 | 
			
		||||
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
 | 
			
		||||
import { RouterModule } from '@angular/router';
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
@@ -35,6 +35,58 @@ import { RouterModule } from '@angular/router';
 | 
			
		||||
            {
 | 
			
		||||
                path: 'customer',
 | 
			
		||||
                loadChildren: './customer/customer.module#HsadminNgCustomerModule'
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                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'
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                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: 'membership',
 | 
			
		||||
                loadChildren: './membership/membership.module#HsadminNgMembershipModule'
 | 
			
		||||
            }
 | 
			
		||||
            /* jhipster-needle-add-entity-route - JHipster will add entity modules routes here */
 | 
			
		||||
        ])
 | 
			
		||||
 
 | 
			
		||||
@@ -38,11 +38,19 @@
 | 
			
		||||
 | 
			
		||||
                <div class="form-group">
 | 
			
		||||
                    <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" >
 | 
			
		||||
                        <option [ngValue]="null"></option>
 | 
			
		||||
                    <select class="form-control" id="field_customer" name="customer" [(ngModel)]="membership.customerId"
 | 
			
		||||
                            required>
 | 
			
		||||
                        <option *ngIf="!editForm.value.customer" [ngValue]="null" selected></option>
 | 
			
		||||
                        <option [ngValue]="customerOption.id" *ngFor="let customerOption of customers; trackBy: trackCustomerById">{{customerOption.prefix}}</option>
 | 
			
		||||
                    </select>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div [hidden]="!(editForm.controls.customer?.dirty && editForm.controls.customer?.invalid)">
 | 
			
		||||
                    <small class="form-text text-danger"
 | 
			
		||||
                           [hidden]="!editForm.controls.customer?.errors?.required"
 | 
			
		||||
                           jhiTranslate="entity.validation.required">
 | 
			
		||||
                        This field is required.
 | 
			
		||||
                    </small>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div>
 | 
			
		||||
                <button type="button" id="cancel-save" class="btn btn-secondary"  (click)="previousState()">
 | 
			
		||||
 
 | 
			
		||||
@@ -67,11 +67,18 @@
 | 
			
		||||
 | 
			
		||||
                <div class="form-group">
 | 
			
		||||
                    <label class="form-control-label" jhiTranslate="hsadminNgApp.share.member" for="field_member">Member</label>
 | 
			
		||||
                    <select class="form-control" id="field_member" name="member" [(ngModel)]="share.memberId" >
 | 
			
		||||
                        <option [ngValue]="null"></option>
 | 
			
		||||
                    <select class="form-control" id="field_member" name="member" [(ngModel)]="share.memberId" required>
 | 
			
		||||
                        <option *ngIf="!editForm.value.member" [ngValue]="null" selected></option>
 | 
			
		||||
                        <option [ngValue]="membershipOption.id" *ngFor="let membershipOption of memberships; trackBy: trackMembershipById">{{membershipOption.id}}</option>
 | 
			
		||||
                    </select>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div [hidden]="!(editForm.controls.member?.dirty && editForm.controls.member?.invalid)">
 | 
			
		||||
                    <small class="form-text text-danger"
 | 
			
		||||
                           [hidden]="!editForm.controls.member?.errors?.required"
 | 
			
		||||
                           jhiTranslate="entity.validation.required">
 | 
			
		||||
                        This field is required.
 | 
			
		||||
                    </small>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div>
 | 
			
		||||
                <button type="button" id="cancel-save" class="btn btn-secondary"  (click)="previousState()">
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
import { IMembership } from 'app/shared/model/membership.model';
 | 
			
		||||
import { ICustomerContact } from 'app/shared/model/customer-contact.model';
 | 
			
		||||
import { IMembership } from 'app/shared/model/membership.model';
 | 
			
		||||
 | 
			
		||||
export interface ICustomer {
 | 
			
		||||
    id?: number;
 | 
			
		||||
@@ -10,8 +10,8 @@ export interface ICustomer {
 | 
			
		||||
    contractualSalutation?: string;
 | 
			
		||||
    billingAddress?: string;
 | 
			
		||||
    billingSalutation?: string;
 | 
			
		||||
    memberships?: IMembership[];
 | 
			
		||||
    roles?: ICustomerContact[];
 | 
			
		||||
    memberships?: IMembership[];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export class Customer implements ICustomer {
 | 
			
		||||
@@ -24,7 +24,7 @@ export class Customer implements ICustomer {
 | 
			
		||||
        public contractualSalutation?: string,
 | 
			
		||||
        public billingAddress?: string,
 | 
			
		||||
        public billingSalutation?: string,
 | 
			
		||||
        public memberships?: IMembership[],
 | 
			
		||||
        public roles?: ICustomerContact[]
 | 
			
		||||
        public roles?: ICustomerContact[],
 | 
			
		||||
        public memberships?: IMembership[]
 | 
			
		||||
    ) {}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -22,8 +22,8 @@
 | 
			
		||||
            "contractualSalutation": "Contractual Salutation",
 | 
			
		||||
            "billingAddress": "Billing Address",
 | 
			
		||||
            "billingSalutation": "Billing Salutation",
 | 
			
		||||
            "membership": "Membership",
 | 
			
		||||
            "role": "Role"
 | 
			
		||||
            "role": "Role",
 | 
			
		||||
            "membership": "Membership"
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -22,8 +22,8 @@
 | 
			
		||||
            "contractualSalutation": "Contractual Salutation",
 | 
			
		||||
            "billingAddress": "Billing Address",
 | 
			
		||||
            "billingSalutation": "Billing Salutation",
 | 
			
		||||
            "membership": "Membership",
 | 
			
		||||
            "role": "Role"
 | 
			
		||||
            "role": "Role",
 | 
			
		||||
            "membership": "Membership"
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user