Model customers.
This commit is contained in:
parent
bd5bb859d9
commit
2459dd3b64
@ -2,7 +2,14 @@
|
||||
"name": "Asset",
|
||||
"fields": [
|
||||
{
|
||||
"fieldName": "date",
|
||||
"fieldName": "documentDate",
|
||||
"fieldType": "LocalDate",
|
||||
"fieldValidateRules": [
|
||||
"required"
|
||||
]
|
||||
},
|
||||
{
|
||||
"fieldName": "valueDate",
|
||||
"fieldType": "LocalDate",
|
||||
"fieldValidateRules": [
|
||||
"required"
|
||||
@ -24,7 +31,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"fieldName": "comment",
|
||||
"fieldName": "remark",
|
||||
"fieldType": "String",
|
||||
"fieldValidateRules": [
|
||||
"maxlength"
|
||||
@ -38,8 +45,8 @@
|
||||
"otherEntityName": "membership",
|
||||
"otherEntityRelationshipName": "asset",
|
||||
"relationshipValidateRules": "required",
|
||||
"relationshipName": "member",
|
||||
"otherEntityField": "id"
|
||||
"relationshipName": "membership",
|
||||
"otherEntityField": "documentDate"
|
||||
}
|
||||
],
|
||||
"changelogDate": "20190403083740",
|
||||
|
@ -2,7 +2,7 @@
|
||||
"name": "Customer",
|
||||
"fields": [
|
||||
{
|
||||
"fieldName": "number",
|
||||
"fieldName": "reference",
|
||||
"fieldType": "Integer",
|
||||
"fieldValidateRules": [
|
||||
"required",
|
||||
@ -18,9 +18,11 @@
|
||||
"fieldType": "String",
|
||||
"fieldValidateRules": [
|
||||
"required",
|
||||
"maxlength",
|
||||
"unique",
|
||||
"pattern"
|
||||
],
|
||||
"fieldValidateRulesMaxlength": 3,
|
||||
"fieldValidateRulesPattern": "[a-z][a-z0-9]+"
|
||||
},
|
||||
{
|
||||
@ -32,6 +34,14 @@
|
||||
],
|
||||
"fieldValidateRulesMaxlength": 80
|
||||
},
|
||||
{
|
||||
"fieldName": "contractualSalutation",
|
||||
"fieldType": "String",
|
||||
"fieldValidateRules": [
|
||||
"maxlength"
|
||||
],
|
||||
"fieldValidateRulesMaxlength": 80
|
||||
},
|
||||
{
|
||||
"fieldName": "contractualAddress",
|
||||
"fieldType": "String",
|
||||
@ -42,7 +52,7 @@
|
||||
"fieldValidateRulesMaxlength": 400
|
||||
},
|
||||
{
|
||||
"fieldName": "contractualSalutation",
|
||||
"fieldName": "billingSalutation",
|
||||
"fieldType": "String",
|
||||
"fieldValidateRules": [
|
||||
"maxlength"
|
||||
@ -58,26 +68,26 @@
|
||||
"fieldValidateRulesMaxlength": 400
|
||||
},
|
||||
{
|
||||
"fieldName": "billingSalutation",
|
||||
"fieldName": "remark",
|
||||
"fieldType": "String",
|
||||
"fieldValidateRules": [
|
||||
"maxlength"
|
||||
],
|
||||
"fieldValidateRulesMaxlength": 80
|
||||
"fieldValidateRulesMaxlength": 160
|
||||
}
|
||||
],
|
||||
"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",
|
||||
|
@ -2,28 +2,43 @@
|
||||
"name": "Membership",
|
||||
"fields": [
|
||||
{
|
||||
"fieldName": "sinceDate",
|
||||
"fieldName": "documentDate",
|
||||
"fieldType": "LocalDate",
|
||||
"fieldValidateRules": [
|
||||
"required"
|
||||
]
|
||||
},
|
||||
{
|
||||
"fieldName": "untilDate",
|
||||
"fieldName": "memberFrom",
|
||||
"fieldType": "LocalDate",
|
||||
"fieldValidateRules": [
|
||||
"required"
|
||||
]
|
||||
},
|
||||
{
|
||||
"fieldName": "memberUntil",
|
||||
"fieldType": "LocalDate"
|
||||
},
|
||||
{
|
||||
"fieldName": "remark",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
|
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": "documentDate",
|
||||
"fieldType": "LocalDate",
|
||||
"fieldValidateRules": [
|
||||
"required"
|
||||
]
|
||||
},
|
||||
{
|
||||
"fieldName": "validFrom",
|
||||
"fieldType": "LocalDate",
|
||||
"fieldValidateRules": [
|
||||
"required"
|
||||
]
|
||||
},
|
||||
{
|
||||
"fieldName": "validUntil",
|
||||
"fieldType": "LocalDate"
|
||||
},
|
||||
{
|
||||
"fieldName": "lastUsed",
|
||||
"fieldType": "LocalDate"
|
||||
},
|
||||
{
|
||||
"fieldName": "cancellationDate",
|
||||
"fieldType": "LocalDate"
|
||||
},
|
||||
{
|
||||
"fieldName": "remark",
|
||||
"fieldType": "String",
|
||||
"fieldValidateRules": [
|
||||
"maxlength"
|
||||
],
|
||||
"fieldValidateRulesMaxlength": 160
|
||||
}
|
||||
],
|
||||
"relationships": [
|
||||
{
|
||||
"relationshipType": "many-to-one",
|
||||
"otherEntityName": "customer",
|
||||
"otherEntityRelationshipName": "sepamandate",
|
||||
"relationshipValidateRules": "required",
|
||||
"relationshipName": "customer",
|
||||
"otherEntityField": "prefix"
|
||||
}
|
||||
],
|
||||
"changelogDate": "20190418100951",
|
||||
"entityTableName": "sepa_mandate",
|
||||
"dto": "mapstruct",
|
||||
"pagination": "infinite-scroll",
|
||||
"service": "serviceClass",
|
||||
"jpaMetamodelFiltering": true,
|
||||
"fluentMethods": true,
|
||||
"clientRootFolder": "",
|
||||
"applications": "*"
|
||||
}
|
@ -2,7 +2,14 @@
|
||||
"name": "Share",
|
||||
"fields": [
|
||||
{
|
||||
"fieldName": "date",
|
||||
"fieldName": "documentDate",
|
||||
"fieldType": "LocalDate",
|
||||
"fieldValidateRules": [
|
||||
"required"
|
||||
]
|
||||
},
|
||||
{
|
||||
"fieldName": "valueDate",
|
||||
"fieldType": "LocalDate",
|
||||
"fieldValidateRules": [
|
||||
"required"
|
||||
@ -24,7 +31,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"fieldName": "comment",
|
||||
"fieldName": "remark",
|
||||
"fieldType": "String",
|
||||
"fieldValidateRules": [
|
||||
"maxlength"
|
||||
@ -38,8 +45,8 @@
|
||||
"otherEntityName": "membership",
|
||||
"otherEntityRelationshipName": "share",
|
||||
"relationshipValidateRules": "required",
|
||||
"relationshipName": "member",
|
||||
"otherEntityField": "id"
|
||||
"relationshipName": "membership",
|
||||
"otherEntityField": "documentDate"
|
||||
}
|
||||
],
|
||||
"changelogDate": "20190403083739",
|
||||
|
@ -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.
|
||||
*/
|
||||
@ -27,8 +28,12 @@ public class Asset implements Serializable {
|
||||
private Long id;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "jhi_date", nullable = false)
|
||||
private LocalDate date;
|
||||
@Column(name = "document_date", nullable = false)
|
||||
private LocalDate documentDate;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "value_date", nullable = false)
|
||||
private LocalDate valueDate;
|
||||
|
||||
@NotNull
|
||||
@Enumerated(EnumType.STRING)
|
||||
@ -40,13 +45,13 @@ public class Asset implements Serializable {
|
||||
private BigDecimal amount;
|
||||
|
||||
@Size(max = 160)
|
||||
@Column(name = "jhi_comment", length = 160)
|
||||
private String comment;
|
||||
@Column(name = "remark", length = 160)
|
||||
private String remark;
|
||||
|
||||
@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() {
|
||||
@ -57,17 +62,30 @@ public class Asset implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public LocalDate getDate() {
|
||||
return date;
|
||||
public LocalDate getDocumentDate() {
|
||||
return documentDate;
|
||||
}
|
||||
|
||||
public Asset date(LocalDate date) {
|
||||
this.date = date;
|
||||
public Asset documentDate(LocalDate documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setDate(LocalDate date) {
|
||||
this.date = date;
|
||||
public void setDocumentDate(LocalDate documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
}
|
||||
|
||||
public LocalDate getValueDate() {
|
||||
return valueDate;
|
||||
}
|
||||
|
||||
public Asset valueDate(LocalDate valueDate) {
|
||||
this.valueDate = valueDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setValueDate(LocalDate valueDate) {
|
||||
this.valueDate = valueDate;
|
||||
}
|
||||
|
||||
public AssetAction getAction() {
|
||||
@ -96,30 +114,30 @@ public class Asset implements Serializable {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return comment;
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public Asset comment(String comment) {
|
||||
this.comment = comment;
|
||||
public Asset remark(String remark) {
|
||||
this.remark = remark;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
this.comment = comment;
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
@ -147,10 +165,11 @@ public class Asset implements Serializable {
|
||||
public String toString() {
|
||||
return "Asset{" +
|
||||
"id=" + getId() +
|
||||
", date='" + getDate() + "'" +
|
||||
", documentDate='" + getDocumentDate() + "'" +
|
||||
", valueDate='" + getValueDate() + "'" +
|
||||
", action='" + getAction() + "'" +
|
||||
", amount=" + getAmount() +
|
||||
", comment='" + getComment() + "'" +
|
||||
", remark='" + getRemark() + "'" +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
@ -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.
|
||||
@ -25,12 +28,13 @@ public class Customer implements Serializable {
|
||||
@NotNull
|
||||
@Min(value = 10000)
|
||||
@Max(value = 99999)
|
||||
@Column(name = "jhi_number", nullable = false, unique = true)
|
||||
private Integer number;
|
||||
@Column(name = "reference", nullable = false, unique = true)
|
||||
private Integer reference;
|
||||
|
||||
@NotNull
|
||||
@Size(max = 3)
|
||||
@Pattern(regexp = "[a-z][a-z0-9]+")
|
||||
@Column(name = "prefix", nullable = false, unique = true)
|
||||
@Column(name = "prefix", length = 3, nullable = false, unique = true)
|
||||
private String prefix;
|
||||
|
||||
@NotNull
|
||||
@ -38,27 +42,31 @@ 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;
|
||||
@Size(max = 160)
|
||||
@Column(name = "remark", length = 160)
|
||||
private String remark;
|
||||
|
||||
@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;
|
||||
@ -68,17 +76,17 @@ public class Customer implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getNumber() {
|
||||
return number;
|
||||
public Integer getReference() {
|
||||
return reference;
|
||||
}
|
||||
|
||||
public Customer number(Integer number) {
|
||||
this.number = number;
|
||||
public Customer reference(Integer reference) {
|
||||
this.reference = reference;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setNumber(Integer number) {
|
||||
this.number = number;
|
||||
public void setReference(Integer reference) {
|
||||
this.reference = reference;
|
||||
}
|
||||
|
||||
public String getPrefix() {
|
||||
@ -107,19 +115,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 +128,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 +154,30 @@ 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);
|
||||
public void setBillingAddress(String billingAddress) {
|
||||
this.billingAddress = billingAddress;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public Customer remark(String remark) {
|
||||
this.remark = remark;
|
||||
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 setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public Set<Membership> getMemberships() {
|
||||
@ -208,6 +204,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
|
||||
@ -234,13 +255,14 @@ public class Customer implements Serializable {
|
||||
public String toString() {
|
||||
return "Customer{" +
|
||||
"id=" + getId() +
|
||||
", number=" + getNumber() +
|
||||
", reference=" + getReference() +
|
||||
", prefix='" + getPrefix() + "'" +
|
||||
", name='" + getName() + "'" +
|
||||
", contractualAddress='" + getContractualAddress() + "'" +
|
||||
", contractualSalutation='" + getContractualSalutation() + "'" +
|
||||
", billingAddress='" + getBillingAddress() + "'" +
|
||||
", contractualAddress='" + getContractualAddress() + "'" +
|
||||
", billingSalutation='" + getBillingSalutation() + "'" +
|
||||
", billingAddress='" + getBillingAddress() + "'" +
|
||||
", remark='" + getRemark() + "'" +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
@ -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,23 @@ public class Membership implements Serializable {
|
||||
private Long id;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "since_date", nullable = false)
|
||||
private LocalDate sinceDate;
|
||||
@Column(name = "document_date", nullable = false)
|
||||
private LocalDate documentDate;
|
||||
|
||||
@Column(name = "until_date")
|
||||
private LocalDate untilDate;
|
||||
@NotNull
|
||||
@Column(name = "member_from", nullable = false)
|
||||
private LocalDate memberFrom;
|
||||
|
||||
@OneToMany(mappedBy = "member")
|
||||
@Column(name = "member_until")
|
||||
private LocalDate memberUntil;
|
||||
|
||||
@Size(max = 160)
|
||||
@Column(name = "remark", length = 160)
|
||||
private String remark;
|
||||
|
||||
@OneToMany(mappedBy = "membership")
|
||||
private Set<Share> shares = new HashSet<>();
|
||||
@OneToMany(mappedBy = "member")
|
||||
@OneToMany(mappedBy = "membership")
|
||||
private Set<Asset> assets = new HashSet<>();
|
||||
@ManyToOne(optional = false)
|
||||
@NotNull
|
||||
@ -50,30 +60,56 @@ public class Membership implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public LocalDate getSinceDate() {
|
||||
return sinceDate;
|
||||
public LocalDate getDocumentDate() {
|
||||
return documentDate;
|
||||
}
|
||||
|
||||
public Membership sinceDate(LocalDate sinceDate) {
|
||||
this.sinceDate = sinceDate;
|
||||
public Membership documentDate(LocalDate documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setSinceDate(LocalDate sinceDate) {
|
||||
this.sinceDate = sinceDate;
|
||||
public void setDocumentDate(LocalDate documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
}
|
||||
|
||||
public LocalDate getUntilDate() {
|
||||
return untilDate;
|
||||
public LocalDate getMemberFrom() {
|
||||
return memberFrom;
|
||||
}
|
||||
|
||||
public Membership untilDate(LocalDate untilDate) {
|
||||
this.untilDate = untilDate;
|
||||
public Membership memberFrom(LocalDate memberFrom) {
|
||||
this.memberFrom = memberFrom;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setUntilDate(LocalDate untilDate) {
|
||||
this.untilDate = untilDate;
|
||||
public void setMemberFrom(LocalDate memberFrom) {
|
||||
this.memberFrom = memberFrom;
|
||||
}
|
||||
|
||||
public LocalDate getMemberUntil() {
|
||||
return memberUntil;
|
||||
}
|
||||
|
||||
public Membership memberUntil(LocalDate memberUntil) {
|
||||
this.memberUntil = memberUntil;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setMemberUntil(LocalDate memberUntil) {
|
||||
this.memberUntil = memberUntil;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public Membership remark(String remark) {
|
||||
this.remark = remark;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public Set<Share> getShares() {
|
||||
@ -87,13 +123,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 +148,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 +200,10 @@ public class Membership implements Serializable {
|
||||
public String toString() {
|
||||
return "Membership{" +
|
||||
"id=" + getId() +
|
||||
", sinceDate='" + getSinceDate() + "'" +
|
||||
", untilDate='" + getUntilDate() + "'" +
|
||||
", documentDate='" + getDocumentDate() + "'" +
|
||||
", memberFrom='" + getMemberFrom() + "'" +
|
||||
", memberUntil='" + getMemberUntil() + "'" +
|
||||
", remark='" + getRemark() + "'" +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
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 = "document_date", nullable = false)
|
||||
private LocalDate documentDate;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "valid_from", nullable = false)
|
||||
private LocalDate validFrom;
|
||||
|
||||
@Column(name = "valid_until")
|
||||
private LocalDate validUntil;
|
||||
|
||||
@Column(name = "last_used")
|
||||
private LocalDate lastUsed;
|
||||
|
||||
@Column(name = "cancellation_date")
|
||||
private LocalDate cancellationDate;
|
||||
|
||||
@Size(max = 160)
|
||||
@Column(name = "remark", length = 160)
|
||||
private String remark;
|
||||
|
||||
@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 getDocumentDate() {
|
||||
return documentDate;
|
||||
}
|
||||
|
||||
public SepaMandate documentDate(LocalDate documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setDocumentDate(LocalDate documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
}
|
||||
|
||||
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 getValidUntil() {
|
||||
return validUntil;
|
||||
}
|
||||
|
||||
public SepaMandate validUntil(LocalDate validUntil) {
|
||||
this.validUntil = validUntil;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setValidUntil(LocalDate validUntil) {
|
||||
this.validUntil = validUntil;
|
||||
}
|
||||
|
||||
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 getCancellationDate() {
|
||||
return cancellationDate;
|
||||
}
|
||||
|
||||
public SepaMandate cancellationDate(LocalDate cancellationDate) {
|
||||
this.cancellationDate = cancellationDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setCancellationDate(LocalDate cancellationDate) {
|
||||
this.cancellationDate = cancellationDate;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public SepaMandate remark(String remark) {
|
||||
this.remark = remark;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
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() + "'" +
|
||||
", documentDate='" + getDocumentDate() + "'" +
|
||||
", validFrom='" + getValidFrom() + "'" +
|
||||
", validUntil='" + getValidUntil() + "'" +
|
||||
", lastUsed='" + getLastUsed() + "'" +
|
||||
", cancellationDate='" + getCancellationDate() + "'" +
|
||||
", remark='" + getRemark() + "'" +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -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.
|
||||
*/
|
||||
@ -26,8 +27,12 @@ public class Share implements Serializable {
|
||||
private Long id;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "jhi_date", nullable = false)
|
||||
private LocalDate date;
|
||||
@Column(name = "document_date", nullable = false)
|
||||
private LocalDate documentDate;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "value_date", nullable = false)
|
||||
private LocalDate valueDate;
|
||||
|
||||
@NotNull
|
||||
@Enumerated(EnumType.STRING)
|
||||
@ -39,13 +44,13 @@ public class Share implements Serializable {
|
||||
private Integer quantity;
|
||||
|
||||
@Size(max = 160)
|
||||
@Column(name = "jhi_comment", length = 160)
|
||||
private String comment;
|
||||
@Column(name = "remark", length = 160)
|
||||
private String remark;
|
||||
|
||||
@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() {
|
||||
@ -56,17 +61,30 @@ public class Share implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public LocalDate getDate() {
|
||||
return date;
|
||||
public LocalDate getDocumentDate() {
|
||||
return documentDate;
|
||||
}
|
||||
|
||||
public Share date(LocalDate date) {
|
||||
this.date = date;
|
||||
public Share documentDate(LocalDate documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setDate(LocalDate date) {
|
||||
this.date = date;
|
||||
public void setDocumentDate(LocalDate documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
}
|
||||
|
||||
public LocalDate getValueDate() {
|
||||
return valueDate;
|
||||
}
|
||||
|
||||
public Share valueDate(LocalDate valueDate) {
|
||||
this.valueDate = valueDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setValueDate(LocalDate valueDate) {
|
||||
this.valueDate = valueDate;
|
||||
}
|
||||
|
||||
public ShareAction getAction() {
|
||||
@ -95,30 +113,30 @@ public class Share implements Serializable {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return comment;
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public Share comment(String comment) {
|
||||
this.comment = comment;
|
||||
public Share remark(String remark) {
|
||||
this.remark = remark;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
this.comment = comment;
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
@ -146,10 +164,11 @@ public class Share implements Serializable {
|
||||
public String toString() {
|
||||
return "Share{" +
|
||||
"id=" + getId() +
|
||||
", date='" + getDate() + "'" +
|
||||
", documentDate='" + getDocumentDate() + "'" +
|
||||
", valueDate='" + getValueDate() + "'" +
|
||||
", action='" + getAction() + "'" +
|
||||
", quantity=" + getQuantity() +
|
||||
", comment='" + getComment() + "'" +
|
||||
", remark='" + getRemark() + "'" +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
@ -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> {
|
||||
|
||||
}
|
@ -89,8 +89,11 @@ public class AssetQueryService extends QueryService<Asset> {
|
||||
if (criteria.getId() != null) {
|
||||
specification = specification.and(buildSpecification(criteria.getId(), Asset_.id));
|
||||
}
|
||||
if (criteria.getDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getDate(), Asset_.date));
|
||||
if (criteria.getDocumentDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getDocumentDate(), Asset_.documentDate));
|
||||
}
|
||||
if (criteria.getValueDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getValueDate(), Asset_.valueDate));
|
||||
}
|
||||
if (criteria.getAction() != null) {
|
||||
specification = specification.and(buildSpecification(criteria.getAction(), Asset_.action));
|
||||
@ -98,12 +101,12 @@ public class AssetQueryService extends QueryService<Asset> {
|
||||
if (criteria.getAmount() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getAmount(), Asset_.amount));
|
||||
}
|
||||
if (criteria.getComment() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getComment(), Asset_.comment));
|
||||
if (criteria.getRemark() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getRemark(), Asset_.remark));
|
||||
}
|
||||
if (criteria.getMemberId() != null) {
|
||||
specification = specification.and(buildSpecification(criteria.getMemberId(),
|
||||
root -> root.join(Asset_.member, JoinType.LEFT).get(Membership_.id)));
|
||||
if (criteria.getMembershipId() != null) {
|
||||
specification = specification.and(buildSpecification(criteria.getMembershipId(),
|
||||
root -> root.join(Asset_.membership, JoinType.LEFT).get(Membership_.id)));
|
||||
}
|
||||
}
|
||||
return specification;
|
||||
|
@ -1,14 +1,9 @@
|
||||
package org.hostsharing.hsadminng.service;
|
||||
|
||||
import io.github.jhipster.service.QueryService;
|
||||
import org.hostsharing.hsadminng.domain.Customer;
|
||||
import org.hostsharing.hsadminng.domain.CustomerContact_;
|
||||
import org.hostsharing.hsadminng.domain.Customer_;
|
||||
import org.hostsharing.hsadminng.domain.Membership_;
|
||||
import org.hostsharing.hsadminng.repository.CustomerRepository;
|
||||
import org.hostsharing.hsadminng.service.dto.CustomerCriteria;
|
||||