Model customers.
This commit is contained in:
parent
bd5bb859d9
commit
7f0dfebaa4
@ -38,11 +38,11 @@
|
||||
"otherEntityName": "membership",
|
||||
"otherEntityRelationshipName": "asset",
|
||||
"relationshipValidateRules": "required",
|
||||
"relationshipName": "member",
|
||||
"otherEntityField": "id"
|
||||
"relationshipName": "membership",
|
||||
"otherEntityField": "from"
|
||||
}
|
||||
],
|
||||
"changelogDate": "20190403083740",
|
||||
"changelogDate": "20190418073046",
|
||||
"entityTableName": "asset",
|
||||
"dto": "mapstruct",
|
||||
"pagination": "infinite-scroll",
|
||||
|
@ -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": "*"
|
||||
}
|
@ -32,6 +32,14 @@
|
||||
],
|
||||
"fieldValidateRulesMaxlength": 80
|
||||
},
|
||||
{
|
||||
"fieldName": "contractualSalutation",
|
||||
"fieldType": "String",
|
||||
"fieldValidateRules": [
|
||||
"maxlength"
|
||||
],
|
||||
"fieldValidateRulesMaxlength": 80
|
||||
},
|
||||
{
|
||||
"fieldName": "contractualAddress",
|
||||
"fieldType": "String",
|
||||
@ -42,7 +50,7 @@
|
||||
"fieldValidateRulesMaxlength": 400
|
||||
},
|
||||
{
|
||||
"fieldName": "contractualSalutation",
|
||||
"fieldName": "billingSalutation",
|
||||
"fieldType": "String",
|
||||
"fieldValidateRules": [
|
||||
"maxlength"
|
||||
@ -56,31 +64,23 @@
|
||||
"maxlength"
|
||||
],
|
||||
"fieldValidateRulesMaxlength": 400
|
||||
},
|
||||
{
|
||||
"fieldName": "billingSalutation",
|
||||
"fieldType": "String",
|
||||
"fieldValidateRules": [
|
||||
"maxlength"
|
||||
],
|
||||
"fieldValidateRulesMaxlength": 80
|
||||
}
|
||||
],
|
||||
"relationships": [
|
||||
{
|
||||
"relationshipType": "one-to-many",
|
||||
"otherEntityName": "customerContact",
|
||||
"otherEntityRelationshipName": "customer",
|
||||
"relationshipName": "role"
|
||||
},
|
||||
{
|
||||
"relationshipType": "one-to-many",
|
||||
"otherEntityName": "membership",
|
||||
"otherEntityRelationshipName": "customer",
|
||||
"relationshipName": "membership"
|
||||
},
|
||||
{
|
||||
"relationshipType": "one-to-many",
|
||||
"otherEntityName": "sepaMandate",
|
||||
"otherEntityRelationshipName": "customer",
|
||||
"relationshipName": "sepamandate"
|
||||
}
|
||||
],
|
||||
"changelogDate": "20190403083735",
|
||||
"changelogDate": "20190418073043",
|
||||
"entityTableName": "customer",
|
||||
"dto": "mapstruct",
|
||||
"pagination": "infinite-scroll",
|
||||
|
@ -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": "*"
|
||||
}
|
@ -2,28 +2,36 @@
|
||||
"name": "Membership",
|
||||
"fields": [
|
||||
{
|
||||
"fieldName": "sinceDate",
|
||||
"fieldName": "from",
|
||||
"fieldType": "LocalDate",
|
||||
"fieldValidateRules": [
|
||||
"required"
|
||||
]
|
||||
},
|
||||
{
|
||||
"fieldName": "untilDate",
|
||||
"fieldName": "to",
|
||||
"fieldType": "LocalDate"
|
||||
},
|
||||
{
|
||||
"fieldName": "comment",
|
||||
"fieldType": "String",
|
||||
"fieldValidateRules": [
|
||||
"maxlength"
|
||||
],
|
||||
"fieldValidateRulesMaxlength": 160
|
||||
}
|
||||
],
|
||||
"relationships": [
|
||||
{
|
||||
"relationshipType": "one-to-many",
|
||||
"otherEntityName": "share",
|
||||
"otherEntityRelationshipName": "member",
|
||||
"otherEntityRelationshipName": "membership",
|
||||
"relationshipName": "share"
|
||||
},
|
||||
{
|
||||
"relationshipType": "one-to-many",
|
||||
"otherEntityName": "asset",
|
||||
"otherEntityRelationshipName": "member",
|
||||
"otherEntityRelationshipName": "membership",
|
||||
"relationshipName": "asset"
|
||||
},
|
||||
{
|
||||
@ -35,7 +43,7 @@
|
||||
"otherEntityField": "prefix"
|
||||
}
|
||||
],
|
||||
"changelogDate": "20190403083738",
|
||||
"changelogDate": "20190418073044",
|
||||
"entityTableName": "membership",
|
||||
"dto": "mapstruct",
|
||||
"pagination": "infinite-scroll",
|
||||
|
84
.jhipster/SepaMandate.json
Normal file
84
.jhipster/SepaMandate.json
Normal 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": "*"
|
||||
}
|
@ -38,11 +38,11 @@
|
||||
"otherEntityName": "membership",
|
||||
"otherEntityRelationshipName": "share",
|
||||
"relationshipValidateRules": "required",
|
||||
"relationshipName": "member",
|
||||
"otherEntityField": "id"
|
||||
"relationshipName": "membership",
|
||||
"otherEntityField": "from"
|
||||
}
|
||||
],
|
||||
"changelogDate": "20190403083739",
|
||||
"changelogDate": "20190418073045",
|
||||
"entityTableName": "share",
|
||||
"dto": "mapstruct",
|
||||
"pagination": "infinite-scroll",
|
||||
|
@ -2,16 +2,17 @@ package org.hostsharing.hsadminng.domain;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import org.hostsharing.hsadminng.domain.enumeration.AssetAction;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.hostsharing.hsadminng.domain.enumeration.AssetAction;
|
||||
|
||||
/**
|
||||
* A Asset.
|
||||
*/
|
||||
@ -46,7 +47,7 @@ public class Asset implements Serializable {
|
||||
@ManyToOne(optional = false)
|
||||
@NotNull
|
||||
@JsonIgnoreProperties("assets")
|
||||
private Membership member;
|
||||
private Membership membership;
|
||||
|
||||
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
|
||||
public Long getId() {
|
||||
@ -109,17 +110,17 @@ public class Asset implements Serializable {
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public Membership getMember() {
|
||||
return member;
|
||||
public Membership getMembership() {
|
||||
return membership;
|
||||
}
|
||||
|
||||
public Asset member(Membership membership) {
|
||||
this.member = membership;
|
||||
public Asset membership(Membership membership) {
|
||||
this.membership = membership;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setMember(Membership membership) {
|
||||
this.member = membership;
|
||||
public void setMembership(Membership membership) {
|
||||
this.membership = membership;
|
||||
}
|
||||
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
|
||||
|
||||
|
@ -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() + "'" +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -1,12 +1,15 @@
|
||||
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.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* A Customer.
|
||||
@ -38,27 +41,27 @@ public class Customer implements Serializable {
|
||||
@Column(name = "name", length = 80, nullable = false)
|
||||
private String name;
|
||||
|
||||
@Size(max = 80)
|
||||
@Column(name = "contractual_salutation", length = 80)
|
||||
private String contractualSalutation;
|
||||
|
||||
@NotNull
|
||||
@Size(max = 400)
|
||||
@Column(name = "contractual_address", length = 400, nullable = false)
|
||||
private String contractualAddress;
|
||||
|
||||
@Size(max = 80)
|
||||
@Column(name = "contractual_salutation", length = 80)
|
||||
private String contractualSalutation;
|
||||
@Column(name = "billing_salutation", length = 80)
|
||||
private String billingSalutation;
|
||||
|
||||
@Size(max = 400)
|
||||
@Column(name = "billing_address", length = 400)
|
||||
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")
|
||||
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
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -107,19 +110,6 @@ public class Customer implements Serializable {
|
||||
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() {
|
||||
return contractualSalutation;
|
||||
}
|
||||
@ -133,17 +123,17 @@ public class Customer implements Serializable {
|
||||
this.contractualSalutation = contractualSalutation;
|
||||
}
|
||||
|
||||
public String getBillingAddress() {
|
||||
return billingAddress;
|
||||
public String getContractualAddress() {
|
||||
return contractualAddress;
|
||||
}
|
||||
|
||||
public Customer billingAddress(String billingAddress) {
|
||||
this.billingAddress = billingAddress;
|
||||
public Customer contractualAddress(String contractualAddress) {
|
||||
this.contractualAddress = contractualAddress;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setBillingAddress(String billingAddress) {
|
||||
this.billingAddress = billingAddress;
|
||||
public void setContractualAddress(String contractualAddress) {
|
||||
this.contractualAddress = contractualAddress;
|
||||
}
|
||||
|
||||
public String getBillingSalutation() {
|
||||
@ -159,29 +149,17 @@ public class Customer implements Serializable {
|
||||
this.billingSalutation = billingSalutation;
|
||||
}
|
||||
|
||||
public Set<CustomerContact> getRoles() {
|
||||
return roles;
|
||||
public String getBillingAddress() {
|
||||
return billingAddress;
|
||||
}
|
||||
|
||||
public Customer roles(Set<CustomerContact> customerContacts) {
|
||||
this.roles = customerContacts;
|
||||
public Customer billingAddress(String billingAddress) {
|
||||
this.billingAddress = billingAddress;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Customer addRole(CustomerContact customerContact) {
|
||||
this.roles.add(customerContact);
|
||||
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 void setBillingAddress(String billingAddress) {
|
||||
this.billingAddress = billingAddress;
|
||||
}
|
||||
|
||||
public Set<Membership> getMemberships() {
|
||||
@ -208,6 +186,31 @@ public class Customer implements Serializable {
|
||||
public void setMemberships(Set<Membership> 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
|
||||
|
||||
@Override
|
||||
@ -237,10 +240,10 @@ public class Customer implements Serializable {
|
||||
", number=" + getNumber() +
|
||||
", prefix='" + getPrefix() + "'" +
|
||||
", name='" + getName() + "'" +
|
||||
", contractualAddress='" + getContractualAddress() + "'" +
|
||||
", contractualSalutation='" + getContractualSalutation() + "'" +
|
||||
", billingAddress='" + getBillingAddress() + "'" +
|
||||
", contractualAddress='" + getContractualAddress() + "'" +
|
||||
", billingSalutation='" + getBillingSalutation() + "'" +
|
||||
", billingAddress='" + getBillingAddress() + "'" +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
@ -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() + "'" +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -1,15 +1,17 @@
|
||||
package org.hostsharing.hsadminng.domain;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* A Membership.
|
||||
@ -26,15 +28,19 @@ public class Membership implements Serializable {
|
||||
private Long id;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "since_date", nullable = false)
|
||||
private LocalDate sinceDate;
|
||||
@Column(name = "jhi_from", nullable = false)
|
||||
private LocalDate from;
|
||||
|
||||
@Column(name = "until_date")
|
||||
private LocalDate untilDate;
|
||||
@Column(name = "jhi_to")
|
||||
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<>();
|
||||
@OneToMany(mappedBy = "member")
|
||||
@OneToMany(mappedBy = "membership")
|
||||
private Set<Asset> assets = new HashSet<>();
|
||||
@ManyToOne(optional = false)
|
||||
@NotNull
|
||||
@ -50,30 +56,43 @@ public class Membership implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public LocalDate getSinceDate() {
|
||||
return sinceDate;
|
||||
public LocalDate getFrom() {
|
||||
return from;
|
||||
}
|
||||
|
||||
public Membership sinceDate(LocalDate sinceDate) {
|
||||
this.sinceDate = sinceDate;
|
||||
public Membership from(LocalDate from) {
|
||||
this.from = from;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setSinceDate(LocalDate sinceDate) {
|
||||
this.sinceDate = sinceDate;
|
||||
public void setFrom(LocalDate from) {
|
||||
this.from = from;
|
||||
}
|
||||
|
||||
public LocalDate getUntilDate() {
|
||||
return untilDate;
|
||||
public LocalDate getTo() {
|
||||
return to;
|
||||
}
|
||||
|
||||
public Membership untilDate(LocalDate untilDate) {
|
||||
this.untilDate = untilDate;
|
||||
public Membership to(LocalDate to) {
|
||||
this.to = to;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setUntilDate(LocalDate untilDate) {
|
||||
this.untilDate = untilDate;
|
||||
public void setTo(LocalDate to) {
|
||||
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() {
|
||||
@ -87,13 +106,13 @@ public class Membership implements Serializable {
|
||||
|
||||
public Membership addShare(Share share) {
|
||||
this.shares.add(share);
|
||||
share.setMember(this);
|
||||
share.setMembership(this);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Membership removeShare(Share share) {
|
||||
this.shares.remove(share);
|
||||
share.setMember(null);
|
||||
share.setMembership(null);
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -112,13 +131,13 @@ public class Membership implements Serializable {
|
||||
|
||||
public Membership addAsset(Asset asset) {
|
||||
this.assets.add(asset);
|
||||
asset.setMember(this);
|
||||
asset.setMembership(this);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Membership removeAsset(Asset asset) {
|
||||
this.assets.remove(asset);
|
||||
asset.setMember(null);
|
||||
asset.setMembership(null);
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -164,8 +183,9 @@ public class Membership implements Serializable {
|
||||
public String toString() {
|
||||
return "Membership{" +
|
||||
"id=" + getId() +
|
||||
", sinceDate='" + getSinceDate() + "'" +
|
||||
", untilDate='" + getUntilDate() + "'" +
|
||||
", from='" + getFrom() + "'" +
|
||||
", to='" + getTo() + "'" +
|
||||
", comment='" + getComment() + "'" +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
241
src/main/java/org/hostsharing/hsadminng/domain/SepaMandate.java
Normal file
241
src/main/java/org/hostsharing/hsadminng/domain/SepaMandate.java
Normal 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() + "'" +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -2,15 +2,16 @@ package org.hostsharing.hsadminng.domain;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import org.hostsharing.hsadminng.domain.enumeration.ShareAction;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.hostsharing.hsadminng.domain.enumeration.ShareAction;
|
||||
|
||||
/**
|
||||
* A Share.
|
||||
*/
|
||||
@ -45,7 +46,7 @@ public class Share implements Serializable {
|
||||
@ManyToOne(optional = false)
|
||||
@NotNull
|
||||
@JsonIgnoreProperties("shares")
|
||||
private Membership member;
|
||||
private Membership membership;
|
||||
|
||||
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
|
||||
public Long getId() {
|
||||
@ -108,17 +109,17 @@ public class Share implements Serializable {
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public Membership getMember() {
|
||||
return member;
|
||||
public Membership getMembership() {
|
||||
return membership;
|
||||
}
|
||||
|
||||
public Share member(Membership membership) {
|
||||
this.member = membership;
|
||||
public Share membership(Membership membership) {
|
||||
this.membership = membership;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setMember(Membership membership) {
|
||||
this.member = membership;
|
||||
public void setMembership(Membership membership) {
|
||||
this.membership = membership;
|
||||
}
|
||||
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
|
||||
|
||||
|
@ -1,8 +0,0 @@
|
||||
package org.hostsharing.hsadminng.domain.enumeration;
|
||||
|
||||
/**
|
||||
* The CustomerContactRole enumeration.
|
||||
*/
|
||||
public enum CustomerContactRole {
|
||||
CONTRACTUAL, TECHNICAL, FINANCIAL
|
||||
}
|
@ -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> {
|
||||
|
||||
}
|
@ -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> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||