Merge branch 'master' into spike/JSonSerializerDeserializerForDTOs
# Conflicts: # package-lock.json # src/main/java/org/hostsharing/hsadminng/service/dto/CustomerDTO.java
This commit is contained in:
commit
16cf845015
@ -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,11 +45,11 @@
|
||||
"otherEntityName": "membership",
|
||||
"otherEntityRelationshipName": "asset",
|
||||
"relationshipValidateRules": "required",
|
||||
"relationshipName": "member",
|
||||
"otherEntityField": "id"
|
||||
"relationshipName": "membership",
|
||||
"otherEntityField": "documentDate"
|
||||
}
|
||||
],
|
||||
"changelogDate": "20190403083740",
|
||||
"changelogDate": "20190418143053",
|
||||
"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": "*"
|
||||
}
|
@ -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,29 +68,29 @@
|
||||
"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",
|
||||
"changelogDate": "20190418143050",
|
||||
"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,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"
|
||||
},
|
||||
{
|
||||
@ -35,7 +50,7 @@
|
||||
"otherEntityField": "prefix"
|
||||
}
|
||||
],
|
||||
"changelogDate": "20190403083738",
|
||||
"changelogDate": "20190418143051",
|
||||
"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": "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": "20190418143054",
|
||||
"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,11 +45,11 @@
|
||||
"otherEntityName": "membership",
|
||||
"otherEntityRelationshipName": "share",
|
||||
"relationshipValidateRules": "required",
|
||||
"relationshipName": "member",
|
||||
"otherEntityField": "id"
|
||||
"relationshipName": "membership",
|
||||
"otherEntityField": "documentDate"
|
||||
}
|
||||
],
|
||||
"changelogDate": "20190403083739",
|
||||
"changelogDate": "20190418143052",
|
||||
"entityTableName": "share",
|
||||
"dto": "mapstruct",
|
||||
"pagination": "infinite-scroll",
|
||||
|
41
package-lock.json
generated
41
package-lock.json
generated
@ -6025,8 +6025,7 @@
|
||||
"ansi-regex": {
|
||||
"version": "2.1.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"aproba": {
|
||||
"version": "1.2.0",
|
||||
@ -6047,14 +6046,12 @@
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
@ -6069,20 +6066,17 @@
|
||||
"code-point-at": {
|
||||
"version": "1.1.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"console-control-strings": {
|
||||
"version": "1.1.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"core-util-is": {
|
||||
"version": "1.0.2",
|
||||
@ -6199,8 +6193,7 @@
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"ini": {
|
||||
"version": "1.3.5",
|
||||
@ -6212,7 +6205,6 @@
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"number-is-nan": "^1.0.0"
|
||||
}
|
||||
@ -6227,7 +6219,6 @@
|
||||
"version": "3.0.4",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
@ -6235,14 +6226,12 @@
|
||||
"minimist": {
|
||||
"version": "0.0.8",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"minipass": {
|
||||
"version": "2.3.5",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"safe-buffer": "^5.1.2",
|
||||
"yallist": "^3.0.0"
|
||||
@ -6261,7 +6250,6 @@
|
||||
"version": "0.5.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"minimist": "0.0.8"
|
||||
}
|
||||
@ -6342,8 +6330,7 @@
|
||||
"number-is-nan": {
|
||||
"version": "1.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"object-assign": {
|
||||
"version": "4.1.1",
|
||||
@ -6355,7 +6342,6 @@
|
||||
"version": "1.4.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
@ -6441,8 +6427,7 @@
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
@ -6478,7 +6463,6 @@
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"code-point-at": "^1.0.0",
|
||||
"is-fullwidth-code-point": "^1.0.0",
|
||||
@ -6498,7 +6482,6 @@
|
||||
"version": "3.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"ansi-regex": "^2.0.0"
|
||||
}
|
||||
@ -6542,14 +6525,12 @@
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"yallist": {
|
||||
"version": "3.0.3",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -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;
|
||||
|
||||
@NotNull
|
||||
@ManyToOne(optional = false)
|
||||
@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,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.
|
||||
@ -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,29 +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;
|
||||
|
||||
@OneToMany(mappedBy = "customer")
|
||||
private Set<CustomerContact> roles = new HashSet<>();
|
||||
@Size(max = 160)
|
||||
@Column(name = "remark", length = 160)
|
||||
private String remark;
|
||||
|
||||
@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;
|
||||
@ -70,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() {
|
||||
@ -109,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;
|
||||
}
|
||||
@ -135,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() {
|
||||
@ -161,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() {
|
||||
@ -210,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
|
||||
@ -236,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,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.
|
||||
@ -28,20 +30,26 @@ public class Membership implements Serializable {
|
||||
private Long id;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "since_date", nullable = false)
|
||||
private LocalDate sinceDate;
|
||||
|
||||
@Column(name = "until_date")
|
||||
private LocalDate untilDate;
|
||||
|
||||
@OneToMany(mappedBy = "member")
|
||||
private Set<Share> shares = new HashSet<>();
|
||||
|
||||
@OneToMany(mappedBy = "member")
|
||||
private Set<Asset> assets = new HashSet<>();
|
||||
@Column(name = "document_date", nullable = false)
|
||||
private LocalDate documentDate;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "member_from", nullable = false)
|
||||
private LocalDate memberFrom;
|
||||
|
||||
@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 = "membership")
|
||||
private Set<Asset> assets = new HashSet<>();
|
||||
@ManyToOne(optional = false)
|
||||
@NotNull
|
||||
@JsonIgnoreProperties("memberships")
|
||||
private Customer customer;
|
||||
|
||||
@ -54,30 +62,56 @@ public class Membership implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public LocalDate getSinceDate() {
|
||||
return sinceDate;
|
||||
public LocalDate getDocumentDate() {
|
||||
return documentDate;
|
||||
}
|
||||
|
||||
public Membership sinceDate(LocalDate sinceDate) {
|
||||
this.sinceDate = sinceDate;
|
||||
public Membership documentDate(LocalDate documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setSinceDate(LocalDate sinceDate) {
|
||||
this.sinceDate = sinceDate;
|
||||
public void setDocumentDate(LocalDate documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
}
|
||||
|
||||
public LocalDate getUntilDate() {
|
||||
return untilDate;
|
||||
public LocalDate getMemberFrom() {
|
||||
return memberFrom;
|
||||
}
|
||||
|
||||
public Membership untilDate(LocalDate untilDate) {
|
||||
this.untilDate = untilDate;
|
||||
public Membership memberFrom(LocalDate memberFrom) {
|
||||
this.memberFrom = memberFrom;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setUntilDate(LocalDate untilDate) {
|
||||
this.untilDate = untilDate;
|
||||
public void setMemberFrom(LocalDate memberFrom) {
|
||||
this.memberFrom = memberFrom;
|
||||
}
|
||||
|
||||
public LocalDate getMemberUntil() {
|
||||
return memberUntil;
|
||||
}
|
||||
|
||||
public Membership memberUntil(LocalDate memberUntil) {
|
||||
this.memberUntil = memberUntil;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setMemberUntil(LocalDate memberUntil) {
|
||||
this.memberUntil = memberUntil;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public Membership remark(String remark) {
|
||||
this.remark = remark;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public Set<Share> getShares() {
|
||||
@ -91,13 +125,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;
|
||||
}
|
||||
|
||||
@ -116,13 +150,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;
|
||||
}
|
||||
|
||||
@ -168,8 +202,10 @@ public class Membership implements Serializable {
|
||||
public String toString() {
|
||||
return "Membership{" +
|
||||
"id=" + getId() +
|
||||
", sinceDate='" + getSinceDate() + "'" +
|
||||
", untilDate='" + getUntilDate() + "'" +
|
||||
", documentDate='" + getDocumentDate() + "'" +
|
||||
", memberFrom='" + getMemberFrom() + "'" +
|
||||
", memberUntil='" + getMemberUntil() + "'" +
|
||||
", remark='" + getRemark() + "'" +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
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.
|
||||
*/
|
||||
@ -28,8 +29,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)
|
||||
@ -41,13 +46,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;
|
||||
|
||||
@NotNull
|
||||
@ManyToOne(optional = false)
|
||||
@JsonIgnoreProperties("shares")
|
||||
private Membership member;
|
||||
private Membership membership;
|
||||
|
||||
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
|
||||
public Long getId() {
|
||||
@ -58,17 +63,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() {
|
||||
@ -97,30 +115,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
|
||||
|
||||
@ -148,10 +166,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() + "'" +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
@ -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> {
|
||||
|
||||
}
|
@ -16,6 +16,6 @@ import org.springframework.stereotype.Repository;
|
||||
public interface MembershipRepository extends JpaRepository<Membership, Long>, JpaSpecificationExecutor<Membership> {
|
||||
|
||||
@Query("SELECT CASE WHEN COUNT(m)> 0 THEN TRUE ELSE FALSE END " +
|
||||
" FROM Membership m WHERE m.customer.id=:customerId AND m.untilDate IS NULL")
|
||||
" FROM Membership m WHERE m.customer.id=:customerId AND m.memberUntil IS NULL")
|
||||
boolean hasUncancelledMembershipForCustomer(@Param("customerId") final long customerId);
|
||||
}
|
||||
|
@ -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,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;
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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;
|
||||
import org.hostsharing.hsadminng.service.dto.CustomerDTO;
|
||||
import org.hostsharing.hsadminng.service.mapper.CustomerMapper;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.criteria.JoinType;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
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.transaction.annotation.Transactional;
|
||||
|
||||
import javax.persistence.criteria.JoinType;
|
||||
import java.util.List;
|
||||
import io.github.jhipster.service.QueryService;
|
||||
|
||||
import org.hostsharing.hsadminng.domain.Customer;
|
||||
import org.hostsharing.hsadminng.domain.*; // for static metamodels
|
||||
import org.hostsharing.hsadminng.repository.CustomerRepository;
|
||||
import org.hostsharing.hsadminng.service.dto.CustomerCriteria;
|
||||
import org.hostsharing.hsadminng.service.dto.CustomerDTO;
|
||||
import org.hostsharing.hsadminng.service.mapper.CustomerMapper;
|
||||
|
||||
/**
|
||||
* Service for executing complex queries for Customer entities in the database.
|
||||
@ -88,8 +89,8 @@ public class CustomerQueryService extends QueryService<Customer> {
|
||||
if (criteria.getId() != null) {
|
||||
specification = specification.and(buildSpecification(criteria.getId(), Customer_.id));
|
||||
}
|
||||
if (criteria.getNumber() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getNumber(), Customer_.number));
|
||||
if (criteria.getReference() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getReference(), Customer_.reference));
|
||||
}
|
||||
if (criteria.getPrefix() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getPrefix(), Customer_.prefix));
|
||||
@ -97,26 +98,29 @@ public class CustomerQueryService extends QueryService<Customer> {
|
||||
if (criteria.getName() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getName(), Customer_.name));
|
||||
}
|
||||
if (criteria.getContractualAddress() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getContractualAddress(), Customer_.contractualAddress));
|
||||
}
|
||||
if (criteria.getContractualSalutation() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getContractualSalutation(), Customer_.contractualSalutation));
|
||||
}
|
||||
if (criteria.getBillingAddress() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getBillingAddress(), Customer_.billingAddress));
|
||||
if (criteria.getContractualAddress() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getContractualAddress(), Customer_.contractualAddress));
|
||||
}
|
||||
if (criteria.getBillingSalutation() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getBillingSalutation(), Customer_.billingSalutation));
|
||||
}
|
||||
if (criteria.getRoleId() != null) {
|
||||
specification = specification.and(buildSpecification(criteria.getRoleId(),
|
||||
root -> root.join(Customer_.roles, JoinType.LEFT).get(CustomerContact_.id)));
|
||||
if (criteria.getBillingAddress() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getBillingAddress(), Customer_.billingAddress));
|
||||
}
|
||||
if (criteria.getRemark() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getRemark(), Customer_.remark));
|
||||
}
|
||||
if (criteria.getMembershipId() != null) {
|
||||
specification = specification.and(buildSpecification(criteria.getMembershipId(),
|
||||
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;
|
||||
}
|
||||
|
@ -89,11 +89,17 @@ public class MembershipQueryService extends QueryService<Membership> {
|
||||
if (criteria.getId() != null) {
|
||||
specification = specification.and(buildSpecification(criteria.getId(), Membership_.id));
|
||||
}
|
||||
if (criteria.getSinceDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getSinceDate(), Membership_.sinceDate));
|
||||
if (criteria.getDocumentDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getDocumentDate(), Membership_.documentDate));
|
||||
}
|
||||
if (criteria.getUntilDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getUntilDate(), Membership_.untilDate));
|
||||
if (criteria.getMemberFrom() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getMemberFrom(), Membership_.memberFrom));
|
||||
}
|
||||
if (criteria.getMemberUntil() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getMemberUntil(), Membership_.memberUntil));
|
||||
}
|
||||
if (criteria.getRemark() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getRemark(), Membership_.remark));
|
||||
}
|
||||
if (criteria.getShareId() != null) {
|
||||
specification = specification.and(buildSpecification(criteria.getShareId(),
|
||||
|
@ -14,7 +14,7 @@ public class MembershipValidator {
|
||||
private MembershipRepository membershipRepository;
|
||||
|
||||
public void validate(final MembershipDTO membershipDTO) {
|
||||
if (membershipDTO.getUntilDate() != null && !membershipDTO.getUntilDate().isAfter(membershipDTO.getSinceDate())) {
|
||||
if (membershipDTO.getMemberUntil() != null && !membershipDTO.getMemberUntil().isAfter(membershipDTO.getMemberFrom())) {
|
||||
throw new BadRequestAlertException("Invalid untilDate", Membership.ENTITY_NAME, "untilDateMustBeAfterSinceDate");
|
||||
}
|
||||
|
||||
|
@ -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.getDocumentDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getDocumentDate(), SepaMandate_.documentDate));
|
||||
}
|
||||
if (criteria.getValidFrom() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getValidFrom(), SepaMandate_.validFrom));
|
||||
}
|
||||
if (criteria.getValidUntil() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getValidUntil(), SepaMandate_.validUntil));
|
||||
}
|
||||
if (criteria.getLastUsed() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getLastUsed(), SepaMandate_.lastUsed));
|
||||
}
|
||||
if (criteria.getCancellationDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getCancellationDate(), SepaMandate_.cancellationDate));
|
||||
}
|
||||
if (criteria.getRemark() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getRemark(), SepaMandate_.remark));
|
||||
}
|
||||
if (criteria.getCustomerId() != null) {
|
||||
specification = specification.and(buildSpecification(criteria.getCustomerId(),
|
||||
root -> root.join(SepaMandate_.customer, JoinType.LEFT).get(Customer_.id)));
|
||||
}
|
||||
}
|
||||
return specification;
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -89,8 +89,11 @@ public class ShareQueryService extends QueryService<Share> {
|
||||
if (criteria.getId() != null) {
|
||||
specification = specification.and(buildSpecification(criteria.getId(), Share_.id));
|
||||
}
|
||||
if (criteria.getDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getDate(), Share_.date));
|
||||
if (criteria.getDocumentDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getDocumentDate(), Share_.documentDate));
|
||||
}
|
||||
if (criteria.getValueDate() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getValueDate(), Share_.valueDate));
|
||||
}
|
||||
if (criteria.getAction() != null) {
|
||||
specification = specification.and(buildSpecification(criteria.getAction(), Share_.action));
|
||||
@ -98,12 +101,12 @@ public class ShareQueryService extends QueryService<Share> {
|
||||
if (criteria.getQuantity() != null) {
|
||||
specification = specification.and(buildRangeSpecification(criteria.getQuantity(), Share_.quantity));
|
||||
}
|
||||
if (criteria.getComment() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getComment(), Share_.comment));
|
||||
if (criteria.getRemark() != null) {
|
||||
specification = specification.and(buildStringSpecification(criteria.getRemark(), Share_.remark));
|
||||
}
|
||||
if (criteria.getMemberId() != null) {
|
||||
specification = specification.and(buildSpecification(criteria.getMemberId(),
|
||||
root -> root.join(Share_.member, JoinType.LEFT).get(Membership_.id)));
|
||||
if (criteria.getMembershipId() != null) {
|
||||
specification = specification.and(buildSpecification(criteria.getMembershipId(),
|
||||
root -> root.join(Share_.membership, JoinType.LEFT).get(Membership_.id)));
|
||||
}
|
||||
}
|
||||
return specification;
|
||||
|
@ -32,15 +32,17 @@ public class AssetCriteria implements Serializable {
|
||||
|
||||
private LongFilter id;
|
||||
|
||||
private LocalDateFilter date;
|
||||
private LocalDateFilter documentDate;
|
||||
|
||||
private LocalDateFilter valueDate;
|
||||
|
||||
private AssetActionFilter action;
|
||||
|
||||
private BigDecimalFilter amount;
|
||||
|
||||
private StringFilter comment;
|
||||
private StringFilter remark;
|
||||
|
||||
private LongFilter memberId;
|
||||
private LongFilter membershipId;
|
||||
|
||||
public LongFilter getId() {
|
||||
return id;
|
||||
@ -50,12 +52,20 @@ public class AssetCriteria implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public LocalDateFilter getDate() {
|
||||
return date;
|
||||
public LocalDateFilter getDocumentDate() {
|
||||
return documentDate;
|
||||
}
|
||||
|
||||
public void setDate(LocalDateFilter date) {
|
||||
this.date = date;
|
||||
public void setDocumentDate(LocalDateFilter documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
}
|
||||
|
||||
public LocalDateFilter getValueDate() {
|
||||
return valueDate;
|
||||
}
|
||||
|
||||
public void setValueDate(LocalDateFilter valueDate) {
|
||||
this.valueDate = valueDate;
|
||||
}
|
||||
|
||||
public AssetActionFilter getAction() {
|
||||
@ -74,20 +84,20 @@ public class AssetCriteria implements Serializable {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public StringFilter getComment() {
|
||||
return comment;
|
||||
public StringFilter getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setComment(StringFilter comment) {
|
||||
this.comment = comment;
|
||||
public void setRemark(StringFilter remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public LongFilter getMemberId() {
|
||||
return memberId;
|
||||
public LongFilter getMembershipId() {
|
||||
return membershipId;
|
||||
}
|
||||
|
||||
public void setMemberId(LongFilter memberId) {
|
||||
this.memberId = memberId;
|
||||
public void setMembershipId(LongFilter membershipId) {
|
||||
this.membershipId = membershipId;
|
||||
}
|
||||
|
||||
|
||||
@ -102,22 +112,24 @@ public class AssetCriteria implements Serializable {
|
||||
final AssetCriteria that = (AssetCriteria) o;
|
||||
return
|
||||
Objects.equals(id, that.id) &&
|
||||
Objects.equals(date, that.date) &&
|
||||
Objects.equals(documentDate, that.documentDate) &&
|
||||
Objects.equals(valueDate, that.valueDate) &&
|
||||
Objects.equals(action, that.action) &&
|
||||
Objects.equals(amount, that.amount) &&
|
||||
Objects.equals(comment, that.comment) &&
|
||||
Objects.equals(memberId, that.memberId);
|
||||
Objects.equals(remark, that.remark) &&
|
||||
Objects.equals(membershipId, that.membershipId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
id,
|
||||
date,
|
||||
documentDate,
|
||||
valueDate,
|
||||
action,
|
||||
amount,
|
||||
comment,
|
||||
memberId
|
||||
remark,
|
||||
membershipId
|
||||
);
|
||||
}
|
||||
|
||||
@ -125,11 +137,12 @@ public class AssetCriteria implements Serializable {
|
||||
public String toString() {
|
||||
return "AssetCriteria{" +
|
||||
(id != null ? "id=" + id + ", " : "") +
|
||||
(date != null ? "date=" + date + ", " : "") +
|
||||
(documentDate != null ? "documentDate=" + documentDate + ", " : "") +
|
||||
(valueDate != null ? "valueDate=" + valueDate + ", " : "") +
|
||||
(action != null ? "action=" + action + ", " : "") +
|
||||
(amount != null ? "amount=" + amount + ", " : "") +
|
||||
(comment != null ? "comment=" + comment + ", " : "") +
|
||||
(memberId != null ? "memberId=" + memberId + ", " : "") +
|
||||
(remark != null ? "remark=" + remark + ", " : "") +
|
||||
(membershipId != null ? "membershipId=" + membershipId + ", " : "") +
|
||||
"}";
|
||||
}
|
||||
|
||||
|
@ -1,13 +1,10 @@
|
||||
package org.hostsharing.hsadminng.service.dto;
|
||||
|
||||
import org.hostsharing.hsadminng.domain.enumeration.AssetAction;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.time.LocalDate;
|
||||
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 DTO for the Asset entity.
|
||||
@ -17,7 +14,10 @@ public class AssetDTO implements Serializable {
|
||||
private Long id;
|
||||
|
||||
@NotNull
|
||||
private LocalDate date;
|
||||
private LocalDate documentDate;
|
||||
|
||||
@NotNull
|
||||
private LocalDate valueDate;
|
||||
|
||||
@NotNull
|
||||
private AssetAction action;
|
||||
@ -26,10 +26,12 @@ public class AssetDTO implements Serializable {
|
||||
private BigDecimal amount;
|
||||
|
||||
@Size(max = 160)
|
||||
private String comment;
|
||||
private String remark;
|
||||
|
||||
@NotNull
|
||||
private Long memberId;
|
||||
|
||||
private Long membershipId;
|
||||
|
||||
private String membershipDocumentDate;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -39,12 +41,20 @@ public class AssetDTO implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public LocalDate getDate() {
|
||||
return date;
|
||||
public LocalDate getDocumentDate() {
|
||||
return documentDate;
|
||||
}
|
||||
|
||||
public void setDate(LocalDate date) {
|
||||
this.date = date;
|
||||
public void setDocumentDate(LocalDate documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
}
|
||||
|
||||
public LocalDate getValueDate() {
|
||||
return valueDate;
|
||||
}
|
||||
|
||||
public void setValueDate(LocalDate valueDate) {
|
||||
this.valueDate = valueDate;
|
||||
}
|
||||
|
||||
public AssetAction getAction() {
|
||||
@ -63,20 +73,28 @@ public class AssetDTO implements Serializable {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return comment;
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
this.comment = comment;
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public Long getMemberId() {
|
||||
return memberId;
|
||||
public Long getMembershipId() {
|
||||
return membershipId;
|
||||
}
|
||||
|
||||
public void setMemberId(Long membershipId) {
|
||||
this.memberId = membershipId;
|
||||
public void setMembershipId(Long membershipId) {
|
||||
this.membershipId = membershipId;
|
||||
}
|
||||
|
||||
public String getMembershipDocumentDate() {
|
||||
return membershipDocumentDate;
|
||||
}
|
||||
|
||||
public void setMembershipDocumentDate(String membershipDocumentDate) {
|
||||
this.membershipDocumentDate = membershipDocumentDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -104,11 +122,13 @@ public class AssetDTO implements Serializable {
|
||||
public String toString() {
|
||||
return "AssetDTO{" +
|
||||
"id=" + getId() +
|
||||
", date='" + getDate() + "'" +
|
||||
", documentDate='" + getDocumentDate() + "'" +
|
||||
", valueDate='" + getValueDate() + "'" +
|
||||
", action='" + getAction() + "'" +
|
||||
", amount=" + getAmount() +
|
||||
", comment='" + getComment() + "'" +
|
||||
", member=" + getMemberId() +
|
||||
", remark='" + getRemark() + "'" +
|
||||
", membership=" + getMembershipId() +
|
||||
", membership='" + getMembershipDocumentDate() + "'" +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
@ -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&attr1.contains=something&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 + ", " : "") +
|
||||
"}";
|
||||
}
|
||||
|
||||
}
|
@ -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() + "'" +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -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&attr1.contains=something&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 + ", " : "") +
|
||||
"}";
|
||||
}
|
||||
|
||||
}
|
@ -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() + "'" +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -1,12 +1,14 @@
|
||||
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.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
|
||||
@ -22,24 +24,26 @@ public class CustomerCriteria implements Serializable {
|
||||
|
||||
private LongFilter id;
|
||||
|
||||
private IntegerFilter number;
|
||||
private IntegerFilter reference;
|
||||
|
||||
private StringFilter prefix;
|
||||
|
||||
private StringFilter name;
|
||||
|
||||
private StringFilter contractualAddress;
|
||||
|
||||
private StringFilter contractualSalutation;
|
||||
|
||||
private StringFilter billingAddress;
|
||||
private StringFilter contractualAddress;
|
||||
|
||||
private StringFilter billingSalutation;
|
||||
|
||||
private LongFilter roleId;
|
||||
private StringFilter billingAddress;
|
||||
|
||||
private StringFilter remark;
|
||||
|
||||
private LongFilter membershipId;
|
||||
|
||||
private LongFilter sepamandateId;
|
||||
|
||||
public LongFilter getId() {
|
||||
return id;
|
||||
}
|
||||
@ -48,12 +52,12 @@ public class CustomerCriteria implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public IntegerFilter getNumber() {
|
||||
return number;
|
||||
public IntegerFilter getReference() {
|
||||
return reference;
|
||||
}
|
||||
|
||||
public void setNumber(IntegerFilter number) {
|
||||
this.number = number;
|
||||
public void setReference(IntegerFilter reference) {
|
||||
this.reference = reference;
|
||||
}
|
||||
|
||||
public StringFilter getPrefix() {
|
||||
@ -72,14 +76,6 @@ public class CustomerCriteria implements Serializable {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public StringFilter getContractualAddress() {
|
||||
return contractualAddress;
|
||||
}
|
||||
|
||||
public void setContractualAddress(StringFilter contractualAddress) {
|
||||
this.contractualAddress = contractualAddress;
|
||||
}
|
||||
|
||||
public StringFilter getContractualSalutation() {
|
||||
return contractualSalutation;
|
||||
}
|
||||
@ -88,12 +84,12 @@ public class CustomerCriteria implements Serializable {
|
||||
this.contractualSalutation = contractualSalutation;
|
||||
}
|
||||
|
||||
public StringFilter getBillingAddress() {
|
||||
return billingAddress;
|
||||
public StringFilter getContractualAddress() {
|
||||
return contractualAddress;
|
||||
}
|
||||
|
||||
public void setBillingAddress(StringFilter billingAddress) {
|
||||
this.billingAddress = billingAddress;
|
||||
public void setContractualAddress(StringFilter contractualAddress) {
|
||||
this.contractualAddress = contractualAddress;
|
||||
}
|
||||
|
||||
public StringFilter getBillingSalutation() {
|
||||
@ -104,12 +100,20 @@ public class CustomerCriteria implements Serializable {
|
||||
this.billingSalutation = billingSalutation;
|
||||
}
|
||||
|
||||
public LongFilter getRoleId() {
|
||||
return roleId;
|
||||
public StringFilter getBillingAddress() {
|
||||
return billingAddress;
|
||||
}
|
||||
|
||||
public void setRoleId(LongFilter roleId) {
|
||||
this.roleId = roleId;
|
||||
public void setBillingAddress(StringFilter billingAddress) {
|
||||
this.billingAddress = billingAddress;
|
||||
}
|
||||
|
||||
public StringFilter getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(StringFilter remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public LongFilter getMembershipId() {
|
||||
@ -120,6 +124,14 @@ public class CustomerCriteria implements Serializable {
|
||||
this.membershipId = membershipId;
|
||||
}
|
||||
|
||||
public LongFilter getSepamandateId() {
|
||||
return sepamandateId;
|
||||
}
|
||||
|
||||
public void setSepamandateId(LongFilter sepamandateId) {
|
||||
this.sepamandateId = sepamandateId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
@ -132,30 +144,32 @@ public class CustomerCriteria implements Serializable {
|
||||
final CustomerCriteria that = (CustomerCriteria) o;
|
||||
return
|
||||
Objects.equals(id, that.id) &&
|
||||
Objects.equals(number, that.number) &&
|
||||
Objects.equals(reference, that.reference) &&
|
||||
Objects.equals(prefix, that.prefix) &&
|
||||
Objects.equals(name, that.name) &&
|
||||
Objects.equals(contractualAddress, that.contractualAddress) &&
|
||||
Objects.equals(contractualSalutation, that.contractualSalutation) &&
|
||||
Objects.equals(billingAddress, that.billingAddress) &&
|
||||
Objects.equals(contractualAddress, that.contractualAddress) &&
|
||||
Objects.equals(billingSalutation, that.billingSalutation) &&
|
||||
Objects.equals(roleId, that.roleId) &&
|
||||
Objects.equals(membershipId, that.membershipId);
|
||||
Objects.equals(billingAddress, that.billingAddress) &&
|
||||
Objects.equals(remark, that.remark) &&
|
||||
Objects.equals(membershipId, that.membershipId) &&
|
||||
Objects.equals(sepamandateId, that.sepamandateId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
id,
|
||||
number,
|
||||
reference,
|
||||
prefix,
|
||||
name,
|
||||
contractualAddress,
|
||||
contractualSalutation,
|
||||
billingAddress,
|
||||
contractualAddress,
|
||||
billingSalutation,
|
||||
roleId,
|
||||
membershipId
|
||||
billingAddress,
|
||||
remark,
|
||||
membershipId,
|
||||
sepamandateId
|
||||
);
|
||||
}
|
||||
|
||||
@ -163,15 +177,16 @@ public class CustomerCriteria implements Serializable {
|
||||
public String toString() {
|
||||
return "CustomerCriteria{" +
|
||||
(id != null ? "id=" + id + ", " : "") +
|
||||
(number != null ? "number=" + number + ", " : "") +
|
||||
(reference != null ? "reference=" + reference + ", " : "") +
|
||||
(prefix != null ? "prefix=" + prefix + ", " : "") +
|
||||
(name != null ? "name=" + name + ", " : "") +
|
||||
(contractualAddress != null ? "contractualAddress=" + contractualAddress + ", " : "") +
|
||||
(contractualSalutation != null ? "contractualSalutation=" + contractualSalutation + ", " : "") +
|
||||
(billingAddress != null ? "billingAddress=" + billingAddress + ", " : "") +
|
||||
(contractualAddress != null ? "contractualAddress=" + contractualAddress + ", " : "") +
|
||||
(billingSalutation != null ? "billingSalutation=" + billingSalutation + ", " : "") +
|
||||
(roleId != null ? "roleId=" + roleId + ", " : "") +
|
||||
(membershipId != null ? "membershipId=" + membershipId + ", " : "") +
|
||||
(billingAddress != null ? "billingAddress=" + billingAddress + ", " : "") +
|
||||
(remark != null ? "remark=" + remark + ", " : "") +
|
||||
(membershipId != null ? "membershipId=" + membershipId + ", " : "") +
|
||||
(sepamandateId != null ? "sepamandateId=" + sepamandateId + ", " : "") +
|
||||
"}";
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,6 @@ import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* A DTO for the Customer entity.
|
||||
*/
|
||||
@ -36,9 +35,10 @@ public class CustomerDTO implements Serializable {
|
||||
@Min(value = 10000)
|
||||
@Max(value = 99999)
|
||||
@AccessFor(init = Role.ADMIN, read = Role.ANY_CUSTOMER_USER)
|
||||
private Integer number;
|
||||
private Integer reference;
|
||||
|
||||
@NotNull
|
||||
@Size(max = 3)
|
||||
@Pattern(regexp = "[a-z][a-z0-9]+")
|
||||
@AccessFor(init = Role.ADMIN, read = Role.ANY_CUSTOMER_USER)
|
||||
private String prefix;
|
||||
@ -48,6 +48,10 @@ public class CustomerDTO implements Serializable {
|
||||
@AccessFor(init = Role.ADMIN, read = Role.ANY_CUSTOMER_USER)
|
||||
private String name;
|
||||
|
||||
@Size(max = 80)
|
||||
@AccessFor(init = Role.ADMIN, update = Role.CONTRACTUAL_CONTACT, read = Role.ANY_CUSTOMER_CONTACT)
|
||||
private String contractualSalutation;
|
||||
|
||||
@NotNull
|
||||
@Size(max = 400)
|
||||
@AccessFor(init = Role.ADMIN, update = Role.ADMIN, read = Role.CONTRACTUAL_CONTACT)
|
||||
@ -57,13 +61,17 @@ public class CustomerDTO implements Serializable {
|
||||
@AccessFor(init = Role.ADMIN, update = Role.CONTRACTUAL_CONTACT, read = Role.ANY_CUSTOMER_CONTACT)
|
||||
private String contractualSalutation;
|
||||
|
||||
@Size(max = 80)
|
||||
@AccessFor(init = Role.ADMIN, update = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT}, read = Role.CONTRACTUAL_CONTACT)
|
||||
private String billingSalutation;
|
||||
|
||||
@Size(max = 400)
|
||||
@AccessFor(init = Role.ADMIN, update = Role.ADMIN, read = Role.CONTRACTUAL_CONTACT)
|
||||
private String billingAddress;
|
||||
|
||||
@Size(max = 80)
|
||||
@AccessFor(init = Role.ADMIN, update = {Role.CONTRACTUAL_CONTACT, Role.FINANCIAL_CONTACT}, read = Role.CONTRACTUAL_CONTACT)
|
||||
private String billingSalutation;
|
||||
@Size(max = 160)
|
||||
@AccessFor(init = Role.ADMIN, update = Role.SUPPORTER, read = Role.SUPPORTER)
|
||||
private String remark;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -73,12 +81,12 @@ public class CustomerDTO implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getNumber() {
|
||||
return number;
|
||||
public Integer getReference() {
|
||||
return reference;
|
||||
}
|
||||
|
||||
public void setNumber(Integer number) {
|
||||
this.number = number;
|
||||
public void setReference(Integer reference) {
|
||||
this.reference = reference;
|
||||
}
|
||||
|
||||
public String getPrefix() {
|
||||
@ -97,6 +105,14 @@ public class CustomerDTO implements Serializable {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getContractualSalutation() {
|
||||
return contractualSalutation;
|
||||
}
|
||||
|
||||
public void setContractualSalutation(String contractualSalutation) {
|
||||
this.contractualSalutation = contractualSalutation;
|
||||
}
|
||||
|
||||
public String getContractualAddress() {
|
||||
return contractualAddress;
|
||||
}
|
||||
@ -105,12 +121,12 @@ public class CustomerDTO implements Serializable {
|
||||
this.contractualAddress = contractualAddress;
|
||||
}
|
||||
|
||||
public String getContractualSalutation() {
|
||||
return contractualSalutation;
|
||||
public String getBillingSalutation() {
|
||||
return billingSalutation;
|
||||
}
|
||||
|
||||
public void setContractualSalutation(String contractualSalutation) {
|
||||
this.contractualSalutation = contractualSalutation;
|
||||
public void setBillingSalutation(String billingSalutation) {
|
||||
this.billingSalutation = billingSalutation;
|
||||
}
|
||||
|
||||
public String getBillingAddress() {
|
||||
@ -121,12 +137,12 @@ public class CustomerDTO implements Serializable {
|
||||
this.billingAddress = billingAddress;
|
||||
}
|
||||
|
||||
public String getBillingSalutation() {
|
||||
return billingSalutation;
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setBillingSalutation(String billingSalutation) {
|
||||
this.billingSalutation = billingSalutation;
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -154,13 +170,14 @@ public class CustomerDTO implements Serializable {
|
||||
public String toString() {
|
||||
return "CustomerDTO{" +
|
||||
"id=" + getId() +
|
||||
", number=" + getNumber() +
|
||||
", reference=" + getReference() +
|
||||
", prefix='" + getPrefix() + "'" +
|
||||
", name='" + getName() + "'" +
|
||||
", contractualAddress='" + getContractualAddress() + "'" +
|
||||
", contractualSalutation='" + getContractualSalutation() + "'" +
|
||||
", billingAddress='" + getBillingAddress() + "'" +
|
||||
", contractualAddress='" + getContractualAddress() + "'" +
|
||||
", billingSalutation='" + getBillingSalutation() + "'" +
|
||||
", billingAddress='" + getBillingAddress() + "'" +
|
||||
", remark='" + getRemark() + "'" +
|
||||
"}";
|
||||
}
|
||||
|
||||
|
@ -25,9 +25,13 @@ public class MembershipCriteria implements Serializable {
|
||||
|
||||
private LongFilter id;
|
||||
|
||||
private LocalDateFilter sinceDate;
|
||||
private LocalDateFilter documentDate;
|
||||
|
||||
private LocalDateFilter untilDate;
|
||||
private LocalDateFilter memberFrom;
|
||||
|
||||
private LocalDateFilter memberUntil;
|
||||
|
||||
private StringFilter remark;
|
||||
|
||||
private LongFilter shareId;
|
||||
|
||||
@ -43,20 +47,36 @@ public class MembershipCriteria implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public LocalDateFilter getSinceDate() {
|
||||
return sinceDate;
|
||||
public LocalDateFilter getDocumentDate() {
|
||||
return documentDate;
|
||||
}
|
||||
|
||||
public void setSinceDate(LocalDateFilter sinceDate) {
|
||||
this.sinceDate = sinceDate;
|
||||
public void setDocumentDate(LocalDateFilter documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
}
|
||||
|
||||
public LocalDateFilter getUntilDate() {
|
||||
return untilDate;
|
||||
public LocalDateFilter getMemberFrom() {
|
||||
return memberFrom;
|
||||
}
|
||||
|
||||
public void setUntilDate(LocalDateFilter untilDate) {
|
||||
this.untilDate = untilDate;
|
||||
public void setMemberFrom(LocalDateFilter memberFrom) {
|
||||
this.memberFrom = memberFrom;
|
||||
}
|
||||
|
||||
public LocalDateFilter getMemberUntil() {
|
||||
return memberUntil;
|
||||
}
|
||||
|
||||
public void setMemberUntil(LocalDateFilter memberUntil) {
|
||||
this.memberUntil = memberUntil;
|
||||
}
|
||||
|
||||
public StringFilter getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(StringFilter remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public LongFilter getShareId() {
|
||||
@ -95,8 +115,10 @@ public class MembershipCriteria implements Serializable {
|
||||
final MembershipCriteria that = (MembershipCriteria) o;
|
||||
return
|
||||
Objects.equals(id, that.id) &&
|
||||
Objects.equals(sinceDate, that.sinceDate) &&
|
||||
Objects.equals(untilDate, that.untilDate) &&
|
||||
Objects.equals(documentDate, that.documentDate) &&
|
||||
Objects.equals(memberFrom, that.memberFrom) &&
|
||||
Objects.equals(memberUntil, that.memberUntil) &&
|
||||
Objects.equals(remark, that.remark) &&
|
||||
Objects.equals(shareId, that.shareId) &&
|
||||
Objects.equals(assetId, that.assetId) &&
|
||||
Objects.equals(customerId, that.customerId);
|
||||
@ -106,8 +128,10 @@ public class MembershipCriteria implements Serializable {
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
id,
|
||||
sinceDate,
|
||||
untilDate,
|
||||
documentDate,
|
||||
memberFrom,
|
||||
memberUntil,
|
||||
remark,
|
||||
shareId,
|
||||
assetId,
|
||||
customerId
|
||||
@ -118,8 +142,10 @@ public class MembershipCriteria implements Serializable {
|
||||
public String toString() {
|
||||
return "MembershipCriteria{" +
|
||||
(id != null ? "id=" + id + ", " : "") +
|
||||
(sinceDate != null ? "sinceDate=" + sinceDate + ", " : "") +
|
||||
(untilDate != null ? "untilDate=" + untilDate + ", " : "") +
|
||||
(documentDate != null ? "documentDate=" + documentDate + ", " : "") +
|
||||
(memberFrom != null ? "memberFrom=" + memberFrom + ", " : "") +
|
||||
(memberUntil != null ? "memberUntil=" + memberUntil + ", " : "") +
|
||||
(remark != null ? "remark=" + remark + ", " : "") +
|
||||
(shareId != null ? "shareId=" + shareId + ", " : "") +
|
||||
(assetId != null ? "assetId=" + assetId + ", " : "") +
|
||||
(customerId != null ? "customerId=" + customerId + ", " : "") +
|
||||
|
@ -1,8 +1,7 @@
|
||||
package org.hostsharing.hsadminng.service.dto;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import javax.validation.constraints.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@ -14,11 +13,17 @@ public class MembershipDTO implements Serializable {
|
||||
private Long id;
|
||||
|
||||
@NotNull
|
||||
private LocalDate sinceDate;
|
||||
|
||||
private LocalDate untilDate;
|
||||
private LocalDate documentDate;
|
||||
|
||||
@NotNull
|
||||
private LocalDate memberFrom;
|
||||
|
||||
private LocalDate memberUntil;
|
||||
|
||||
@Size(max = 160)
|
||||
private String remark;
|
||||
|
||||
|
||||
private Long customerId;
|
||||
|
||||
private String customerPrefix;
|
||||
@ -37,20 +42,36 @@ public class MembershipDTO implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public LocalDate getSinceDate() {
|
||||
return sinceDate;
|
||||
public LocalDate getDocumentDate() {
|
||||
return documentDate;
|
||||
}
|
||||
|
||||
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 void setUntilDate(LocalDate untilDate) {
|
||||
this.untilDate = untilDate;
|
||||
public void setMemberFrom(LocalDate memberFrom) {
|
||||
this.memberFrom = memberFrom;
|
||||
}
|
||||
|
||||
public LocalDate getMemberUntil() {
|
||||
return memberUntil;
|
||||
}
|
||||
|
||||
public void setMemberUntil(LocalDate memberUntil) {
|
||||
this.memberUntil = memberUntil;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public Long getCustomerId() {
|
||||
@ -94,8 +115,10 @@ public class MembershipDTO implements Serializable {
|
||||
public String toString() {
|
||||
return "MembershipDTO{" +
|
||||
"id=" + getId() +
|
||||
", sinceDate='" + getSinceDate() + "'" +
|
||||
", untilDate='" + getUntilDate() + "'" +
|
||||
", documentDate='" + getDocumentDate() + "'" +
|
||||
", memberFrom='" + getMemberFrom() + "'" +
|
||||
", memberUntil='" + getMemberUntil() + "'" +
|
||||
", remark='" + getRemark() + "'" +
|
||||
", customer=" + getCustomerId() +
|
||||
", customer='" + getCustomerPrefix() + "'" +
|
||||
"}";
|
||||
|
@ -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&attr1.contains=something&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 documentDate;
|
||||
|
||||
private LocalDateFilter validFrom;
|
||||
|
||||
private LocalDateFilter validUntil;
|
||||
|
||||
private LocalDateFilter lastUsed;
|
||||
|
||||
private LocalDateFilter cancellationDate;
|
||||
|
||||
private StringFilter remark;
|
||||
|
||||
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 getDocumentDate() {
|
||||
return documentDate;
|
||||
}
|
||||
|
||||
public void setDocumentDate(LocalDateFilter documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
}
|
||||
|
||||
public LocalDateFilter getValidFrom() {
|
||||
return validFrom;
|
||||
}
|
||||
|
||||
public void setValidFrom(LocalDateFilter validFrom) {
|
||||
this.validFrom = validFrom;
|
||||
}
|
||||
|
||||
public LocalDateFilter getValidUntil() {
|
||||
return validUntil;
|
||||
}
|
||||
|
||||
public void setValidUntil(LocalDateFilter validUntil) {
|
||||
this.validUntil = validUntil;
|
||||
}
|
||||
|
||||
public LocalDateFilter getLastUsed() {
|
||||
return lastUsed;
|
||||
}
|
||||
|
||||
public void setLastUsed(LocalDateFilter lastUsed) {
|
||||
this.lastUsed = lastUsed;
|
||||
}
|
||||
|
||||
public LocalDateFilter getCancellationDate() {
|
||||
return cancellationDate;
|
||||
}
|
||||
|
||||
public void setCancellationDate(LocalDateFilter cancellationDate) {
|
||||
this.cancellationDate = cancellationDate;
|
||||
}
|
||||
|
||||
public StringFilter getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(StringFilter remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
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(documentDate, that.documentDate) &&
|
||||
Objects.equals(validFrom, that.validFrom) &&
|
||||
Objects.equals(validUntil, that.validUntil) &&
|
||||
Objects.equals(lastUsed, that.lastUsed) &&
|
||||
Objects.equals(cancellationDate, that.cancellationDate) &&
|
||||
Objects.equals(remark, that.remark) &&
|
||||
Objects.equals(customerId, that.customerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
id,
|
||||
reference,
|
||||
iban,
|
||||
bic,
|
||||
documentDate,
|
||||
validFrom,
|
||||
validUntil,
|
||||
lastUsed,
|
||||
cancellationDate,
|
||||
remark,
|
||||
customerId
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SepaMandateCriteria{" +
|
||||
(id != null ? "id=" + id + ", " : "") +
|
||||
(reference != null ? "reference=" + reference + ", " : "") +
|
||||
(iban != null ? "iban=" + iban + ", " : "") +
|
||||
(bic != null ? "bic=" + bic + ", " : "") +
|
||||
(documentDate != null ? "documentDate=" + documentDate + ", " : "") +
|
||||
(validFrom != null ? "validFrom=" + validFrom + ", " : "") +
|
||||
(validUntil != null ? "validUntil=" + validUntil + ", " : "") +
|
||||
(lastUsed != null ? "lastUsed=" + lastUsed + ", " : "") +
|
||||
(cancellationDate != null ? "cancellationDate=" + cancellationDate + ", " : "") +
|
||||
(remark != null ? "remark=" + remark + ", " : "") +
|
||||
(customerId != null ? "customerId=" + customerId + ", " : "") +
|
||||
"}";
|
||||
}
|
||||
|
||||
}
|
@ -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 documentDate;
|
||||
|
||||
@NotNull
|
||||
private LocalDate validFrom;
|
||||
|
||||
private LocalDate validUntil;
|
||||
|
||||
private LocalDate lastUsed;
|
||||
|
||||
private LocalDate cancellationDate;
|
||||
|
||||
@Size(max = 160)
|
||||
private String remark;
|
||||
|
||||
|
||||
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 getDocumentDate() {
|
||||
return documentDate;
|
||||
}
|
||||
|
||||
public void setDocumentDate(LocalDate documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
}
|
||||
|
||||
public LocalDate getValidFrom() {
|
||||
return validFrom;
|
||||
}
|
||||
|
||||
public void setValidFrom(LocalDate validFrom) {
|
||||
this.validFrom = validFrom;
|
||||
}
|
||||
|
||||
public LocalDate getValidUntil() {
|
||||
return validUntil;
|
||||
}
|
||||
|
||||
public void setValidUntil(LocalDate validUntil) {
|
||||
this.validUntil = validUntil;
|
||||
}
|
||||
|
||||
public LocalDate getLastUsed() {
|
||||
return lastUsed;
|
||||
}
|
||||
|
||||
public void setLastUsed(LocalDate lastUsed) {
|
||||
this.lastUsed = lastUsed;
|
||||
}
|
||||
|
||||
public LocalDate getCancellationDate() {
|
||||
return cancellationDate;
|
||||
}
|
||||
|
||||
public void setCancellationDate(LocalDate cancellationDate) {
|
||||
this.cancellationDate = cancellationDate;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
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() + "'" +
|
||||
", documentDate='" + getDocumentDate() + "'" +
|
||||
", validFrom='" + getValidFrom() + "'" +
|
||||
", validUntil='" + getValidUntil() + "'" +
|
||||
", lastUsed='" + getLastUsed() + "'" +
|
||||
", cancellationDate='" + getCancellationDate() + "'" +
|
||||
", remark='" + getRemark() + "'" +
|
||||
", customer=" + getCustomerId() +
|
||||
", customer='" + getCustomerPrefix() + "'" +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -31,15 +31,17 @@ public class ShareCriteria implements Serializable {
|
||||
|
||||
private LongFilter id;
|
||||
|
||||
private LocalDateFilter date;
|
||||
private LocalDateFilter documentDate;
|
||||
|
||||
private LocalDateFilter valueDate;
|
||||
|
||||
private ShareActionFilter action;
|
||||
|
||||
private IntegerFilter quantity;
|
||||
|
||||
private StringFilter comment;
|
||||
private StringFilter remark;
|
||||
|
||||
private LongFilter memberId;
|
||||
private LongFilter membershipId;
|
||||
|
||||
public LongFilter getId() {
|
||||
return id;
|
||||
@ -49,12 +51,20 @@ public class ShareCriteria implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public LocalDateFilter getDate() {
|
||||
return date;
|
||||
public LocalDateFilter getDocumentDate() {
|
||||
return documentDate;
|
||||
}
|
||||
|
||||
public void setDate(LocalDateFilter date) {
|
||||
this.date = date;
|
||||
public void setDocumentDate(LocalDateFilter documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
}
|
||||
|
||||
public LocalDateFilter getValueDate() {
|
||||
return valueDate;
|
||||
}
|
||||
|
||||
public void setValueDate(LocalDateFilter valueDate) {
|
||||
this.valueDate = valueDate;
|
||||
}
|
||||
|
||||
public ShareActionFilter getAction() {
|
||||
@ -73,20 +83,20 @@ public class ShareCriteria implements Serializable {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public StringFilter getComment() {
|
||||
return comment;
|
||||
public StringFilter getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setComment(StringFilter comment) {
|
||||
this.comment = comment;
|
||||
public void setRemark(StringFilter remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public LongFilter getMemberId() {
|
||||
return memberId;
|
||||
public LongFilter getMembershipId() {
|
||||
return membershipId;
|
||||
}
|
||||
|
||||
public void setMemberId(LongFilter memberId) {
|
||||
this.memberId = memberId;
|
||||
public void setMembershipId(LongFilter membershipId) {
|
||||
this.membershipId = membershipId;
|
||||
}
|
||||
|
||||
|
||||
@ -101,22 +111,24 @@ public class ShareCriteria implements Serializable {
|
||||
final ShareCriteria that = (ShareCriteria) o;
|
||||
return
|
||||
Objects.equals(id, that.id) &&
|
||||
Objects.equals(date, that.date) &&
|
||||
Objects.equals(documentDate, that.documentDate) &&
|
||||
Objects.equals(valueDate, that.valueDate) &&
|
||||
Objects.equals(action, that.action) &&
|
||||
Objects.equals(quantity, that.quantity) &&
|
||||
Objects.equals(comment, that.comment) &&
|
||||
Objects.equals(memberId, that.memberId);
|
||||
Objects.equals(remark, that.remark) &&
|
||||
Objects.equals(membershipId, that.membershipId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
id,
|
||||
date,
|
||||
documentDate,
|
||||
valueDate,
|
||||
action,
|
||||
quantity,
|
||||
comment,
|
||||
memberId
|
||||
remark,
|
||||
membershipId
|
||||
);
|
||||
}
|
||||
|
||||
@ -124,11 +136,12 @@ public class ShareCriteria implements Serializable {
|
||||
public String toString() {
|
||||
return "ShareCriteria{" +
|
||||
(id != null ? "id=" + id + ", " : "") +
|
||||
(date != null ? "date=" + date + ", " : "") +
|
||||
(documentDate != null ? "documentDate=" + documentDate + ", " : "") +
|
||||
(valueDate != null ? "valueDate=" + valueDate + ", " : "") +
|
||||
(action != null ? "action=" + action + ", " : "") +
|
||||
(quantity != null ? "quantity=" + quantity + ", " : "") +
|
||||
(comment != null ? "comment=" + comment + ", " : "") +
|
||||
(memberId != null ? "memberId=" + memberId + ", " : "") +
|
||||
(remark != null ? "remark=" + remark + ", " : "") +
|
||||
(membershipId != null ? "membershipId=" + membershipId + ", " : "") +
|
||||
"}";
|
||||
}
|
||||
|
||||
|
@ -1,12 +1,9 @@
|
||||
package org.hostsharing.hsadminng.service.dto;
|
||||
|
||||
import org.hostsharing.hsadminng.domain.enumeration.ShareAction;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import javax.validation.constraints.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
import org.hostsharing.hsadminng.domain.enumeration.ShareAction;
|
||||
|
||||
/**
|
||||
* A DTO for the Share entity.
|
||||
@ -16,7 +13,10 @@ public class ShareDTO implements Serializable {
|
||||
private Long id;
|
||||
|
||||
@NotNull
|
||||
private LocalDate date;
|
||||
private LocalDate documentDate;
|
||||
|
||||
@NotNull
|
||||
private LocalDate valueDate;
|
||||
|
||||
@NotNull
|
||||
private ShareAction action;
|
||||
@ -25,10 +25,12 @@ public class ShareDTO implements Serializable {
|
||||
private Integer quantity;
|
||||
|
||||
@Size(max = 160)
|
||||
private String comment;
|
||||
private String remark;
|
||||
|
||||
@NotNull
|
||||
private Long memberId;
|
||||
|
||||
private Long membershipId;
|
||||
|
||||
private String membershipDocumentDate;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -38,12 +40,20 @@ public class ShareDTO implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public LocalDate getDate() {
|
||||
return date;
|
||||
public LocalDate getDocumentDate() {
|
||||
return documentDate;
|
||||
}
|
||||
|
||||
public void setDate(LocalDate date) {
|
||||
this.date = date;
|
||||
public void setDocumentDate(LocalDate documentDate) {
|
||||
this.documentDate = documentDate;
|
||||
}
|
||||
|
||||
public LocalDate getValueDate() {
|
||||
return valueDate;
|
||||
}
|
||||
|
||||
public void setValueDate(LocalDate valueDate) {
|
||||
this.valueDate = valueDate;
|
||||
}
|
||||
|
||||
public ShareAction getAction() {
|
||||
@ -62,20 +72,28 @@ public class ShareDTO implements Serializable {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return comment;
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
this.comment = comment;
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public Long getMemberId() {
|
||||
return memberId;
|
||||
public Long getMembershipId() {
|
||||
return membershipId;
|
||||
}
|
||||
|
||||
public void setMemberId(Long membershipId) {
|
||||
this.memberId = membershipId;
|
||||
public void setMembershipId(Long membershipId) {
|
||||
this.membershipId = membershipId;
|
||||
}
|
||||
|
||||
public String getMembershipDocumentDate() {
|
||||
return membershipDocumentDate;
|
||||
}
|
||||
|
||||
public void setMembershipDocumentDate(String membershipDocumentDate) {
|
||||
this.membershipDocumentDate = membershipDocumentDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -103,11 +121,13 @@ public class ShareDTO implements Serializable {
|
||||
public String toString() {
|
||||
return "ShareDTO{" +
|
||||
"id=" + getId() +
|
||||
", date='" + getDate() + "'" +
|
||||
", documentDate='" + getDocumentDate() + "'" +
|
||||
", valueDate='" + getValueDate() + "'" +
|
||||
", action='" + getAction() + "'" +
|
||||
", quantity=" + getQuantity() +
|
||||
", comment='" + getComment() + "'" +
|
||||
", member=" + getMemberId() +
|
||||
", remark='" + getRemark() + "'" +
|
||||
", membership=" + getMembershipId() +
|
||||
", membership='" + getMembershipDocumentDate() + "'" +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
@ -11,10 +11,11 @@ import org.mapstruct.*;
|
||||
@Mapper(componentModel = "spring", uses = {MembershipMapper.class})
|
||||
public interface AssetMapper extends EntityMapper<AssetDTO, Asset> {
|
||||
|
||||
@Mapping(source = "member.id", target = "memberId")
|
||||
@Mapping(source = "membership.id", target = "membershipId")
|
||||
@Mapping(source = "membership.documentDate", target = "membershipDocumentDate")
|
||||
AssetDTO toDto(Asset asset);
|
||||
|
||||
@Mapping(source = "memberId", target = "member")
|
||||
@Mapping(source = "membershipId", target = "membership")
|
||||
Asset toEntity(AssetDTO assetDTO);
|
||||
|
||||
default Asset fromId(Long id) {
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -1,9 +1,9 @@
|
||||
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.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
import org.mapstruct.*;
|
||||
|
||||
/**
|
||||
* Mapper for the entity Customer and its DTO CustomerDTO.
|
||||
@ -12,8 +12,8 @@ import org.mapstruct.Mapping;
|
||||
public interface CustomerMapper extends EntityMapper<CustomerDTO, Customer> {
|
||||
|
||||
|
||||
@Mapping(target = "roles", ignore = true)
|
||||
@Mapping(target = "memberships", ignore = true)
|
||||
@Mapping(target = "sepamandates", ignore = true)
|
||||
Customer toEntity(CustomerDTO customerDTO);
|
||||
|
||||
default Customer fromId(Long id) {
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -11,10 +11,11 @@ import org.mapstruct.*;
|
||||
@Mapper(componentModel = "spring", uses = {MembershipMapper.class})
|
||||
public interface ShareMapper extends EntityMapper<ShareDTO, Share> {
|
||||
|
||||
@Mapping(source = "member.id", target = "memberId")
|
||||
@Mapping(source = "membership.id", target = "membershipId")
|
||||
@Mapping(source = "membership.documentDate", target = "membershipDocumentDate")
|
||||
ShareDTO toDto(Share share);
|
||||
|
||||
@Mapping(source = "memberId", target = "member")
|
||||
@Mapping(source = "membershipId", target = "membership")
|
||||
Share toEntity(ShareDTO shareDTO);
|
||||
|
||||
default Share fromId(Long id) {
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
@ -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();
|
||||
}
|
||||
}
|
@ -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();
|
||||
}
|
||||
}
|
@ -1,37 +1,24 @@
|
||||
filter all
|
||||
dto all with mapstruct
|
||||
service all with serviceClass
|
||||
paginate all with infinite-scroll
|
||||
paginate all with infinite-scroll
|
||||
|
||||
entity Customer {
|
||||
number Integer required unique min(10000) max(99999),
|
||||
prefix String required unique pattern(/[a-z][a-z0-9]+/),
|
||||
reference Integer required unique min(10000) max(99999),
|
||||
prefix String required maxlength(3) unique pattern(/[a-z][a-z0-9]+/),
|
||||
name String required maxlength(80),
|
||||
contractualAddress String required maxlength(400),
|
||||
contractualSalutation String maxlength(80),
|
||||
contractualAddress String required maxlength(400),
|
||||
billingSalutation String maxlength(80),
|
||||
billingAddress String maxlength(400),
|
||||
billingSalutation String maxlength(80)
|
||||
}
|
||||
|
||||
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
|
||||
remark String maxlength(160)
|
||||
}
|
||||
|
||||
entity Membership {
|
||||
sinceDate LocalDate required,
|
||||
untilDate LocalDate
|
||||
documentDate LocalDate required,
|
||||
memberFrom LocalDate required,
|
||||
memberUntil LocalDate,
|
||||
remark String maxlength(160)
|
||||
}
|
||||
|
||||
enum ShareAction {
|
||||
@ -40,10 +27,11 @@ enum ShareAction {
|
||||
}
|
||||
|
||||
entity Share {
|
||||
date LocalDate required,
|
||||
documentDate LocalDate required,
|
||||
valueDate LocalDate required,
|
||||
action ShareAction required,
|
||||
quantity Integer required,
|
||||
comment String maxlength(160)
|
||||
remark String maxlength(160)
|
||||
}
|
||||
|
||||
enum AssetAction {
|
||||
@ -56,17 +44,28 @@ enum AssetAction {
|
||||
}
|
||||
|
||||
entity Asset {
|
||||
date LocalDate required,
|
||||
documentDate LocalDate required,
|
||||
valueDate LocalDate required,
|
||||
action AssetAction required,
|
||||
amount BigDecimal required,
|
||||
comment String maxlength(160)
|
||||
remark String maxlength(160)
|
||||
}
|
||||
|
||||
entity SepaMandate {
|
||||
reference String maxlength(40) unique required,
|
||||
iban String maxlength(34),
|
||||
bic String maxlength(11),
|
||||
documentDate LocalDate required,
|
||||
validFrom LocalDate required,
|
||||
validUntil LocalDate,
|
||||
lastUsed LocalDate,
|
||||
cancellationDate LocalDate,
|
||||
remark String maxlength(160)
|
||||
}
|
||||
|
||||
relationship OneToMany {
|
||||
Contact{role} to CustomerContact{contact(email) required},
|
||||
Customer{role} to CustomerContact{customer(prefix) required},
|
||||
Customer to Membership{customer(prefix) required},
|
||||
Membership to Share{member required},
|
||||
Membership to Asset{member required}
|
||||
Customer{membership} to Membership{customer(prefix) required},
|
||||
Customer{sepamandate} to SepaMandate{customer(prefix) required},
|
||||
Membership{share} to Share{membership(documentDate) required},
|
||||
Membership{asset} to Asset{membership(documentDate) required}
|
||||
}
|
||||
|
||||
|
@ -1,40 +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 Contact.
|
||||
-->
|
||||
<changeSet id="20190403083736-1" author="jhipster">
|
||||
<createTable tableName="contact">
|
||||
<column name="id" type="bigint" autoIncrement="${autoIncrement}">
|
||||
<constraints primaryKey="true" nullable="false"/>
|
||||
</column>
|
||||
<column name="first_name" type="varchar(80)">
|
||||
<constraints nullable="false" />
|
||||
</column>
|
||||
|
||||
<column name="last_name" type="varchar(80)">
|
||||
<constraints nullable="false" />
|
||||
</column>
|
||||
|
||||
<column name="email" type="varchar(80)">
|
||||
<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>
|
@ -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>
|
@ -12,21 +12,49 @@
|
||||
<property name="floatType" value="float" dbms="mysql, oracle, mssql"/>
|
||||
|
||||
<!--
|
||||
Added the entity CustomerContact.
|
||||
Added the entity SepaMandate.
|
||||
-->
|
||||
<changeSet id="20190403083737-1" author="jhipster">
|
||||
<createTable tableName="customer_contact">
|
||||
<changeSet id="20190418073047-1" author="jhipster">
|
||||
<createTable tableName="sepa_mandate">
|
||||
<column name="id" type="bigint" autoIncrement="${autoIncrement}">
|
||||
<constraints primaryKey="true" nullable="false"/>
|
||||
</column>
|
||||
<column name="jhi_role" type="varchar(255)">
|
||||
<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" />
|
||||
</column>
|
||||
|
||||
<column name="contact_id" type="bigint">
|
||||
<column name="valid_from" type="date">
|
||||
<constraints nullable="false" />
|
||||
</column>
|
||||
|
||||
<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" />
|
||||
</column>
|
@ -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>
|
@ -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="20190418100951-2" author="jhipster">
|
||||
|
||||
<addForeignKeyConstraint baseColumnNames="customer_id"
|
||||
baseTableName="sepa_mandate"
|
||||
constraintName="fk_sepa_mandate_customer_id"
|
||||
referencedColumnNames="id"
|
||||
referencedTableName="customer"/>
|
||||
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
@ -1,8 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<databaseChangeLog
|
||||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
|
||||
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"/>
|
||||
|
||||
@ -14,16 +16,16 @@
|
||||
<!--
|
||||
Added the entity Customer.
|
||||
-->
|
||||
<changeSet id="20190403083735-1" author="jhipster">
|
||||
<changeSet id="20190418143050-1" author="jhipster">
|
||||
<createTable tableName="customer">
|
||||
<column name="id" type="bigint" autoIncrement="${autoIncrement}">
|
||||
<constraints primaryKey="true" nullable="false"/>
|
||||
</column>
|
||||
<column name="jhi_number" type="integer">
|
||||
<constraints nullable="false" unique="true" uniqueConstraintName="ux_customer_jhi_number" />
|
||||
<column name="reference" type="integer">
|
||||
<constraints nullable="false" unique="true" uniqueConstraintName="ux_customer_reference" />
|
||||
</column>
|
||||
|
||||
<column name="prefix" type="varchar(255)">
|
||||
<column name="prefix" type="varchar(3)">
|
||||
<constraints nullable="false" unique="true" uniqueConstraintName="ux_customer_prefix" />
|
||||
</column>
|
||||
|
||||
@ -31,11 +33,15 @@
|
||||
<constraints nullable="false" />
|
||||
</column>
|
||||
|
||||
<column name="contractual_salutation" type="varchar(80)">
|
||||
<constraints nullable="true" />
|
||||
</column>
|
||||
|
||||
<column name="contractual_address" type="varchar(400)">
|
||||
<constraints nullable="false" />
|
||||
</column>
|
||||
|
||||
<column name="contractual_salutation" type="varchar(80)">
|
||||
<column name="billing_salutation" type="varchar(80)">
|
||||
<constraints nullable="true" />
|
||||
</column>
|
||||
|
||||
@ -43,7 +49,7 @@
|
||||
<constraints nullable="true" />
|
||||
</column>
|
||||
|
||||
<column name="billing_salutation" type="varchar(80)">
|
||||
<column name="remark" type="varchar(160)">
|
||||
<constraints nullable="true" />
|
||||
</column>
|
||||
|
@ -1,8 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<databaseChangeLog
|
||||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
|
||||
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"/>
|
||||
|
||||
@ -14,21 +16,29 @@
|
||||
<!--
|
||||
Added the entity Membership.
|
||||
-->
|
||||
<changeSet id="20190403083738-1" author="jhipster">
|
||||
<changeSet id="20190418143051-1" author="jhipster">
|
||||
<createTable tableName="membership">
|
||||
<column name="id" type="bigint" autoIncrement="${autoIncrement}">
|
||||
<constraints primaryKey="true" nullable="false"/>
|
||||
</column>
|
||||
<column name="since_date" type="date">
|
||||
<column name="document_date" type="date">
|
||||
<constraints nullable="false" />
|
||||
</column>
|
||||
|
||||
<column name="until_date" type="date">
|
||||
<column name="member_from" type="date">
|
||||
<constraints nullable="false" />
|
||||
</column>
|
||||
|
||||
<column name="member_until" type="date">
|
||||
<constraints nullable="true" />
|
||||
</column>
|
||||
|
||||
<column name="remark" type="varchar(160)">
|
||||
<constraints nullable="true" />
|
||||
</column>
|
||||
|
||||
<column name="customer_id" type="bigint">
|
||||
<constraints nullable="false"/>
|
||||
<constraints nullable="false" />
|
||||
</column>
|
||||
|
||||
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here, do not remove-->
|
@ -6,7 +6,7 @@
|
||||
<!--
|
||||
Added the constraints for entity Membership.
|
||||
-->
|
||||
<changeSet id="20190403083738-2" author="jhipster">
|
||||
<changeSet id="20190418143051-2" author="jhipster">
|
||||
|
||||
<addForeignKeyConstraint baseColumnNames="customer_id"
|
||||
baseTableName="membership"
|
@ -1,8 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<databaseChangeLog
|
||||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
|
||||
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"/>
|
||||
|
||||
@ -14,12 +16,16 @@
|
||||
<!--
|
||||
Added the entity Share.
|
||||
-->
|
||||
<changeSet id="20190403083739-1" author="jhipster">
|
||||
<changeSet id="20190418143052-1" author="jhipster">
|
||||
<createTable tableName="share">
|
||||
<column name="id" type="bigint" autoIncrement="${autoIncrement}">
|
||||
<constraints primaryKey="true" nullable="false"/>
|
||||
</column>
|
||||
<column name="jhi_date" type="date">
|
||||
<column name="document_date" type="date">
|
||||
<constraints nullable="false" />
|
||||
</column>
|
||||
|
||||
<column name="value_date" type="date">
|
||||
<constraints nullable="false" />
|
||||
</column>
|
||||
|
||||
@ -31,12 +37,12 @@
|
||||
<constraints nullable="false" />
|
||||
</column>
|
||||
|
||||
<column name="jhi_comment" type="varchar(160)">
|
||||
<column name="remark" type="varchar(160)">
|
||||
<constraints nullable="true" />
|
||||
</column>
|
||||
|
||||
<column name="member_id" type="bigint">
|
||||
<constraints nullable="false"/>
|
||||
<column name="membership_id" type="bigint">
|
||||
<constraints nullable="false" />
|
||||
</column>
|
||||
|
||||
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here, do not remove-->
|
@ -6,11 +6,11 @@
|
||||
<!--
|
||||
Added the constraints for entity Share.
|
||||
-->
|
||||
<changeSet id="20190403083739-2" author="jhipster">
|
||||
<changeSet id="20190418143052-2" author="jhipster">
|
||||
|
||||
<addForeignKeyConstraint baseColumnNames="member_id"
|
||||
<addForeignKeyConstraint baseColumnNames="membership_id"
|
||||
baseTableName="share"
|
||||
constraintName="fk_share_member_id"
|
||||
constraintName="fk_share_membership_id"
|
||||
referencedColumnNames="id"
|
||||
referencedTableName="membership"/>
|
||||
|
@ -1,8 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<databaseChangeLog
|
||||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
|
||||
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"/>
|
||||
|
||||
@ -14,12 +16,16 @@
|
||||
<!--
|
||||
Added the entity Asset.
|
||||
-->
|
||||
<changeSet id="20190403083740-1" author="jhipster">
|
||||
<changeSet id="20190418143053-1" author="jhipster">
|
||||
<createTable tableName="asset">
|
||||
<column name="id" type="bigint" autoIncrement="${autoIncrement}">
|
||||
<constraints primaryKey="true" nullable="false"/>
|
||||
</column>
|
||||
<column name="jhi_date" type="date">
|
||||
<column name="document_date" type="date">
|
||||
<constraints nullable="false" />
|
||||
</column>
|
||||
|
||||
<column name="value_date" type="date">
|
||||
<constraints nullable="false" />
|
||||
</column>
|
||||
|
||||
@ -31,12 +37,12 @@
|
||||
<constraints nullable="false" />
|
||||
</column>
|
||||
|
||||
<column name="jhi_comment" type="varchar(160)">
|
||||
<column name="remark" type="varchar(160)">
|
||||
<constraints nullable="true" />
|
||||
</column>
|
||||
|
||||
<column name="member_id" type="bigint">
|
||||
<constraints nullable="false"/>
|
||||
<column name="membership_id" type="bigint">
|
||||
<constraints nullable="false" />
|
||||
</column>
|
||||
|
||||
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here, do not remove-->
|
@ -6,11 +6,11 @@
|
||||
<!--
|
||||
Added the constraints for entity Asset.
|
||||
-->
|
||||
<changeSet id="20190403083740-2" author="jhipster">
|
||||
<changeSet id="20190418143053-2" author="jhipster">
|
||||
|
||||
<addForeignKeyConstraint baseColumnNames="member_id"
|
||||
<addForeignKeyConstraint baseColumnNames="membership_id"
|
||||
baseTableName="asset"
|
||||
constraintName="fk_asset_member_id"
|
||||
constraintName="fk_asset_membership_id"
|
||||
referencedColumnNames="id"
|
||||
referencedTableName="membership"/>
|
||||
|
@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<databaseChangeLog
|
||||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
|
||||
|
||||
<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 SepaMandate.
|
||||
-->
|
||||
<changeSet id="20190418143054-1" author="jhipster">
|
||||
<createTable tableName="sepa_mandate">
|
||||
<column name="id" type="bigint" autoIncrement="${autoIncrement}">
|
||||
<constraints primaryKey="true" nullable="false"/>
|
||||
</column>
|
||||
<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="document_date" type="date">
|
||||
<constraints nullable="false" />
|
||||
</column>
|
||||
|
||||
<column name="valid_from" type="date">
|
||||
<constraints nullable="false" />
|
||||
</column>
|
||||
|
||||
<column name="valid_until" type="date">
|
||||
<constraints nullable="true" />
|
||||
</column>
|
||||
|
||||
<column name="last_used" type="date">
|
||||
<constraints nullable="true" />
|
||||
</column>
|
||||
|
||||
<column name="cancellation_date" type="date">
|
||||
<constraints nullable="true" />
|
||||
</column>
|
||||
|
||||
<column name="remark" type="varchar(160)">
|
||||
<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>
|
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<databaseChangeLog
|
||||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
|
||||
<!--
|
||||
Added the constraints for entity SepaMandate.
|
||||
-->
|
||||
<changeSet id="20190418143054-2" author="jhipster">
|
||||
|
||||
<addForeignKeyConstraint baseColumnNames="customer_id"
|
||||
baseTableName="sepa_mandate"
|
||||
constraintName="fk_sepa_mandate_customer_id"
|
||||
referencedColumnNames="id"
|
||||
referencedTableName="customer"/>
|
||||
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
@ -1,19 +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">
|
||||
|
||||
<changeSet id="sample-data-Contact-01" author="mhoennig" context="sample-data">
|
||||
<loadData encoding="UTF-8"
|
||||
file="config/liquibase/sample-data/contacts.csv"
|
||||
separator=";"
|
||||
tableName="contact">
|
||||
<column name="id" type="numeric"/>
|
||||
<column name="first_name" type="string"/>
|
||||
<column name="last_name" type="string"/>
|
||||
<column name="email" type="string"/>
|
||||
</loadData>
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
@ -1,19 +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">
|
||||
|
||||
<changeSet id="sample-data-CustomerContact-01" author="mhoennig" context="sample-data">
|
||||
<loadData encoding="UTF-8"
|
||||
file="config/liquibase/sample-data/customer-contacts.csv"
|
||||
separator=";"
|
||||
tableName="customer_contact">
|
||||
<column name="id" type="numeric"/>
|
||||
<column name="customer" type="numeric"/>
|
||||
<column name="role" type="string"/>
|
||||
<column name="contact" type="numeric"/>
|
||||
</loadData>
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
@ -11,8 +11,8 @@
|
||||
tableName="membership">
|
||||
<column name="id" type="numeric"/>
|
||||
<column name="customer" type="numeric"/>
|
||||
<column name="since_date" type="date"/>
|
||||
<column name="until_date" type="date"/>
|
||||
<column name="jhi_from" type="date"/>
|
||||
<column name="jhi_to" type="date"/>
|
||||
</loadData>
|
||||
</changeSet>
|
||||
|
||||
|
@ -5,22 +5,15 @@
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
|
||||
|
||||
<include file="config/liquibase/changelog/00000000000000_initial_schema.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/20190403083735_added_entity_Customer.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/20190403083736_added_entity_Contact.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/20190403083737_added_entity_CustomerContact.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/20190403083738_added_entity_Membership.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/20190403083739_added_entity_Share.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/20190403083740_added_entity_Asset.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/20190418143050_added_entity_Customer.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/20190418143051_added_entity_Membership.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/20190418143052_added_entity_Share.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/20190418143053_added_entity_Asset.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/20190418143054_added_entity_SepaMandate.xml" relativeToChangelogFile="false"/>
|
||||
<!-- jhipster-needle-liquibase-add-changelog - JHipster will add liquibase changelogs here -->
|
||||
<include file="config/liquibase/changelog/20190403083737_added_entity_constraints_CustomerContact.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/20190403083738_added_entity_constraints_Membership.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/20190403083739_added_entity_constraints_Share.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/20190403083740_added_entity_constraints_Asset.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/20190418143051_added_entity_constraints_Membership.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/20190418143052_added_entity_constraints_Share.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/20190418143053_added_entity_constraints_Asset.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/20190418143054_added_entity_constraints_SepaMandate.xml" relativeToChangelogFile="false"/>
|
||||
<!-- jhipster-needle-liquibase-add-constraints-changelog - JHipster will add liquibase constraints changelogs here -->
|
||||
|
||||
<include file="config/liquibase/changelog/sample-data-Customer.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/sample-data-Contact.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/sample-data-CustomerContact.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/sample-data-Membership.xml" relativeToChangelogFile="false"/>
|
||||
|
||||
</databaseChangeLog>
|
||||
|
@ -1,6 +0,0 @@
|
||||
id;first_name;last_name;email
|
||||
1;Paule;Müller;paule.mueller@example.com
|
||||
2;Helma;Schmidt;helma.schmidt@example.com
|
||||
3;Vidi;Vitt;vidi.vitt@example.com
|
||||
4;Saskia;Balder;saskia@balder.example.com
|
||||
|
|
@ -1,8 +0,0 @@
|
||||
id;customer_id;jhi_role;contact_id
|
||||
1;1;CONTRACTUAL;1
|
||||
2;1;TECHNICAL;1
|
||||
3;1;FINANCIAL;1
|
||||
4;2;CONTRACTUAL;1
|
||||
5;2;TECHNICAL;2
|
||||
6;2;FINANCIAL;3
|
||||
|
|
@ -1,7 +1,6 @@
|
||||
id;customer_id;since_date;until_date
|
||||
id;customer_id;jhi_from;jhi_to
|
||||
1;1;2001-04-10;2007-12-31
|
||||
2;1;2017-01-15;null
|
||||
3;3;2003-05-15;2019-12-31
|
||||
4;4;2017-05-15;null
|
||||
5;5;2011-08-18;null
|
||||
|
||||
|
|
@ -5,9 +5,13 @@
|
||||
<hr>
|
||||
<jhi-alert-error></jhi-alert-error>
|
||||
<dl class="row-md jh-entity-details">
|
||||
<dt><span jhiTranslate="hsadminNgApp.asset.date">Date</span></dt>
|
||||
<dt><span jhiTranslate="hsadminNgApp.asset.documentDate">Document Date</span></dt>
|
||||
<dd>
|
||||
<span>{{asset.date}}</span>
|
||||
<span>{{asset.documentDate}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.asset.valueDate">Value Date</span></dt>
|
||||
<dd>
|
||||
<span>{{asset.valueDate}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.asset.action">Action</span></dt>
|
||||
<dd>
|
||||
@ -17,14 +21,14 @@
|
||||
<dd>
|
||||
<span>{{asset.amount}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.asset.comment">Comment</span></dt>
|
||||
<dt><span jhiTranslate="hsadminNgApp.asset.remark">Remark</span></dt>
|
||||
<dd>
|
||||
<span>{{asset.comment}}</span>
|
||||
<span>{{asset.remark}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.asset.member">Member</span></dt>
|
||||
<dt><span jhiTranslate="hsadminNgApp.asset.membership">Membership</span></dt>
|
||||
<dd>
|
||||
<div *ngIf="asset.memberId">
|
||||
<a [routerLink]="['/membership', asset.memberId, 'view']">{{asset.memberId}}</a>
|
||||
<div *ngIf="asset.membershipId">
|
||||
<a [routerLink]="['/membership', asset.membershipId, 'view']">{{asset.membershipDocumentDate}}</a>
|
||||
</div>
|
||||
</dd>
|
||||
</dl>
|
||||
|
@ -10,17 +10,33 @@
|
||||
[(ngModel)]="asset.id" readonly />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.asset.date" for="field_date">Date</label>
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.asset.documentDate" for="field_documentDate">Document Date</label>
|
||||
<div class="input-group">
|
||||
<input id="field_date" type="text" class="form-control" name="date" ngbDatepicker #dateDp="ngbDatepicker" [(ngModel)]="asset.date"
|
||||
<input id="field_documentDate" type="text" class="form-control" name="documentDate" ngbDatepicker #documentDateDp="ngbDatepicker" [(ngModel)]="asset.documentDate"
|
||||
required/>
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" (click)="dateDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button>
|
||||
<button type="button" class="btn btn-secondary" (click)="documentDateDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button>
|
||||
</span>
|
||||
</div>
|
||||
<div [hidden]="!(editForm.controls.date?.dirty && editForm.controls.date?.invalid)">
|
||||
<div [hidden]="!(editForm.controls.documentDate?.dirty && editForm.controls.documentDate?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.date?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
[hidden]="!editForm.controls.documentDate?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.asset.valueDate" for="field_valueDate">Value Date</label>
|
||||
<div class="input-group">
|
||||
<input id="field_valueDate" type="text" class="form-control" name="valueDate" ngbDatepicker #valueDateDp="ngbDatepicker" [(ngModel)]="asset.valueDate"
|
||||
required/>
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" (click)="valueDateDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button>
|
||||
</span>
|
||||
</div>
|
||||
<div [hidden]="!(editForm.controls.valueDate?.dirty && editForm.controls.valueDate?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.valueDate?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
</div>
|
||||
@ -58,28 +74,27 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.asset.comment" for="field_comment">Comment</label>
|
||||
<input type="text" class="form-control" name="comment" id="field_comment"
|
||||
[(ngModel)]="asset.comment" maxlength="160"/>
|
||||
<div [hidden]="!(editForm.controls.comment?.dirty && editForm.controls.comment?.invalid)">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.asset.remark" for="field_remark">Remark</label>
|
||||
<input type="text" class="form-control" name="remark" id="field_remark"
|
||||
[(ngModel)]="asset.remark" maxlength="160"/>
|
||||
<div [hidden]="!(editForm.controls.remark?.dirty && editForm.controls.remark?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.comment?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 160 }">
|
||||
[hidden]="!editForm.controls.remark?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 160 }">
|
||||
This field cannot be longer than 160 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.asset.member" for="field_member">Member</label>
|
||||
<select class="form-control" id="field_member" name="member" [(ngModel)]="asset.memberId" required>
|
||||
<option *ngIf="!editForm.value.member" [ngValue]="null" selected></option>
|
||||
<option [ngValue]="membershipOption.id" *ngFor="let membershipOption of memberships; trackBy: trackMembershipById">{{membershipOption.id}}</option>
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.asset.membership" for="field_membership">Membership</label>
|
||||
<select class="form-control" id="field_membership" name="membership" [(ngModel)]="asset.membershipId" required>
|
||||
<option *ngIf="!editForm.value.membership" [ngValue]="null" selected></option>
|
||||
<option [ngValue]="membershipOption.id" *ngFor="let membershipOption of memberships; trackBy: trackMembershipById">{{membershipOption.documentDate}}</option>
|
||||
</select>
|
||||
</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"
|
||||
[hidden]="!editForm.controls.member?.errors?.required"
|
||||
jhiTranslate="entity.validation.required">
|
||||
[hidden]="!editForm.controls.membership?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
</div>
|
||||
|
@ -19,7 +19,8 @@ export class AssetUpdateComponent implements OnInit {
|
||||
isSaving: boolean;
|
||||
|
||||
memberships: IMembership[];
|
||||
dateDp: any;
|
||||
documentDateDp: any;
|
||||
valueDateDp: any;
|
||||
|
||||
constructor(
|
||||
protected jhiAlertService: JhiAlertService,
|
||||
|
@ -15,24 +15,26 @@
|
||||
<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="date"><span jhiTranslate="hsadminNgApp.asset.date">Date</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="documentDate"><span jhiTranslate="hsadminNgApp.asset.documentDate">Document Date</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="valueDate"><span jhiTranslate="hsadminNgApp.asset.valueDate">Value Date</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="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="remark"><span jhiTranslate="hsadminNgApp.asset.remark">Remark</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="membershipDocumentDate"><span jhiTranslate="hsadminNgApp.asset.membership">Membership</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 asset of assets ;trackBy: trackId">
|
||||
<td><a [routerLink]="['/asset', asset.id, 'view' ]">{{asset.id}}</a></td>
|
||||
<td>{{asset.date | date:'mediumDate'}}</td>
|
||||
<td>{{asset.documentDate | date:'mediumDate'}}</td>
|
||||
<td>{{asset.valueDate | date:'mediumDate'}}</td>
|
||||
<td jhiTranslate="{{'hsadminNgApp.AssetAction.' + asset.action}}">{{asset.action}}</td>
|
||||
<td>{{asset.amount}}</td>
|
||||
<td>{{asset.comment}}</td>
|
||||
<td>{{asset.remark}}</td>
|
||||
<td>
|
||||
<div *ngIf="asset.memberId">
|
||||
<a [routerLink]="['../membership', asset.memberId , 'view' ]" >{{asset.memberId}}</a>
|
||||
<div *ngIf="asset.membershipId">
|
||||
<a [routerLink]="['../membership', asset.membershipId , 'view' ]" >{{asset.membershipDocumentDate}}</a>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
|
@ -51,14 +51,16 @@ export class AssetService {
|
||||
|
||||
protected convertDateFromClient(asset: IAsset): IAsset {
|
||||
const copy: IAsset = Object.assign({}, asset, {
|
||||
date: asset.date != null && asset.date.isValid() ? asset.date.format(DATE_FORMAT) : null
|
||||
documentDate: asset.documentDate != null && asset.documentDate.isValid() ? asset.documentDate.format(DATE_FORMAT) : null,
|
||||
valueDate: asset.valueDate != null && asset.valueDate.isValid() ? asset.valueDate.format(DATE_FORMAT) : null
|
||||
});
|
||||
return copy;
|
||||
}
|
||||
|
||||
protected convertDateFromServer(res: EntityResponseType): EntityResponseType {
|
||||
if (res.body) {
|
||||
res.body.date = res.body.date != null ? moment(res.body.date) : null;
|
||||
res.body.documentDate = res.body.documentDate != null ? moment(res.body.documentDate) : null;
|
||||
res.body.valueDate = res.body.valueDate != null ? moment(res.body.valueDate) : null;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@ -66,7 +68,8 @@ export class AssetService {
|
||||
protected convertDateArrayFromServer(res: EntityArrayResponseType): EntityArrayResponseType {
|
||||
if (res.body) {
|
||||
res.body.forEach((asset: IAsset) => {
|
||||
asset.date = asset.date != null ? moment(asset.date) : null;
|
||||
asset.documentDate = asset.documentDate != null ? moment(asset.documentDate) : null;
|
||||
asset.valueDate = asset.valueDate != null ? moment(asset.valueDate) : null;
|
||||
});
|
||||
}
|
||||
return res;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -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> <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> <span jhiTranslate="entity.action.edit"> Edit</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -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();
|
||||
}
|
||||
}
|
@ -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> <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> <span jhiTranslate="entity.action.save">Save</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
@ -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;
|
||||
}
|
||||
}
|
@ -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>
|
@ -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'
|
||||
}
|
||||
];
|
@ -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' });
|
||||
}
|
||||
}
|
@ -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';
|
@ -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()">×</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> <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> <span jhiTranslate="entity.action.delete">Delete</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
@ -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> <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> <span jhiTranslate="entity.action.edit"> Edit</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -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();
|
||||
}
|
||||
}
|
@ -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> <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> <span jhiTranslate="entity.action.save">Save</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
@ -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>
|
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -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'
|
||||
}
|
||||
];
|
@ -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' });
|
||||
}
|
||||
}
|
@ -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';
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user