Model customers.

This commit is contained in:
Michael Hierweck 2019-04-17 16:45:43 +02:00
parent bd5bb859d9
commit 7f0dfebaa4
160 changed files with 3911 additions and 5068 deletions

View File

@ -38,11 +38,11 @@
"otherEntityName": "membership", "otherEntityName": "membership",
"otherEntityRelationshipName": "asset", "otherEntityRelationshipName": "asset",
"relationshipValidateRules": "required", "relationshipValidateRules": "required",
"relationshipName": "member", "relationshipName": "membership",
"otherEntityField": "id" "otherEntityField": "from"
} }
], ],
"changelogDate": "20190403083740", "changelogDate": "20190418073046",
"entityTableName": "asset", "entityTableName": "asset",
"dto": "mapstruct", "dto": "mapstruct",
"pagination": "infinite-scroll", "pagination": "infinite-scroll",

View File

@ -1,49 +0,0 @@
{
"name": "Contact",
"fields": [
{
"fieldName": "firstName",
"fieldType": "String",
"fieldValidateRules": [
"required",
"maxlength"
],
"fieldValidateRulesMaxlength": 80
},
{
"fieldName": "lastName",
"fieldType": "String",
"fieldValidateRules": [
"required",
"maxlength"
],
"fieldValidateRulesMaxlength": 80
},
{
"fieldName": "email",
"fieldType": "String",
"fieldValidateRules": [
"required",
"maxlength"
],
"fieldValidateRulesMaxlength": 80
}
],
"relationships": [
{
"relationshipType": "one-to-many",
"otherEntityName": "customerContact",
"otherEntityRelationshipName": "contact",
"relationshipName": "role"
}
],
"changelogDate": "20190403083736",
"entityTableName": "contact",
"dto": "mapstruct",
"pagination": "infinite-scroll",
"service": "serviceClass",
"jpaMetamodelFiltering": true,
"fluentMethods": true,
"clientRootFolder": "",
"applications": "*"
}

View File

@ -32,6 +32,14 @@
], ],
"fieldValidateRulesMaxlength": 80 "fieldValidateRulesMaxlength": 80
}, },
{
"fieldName": "contractualSalutation",
"fieldType": "String",
"fieldValidateRules": [
"maxlength"
],
"fieldValidateRulesMaxlength": 80
},
{ {
"fieldName": "contractualAddress", "fieldName": "contractualAddress",
"fieldType": "String", "fieldType": "String",
@ -42,7 +50,7 @@
"fieldValidateRulesMaxlength": 400 "fieldValidateRulesMaxlength": 400
}, },
{ {
"fieldName": "contractualSalutation", "fieldName": "billingSalutation",
"fieldType": "String", "fieldType": "String",
"fieldValidateRules": [ "fieldValidateRules": [
"maxlength" "maxlength"
@ -56,31 +64,23 @@
"maxlength" "maxlength"
], ],
"fieldValidateRulesMaxlength": 400 "fieldValidateRulesMaxlength": 400
},
{
"fieldName": "billingSalutation",
"fieldType": "String",
"fieldValidateRules": [
"maxlength"
],
"fieldValidateRulesMaxlength": 80
} }
], ],
"relationships": [ "relationships": [
{
"relationshipType": "one-to-many",
"otherEntityName": "customerContact",
"otherEntityRelationshipName": "customer",
"relationshipName": "role"
},
{ {
"relationshipType": "one-to-many", "relationshipType": "one-to-many",
"otherEntityName": "membership", "otherEntityName": "membership",
"otherEntityRelationshipName": "customer", "otherEntityRelationshipName": "customer",
"relationshipName": "membership" "relationshipName": "membership"
},
{
"relationshipType": "one-to-many",
"otherEntityName": "sepaMandate",
"otherEntityRelationshipName": "customer",
"relationshipName": "sepamandate"
} }
], ],
"changelogDate": "20190403083735", "changelogDate": "20190418073043",
"entityTableName": "customer", "entityTableName": "customer",
"dto": "mapstruct", "dto": "mapstruct",
"pagination": "infinite-scroll", "pagination": "infinite-scroll",

View File

@ -1,40 +0,0 @@
{
"name": "CustomerContact",
"fields": [
{
"fieldName": "role",
"fieldType": "CustomerContactRole",
"fieldValues": "CONTRACTUAL,TECHNICAL,FINANCIAL",
"fieldValidateRules": [
"required"
]
}
],
"relationships": [
{
"relationshipType": "many-to-one",
"otherEntityName": "contact",
"otherEntityRelationshipName": "role",
"relationshipValidateRules": "required",
"relationshipName": "contact",
"otherEntityField": "email"
},
{
"relationshipType": "many-to-one",
"otherEntityName": "customer",
"otherEntityRelationshipName": "role",
"relationshipValidateRules": "required",
"relationshipName": "customer",
"otherEntityField": "prefix"
}
],
"changelogDate": "20190403083737",
"entityTableName": "customer_contact",
"dto": "mapstruct",
"pagination": "infinite-scroll",
"service": "serviceClass",
"jpaMetamodelFiltering": true,
"fluentMethods": true,
"clientRootFolder": "",
"applications": "*"
}

View File

@ -2,28 +2,36 @@
"name": "Membership", "name": "Membership",
"fields": [ "fields": [
{ {
"fieldName": "sinceDate", "fieldName": "from",
"fieldType": "LocalDate", "fieldType": "LocalDate",
"fieldValidateRules": [ "fieldValidateRules": [
"required" "required"
] ]
}, },
{ {
"fieldName": "untilDate", "fieldName": "to",
"fieldType": "LocalDate" "fieldType": "LocalDate"
},
{
"fieldName": "comment",
"fieldType": "String",
"fieldValidateRules": [
"maxlength"
],
"fieldValidateRulesMaxlength": 160
} }
], ],
"relationships": [ "relationships": [
{ {
"relationshipType": "one-to-many", "relationshipType": "one-to-many",
"otherEntityName": "share", "otherEntityName": "share",
"otherEntityRelationshipName": "member", "otherEntityRelationshipName": "membership",
"relationshipName": "share" "relationshipName": "share"
}, },
{ {
"relationshipType": "one-to-many", "relationshipType": "one-to-many",
"otherEntityName": "asset", "otherEntityName": "asset",
"otherEntityRelationshipName": "member", "otherEntityRelationshipName": "membership",
"relationshipName": "asset" "relationshipName": "asset"
}, },
{ {
@ -35,7 +43,7 @@
"otherEntityField": "prefix" "otherEntityField": "prefix"
} }
], ],
"changelogDate": "20190403083738", "changelogDate": "20190418073044",
"entityTableName": "membership", "entityTableName": "membership",
"dto": "mapstruct", "dto": "mapstruct",
"pagination": "infinite-scroll", "pagination": "infinite-scroll",

View File

@ -0,0 +1,84 @@
{
"name": "SepaMandate",
"fields": [
{
"fieldName": "reference",
"fieldType": "String",
"fieldValidateRules": [
"maxlength",
"unique",
"required"
],
"fieldValidateRulesMaxlength": 40
},
{
"fieldName": "iban",
"fieldType": "String",
"fieldValidateRules": [
"maxlength"
],
"fieldValidateRulesMaxlength": 34
},
{
"fieldName": "bic",
"fieldType": "String",
"fieldValidateRules": [
"maxlength"
],
"fieldValidateRulesMaxlength": 11
},
{
"fieldName": "created",
"fieldType": "LocalDate",
"fieldValidateRules": [
"required"
]
},
{
"fieldName": "validFrom",
"fieldType": "LocalDate",
"fieldValidateRules": [
"required"
]
},
{
"fieldName": "validTo",
"fieldType": "LocalDate"
},
{
"fieldName": "lastUsed",
"fieldType": "LocalDate"
},
{
"fieldName": "cancelled",
"fieldType": "LocalDate"
},
{
"fieldName": "comment",
"fieldType": "String",
"fieldValidateRules": [
"maxlength"
],
"fieldValidateRulesMaxlength": 160
}
],
"relationships": [
{
"relationshipType": "many-to-one",
"otherEntityName": "customer",
"otherEntityRelationshipName": "sepamandate",
"relationshipValidateRules": "required",
"relationshipName": "customer",
"otherEntityField": "prefix"
}
],
"changelogDate": "20190418073047",
"entityTableName": "sepa_mandate",
"dto": "mapstruct",
"pagination": "infinite-scroll",
"service": "serviceClass",
"jpaMetamodelFiltering": true,
"fluentMethods": true,
"clientRootFolder": "",
"applications": "*"
}

View File

@ -38,11 +38,11 @@
"otherEntityName": "membership", "otherEntityName": "membership",
"otherEntityRelationshipName": "share", "otherEntityRelationshipName": "share",
"relationshipValidateRules": "required", "relationshipValidateRules": "required",
"relationshipName": "member", "relationshipName": "membership",
"otherEntityField": "id" "otherEntityField": "from"
} }
], ],
"changelogDate": "20190403083739", "changelogDate": "20190418073045",
"entityTableName": "share", "entityTableName": "share",
"dto": "mapstruct", "dto": "mapstruct",
"pagination": "infinite-scroll", "pagination": "infinite-scroll",

View File

@ -2,16 +2,17 @@ package org.hostsharing.hsadminng.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.hostsharing.hsadminng.domain.enumeration.AssetAction;
import javax.persistence.*; import javax.persistence.*;
import javax.validation.constraints.NotNull; import javax.validation.constraints.*;
import javax.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.Objects; import java.util.Objects;
import org.hostsharing.hsadminng.domain.enumeration.AssetAction;
/** /**
* A Asset. * A Asset.
*/ */
@ -46,7 +47,7 @@ public class Asset implements Serializable {
@ManyToOne(optional = false) @ManyToOne(optional = false)
@NotNull @NotNull
@JsonIgnoreProperties("assets") @JsonIgnoreProperties("assets")
private Membership member; private Membership membership;
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
public Long getId() { public Long getId() {
@ -109,17 +110,17 @@ public class Asset implements Serializable {
this.comment = comment; this.comment = comment;
} }
public Membership getMember() { public Membership getMembership() {
return member; return membership;
} }
public Asset member(Membership membership) { public Asset membership(Membership membership) {
this.member = membership; this.membership = membership;
return this; return this;
} }
public void setMember(Membership membership) { public void setMembership(Membership membership) {
this.member = membership; this.membership = membership;
} }
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

View File

@ -1,148 +0,0 @@
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;
/**
* A Contact.
*/
@Entity
@Table(name = "contact")
public class Contact implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@NotNull
@Size(max = 80)
@Column(name = "first_name", length = 80, nullable = false)
private String firstName;
@NotNull
@Size(max = 80)
@Column(name = "last_name", length = 80, nullable = false)
private String lastName;
@NotNull
@Size(max = 80)
@Column(name = "email", length = 80, nullable = false)
private String email;
@OneToMany(mappedBy = "contact")
private Set<CustomerContact> roles = new HashSet<>();
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getFirstName() {
return firstName;
}
public Contact firstName(String firstName) {
this.firstName = firstName;
return this;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public Contact lastName(String lastName) {
this.lastName = lastName;
return this;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getEmail() {
return email;
}
public Contact email(String email) {
this.email = email;
return this;
}
public void setEmail(String email) {
this.email = email;
}
public Set<CustomerContact> getRoles() {
return roles;
}
public Contact roles(Set<CustomerContact> customerContacts) {
this.roles = customerContacts;
return this;
}
public Contact addRole(CustomerContact customerContact) {
this.roles.add(customerContact);
customerContact.setContact(this);
return this;
}
public Contact removeRole(CustomerContact customerContact) {
this.roles.remove(customerContact);
customerContact.setContact(null);
return this;
}
public void setRoles(Set<CustomerContact> customerContacts) {
this.roles = customerContacts;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Contact contact = (Contact) o;
if (contact.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), contact.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "Contact{" +
"id=" + getId() +
", firstName='" + getFirstName() + "'" +
", lastName='" + getLastName() + "'" +
", email='" + getEmail() + "'" +
"}";
}
}

View File

@ -1,12 +1,15 @@
package org.hostsharing.hsadminng.domain; package org.hostsharing.hsadminng.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import javax.persistence.*; import javax.persistence.*;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import java.io.Serializable; import java.io.Serializable;
import java.util.HashSet; import java.util.HashSet;
import java.util.Objects;
import java.util.Set; import java.util.Set;
import java.util.Objects;
/** /**
* A Customer. * A Customer.
@ -38,27 +41,27 @@ public class Customer implements Serializable {
@Column(name = "name", length = 80, nullable = false) @Column(name = "name", length = 80, nullable = false)
private String name; private String name;
@Size(max = 80)
@Column(name = "contractual_salutation", length = 80)
private String contractualSalutation;
@NotNull @NotNull
@Size(max = 400) @Size(max = 400)
@Column(name = "contractual_address", length = 400, nullable = false) @Column(name = "contractual_address", length = 400, nullable = false)
private String contractualAddress; private String contractualAddress;
@Size(max = 80) @Size(max = 80)
@Column(name = "contractual_salutation", length = 80) @Column(name = "billing_salutation", length = 80)
private String contractualSalutation; private String billingSalutation;
@Size(max = 400) @Size(max = 400)
@Column(name = "billing_address", length = 400) @Column(name = "billing_address", length = 400)
private String billingAddress; private String billingAddress;
@Size(max = 80)
@Column(name = "billing_salutation", length = 80)
private String billingSalutation;
@OneToMany(mappedBy = "customer")
private Set<CustomerContact> roles = new HashSet<>();
@OneToMany(mappedBy = "customer") @OneToMany(mappedBy = "customer")
private Set<Membership> memberships = new HashSet<>(); private Set<Membership> memberships = new HashSet<>();
@OneToMany(mappedBy = "customer")
private Set<SepaMandate> sepamandates = new HashSet<>();
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
public Long getId() { public Long getId() {
return id; return id;
@ -107,19 +110,6 @@ public class Customer implements Serializable {
this.name = name; this.name = name;
} }
public String getContractualAddress() {
return contractualAddress;
}
public Customer contractualAddress(String contractualAddress) {
this.contractualAddress = contractualAddress;
return this;
}
public void setContractualAddress(String contractualAddress) {
this.contractualAddress = contractualAddress;
}
public String getContractualSalutation() { public String getContractualSalutation() {
return contractualSalutation; return contractualSalutation;
} }
@ -133,17 +123,17 @@ public class Customer implements Serializable {
this.contractualSalutation = contractualSalutation; this.contractualSalutation = contractualSalutation;
} }
public String getBillingAddress() { public String getContractualAddress() {
return billingAddress; return contractualAddress;
} }
public Customer billingAddress(String billingAddress) { public Customer contractualAddress(String contractualAddress) {
this.billingAddress = billingAddress; this.contractualAddress = contractualAddress;
return this; return this;
} }
public void setBillingAddress(String billingAddress) { public void setContractualAddress(String contractualAddress) {
this.billingAddress = billingAddress; this.contractualAddress = contractualAddress;
} }
public String getBillingSalutation() { public String getBillingSalutation() {
@ -159,29 +149,17 @@ public class Customer implements Serializable {
this.billingSalutation = billingSalutation; this.billingSalutation = billingSalutation;
} }
public Set<CustomerContact> getRoles() { public String getBillingAddress() {
return roles; return billingAddress;
} }
public Customer roles(Set<CustomerContact> customerContacts) { public Customer billingAddress(String billingAddress) {
this.roles = customerContacts; this.billingAddress = billingAddress;
return this; return this;
} }
public Customer addRole(CustomerContact customerContact) { public void setBillingAddress(String billingAddress) {
this.roles.add(customerContact); this.billingAddress = billingAddress;
customerContact.setCustomer(this);
return this;
}
public Customer removeRole(CustomerContact customerContact) {
this.roles.remove(customerContact);
customerContact.setCustomer(null);
return this;
}
public void setRoles(Set<CustomerContact> customerContacts) {
this.roles = customerContacts;
} }
public Set<Membership> getMemberships() { public Set<Membership> getMemberships() {
@ -208,6 +186,31 @@ public class Customer implements Serializable {
public void setMemberships(Set<Membership> memberships) { public void setMemberships(Set<Membership> memberships) {
this.memberships = memberships; this.memberships = memberships;
} }
public Set<SepaMandate> getSepamandates() {
return sepamandates;
}
public Customer sepamandates(Set<SepaMandate> sepaMandates) {
this.sepamandates = sepaMandates;
return this;
}
public Customer addSepamandate(SepaMandate sepaMandate) {
this.sepamandates.add(sepaMandate);
sepaMandate.setCustomer(this);
return this;
}
public Customer removeSepamandate(SepaMandate sepaMandate) {
this.sepamandates.remove(sepaMandate);
sepaMandate.setCustomer(null);
return this;
}
public void setSepamandates(Set<SepaMandate> sepaMandates) {
this.sepamandates = sepaMandates;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
@Override @Override
@ -237,10 +240,10 @@ public class Customer implements Serializable {
", number=" + getNumber() + ", number=" + getNumber() +
", prefix='" + getPrefix() + "'" + ", prefix='" + getPrefix() + "'" +
", name='" + getName() + "'" + ", name='" + getName() + "'" +
", contractualAddress='" + getContractualAddress() + "'" +
", contractualSalutation='" + getContractualSalutation() + "'" + ", contractualSalutation='" + getContractualSalutation() + "'" +
", billingAddress='" + getBillingAddress() + "'" + ", contractualAddress='" + getContractualAddress() + "'" +
", billingSalutation='" + getBillingSalutation() + "'" + ", billingSalutation='" + getBillingSalutation() + "'" +
", billingAddress='" + getBillingAddress() + "'" +
"}"; "}";
} }
} }

View File

@ -1,119 +0,0 @@
package org.hostsharing.hsadminng.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Objects;
import org.hostsharing.hsadminng.domain.enumeration.CustomerContactRole;
/**
* A CustomerContact.
*/
@Entity
@Table(name = "customer_contact")
public class CustomerContact implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@NotNull
@Enumerated(EnumType.STRING)
@Column(name = "jhi_role", nullable = false)
private CustomerContactRole role;
@ManyToOne(optional = false)
@NotNull
@JsonIgnoreProperties("roles")
private Contact contact;
@ManyToOne(optional = false)
@NotNull
@JsonIgnoreProperties("roles")
private Customer customer;
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public CustomerContactRole getRole() {
return role;
}
public CustomerContact role(CustomerContactRole role) {
this.role = role;
return this;
}
public void setRole(CustomerContactRole role) {
this.role = role;
}
public Contact getContact() {
return contact;
}
public CustomerContact contact(Contact contact) {
this.contact = contact;
return this;
}
public void setContact(Contact contact) {
this.contact = contact;
}
public Customer getCustomer() {
return customer;
}
public CustomerContact customer(Customer customer) {
this.customer = customer;
return this;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CustomerContact customerContact = (CustomerContact) o;
if (customerContact.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), customerContact.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "CustomerContact{" +
"id=" + getId() +
", role='" + getRole() + "'" +
"}";
}
}

View File

@ -1,15 +1,17 @@
package org.hostsharing.hsadminng.domain; package org.hostsharing.hsadminng.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import javax.persistence.*; import javax.persistence.*;
import javax.validation.constraints.NotNull; import javax.validation.constraints.*;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.HashSet; import java.util.HashSet;
import java.util.Objects;
import java.util.Set; import java.util.Set;
import java.util.Objects;
/** /**
* A Membership. * A Membership.
@ -26,15 +28,19 @@ public class Membership implements Serializable {
private Long id; private Long id;
@NotNull @NotNull
@Column(name = "since_date", nullable = false) @Column(name = "jhi_from", nullable = false)
private LocalDate sinceDate; private LocalDate from;
@Column(name = "until_date") @Column(name = "jhi_to")
private LocalDate untilDate; private LocalDate to;
@OneToMany(mappedBy = "member") @Size(max = 160)
@Column(name = "jhi_comment", length = 160)
private String comment;
@OneToMany(mappedBy = "membership")
private Set<Share> shares = new HashSet<>(); private Set<Share> shares = new HashSet<>();
@OneToMany(mappedBy = "member") @OneToMany(mappedBy = "membership")
private Set<Asset> assets = new HashSet<>(); private Set<Asset> assets = new HashSet<>();
@ManyToOne(optional = false) @ManyToOne(optional = false)
@NotNull @NotNull
@ -50,30 +56,43 @@ public class Membership implements Serializable {
this.id = id; this.id = id;
} }
public LocalDate getSinceDate() { public LocalDate getFrom() {
return sinceDate; return from;
} }
public Membership sinceDate(LocalDate sinceDate) { public Membership from(LocalDate from) {
this.sinceDate = sinceDate; this.from = from;
return this; return this;
} }
public void setSinceDate(LocalDate sinceDate) { public void setFrom(LocalDate from) {
this.sinceDate = sinceDate; this.from = from;
} }
public LocalDate getUntilDate() { public LocalDate getTo() {
return untilDate; return to;
} }
public Membership untilDate(LocalDate untilDate) { public Membership to(LocalDate to) {
this.untilDate = untilDate; this.to = to;
return this; return this;
} }
public void setUntilDate(LocalDate untilDate) { public void setTo(LocalDate to) {
this.untilDate = untilDate; this.to = to;
}
public String getComment() {
return comment;
}
public Membership comment(String comment) {
this.comment = comment;
return this;
}
public void setComment(String comment) {
this.comment = comment;
} }
public Set<Share> getShares() { public Set<Share> getShares() {
@ -87,13 +106,13 @@ public class Membership implements Serializable {
public Membership addShare(Share share) { public Membership addShare(Share share) {
this.shares.add(share); this.shares.add(share);
share.setMember(this); share.setMembership(this);
return this; return this;
} }
public Membership removeShare(Share share) { public Membership removeShare(Share share) {
this.shares.remove(share); this.shares.remove(share);
share.setMember(null); share.setMembership(null);
return this; return this;
} }
@ -112,13 +131,13 @@ public class Membership implements Serializable {
public Membership addAsset(Asset asset) { public Membership addAsset(Asset asset) {
this.assets.add(asset); this.assets.add(asset);
asset.setMember(this); asset.setMembership(this);
return this; return this;
} }
public Membership removeAsset(Asset asset) { public Membership removeAsset(Asset asset) {
this.assets.remove(asset); this.assets.remove(asset);
asset.setMember(null); asset.setMembership(null);
return this; return this;
} }
@ -164,8 +183,9 @@ public class Membership implements Serializable {
public String toString() { public String toString() {
return "Membership{" + return "Membership{" +
"id=" + getId() + "id=" + getId() +
", sinceDate='" + getSinceDate() + "'" + ", from='" + getFrom() + "'" +
", untilDate='" + getUntilDate() + "'" + ", to='" + getTo() + "'" +
", comment='" + getComment() + "'" +
"}"; "}";
} }
} }

View File

@ -0,0 +1,241 @@
package org.hostsharing.hsadminng.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
/**
* A SepaMandate.
*/
@Entity
@Table(name = "sepa_mandate")
public class SepaMandate implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@NotNull
@Size(max = 40)
@Column(name = "reference", length = 40, nullable = false, unique = true)
private String reference;
@Size(max = 34)
@Column(name = "iban", length = 34)
private String iban;
@Size(max = 11)
@Column(name = "bic", length = 11)
private String bic;
@NotNull
@Column(name = "created", nullable = false)
private LocalDate created;
@NotNull
@Column(name = "valid_from", nullable = false)
private LocalDate validFrom;
@Column(name = "valid_to")
private LocalDate validTo;
@Column(name = "last_used")
private LocalDate lastUsed;
@Column(name = "cancelled")
private LocalDate cancelled;
@Size(max = 160)
@Column(name = "jhi_comment", length = 160)
private String comment;
@ManyToOne(optional = false)
@NotNull
@JsonIgnoreProperties("sepamandates")
private Customer customer;
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getReference() {
return reference;
}
public SepaMandate reference(String reference) {
this.reference = reference;
return this;
}
public void setReference(String reference) {
this.reference = reference;
}
public String getIban() {
return iban;
}
public SepaMandate iban(String iban) {
this.iban = iban;
return this;
}
public void setIban(String iban) {
this.iban = iban;
}
public String getBic() {
return bic;
}
public SepaMandate bic(String bic) {
this.bic = bic;
return this;
}
public void setBic(String bic) {
this.bic = bic;
}
public LocalDate getCreated() {
return created;
}
public SepaMandate created(LocalDate created) {
this.created = created;
return this;
}
public void setCreated(LocalDate created) {
this.created = created;
}
public LocalDate getValidFrom() {
return validFrom;
}
public SepaMandate validFrom(LocalDate validFrom) {
this.validFrom = validFrom;
return this;
}
public void setValidFrom(LocalDate validFrom) {
this.validFrom = validFrom;
}
public LocalDate getValidTo() {
return validTo;
}
public SepaMandate validTo(LocalDate validTo) {
this.validTo = validTo;
return this;
}
public void setValidTo(LocalDate validTo) {
this.validTo = validTo;
}
public LocalDate getLastUsed() {
return lastUsed;
}
public SepaMandate lastUsed(LocalDate lastUsed) {
this.lastUsed = lastUsed;
return this;
}
public void setLastUsed(LocalDate lastUsed) {
this.lastUsed = lastUsed;
}
public LocalDate getCancelled() {
return cancelled;
}
public SepaMandate cancelled(LocalDate cancelled) {
this.cancelled = cancelled;
return this;
}
public void setCancelled(LocalDate cancelled) {
this.cancelled = cancelled;
}
public String getComment() {
return comment;
}
public SepaMandate comment(String comment) {
this.comment = comment;
return this;
}
public void setComment(String comment) {
this.comment = comment;
}
public Customer getCustomer() {
return customer;
}
public SepaMandate customer(Customer customer) {
this.customer = customer;
return this;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SepaMandate sepaMandate = (SepaMandate) o;
if (sepaMandate.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), sepaMandate.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "SepaMandate{" +
"id=" + getId() +
", reference='" + getReference() + "'" +
", iban='" + getIban() + "'" +
", bic='" + getBic() + "'" +
", created='" + getCreated() + "'" +
", validFrom='" + getValidFrom() + "'" +
", validTo='" + getValidTo() + "'" +
", lastUsed='" + getLastUsed() + "'" +
", cancelled='" + getCancelled() + "'" +
", comment='" + getComment() + "'" +
"}";
}
}

View File

@ -2,15 +2,16 @@ package org.hostsharing.hsadminng.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.hostsharing.hsadminng.domain.enumeration.ShareAction;
import javax.persistence.*; import javax.persistence.*;
import javax.validation.constraints.NotNull; import javax.validation.constraints.*;
import javax.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.Objects; import java.util.Objects;
import org.hostsharing.hsadminng.domain.enumeration.ShareAction;
/** /**
* A Share. * A Share.
*/ */
@ -45,7 +46,7 @@ public class Share implements Serializable {
@ManyToOne(optional = false) @ManyToOne(optional = false)
@NotNull @NotNull
@JsonIgnoreProperties("shares") @JsonIgnoreProperties("shares")
private Membership member; private Membership membership;
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
public Long getId() { public Long getId() {
@ -108,17 +109,17 @@ public class Share implements Serializable {
this.comment = comment; this.comment = comment;
} }
public Membership getMember() { public Membership getMembership() {
return member; return membership;
} }
public Share member(Membership membership) { public Share membership(Membership membership) {
this.member = membership; this.membership = membership;
return this; return this;
} }
public void setMember(Membership membership) { public void setMembership(Membership membership) {
this.member = membership; this.membership = membership;
} }
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

View File

@ -1,8 +0,0 @@
package org.hostsharing.hsadminng.domain.enumeration;
/**
* The CustomerContactRole enumeration.
*/
public enum CustomerContactRole {
CONTRACTUAL, TECHNICAL, FINANCIAL
}

View File

@ -1,15 +0,0 @@
package org.hostsharing.hsadminng.repository;
import org.hostsharing.hsadminng.domain.Contact;
import org.springframework.data.jpa.repository.*;
import org.springframework.stereotype.Repository;
/**
* Spring Data repository for the Contact entity.
*/
@SuppressWarnings("unused")
@Repository
public interface ContactRepository extends JpaRepository<Contact, Long>, JpaSpecificationExecutor<Contact> {
}

View File

@ -1,15 +0,0 @@
package org.hostsharing.hsadminng.repository;
import org.hostsharing.hsadminng.domain.CustomerContact;
import org.springframework.data.jpa.repository.*;
import org.springframework.stereotype.Repository;
/**
* Spring Data repository for the CustomerContact entity.
*/
@SuppressWarnings("unused")
@Repository
public interface CustomerContactRepository extends JpaRepository<CustomerContact, Long>, JpaSpecificationExecutor<CustomerContact> {
}

View File

@ -0,0 +1,15 @@
package org.hostsharing.hsadminng.repository;
import org.hostsharing.hsadminng.domain.SepaMandate;
import org.springframework.data.jpa.repository.*;
import org.springframework.stereotype.Repository;
/**
* Spring Data repository for the SepaMandate entity.
*/
@SuppressWarnings("unused")
@Repository
public interface SepaMandateRepository extends JpaRepository<SepaMandate, Long>, JpaSpecificationExecutor<SepaMandate> {
}

View File

@ -101,9 +101,9 @@ public class AssetQueryService extends QueryService<Asset> {
if (criteria.getComment() != null) { if (criteria.getComment() != null) {
specification = specification.and(buildStringSpecification(criteria.getComment(), Asset_.comment)); specification = specification.and(buildStringSpecification(criteria.getComment(), Asset_.comment));
} }
if (criteria.getMemberId() != null) { if (criteria.getMembershipId() != null) {
specification = specification.and(buildSpecification(criteria.getMemberId(), specification = specification.and(buildSpecification(criteria.getMembershipId(),
root -> root.join(Asset_.member, JoinType.LEFT).get(Membership_.id))); root -> root.join(Asset_.membership, JoinType.LEFT).get(Membership_.id)));
} }
} }
return specification; return specification;

View File

@ -1,108 +0,0 @@
package org.hostsharing.hsadminng.service;
import java.util.List;
import javax.persistence.criteria.JoinType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
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.Contact;
import org.hostsharing.hsadminng.domain.*; // for static metamodels
import org.hostsharing.hsadminng.repository.ContactRepository;
import org.hostsharing.hsadminng.service.dto.ContactCriteria;
import org.hostsharing.hsadminng.service.dto.ContactDTO;
import org.hostsharing.hsadminng.service.mapper.ContactMapper;
/**
* Service for executing complex queries for Contact entities in the database.
* The main input is a {@link ContactCriteria} which gets converted to {@link Specification},
* in a way that all the filters must apply.
* It returns a {@link List} of {@link ContactDTO} or a {@link Page} of {@link ContactDTO} which fulfills the criteria.
*/
@Service
@Transactional(readOnly = true)
public class ContactQueryService extends QueryService<Contact> {
private final Logger log = LoggerFactory.getLogger(ContactQueryService.class);
private final ContactRepository contactRepository;
private final ContactMapper contactMapper;
public ContactQueryService(ContactRepository contactRepository, ContactMapper contactMapper) {
this.contactRepository = contactRepository;
this.contactMapper = contactMapper;
}
/**
* Return a {@link List} of {@link ContactDTO} which matches the criteria from the database
* @param criteria The object which holds all the filters, which the entities should match.
* @return the matching entities.
*/
@Transactional(readOnly = true)
public List<ContactDTO> findByCriteria(ContactCriteria criteria) {
log.debug("find by criteria : {}", criteria);
final Specification<Contact> specification = createSpecification(criteria);
return contactMapper.toDto(contactRepository.findAll(specification));
}
/**
* Return a {@link Page} of {@link ContactDTO} which matches the criteria from the database
* @param criteria The object which holds all the filters, which the entities should match.
* @param page The page, which should be returned.
* @return the matching entities.
*/
@Transactional(readOnly = true)
public Page<ContactDTO> findByCriteria(ContactCriteria criteria, Pageable page) {
log.debug("find by criteria : {}, page: {}", criteria, page);
final Specification<Contact> specification = createSpecification(criteria);
return contactRepository.findAll(specification, page)
.map(contactMapper::toDto);
}
/**
* Return the number of matching entities in the database
* @param criteria The object which holds all the filters, which the entities should match.
* @return the number of matching entities.
*/
@Transactional(readOnly = true)
public long countByCriteria(ContactCriteria criteria) {
log.debug("count by criteria : {}", criteria);
final Specification<Contact> specification = createSpecification(criteria);
return contactRepository.count(specification);
}
/**
* Function to convert ContactCriteria to a {@link Specification}
*/
private Specification<Contact> createSpecification(ContactCriteria criteria) {
Specification<Contact> specification = Specification.where(null);
if (criteria != null) {
if (criteria.getId() != null) {
specification = specification.and(buildSpecification(criteria.getId(), Contact_.id));
}
if (criteria.getFirstName() != null) {
specification = specification.and(buildStringSpecification(criteria.getFirstName(), Contact_.firstName));
}
if (criteria.getLastName() != null) {
specification = specification.and(buildStringSpecification(criteria.getLastName(), Contact_.lastName));
}
if (criteria.getEmail() != null) {
specification = specification.and(buildStringSpecification(criteria.getEmail(), Contact_.email));
}
if (criteria.getRoleId() != null) {
specification = specification.and(buildSpecification(criteria.getRoleId(),
root -> root.join(Contact_.roles, JoinType.LEFT).get(CustomerContact_.id)));
}
}
return specification;
}
}

View File

@ -1,84 +0,0 @@
package org.hostsharing.hsadminng.service;
import org.hostsharing.hsadminng.domain.Contact;
import org.hostsharing.hsadminng.repository.ContactRepository;
import org.hostsharing.hsadminng.service.dto.ContactDTO;
import org.hostsharing.hsadminng.service.mapper.ContactMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Optional;
/**
* Service Implementation for managing Contact.
*/
@Service
@Transactional
public class ContactService {
private final Logger log = LoggerFactory.getLogger(ContactService.class);
private final ContactRepository contactRepository;
private final ContactMapper contactMapper;
public ContactService(ContactRepository contactRepository, ContactMapper contactMapper) {
this.contactRepository = contactRepository;
this.contactMapper = contactMapper;
}
/**
* Save a contact.
*
* @param contactDTO the entity to save
* @return the persisted entity
*/
public ContactDTO save(ContactDTO contactDTO) {
log.debug("Request to save Contact : {}", contactDTO);
Contact contact = contactMapper.toEntity(contactDTO);
contact = contactRepository.save(contact);
return contactMapper.toDto(contact);
}
/**
* Get all the contacts.
*
* @param pageable the pagination information
* @return the list of entities
*/
@Transactional(readOnly = true)
public Page<ContactDTO> findAll(Pageable pageable) {
log.debug("Request to get all Contacts");
return contactRepository.findAll(pageable)
.map(contactMapper::toDto);
}
/**
* Get one contact by id.
*
* @param id the id of the entity
* @return the entity
*/
@Transactional(readOnly = true)
public Optional<ContactDTO> findOne(Long id) {
log.debug("Request to get Contact : {}", id);
return contactRepository.findById(id)
.map(contactMapper::toDto);
}
/**
* Delete the contact by id.
*
* @param id the id of the entity
*/
public void delete(Long id) {
log.debug("Request to delete Contact : {}", id);
contactRepository.deleteById(id);
}
}

View File

@ -1,106 +0,0 @@
package org.hostsharing.hsadminng.service;
import java.util.List;
import javax.persistence.criteria.JoinType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
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.CustomerContact;
import org.hostsharing.hsadminng.domain.*; // for static metamodels
import org.hostsharing.hsadminng.repository.CustomerContactRepository;
import org.hostsharing.hsadminng.service.dto.CustomerContactCriteria;
import org.hostsharing.hsadminng.service.dto.CustomerContactDTO;
import org.hostsharing.hsadminng.service.mapper.CustomerContactMapper;
/**
* Service for executing complex queries for CustomerContact entities in the database.
* The main input is a {@link CustomerContactCriteria} which gets converted to {@link Specification},
* in a way that all the filters must apply.
* It returns a {@link List} of {@link CustomerContactDTO} or a {@link Page} of {@link CustomerContactDTO} which fulfills the criteria.
*/
@Service
@Transactional(readOnly = true)
public class CustomerContactQueryService extends QueryService<CustomerContact> {
private final Logger log = LoggerFactory.getLogger(CustomerContactQueryService.class);
private final CustomerContactRepository customerContactRepository;
private final CustomerContactMapper customerContactMapper;
public CustomerContactQueryService(CustomerContactRepository customerContactRepository, CustomerContactMapper customerContactMapper) {
this.customerContactRepository = customerContactRepository;
this.customerContactMapper = customerContactMapper;
}
/**
* Return a {@link List} of {@link CustomerContactDTO} which matches the criteria from the database
* @param criteria The object which holds all the filters, which the entities should match.
* @return the matching entities.
*/
@Transactional(readOnly = true)
public List<CustomerContactDTO> findByCriteria(CustomerContactCriteria criteria) {
log.debug("find by criteria : {}", criteria);
final Specification<CustomerContact> specification = createSpecification(criteria);
return customerContactMapper.toDto(customerContactRepository.findAll(specification));
}
/**
* Return a {@link Page} of {@link CustomerContactDTO} which matches the criteria from the database
* @param criteria The object which holds all the filters, which the entities should match.
* @param page The page, which should be returned.
* @return the matching entities.
*/
@Transactional(readOnly = true)
public Page<CustomerContactDTO> findByCriteria(CustomerContactCriteria criteria, Pageable page) {
log.debug("find by criteria : {}, page: {}", criteria, page);
final Specification<CustomerContact> specification = createSpecification(criteria);
return customerContactRepository.findAll(specification, page)
.map(customerContactMapper::toDto);
}
/**
* Return the number of matching entities in the database
* @param criteria The object which holds all the filters, which the entities should match.
* @return the number of matching entities.
*/
@Transactional(readOnly = true)
public long countByCriteria(CustomerContactCriteria criteria) {
log.debug("count by criteria : {}", criteria);
final Specification<CustomerContact> specification = createSpecification(criteria);
return customerContactRepository.count(specification);
}
/**
* Function to convert CustomerContactCriteria to a {@link Specification}
*/
private Specification<CustomerContact> createSpecification(CustomerContactCriteria criteria) {
Specification<CustomerContact> specification = Specification.where(null);
if (criteria != null) {
if (criteria.getId() != null) {
specification = specification.and(buildSpecification(criteria.getId(), CustomerContact_.id));
}
if (criteria.getRole() != null) {
specification = specification.and(buildSpecification(criteria.getRole(), CustomerContact_.role));
}
if (criteria.getContactId() != null) {
specification = specification.and(buildSpecification(criteria.getContactId(),
root -> root.join(CustomerContact_.contact, JoinType.LEFT).get(Contact_.id)));
}
if (criteria.getCustomerId() != null) {
specification = specification.and(buildSpecification(criteria.getCustomerId(),
root -> root.join(CustomerContact_.customer, JoinType.LEFT).get(Customer_.id)));
}
}
return specification;
}
}

View File

@ -1,84 +0,0 @@
package org.hostsharing.hsadminng.service;
import org.hostsharing.hsadminng.domain.CustomerContact;
import org.hostsharing.hsadminng.repository.CustomerContactRepository;
import org.hostsharing.hsadminng.service.dto.CustomerContactDTO;
import org.hostsharing.hsadminng.service.mapper.CustomerContactMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Optional;
/**
* Service Implementation for managing CustomerContact.
*/
@Service
@Transactional
public class CustomerContactService {
private final Logger log = LoggerFactory.getLogger(CustomerContactService.class);
private final CustomerContactRepository customerContactRepository;
private final CustomerContactMapper customerContactMapper;
public CustomerContactService(CustomerContactRepository customerContactRepository, CustomerContactMapper customerContactMapper) {
this.customerContactRepository = customerContactRepository;
this.customerContactMapper = customerContactMapper;
}
/**
* Save a customerContact.
*
* @param customerContactDTO the entity to save
* @return the persisted entity
*/
public CustomerContactDTO save(CustomerContactDTO customerContactDTO) {
log.debug("Request to save CustomerContact : {}", customerContactDTO);
CustomerContact customerContact = customerContactMapper.toEntity(customerContactDTO);
customerContact = customerContactRepository.save(customerContact);
return customerContactMapper.toDto(customerContact);
}
/**
* Get all the customerContacts.
*
* @param pageable the pagination information
* @return the list of entities
*/
@Transactional(readOnly = true)
public Page<CustomerContactDTO> findAll(Pageable pageable) {
log.debug("Request to get all CustomerContacts");
return customerContactRepository.findAll(pageable)
.map(customerContactMapper::toDto);
}
/**
* Get one customerContact by id.
*
* @param id the id of the entity
* @return the entity
*/
@Transactional(readOnly = true)
public Optional<CustomerContactDTO> findOne(Long id) {
log.debug("Request to get CustomerContact : {}", id);
return customerContactRepository.findById(id)
.map(customerContactMapper::toDto);
}
/**
* Delete the customerContact by id.
*
* @param id the id of the entity
*/
public void delete(Long id) {
log.debug("Request to delete CustomerContact : {}", id);
customerContactRepository.deleteById(id);
}
}

View File

@ -1,14 +1,9 @@
package org.hostsharing.hsadminng.service; package org.hostsharing.hsadminng.service;
import io.github.jhipster.service.QueryService; import java.util.List;
import org.hostsharing.hsadminng.domain.Customer;
import org.hostsharing.hsadminng.domain.CustomerContact_; import javax.persistence.criteria.JoinType;
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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
@ -17,8 +12,14 @@ import org.springframework.data.jpa.domain.Specification;
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.criteria.JoinType; import io.github.jhipster.service.QueryService;
import java.util.List;
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;
/** /**
* Service for executing complex queries for Customer entities in the database. * Service for executing complex queries for Customer entities in the database.
@ -97,26 +98,26 @@ public class CustomerQueryService extends QueryService<Customer> {
if (criteria.getName() != null) { if (criteria.getName() != null) {
specification = specification.and(buildStringSpecification(criteria.getName(), Customer_.name)); specification = specification.and(buildStringSpecification(criteria.getName(), Customer_.name));
} }
if (criteria.getContractualAddress() != null) {
specification = specification.and(buildStringSpecification(criteria.getContractualAddress(), Customer_.contractualAddress));
}
if (criteria.getContractualSalutation() != null) { if (criteria.getContractualSalutation() != null) {
specification = specification.and(buildStringSpecification(criteria.getContractualSalutation(), Customer_.contractualSalutation)); specification = specification.and(buildStringSpecification(criteria.getContractualSalutation(), Customer_.contractualSalutation));
} }
if (criteria.getBillingAddress() != null) { if (criteria.getContractualAddress() != null) {
specification = specification.and(buildStringSpecification(criteria.getBillingAddress(), Customer_.billingAddress)); specification = specification.and(buildStringSpecification(criteria.getContractualAddress(), Customer_.contractualAddress));
} }
if (criteria.getBillingSalutation() != null) { if (criteria.getBillingSalutation() != null) {
specification = specification.and(buildStringSpecification(criteria.getBillingSalutation(), Customer_.billingSalutation)); specification = specification.and(buildStringSpecification(criteria.getBillingSalutation(), Customer_.billingSalutation));
} }
if (criteria.getRoleId() != null) { if (criteria.getBillingAddress() != null) {
specification = specification.and(buildSpecification(criteria.getRoleId(), specification = specification.and(buildStringSpecification(criteria.getBillingAddress(), Customer_.billingAddress));
root -> root.join(Customer_.roles, JoinType.LEFT).get(CustomerContact_.id)));
} }
if (criteria.getMembershipId() != null) { if (criteria.getMembershipId() != null) {
specification = specification.and(buildSpecification(criteria.getMembershipId(), specification = specification.and(buildSpecification(criteria.getMembershipId(),
root -> root.join(Customer_.memberships, JoinType.LEFT).get(Membership_.id))); root -> root.join(Customer_.memberships, JoinType.LEFT).get(Membership_.id)));
} }
if (criteria.getSepamandateId() != null) {
specification = specification.and(buildSpecification(criteria.getSepamandateId(),
root -> root.join(Customer_.sepamandates, JoinType.LEFT).get(SepaMandate_.id)));
}
} }
return specification; return specification;
} }

View File

@ -89,11 +89,14 @@ public class MembershipQueryService extends QueryService<Membership> {
if (criteria.getId() != null) { if (criteria.getId() != null) {
specification = specification.and(buildSpecification(criteria.getId(), Membership_.id)); specification = specification.and(buildSpecification(criteria.getId(), Membership_.id));
} }
if (criteria.getSinceDate() != null) { if (criteria.getFrom() != null) {
specification = specification.and(buildRangeSpecification(criteria.getSinceDate(), Membership_.sinceDate)); specification = specification.and(buildRangeSpecification(criteria.getFrom(), Membership_.from));
} }
if (criteria.getUntilDate() != null) { if (criteria.getTo() != null) {
specification = specification.and(buildRangeSpecification(criteria.getUntilDate(), Membership_.untilDate)); specification = specification.and(buildRangeSpecification(criteria.getTo(), Membership_.to));
}
if (criteria.getComment() != null) {
specification = specification.and(buildStringSpecification(criteria.getComment(), Membership_.comment));
} }
if (criteria.getShareId() != null) { if (criteria.getShareId() != null) {
specification = specification.and(buildSpecification(criteria.getShareId(), specification = specification.and(buildSpecification(criteria.getShareId(),

View File

@ -0,0 +1,126 @@
package org.hostsharing.hsadminng.service;
import java.util.List;
import javax.persistence.criteria.JoinType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import io.github.jhipster.service.QueryService;
import org.hostsharing.hsadminng.domain.SepaMandate;
import org.hostsharing.hsadminng.domain.*; // for static metamodels
import org.hostsharing.hsadminng.repository.SepaMandateRepository;
import org.hostsharing.hsadminng.service.dto.SepaMandateCriteria;
import org.hostsharing.hsadminng.service.dto.SepaMandateDTO;
import org.hostsharing.hsadminng.service.mapper.SepaMandateMapper;
/**
* Service for executing complex queries for SepaMandate entities in the database.
* The main input is a {@link SepaMandateCriteria} which gets converted to {@link Specification},
* in a way that all the filters must apply.
* It returns a {@link List} of {@link SepaMandateDTO} or a {@link Page} of {@link SepaMandateDTO} which fulfills the criteria.
*/
@Service
@Transactional(readOnly = true)
public class SepaMandateQueryService extends QueryService<SepaMandate> {
private final Logger log = LoggerFactory.getLogger(SepaMandateQueryService.class);
private final SepaMandateRepository sepaMandateRepository;
private final SepaMandateMapper sepaMandateMapper;
public SepaMandateQueryService(SepaMandateRepository sepaMandateRepository, SepaMandateMapper sepaMandateMapper) {
this.sepaMandateRepository = sepaMandateRepository;
this.sepaMandateMapper = sepaMandateMapper;
}
/**
* Return a {@link List} of {@link SepaMandateDTO} which matches the criteria from the database
* @param criteria The object which holds all the filters, which the entities should match.
* @return the matching entities.
*/
@Transactional(readOnly = true)
public List<SepaMandateDTO> findByCriteria(SepaMandateCriteria criteria) {
log.debug("find by criteria : {}", criteria);
final Specification<SepaMandate> specification = createSpecification(criteria);
return sepaMandateMapper.toDto(sepaMandateRepository.findAll(specification));
}
/**
* Return a {@link Page} of {@link SepaMandateDTO} which matches the criteria from the database
* @param criteria The object which holds all the filters, which the entities should match.
* @param page The page, which should be returned.
* @return the matching entities.
*/
@Transactional(readOnly = true)
public Page<SepaMandateDTO> findByCriteria(SepaMandateCriteria criteria, Pageable page) {
log.debug("find by criteria : {}, page: {}", criteria, page);
final Specification<SepaMandate> specification = createSpecification(criteria);
return sepaMandateRepository.findAll(specification, page)
.map(sepaMandateMapper::toDto);
}
/**
* Return the number of matching entities in the database
* @param criteria The object which holds all the filters, which the entities should match.
* @return the number of matching entities.
*/
@Transactional(readOnly = true)
public long countByCriteria(SepaMandateCriteria criteria) {
log.debug("count by criteria : {}", criteria);
final Specification<SepaMandate> specification = createSpecification(criteria);
return sepaMandateRepository.count(specification);
}
/**
* Function to convert SepaMandateCriteria to a {@link Specification}
*/
private Specification<SepaMandate> createSpecification(SepaMandateCriteria criteria) {
Specification<SepaMandate> specification = Specification.where(null);
if (criteria != null) {
if (criteria.getId() != null) {
specification = specification.and(buildSpecification(criteria.getId(), SepaMandate_.id));
}
if (criteria.getReference() != null) {
specification = specification.and(buildStringSpecification(criteria.getReference(), SepaMandate_.reference));
}
if (criteria.getIban() != null) {
specification = specification.and(buildStringSpecification(criteria.getIban(), SepaMandate_.iban));
}
if (criteria.getBic() != null) {
specification = specification.and(buildStringSpecification(criteria.getBic(), SepaMandate_.bic));
}
if (criteria.getCreated() != null) {
specification = specification.and(buildRangeSpecification(criteria.getCreated(), SepaMandate_.created));
}
if (criteria.getValidFrom() != null) {
specification = specification.and(buildRangeSpecification(criteria.getValidFrom(), SepaMandate_.validFrom));
}
if (criteria.getValidTo() != null) {
specification = specification.and(buildRangeSpecification(criteria.getValidTo(), SepaMandate_.validTo));
}
if (criteria.getLastUsed() != null) {
specification = specification.and(buildRangeSpecification(criteria.getLastUsed(), SepaMandate_.lastUsed));
}
if (criteria.getCancelled() != null) {
specification = specification.and(buildRangeSpecification(criteria.getCancelled(), SepaMandate_.cancelled));
}
if (criteria.getComment() != null) {
specification = specification.and(buildStringSpecification(criteria.getComment(), SepaMandate_.comment));
}
if (criteria.getCustomerId() != null) {
specification = specification.and(buildSpecification(criteria.getCustomerId(),
root -> root.join(SepaMandate_.customer, JoinType.LEFT).get(Customer_.id)));
}
}
return specification;
}
}

View File

@ -0,0 +1,84 @@
package org.hostsharing.hsadminng.service;
import org.hostsharing.hsadminng.domain.SepaMandate;
import org.hostsharing.hsadminng.repository.SepaMandateRepository;
import org.hostsharing.hsadminng.service.dto.SepaMandateDTO;
import org.hostsharing.hsadminng.service.mapper.SepaMandateMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Optional;
/**
* Service Implementation for managing SepaMandate.
*/
@Service
@Transactional
public class SepaMandateService {
private final Logger log = LoggerFactory.getLogger(SepaMandateService.class);
private final SepaMandateRepository sepaMandateRepository;
private final SepaMandateMapper sepaMandateMapper;
public SepaMandateService(SepaMandateRepository sepaMandateRepository, SepaMandateMapper sepaMandateMapper) {
this.sepaMandateRepository = sepaMandateRepository;
this.sepaMandateMapper = sepaMandateMapper;
}
/**
* Save a sepaMandate.
*
* @param sepaMandateDTO the entity to save
* @return the persisted entity
*/
public SepaMandateDTO save(SepaMandateDTO sepaMandateDTO) {
log.debug("Request to save SepaMandate : {}", sepaMandateDTO);
SepaMandate sepaMandate = sepaMandateMapper.toEntity(sepaMandateDTO);
sepaMandate = sepaMandateRepository.save(sepaMandate);
return sepaMandateMapper.toDto(sepaMandate);
}
/**
* Get all the sepaMandates.
*
* @param pageable the pagination information
* @return the list of entities
*/
@Transactional(readOnly = true)
public Page<SepaMandateDTO> findAll(Pageable pageable) {
log.debug("Request to get all SepaMandates");
return sepaMandateRepository.findAll(pageable)
.map(sepaMandateMapper::toDto);
}
/**
* Get one sepaMandate by id.
*
* @param id the id of the entity
* @return the entity
*/
@Transactional(readOnly = true)
public Optional<SepaMandateDTO> findOne(Long id) {
log.debug("Request to get SepaMandate : {}", id);
return sepaMandateRepository.findById(id)
.map(sepaMandateMapper::toDto);
}
/**
* Delete the sepaMandate by id.
*
* @param id the id of the entity
*/
public void delete(Long id) {
log.debug("Request to delete SepaMandate : {}", id);
sepaMandateRepository.deleteById(id);
}
}

View File

@ -101,9 +101,9 @@ public class ShareQueryService extends QueryService<Share> {
if (criteria.getComment() != null) { if (criteria.getComment() != null) {
specification = specification.and(buildStringSpecification(criteria.getComment(), Share_.comment)); specification = specification.and(buildStringSpecification(criteria.getComment(), Share_.comment));
} }
if (criteria.getMemberId() != null) { if (criteria.getMembershipId() != null) {
specification = specification.and(buildSpecification(criteria.getMemberId(), specification = specification.and(buildSpecification(criteria.getMembershipId(),
root -> root.join(Share_.member, JoinType.LEFT).get(Membership_.id))); root -> root.join(Share_.membership, JoinType.LEFT).get(Membership_.id)));
} }
} }
return specification; return specification;

View File

@ -40,7 +40,7 @@ public class AssetCriteria implements Serializable {
private StringFilter comment; private StringFilter comment;
private LongFilter memberId; private LongFilter membershipId;
public LongFilter getId() { public LongFilter getId() {
return id; return id;
@ -82,12 +82,12 @@ public class AssetCriteria implements Serializable {
this.comment = comment; this.comment = comment;
} }
public LongFilter getMemberId() { public LongFilter getMembershipId() {
return memberId; return membershipId;
} }
public void setMemberId(LongFilter memberId) { public void setMembershipId(LongFilter membershipId) {
this.memberId = memberId; this.membershipId = membershipId;
} }
@ -106,7 +106,7 @@ public class AssetCriteria implements Serializable {
Objects.equals(action, that.action) && Objects.equals(action, that.action) &&
Objects.equals(amount, that.amount) && Objects.equals(amount, that.amount) &&
Objects.equals(comment, that.comment) && Objects.equals(comment, that.comment) &&
Objects.equals(memberId, that.memberId); Objects.equals(membershipId, that.membershipId);
} }
@Override @Override
@ -117,7 +117,7 @@ public class AssetCriteria implements Serializable {
action, action,
amount, amount,
comment, comment,
memberId membershipId
); );
} }
@ -129,7 +129,7 @@ public class AssetCriteria implements Serializable {
(action != null ? "action=" + action + ", " : "") + (action != null ? "action=" + action + ", " : "") +
(amount != null ? "amount=" + amount + ", " : "") + (amount != null ? "amount=" + amount + ", " : "") +
(comment != null ? "comment=" + comment + ", " : "") + (comment != null ? "comment=" + comment + ", " : "") +
(memberId != null ? "memberId=" + memberId + ", " : "") + (membershipId != null ? "membershipId=" + membershipId + ", " : "") +
"}"; "}";
} }

View File

@ -26,7 +26,9 @@ public class AssetDTO implements Serializable {
private String comment; private String comment;
private Long memberId; private Long membershipId;
private String membershipFrom;
public Long getId() { public Long getId() {
return id; return id;
@ -68,12 +70,20 @@ public class AssetDTO implements Serializable {
this.comment = comment; this.comment = comment;
} }
public Long getMemberId() { public Long getMembershipId() {
return memberId; return membershipId;
} }
public void setMemberId(Long membershipId) { public void setMembershipId(Long membershipId) {
this.memberId = membershipId; this.membershipId = membershipId;
}
public String getMembershipFrom() {
return membershipFrom;
}
public void setMembershipFrom(String membershipFrom) {
this.membershipFrom = membershipFrom;
} }
@Override @Override
@ -105,7 +115,8 @@ public class AssetDTO implements Serializable {
", action='" + getAction() + "'" + ", action='" + getAction() + "'" +
", amount=" + getAmount() + ", amount=" + getAmount() +
", comment='" + getComment() + "'" + ", comment='" + getComment() + "'" +
", member=" + getMemberId() + ", membership=" + getMembershipId() +
", membership='" + getMembershipFrom() + "'" +
"}"; "}";
} }
} }

View File

@ -1,115 +0,0 @@
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;
/**
* Criteria class for the Contact entity. This class is used in ContactResource to
* receive all the possible filtering options from the Http GET request parameters.
* For example the following could be a valid requests:
* <code> /contacts?id.greaterThan=5&amp;attr1.contains=something&amp;attr2.specified=false</code>
* As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use
* fix type specific filters.
*/
public class ContactCriteria implements Serializable {
private static final long serialVersionUID = 1L;
private LongFilter id;
private StringFilter firstName;
private StringFilter lastName;
private StringFilter email;
private LongFilter roleId;
public LongFilter getId() {
return id;
}
public void setId(LongFilter id) {
this.id = id;
}
public StringFilter getFirstName() {
return firstName;
}
public void setFirstName(StringFilter firstName) {
this.firstName = firstName;
}
public StringFilter getLastName() {
return lastName;
}
public void setLastName(StringFilter lastName) {
this.lastName = lastName;
}
public StringFilter getEmail() {
return email;
}
public void setEmail(StringFilter email) {
this.email = email;
}
public LongFilter getRoleId() {
return roleId;
}
public void setRoleId(LongFilter roleId) {
this.roleId = roleId;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final ContactCriteria that = (ContactCriteria) o;
return
Objects.equals(id, that.id) &&
Objects.equals(firstName, that.firstName) &&
Objects.equals(lastName, that.lastName) &&
Objects.equals(email, that.email) &&
Objects.equals(roleId, that.roleId);
}
@Override
public int hashCode() {
return Objects.hash(
id,
firstName,
lastName,
email,
roleId
);
}
@Override
public String toString() {
return "ContactCriteria{" +
(id != null ? "id=" + id + ", " : "") +
(firstName != null ? "firstName=" + firstName + ", " : "") +
(lastName != null ? "lastName=" + lastName + ", " : "") +
(email != null ? "email=" + email + ", " : "") +
(roleId != null ? "roleId=" + roleId + ", " : "") +
"}";
}
}

View File

@ -1,88 +0,0 @@
package org.hostsharing.hsadminng.service.dto;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Objects;
/**
* A DTO for the Contact entity.
*/
public class ContactDTO implements Serializable {
private Long id;
@NotNull
@Size(max = 80)
private String firstName;
@NotNull
@Size(max = 80)
private String lastName;
@NotNull
@Size(max = 80)
private String email;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ContactDTO contactDTO = (ContactDTO) o;
if (contactDTO.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), contactDTO.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "ContactDTO{" +
"id=" + getId() +
", firstName='" + getFirstName() + "'" +
", lastName='" + getLastName() + "'" +
", email='" + getEmail() + "'" +
"}";
}
}

View File

@ -1,108 +0,0 @@
package org.hostsharing.hsadminng.service.dto;
import java.io.Serializable;
import java.util.Objects;
import org.hostsharing.hsadminng.domain.enumeration.CustomerContactRole;
import io.github.jhipster.service.filter.BooleanFilter;
import io.github.jhipster.service.filter.DoubleFilter;
import io.github.jhipster.service.filter.Filter;
import io.github.jhipster.service.filter.FloatFilter;
import io.github.jhipster.service.filter.IntegerFilter;
import io.github.jhipster.service.filter.LongFilter;
import io.github.jhipster.service.filter.StringFilter;
/**
* Criteria class for the CustomerContact entity. This class is used in CustomerContactResource to
* receive all the possible filtering options from the Http GET request parameters.
* For example the following could be a valid requests:
* <code> /customer-contacts?id.greaterThan=5&amp;attr1.contains=something&amp;attr2.specified=false</code>
* As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use
* fix type specific filters.
*/
public class CustomerContactCriteria implements Serializable {
/**
* Class for filtering CustomerContactRole
*/
public static class CustomerContactRoleFilter extends Filter<CustomerContactRole> {
}
private static final long serialVersionUID = 1L;
private LongFilter id;
private CustomerContactRoleFilter role;
private LongFilter contactId;
private LongFilter customerId;
public LongFilter getId() {
return id;
}
public void setId(LongFilter id) {
this.id = id;
}
public CustomerContactRoleFilter getRole() {
return role;
}
public void setRole(CustomerContactRoleFilter role) {
this.role = role;
}
public LongFilter getContactId() {
return contactId;
}
public void setContactId(LongFilter contactId) {
this.contactId = contactId;
}
public LongFilter getCustomerId() {
return customerId;
}
public void setCustomerId(LongFilter customerId) {
this.customerId = customerId;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final CustomerContactCriteria that = (CustomerContactCriteria) o;
return
Objects.equals(id, that.id) &&
Objects.equals(role, that.role) &&
Objects.equals(contactId, that.contactId) &&
Objects.equals(customerId, that.customerId);
}
@Override
public int hashCode() {
return Objects.hash(
id,
role,
contactId,
customerId
);
}
@Override
public String toString() {
return "CustomerContactCriteria{" +
(id != null ? "id=" + id + ", " : "") +
(role != null ? "role=" + role + ", " : "") +
(contactId != null ? "contactId=" + contactId + ", " : "") +
(customerId != null ? "customerId=" + customerId + ", " : "") +
"}";
}
}

View File

@ -1,106 +0,0 @@
package org.hostsharing.hsadminng.service.dto;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Objects;
import org.hostsharing.hsadminng.domain.enumeration.CustomerContactRole;
/**
* A DTO for the CustomerContact entity.
*/
public class CustomerContactDTO implements Serializable {
private Long id;
@NotNull
private CustomerContactRole role;
private Long contactId;
private String contactEmail;
private Long customerId;
private String customerPrefix;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public CustomerContactRole getRole() {
return role;
}
public void setRole(CustomerContactRole role) {
this.role = role;
}
public Long getContactId() {
return contactId;
}
public void setContactId(Long contactId) {
this.contactId = contactId;
}
public String getContactEmail() {
return contactEmail;
}
public void setContactEmail(String contactEmail) {
this.contactEmail = contactEmail;
}
public Long getCustomerId() {
return customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
public String getCustomerPrefix() {
return customerPrefix;
}
public void setCustomerPrefix(String customerPrefix) {
this.customerPrefix = customerPrefix;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CustomerContactDTO customerContactDTO = (CustomerContactDTO) o;
if (customerContactDTO.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), customerContactDTO.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "CustomerContactDTO{" +
"id=" + getId() +
", role='" + getRole() + "'" +
", contact=" + getContactId() +
", contact='" + getContactEmail() + "'" +
", customer=" + getCustomerId() +
", customer='" + getCustomerPrefix() + "'" +
"}";
}
}

View File

@ -1,12 +1,14 @@
package org.hostsharing.hsadminng.service.dto; package org.hostsharing.hsadminng.service.dto;
import io.github.jhipster.service.filter.Filter;
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.io.Serializable;
import java.util.Objects; import java.util.Objects;
import io.github.jhipster.service.filter.BooleanFilter;
import io.github.jhipster.service.filter.DoubleFilter;
import io.github.jhipster.service.filter.Filter;
import io.github.jhipster.service.filter.FloatFilter;
import io.github.jhipster.service.filter.IntegerFilter;
import io.github.jhipster.service.filter.LongFilter;
import io.github.jhipster.service.filter.StringFilter;
/** /**
* Criteria class for the Customer entity. This class is used in CustomerResource to * Criteria class for the Customer entity. This class is used in CustomerResource to
@ -28,18 +30,18 @@ public class CustomerCriteria implements Serializable {
private StringFilter name; private StringFilter name;
private StringFilter contractualAddress;
private StringFilter contractualSalutation; private StringFilter contractualSalutation;
private StringFilter billingAddress; private StringFilter contractualAddress;
private StringFilter billingSalutation; private StringFilter billingSalutation;
private LongFilter roleId; private StringFilter billingAddress;
private LongFilter membershipId; private LongFilter membershipId;
private LongFilter sepamandateId;
public LongFilter getId() { public LongFilter getId() {
return id; return id;
} }
@ -72,14 +74,6 @@ public class CustomerCriteria implements Serializable {
this.name = name; this.name = name;
} }
public StringFilter getContractualAddress() {
return contractualAddress;
}
public void setContractualAddress(StringFilter contractualAddress) {
this.contractualAddress = contractualAddress;
}
public StringFilter getContractualSalutation() { public StringFilter getContractualSalutation() {
return contractualSalutation; return contractualSalutation;
} }
@ -88,12 +82,12 @@ public class CustomerCriteria implements Serializable {
this.contractualSalutation = contractualSalutation; this.contractualSalutation = contractualSalutation;
} }
public StringFilter getBillingAddress() { public StringFilter getContractualAddress() {
return billingAddress; return contractualAddress;
} }
public void setBillingAddress(StringFilter billingAddress) { public void setContractualAddress(StringFilter contractualAddress) {
this.billingAddress = billingAddress; this.contractualAddress = contractualAddress;
} }
public StringFilter getBillingSalutation() { public StringFilter getBillingSalutation() {
@ -104,12 +98,12 @@ public class CustomerCriteria implements Serializable {
this.billingSalutation = billingSalutation; this.billingSalutation = billingSalutation;
} }
public LongFilter getRoleId() { public StringFilter getBillingAddress() {
return roleId; return billingAddress;
} }
public void setRoleId(LongFilter roleId) { public void setBillingAddress(StringFilter billingAddress) {
this.roleId = roleId; this.billingAddress = billingAddress;
} }
public LongFilter getMembershipId() { public LongFilter getMembershipId() {
@ -120,6 +114,14 @@ public class CustomerCriteria implements Serializable {
this.membershipId = membershipId; this.membershipId = membershipId;
} }
public LongFilter getSepamandateId() {
return sepamandateId;
}
public void setSepamandateId(LongFilter sepamandateId) {
this.sepamandateId = sepamandateId;
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
@ -135,12 +137,12 @@ public class CustomerCriteria implements Serializable {
Objects.equals(number, that.number) && Objects.equals(number, that.number) &&
Objects.equals(prefix, that.prefix) && Objects.equals(prefix, that.prefix) &&
Objects.equals(name, that.name) && Objects.equals(name, that.name) &&
Objects.equals(contractualAddress, that.contractualAddress) &&
Objects.equals(contractualSalutation, that.contractualSalutation) && Objects.equals(contractualSalutation, that.contractualSalutation) &&
Objects.equals(billingAddress, that.billingAddress) && Objects.equals(contractualAddress, that.contractualAddress) &&
Objects.equals(billingSalutation, that.billingSalutation) && Objects.equals(billingSalutation, that.billingSalutation) &&
Objects.equals(roleId, that.roleId) && Objects.equals(billingAddress, that.billingAddress) &&
Objects.equals(membershipId, that.membershipId); Objects.equals(membershipId, that.membershipId) &&
Objects.equals(sepamandateId, that.sepamandateId);
} }
@Override @Override
@ -150,12 +152,12 @@ public class CustomerCriteria implements Serializable {
number, number,
prefix, prefix,
name, name,
contractualAddress,
contractualSalutation, contractualSalutation,
billingAddress, contractualAddress,
billingSalutation, billingSalutation,
roleId, billingAddress,
membershipId membershipId,
sepamandateId
); );
} }
@ -166,12 +168,12 @@ public class CustomerCriteria implements Serializable {
(number != null ? "number=" + number + ", " : "") + (number != null ? "number=" + number + ", " : "") +
(prefix != null ? "prefix=" + prefix + ", " : "") + (prefix != null ? "prefix=" + prefix + ", " : "") +
(name != null ? "name=" + name + ", " : "") + (name != null ? "name=" + name + ", " : "") +
(contractualAddress != null ? "contractualAddress=" + contractualAddress + ", " : "") +
(contractualSalutation != null ? "contractualSalutation=" + contractualSalutation + ", " : "") + (contractualSalutation != null ? "contractualSalutation=" + contractualSalutation + ", " : "") +
(billingAddress != null ? "billingAddress=" + billingAddress + ", " : "") + (contractualAddress != null ? "contractualAddress=" + contractualAddress + ", " : "") +
(billingSalutation != null ? "billingSalutation=" + billingSalutation + ", " : "") + (billingSalutation != null ? "billingSalutation=" + billingSalutation + ", " : "") +
(roleId != null ? "roleId=" + roleId + ", " : "") + (billingAddress != null ? "billingAddress=" + billingAddress + ", " : "") +
(membershipId != null ? "membershipId=" + membershipId + ", " : "") + (membershipId != null ? "membershipId=" + membershipId + ", " : "") +
(sepamandateId != null ? "sepamandateId=" + sepamandateId + ", " : "") +
"}"; "}";
} }

View File

@ -23,19 +23,19 @@ public class CustomerDTO implements Serializable {
@Size(max = 80) @Size(max = 80)
private String name; private String name;
@Size(max = 80)
private String contractualSalutation;
@NotNull @NotNull
@Size(max = 400) @Size(max = 400)
private String contractualAddress; private String contractualAddress;
@Size(max = 80) @Size(max = 80)
private String contractualSalutation; private String billingSalutation;
@Size(max = 400) @Size(max = 400)
private String billingAddress; private String billingAddress;
@Size(max = 80)
private String billingSalutation;
public Long getId() { public Long getId() {
return id; return id;
@ -69,14 +69,6 @@ public class CustomerDTO implements Serializable {
this.name = name; this.name = name;
} }
public String getContractualAddress() {
return contractualAddress;
}
public void setContractualAddress(String contractualAddress) {
this.contractualAddress = contractualAddress;
}
public String getContractualSalutation() { public String getContractualSalutation() {
return contractualSalutation; return contractualSalutation;
} }
@ -85,12 +77,12 @@ public class CustomerDTO implements Serializable {
this.contractualSalutation = contractualSalutation; this.contractualSalutation = contractualSalutation;
} }
public String getBillingAddress() { public String getContractualAddress() {
return billingAddress; return contractualAddress;
} }
public void setBillingAddress(String billingAddress) { public void setContractualAddress(String contractualAddress) {
this.billingAddress = billingAddress; this.contractualAddress = contractualAddress;
} }
public String getBillingSalutation() { public String getBillingSalutation() {
@ -101,6 +93,14 @@ public class CustomerDTO implements Serializable {
this.billingSalutation = billingSalutation; this.billingSalutation = billingSalutation;
} }
public String getBillingAddress() {
return billingAddress;
}
public void setBillingAddress(String billingAddress) {
this.billingAddress = billingAddress;
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) { if (this == o) {
@ -129,10 +129,10 @@ public class CustomerDTO implements Serializable {
", number=" + getNumber() + ", number=" + getNumber() +
", prefix='" + getPrefix() + "'" + ", prefix='" + getPrefix() + "'" +
", name='" + getName() + "'" + ", name='" + getName() + "'" +
", contractualAddress='" + getContractualAddress() + "'" +
", contractualSalutation='" + getContractualSalutation() + "'" + ", contractualSalutation='" + getContractualSalutation() + "'" +
", billingAddress='" + getBillingAddress() + "'" + ", contractualAddress='" + getContractualAddress() + "'" +
", billingSalutation='" + getBillingSalutation() + "'" + ", billingSalutation='" + getBillingSalutation() + "'" +
", billingAddress='" + getBillingAddress() + "'" +
"}"; "}";
} }
} }

View File

@ -25,9 +25,11 @@ public class MembershipCriteria implements Serializable {
private LongFilter id; private LongFilter id;
private LocalDateFilter sinceDate; private LocalDateFilter from;
private LocalDateFilter untilDate; private LocalDateFilter to;
private StringFilter comment;
private LongFilter shareId; private LongFilter shareId;
@ -43,20 +45,28 @@ public class MembershipCriteria implements Serializable {
this.id = id; this.id = id;
} }
public LocalDateFilter getSinceDate() { public LocalDateFilter getFrom() {
return sinceDate; return from;
} }
public void setSinceDate(LocalDateFilter sinceDate) { public void setFrom(LocalDateFilter from) {
this.sinceDate = sinceDate; this.from = from;
} }
public LocalDateFilter getUntilDate() { public LocalDateFilter getTo() {
return untilDate; return to;
} }
public void setUntilDate(LocalDateFilter untilDate) { public void setTo(LocalDateFilter to) {
this.untilDate = untilDate; this.to = to;
}
public StringFilter getComment() {
return comment;
}
public void setComment(StringFilter comment) {
this.comment = comment;
} }
public LongFilter getShareId() { public LongFilter getShareId() {
@ -95,8 +105,9 @@ public class MembershipCriteria implements Serializable {
final MembershipCriteria that = (MembershipCriteria) o; final MembershipCriteria that = (MembershipCriteria) o;
return return
Objects.equals(id, that.id) && Objects.equals(id, that.id) &&
Objects.equals(sinceDate, that.sinceDate) && Objects.equals(from, that.from) &&
Objects.equals(untilDate, that.untilDate) && Objects.equals(to, that.to) &&
Objects.equals(comment, that.comment) &&
Objects.equals(shareId, that.shareId) && Objects.equals(shareId, that.shareId) &&
Objects.equals(assetId, that.assetId) && Objects.equals(assetId, that.assetId) &&
Objects.equals(customerId, that.customerId); Objects.equals(customerId, that.customerId);
@ -106,8 +117,9 @@ public class MembershipCriteria implements Serializable {
public int hashCode() { public int hashCode() {
return Objects.hash( return Objects.hash(
id, id,
sinceDate, from,
untilDate, to,
comment,
shareId, shareId,
assetId, assetId,
customerId customerId
@ -118,8 +130,9 @@ public class MembershipCriteria implements Serializable {
public String toString() { public String toString() {
return "MembershipCriteria{" + return "MembershipCriteria{" +
(id != null ? "id=" + id + ", " : "") + (id != null ? "id=" + id + ", " : "") +
(sinceDate != null ? "sinceDate=" + sinceDate + ", " : "") + (from != null ? "from=" + from + ", " : "") +
(untilDate != null ? "untilDate=" + untilDate + ", " : "") + (to != null ? "to=" + to + ", " : "") +
(comment != null ? "comment=" + comment + ", " : "") +
(shareId != null ? "shareId=" + shareId + ", " : "") + (shareId != null ? "shareId=" + shareId + ", " : "") +
(assetId != null ? "assetId=" + assetId + ", " : "") + (assetId != null ? "assetId=" + assetId + ", " : "") +
(customerId != null ? "customerId=" + customerId + ", " : "") + (customerId != null ? "customerId=" + customerId + ", " : "") +

View File

@ -12,9 +12,12 @@ public class MembershipDTO implements Serializable {
private Long id; private Long id;
@NotNull @NotNull
private LocalDate sinceDate; private LocalDate from;
private LocalDate untilDate; private LocalDate to;
@Size(max = 160)
private String comment;
private Long customerId; private Long customerId;
@ -29,20 +32,28 @@ public class MembershipDTO implements Serializable {
this.id = id; this.id = id;
} }
public LocalDate getSinceDate() { public LocalDate getFrom() {
return sinceDate; return from;
} }
public void setSinceDate(LocalDate sinceDate) { public void setFrom(LocalDate from) {
this.sinceDate = sinceDate; this.from = from;
} }
public LocalDate getUntilDate() { public LocalDate getTo() {
return untilDate; return to;
} }
public void setUntilDate(LocalDate untilDate) { public void setTo(LocalDate to) {
this.untilDate = untilDate; this.to = to;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
} }
public Long getCustomerId() { public Long getCustomerId() {
@ -86,8 +97,9 @@ public class MembershipDTO implements Serializable {
public String toString() { public String toString() {
return "MembershipDTO{" + return "MembershipDTO{" +
"id=" + getId() + "id=" + getId() +
", sinceDate='" + getSinceDate() + "'" + ", from='" + getFrom() + "'" +
", untilDate='" + getUntilDate() + "'" + ", to='" + getTo() + "'" +
", comment='" + getComment() + "'" +
", customer=" + getCustomerId() + ", customer=" + getCustomerId() +
", customer='" + getCustomerPrefix() + "'" + ", customer='" + getCustomerPrefix() + "'" +
"}"; "}";

View File

@ -0,0 +1,194 @@
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 io.github.jhipster.service.filter.LocalDateFilter;
/**
* Criteria class for the SepaMandate entity. This class is used in SepaMandateResource to
* receive all the possible filtering options from the Http GET request parameters.
* For example the following could be a valid requests:
* <code> /sepa-mandates?id.greaterThan=5&amp;attr1.contains=something&amp;attr2.specified=false</code>
* As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use
* fix type specific filters.
*/
public class SepaMandateCriteria implements Serializable {
private static final long serialVersionUID = 1L;
private LongFilter id;
private StringFilter reference;
private StringFilter iban;
private StringFilter bic;
private LocalDateFilter created;
private LocalDateFilter validFrom;
private LocalDateFilter validTo;
private LocalDateFilter lastUsed;
private LocalDateFilter cancelled;
private StringFilter comment;
private LongFilter customerId;
public LongFilter getId() {
return id;
}
public void setId(LongFilter id) {
this.id = id;
}
public StringFilter getReference() {
return reference;
}
public void setReference(StringFilter reference) {
this.reference = reference;
}
public StringFilter getIban() {
return iban;
}
public void setIban(StringFilter iban) {
this.iban = iban;
}
public StringFilter getBic() {
return bic;
}
public void setBic(StringFilter bic) {
this.bic = bic;
}
public LocalDateFilter getCreated() {
return created;
}
public void setCreated(LocalDateFilter created) {
this.created = created;
}
public LocalDateFilter getValidFrom() {
return validFrom;
}
public void setValidFrom(LocalDateFilter validFrom) {
this.validFrom = validFrom;
}
public LocalDateFilter getValidTo() {
return validTo;
}
public void setValidTo(LocalDateFilter validTo) {
this.validTo = validTo;
}
public LocalDateFilter getLastUsed() {
return lastUsed;
}
public void setLastUsed(LocalDateFilter lastUsed) {
this.lastUsed = lastUsed;
}
public LocalDateFilter getCancelled() {
return cancelled;
}
public void setCancelled(LocalDateFilter cancelled) {
this.cancelled = cancelled;
}
public StringFilter getComment() {
return comment;
}
public void setComment(StringFilter comment) {
this.comment = comment;
}
public LongFilter getCustomerId() {
return customerId;
}
public void setCustomerId(LongFilter customerId) {
this.customerId = customerId;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final SepaMandateCriteria that = (SepaMandateCriteria) o;
return
Objects.equals(id, that.id) &&
Objects.equals(reference, that.reference) &&
Objects.equals(iban, that.iban) &&
Objects.equals(bic, that.bic) &&
Objects.equals(created, that.created) &&
Objects.equals(validFrom, that.validFrom) &&
Objects.equals(validTo, that.validTo) &&
Objects.equals(lastUsed, that.lastUsed) &&
Objects.equals(cancelled, that.cancelled) &&
Objects.equals(comment, that.comment) &&
Objects.equals(customerId, that.customerId);
}
@Override
public int hashCode() {
return Objects.hash(
id,
reference,
iban,
bic,
created,
validFrom,
validTo,
lastUsed,
cancelled,
comment,
customerId
);
}
@Override
public String toString() {
return "SepaMandateCriteria{" +
(id != null ? "id=" + id + ", " : "") +
(reference != null ? "reference=" + reference + ", " : "") +
(iban != null ? "iban=" + iban + ", " : "") +
(bic != null ? "bic=" + bic + ", " : "") +
(created != null ? "created=" + created + ", " : "") +
(validFrom != null ? "validFrom=" + validFrom + ", " : "") +
(validTo != null ? "validTo=" + validTo + ", " : "") +
(lastUsed != null ? "lastUsed=" + lastUsed + ", " : "") +
(cancelled != null ? "cancelled=" + cancelled + ", " : "") +
(comment != null ? "comment=" + comment + ", " : "") +
(customerId != null ? "customerId=" + customerId + ", " : "") +
"}";
}
}

View File

@ -0,0 +1,178 @@
package org.hostsharing.hsadminng.service.dto;
import java.time.LocalDate;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Objects;
/**
* A DTO for the SepaMandate entity.
*/
public class SepaMandateDTO implements Serializable {
private Long id;
@NotNull
@Size(max = 40)
private String reference;
@Size(max = 34)
private String iban;
@Size(max = 11)
private String bic;
@NotNull
private LocalDate created;
@NotNull
private LocalDate validFrom;
private LocalDate validTo;
private LocalDate lastUsed;
private LocalDate cancelled;
@Size(max = 160)
private String comment;
private Long customerId;
private String customerPrefix;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getReference() {
return reference;
}
public void setReference(String reference) {
this.reference = reference;
}
public String getIban() {
return iban;
}
public void setIban(String iban) {
this.iban = iban;
}
public String getBic() {
return bic;
}
public void setBic(String bic) {
this.bic = bic;
}
public LocalDate getCreated() {
return created;
}
public void setCreated(LocalDate created) {
this.created = created;
}
public LocalDate getValidFrom() {
return validFrom;
}
public void setValidFrom(LocalDate validFrom) {
this.validFrom = validFrom;
}
public LocalDate getValidTo() {
return validTo;
}
public void setValidTo(LocalDate validTo) {
this.validTo = validTo;
}
public LocalDate getLastUsed() {
return lastUsed;
}
public void setLastUsed(LocalDate lastUsed) {
this.lastUsed = lastUsed;
}
public LocalDate getCancelled() {
return cancelled;
}
public void setCancelled(LocalDate cancelled) {
this.cancelled = cancelled;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
public Long getCustomerId() {
return customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
public String getCustomerPrefix() {
return customerPrefix;
}
public void setCustomerPrefix(String customerPrefix) {
this.customerPrefix = customerPrefix;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SepaMandateDTO sepaMandateDTO = (SepaMandateDTO) o;
if (sepaMandateDTO.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), sepaMandateDTO.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "SepaMandateDTO{" +
"id=" + getId() +
", reference='" + getReference() + "'" +
", iban='" + getIban() + "'" +
", bic='" + getBic() + "'" +
", created='" + getCreated() + "'" +
", validFrom='" + getValidFrom() + "'" +
", validTo='" + getValidTo() + "'" +
", lastUsed='" + getLastUsed() + "'" +
", cancelled='" + getCancelled() + "'" +
", comment='" + getComment() + "'" +
", customer=" + getCustomerId() +
", customer='" + getCustomerPrefix() + "'" +
"}";
}
}

View File

@ -39,7 +39,7 @@ public class ShareCriteria implements Serializable {
private StringFilter comment; private StringFilter comment;
private LongFilter memberId; private LongFilter membershipId;
public LongFilter getId() { public LongFilter getId() {
return id; return id;
@ -81,12 +81,12 @@ public class ShareCriteria implements Serializable {
this.comment = comment; this.comment = comment;
} }
public LongFilter getMemberId() { public LongFilter getMembershipId() {
return memberId; return membershipId;
} }
public void setMemberId(LongFilter memberId) { public void setMembershipId(LongFilter membershipId) {
this.memberId = memberId; this.membershipId = membershipId;
} }
@ -105,7 +105,7 @@ public class ShareCriteria implements Serializable {
Objects.equals(action, that.action) && Objects.equals(action, that.action) &&
Objects.equals(quantity, that.quantity) && Objects.equals(quantity, that.quantity) &&
Objects.equals(comment, that.comment) && Objects.equals(comment, that.comment) &&
Objects.equals(memberId, that.memberId); Objects.equals(membershipId, that.membershipId);
} }
@Override @Override
@ -116,7 +116,7 @@ public class ShareCriteria implements Serializable {
action, action,
quantity, quantity,
comment, comment,
memberId membershipId
); );
} }
@ -128,7 +128,7 @@ public class ShareCriteria implements Serializable {
(action != null ? "action=" + action + ", " : "") + (action != null ? "action=" + action + ", " : "") +
(quantity != null ? "quantity=" + quantity + ", " : "") + (quantity != null ? "quantity=" + quantity + ", " : "") +
(comment != null ? "comment=" + comment + ", " : "") + (comment != null ? "comment=" + comment + ", " : "") +
(memberId != null ? "memberId=" + memberId + ", " : "") + (membershipId != null ? "membershipId=" + membershipId + ", " : "") +
"}"; "}";
} }

View File

@ -25,7 +25,9 @@ public class ShareDTO implements Serializable {
private String comment; private String comment;
private Long memberId; private Long membershipId;
private String membershipFrom;
public Long getId() { public Long getId() {
return id; return id;
@ -67,12 +69,20 @@ public class ShareDTO implements Serializable {
this.comment = comment; this.comment = comment;
} }
public Long getMemberId() { public Long getMembershipId() {
return memberId; return membershipId;
} }
public void setMemberId(Long membershipId) { public void setMembershipId(Long membershipId) {
this.memberId = membershipId; this.membershipId = membershipId;
}
public String getMembershipFrom() {
return membershipFrom;
}
public void setMembershipFrom(String membershipFrom) {
this.membershipFrom = membershipFrom;
} }
@Override @Override
@ -104,7 +114,8 @@ public class ShareDTO implements Serializable {
", action='" + getAction() + "'" + ", action='" + getAction() + "'" +
", quantity=" + getQuantity() + ", quantity=" + getQuantity() +
", comment='" + getComment() + "'" + ", comment='" + getComment() + "'" +
", member=" + getMemberId() + ", membership=" + getMembershipId() +
", membership='" + getMembershipFrom() + "'" +
"}"; "}";
} }
} }

View File

@ -11,10 +11,11 @@ import org.mapstruct.*;
@Mapper(componentModel = "spring", uses = {MembershipMapper.class}) @Mapper(componentModel = "spring", uses = {MembershipMapper.class})
public interface AssetMapper extends EntityMapper<AssetDTO, Asset> { public interface AssetMapper extends EntityMapper<AssetDTO, Asset> {
@Mapping(source = "member.id", target = "memberId") @Mapping(source = "membership.id", target = "membershipId")
@Mapping(source = "membership.from", target = "membershipFrom")
AssetDTO toDto(Asset asset); AssetDTO toDto(Asset asset);
@Mapping(source = "memberId", target = "member") @Mapping(source = "membershipId", target = "membership")
Asset toEntity(AssetDTO assetDTO); Asset toEntity(AssetDTO assetDTO);
default Asset fromId(Long id) { default Asset fromId(Long id) {

View File

@ -1,26 +0,0 @@
package org.hostsharing.hsadminng.service.mapper;
import org.hostsharing.hsadminng.domain.*;
import org.hostsharing.hsadminng.service.dto.ContactDTO;
import org.mapstruct.*;
/**
* Mapper for the entity Contact and its DTO ContactDTO.
*/
@Mapper(componentModel = "spring", uses = {})
public interface ContactMapper extends EntityMapper<ContactDTO, Contact> {
@Mapping(target = "roles", ignore = true)
Contact toEntity(ContactDTO contactDTO);
default Contact fromId(Long id) {
if (id == null) {
return null;
}
Contact contact = new Contact();
contact.setId(id);
return contact;
}
}

View File

@ -1,32 +0,0 @@
package org.hostsharing.hsadminng.service.mapper;
import org.hostsharing.hsadminng.domain.*;
import org.hostsharing.hsadminng.service.dto.CustomerContactDTO;
import org.mapstruct.*;
/**
* Mapper for the entity CustomerContact and its DTO CustomerContactDTO.
*/
@Mapper(componentModel = "spring", uses = {ContactMapper.class, CustomerMapper.class})
public interface CustomerContactMapper extends EntityMapper<CustomerContactDTO, CustomerContact> {
@Mapping(source = "contact.id", target = "contactId")
@Mapping(source = "contact.email", target = "contactEmail")
@Mapping(source = "customer.id", target = "customerId")
@Mapping(source = "customer.prefix", target = "customerPrefix")
CustomerContactDTO toDto(CustomerContact customerContact);
@Mapping(source = "contactId", target = "contact")
@Mapping(source = "customerId", target = "customer")
CustomerContact toEntity(CustomerContactDTO customerContactDTO);
default CustomerContact fromId(Long id) {
if (id == null) {
return null;
}
CustomerContact customerContact = new CustomerContact();
customerContact.setId(id);
return customerContact;
}
}

View File

@ -1,9 +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.Mapper;
import org.mapstruct.Mapping; import org.mapstruct.*;
/** /**
* Mapper for the entity Customer and its DTO CustomerDTO. * Mapper for the entity Customer and its DTO CustomerDTO.
@ -12,8 +12,8 @@ import org.mapstruct.Mapping;
public interface CustomerMapper extends EntityMapper<CustomerDTO, Customer> { public interface CustomerMapper extends EntityMapper<CustomerDTO, Customer> {
@Mapping(target = "roles", ignore = true)
@Mapping(target = "memberships", ignore = true) @Mapping(target = "memberships", ignore = true)
@Mapping(target = "sepamandates", ignore = true)
Customer toEntity(CustomerDTO customerDTO); Customer toEntity(CustomerDTO customerDTO);
default Customer fromId(Long id) { default Customer fromId(Long id) {

View File

@ -0,0 +1,29 @@
package org.hostsharing.hsadminng.service.mapper;
import org.hostsharing.hsadminng.domain.*;
import org.hostsharing.hsadminng.service.dto.SepaMandateDTO;
import org.mapstruct.*;
/**
* Mapper for the entity SepaMandate and its DTO SepaMandateDTO.
*/
@Mapper(componentModel = "spring", uses = {CustomerMapper.class})
public interface SepaMandateMapper extends EntityMapper<SepaMandateDTO, SepaMandate> {
@Mapping(source = "customer.id", target = "customerId")
@Mapping(source = "customer.prefix", target = "customerPrefix")
SepaMandateDTO toDto(SepaMandate sepaMandate);
@Mapping(source = "customerId", target = "customer")
SepaMandate toEntity(SepaMandateDTO sepaMandateDTO);
default SepaMandate fromId(Long id) {
if (id == null) {
return null;
}
SepaMandate sepaMandate = new SepaMandate();
sepaMandate.setId(id);
return sepaMandate;
}
}

View File

@ -11,10 +11,11 @@ import org.mapstruct.*;
@Mapper(componentModel = "spring", uses = {MembershipMapper.class}) @Mapper(componentModel = "spring", uses = {MembershipMapper.class})
public interface ShareMapper extends EntityMapper<ShareDTO, Share> { public interface ShareMapper extends EntityMapper<ShareDTO, Share> {
@Mapping(source = "member.id", target = "memberId") @Mapping(source = "membership.id", target = "membershipId")
@Mapping(source = "membership.from", target = "membershipFrom")
ShareDTO toDto(Share share); ShareDTO toDto(Share share);
@Mapping(source = "memberId", target = "member") @Mapping(source = "membershipId", target = "membership")
Share toEntity(ShareDTO shareDTO); Share toEntity(ShareDTO shareDTO);
default Share fromId(Long id) { default Share fromId(Long id) {

View File

@ -1,138 +0,0 @@
package org.hostsharing.hsadminng.web.rest;
import org.hostsharing.hsadminng.service.ContactService;
import org.hostsharing.hsadminng.web.rest.errors.BadRequestAlertException;
import org.hostsharing.hsadminng.web.rest.util.HeaderUtil;
import org.hostsharing.hsadminng.web.rest.util.PaginationUtil;
import org.hostsharing.hsadminng.service.dto.ContactDTO;
import org.hostsharing.hsadminng.service.dto.ContactCriteria;
import org.hostsharing.hsadminng.service.ContactQueryService;
import io.github.jhipster.web.util.ResponseUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Optional;
/**
* REST controller for managing Contact.
*/
@RestController
@RequestMapping("/api")
public class ContactResource {
private final Logger log = LoggerFactory.getLogger(ContactResource.class);
private static final String ENTITY_NAME = "contact";
private final ContactService contactService;
private final ContactQueryService contactQueryService;
public ContactResource(ContactService contactService, ContactQueryService contactQueryService) {
this.contactService = contactService;
this.contactQueryService = contactQueryService;
}
/**
* POST /contacts : Create a new contact.
*
* @param contactDTO the contactDTO to create
* @return the ResponseEntity with status 201 (Created) and with body the new contactDTO, or with status 400 (Bad Request) if the contact has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/contacts")
public ResponseEntity<ContactDTO> createContact(@Valid @RequestBody ContactDTO contactDTO) throws URISyntaxException {
log.debug("REST request to save Contact : {}", contactDTO);
if (contactDTO.getId() != null) {
throw new BadRequestAlertException("A new contact cannot already have an ID", ENTITY_NAME, "idexists");
}
ContactDTO result = contactService.save(contactDTO);
return ResponseEntity.created(new URI("/api/contacts/" + result.getId()))
.headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))
.body(result);
}
/**
* PUT /contacts : Updates an existing contact.
*
* @param contactDTO the contactDTO to update
* @return the ResponseEntity with status 200 (OK) and with body the updated contactDTO,
* or with status 400 (Bad Request) if the contactDTO is not valid,
* or with status 500 (Internal Server Error) if the contactDTO couldn't be updated
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PutMapping("/contacts")
public ResponseEntity<ContactDTO> updateContact(@Valid @RequestBody ContactDTO contactDTO) throws URISyntaxException {
log.debug("REST request to update Contact : {}", contactDTO);
if (contactDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
ContactDTO result = contactService.save(contactDTO);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, contactDTO.getId().toString()))
.body(result);
}
/**
* GET /contacts : get all the contacts.
*
* @param pageable the pagination information
* @param criteria the criterias which the requested entities should match
* @return the ResponseEntity with status 200 (OK) and the list of contacts in body
*/
@GetMapping("/contacts")
public ResponseEntity<List<ContactDTO>> getAllContacts(ContactCriteria criteria, Pageable pageable) {
log.debug("REST request to get Contacts by criteria: {}", criteria);
Page<ContactDTO> page = contactQueryService.findByCriteria(criteria, pageable);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/contacts");
return ResponseEntity.ok().headers(headers).body(page.getContent());
}
/**
* GET /contacts/count : count all the contacts.
*
* @param criteria the criterias which the requested entities should match
* @return the ResponseEntity with status 200 (OK) and the count in body
*/
@GetMapping("/contacts/count")
public ResponseEntity<Long> countContacts(ContactCriteria criteria) {
log.debug("REST request to count Contacts by criteria: {}", criteria);
return ResponseEntity.ok().body(contactQueryService.countByCriteria(criteria));
}
/**
* GET /contacts/:id : get the "id" contact.
*
* @param id the id of the contactDTO to retrieve
* @return the ResponseEntity with status 200 (OK) and with body the contactDTO, or with status 404 (Not Found)
*/
@GetMapping("/contacts/{id}")
public ResponseEntity<ContactDTO> getContact(@PathVariable Long id) {
log.debug("REST request to get Contact : {}", id);
Optional<ContactDTO> contactDTO = contactService.findOne(id);
return ResponseUtil.wrapOrNotFound(contactDTO);
}
/**
* DELETE /contacts/:id : delete the "id" contact.
*
* @param id the id of the contactDTO to delete
* @return the ResponseEntity with status 200 (OK)
*/
@DeleteMapping("/contacts/{id}")
public ResponseEntity<Void> deleteContact(@PathVariable Long id) {
log.debug("REST request to delete Contact : {}", id);
contactService.delete(id);
return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();
}
}

View File

@ -1,138 +0,0 @@
package org.hostsharing.hsadminng.web.rest;
import org.hostsharing.hsadminng.service.CustomerContactService;
import org.hostsharing.hsadminng.web.rest.errors.BadRequestAlertException;
import org.hostsharing.hsadminng.web.rest.util.HeaderUtil;
import org.hostsharing.hsadminng.web.rest.util.PaginationUtil;
import org.hostsharing.hsadminng.service.dto.CustomerContactDTO;
import org.hostsharing.hsadminng.service.dto.CustomerContactCriteria;
import org.hostsharing.hsadminng.service.CustomerContactQueryService;
import io.github.jhipster.web.util.ResponseUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Optional;
/**
* REST controller for managing CustomerContact.
*/
@RestController
@RequestMapping("/api")
public class CustomerContactResource {
private final Logger log = LoggerFactory.getLogger(CustomerContactResource.class);
private static final String ENTITY_NAME = "customerContact";
private final CustomerContactService customerContactService;
private final CustomerContactQueryService customerContactQueryService;
public CustomerContactResource(CustomerContactService customerContactService, CustomerContactQueryService customerContactQueryService) {
this.customerContactService = customerContactService;
this.customerContactQueryService = customerContactQueryService;
}
/**
* POST /customer-contacts : Create a new customerContact.
*
* @param customerContactDTO the customerContactDTO to create
* @return the ResponseEntity with status 201 (Created) and with body the new customerContactDTO, or with status 400 (Bad Request) if the customerContact has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/customer-contacts")
public ResponseEntity<CustomerContactDTO> createCustomerContact(@Valid @RequestBody CustomerContactDTO customerContactDTO) throws URISyntaxException {
log.debug("REST request to save CustomerContact : {}", customerContactDTO);
if (customerContactDTO.getId() != null) {
throw new BadRequestAlertException("A new customerContact cannot already have an ID", ENTITY_NAME, "idexists");
}
CustomerContactDTO result = customerContactService.save(customerContactDTO);
return ResponseEntity.created(new URI("/api/customer-contacts/" + result.getId()))
.headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))
.body(result);
}
/**
* PUT /customer-contacts : Updates an existing customerContact.
*
* @param customerContactDTO the customerContactDTO to update
* @return the ResponseEntity with status 200 (OK) and with body the updated customerContactDTO,
* or with status 400 (Bad Request) if the customerContactDTO is not valid,
* or with status 500 (Internal Server Error) if the customerContactDTO couldn't be updated
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PutMapping("/customer-contacts")
public ResponseEntity<CustomerContactDTO> updateCustomerContact(@Valid @RequestBody CustomerContactDTO customerContactDTO) throws URISyntaxException {
log.debug("REST request to update CustomerContact : {}", customerContactDTO);
if (customerContactDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
CustomerContactDTO result = customerContactService.save(customerContactDTO);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, customerContactDTO.getId().toString()))
.body(result);
}
/**
* GET /customer-contacts : get all the customerContacts.
*
* @param pageable the pagination information
* @param criteria the criterias which the requested entities should match
* @return the ResponseEntity with status 200 (OK) and the list of customerContacts in body
*/
@GetMapping("/customer-contacts")
public ResponseEntity<List<CustomerContactDTO>> getAllCustomerContacts(CustomerContactCriteria criteria, Pageable pageable) {
log.debug("REST request to get CustomerContacts by criteria: {}", criteria);
Page<CustomerContactDTO> page = customerContactQueryService.findByCriteria(criteria, pageable);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/customer-contacts");
return ResponseEntity.ok().headers(headers).body(page.getContent());
}
/**
* GET /customer-contacts/count : count all the customerContacts.
*
* @param criteria the criterias which the requested entities should match
* @return the ResponseEntity with status 200 (OK) and the count in body
*/
@GetMapping("/customer-contacts/count")
public ResponseEntity<Long> countCustomerContacts(CustomerContactCriteria criteria) {
log.debug("REST request to count CustomerContacts by criteria: {}", criteria);
return ResponseEntity.ok().body(customerContactQueryService.countByCriteria(criteria));
}
/**
* GET /customer-contacts/:id : get the "id" customerContact.
*
* @param id the id of the customerContactDTO to retrieve
* @return the ResponseEntity with status 200 (OK) and with body the customerContactDTO, or with status 404 (Not Found)
*/
@GetMapping("/customer-contacts/{id}")
public ResponseEntity<CustomerContactDTO> getCustomerContact(@PathVariable Long id) {
log.debug("REST request to get CustomerContact : {}", id);
Optional<CustomerContactDTO> customerContactDTO = customerContactService.findOne(id);
return ResponseUtil.wrapOrNotFound(customerContactDTO);
}
/**
* DELETE /customer-contacts/:id : delete the "id" customerContact.
*
* @param id the id of the customerContactDTO to delete
* @return the ResponseEntity with status 200 (OK)
*/
@DeleteMapping("/customer-contacts/{id}")
public ResponseEntity<Void> deleteCustomerContact(@PathVariable Long id) {
log.debug("REST request to delete CustomerContact : {}", id);
customerContactService.delete(id);
return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();
}
}

View File

@ -0,0 +1,138 @@
package org.hostsharing.hsadminng.web.rest;
import org.hostsharing.hsadminng.service.SepaMandateService;
import org.hostsharing.hsadminng.web.rest.errors.BadRequestAlertException;
import org.hostsharing.hsadminng.web.rest.util.HeaderUtil;
import org.hostsharing.hsadminng.web.rest.util.PaginationUtil;
import org.hostsharing.hsadminng.service.dto.SepaMandateDTO;
import org.hostsharing.hsadminng.service.dto.SepaMandateCriteria;
import org.hostsharing.hsadminng.service.SepaMandateQueryService;
import io.github.jhipster.web.util.ResponseUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Optional;
/**
* REST controller for managing SepaMandate.
*/
@RestController
@RequestMapping("/api")
public class SepaMandateResource {
private final Logger log = LoggerFactory.getLogger(SepaMandateResource.class);
private static final String ENTITY_NAME = "sepaMandate";
private final SepaMandateService sepaMandateService;
private final SepaMandateQueryService sepaMandateQueryService;
public SepaMandateResource(SepaMandateService sepaMandateService, SepaMandateQueryService sepaMandateQueryService) {
this.sepaMandateService = sepaMandateService;
this.sepaMandateQueryService = sepaMandateQueryService;
}
/**
* POST /sepa-mandates : Create a new sepaMandate.
*
* @param sepaMandateDTO the sepaMandateDTO to create
* @return the ResponseEntity with status 201 (Created) and with body the new sepaMandateDTO, or with status 400 (Bad Request) if the sepaMandate has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/sepa-mandates")
public ResponseEntity<SepaMandateDTO> createSepaMandate(@Valid @RequestBody SepaMandateDTO sepaMandateDTO) throws URISyntaxException {
log.debug("REST request to save SepaMandate : {}", sepaMandateDTO);
if (sepaMandateDTO.getId() != null) {
throw new BadRequestAlertException("A new sepaMandate cannot already have an ID", ENTITY_NAME, "idexists");
}
SepaMandateDTO result = sepaMandateService.save(sepaMandateDTO);
return ResponseEntity.created(new URI("/api/sepa-mandates/" + result.getId()))
.headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))
.body(result);
}
/**
* PUT /sepa-mandates : Updates an existing sepaMandate.
*
* @param sepaMandateDTO the sepaMandateDTO to update
* @return the ResponseEntity with status 200 (OK) and with body the updated sepaMandateDTO,
* or with status 400 (Bad Request) if the sepaMandateDTO is not valid,
* or with status 500 (Internal Server Error) if the sepaMandateDTO couldn't be updated
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PutMapping("/sepa-mandates")
public ResponseEntity<SepaMandateDTO> updateSepaMandate(@Valid @RequestBody SepaMandateDTO sepaMandateDTO) throws URISyntaxException {
log.debug("REST request to update SepaMandate : {}", sepaMandateDTO);
if (sepaMandateDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
SepaMandateDTO result = sepaMandateService.save(sepaMandateDTO);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, sepaMandateDTO.getId().toString()))
.body(result);
}
/**
* GET /sepa-mandates : get all the sepaMandates.
*
* @param pageable the pagination information
* @param criteria the criterias which the requested entities should match
* @return the ResponseEntity with status 200 (OK) and the list of sepaMandates in body
*/
@GetMapping("/sepa-mandates")
public ResponseEntity<List<SepaMandateDTO>> getAllSepaMandates(SepaMandateCriteria criteria, Pageable pageable) {
log.debug("REST request to get SepaMandates by criteria: {}", criteria);
Page<SepaMandateDTO> page = sepaMandateQueryService.findByCriteria(criteria, pageable);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/sepa-mandates");
return ResponseEntity.ok().headers(headers).body(page.getContent());
}
/**
* GET /sepa-mandates/count : count all the sepaMandates.
*
* @param criteria the criterias which the requested entities should match
* @return the ResponseEntity with status 200 (OK) and the count in body
*/
@GetMapping("/sepa-mandates/count")
public ResponseEntity<Long> countSepaMandates(SepaMandateCriteria criteria) {
log.debug("REST request to count SepaMandates by criteria: {}", criteria);
return ResponseEntity.ok().body(sepaMandateQueryService.countByCriteria(criteria));
}
/**
* GET /sepa-mandates/:id : get the "id" sepaMandate.
*
* @param id the id of the sepaMandateDTO to retrieve
* @return the ResponseEntity with status 200 (OK) and with body the sepaMandateDTO, or with status 404 (Not Found)
*/
@GetMapping("/sepa-mandates/{id}")
public ResponseEntity<SepaMandateDTO> getSepaMandate(@PathVariable Long id) {
log.debug("REST request to get SepaMandate : {}", id);
Optional<SepaMandateDTO> sepaMandateDTO = sepaMandateService.findOne(id);
return ResponseUtil.wrapOrNotFound(sepaMandateDTO);
}
/**
* DELETE /sepa-mandates/:id : delete the "id" sepaMandate.
*
* @param id the id of the sepaMandateDTO to delete
* @return the ResponseEntity with status 200 (OK)
*/
@DeleteMapping("/sepa-mandates/{id}")
public ResponseEntity<Void> deleteSepaMandate(@PathVariable Long id) {
log.debug("REST request to delete SepaMandate : {}", id);
sepaMandateService.delete(id);
return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();
}
}

View File

@ -7,31 +7,16 @@ entity Customer {
number Integer required unique min(10000) max(99999), number Integer required unique min(10000) max(99999),
prefix String required unique pattern(/[a-z][a-z0-9]+/), prefix String required unique pattern(/[a-z][a-z0-9]+/),
name String required maxlength(80), name String required maxlength(80),
contractualAddress String required maxlength(400),
contractualSalutation String maxlength(80), contractualSalutation String maxlength(80),
billingAddress String maxlength(400), contractualAddress String required maxlength(400),
billingSalutation String maxlength(80) billingSalutation String maxlength(80),
} billingAddress String maxlength(400)
entity Contact {
firstName String required maxlength(80),
lastName String required maxlength(80),
email String required maxlength(80)
}
enum CustomerContactRole {
CONTRACTUAL,
TECHNICAL,
FINANCIAL
}
entity CustomerContact {
role CustomerContactRole required
} }
entity Membership { entity Membership {
sinceDate LocalDate required, from LocalDate required,
untilDate LocalDate to LocalDate,
comment String maxlength(160)
} }
enum ShareAction { enum ShareAction {
@ -62,11 +47,21 @@ entity Asset {
comment String maxlength(160) comment String maxlength(160)
} }
relationship OneToMany { entity SepaMandate {
Contact{role} to CustomerContact{contact(email) required}, reference String maxlength(40) unique required,
Customer{role} to CustomerContact{customer(prefix) required}, iban String maxlength(34),
Customer to Membership{customer(prefix) required}, bic String maxlength(11),
Membership to Share{member required}, created LocalDate required,
Membership to Asset{member required} validFrom LocalDate required,
validTo LocalDate,
lastUsed LocalDate,
cancelled LocalDate,
comment String maxlength(160)
} }
relationship OneToMany {
Customer{membership} to Membership{customer(prefix) required},
Customer{sepamandate} to SepaMandate{customer(prefix) required},
Membership{share} to Share{membership(from) required},
Membership{asset} to Asset{membership(from) required}
}

View File

@ -1,24 +0,0 @@
<?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 CustomerContact.
-->
<changeSet id="20190403083737-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="contact_id"
baseTableName="customer_contact"
constraintName="fk_customer_contact_contact_id"
referencedColumnNames="id"
referencedTableName="contact"/>
<addForeignKeyConstraint baseColumnNames="customer_id"
baseTableName="customer_contact"
constraintName="fk_customer_contact_customer_id"
referencedColumnNames="id"
referencedTableName="customer"/>
</changeSet>
</databaseChangeLog>

View File

@ -1,39 +0,0 @@
<?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">
<property name="now" value="now()" dbms="h2"/>
<property name="now" value="current_timestamp" dbms="postgresql"/>
<property name="floatType" value="float4" dbms="postgresql, h2"/>
<property name="floatType" value="float" dbms="mysql, oracle, mssql"/>
<!--
Added the entity Membership.
-->
<changeSet id="20190403083738-1" author="jhipster">
<createTable tableName="membership">
<column name="id" type="bigint" autoIncrement="${autoIncrement}">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="since_date" type="date">
<constraints nullable="false" />
</column>
<column name="until_date" type="date">
<constraints nullable="true" />
</column>
<column name="customer_id" type="bigint">
<constraints nullable="false"/>
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here, do not remove-->
</createTable>
</changeSet>
<!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here, do not remove-->
</databaseChangeLog>

View File

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog <databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" 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" 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"> 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">
<property name="now" value="now()" dbms="h2"/> <property name="now" value="now()" dbms="h2"/>
@ -14,7 +16,7 @@
<!-- <!--
Added the entity Customer. Added the entity Customer.
--> -->
<changeSet id="20190403083735-1" author="jhipster"> <changeSet id="20190418073043-1" author="jhipster">
<createTable tableName="customer"> <createTable tableName="customer">
<column name="id" type="bigint" autoIncrement="${autoIncrement}"> <column name="id" type="bigint" autoIncrement="${autoIncrement}">
<constraints primaryKey="true" nullable="false"/> <constraints primaryKey="true" nullable="false"/>
@ -28,23 +30,23 @@
</column> </column>
<column name="name" type="varchar(80)"> <column name="name" type="varchar(80)">
<constraints nullable="false"/> <constraints nullable="false" />
</column>
<column name="contractual_address" type="varchar(400)">
<constraints nullable="false"/>
</column> </column>
<column name="contractual_salutation" type="varchar(80)"> <column name="contractual_salutation" type="varchar(80)">
<constraints nullable="true"/> <constraints nullable="true" />
</column> </column>
<column name="billing_address" type="varchar(400)"> <column name="contractual_address" type="varchar(400)">
<constraints nullable="true"/> <constraints nullable="false" />
</column> </column>
<column name="billing_salutation" type="varchar(80)"> <column name="billing_salutation" type="varchar(80)">
<constraints nullable="true"/> <constraints nullable="true" />
</column>
<column name="billing_address" type="varchar(400)">
<constraints nullable="true" />
</column> </column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here, do not remove--> <!-- jhipster-needle-liquibase-add-column - JHipster will add columns here, do not remove-->

View File

@ -14,19 +14,23 @@
<property name="floatType" value="float" dbms="mysql, oracle, mssql"/> <property name="floatType" value="float" dbms="mysql, oracle, mssql"/>
<!-- <!--
Added the entity CustomerContact. Added the entity Membership.
--> -->
<changeSet id="20190403083737-1" author="jhipster"> <changeSet id="20190418073044-1" author="jhipster">
<createTable tableName="customer_contact"> <createTable tableName="membership">
<column name="id" type="bigint" autoIncrement="${autoIncrement}"> <column name="id" type="bigint" autoIncrement="${autoIncrement}">
<constraints primaryKey="true" nullable="false"/> <constraints primaryKey="true" nullable="false"/>
</column> </column>
<column name="jhi_role" type="varchar(255)"> <column name="jhi_from" type="date">
<constraints nullable="false" /> <constraints nullable="false" />
</column> </column>
<column name="contact_id" type="bigint"> <column name="jhi_to" type="date">
<constraints nullable="false" /> <constraints nullable="true" />
</column>
<column name="jhi_comment" type="varchar(160)">
<constraints nullable="true" />
</column> </column>
<column name="customer_id" type="bigint"> <column name="customer_id" type="bigint">

View File

@ -6,7 +6,7 @@
<!-- <!--
Added the constraints for entity Membership. Added the constraints for entity Membership.
--> -->
<changeSet id="20190403083738-2" author="jhipster"> <changeSet id="20190418073044-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="customer_id" <addForeignKeyConstraint baseColumnNames="customer_id"
baseTableName="membership" baseTableName="membership"

View File

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog <databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" 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" 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"> 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">
<property name="now" value="now()" dbms="h2"/> <property name="now" value="now()" dbms="h2"/>
@ -14,7 +16,7 @@
<!-- <!--
Added the entity Share. Added the entity Share.
--> -->
<changeSet id="20190403083739-1" author="jhipster"> <changeSet id="20190418073045-1" author="jhipster">
<createTable tableName="share"> <createTable tableName="share">
<column name="id" type="bigint" autoIncrement="${autoIncrement}"> <column name="id" type="bigint" autoIncrement="${autoIncrement}">
<constraints primaryKey="true" nullable="false"/> <constraints primaryKey="true" nullable="false"/>
@ -35,8 +37,8 @@
<constraints nullable="true" /> <constraints nullable="true" />
</column> </column>
<column name="member_id" type="bigint"> <column name="membership_id" type="bigint">
<constraints nullable="false"/> <constraints nullable="false" />
</column> </column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here, do not remove--> <!-- jhipster-needle-liquibase-add-column - JHipster will add columns here, do not remove-->

View File

@ -6,11 +6,11 @@
<!-- <!--
Added the constraints for entity Share. Added the constraints for entity Share.
--> -->
<changeSet id="20190403083739-2" author="jhipster"> <changeSet id="20190418073045-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="member_id" <addForeignKeyConstraint baseColumnNames="membership_id"
baseTableName="share" baseTableName="share"
constraintName="fk_share_member_id" constraintName="fk_share_membership_id"
referencedColumnNames="id" referencedColumnNames="id"
referencedTableName="membership"/> referencedTableName="membership"/>

View File

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog <databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" 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" 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"> 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">
<property name="now" value="now()" dbms="h2"/> <property name="now" value="now()" dbms="h2"/>
@ -14,7 +16,7 @@
<!-- <!--
Added the entity Asset. Added the entity Asset.
--> -->
<changeSet id="20190403083740-1" author="jhipster"> <changeSet id="20190418073046-1" author="jhipster">
<createTable tableName="asset"> <createTable tableName="asset">
<column name="id" type="bigint" autoIncrement="${autoIncrement}"> <column name="id" type="bigint" autoIncrement="${autoIncrement}">
<constraints primaryKey="true" nullable="false"/> <constraints primaryKey="true" nullable="false"/>
@ -35,8 +37,8 @@
<constraints nullable="true" /> <constraints nullable="true" />
</column> </column>
<column name="member_id" type="bigint"> <column name="membership_id" type="bigint">
<constraints nullable="false"/> <constraints nullable="false" />
</column> </column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here, do not remove--> <!-- jhipster-needle-liquibase-add-column - JHipster will add columns here, do not remove-->

View File

@ -6,11 +6,11 @@
<!-- <!--
Added the constraints for entity Asset. Added the constraints for entity Asset.
--> -->
<changeSet id="20190403083740-2" author="jhipster"> <changeSet id="20190418073046-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="member_id" <addForeignKeyConstraint baseColumnNames="membership_id"
baseTableName="asset" baseTableName="asset"
constraintName="fk_asset_member_id" constraintName="fk_asset_membership_id"
referencedColumnNames="id" referencedColumnNames="id"
referencedTableName="membership"/> referencedTableName="membership"/>

View File

@ -14,22 +14,50 @@
<property name="floatType" value="float" dbms="mysql, oracle, mssql"/> <property name="floatType" value="float" dbms="mysql, oracle, mssql"/>
<!-- <!--
Added the entity Contact. Added the entity SepaMandate.
--> -->
<changeSet id="20190403083736-1" author="jhipster"> <changeSet id="20190418073047-1" author="jhipster">
<createTable tableName="contact"> <createTable tableName="sepa_mandate">
<column name="id" type="bigint" autoIncrement="${autoIncrement}"> <column name="id" type="bigint" autoIncrement="${autoIncrement}">
<constraints primaryKey="true" nullable="false"/> <constraints primaryKey="true" nullable="false"/>
</column> </column>
<column name="first_name" type="varchar(80)"> <column name="reference" type="varchar(40)">
<constraints nullable="false" unique="true" uniqueConstraintName="ux_sepa_mandate_reference" />
</column>
<column name="iban" type="varchar(34)">
<constraints nullable="true" />
</column>
<column name="bic" type="varchar(11)">
<constraints nullable="true" />
</column>
<column name="created" type="date">
<constraints nullable="false" /> <constraints nullable="false" />
</column> </column>
<column name="last_name" type="varchar(80)"> <column name="valid_from" type="date">
<constraints nullable="false" /> <constraints nullable="false" />
</column> </column>
<column name="email" type="varchar(80)"> <column name="valid_to" type="date">
<constraints nullable="true" />
</column>
<column name="last_used" type="date">
<constraints nullable="true" />
</column>
<column name="cancelled" type="date">
<constraints nullable="true" />
</column>
<column name="jhi_comment" type="varchar(160)">
<constraints nullable="true" />
</column>
<column name="customer_id" type="bigint">
<constraints nullable="false" /> <constraints nullable="false" />
</column> </column>

View File

@ -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="20190418073047-2" author="jhipster">
<addForeignKeyConstraint baseColumnNames="customer_id"
baseTableName="sepa_mandate"
constraintName="fk_sepa_mandate_customer_id"
referencedColumnNames="id"
referencedTableName="customer"/>
</changeSet>
</databaseChangeLog>

View File

@ -5,16 +5,15 @@
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd"> 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/00000000000000_initial_schema.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20190403083735_added_entity_Customer.xml" relativeToChangelogFile="false"/> <include file="config/liquibase/changelog/20190418073043_added_entity_Customer.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20190403083736_added_entity_Contact.xml" relativeToChangelogFile="false"/> <include file="config/liquibase/changelog/20190418073044_added_entity_Membership.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20190403083737_added_entity_CustomerContact.xml" relativeToChangelogFile="false"/> <include file="config/liquibase/changelog/20190418073045_added_entity_Share.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20190403083738_added_entity_Membership.xml" relativeToChangelogFile="false"/> <include file="config/liquibase/changelog/20190418073046_added_entity_Asset.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20190403083739_added_entity_Share.xml" relativeToChangelogFile="false"/> <include file="config/liquibase/changelog/20190418073047_added_entity_SepaMandate.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20190403083740_added_entity_Asset.xml" relativeToChangelogFile="false"/>
<!-- jhipster-needle-liquibase-add-changelog - JHipster will add liquibase changelogs here --> <!-- 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/20190418073044_added_entity_constraints_Membership.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20190403083738_added_entity_constraints_Membership.xml" relativeToChangelogFile="false"/> <include file="config/liquibase/changelog/20190418073045_added_entity_constraints_Share.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20190403083739_added_entity_constraints_Share.xml" relativeToChangelogFile="false"/> <include file="config/liquibase/changelog/20190418073046_added_entity_constraints_Asset.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/changelog/20190403083740_added_entity_constraints_Asset.xml" relativeToChangelogFile="false"/> <include file="config/liquibase/changelog/20190418073047_added_entity_constraints_SepaMandate.xml" relativeToChangelogFile="false"/>
<!-- jhipster-needle-liquibase-add-constraints-changelog - JHipster will add liquibase constraints changelogs here --> <!-- jhipster-needle-liquibase-add-constraints-changelog - JHipster will add liquibase constraints changelogs here -->
</databaseChangeLog> </databaseChangeLog>

View File

@ -21,10 +21,10 @@
<dd> <dd>
<span>{{asset.comment}}</span> <span>{{asset.comment}}</span>
</dd> </dd>
<dt><span jhiTranslate="hsadminNgApp.asset.member">Member</span></dt> <dt><span jhiTranslate="hsadminNgApp.asset.membership">Membership</span></dt>
<dd> <dd>
<div *ngIf="asset.memberId"> <div *ngIf="asset.membershipId">
<a [routerLink]="['/membership', asset.memberId, 'view']">{{asset.memberId}}</a> <a [routerLink]="['/membership', asset.membershipId, 'view']">{{asset.membershipFrom}}</a>
</div> </div>
</dd> </dd>
</dl> </dl>

View File

@ -70,16 +70,15 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.asset.member" for="field_member">Member</label> <label class="form-control-label" jhiTranslate="hsadminNgApp.asset.membership" for="field_membership">Membership</label>
<select class="form-control" id="field_member" name="member" [(ngModel)]="asset.memberId" required> <select class="form-control" id="field_membership" name="membership" [(ngModel)]="asset.membershipId" required>
<option *ngIf="!editForm.value.member" [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.id}}</option> <option [ngValue]="membershipOption.id" *ngFor="let membershipOption of memberships; trackBy: trackMembershipById">{{membershipOption.from}}</option>
</select> </select>
</div> </div>
<div [hidden]="!(editForm.controls.member?.dirty && editForm.controls.member?.invalid)"> <div [hidden]="!(editForm.controls.membership?.dirty && editForm.controls.membership?.invalid)">
<small class="form-text text-danger" <small class="form-text text-danger"
[hidden]="!editForm.controls.member?.errors?.required" [hidden]="!editForm.controls.membership?.errors?.required" jhiTranslate="entity.validation.required">
jhiTranslate="entity.validation.required">
This field is required. This field is required.
</small> </small>
</div> </div>

View File

@ -19,7 +19,7 @@
<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="comment"><span jhiTranslate="hsadminNgApp.asset.comment">Comment</span> <fa-icon [icon]="'sort'"></fa-icon></th> <th jhiSortBy="comment"><span jhiTranslate="hsadminNgApp.asset.comment">Comment</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th jhiSortBy="memberId"><span jhiTranslate="hsadminNgApp.asset.member">Member</span> <fa-icon [icon]="'sort'"></fa-icon></th> <th jhiSortBy="membershipFrom"><span jhiTranslate="hsadminNgApp.asset.membership">Membership</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
@ -31,8 +31,8 @@
<td>{{asset.amount}}</td> <td>{{asset.amount}}</td>
<td>{{asset.comment}}</td> <td>{{asset.comment}}</td>
<td> <td>
<div *ngIf="asset.memberId"> <div *ngIf="asset.membershipId">
<a [routerLink]="['../membership', asset.memberId , 'view' ]" >{{asset.memberId}}</a> <a [routerLink]="['../membership', asset.membershipId , 'view' ]" >{{asset.membershipFrom}}</a>
</div> </div>
</td> </td>
<td class="text-right"> <td class="text-right">

View File

@ -1,65 +0,0 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { NgbActiveModal, NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
import { JhiEventManager } from 'ng-jhipster';
import { IContact } from 'app/shared/model/contact.model';
import { ContactService } from './contact.service';
@Component({
selector: 'jhi-contact-delete-dialog',
templateUrl: './contact-delete-dialog.component.html'
})
export class ContactDeleteDialogComponent {
contact: IContact;
constructor(protected contactService: ContactService, public activeModal: NgbActiveModal, protected eventManager: JhiEventManager) {}
clear() {
this.activeModal.dismiss('cancel');
}
confirmDelete(id: number) {
this.contactService.delete(id).subscribe(response => {
this.eventManager.broadcast({
name: 'contactListModification',
content: 'Deleted an contact'
});
this.activeModal.dismiss(true);
});
}
}
@Component({
selector: 'jhi-contact-delete-popup',
template: ''
})
export class ContactDeletePopupComponent implements OnInit, OnDestroy {
protected ngbModalRef: NgbModalRef;
constructor(protected activatedRoute: ActivatedRoute, protected router: Router, protected modalService: NgbModal) {}
ngOnInit() {
this.activatedRoute.data.subscribe(({ contact }) => {
setTimeout(() => {
this.ngbModalRef = this.modalService.open(ContactDeleteDialogComponent as Component, { size: 'lg', backdrop: 'static' });
this.ngbModalRef.componentInstance.contact = contact;
this.ngbModalRef.result.then(
result => {
this.router.navigate(['/contact', { outlets: { popup: null } }]);
this.ngbModalRef = null;
},
reason => {
this.router.navigate(['/contact', { outlets: { popup: null } }]);
this.ngbModalRef = null;
}
);
}, 0);
});
}
ngOnDestroy() {
this.ngbModalRef = null;
}
}

View File

@ -1,35 +0,0 @@
<div class="row justify-content-center">
<div class="col-8">
<div *ngIf="contact">
<h2><span jhiTranslate="hsadminNgApp.contact.detail.title">Contact</span> {{contact.id}}</h2>
<hr>
<jhi-alert-error></jhi-alert-error>
<dl class="row-md jh-entity-details">
<dt><span jhiTranslate="hsadminNgApp.contact.firstName">First Name</span></dt>
<dd>
<span>{{contact.firstName}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.contact.lastName">Last Name</span></dt>
<dd>
<span>{{contact.lastName}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.contact.email">Email</span></dt>
<dd>
<span>{{contact.email}}</span>
</dd>
</dl>
<button type="submit"
(click)="previousState()"
class="btn btn-info">
<fa-icon [icon]="'arrow-left'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.back"> Back</span>
</button>
<button type="button"
[routerLink]="['/contact', contact.id, 'edit']"
class="btn btn-primary">
<fa-icon [icon]="'pencil-alt'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.edit"> Edit</span>
</button>
</div>
</div>
</div>

View File

@ -1,24 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { IContact } from 'app/shared/model/contact.model';
@Component({
selector: 'jhi-contact-detail',
templateUrl: './contact-detail.component.html'
})
export class ContactDetailComponent implements OnInit {
contact: IContact;
constructor(protected activatedRoute: ActivatedRoute) {}
ngOnInit() {
this.activatedRoute.data.subscribe(({ contact }) => {
this.contact = contact;
});
}
previousState() {
window.history.back();
}
}

View File

@ -1,69 +0,0 @@
<div class="row justify-content-center">
<div class="col-8">
<form name="editForm" role="form" novalidate (ngSubmit)="save()" #editForm="ngForm">
<h2 id="jhi-contact-heading" jhiTranslate="hsadminNgApp.contact.home.createOrEditLabel">Create or edit a Contact</h2>
<div>
<jhi-alert-error></jhi-alert-error>
<div class="form-group" [hidden]="!contact.id">
<label for="id" jhiTranslate="global.field.id">ID</label>
<input type="text" class="form-control" id="id" name="id"
[(ngModel)]="contact.id" readonly />
</div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.contact.firstName" for="field_firstName">First Name</label>
<input type="text" class="form-control" name="firstName" id="field_firstName"
[(ngModel)]="contact.firstName" required maxlength="80"/>
<div [hidden]="!(editForm.controls.firstName?.dirty && editForm.controls.firstName?.invalid)">
<small class="form-text text-danger"
[hidden]="!editForm.controls.firstName?.errors?.required" jhiTranslate="entity.validation.required">
This field is required.
</small>
<small class="form-text text-danger"
[hidden]="!editForm.controls.firstName?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 80 }">
This field cannot be longer than 80 characters.
</small>
</div>
</div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.contact.lastName" for="field_lastName">Last Name</label>
<input type="text" class="form-control" name="lastName" id="field_lastName"
[(ngModel)]="contact.lastName" required maxlength="80"/>
<div [hidden]="!(editForm.controls.lastName?.dirty && editForm.controls.lastName?.invalid)">
<small class="form-text text-danger"
[hidden]="!editForm.controls.lastName?.errors?.required" jhiTranslate="entity.validation.required">
This field is required.
</small>
<small class="form-text text-danger"
[hidden]="!editForm.controls.lastName?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 80 }">
This field cannot be longer than 80 characters.
</small>
</div>
</div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.contact.email" for="field_email">Email</label>
<input type="text" class="form-control" name="email" id="field_email"
[(ngModel)]="contact.email" required maxlength="80"/>
<div [hidden]="!(editForm.controls.email?.dirty && editForm.controls.email?.invalid)">
<small class="form-text text-danger"
[hidden]="!editForm.controls.email?.errors?.required" jhiTranslate="entity.validation.required">
This field is required.
</small>
<small class="form-text text-danger"
[hidden]="!editForm.controls.email?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 80 }">
This field cannot be longer than 80 characters.
</small>
</div>
</div>
</div>
<div>
<button type="button" id="cancel-save" class="btn btn-secondary" (click)="previousState()">
<fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
</button>
<button type="submit" id="save-entity" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
<fa-icon [icon]="'save'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.save">Save</span>
</button>
</div>
</form>
</div>
</div>

View File

@ -1,51 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { HttpResponse, HttpErrorResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { IContact } from 'app/shared/model/contact.model';
import { ContactService } from './contact.service';
@Component({
selector: 'jhi-contact-update',
templateUrl: './contact-update.component.html'
})
export class ContactUpdateComponent implements OnInit {
contact: IContact;
isSaving: boolean;
constructor(protected contactService: ContactService, protected activatedRoute: ActivatedRoute) {}
ngOnInit() {
this.isSaving = false;
this.activatedRoute.data.subscribe(({ contact }) => {
this.contact = contact;
});
}
previousState() {
window.history.back();
}
save() {
this.isSaving = true;
if (this.contact.id !== undefined) {
this.subscribeToSaveResponse(this.contactService.update(this.contact));
} else {
this.subscribeToSaveResponse(this.contactService.create(this.contact));
}
}
protected subscribeToSaveResponse(result: Observable<HttpResponse<IContact>>) {
result.subscribe((res: HttpResponse<IContact>) => this.onSaveSuccess(), (res: HttpErrorResponse) => this.onSaveError());
}
protected onSaveSuccess() {
this.isSaving = false;
this.previousState();
}
protected onSaveError() {
this.isSaving = false;
}
}

View File

@ -1,58 +0,0 @@
<div>
<h2 id="page-heading">
<span jhiTranslate="hsadminNgApp.contact.home.title">Contacts</span>
<button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-contact" [routerLink]="['/contact/new']">
<fa-icon [icon]="'plus'"></fa-icon>
<span jhiTranslate="hsadminNgApp.contact.home.createLabel">
Create new Contact
</span>
</button>
</h2>
<jhi-alert></jhi-alert>
<br/>
<div class="table-responsive" *ngIf="contacts">
<table class="table table-striped">
<thead>
<tr jhiSort [(predicate)]="predicate" [(ascending)]="reverse" [callback]="reset.bind(this)">
<th jhiSortBy="id"><span jhiTranslate="global.field.id">ID</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th jhiSortBy="firstName"><span jhiTranslate="hsadminNgApp.contact.firstName">First Name</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th jhiSortBy="lastName"><span jhiTranslate="hsadminNgApp.contact.lastName">Last Name</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th jhiSortBy="email"><span jhiTranslate="hsadminNgApp.contact.email">Email</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th></th>
</tr>
</thead>
<tbody infinite-scroll (scrolled)="loadPage(page + 1)" [infiniteScrollDisabled]="page >= links['last']" [infiniteScrollDistance]="0">
<tr *ngFor="let contact of contacts ;trackBy: trackId">
<td><a [routerLink]="['/contact', contact.id, 'view' ]">{{contact.id}}</a></td>
<td>{{contact.firstName}}</td>
<td>{{contact.lastName}}</td>
<td>{{contact.email}}</td>
<td class="text-right">
<div class="btn-group flex-btn-group-container">
<button type="submit"
[routerLink]="['/contact', contact.id, 'view' ]"
class="btn btn-info btn-sm">
<fa-icon [icon]="'eye'"></fa-icon>
<span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
</button>
<button type="submit"
[routerLink]="['/contact', contact.id, 'edit']"
class="btn btn-primary btn-sm">
<fa-icon [icon]="'pencil-alt'"></fa-icon>
<span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
</button>
<button type="submit"
[routerLink]="['/', 'contact', { outlets: { popup: contact.id + '/delete'} }]"
replaceUrl="true"
queryParamsHandling="merge"
class="btn btn-danger btn-sm">
<fa-icon [icon]="'times'"></fa-icon>
<span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>

View File

@ -1,93 +0,0 @@
import { Injectable } from '@angular/core';
import { HttpResponse } from '@angular/common/http';
import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot, Routes } from '@angular/router';
import { UserRouteAccessService } from 'app/core';
import { Observable, of } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { Contact } from 'app/shared/model/contact.model';
import { ContactService } from './contact.service';
import { ContactComponent } from './contact.component';
import { ContactDetailComponent } from './contact-detail.component';
import { ContactUpdateComponent } from './contact-update.component';
import { ContactDeletePopupComponent } from './contact-delete-dialog.component';
import { IContact } from 'app/shared/model/contact.model';
@Injectable({ providedIn: 'root' })
export class ContactResolve implements Resolve<IContact> {
constructor(private service: ContactService) {}
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<IContact> {
const id = route.params['id'] ? route.params['id'] : null;
if (id) {
return this.service.find(id).pipe(
filter((response: HttpResponse<Contact>) => response.ok),
map((contact: HttpResponse<Contact>) => contact.body)
);
}
return of(new Contact());
}
}
export const contactRoute: Routes = [
{
path: '',
component: ContactComponent,
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.contact.home.title'
},
canActivate: [UserRouteAccessService]
},
{
path: ':id/view',
component: ContactDetailComponent,
resolve: {
contact: ContactResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.contact.home.title'
},
canActivate: [UserRouteAccessService]
},
{
path: 'new',
component: ContactUpdateComponent,
resolve: {
contact: ContactResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.contact.home.title'
},
canActivate: [UserRouteAccessService]
},
{
path: ':id/edit',
component: ContactUpdateComponent,
resolve: {
contact: ContactResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.contact.home.title'
},
canActivate: [UserRouteAccessService]
}
];
export const contactPopupRoute: Routes = [
{
path: ':id/delete',
component: ContactDeletePopupComponent,
resolve: {
contact: ContactResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.contact.home.title'
},
canActivate: [UserRouteAccessService],
outlet: 'popup'
}
];

View File

@ -1,38 +0,0 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { SERVER_API_URL } from 'app/app.constants';
import { createRequestOption } from 'app/shared';
import { IContact } from 'app/shared/model/contact.model';
type EntityResponseType = HttpResponse<IContact>;
type EntityArrayResponseType = HttpResponse<IContact[]>;
@Injectable({ providedIn: 'root' })
export class ContactService {
public resourceUrl = SERVER_API_URL + 'api/contacts';
constructor(protected http: HttpClient) {}
create(contact: IContact): Observable<EntityResponseType> {
return this.http.post<IContact>(this.resourceUrl, contact, { observe: 'response' });
}
update(contact: IContact): Observable<EntityResponseType> {
return this.http.put<IContact>(this.resourceUrl, contact, { observe: 'response' });
}
find(id: number): Observable<EntityResponseType> {
return this.http.get<IContact>(`${this.resourceUrl}/${id}`, { observe: 'response' });
}
query(req?: any): Observable<EntityArrayResponseType> {
const options = createRequestOption(req);
return this.http.get<IContact[]>(this.resourceUrl, { params: options, observe: 'response' });
}
delete(id: number): Observable<HttpResponse<any>> {
return this.http.delete<any>(`${this.resourceUrl}/${id}`, { observe: 'response' });
}
}

View File

@ -1,6 +0,0 @@
export * from './contact.service';
export * from './contact-update.component';
export * from './contact-delete-dialog.component';
export * from './contact-detail.component';
export * from './contact.component';
export * from './contact.route';

View File

@ -1,19 +0,0 @@
<form name="deleteForm" (ngSubmit)="confirmDelete(customerContact.id)">
<div class="modal-header">
<h4 class="modal-title" jhiTranslate="entity.delete.title">Confirm delete operation</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"
(click)="clear()">&times;</button>
</div>
<div class="modal-body">
<jhi-alert-error></jhi-alert-error>
<p id="jhi-delete-customerContact-heading" jhiTranslate="hsadminNgApp.customerContact.delete.question" [translateValues]="{id: customerContact.id}">Are you sure you want to delete this Customer Contact?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="clear()">
<fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
</button>
<button id="jhi-confirm-delete-customerContact" type="submit" class="btn btn-danger">
<fa-icon [icon]="'times'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.delete">Delete</span>
</button>
</div>
</form>

View File

@ -1,39 +0,0 @@
<div class="row justify-content-center">
<div class="col-8">
<div *ngIf="customerContact">
<h2><span jhiTranslate="hsadminNgApp.customerContact.detail.title">Customer Contact</span> {{customerContact.id}}</h2>
<hr>
<jhi-alert-error></jhi-alert-error>
<dl class="row-md jh-entity-details">
<dt><span jhiTranslate="hsadminNgApp.customerContact.role">Role</span></dt>
<dd>
<span jhiTranslate="{{'hsadminNgApp.CustomerContactRole.' + customerContact.role}}">{{customerContact.role}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.customerContact.contact">Contact</span></dt>
<dd>
<div *ngIf="customerContact.contactId">
<a [routerLink]="['/contact', customerContact.contactId, 'view']">{{customerContact.contactEmail}}</a>
</div>
</dd>
<dt><span jhiTranslate="hsadminNgApp.customerContact.customer">Customer</span></dt>
<dd>
<div *ngIf="customerContact.customerId">
<a [routerLink]="['/customer', customerContact.customerId, 'view']">{{customerContact.customerPrefix}}</a>
</div>
</dd>
</dl>
<button type="submit"
(click)="previousState()"
class="btn btn-info">
<fa-icon [icon]="'arrow-left'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.back"> Back</span>
</button>
<button type="button"
[routerLink]="['/customer-contact', customerContact.id, 'edit']"
class="btn btn-primary">
<fa-icon [icon]="'pencil-alt'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.edit"> Edit</span>
</button>
</div>
</div>
</div>

View File

@ -1,24 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ICustomerContact } from 'app/shared/model/customer-contact.model';
@Component({
selector: 'jhi-customer-contact-detail',
templateUrl: './customer-contact-detail.component.html'
})
export class CustomerContactDetailComponent implements OnInit {
customerContact: ICustomerContact;
constructor(protected activatedRoute: ActivatedRoute) {}
ngOnInit() {
this.activatedRoute.data.subscribe(({ customerContact }) => {
this.customerContact = customerContact;
});
}
previousState() {
window.history.back();
}
}

View File

@ -1,64 +0,0 @@
<div class="row justify-content-center">
<div class="col-8">
<form name="editForm" role="form" novalidate (ngSubmit)="save()" #editForm="ngForm">
<h2 id="jhi-customer-contact-heading" jhiTranslate="hsadminNgApp.customerContact.home.createOrEditLabel">Create or edit a Customer Contact</h2>
<div>
<jhi-alert-error></jhi-alert-error>
<div class="form-group" [hidden]="!customerContact.id">
<label for="id" jhiTranslate="global.field.id">ID</label>
<input type="text" class="form-control" id="id" name="id"
[(ngModel)]="customerContact.id" readonly />
</div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.customerContact.role" for="field_role">Role</label>
<select class="form-control" name="role" [(ngModel)]="customerContact.role" id="field_role" required>
<option value="CONTRACTUAL">{{'hsadminNgApp.CustomerContactRole.CONTRACTUAL' | translate}}</option>
<option value="TECHNICAL">{{'hsadminNgApp.CustomerContactRole.TECHNICAL' | translate}}</option>
<option value="FINANCIAL">{{'hsadminNgApp.CustomerContactRole.FINANCIAL' | translate}}</option>
</select>
<div [hidden]="!(editForm.controls.role?.dirty && editForm.controls.role?.invalid)">
<small class="form-text text-danger"
[hidden]="!editForm.controls.role?.errors?.required" jhiTranslate="entity.validation.required">
This field is required.
</small>
</div>
</div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.customerContact.contact" for="field_contact">Contact</label>
<select class="form-control" id="field_contact" name="contact" [(ngModel)]="customerContact.contactId" required>
<option *ngIf="!editForm.value.contact" [ngValue]="null" selected></option>
<option [ngValue]="contactOption.id" *ngFor="let contactOption of contacts; trackBy: trackContactById">{{contactOption.email}}</option>
</select>
</div>
<div [hidden]="!(editForm.controls.contact?.dirty && editForm.controls.contact?.invalid)">
<small class="form-text text-danger"
[hidden]="!editForm.controls.contact?.errors?.required" jhiTranslate="entity.validation.required">
This field is required.
</small>
</div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.customerContact.customer" for="field_customer">Customer</label>
<select class="form-control" id="field_customer" name="customer" [(ngModel)]="customerContact.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()">
<fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
</button>
<button type="submit" id="save-entity" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
<fa-icon [icon]="'save'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.save">Save</span>
</button>
</div>
</form>
</div>
</div>

View File

@ -1,66 +0,0 @@
<div>
<h2 id="page-heading">
<span jhiTranslate="hsadminNgApp.customerContact.home.title">Customer Contacts</span>
<button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-customer-contact" [routerLink]="['/customer-contact/new']">
<fa-icon [icon]="'plus'"></fa-icon>
<span jhiTranslate="hsadminNgApp.customerContact.home.createLabel">
Create new Customer Contact
</span>
</button>
</h2>
<jhi-alert></jhi-alert>
<br/>
<div class="table-responsive" *ngIf="customerContacts">
<table class="table table-striped">
<thead>
<tr jhiSort [(predicate)]="predicate" [(ascending)]="reverse" [callback]="reset.bind(this)">
<th jhiSortBy="id"><span jhiTranslate="global.field.id">ID</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th jhiSortBy="role"><span jhiTranslate="hsadminNgApp.customerContact.role">Role</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th jhiSortBy="contactEmail"><span jhiTranslate="hsadminNgApp.customerContact.contact">Contact</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th jhiSortBy="customerPrefix"><span jhiTranslate="hsadminNgApp.customerContact.customer">Customer</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th></th>
</tr>
</thead>
<tbody infinite-scroll (scrolled)="loadPage(page + 1)" [infiniteScrollDisabled]="page >= links['last']" [infiniteScrollDistance]="0">
<tr *ngFor="let customerContact of customerContacts ;trackBy: trackId">
<td><a [routerLink]="['/customer-contact', customerContact.id, 'view' ]">{{customerContact.id}}</a></td>
<td jhiTranslate="{{'hsadminNgApp.CustomerContactRole.' + customerContact.role}}">{{customerContact.role}}</td>
<td>
<div *ngIf="customerContact.contactId">
<a [routerLink]="['../contact', customerContact.contactId , 'view' ]" >{{customerContact.contactEmail}}</a>
</div>
</td>
<td>
<div *ngIf="customerContact.customerId">
<a [routerLink]="['../customer', customerContact.customerId , 'view' ]" >{{customerContact.customerPrefix}}</a>
</div>
</td>
<td class="text-right">
<div class="btn-group flex-btn-group-container">
<button type="submit"
[routerLink]="['/customer-contact', customerContact.id, 'view' ]"
class="btn btn-info btn-sm">
<fa-icon [icon]="'eye'"></fa-icon>
<span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
</button>
<button type="submit"
[routerLink]="['/customer-contact', customerContact.id, 'edit']"
class="btn btn-primary btn-sm">
<fa-icon [icon]="'pencil-alt'"></fa-icon>
<span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
</button>
<button type="submit"
[routerLink]="['/', 'customer-contact', { outlets: { popup: customerContact.id + '/delete'} }]"
replaceUrl="true"
queryParamsHandling="merge"
class="btn btn-danger btn-sm">
<fa-icon [icon]="'times'"></fa-icon>
<span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>

View File

@ -1,108 +0,0 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { HttpErrorResponse, HttpHeaders, HttpResponse } from '@angular/common/http';
import { Subscription } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { JhiEventManager, JhiParseLinks, JhiAlertService } from 'ng-jhipster';
import { ICustomerContact } from 'app/shared/model/customer-contact.model';
import { AccountService } from 'app/core';
import { ITEMS_PER_PAGE } from 'app/shared';
import { CustomerContactService } from './customer-contact.service';
@Component({
selector: 'jhi-customer-contact',
templateUrl: './customer-contact.component.html'
})
export class CustomerContactComponent implements OnInit, OnDestroy {
customerContacts: ICustomerContact[];
currentAccount: any;
eventSubscriber: Subscription;
itemsPerPage: number;
links: any;
page: any;
predicate: any;
reverse: any;
totalItems: number;
constructor(
protected customerContactService: CustomerContactService,
protected jhiAlertService: JhiAlertService,
protected eventManager: JhiEventManager,
protected parseLinks: JhiParseLinks,
protected accountService: AccountService
) {
this.customerContacts = [];
this.itemsPerPage = ITEMS_PER_PAGE;
this.page = 0;
this.links = {
last: 0
};
this.predicate = 'id';
this.reverse = true;
}
loadAll() {
this.customerContactService
.query({
page: this.page,
size: this.itemsPerPage,
sort: this.sort()
})
.subscribe(
(res: HttpResponse<ICustomerContact[]>) => this.paginateCustomerContacts(res.body, res.headers),
(res: HttpErrorResponse) => this.onError(res.message)
);
}
reset() {
this.page = 0;
this.customerContacts = [];
this.loadAll();
}
loadPage(page) {
this.page = page;
this.loadAll();
}
ngOnInit() {
this.loadAll();
this.accountService.identity().then(account => {
this.currentAccount = account;
});
this.registerChangeInCustomerContacts();
}
ngOnDestroy() {
this.eventManager.destroy(this.eventSubscriber);
}
trackId(index: number, item: ICustomerContact) {
return item.id;
}
registerChangeInCustomerContacts() {
this.eventSubscriber = this.eventManager.subscribe('customerContactListModification', response => this.reset());
}
sort() {
const result = [this.predicate + ',' + (this.reverse ? 'asc' : 'desc')];
if (this.predicate !== 'id') {
result.push('id');
}
return result;
}
protected paginateCustomerContacts(data: ICustomerContact[], headers: HttpHeaders) {
this.links = this.parseLinks.parse(headers.get('link'));
this.totalItems = parseInt(headers.get('X-Total-Count'), 10);
for (let i = 0; i < data.length; i++) {
this.customerContacts.push(data[i]);
}
}
protected onError(errorMessage: string) {
this.jhiAlertService.error(errorMessage, null, null);
}
}

View File

@ -1,45 +0,0 @@
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { RouterModule } from '@angular/router';
import { JhiLanguageService } from 'ng-jhipster';
import { JhiLanguageHelper } from 'app/core';
import { HsadminNgSharedModule } from 'app/shared';
import {
CustomerContactComponent,
CustomerContactDetailComponent,
CustomerContactUpdateComponent,
CustomerContactDeletePopupComponent,
CustomerContactDeleteDialogComponent,
customerContactRoute,
customerContactPopupRoute
} from './';
const ENTITY_STATES = [...customerContactRoute, ...customerContactPopupRoute];
@NgModule({
imports: [HsadminNgSharedModule, RouterModule.forChild(ENTITY_STATES)],
declarations: [
CustomerContactComponent,
CustomerContactDetailComponent,
CustomerContactUpdateComponent,
CustomerContactDeleteDialogComponent,
CustomerContactDeletePopupComponent
],
entryComponents: [
CustomerContactComponent,
CustomerContactUpdateComponent,
CustomerContactDeleteDialogComponent,
CustomerContactDeletePopupComponent
],
providers: [{ provide: JhiLanguageService, useClass: JhiLanguageService }],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class HsadminNgCustomerContactModule {
constructor(private languageService: JhiLanguageService, private languageHelper: JhiLanguageHelper) {
this.languageHelper.language.subscribe((languageKey: string) => {
if (languageKey !== undefined) {
this.languageService.changeLanguage(languageKey);
}
});
}
}

View File

@ -1,93 +0,0 @@
import { Injectable } from '@angular/core';
import { HttpResponse } from '@angular/common/http';
import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot, Routes } from '@angular/router';
import { UserRouteAccessService } from 'app/core';
import { Observable, of } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { CustomerContact } from 'app/shared/model/customer-contact.model';
import { CustomerContactService } from './customer-contact.service';
import { CustomerContactComponent } from './customer-contact.component';
import { CustomerContactDetailComponent } from './customer-contact-detail.component';
import { CustomerContactUpdateComponent } from './customer-contact-update.component';
import { CustomerContactDeletePopupComponent } from './customer-contact-delete-dialog.component';
import { ICustomerContact } from 'app/shared/model/customer-contact.model';
@Injectable({ providedIn: 'root' })
export class CustomerContactResolve implements Resolve<ICustomerContact> {
constructor(private service: CustomerContactService) {}
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<ICustomerContact> {
const id = route.params['id'] ? route.params['id'] : null;
if (id) {
return this.service.find(id).pipe(
filter((response: HttpResponse<CustomerContact>) => response.ok),
map((customerContact: HttpResponse<CustomerContact>) => customerContact.body)
);
}
return of(new CustomerContact());
}
}
export const customerContactRoute: Routes = [
{
path: '',
component: CustomerContactComponent,
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.customerContact.home.title'
},
canActivate: [UserRouteAccessService]
},
{
path: ':id/view',
component: CustomerContactDetailComponent,
resolve: {
customerContact: CustomerContactResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.customerContact.home.title'
},
canActivate: [UserRouteAccessService]
},
{
path: 'new',
component: CustomerContactUpdateComponent,
resolve: {
customerContact: CustomerContactResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.customerContact.home.title'
},
canActivate: [UserRouteAccessService]
},
{
path: ':id/edit',
component: CustomerContactUpdateComponent,
resolve: {
customerContact: CustomerContactResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.customerContact.home.title'
},
canActivate: [UserRouteAccessService]
}
];
export const customerContactPopupRoute: Routes = [
{
path: ':id/delete',
component: CustomerContactDeletePopupComponent,
resolve: {
customerContact: CustomerContactResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.customerContact.home.title'
},
canActivate: [UserRouteAccessService],
outlet: 'popup'
}
];

View File

@ -1,38 +0,0 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { SERVER_API_URL } from 'app/app.constants';
import { createRequestOption } from 'app/shared';
import { ICustomerContact } from 'app/shared/model/customer-contact.model';
type EntityResponseType = HttpResponse<ICustomerContact>;
type EntityArrayResponseType = HttpResponse<ICustomerContact[]>;
@Injectable({ providedIn: 'root' })
export class CustomerContactService {
public resourceUrl = SERVER_API_URL + 'api/customer-contacts';
constructor(protected http: HttpClient) {}
create(customerContact: ICustomerContact): Observable<EntityResponseType> {
return this.http.post<ICustomerContact>(this.resourceUrl, customerContact, { observe: 'response' });
}
update(customerContact: ICustomerContact): Observable<EntityResponseType> {
return this.http.put<ICustomerContact>(this.resourceUrl, customerContact, { observe: 'response' });
}
find(id: number): Observable<EntityResponseType> {
return this.http.get<ICustomerContact>(`${this.resourceUrl}/${id}`, { observe: 'response' });
}
query(req?: any): Observable<EntityArrayResponseType> {
const options = createRequestOption(req);
return this.http.get<ICustomerContact[]>(this.resourceUrl, { params: options, observe: 'response' });
}
delete(id: number): Observable<HttpResponse<any>> {
return this.http.delete<any>(`${this.resourceUrl}/${id}`, { observe: 'response' });
}
}

View File

@ -1,6 +0,0 @@
export * from './customer-contact.service';
export * from './customer-contact-update.component';
export * from './customer-contact-delete-dialog.component';
export * from './customer-contact-detail.component';
export * from './customer-contact.component';
export * from './customer-contact.route';

View File

@ -17,22 +17,22 @@
<dd> <dd>
<span>{{customer.name}}</span> <span>{{customer.name}}</span>
</dd> </dd>
<dt><span jhiTranslate="hsadminNgApp.customer.contractualAddress">Contractual Address</span></dt>
<dd>
<span>{{customer.contractualAddress}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.customer.contractualSalutation">Contractual Salutation</span></dt> <dt><span jhiTranslate="hsadminNgApp.customer.contractualSalutation">Contractual Salutation</span></dt>
<dd> <dd>
<span>{{customer.contractualSalutation}}</span> <span>{{customer.contractualSalutation}}</span>
</dd> </dd>
<dt><span jhiTranslate="hsadminNgApp.customer.billingAddress">Billing Address</span></dt> <dt><span jhiTranslate="hsadminNgApp.customer.contractualAddress">Contractual Address</span></dt>
<dd> <dd>
<span>{{customer.billingAddress}}</span> <span>{{customer.contractualAddress}}</span>
</dd> </dd>
<dt><span jhiTranslate="hsadminNgApp.customer.billingSalutation">Billing Salutation</span></dt> <dt><span jhiTranslate="hsadminNgApp.customer.billingSalutation">Billing Salutation</span></dt>
<dd> <dd>
<span>{{customer.billingSalutation}}</span> <span>{{customer.billingSalutation}}</span>
</dd> </dd>
<dt><span jhiTranslate="hsadminNgApp.customer.billingAddress">Billing Address</span></dt>
<dd>
<span>{{customer.billingAddress}}</span>
</dd>
</dl> </dl>
<button type="submit" <button type="submit"

View File

@ -48,85 +48,68 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.customer.name" <label class="form-control-label" jhiTranslate="hsadminNgApp.customer.name" for="field_name">Name</label>
for="field_name">Name</label>
<input type="text" class="form-control" name="name" id="field_name" <input type="text" class="form-control" name="name" id="field_name"
[(ngModel)]="customer.name" required maxlength="80"/> [(ngModel)]="customer.name" required maxlength="80"/>
<div [hidden]="!(editForm.controls.name?.dirty && editForm.controls.name?.invalid)"> <div [hidden]="!(editForm.controls.name?.dirty && editForm.controls.name?.invalid)">
<small class="form-text text-danger" <small class="form-text text-danger"
[hidden]="!editForm.controls.name?.errors?.required" [hidden]="!editForm.controls.name?.errors?.required" jhiTranslate="entity.validation.required">
jhiTranslate="entity.validation.required">
This field is required. This field is required.
</small> </small>
<small class="form-text text-danger" <small class="form-text text-danger"
[hidden]="!editForm.controls.name?.errors?.maxlength" [hidden]="!editForm.controls.name?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 80 }">
jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 80 }">
This field cannot be longer than 80 characters. This field cannot be longer than 80 characters.
</small> </small>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.customer.contractualAddress" <label class="form-control-label" jhiTranslate="hsadminNgApp.customer.contractualSalutation" for="field_contractualSalutation">Contractual Salutation</label>
for="field_contractualAddress">Contractual Address</label> <input type="text" class="form-control" name="contractualSalutation" id="field_contractualSalutation"
[(ngModel)]="customer.contractualSalutation" maxlength="80"/>
<div [hidden]="!(editForm.controls.contractualSalutation?.dirty && editForm.controls.contractualSalutation?.invalid)">
<small class="form-text text-danger"
[hidden]="!editForm.controls.contractualSalutation?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 80 }">
This field cannot be longer than 80 characters.
</small>
</div>
</div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.customer.contractualAddress" for="field_contractualAddress">Contractual Address</label>
<input type="text" class="form-control" name="contractualAddress" id="field_contractualAddress" <input type="text" class="form-control" name="contractualAddress" id="field_contractualAddress"
[(ngModel)]="customer.contractualAddress" required maxlength="400"/> [(ngModel)]="customer.contractualAddress" required maxlength="400"/>
<div <div [hidden]="!(editForm.controls.contractualAddress?.dirty && editForm.controls.contractualAddress?.invalid)">
[hidden]="!(editForm.controls.contractualAddress?.dirty && editForm.controls.contractualAddress?.invalid)">
<small class="form-text text-danger" <small class="form-text text-danger"
[hidden]="!editForm.controls.contractualAddress?.errors?.required" [hidden]="!editForm.controls.contractualAddress?.errors?.required" jhiTranslate="entity.validation.required">
jhiTranslate="entity.validation.required">
This field is required. This field is required.
</small> </small>
<small class="form-text text-danger" <small class="form-text text-danger"
[hidden]="!editForm.controls.contractualAddress?.errors?.maxlength" [hidden]="!editForm.controls.contractualAddress?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 400 }">
jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 400 }">
This field cannot be longer than 400 characters. This field cannot be longer than 400 characters.
</small> </small>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.customer.contractualSalutation" <label class="form-control-label" jhiTranslate="hsadminNgApp.customer.billingSalutation" for="field_billingSalutation">Billing Salutation</label>
for="field_contractualSalutation">Contractual Salutation</label>
<input type="text" class="form-control" name="contractualSalutation"
id="field_contractualSalutation"
[(ngModel)]="customer.contractualSalutation" maxlength="80"/>
<div
[hidden]="!(editForm.controls.contractualSalutation?.dirty && editForm.controls.contractualSalutation?.invalid)">
<small class="form-text text-danger"
[hidden]="!editForm.controls.contractualSalutation?.errors?.maxlength"
jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 80 }">
This field cannot be longer than 80 characters.
</small>
</div>
</div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.customer.billingAddress"
for="field_billingAddress">Billing Address</label>
<input type="text" class="form-control" name="billingAddress" id="field_billingAddress"
[(ngModel)]="customer.billingAddress" maxlength="400"/>
<div
[hidden]="!(editForm.controls.billingAddress?.dirty && editForm.controls.billingAddress?.invalid)">
<small class="form-text text-danger"
[hidden]="!editForm.controls.billingAddress?.errors?.maxlength"
jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 400 }">
This field cannot be longer than 400 characters.
</small>
</div>
</div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.customer.billingSalutation"
for="field_billingSalutation">Billing Salutation</label>
<input type="text" class="form-control" name="billingSalutation" id="field_billingSalutation" <input type="text" class="form-control" name="billingSalutation" id="field_billingSalutation"
[(ngModel)]="customer.billingSalutation" maxlength="80"/> [(ngModel)]="customer.billingSalutation" maxlength="80"/>
<div <div [hidden]="!(editForm.controls.billingSalutation?.dirty && editForm.controls.billingSalutation?.invalid)">
[hidden]="!(editForm.controls.billingSalutation?.dirty && editForm.controls.billingSalutation?.invalid)">
<small class="form-text text-danger" <small class="form-text text-danger"
[hidden]="!editForm.controls.billingSalutation?.errors?.maxlength" [hidden]="!editForm.controls.billingSalutation?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 80 }">
jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 80 }">
This field cannot be longer than 80 characters. This field cannot be longer than 80 characters.
</small> </small>
</div> </div>
</div> </div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.customer.billingAddress" for="field_billingAddress">Billing Address</label>
<input type="text" class="form-control" name="billingAddress" id="field_billingAddress"
[(ngModel)]="customer.billingAddress" maxlength="400"/>
<div [hidden]="!(editForm.controls.billingAddress?.dirty && editForm.controls.billingAddress?.invalid)">
<small class="form-text text-danger"
[hidden]="!editForm.controls.billingAddress?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 400 }">
This field cannot be longer than 400 characters.
</small>
</div>
</div>
</div> </div>
<div> <div>

View File

@ -17,22 +17,11 @@
<th jhiSortBy="id"><span jhiTranslate="global.field.id">ID</span> <fa-icon [icon]="'sort'"></fa-icon></th> <th jhiSortBy="id"><span jhiTranslate="global.field.id">ID</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th jhiSortBy="number"><span jhiTranslate="hsadminNgApp.customer.number">Number</span> <fa-icon [icon]="'sort'"></fa-icon></th> <th jhiSortBy="number"><span jhiTranslate="hsadminNgApp.customer.number">Number</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> <th jhiSortBy="name"><span jhiTranslate="hsadminNgApp.customer.name">Name</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<fa-icon [icon]="'sort'"></fa-icon> <th jhiSortBy="contractualSalutation"><span jhiTranslate="hsadminNgApp.customer.contractualSalutation">Contractual Salutation</span> <fa-icon [icon]="'sort'"></fa-icon></th>
</th> <th jhiSortBy="contractualAddress"><span jhiTranslate="hsadminNgApp.customer.contractualAddress">Contractual Address</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th jhiSortBy="contractualAddress"><span jhiTranslate="hsadminNgApp.customer.contractualAddress">Contractual Address</span> <th jhiSortBy="billingSalutation"><span jhiTranslate="hsadminNgApp.customer.billingSalutation">Billing Salutation</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<fa-icon [icon]="'sort'"></fa-icon> <th jhiSortBy="billingAddress"><span jhiTranslate="hsadminNgApp.customer.billingAddress">Billing Address</span> <fa-icon [icon]="'sort'"></fa-icon></th>
</th>
<th jhiSortBy="contractualSalutation"><span jhiTranslate="hsadminNgApp.customer.contractualSalutation">Contractual 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="billingSalutation"><span jhiTranslate="hsadminNgApp.customer.billingSalutation">Billing Salutation</span>
<fa-icon [icon]="'sort'"></fa-icon>
</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
@ -42,10 +31,10 @@
<td>{{customer.number}}</td> <td>{{customer.number}}</td>
<td>{{customer.prefix}}</td> <td>{{customer.prefix}}</td>
<td>{{customer.name}}</td> <td>{{customer.name}}</td>
<td>{{customer.contractualAddress}}</td>
<td>{{customer.contractualSalutation}}</td> <td>{{customer.contractualSalutation}}</td>
<td>{{customer.billingAddress}}</td> <td>{{customer.contractualAddress}}</td>
<td>{{customer.billingSalutation}}</td> <td>{{customer.billingSalutation}}</td>
<td>{{customer.billingAddress}}</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"

View File

@ -1,4 +1,4 @@
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
@NgModule({ @NgModule({
@ -8,14 +8,6 @@ import { RouterModule } from '@angular/router';
path: 'customer', path: 'customer',
loadChildren: './customer/customer.module#HsadminNgCustomerModule' loadChildren: './customer/customer.module#HsadminNgCustomerModule'
}, },
{
path: 'contact',
loadChildren: './contact/contact.module#HsadminNgContactModule'
},
{
path: 'customer-contact',
loadChildren: './customer-contact/customer-contact.module#HsadminNgCustomerContactModule'
},
{ {
path: 'membership', path: 'membership',
loadChildren: './membership/membership.module#HsadminNgMembershipModule' loadChildren: './membership/membership.module#HsadminNgMembershipModule'
@ -29,20 +21,8 @@ import { RouterModule } from '@angular/router';
loadChildren: './asset/asset.module#HsadminNgAssetModule' loadChildren: './asset/asset.module#HsadminNgAssetModule'
}, },
{ {
path: 'customer', path: 'sepa-mandate',
loadChildren: './customer/customer.module#HsadminNgCustomerModule' loadChildren: './sepa-mandate/sepa-mandate.module#HsadminNgSepaMandateModule'
},
{
path: 'membership',
loadChildren: './membership/membership.module#HsadminNgMembershipModule'
},
{
path: 'share',
loadChildren: './share/share.module#HsadminNgShareModule'
},
{
path: 'asset',
loadChildren: './asset/asset.module#HsadminNgAssetModule'
} }
/* jhipster-needle-add-entity-route - JHipster will add entity modules routes here */ /* jhipster-needle-add-entity-route - JHipster will add entity modules routes here */
]) ])

View File

@ -5,13 +5,17 @@
<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">
<dt><span jhiTranslate="hsadminNgApp.membership.sinceDate">Since Date</span></dt> <dt><span jhiTranslate="hsadminNgApp.membership.from">From</span></dt>
<dd> <dd>
<span>{{membership.sinceDate}}</span> <span>{{membership.from}}</span>
</dd> </dd>
<dt><span jhiTranslate="hsadminNgApp.membership.untilDate">Until Date</span></dt> <dt><span jhiTranslate="hsadminNgApp.membership.to">To</span></dt>
<dd> <dd>
<span>{{membership.untilDate}}</span> <span>{{membership.to}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.membership.comment">Comment</span></dt>
<dd>
<span>{{membership.comment}}</span>
</dd> </dd>
<dt><span jhiTranslate="hsadminNgApp.membership.customer">Customer</span></dt> <dt><span jhiTranslate="hsadminNgApp.membership.customer">Customer</span></dt>
<dd> <dd>

View File

@ -10,44 +10,53 @@
[(ngModel)]="membership.id" readonly /> [(ngModel)]="membership.id" readonly />
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.membership.sinceDate" for="field_sinceDate">Since Date</label> <label class="form-control-label" jhiTranslate="hsadminNgApp.membership.from" for="field_from">From</label>
<div class="input-group"> <div class="input-group">
<input id="field_sinceDate" type="text" class="form-control" name="sinceDate" ngbDatepicker #sinceDateDp="ngbDatepicker" [(ngModel)]="membership.sinceDate" <input id="field_from" type="text" class="form-control" name="from" ngbDatepicker #fromDp="ngbDatepicker" [(ngModel)]="membership.from"
required/> required/>
<span class="input-group-append"> <span class="input-group-append">
<button type="button" class="btn btn-secondary" (click)="sinceDateDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button> <button type="button" class="btn btn-secondary" (click)="fromDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button>
</span> </span>
</div> </div>
<div [hidden]="!(editForm.controls.sinceDate?.dirty && editForm.controls.sinceDate?.invalid)"> <div [hidden]="!(editForm.controls.from?.dirty && editForm.controls.from?.invalid)">
<small class="form-text text-danger" <small class="form-text text-danger"
[hidden]="!editForm.controls.sinceDate?.errors?.required" jhiTranslate="entity.validation.required"> [hidden]="!editForm.controls.from?.errors?.required" jhiTranslate="entity.validation.required">
This field is required. This field is required.
</small> </small>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.membership.untilDate" for="field_untilDate">Until Date</label> <label class="form-control-label" jhiTranslate="hsadminNgApp.membership.to" for="field_to">To</label>
<div class="input-group"> <div class="input-group">
<input id="field_untilDate" type="text" class="form-control" name="untilDate" ngbDatepicker #untilDateDp="ngbDatepicker" [(ngModel)]="membership.untilDate" <input id="field_to" type="text" class="form-control" name="to" ngbDatepicker #toDp="ngbDatepicker" [(ngModel)]="membership.to"
/> />
<span class="input-group-append"> <span class="input-group-append">
<button type="button" class="btn btn-secondary" (click)="untilDateDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button> <button type="button" class="btn btn-secondary" (click)="toDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button>
</span> </span>
</div> </div>
</div> </div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.membership.comment" for="field_comment">Comment</label>
<input type="text" class="form-control" name="comment" id="field_comment"
[(ngModel)]="membership.comment" maxlength="160"/>
<div [hidden]="!(editForm.controls.comment?.dirty && editForm.controls.comment?.invalid)">
<small class="form-text text-danger"
[hidden]="!editForm.controls.comment?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 160 }">
This field cannot be longer than 160 characters.
</small>
</div>
</div>
<div class="form-group"> <div class="form-group">
<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" <select class="form-control" id="field_customer" name="customer" [(ngModel)]="membership.customerId" required>
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.prefix}}</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)">
<small class="form-text text-danger" <small class="form-text text-danger"
[hidden]="!editForm.controls.customer?.errors?.required" [hidden]="!editForm.controls.customer?.errors?.required" jhiTranslate="entity.validation.required">
jhiTranslate="entity.validation.required">
This field is required. This field is required.
</small> </small>
</div> </div>

View File

@ -19,8 +19,8 @@ export class MembershipUpdateComponent implements OnInit {
isSaving: boolean; isSaving: boolean;
customers: ICustomer[]; customers: ICustomer[];
sinceDateDp: any; fromDp: any;
untilDateDp: any; toDp: any;
constructor( constructor(
protected jhiAlertService: JhiAlertService, protected jhiAlertService: JhiAlertService,

View File

@ -15,8 +15,9 @@
<thead> <thead>
<tr jhiSort [(predicate)]="predicate" [(ascending)]="reverse" [callback]="reset.bind(this)"> <tr jhiSort [(predicate)]="predicate" [(ascending)]="reverse" [callback]="reset.bind(this)">
<th jhiSortBy="id"><span jhiTranslate="global.field.id">ID</span> <fa-icon [icon]="'sort'"></fa-icon></th> <th jhiSortBy="id"><span jhiTranslate="global.field.id">ID</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th jhiSortBy="sinceDate"><span jhiTranslate="hsadminNgApp.membership.sinceDate">Since Date</span> <fa-icon [icon]="'sort'"></fa-icon></th> <th jhiSortBy="from"><span jhiTranslate="hsadminNgApp.membership.from">From</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th jhiSortBy="untilDate"><span jhiTranslate="hsadminNgApp.membership.untilDate">Until Date</span> <fa-icon [icon]="'sort'"></fa-icon></th> <th jhiSortBy="to"><span jhiTranslate="hsadminNgApp.membership.to">To</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th jhiSortBy="comment"><span jhiTranslate="hsadminNgApp.membership.comment">Comment</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>
@ -24,8 +25,9 @@
<tbody infinite-scroll (scrolled)="loadPage(page + 1)" [infiniteScrollDisabled]="page >= links['last']" [infiniteScrollDistance]="0"> <tbody infinite-scroll (scrolled)="loadPage(page + 1)" [infiniteScrollDisabled]="page >= links['last']" [infiniteScrollDistance]="0">
<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.sinceDate | date:'mediumDate'}}</td> <td>{{membership.from | date:'mediumDate'}}</td>
<td>{{membership.untilDate | date:'mediumDate'}}</td> <td>{{membership.to | date:'mediumDate'}}</td>
<td>{{membership.comment}}</td>
<td> <td>
<div *ngIf="membership.customerId"> <div *ngIf="membership.customerId">
<a [routerLink]="['../customer', membership.customerId , 'view' ]" >{{membership.customerPrefix}}</a> <a [routerLink]="['../customer', membership.customerId , 'view' ]" >{{membership.customerPrefix}}</a>

View File

@ -51,16 +51,16 @@ export class MembershipService {
protected convertDateFromClient(membership: IMembership): IMembership { protected convertDateFromClient(membership: IMembership): IMembership {
const copy: IMembership = Object.assign({}, membership, { const copy: IMembership = Object.assign({}, membership, {
sinceDate: membership.sinceDate != null && membership.sinceDate.isValid() ? membership.sinceDate.format(DATE_FORMAT) : null, from: membership.from != null && membership.from.isValid() ? membership.from.format(DATE_FORMAT) : null,
untilDate: membership.untilDate != null && membership.untilDate.isValid() ? membership.untilDate.format(DATE_FORMAT) : null to: membership.to != null && membership.to.isValid() ? membership.to.format(DATE_FORMAT) : null
}); });
return copy; return copy;
} }
protected convertDateFromServer(res: EntityResponseType): EntityResponseType { protected convertDateFromServer(res: EntityResponseType): EntityResponseType {
if (res.body) { if (res.body) {
res.body.sinceDate = res.body.sinceDate != null ? moment(res.body.sinceDate) : null; res.body.from = res.body.from != null ? moment(res.body.from) : null;
res.body.untilDate = res.body.untilDate != null ? moment(res.body.untilDate) : null; res.body.to = res.body.to != null ? moment(res.body.to) : null;
} }
return res; return res;
} }
@ -68,8 +68,8 @@ export class MembershipService {
protected convertDateArrayFromServer(res: EntityArrayResponseType): EntityArrayResponseType { protected convertDateArrayFromServer(res: EntityArrayResponseType): EntityArrayResponseType {
if (res.body) { if (res.body) {
res.body.forEach((membership: IMembership) => { res.body.forEach((membership: IMembership) => {
membership.sinceDate = membership.sinceDate != null ? moment(membership.sinceDate) : null; membership.from = membership.from != null ? moment(membership.from) : null;
membership.untilDate = membership.untilDate != null ? moment(membership.untilDate) : null; membership.to = membership.to != null ? moment(membership.to) : null;
}); });
} }
return res; return res;

View File

@ -0,0 +1,6 @@
export * from './sepa-mandate.service';
export * from './sepa-mandate-update.component';
export * from './sepa-mandate-delete-dialog.component';
export * from './sepa-mandate-detail.component';
export * from './sepa-mandate.component';
export * from './sepa-mandate.route';

View File

@ -1,4 +1,4 @@
<form name="deleteForm" (ngSubmit)="confirmDelete(contact.id)"> <form name="deleteForm" (ngSubmit)="confirmDelete(sepaMandate.id)">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title" jhiTranslate="entity.delete.title">Confirm delete operation</h4> <h4 class="modal-title" jhiTranslate="entity.delete.title">Confirm delete operation</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" <button type="button" class="close" data-dismiss="modal" aria-hidden="true"
@ -6,13 +6,13 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<jhi-alert-error></jhi-alert-error> <jhi-alert-error></jhi-alert-error>
<p id="jhi-delete-contact-heading" jhiTranslate="hsadminNgApp.contact.delete.question" [translateValues]="{id: contact.id}">Are you sure you want to delete this Contact?</p> <p id="jhi-delete-sepaMandate-heading" jhiTranslate="hsadminNgApp.sepaMandate.delete.question" [translateValues]="{id: sepaMandate.id}">Are you sure you want to delete this Sepa Mandate?</p>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="clear()"> <button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="clear()">
<fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span> <fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
</button> </button>
<button id="jhi-confirm-delete-contact" type="submit" class="btn btn-danger"> <button id="jhi-confirm-delete-sepaMandate" type="submit" class="btn btn-danger">
<fa-icon [icon]="'times'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.delete">Delete</span> <fa-icon [icon]="'times'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.delete">Delete</span>
</button> </button>
</div> </div>

View File

@ -4,18 +4,18 @@ import { ActivatedRoute, Router } from '@angular/router';
import { NgbActiveModal, NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; import { NgbActiveModal, NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
import { JhiEventManager } from 'ng-jhipster'; import { JhiEventManager } from 'ng-jhipster';
import { ICustomerContact } from 'app/shared/model/customer-contact.model'; import { ISepaMandate } from 'app/shared/model/sepa-mandate.model';
import { CustomerContactService } from './customer-contact.service'; import { SepaMandateService } from './sepa-mandate.service';
@Component({ @Component({
selector: 'jhi-customer-contact-delete-dialog', selector: 'jhi-sepa-mandate-delete-dialog',
templateUrl: './customer-contact-delete-dialog.component.html' templateUrl: './sepa-mandate-delete-dialog.component.html'
}) })
export class CustomerContactDeleteDialogComponent { export class SepaMandateDeleteDialogComponent {
customerContact: ICustomerContact; sepaMandate: ISepaMandate;
constructor( constructor(
protected customerContactService: CustomerContactService, protected sepaMandateService: SepaMandateService,
public activeModal: NgbActiveModal, public activeModal: NgbActiveModal,
protected eventManager: JhiEventManager protected eventManager: JhiEventManager
) {} ) {}
@ -25,10 +25,10 @@ export class CustomerContactDeleteDialogComponent {
} }
confirmDelete(id: number) { confirmDelete(id: number) {
this.customerContactService.delete(id).subscribe(response => { this.sepaMandateService.delete(id).subscribe(response => {
this.eventManager.broadcast({ this.eventManager.broadcast({
name: 'customerContactListModification', name: 'sepaMandateListModification',
content: 'Deleted an customerContact' content: 'Deleted an sepaMandate'
}); });
this.activeModal.dismiss(true); this.activeModal.dismiss(true);
}); });
@ -36,29 +36,29 @@ export class CustomerContactDeleteDialogComponent {
} }
@Component({ @Component({
selector: 'jhi-customer-contact-delete-popup', selector: 'jhi-sepa-mandate-delete-popup',
template: '' template: ''
}) })
export class CustomerContactDeletePopupComponent implements OnInit, OnDestroy { export class SepaMandateDeletePopupComponent implements OnInit, OnDestroy {
protected ngbModalRef: NgbModalRef; protected ngbModalRef: NgbModalRef;
constructor(protected activatedRoute: ActivatedRoute, protected router: Router, protected modalService: NgbModal) {} constructor(protected activatedRoute: ActivatedRoute, protected router: Router, protected modalService: NgbModal) {}
ngOnInit() { ngOnInit() {
this.activatedRoute.data.subscribe(({ customerContact }) => { this.activatedRoute.data.subscribe(({ sepaMandate }) => {
setTimeout(() => { setTimeout(() => {
this.ngbModalRef = this.modalService.open(CustomerContactDeleteDialogComponent as Component, { this.ngbModalRef = this.modalService.open(SepaMandateDeleteDialogComponent as Component, {
size: 'lg', size: 'lg',
backdrop: 'static' backdrop: 'static'
}); });
this.ngbModalRef.componentInstance.customerContact = customerContact; this.ngbModalRef.componentInstance.sepaMandate = sepaMandate;
this.ngbModalRef.result.then( this.ngbModalRef.result.then(
result => { result => {
this.router.navigate(['/customer-contact', { outlets: { popup: null } }]); this.router.navigate(['/sepa-mandate', { outlets: { popup: null } }]);
this.ngbModalRef = null; this.ngbModalRef = null;
}, },
reason => { reason => {
this.router.navigate(['/customer-contact', { outlets: { popup: null } }]); this.router.navigate(['/sepa-mandate', { outlets: { popup: null } }]);
this.ngbModalRef = null; this.ngbModalRef = null;
} }
); );

View File

@ -0,0 +1,65 @@
<div class="row justify-content-center">
<div class="col-8">
<div *ngIf="sepaMandate">
<h2><span jhiTranslate="hsadminNgApp.sepaMandate.detail.title">Sepa Mandate</span> {{sepaMandate.id}}</h2>
<hr>
<jhi-alert-error></jhi-alert-error>
<dl class="row-md jh-entity-details">
<dt><span jhiTranslate="hsadminNgApp.sepaMandate.reference">Reference</span></dt>
<dd>
<span>{{sepaMandate.reference}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.sepaMandate.iban">Iban</span></dt>
<dd>
<span>{{sepaMandate.iban}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.sepaMandate.bic">Bic</span></dt>
<dd>
<span>{{sepaMandate.bic}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.sepaMandate.created">Created</span></dt>
<dd>
<span>{{sepaMandate.created}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.sepaMandate.validFrom">Valid From</span></dt>
<dd>
<span>{{sepaMandate.validFrom}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.sepaMandate.validTo">Valid To</span></dt>
<dd>
<span>{{sepaMandate.validTo}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.sepaMandate.lastUsed">Last Used</span></dt>
<dd>
<span>{{sepaMandate.lastUsed}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.sepaMandate.cancelled">Cancelled</span></dt>
<dd>
<span>{{sepaMandate.cancelled}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.sepaMandate.comment">Comment</span></dt>
<dd>
<span>{{sepaMandate.comment}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.sepaMandate.customer">Customer</span></dt>
<dd>
<div *ngIf="sepaMandate.customerId">
<a [routerLink]="['/customer', sepaMandate.customerId, 'view']">{{sepaMandate.customerPrefix}}</a>
</div>
</dd>
</dl>
<button type="submit"
(click)="previousState()"
class="btn btn-info">
<fa-icon [icon]="'arrow-left'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.back"> Back</span>
</button>
<button type="button"
[routerLink]="['/sepa-mandate', sepaMandate.id, 'edit']"
class="btn btn-primary">
<fa-icon [icon]="'pencil-alt'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.edit"> Edit</span>
</button>
</div>
</div>
</div>

View File

@ -0,0 +1,24 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ISepaMandate } from 'app/shared/model/sepa-mandate.model';
@Component({
selector: 'jhi-sepa-mandate-detail',
templateUrl: './sepa-mandate-detail.component.html'
})
export class SepaMandateDetailComponent implements OnInit {
sepaMandate: ISepaMandate;
constructor(protected activatedRoute: ActivatedRoute) {}
ngOnInit() {
this.activatedRoute.data.subscribe(({ sepaMandate }) => {
this.sepaMandate = sepaMandate;
});
}
previousState() {
window.history.back();
}
}

Some files were not shown because too many files have changed in this diff Show More