1
0

Preliminary completed customer model.

This commit is contained in:
Michael Hierweck
2019-04-24 13:08:27 +02:00
parent c6be30895e
commit 2a4ee0507c
178 changed files with 17031 additions and 10 deletions

View File

@ -0,0 +1,175 @@
package org.hostsharing.hsadminng.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import javax.persistence.*;
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.
*/
@Entity
@Table(name = "asset")
public class Asset implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@NotNull
@Column(name = "document_date", nullable = false)
private LocalDate documentDate;
@NotNull
@Column(name = "value_date", nullable = false)
private LocalDate valueDate;
@NotNull
@Enumerated(EnumType.STRING)
@Column(name = "action", nullable = false)
private AssetAction action;
@NotNull
@Column(name = "amount", precision = 10, scale = 2, nullable = false)
private BigDecimal amount;
@Size(max = 160)
@Column(name = "remark", length = 160)
private String remark;
@ManyToOne(optional = false)
@NotNull
@JsonIgnoreProperties("assets")
private Membership membership;
// 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 LocalDate getDocumentDate() {
return documentDate;
}
public Asset documentDate(LocalDate documentDate) {
this.documentDate = documentDate;
return this;
}
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() {
return action;
}
public Asset action(AssetAction action) {
this.action = action;
return this;
}
public void setAction(AssetAction action) {
this.action = action;
}
public BigDecimal getAmount() {
return amount;
}
public Asset amount(BigDecimal amount) {
this.amount = amount;
return this;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public String getRemark() {
return remark;
}
public Asset remark(String remark) {
this.remark = remark;
return this;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Membership getMembership() {
return membership;
}
public Asset membership(Membership membership) {
this.membership = membership;
return this;
}
public void setMembership(Membership membership) {
this.membership = membership;
}
// 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;
}
Asset asset = (Asset) o;
if (asset.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), asset.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "Asset{" +
"id=" + getId() +
", documentDate='" + getDocumentDate() + "'" +
", valueDate='" + getValueDate() + "'" +
", action='" + getAction() + "'" +
", amount=" + getAmount() +
", remark='" + getRemark() + "'" +
"}";
}
}

View File

@ -0,0 +1,400 @@
package org.hostsharing.hsadminng.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.HashSet;
import java.util.Set;
import java.util.Objects;
import org.hostsharing.hsadminng.domain.enumeration.CustomerKind;
import org.hostsharing.hsadminng.domain.enumeration.VatRegion;
/**
* A Customer.
*/
@Entity
@Table(name = "customer")
public class Customer implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@NotNull
@Min(value = 10000)
@Max(value = 99999)
@Column(name = "reference", nullable = false, unique = true)
private Integer reference;
@NotNull
@Size(max = 3)
@Pattern(regexp = "[a-z][a-z0-9]+")
@Column(name = "prefix", length = 3, nullable = false, unique = true)
private String prefix;
@NotNull
@Size(max = 80)
@Column(name = "name", length = 80, nullable = false)
private String name;
@NotNull
@Enumerated(EnumType.STRING)
@Column(name = "kind", nullable = false)
private CustomerKind kind;
@Column(name = "birth_date")
private LocalDate birthDate;
@Size(max = 80)
@Column(name = "birth_place", length = 80)
private String birthPlace;
@Size(max = 80)
@Column(name = "registration_court", length = 80)
private String registrationCourt;
@Size(max = 80)
@Column(name = "registration_number", length = 80)
private String registrationNumber;
@NotNull
@Enumerated(EnumType.STRING)
@Column(name = "vat_region", nullable = false)
private VatRegion vatRegion;
@Size(max = 40)
@Column(name = "vat_number", length = 40)
private String vatNumber;
@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 = "billing_salutation", length = 80)
private String billingSalutation;
@Size(max = 400)
@Column(name = "billing_address", length = 400)
private String billingAddress;
@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;
}
public void setId(Long id) {
this.id = id;
}
public Integer getReference() {
return reference;
}
public Customer reference(Integer reference) {
this.reference = reference;
return this;
}
public void setReference(Integer reference) {
this.reference = reference;
}
public String getPrefix() {
return prefix;
}
public Customer prefix(String prefix) {
this.prefix = prefix;
return this;
}
public void setPrefix(String prefix) {
this.prefix = prefix;
}
public String getName() {
return name;
}
public Customer name(String name) {
this.name = name;
return this;
}
public void setName(String name) {
this.name = name;
}
public CustomerKind getKind() {
return kind;
}
public Customer kind(CustomerKind kind) {
this.kind = kind;
return this;
}
public void setKind(CustomerKind kind) {
this.kind = kind;
}
public LocalDate getBirthDate() {
return birthDate;
}
public Customer birthDate(LocalDate birthDate) {
this.birthDate = birthDate;
return this;
}
public void setBirthDate(LocalDate birthDate) {
this.birthDate = birthDate;
}
public String getBirthPlace() {
return birthPlace;
}
public Customer birthPlace(String birthPlace) {
this.birthPlace = birthPlace;
return this;
}
public void setBirthPlace(String birthPlace) {
this.birthPlace = birthPlace;
}
public String getRegistrationCourt() {
return registrationCourt;
}
public Customer registrationCourt(String registrationCourt) {
this.registrationCourt = registrationCourt;
return this;
}
public void setRegistrationCourt(String registrationCourt) {
this.registrationCourt = registrationCourt;
}
public String getRegistrationNumber() {
return registrationNumber;
}
public Customer registrationNumber(String registrationNumber) {
this.registrationNumber = registrationNumber;
return this;
}
public void setRegistrationNumber(String registrationNumber) {
this.registrationNumber = registrationNumber;
}
public VatRegion getVatRegion() {
return vatRegion;
}
public Customer vatRegion(VatRegion vatRegion) {
this.vatRegion = vatRegion;
return this;
}
public void setVatRegion(VatRegion vatRegion) {
this.vatRegion = vatRegion;
}
public String getVatNumber() {
return vatNumber;
}
public Customer vatNumber(String vatNumber) {
this.vatNumber = vatNumber;
return this;
}
public void setVatNumber(String vatNumber) {
this.vatNumber = vatNumber;
}
public String getContractualSalutation() {
return contractualSalutation;
}
public Customer contractualSalutation(String contractualSalutation) {
this.contractualSalutation = contractualSalutation;
return this;
}
public void setContractualSalutation(String contractualSalutation) {
this.contractualSalutation = contractualSalutation;
}
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 getBillingSalutation() {
return billingSalutation;
}
public Customer billingSalutation(String billingSalutation) {
this.billingSalutation = billingSalutation;
return this;
}
public void setBillingSalutation(String billingSalutation) {
this.billingSalutation = billingSalutation;
}
public String getBillingAddress() {
return billingAddress;
}
public Customer billingAddress(String billingAddress) {
this.billingAddress = billingAddress;
return 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 void setRemark(String remark) {
this.remark = remark;
}
public Set<Membership> getMemberships() {
return memberships;
}
public Customer memberships(Set<Membership> memberships) {
this.memberships = memberships;
return this;
}
public Customer addMembership(Membership membership) {
this.memberships.add(membership);
membership.setCustomer(this);
return this;
}
public Customer removeMembership(Membership membership) {
this.memberships.remove(membership);
membership.setCustomer(null);
return this;
}
public void setMemberships(Set<Membership> memberships) {
this.memberships = memberships;
}
public Set<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
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Customer customer = (Customer) o;
if (customer.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), customer.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "Customer{" +
"id=" + getId() +
", reference=" + getReference() +
", prefix='" + getPrefix() + "'" +
", name='" + getName() + "'" +
", kind='" + getKind() + "'" +
", birthDate='" + getBirthDate() + "'" +
", birthPlace='" + getBirthPlace() + "'" +
", registrationCourt='" + getRegistrationCourt() + "'" +
", registrationNumber='" + getRegistrationNumber() + "'" +
", vatRegion='" + getVatRegion() + "'" +
", vatNumber='" + getVatNumber() + "'" +
", contractualSalutation='" + getContractualSalutation() + "'" +
", contractualAddress='" + getContractualAddress() + "'" +
", billingSalutation='" + getBillingSalutation() + "'" +
", billingAddress='" + getBillingAddress() + "'" +
", remark='" + getRemark() + "'" +
"}";
}
}

View File

@ -0,0 +1,226 @@
package org.hostsharing.hsadminng.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.HashSet;
import java.util.Set;
import java.util.Objects;
/**
* A Membership.
*/
@Entity
@Table(name = "membership")
public class Membership implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@NotNull
@Column(name = "admission_document_date", nullable = false)
private LocalDate admissionDocumentDate;
@Column(name = "cancellation_document_date")
private LocalDate cancellationDocumentDate;
@NotNull
@Column(name = "member_from_date", nullable = false)
private LocalDate memberFromDate;
@Column(name = "member_until_date")
private LocalDate memberUntilDate;
@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;
// 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 LocalDate getAdmissionDocumentDate() {
return admissionDocumentDate;
}
public Membership admissionDocumentDate(LocalDate admissionDocumentDate) {
this.admissionDocumentDate = admissionDocumentDate;
return this;
}
public void setAdmissionDocumentDate(LocalDate admissionDocumentDate) {
this.admissionDocumentDate = admissionDocumentDate;
}
public LocalDate getCancellationDocumentDate() {
return cancellationDocumentDate;
}
public Membership cancellationDocumentDate(LocalDate cancellationDocumentDate) {
this.cancellationDocumentDate = cancellationDocumentDate;
return this;
}
public void setCancellationDocumentDate(LocalDate cancellationDocumentDate) {
this.cancellationDocumentDate = cancellationDocumentDate;
}
public LocalDate getMemberFromDate() {
return memberFromDate;
}
public Membership memberFromDate(LocalDate memberFromDate) {
this.memberFromDate = memberFromDate;
return this;
}
public void setMemberFromDate(LocalDate memberFromDate) {
this.memberFromDate = memberFromDate;
}
public LocalDate getMemberUntilDate() {
return memberUntilDate;
}
public Membership memberUntilDate(LocalDate memberUntilDate) {
this.memberUntilDate = memberUntilDate;
return this;
}
public void setMemberUntilDate(LocalDate memberUntilDate) {
this.memberUntilDate = memberUntilDate;
}
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() {
return shares;
}
public Membership shares(Set<Share> shares) {
this.shares = shares;
return this;
}
public Membership addShare(Share share) {
this.shares.add(share);
share.setMembership(this);
return this;
}
public Membership removeShare(Share share) {
this.shares.remove(share);
share.setMembership(null);
return this;
}
public void setShares(Set<Share> shares) {
this.shares = shares;
}
public Set<Asset> getAssets() {
return assets;
}
public Membership assets(Set<Asset> assets) {
this.assets = assets;
return this;
}
public Membership addAsset(Asset asset) {
this.assets.add(asset);
asset.setMembership(this);
return this;
}
public Membership removeAsset(Asset asset) {
this.assets.remove(asset);
asset.setMembership(null);
return this;
}
public void setAssets(Set<Asset> assets) {
this.assets = assets;
}
public Customer getCustomer() {
return customer;
}
public Membership 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;
}
Membership membership = (Membership) o;
if (membership.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), membership.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "Membership{" +
"id=" + getId() +
", admissionDocumentDate='" + getAdmissionDocumentDate() + "'" +
", cancellationDocumentDate='" + getCancellationDocumentDate() + "'" +
", memberFromDate='" + getMemberFromDate() + "'" +
", memberUntilDate='" + getMemberUntilDate() + "'" +
", remark='" + getRemark() + "'" +
"}";
}
}

View File

@ -0,0 +1,241 @@
package org.hostsharing.hsadminng.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
/**
* A SepaMandate.
*/
@Entity
@Table(name = "sepa_mandate")
public class SepaMandate implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@NotNull
@Size(max = 40)
@Column(name = "reference", length = 40, nullable = false, unique = true)
private String reference;
@Size(max = 34)
@Column(name = "iban", length = 34)
private String iban;
@Size(max = 11)
@Column(name = "bic", length = 11)
private String bic;
@NotNull
@Column(name = "granting_document_date", nullable = false)
private LocalDate grantingDocumentDate;
@Column(name = "revokation_document_date")
private LocalDate revokationDocumentDate;
@NotNull
@Column(name = "valid_from_date", nullable = false)
private LocalDate validFromDate;
@Column(name = "valid_until_date")
private LocalDate validUntilDate;
@Column(name = "last_used_date")
private LocalDate lastUsedDate;
@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 getGrantingDocumentDate() {
return grantingDocumentDate;
}
public SepaMandate grantingDocumentDate(LocalDate grantingDocumentDate) {
this.grantingDocumentDate = grantingDocumentDate;
return this;
}
public void setGrantingDocumentDate(LocalDate grantingDocumentDate) {
this.grantingDocumentDate = grantingDocumentDate;
}
public LocalDate getRevokationDocumentDate() {
return revokationDocumentDate;
}
public SepaMandate revokationDocumentDate(LocalDate revokationDocumentDate) {
this.revokationDocumentDate = revokationDocumentDate;
return this;
}
public void setRevokationDocumentDate(LocalDate revokationDocumentDate) {
this.revokationDocumentDate = revokationDocumentDate;
}
public LocalDate getValidFromDate() {
return validFromDate;
}
public SepaMandate validFromDate(LocalDate validFromDate) {
this.validFromDate = validFromDate;
return this;
}
public void setValidFromDate(LocalDate validFromDate) {
this.validFromDate = validFromDate;
}
public LocalDate getValidUntilDate() {
return validUntilDate;
}
public SepaMandate validUntilDate(LocalDate validUntilDate) {
this.validUntilDate = validUntilDate;
return this;
}
public void setValidUntilDate(LocalDate validUntilDate) {
this.validUntilDate = validUntilDate;
}
public LocalDate getLastUsedDate() {
return lastUsedDate;
}
public SepaMandate lastUsedDate(LocalDate lastUsedDate) {
this.lastUsedDate = lastUsedDate;
return this;
}
public void setLastUsedDate(LocalDate lastUsedDate) {
this.lastUsedDate = lastUsedDate;
}
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() + "'" +
", grantingDocumentDate='" + getGrantingDocumentDate() + "'" +
", revokationDocumentDate='" + getRevokationDocumentDate() + "'" +
", validFromDate='" + getValidFromDate() + "'" +
", validUntilDate='" + getValidUntilDate() + "'" +
", lastUsedDate='" + getLastUsedDate() + "'" +
", remark='" + getRemark() + "'" +
"}";
}
}

View File

@ -0,0 +1,174 @@
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;
import org.hostsharing.hsadminng.domain.enumeration.ShareAction;
/**
* A Share.
*/
@Entity
@Table(name = "share")
public class Share implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@NotNull
@Column(name = "document_date", nullable = false)
private LocalDate documentDate;
@NotNull
@Column(name = "value_date", nullable = false)
private LocalDate valueDate;
@NotNull
@Enumerated(EnumType.STRING)
@Column(name = "action", nullable = false)
private ShareAction action;
@NotNull
@Column(name = "quantity", nullable = false)
private Integer quantity;
@Size(max = 160)
@Column(name = "remark", length = 160)
private String remark;
@ManyToOne(optional = false)
@NotNull
@JsonIgnoreProperties("shares")
private Membership membership;
// 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 LocalDate getDocumentDate() {
return documentDate;
}
public Share documentDate(LocalDate documentDate) {
this.documentDate = documentDate;
return this;
}
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() {
return action;
}
public Share action(ShareAction action) {
this.action = action;
return this;
}
public void setAction(ShareAction action) {
this.action = action;
}
public Integer getQuantity() {
return quantity;
}
public Share quantity(Integer quantity) {
this.quantity = quantity;
return this;
}
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
public String getRemark() {
return remark;
}
public Share remark(String remark) {
this.remark = remark;
return this;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Membership getMembership() {
return membership;
}
public Share membership(Membership membership) {
this.membership = membership;
return this;
}
public void setMembership(Membership membership) {
this.membership = membership;
}
// 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;
}
Share share = (Share) o;
if (share.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), share.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "Share{" +
"id=" + getId() +
", documentDate='" + getDocumentDate() + "'" +
", valueDate='" + getValueDate() + "'" +
", action='" + getAction() + "'" +
", quantity=" + getQuantity() +
", remark='" + getRemark() + "'" +
"}";
}
}

View File

@ -0,0 +1,8 @@
package org.hostsharing.hsadminng.domain.enumeration;
/**
* The AssetAction enumeration.
*/
public enum AssetAction {
PAYMENT, HANDOVER, ADOPTION, LOSS, CLEARING, PAYBACK
}

View File

@ -0,0 +1,8 @@
package org.hostsharing.hsadminng.domain.enumeration;
/**
* The CustomerKind enumeration.
*/
public enum CustomerKind {
NATURAL, LEGAL
}

View File

@ -0,0 +1,8 @@
package org.hostsharing.hsadminng.domain.enumeration;
/**
* The ShareAction enumeration.
*/
public enum ShareAction {
SUBSCRIPTION, CANCELLATION
}

View File

@ -0,0 +1,8 @@
package org.hostsharing.hsadminng.domain.enumeration;
/**
* The VatRegion enumeration.
*/
public enum VatRegion {
DOMESTIC, EU, OTHER
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,114 @@
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.Asset;
import org.hostsharing.hsadminng.domain.*; // for static metamodels
import org.hostsharing.hsadminng.repository.AssetRepository;
import org.hostsharing.hsadminng.service.dto.AssetCriteria;
import org.hostsharing.hsadminng.service.dto.AssetDTO;
import org.hostsharing.hsadminng.service.mapper.AssetMapper;
/**
* Service for executing complex queries for Asset entities in the database.
* The main input is a {@link AssetCriteria} which gets converted to {@link Specification},
* in a way that all the filters must apply.
* It returns a {@link List} of {@link AssetDTO} or a {@link Page} of {@link AssetDTO} which fulfills the criteria.
*/
@Service
@Transactional(readOnly = true)
public class AssetQueryService extends QueryService<Asset> {
private final Logger log = LoggerFactory.getLogger(AssetQueryService.class);
private final AssetRepository assetRepository;
private final AssetMapper assetMapper;
public AssetQueryService(AssetRepository assetRepository, AssetMapper assetMapper) {
this.assetRepository = assetRepository;
this.assetMapper = assetMapper;
}
/**
* Return a {@link List} of {@link AssetDTO} 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<AssetDTO> findByCriteria(AssetCriteria criteria) {
log.debug("find by criteria : {}", criteria);
final Specification<Asset> specification = createSpecification(criteria);
return assetMapper.toDto(assetRepository.findAll(specification));
}
/**
* Return a {@link Page} of {@link AssetDTO} 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<AssetDTO> findByCriteria(AssetCriteria criteria, Pageable page) {
log.debug("find by criteria : {}, page: {}", criteria, page);
final Specification<Asset> specification = createSpecification(criteria);
return assetRepository.findAll(specification, page)
.map(assetMapper::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(AssetCriteria criteria) {
log.debug("count by criteria : {}", criteria);
final Specification<Asset> specification = createSpecification(criteria);
return assetRepository.count(specification);
}
/**
* Function to convert AssetCriteria to a {@link Specification}
*/
private Specification<Asset> createSpecification(AssetCriteria criteria) {
Specification<Asset> specification = Specification.where(null);
if (criteria != null) {
if (criteria.getId() != null) {
specification = specification.and(buildSpecification(criteria.getId(), Asset_.id));
}
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));
}
if (criteria.getAmount() != null) {
specification = specification.and(buildRangeSpecification(criteria.getAmount(), Asset_.amount));
}
if (criteria.getRemark() != null) {
specification = specification.and(buildStringSpecification(criteria.getRemark(), Asset_.remark));
}
if (criteria.getMembershipId() != null) {
specification = specification.and(buildSpecification(criteria.getMembershipId(),
root -> root.join(Asset_.membership, JoinType.LEFT).get(Membership_.id)));
}
}
return specification;
}
}

View File

@ -0,0 +1,84 @@
package org.hostsharing.hsadminng.service;
import org.hostsharing.hsadminng.domain.Asset;
import org.hostsharing.hsadminng.repository.AssetRepository;
import org.hostsharing.hsadminng.service.dto.AssetDTO;
import org.hostsharing.hsadminng.service.mapper.AssetMapper;
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 Asset.
*/
@Service
@Transactional
public class AssetService {
private final Logger log = LoggerFactory.getLogger(AssetService.class);
private final AssetRepository assetRepository;
private final AssetMapper assetMapper;
public AssetService(AssetRepository assetRepository, AssetMapper assetMapper) {
this.assetRepository = assetRepository;
this.assetMapper = assetMapper;
}
/**
* Save a asset.
*
* @param assetDTO the entity to save
* @return the persisted entity
*/
public AssetDTO save(AssetDTO assetDTO) {
log.debug("Request to save Asset : {}", assetDTO);
Asset asset = assetMapper.toEntity(assetDTO);
asset = assetRepository.save(asset);
return assetMapper.toDto(asset);
}
/**
* Get all the assets.
*
* @param pageable the pagination information
* @return the list of entities
*/
@Transactional(readOnly = true)
public Page<AssetDTO> findAll(Pageable pageable) {
log.debug("Request to get all Assets");
return assetRepository.findAll(pageable)
.map(assetMapper::toDto);
}
/**
* Get one asset by id.
*
* @param id the id of the entity
* @return the entity
*/
@Transactional(readOnly = true)
public Optional<AssetDTO> findOne(Long id) {
log.debug("Request to get Asset : {}", id);
return assetRepository.findById(id)
.map(assetMapper::toDto);
}
/**
* Delete the asset by id.
*
* @param id the id of the entity
*/
public void delete(Long id) {
log.debug("Request to delete Asset : {}", id);
assetRepository.deleteById(id);
}
}

View File

@ -0,0 +1,148 @@
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.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.
* The main input is a {@link CustomerCriteria} which gets converted to {@link Specification},
* in a way that all the filters must apply.
* It returns a {@link List} of {@link CustomerDTO} or a {@link Page} of {@link CustomerDTO} which fulfills the criteria.
*/
@Service
@Transactional(readOnly = true)
public class CustomerQueryService extends QueryService<Customer> {
private final Logger log = LoggerFactory.getLogger(CustomerQueryService.class);
private final CustomerRepository customerRepository;
private final CustomerMapper customerMapper;
public CustomerQueryService(CustomerRepository customerRepository, CustomerMapper customerMapper) {
this.customerRepository = customerRepository;
this.customerMapper = customerMapper;
}
/**
* Return a {@link List} of {@link CustomerDTO} 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<CustomerDTO> findByCriteria(CustomerCriteria criteria) {
log.debug("find by criteria : {}", criteria);
final Specification<Customer> specification = createSpecification(criteria);
return customerMapper.toDto(customerRepository.findAll(specification));
}
/**
* Return a {@link Page} of {@link CustomerDTO} 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<CustomerDTO> findByCriteria(CustomerCriteria criteria, Pageable page) {
log.debug("find by criteria : {}, page: {}", criteria, page);
final Specification<Customer> specification = createSpecification(criteria);
return customerRepository.findAll(specification, page)
.map(customerMapper::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(CustomerCriteria criteria) {
log.debug("count by criteria : {}", criteria);
final Specification<Customer> specification = createSpecification(criteria);
return customerRepository.count(specification);
}
/**
* Function to convert CustomerCriteria to a {@link Specification}
*/
private Specification<Customer> createSpecification(CustomerCriteria criteria) {
Specification<Customer> specification = Specification.where(null);
if (criteria != null) {
if (criteria.getId() != null) {
specification = specification.and(buildSpecification(criteria.getId(), Customer_.id));
}
if (criteria.getReference() != null) {
specification = specification.and(buildRangeSpecification(criteria.getReference(), Customer_.reference));
}
if (criteria.getPrefix() != null) {
specification = specification.and(buildStringSpecification(criteria.getPrefix(), Customer_.prefix));
}
if (criteria.getName() != null) {
specification = specification.and(buildStringSpecification(criteria.getName(), Customer_.name));
}
if (criteria.getKind() != null) {
specification = specification.and(buildSpecification(criteria.getKind(), Customer_.kind));
}
if (criteria.getBirthDate() != null) {
specification = specification.and(buildRangeSpecification(criteria.getBirthDate(), Customer_.birthDate));
}
if (criteria.getBirthPlace() != null) {
specification = specification.and(buildStringSpecification(criteria.getBirthPlace(), Customer_.birthPlace));
}
if (criteria.getRegistrationCourt() != null) {
specification = specification.and(buildStringSpecification(criteria.getRegistrationCourt(), Customer_.registrationCourt));
}
if (criteria.getRegistrationNumber() != null) {
specification = specification.and(buildStringSpecification(criteria.getRegistrationNumber(), Customer_.registrationNumber));
}
if (criteria.getVatRegion() != null) {
specification = specification.and(buildSpecification(criteria.getVatRegion(), Customer_.vatRegion));
}
if (criteria.getVatNumber() != null) {
specification = specification.and(buildStringSpecification(criteria.getVatNumber(), Customer_.vatNumber));
}
if (criteria.getContractualSalutation() != null) {
specification = specification.and(buildStringSpecification(criteria.getContractualSalutation(), Customer_.contractualSalutation));
}
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.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;
}
}

View File

@ -0,0 +1,84 @@
package org.hostsharing.hsadminng.service;
import org.hostsharing.hsadminng.domain.Customer;
import org.hostsharing.hsadminng.repository.CustomerRepository;
import org.hostsharing.hsadminng.service.dto.CustomerDTO;
import org.hostsharing.hsadminng.service.mapper.CustomerMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
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 Customer.
*/
@Service
@Transactional
public class CustomerService {
private final Logger log = LoggerFactory.getLogger(CustomerService.class);
private final CustomerRepository customerRepository;
private final CustomerMapper customerMapper;
public CustomerService(CustomerRepository customerRepository, CustomerMapper customerMapper) {
this.customerRepository = customerRepository;
this.customerMapper = customerMapper;
}
/**
* Save a customer.
*
* @param customerDTO the entity to save
* @return the persisted entity
*/
public CustomerDTO save(CustomerDTO customerDTO) {
log.debug("Request to save Customer : {}", customerDTO);
Customer customer = customerMapper.toEntity(customerDTO);
customer = customerRepository.save(customer);
return customerMapper.toDto(customer);
}
/**
* Get all the customers.
*
* @param pageable the pagination information
* @return the list of entities
*/
@Transactional(readOnly = true)
public Page<CustomerDTO> findAll(Pageable pageable) {
log.debug("Request to get all Customers");
return customerRepository.findAll(pageable)
.map(customerMapper::toDto);
}
/**
* Get one customer by id.
*
* @param id the id of the entity
* @return the entity
*/
@Transactional(readOnly = true)
public Optional<CustomerDTO> findOne(Long id) {
log.debug("Request to get Customer : {}", id);
return customerRepository.findById(id)
.map(customerMapper::toDto);
}
/**
* Delete the customer by id.
*
* @param id the id of the entity
*/
public void delete(Long id) {
log.debug("Request to delete Customer : {}", id);
customerRepository.deleteById(id);
}
}

View File

@ -0,0 +1,122 @@
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.Membership;
import org.hostsharing.hsadminng.domain.*; // for static metamodels
import org.hostsharing.hsadminng.repository.MembershipRepository;
import org.hostsharing.hsadminng.service.dto.MembershipCriteria;
import org.hostsharing.hsadminng.service.dto.MembershipDTO;
import org.hostsharing.hsadminng.service.mapper.MembershipMapper;
/**
* Service for executing complex queries for Membership entities in the database.
* The main input is a {@link MembershipCriteria} which gets converted to {@link Specification},
* in a way that all the filters must apply.
* It returns a {@link List} of {@link MembershipDTO} or a {@link Page} of {@link MembershipDTO} which fulfills the criteria.
*/
@Service
@Transactional(readOnly = true)
public class MembershipQueryService extends QueryService<Membership> {
private final Logger log = LoggerFactory.getLogger(MembershipQueryService.class);
private final MembershipRepository membershipRepository;
private final MembershipMapper membershipMapper;
public MembershipQueryService(MembershipRepository membershipRepository, MembershipMapper membershipMapper) {
this.membershipRepository = membershipRepository;
this.membershipMapper = membershipMapper;
}
/**
* Return a {@link List} of {@link MembershipDTO} 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<MembershipDTO> findByCriteria(MembershipCriteria criteria) {
log.debug("find by criteria : {}", criteria);
final Specification<Membership> specification = createSpecification(criteria);
return membershipMapper.toDto(membershipRepository.findAll(specification));
}
/**
* Return a {@link Page} of {@link MembershipDTO} 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<MembershipDTO> findByCriteria(MembershipCriteria criteria, Pageable page) {
log.debug("find by criteria : {}, page: {}", criteria, page);
final Specification<Membership> specification = createSpecification(criteria);
return membershipRepository.findAll(specification, page)
.map(membershipMapper::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(MembershipCriteria criteria) {
log.debug("count by criteria : {}", criteria);
final Specification<Membership> specification = createSpecification(criteria);
return membershipRepository.count(specification);
}
/**
* Function to convert MembershipCriteria to a {@link Specification}
*/
private Specification<Membership> createSpecification(MembershipCriteria criteria) {
Specification<Membership> specification = Specification.where(null);
if (criteria != null) {
if (criteria.getId() != null) {
specification = specification.and(buildSpecification(criteria.getId(), Membership_.id));
}
if (criteria.getAdmissionDocumentDate() != null) {
specification = specification.and(buildRangeSpecification(criteria.getAdmissionDocumentDate(), Membership_.admissionDocumentDate));
}
if (criteria.getCancellationDocumentDate() != null) {
specification = specification.and(buildRangeSpecification(criteria.getCancellationDocumentDate(), Membership_.cancellationDocumentDate));
}
if (criteria.getMemberFromDate() != null) {
specification = specification.and(buildRangeSpecification(criteria.getMemberFromDate(), Membership_.memberFromDate));
}
if (criteria.getMemberUntilDate() != null) {
specification = specification.and(buildRangeSpecification(criteria.getMemberUntilDate(), Membership_.memberUntilDate));
}
if (criteria.getRemark() != null) {
specification = specification.and(buildStringSpecification(criteria.getRemark(), Membership_.remark));
}
if (criteria.getShareId() != null) {
specification = specification.and(buildSpecification(criteria.getShareId(),
root -> root.join(Membership_.shares, JoinType.LEFT).get(Share_.id)));
}
if (criteria.getAssetId() != null) {
specification = specification.and(buildSpecification(criteria.getAssetId(),
root -> root.join(Membership_.assets, JoinType.LEFT).get(Asset_.id)));
}
if (criteria.getCustomerId() != null) {
specification = specification.and(buildSpecification(criteria.getCustomerId(),
root -> root.join(Membership_.customer, JoinType.LEFT).get(Customer_.id)));
}
}
return specification;
}
}

View File

@ -0,0 +1,84 @@
package org.hostsharing.hsadminng.service;
import org.hostsharing.hsadminng.domain.Membership;
import org.hostsharing.hsadminng.repository.MembershipRepository;
import org.hostsharing.hsadminng.service.dto.MembershipDTO;
import org.hostsharing.hsadminng.service.mapper.MembershipMapper;
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 Membership.
*/
@Service
@Transactional
public class MembershipService {
private final Logger log = LoggerFactory.getLogger(MembershipService.class);
private final MembershipRepository membershipRepository;
private final MembershipMapper membershipMapper;
public MembershipService(MembershipRepository membershipRepository, MembershipMapper membershipMapper) {
this.membershipRepository = membershipRepository;
this.membershipMapper = membershipMapper;
}
/**
* Save a membership.
*
* @param membershipDTO the entity to save
* @return the persisted entity
*/
public MembershipDTO save(MembershipDTO membershipDTO) {
log.debug("Request to save Membership : {}", membershipDTO);
Membership membership = membershipMapper.toEntity(membershipDTO);
membership = membershipRepository.save(membership);
return membershipMapper.toDto(membership);
}
/**
* Get all the memberships.
*
* @param pageable the pagination information
* @return the list of entities
*/
@Transactional(readOnly = true)
public Page<MembershipDTO> findAll(Pageable pageable) {
log.debug("Request to get all Memberships");
return membershipRepository.findAll(pageable)
.map(membershipMapper::toDto);
}
/**
* Get one membership by id.
*
* @param id the id of the entity
* @return the entity
*/
@Transactional(readOnly = true)
public Optional<MembershipDTO> findOne(Long id) {
log.debug("Request to get Membership : {}", id);
return membershipRepository.findById(id)
.map(membershipMapper::toDto);
}
/**
* Delete the membership by id.
*
* @param id the id of the entity
*/
public void delete(Long id) {
log.debug("Request to delete Membership : {}", id);
membershipRepository.deleteById(id);
}
}

View File

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

View File

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

View File

@ -0,0 +1,114 @@
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.Share;
import org.hostsharing.hsadminng.domain.*; // for static metamodels
import org.hostsharing.hsadminng.repository.ShareRepository;
import org.hostsharing.hsadminng.service.dto.ShareCriteria;
import org.hostsharing.hsadminng.service.dto.ShareDTO;
import org.hostsharing.hsadminng.service.mapper.ShareMapper;
/**
* Service for executing complex queries for Share entities in the database.
* The main input is a {@link ShareCriteria} which gets converted to {@link Specification},
* in a way that all the filters must apply.
* It returns a {@link List} of {@link ShareDTO} or a {@link Page} of {@link ShareDTO} which fulfills the criteria.
*/
@Service
@Transactional(readOnly = true)
public class ShareQueryService extends QueryService<Share> {
private final Logger log = LoggerFactory.getLogger(ShareQueryService.class);
private final ShareRepository shareRepository;
private final ShareMapper shareMapper;
public ShareQueryService(ShareRepository shareRepository, ShareMapper shareMapper) {
this.shareRepository = shareRepository;
this.shareMapper = shareMapper;
}
/**
* Return a {@link List} of {@link ShareDTO} 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<ShareDTO> findByCriteria(ShareCriteria criteria) {
log.debug("find by criteria : {}", criteria);
final Specification<Share> specification = createSpecification(criteria);
return shareMapper.toDto(shareRepository.findAll(specification));
}
/**
* Return a {@link Page} of {@link ShareDTO} 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<ShareDTO> findByCriteria(ShareCriteria criteria, Pageable page) {
log.debug("find by criteria : {}, page: {}", criteria, page);
final Specification<Share> specification = createSpecification(criteria);
return shareRepository.findAll(specification, page)
.map(shareMapper::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(ShareCriteria criteria) {
log.debug("count by criteria : {}", criteria);
final Specification<Share> specification = createSpecification(criteria);
return shareRepository.count(specification);
}
/**
* Function to convert ShareCriteria to a {@link Specification}
*/
private Specification<Share> createSpecification(ShareCriteria criteria) {
Specification<Share> specification = Specification.where(null);
if (criteria != null) {
if (criteria.getId() != null) {
specification = specification.and(buildSpecification(criteria.getId(), Share_.id));
}
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));
}
if (criteria.getQuantity() != null) {
specification = specification.and(buildRangeSpecification(criteria.getQuantity(), Share_.quantity));
}
if (criteria.getRemark() != null) {
specification = specification.and(buildStringSpecification(criteria.getRemark(), Share_.remark));
}
if (criteria.getMembershipId() != null) {
specification = specification.and(buildSpecification(criteria.getMembershipId(),
root -> root.join(Share_.membership, JoinType.LEFT).get(Membership_.id)));
}
}
return specification;
}
}

View File

@ -0,0 +1,84 @@
package org.hostsharing.hsadminng.service;
import org.hostsharing.hsadminng.domain.Share;
import org.hostsharing.hsadminng.repository.ShareRepository;
import org.hostsharing.hsadminng.service.dto.ShareDTO;
import org.hostsharing.hsadminng.service.mapper.ShareMapper;
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 Share.
*/
@Service
@Transactional
public class ShareService {
private final Logger log = LoggerFactory.getLogger(ShareService.class);
private final ShareRepository shareRepository;
private final ShareMapper shareMapper;
public ShareService(ShareRepository shareRepository, ShareMapper shareMapper) {
this.shareRepository = shareRepository;
this.shareMapper = shareMapper;
}
/**
* Save a share.
*
* @param shareDTO the entity to save
* @return the persisted entity
*/
public ShareDTO save(ShareDTO shareDTO) {
log.debug("Request to save Share : {}", shareDTO);
Share share = shareMapper.toEntity(shareDTO);
share = shareRepository.save(share);
return shareMapper.toDto(share);
}
/**
* Get all the shares.
*
* @param pageable the pagination information
* @return the list of entities
*/
@Transactional(readOnly = true)
public Page<ShareDTO> findAll(Pageable pageable) {
log.debug("Request to get all Shares");
return shareRepository.findAll(pageable)
.map(shareMapper::toDto);
}
/**
* Get one share by id.
*
* @param id the id of the entity
* @return the entity
*/
@Transactional(readOnly = true)
public Optional<ShareDTO> findOne(Long id) {
log.debug("Request to get Share : {}", id);
return shareRepository.findById(id)
.map(shareMapper::toDto);
}
/**
* Delete the share by id.
*
* @param id the id of the entity
*/
public void delete(Long id) {
log.debug("Request to delete Share : {}", id);
shareRepository.deleteById(id);
}
}

View File

@ -0,0 +1,149 @@
package org.hostsharing.hsadminng.service.dto;
import java.io.Serializable;
import java.util.Objects;
import org.hostsharing.hsadminng.domain.enumeration.AssetAction;
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.BigDecimalFilter;
import io.github.jhipster.service.filter.LocalDateFilter;
/**
* Criteria class for the Asset entity. This class is used in AssetResource to
* receive all the possible filtering options from the Http GET request parameters.
* For example the following could be a valid requests:
* <code> /assets?id.greaterThan=5&amp;attr1.contains=something&amp;attr2.specified=false</code>
* As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use
* fix type specific filters.
*/
public class AssetCriteria implements Serializable {
/**
* Class for filtering AssetAction
*/
public static class AssetActionFilter extends Filter<AssetAction> {
}
private static final long serialVersionUID = 1L;
private LongFilter id;
private LocalDateFilter documentDate;
private LocalDateFilter valueDate;
private AssetActionFilter action;
private BigDecimalFilter amount;
private StringFilter remark;
private LongFilter membershipId;
public LongFilter getId() {
return id;
}
public void setId(LongFilter id) {
this.id = id;
}
public LocalDateFilter getDocumentDate() {
return documentDate;
}
public void setDocumentDate(LocalDateFilter documentDate) {
this.documentDate = documentDate;
}
public LocalDateFilter getValueDate() {
return valueDate;
}
public void setValueDate(LocalDateFilter valueDate) {
this.valueDate = valueDate;
}
public AssetActionFilter getAction() {
return action;
}
public void setAction(AssetActionFilter action) {
this.action = action;
}
public BigDecimalFilter getAmount() {
return amount;
}
public void setAmount(BigDecimalFilter amount) {
this.amount = amount;
}
public StringFilter getRemark() {
return remark;
}
public void setRemark(StringFilter remark) {
this.remark = remark;
}
public LongFilter getMembershipId() {
return membershipId;
}
public void setMembershipId(LongFilter membershipId) {
this.membershipId = membershipId;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final AssetCriteria that = (AssetCriteria) o;
return
Objects.equals(id, that.id) &&
Objects.equals(documentDate, that.documentDate) &&
Objects.equals(valueDate, that.valueDate) &&
Objects.equals(action, that.action) &&
Objects.equals(amount, that.amount) &&
Objects.equals(remark, that.remark) &&
Objects.equals(membershipId, that.membershipId);
}
@Override
public int hashCode() {
return Objects.hash(
id,
documentDate,
valueDate,
action,
amount,
remark,
membershipId
);
}
@Override
public String toString() {
return "AssetCriteria{" +
(id != null ? "id=" + id + ", " : "") +
(documentDate != null ? "documentDate=" + documentDate + ", " : "") +
(valueDate != null ? "valueDate=" + valueDate + ", " : "") +
(action != null ? "action=" + action + ", " : "") +
(amount != null ? "amount=" + amount + ", " : "") +
(remark != null ? "remark=" + remark + ", " : "") +
(membershipId != null ? "membershipId=" + membershipId + ", " : "") +
"}";
}
}

View File

@ -0,0 +1,134 @@
package org.hostsharing.hsadminng.service.dto;
import java.time.LocalDate;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Objects;
import org.hostsharing.hsadminng.domain.enumeration.AssetAction;
/**
* A DTO for the Asset entity.
*/
public class AssetDTO implements Serializable {
private Long id;
@NotNull
private LocalDate documentDate;
@NotNull
private LocalDate valueDate;
@NotNull
private AssetAction action;
@NotNull
private BigDecimal amount;
@Size(max = 160)
private String remark;
private Long membershipId;
private String membershipAdmissionDocumentDate;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public LocalDate getDocumentDate() {
return documentDate;
}
public void setDocumentDate(LocalDate documentDate) {
this.documentDate = documentDate;
}
public LocalDate getValueDate() {
return valueDate;
}
public void setValueDate(LocalDate valueDate) {
this.valueDate = valueDate;
}
public AssetAction getAction() {
return action;
}
public void setAction(AssetAction action) {
this.action = action;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Long getMembershipId() {
return membershipId;
}
public void setMembershipId(Long membershipId) {
this.membershipId = membershipId;
}
public String getMembershipAdmissionDocumentDate() {
return membershipAdmissionDocumentDate;
}
public void setMembershipAdmissionDocumentDate(String membershipAdmissionDocumentDate) {
this.membershipAdmissionDocumentDate = membershipAdmissionDocumentDate;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AssetDTO assetDTO = (AssetDTO) o;
if (assetDTO.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), assetDTO.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "AssetDTO{" +
"id=" + getId() +
", documentDate='" + getDocumentDate() + "'" +
", valueDate='" + getValueDate() + "'" +
", action='" + getAction() + "'" +
", amount=" + getAmount() +
", remark='" + getRemark() + "'" +
", membership=" + getMembershipId() +
", membership='" + getMembershipAdmissionDocumentDate() + "'" +
"}";
}
}

View File

@ -0,0 +1,297 @@
package org.hostsharing.hsadminng.service.dto;
import java.io.Serializable;
import java.util.Objects;
import org.hostsharing.hsadminng.domain.enumeration.CustomerKind;
import org.hostsharing.hsadminng.domain.enumeration.VatRegion;
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 Customer entity. This class is used in CustomerResource to
* receive all the possible filtering options from the Http GET request parameters.
* For example the following could be a valid requests:
* <code> /customers?id.greaterThan=5&amp;attr1.contains=something&amp;attr2.specified=false</code>
* As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use
* fix type specific filters.
*/
public class CustomerCriteria implements Serializable {
/**
* Class for filtering CustomerKind
*/
public static class CustomerKindFilter extends Filter<CustomerKind> {
}
/**
* Class for filtering VatRegion
*/
public static class VatRegionFilter extends Filter<VatRegion> {
}
private static final long serialVersionUID = 1L;
private LongFilter id;
private IntegerFilter reference;
private StringFilter prefix;
private StringFilter name;
private CustomerKindFilter kind;
private LocalDateFilter birthDate;
private StringFilter birthPlace;
private StringFilter registrationCourt;
private StringFilter registrationNumber;
private VatRegionFilter vatRegion;
private StringFilter vatNumber;
private StringFilter contractualSalutation;
private StringFilter contractualAddress;
private StringFilter billingSalutation;
private StringFilter billingAddress;
private StringFilter remark;
private LongFilter membershipId;
private LongFilter sepamandateId;
public LongFilter getId() {
return id;
}
public void setId(LongFilter id) {
this.id = id;
}
public IntegerFilter getReference() {
return reference;
}
public void setReference(IntegerFilter reference) {
this.reference = reference;
}
public StringFilter getPrefix() {
return prefix;
}
public void setPrefix(StringFilter prefix) {
this.prefix = prefix;
}
public StringFilter getName() {
return name;
}
public void setName(StringFilter name) {
this.name = name;
}
public CustomerKindFilter getKind() {
return kind;
}
public void setKind(CustomerKindFilter kind) {
this.kind = kind;
}
public LocalDateFilter getBirthDate() {
return birthDate;
}
public void setBirthDate(LocalDateFilter birthDate) {
this.birthDate = birthDate;
}
public StringFilter getBirthPlace() {
return birthPlace;
}
public void setBirthPlace(StringFilter birthPlace) {
this.birthPlace = birthPlace;
}
public StringFilter getRegistrationCourt() {
return registrationCourt;
}
public void setRegistrationCourt(StringFilter registrationCourt) {
this.registrationCourt = registrationCourt;
}
public StringFilter getRegistrationNumber() {
return registrationNumber;
}
public void setRegistrationNumber(StringFilter registrationNumber) {
this.registrationNumber = registrationNumber;
}
public VatRegionFilter getVatRegion() {
return vatRegion;
}
public void setVatRegion(VatRegionFilter vatRegion) {
this.vatRegion = vatRegion;
}
public StringFilter getVatNumber() {
return vatNumber;
}
public void setVatNumber(StringFilter vatNumber) {
this.vatNumber = vatNumber;
}
public StringFilter getContractualSalutation() {
return contractualSalutation;
}
public void setContractualSalutation(StringFilter contractualSalutation) {
this.contractualSalutation = contractualSalutation;
}
public StringFilter getContractualAddress() {
return contractualAddress;
}
public void setContractualAddress(StringFilter contractualAddress) {
this.contractualAddress = contractualAddress;
}
public StringFilter getBillingSalutation() {
return billingSalutation;
}
public void setBillingSalutation(StringFilter billingSalutation) {
this.billingSalutation = billingSalutation;
}
public StringFilter getBillingAddress() {
return billingAddress;
}
public void setBillingAddress(StringFilter billingAddress) {
this.billingAddress = billingAddress;
}
public StringFilter getRemark() {
return remark;
}
public void setRemark(StringFilter remark) {
this.remark = remark;
}
public LongFilter getMembershipId() {
return membershipId;
}
public void setMembershipId(LongFilter membershipId) {
this.membershipId = membershipId;
}
public LongFilter getSepamandateId() {
return sepamandateId;
}
public void setSepamandateId(LongFilter sepamandateId) {
this.sepamandateId = sepamandateId;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final CustomerCriteria that = (CustomerCriteria) o;
return
Objects.equals(id, that.id) &&
Objects.equals(reference, that.reference) &&
Objects.equals(prefix, that.prefix) &&
Objects.equals(name, that.name) &&
Objects.equals(kind, that.kind) &&
Objects.equals(birthDate, that.birthDate) &&
Objects.equals(birthPlace, that.birthPlace) &&
Objects.equals(registrationCourt, that.registrationCourt) &&
Objects.equals(registrationNumber, that.registrationNumber) &&
Objects.equals(vatRegion, that.vatRegion) &&
Objects.equals(vatNumber, that.vatNumber) &&
Objects.equals(contractualSalutation, that.contractualSalutation) &&
Objects.equals(contractualAddress, that.contractualAddress) &&
Objects.equals(billingSalutation, that.billingSalutation) &&
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,
reference,
prefix,
name,
kind,
birthDate,
birthPlace,
registrationCourt,
registrationNumber,
vatRegion,
vatNumber,
contractualSalutation,
contractualAddress,
billingSalutation,
billingAddress,
remark,
membershipId,
sepamandateId
);
}
@Override
public String toString() {
return "CustomerCriteria{" +
(id != null ? "id=" + id + ", " : "") +
(reference != null ? "reference=" + reference + ", " : "") +
(prefix != null ? "prefix=" + prefix + ", " : "") +
(name != null ? "name=" + name + ", " : "") +
(kind != null ? "kind=" + kind + ", " : "") +
(birthDate != null ? "birthDate=" + birthDate + ", " : "") +
(birthPlace != null ? "birthPlace=" + birthPlace + ", " : "") +
(registrationCourt != null ? "registrationCourt=" + registrationCourt + ", " : "") +
(registrationNumber != null ? "registrationNumber=" + registrationNumber + ", " : "") +
(vatRegion != null ? "vatRegion=" + vatRegion + ", " : "") +
(vatNumber != null ? "vatNumber=" + vatNumber + ", " : "") +
(contractualSalutation != null ? "contractualSalutation=" + contractualSalutation + ", " : "") +
(contractualAddress != null ? "contractualAddress=" + contractualAddress + ", " : "") +
(billingSalutation != null ? "billingSalutation=" + billingSalutation + ", " : "") +
(billingAddress != null ? "billingAddress=" + billingAddress + ", " : "") +
(remark != null ? "remark=" + remark + ", " : "") +
(membershipId != null ? "membershipId=" + membershipId + ", " : "") +
(sepamandateId != null ? "sepamandateId=" + sepamandateId + ", " : "") +
"}";
}
}

View File

@ -0,0 +1,237 @@
package org.hostsharing.hsadminng.service.dto;
import java.time.LocalDate;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Objects;
import org.hostsharing.hsadminng.domain.enumeration.CustomerKind;
import org.hostsharing.hsadminng.domain.enumeration.VatRegion;
/**
* A DTO for the Customer entity.
*/
public class CustomerDTO implements Serializable {
private Long id;
@NotNull
@Min(value = 10000)
@Max(value = 99999)
private Integer reference;
@NotNull
@Size(max = 3)
@Pattern(regexp = "[a-z][a-z0-9]+")
private String prefix;
@NotNull
@Size(max = 80)
private String name;
@NotNull
private CustomerKind kind;
private LocalDate birthDate;
@Size(max = 80)
private String birthPlace;
@Size(max = 80)
private String registrationCourt;
@Size(max = 80)
private String registrationNumber;
@NotNull
private VatRegion vatRegion;
@Size(max = 40)
private String vatNumber;
@Size(max = 80)
private String contractualSalutation;
@NotNull
@Size(max = 400)
private String contractualAddress;
@Size(max = 80)
private String billingSalutation;
@Size(max = 400)
private String billingAddress;
@Size(max = 160)
private String remark;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getReference() {
return reference;
}
public void setReference(Integer reference) {
this.reference = reference;
}
public String getPrefix() {
return prefix;
}
public void setPrefix(String prefix) {
this.prefix = prefix;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public CustomerKind getKind() {
return kind;
}
public void setKind(CustomerKind kind) {
this.kind = kind;
}
public LocalDate getBirthDate() {
return birthDate;
}
public void setBirthDate(LocalDate birthDate) {
this.birthDate = birthDate;
}
public String getBirthPlace() {
return birthPlace;
}
public void setBirthPlace(String birthPlace) {
this.birthPlace = birthPlace;
}
public String getRegistrationCourt() {
return registrationCourt;
}
public void setRegistrationCourt(String registrationCourt) {
this.registrationCourt = registrationCourt;
}
public String getRegistrationNumber() {
return registrationNumber;
}
public void setRegistrationNumber(String registrationNumber) {
this.registrationNumber = registrationNumber;
}
public VatRegion getVatRegion() {
return vatRegion;
}
public void setVatRegion(VatRegion vatRegion) {
this.vatRegion = vatRegion;
}
public String getVatNumber() {
return vatNumber;
}
public void setVatNumber(String vatNumber) {
this.vatNumber = vatNumber;
}
public String getContractualSalutation() {
return contractualSalutation;
}
public void setContractualSalutation(String contractualSalutation) {
this.contractualSalutation = contractualSalutation;
}
public String getContractualAddress() {
return contractualAddress;
}
public void setContractualAddress(String contractualAddress) {
this.contractualAddress = contractualAddress;
}
public String getBillingSalutation() {
return billingSalutation;
}
public void setBillingSalutation(String billingSalutation) {
this.billingSalutation = billingSalutation;
}
public String getBillingAddress() {
return billingAddress;
}
public void setBillingAddress(String billingAddress) {
this.billingAddress = billingAddress;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CustomerDTO customerDTO = (CustomerDTO) o;
if (customerDTO.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), customerDTO.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "CustomerDTO{" +
"id=" + getId() +
", reference=" + getReference() +
", prefix='" + getPrefix() + "'" +
", name='" + getName() + "'" +
", kind='" + getKind() + "'" +
", birthDate='" + getBirthDate() + "'" +
", birthPlace='" + getBirthPlace() + "'" +
", registrationCourt='" + getRegistrationCourt() + "'" +
", registrationNumber='" + getRegistrationNumber() + "'" +
", vatRegion='" + getVatRegion() + "'" +
", vatNumber='" + getVatNumber() + "'" +
", contractualSalutation='" + getContractualSalutation() + "'" +
", contractualAddress='" + getContractualAddress() + "'" +
", billingSalutation='" + getBillingSalutation() + "'" +
", billingAddress='" + getBillingAddress() + "'" +
", remark='" + getRemark() + "'" +
"}";
}
}

View File

@ -0,0 +1,168 @@
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 Membership entity. This class is used in MembershipResource to
* receive all the possible filtering options from the Http GET request parameters.
* For example the following could be a valid requests:
* <code> /memberships?id.greaterThan=5&amp;attr1.contains=something&amp;attr2.specified=false</code>
* As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use
* fix type specific filters.
*/
public class MembershipCriteria implements Serializable {
private static final long serialVersionUID = 1L;
private LongFilter id;
private LocalDateFilter admissionDocumentDate;
private LocalDateFilter cancellationDocumentDate;
private LocalDateFilter memberFromDate;
private LocalDateFilter memberUntilDate;
private StringFilter remark;
private LongFilter shareId;
private LongFilter assetId;
private LongFilter customerId;
public LongFilter getId() {
return id;
}
public void setId(LongFilter id) {
this.id = id;
}
public LocalDateFilter getAdmissionDocumentDate() {
return admissionDocumentDate;
}
public void setAdmissionDocumentDate(LocalDateFilter admissionDocumentDate) {
this.admissionDocumentDate = admissionDocumentDate;
}
public LocalDateFilter getCancellationDocumentDate() {
return cancellationDocumentDate;
}
public void setCancellationDocumentDate(LocalDateFilter cancellationDocumentDate) {
this.cancellationDocumentDate = cancellationDocumentDate;
}
public LocalDateFilter getMemberFromDate() {
return memberFromDate;
}
public void setMemberFromDate(LocalDateFilter memberFromDate) {
this.memberFromDate = memberFromDate;
}
public LocalDateFilter getMemberUntilDate() {
return memberUntilDate;
}
public void setMemberUntilDate(LocalDateFilter memberUntilDate) {
this.memberUntilDate = memberUntilDate;
}
public StringFilter getRemark() {
return remark;
}
public void setRemark(StringFilter remark) {
this.remark = remark;
}
public LongFilter getShareId() {
return shareId;
}
public void setShareId(LongFilter shareId) {
this.shareId = shareId;
}
public LongFilter getAssetId() {
return assetId;
}
public void setAssetId(LongFilter assetId) {
this.assetId = assetId;
}
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 MembershipCriteria that = (MembershipCriteria) o;
return
Objects.equals(id, that.id) &&
Objects.equals(admissionDocumentDate, that.admissionDocumentDate) &&
Objects.equals(cancellationDocumentDate, that.cancellationDocumentDate) &&
Objects.equals(memberFromDate, that.memberFromDate) &&
Objects.equals(memberUntilDate, that.memberUntilDate) &&
Objects.equals(remark, that.remark) &&
Objects.equals(shareId, that.shareId) &&
Objects.equals(assetId, that.assetId) &&
Objects.equals(customerId, that.customerId);
}
@Override
public int hashCode() {
return Objects.hash(
id,
admissionDocumentDate,
cancellationDocumentDate,
memberFromDate,
memberUntilDate,
remark,
shareId,
assetId,
customerId
);
}
@Override
public String toString() {
return "MembershipCriteria{" +
(id != null ? "id=" + id + ", " : "") +
(admissionDocumentDate != null ? "admissionDocumentDate=" + admissionDocumentDate + ", " : "") +
(cancellationDocumentDate != null ? "cancellationDocumentDate=" + cancellationDocumentDate + ", " : "") +
(memberFromDate != null ? "memberFromDate=" + memberFromDate + ", " : "") +
(memberUntilDate != null ? "memberUntilDate=" + memberUntilDate + ", " : "") +
(remark != null ? "remark=" + remark + ", " : "") +
(shareId != null ? "shareId=" + shareId + ", " : "") +
(assetId != null ? "assetId=" + assetId + ", " : "") +
(customerId != null ? "customerId=" + customerId + ", " : "") +
"}";
}
}

View File

@ -0,0 +1,130 @@
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 Membership entity.
*/
public class MembershipDTO implements Serializable {
private Long id;
@NotNull
private LocalDate admissionDocumentDate;
private LocalDate cancellationDocumentDate;
@NotNull
private LocalDate memberFromDate;
private LocalDate memberUntilDate;
@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 LocalDate getAdmissionDocumentDate() {
return admissionDocumentDate;
}
public void setAdmissionDocumentDate(LocalDate admissionDocumentDate) {
this.admissionDocumentDate = admissionDocumentDate;
}
public LocalDate getCancellationDocumentDate() {
return cancellationDocumentDate;
}
public void setCancellationDocumentDate(LocalDate cancellationDocumentDate) {
this.cancellationDocumentDate = cancellationDocumentDate;
}
public LocalDate getMemberFromDate() {
return memberFromDate;
}
public void setMemberFromDate(LocalDate memberFromDate) {
this.memberFromDate = memberFromDate;
}
public LocalDate getMemberUntilDate() {
return memberUntilDate;
}
public void setMemberUntilDate(LocalDate memberUntilDate) {
this.memberUntilDate = memberUntilDate;
}
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;
}
MembershipDTO membershipDTO = (MembershipDTO) o;
if (membershipDTO.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), membershipDTO.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "MembershipDTO{" +
"id=" + getId() +
", admissionDocumentDate='" + getAdmissionDocumentDate() + "'" +
", cancellationDocumentDate='" + getCancellationDocumentDate() + "'" +
", memberFromDate='" + getMemberFromDate() + "'" +
", memberUntilDate='" + getMemberUntilDate() + "'" +
", remark='" + getRemark() + "'" +
", customer=" + getCustomerId() +
", customer='" + getCustomerPrefix() + "'" +
"}";
}
}

View File

@ -0,0 +1,194 @@
package org.hostsharing.hsadminng.service.dto;
import java.io.Serializable;
import java.util.Objects;
import io.github.jhipster.service.filter.BooleanFilter;
import io.github.jhipster.service.filter.DoubleFilter;
import io.github.jhipster.service.filter.Filter;
import io.github.jhipster.service.filter.FloatFilter;
import io.github.jhipster.service.filter.IntegerFilter;
import io.github.jhipster.service.filter.LongFilter;
import io.github.jhipster.service.filter.StringFilter;
import io.github.jhipster.service.filter.LocalDateFilter;
/**
* Criteria class for the SepaMandate entity. This class is used in SepaMandateResource to
* receive all the possible filtering options from the Http GET request parameters.
* For example the following could be a valid requests:
* <code> /sepa-mandates?id.greaterThan=5&amp;attr1.contains=something&amp;attr2.specified=false</code>
* As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use
* fix type specific filters.
*/
public class SepaMandateCriteria implements Serializable {
private static final long serialVersionUID = 1L;
private LongFilter id;
private StringFilter reference;
private StringFilter iban;
private StringFilter bic;
private LocalDateFilter grantingDocumentDate;
private LocalDateFilter revokationDocumentDate;
private LocalDateFilter validFromDate;
private LocalDateFilter validUntilDate;
private LocalDateFilter lastUsedDate;
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 getGrantingDocumentDate() {
return grantingDocumentDate;
}
public void setGrantingDocumentDate(LocalDateFilter grantingDocumentDate) {
this.grantingDocumentDate = grantingDocumentDate;
}
public LocalDateFilter getRevokationDocumentDate() {
return revokationDocumentDate;
}
public void setRevokationDocumentDate(LocalDateFilter revokationDocumentDate) {
this.revokationDocumentDate = revokationDocumentDate;
}
public LocalDateFilter getValidFromDate() {
return validFromDate;
}
public void setValidFromDate(LocalDateFilter validFromDate) {
this.validFromDate = validFromDate;
}
public LocalDateFilter getValidUntilDate() {
return validUntilDate;
}
public void setValidUntilDate(LocalDateFilter validUntilDate) {
this.validUntilDate = validUntilDate;
}
public LocalDateFilter getLastUsedDate() {
return lastUsedDate;
}
public void setLastUsedDate(LocalDateFilter lastUsedDate) {
this.lastUsedDate = lastUsedDate;
}
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(grantingDocumentDate, that.grantingDocumentDate) &&
Objects.equals(revokationDocumentDate, that.revokationDocumentDate) &&
Objects.equals(validFromDate, that.validFromDate) &&
Objects.equals(validUntilDate, that.validUntilDate) &&
Objects.equals(lastUsedDate, that.lastUsedDate) &&
Objects.equals(remark, that.remark) &&
Objects.equals(customerId, that.customerId);
}
@Override
public int hashCode() {
return Objects.hash(
id,
reference,
iban,
bic,
grantingDocumentDate,
revokationDocumentDate,
validFromDate,
validUntilDate,
lastUsedDate,
remark,
customerId
);
}
@Override
public String toString() {
return "SepaMandateCriteria{" +
(id != null ? "id=" + id + ", " : "") +
(reference != null ? "reference=" + reference + ", " : "") +
(iban != null ? "iban=" + iban + ", " : "") +
(bic != null ? "bic=" + bic + ", " : "") +
(grantingDocumentDate != null ? "grantingDocumentDate=" + grantingDocumentDate + ", " : "") +
(revokationDocumentDate != null ? "revokationDocumentDate=" + revokationDocumentDate + ", " : "") +
(validFromDate != null ? "validFromDate=" + validFromDate + ", " : "") +
(validUntilDate != null ? "validUntilDate=" + validUntilDate + ", " : "") +
(lastUsedDate != null ? "lastUsedDate=" + lastUsedDate + ", " : "") +
(remark != null ? "remark=" + remark + ", " : "") +
(customerId != null ? "customerId=" + customerId + ", " : "") +
"}";
}
}

View File

@ -0,0 +1,178 @@
package org.hostsharing.hsadminng.service.dto;
import java.time.LocalDate;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Objects;
/**
* A DTO for the SepaMandate entity.
*/
public class SepaMandateDTO implements Serializable {
private Long id;
@NotNull
@Size(max = 40)
private String reference;
@Size(max = 34)
private String iban;
@Size(max = 11)
private String bic;
@NotNull
private LocalDate grantingDocumentDate;
private LocalDate revokationDocumentDate;
@NotNull
private LocalDate validFromDate;
private LocalDate validUntilDate;
private LocalDate lastUsedDate;
@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 getGrantingDocumentDate() {
return grantingDocumentDate;
}
public void setGrantingDocumentDate(LocalDate grantingDocumentDate) {
this.grantingDocumentDate = grantingDocumentDate;
}
public LocalDate getRevokationDocumentDate() {
return revokationDocumentDate;
}
public void setRevokationDocumentDate(LocalDate revokationDocumentDate) {
this.revokationDocumentDate = revokationDocumentDate;
}
public LocalDate getValidFromDate() {
return validFromDate;
}
public void setValidFromDate(LocalDate validFromDate) {
this.validFromDate = validFromDate;
}
public LocalDate getValidUntilDate() {
return validUntilDate;
}
public void setValidUntilDate(LocalDate validUntilDate) {
this.validUntilDate = validUntilDate;
}
public LocalDate getLastUsedDate() {
return lastUsedDate;
}
public void setLastUsedDate(LocalDate lastUsedDate) {
this.lastUsedDate = lastUsedDate;
}
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() + "'" +
", grantingDocumentDate='" + getGrantingDocumentDate() + "'" +
", revokationDocumentDate='" + getRevokationDocumentDate() + "'" +
", validFromDate='" + getValidFromDate() + "'" +
", validUntilDate='" + getValidUntilDate() + "'" +
", lastUsedDate='" + getLastUsedDate() + "'" +
", remark='" + getRemark() + "'" +
", customer=" + getCustomerId() +
", customer='" + getCustomerPrefix() + "'" +
"}";
}
}

View File

@ -0,0 +1,148 @@
package org.hostsharing.hsadminng.service.dto;
import java.io.Serializable;
import java.util.Objects;
import org.hostsharing.hsadminng.domain.enumeration.ShareAction;
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 Share entity. This class is used in ShareResource to
* receive all the possible filtering options from the Http GET request parameters.
* For example the following could be a valid requests:
* <code> /shares?id.greaterThan=5&amp;attr1.contains=something&amp;attr2.specified=false</code>
* As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use
* fix type specific filters.
*/
public class ShareCriteria implements Serializable {
/**
* Class for filtering ShareAction
*/
public static class ShareActionFilter extends Filter<ShareAction> {
}
private static final long serialVersionUID = 1L;
private LongFilter id;
private LocalDateFilter documentDate;
private LocalDateFilter valueDate;
private ShareActionFilter action;
private IntegerFilter quantity;
private StringFilter remark;
private LongFilter membershipId;
public LongFilter getId() {
return id;
}
public void setId(LongFilter id) {
this.id = id;
}
public LocalDateFilter getDocumentDate() {
return documentDate;
}
public void setDocumentDate(LocalDateFilter documentDate) {
this.documentDate = documentDate;
}
public LocalDateFilter getValueDate() {
return valueDate;
}
public void setValueDate(LocalDateFilter valueDate) {
this.valueDate = valueDate;
}
public ShareActionFilter getAction() {
return action;
}
public void setAction(ShareActionFilter action) {
this.action = action;
}
public IntegerFilter getQuantity() {
return quantity;
}
public void setQuantity(IntegerFilter quantity) {
this.quantity = quantity;
}
public StringFilter getRemark() {
return remark;
}
public void setRemark(StringFilter remark) {
this.remark = remark;
}
public LongFilter getMembershipId() {
return membershipId;
}
public void setMembershipId(LongFilter membershipId) {
this.membershipId = membershipId;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final ShareCriteria that = (ShareCriteria) o;
return
Objects.equals(id, that.id) &&
Objects.equals(documentDate, that.documentDate) &&
Objects.equals(valueDate, that.valueDate) &&
Objects.equals(action, that.action) &&
Objects.equals(quantity, that.quantity) &&
Objects.equals(remark, that.remark) &&
Objects.equals(membershipId, that.membershipId);
}
@Override
public int hashCode() {
return Objects.hash(
id,
documentDate,
valueDate,
action,
quantity,
remark,
membershipId
);
}
@Override
public String toString() {
return "ShareCriteria{" +
(id != null ? "id=" + id + ", " : "") +
(documentDate != null ? "documentDate=" + documentDate + ", " : "") +
(valueDate != null ? "valueDate=" + valueDate + ", " : "") +
(action != null ? "action=" + action + ", " : "") +
(quantity != null ? "quantity=" + quantity + ", " : "") +
(remark != null ? "remark=" + remark + ", " : "") +
(membershipId != null ? "membershipId=" + membershipId + ", " : "") +
"}";
}
}

View File

@ -0,0 +1,133 @@
package org.hostsharing.hsadminng.service.dto;
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.
*/
public class ShareDTO implements Serializable {
private Long id;
@NotNull
private LocalDate documentDate;
@NotNull
private LocalDate valueDate;
@NotNull
private ShareAction action;
@NotNull
private Integer quantity;
@Size(max = 160)
private String remark;
private Long membershipId;
private String membershipAdmissionDocumentDate;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public LocalDate getDocumentDate() {
return documentDate;
}
public void setDocumentDate(LocalDate documentDate) {
this.documentDate = documentDate;
}
public LocalDate getValueDate() {
return valueDate;
}
public void setValueDate(LocalDate valueDate) {
this.valueDate = valueDate;
}
public ShareAction getAction() {
return action;
}
public void setAction(ShareAction action) {
this.action = action;
}
public Integer getQuantity() {
return quantity;
}
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Long getMembershipId() {
return membershipId;
}
public void setMembershipId(Long membershipId) {
this.membershipId = membershipId;
}
public String getMembershipAdmissionDocumentDate() {
return membershipAdmissionDocumentDate;
}
public void setMembershipAdmissionDocumentDate(String membershipAdmissionDocumentDate) {
this.membershipAdmissionDocumentDate = membershipAdmissionDocumentDate;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ShareDTO shareDTO = (ShareDTO) o;
if (shareDTO.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), shareDTO.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "ShareDTO{" +
"id=" + getId() +
", documentDate='" + getDocumentDate() + "'" +
", valueDate='" + getValueDate() + "'" +
", action='" + getAction() + "'" +
", quantity=" + getQuantity() +
", remark='" + getRemark() + "'" +
", membership=" + getMembershipId() +
", membership='" + getMembershipAdmissionDocumentDate() + "'" +
"}";
}
}

View File

@ -0,0 +1,29 @@
package org.hostsharing.hsadminng.service.mapper;
import org.hostsharing.hsadminng.domain.*;
import org.hostsharing.hsadminng.service.dto.AssetDTO;
import org.mapstruct.*;
/**
* Mapper for the entity Asset and its DTO AssetDTO.
*/
@Mapper(componentModel = "spring", uses = {MembershipMapper.class})
public interface AssetMapper extends EntityMapper<AssetDTO, Asset> {
@Mapping(source = "membership.id", target = "membershipId")
@Mapping(source = "membership.admissionDocumentDate", target = "membershipAdmissionDocumentDate")
AssetDTO toDto(Asset asset);
@Mapping(source = "membershipId", target = "membership")
Asset toEntity(AssetDTO assetDTO);
default Asset fromId(Long id) {
if (id == null) {
return null;
}
Asset asset = new Asset();
asset.setId(id);
return asset;
}
}

View File

@ -0,0 +1,27 @@
package org.hostsharing.hsadminng.service.mapper;
import org.hostsharing.hsadminng.domain.*;
import org.hostsharing.hsadminng.service.dto.CustomerDTO;
import org.mapstruct.*;
/**
* Mapper for the entity Customer and its DTO CustomerDTO.
*/
@Mapper(componentModel = "spring", uses = {})
public interface CustomerMapper extends EntityMapper<CustomerDTO, Customer> {
@Mapping(target = "memberships", ignore = true)
@Mapping(target = "sepamandates", ignore = true)
Customer toEntity(CustomerDTO customerDTO);
default Customer fromId(Long id) {
if (id == null) {
return null;
}
Customer customer = new Customer();
customer.setId(id);
return customer;
}
}

View File

@ -0,0 +1,21 @@
package org.hostsharing.hsadminng.service.mapper;
import java.util.List;
/**
* Contract for a generic dto to entity mapper.
*
* @param <D> - DTO type parameter.
* @param <E> - Entity type parameter.
*/
public interface EntityMapper <D, E> {
E toEntity(D dto);
D toDto(E entity);
List <E> toEntity(List<D> dtoList);
List <D> toDto(List<E> entityList);
}

View File

@ -0,0 +1,31 @@
package org.hostsharing.hsadminng.service.mapper;
import org.hostsharing.hsadminng.domain.*;
import org.hostsharing.hsadminng.service.dto.MembershipDTO;
import org.mapstruct.*;
/**
* Mapper for the entity Membership and its DTO MembershipDTO.
*/
@Mapper(componentModel = "spring", uses = {CustomerMapper.class})
public interface MembershipMapper extends EntityMapper<MembershipDTO, Membership> {
@Mapping(source = "customer.id", target = "customerId")
@Mapping(source = "customer.prefix", target = "customerPrefix")
MembershipDTO toDto(Membership membership);
@Mapping(target = "shares", ignore = true)
@Mapping(target = "assets", ignore = true)
@Mapping(source = "customerId", target = "customer")
Membership toEntity(MembershipDTO membershipDTO);
default Membership fromId(Long id) {
if (id == null) {
return null;
}
Membership membership = new Membership();
membership.setId(id);
return membership;
}
}

View File

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

View File

@ -0,0 +1,29 @@
package org.hostsharing.hsadminng.service.mapper;
import org.hostsharing.hsadminng.domain.*;
import org.hostsharing.hsadminng.service.dto.ShareDTO;
import org.mapstruct.*;
/**
* Mapper for the entity Share and its DTO ShareDTO.
*/
@Mapper(componentModel = "spring", uses = {MembershipMapper.class})
public interface ShareMapper extends EntityMapper<ShareDTO, Share> {
@Mapping(source = "membership.id", target = "membershipId")
@Mapping(source = "membership.admissionDocumentDate", target = "membershipAdmissionDocumentDate")
ShareDTO toDto(Share share);
@Mapping(source = "membershipId", target = "membership")
Share toEntity(ShareDTO shareDTO);
default Share fromId(Long id) {
if (id == null) {
return null;
}
Share share = new Share();
share.setId(id);
return share;
}
}

View File

@ -0,0 +1,138 @@
package org.hostsharing.hsadminng.web.rest;
import org.hostsharing.hsadminng.service.AssetService;
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.AssetDTO;
import org.hostsharing.hsadminng.service.dto.AssetCriteria;
import org.hostsharing.hsadminng.service.AssetQueryService;
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 Asset.
*/
@RestController
@RequestMapping("/api")
public class AssetResource {
private final Logger log = LoggerFactory.getLogger(AssetResource.class);
private static final String ENTITY_NAME = "asset";
private final AssetService assetService;
private final AssetQueryService assetQueryService;
public AssetResource(AssetService assetService, AssetQueryService assetQueryService) {
this.assetService = assetService;
this.assetQueryService = assetQueryService;
}
/**
* POST /assets : Create a new asset.
*
* @param assetDTO the assetDTO to create
* @return the ResponseEntity with status 201 (Created) and with body the new assetDTO, or with status 400 (Bad Request) if the asset has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/assets")
public ResponseEntity<AssetDTO> createAsset(@Valid @RequestBody AssetDTO assetDTO) throws URISyntaxException {
log.debug("REST request to save Asset : {}", assetDTO);
if (assetDTO.getId() != null) {
throw new BadRequestAlertException("A new asset cannot already have an ID", ENTITY_NAME, "idexists");
}
AssetDTO result = assetService.save(assetDTO);
return ResponseEntity.created(new URI("/api/assets/" + result.getId()))
.headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))
.body(result);
}
/**
* PUT /assets : Updates an existing asset.
*
* @param assetDTO the assetDTO to update
* @return the ResponseEntity with status 200 (OK) and with body the updated assetDTO,
* or with status 400 (Bad Request) if the assetDTO is not valid,
* or with status 500 (Internal Server Error) if the assetDTO couldn't be updated
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PutMapping("/assets")
public ResponseEntity<AssetDTO> updateAsset(@Valid @RequestBody AssetDTO assetDTO) throws URISyntaxException {
log.debug("REST request to update Asset : {}", assetDTO);
if (assetDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
AssetDTO result = assetService.save(assetDTO);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, assetDTO.getId().toString()))
.body(result);
}
/**
* GET /assets : get all the assets.
*
* @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 assets in body
*/
@GetMapping("/assets")
public ResponseEntity<List<AssetDTO>> getAllAssets(AssetCriteria criteria, Pageable pageable) {
log.debug("REST request to get Assets by criteria: {}", criteria);
Page<AssetDTO> page = assetQueryService.findByCriteria(criteria, pageable);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/assets");
return ResponseEntity.ok().headers(headers).body(page.getContent());
}
/**
* GET /assets/count : count all the assets.
*
* @param criteria the criterias which the requested entities should match
* @return the ResponseEntity with status 200 (OK) and the count in body
*/
@GetMapping("/assets/count")
public ResponseEntity<Long> countAssets(AssetCriteria criteria) {
log.debug("REST request to count Assets by criteria: {}", criteria);
return ResponseEntity.ok().body(assetQueryService.countByCriteria(criteria));
}
/**
* GET /assets/:id : get the "id" asset.
*
* @param id the id of the assetDTO to retrieve
* @return the ResponseEntity with status 200 (OK) and with body the assetDTO, or with status 404 (Not Found)
*/
@GetMapping("/assets/{id}")
public ResponseEntity<AssetDTO> getAsset(@PathVariable Long id) {
log.debug("REST request to get Asset : {}", id);
Optional<AssetDTO> assetDTO = assetService.findOne(id);
return ResponseUtil.wrapOrNotFound(assetDTO);
}
/**
* DELETE /assets/:id : delete the "id" asset.
*
* @param id the id of the assetDTO to delete
* @return the ResponseEntity with status 200 (OK)
*/
@DeleteMapping("/assets/{id}")
public ResponseEntity<Void> deleteAsset(@PathVariable Long id) {
log.debug("REST request to delete Asset : {}", id);
assetService.delete(id);
return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();
}
}

View File

@ -0,0 +1,138 @@
package org.hostsharing.hsadminng.web.rest;
import org.hostsharing.hsadminng.service.CustomerService;
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.CustomerDTO;
import org.hostsharing.hsadminng.service.dto.CustomerCriteria;
import org.hostsharing.hsadminng.service.CustomerQueryService;
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 Customer.
*/
@RestController
@RequestMapping("/api")
public class CustomerResource {
private final Logger log = LoggerFactory.getLogger(CustomerResource.class);
private static final String ENTITY_NAME = "customer";
private final CustomerService customerService;
private final CustomerQueryService customerQueryService;
public CustomerResource(CustomerService customerService, CustomerQueryService customerQueryService) {
this.customerService = customerService;
this.customerQueryService = customerQueryService;
}
/**
* POST /customers : Create a new customer.
*
* @param customerDTO the customerDTO to create
* @return the ResponseEntity with status 201 (Created) and with body the new customerDTO, or with status 400 (Bad Request) if the customer has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/customers")
public ResponseEntity<CustomerDTO> createCustomer(@Valid @RequestBody CustomerDTO customerDTO) throws URISyntaxException {
log.debug("REST request to save Customer : {}", customerDTO);
if (customerDTO.getId() != null) {
throw new BadRequestAlertException("A new customer cannot already have an ID", ENTITY_NAME, "idexists");
}
CustomerDTO result = customerService.save(customerDTO);
return ResponseEntity.created(new URI("/api/customers/" + result.getId()))
.headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))
.body(result);
}
/**
* PUT /customers : Updates an existing customer.
*
* @param customerDTO the customerDTO to update
* @return the ResponseEntity with status 200 (OK) and with body the updated customerDTO,
* or with status 400 (Bad Request) if the customerDTO is not valid,
* or with status 500 (Internal Server Error) if the customerDTO couldn't be updated
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PutMapping("/customers")
public ResponseEntity<CustomerDTO> updateCustomer(@Valid @RequestBody CustomerDTO customerDTO) throws URISyntaxException {
log.debug("REST request to update Customer : {}", customerDTO);
if (customerDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
CustomerDTO result = customerService.save(customerDTO);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, customerDTO.getId().toString()))
.body(result);
}
/**
* GET /customers : get all the customers.
*
* @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 customers in body
*/
@GetMapping("/customers")
public ResponseEntity<List<CustomerDTO>> getAllCustomers(CustomerCriteria criteria, Pageable pageable) {
log.debug("REST request to get Customers by criteria: {}", criteria);
Page<CustomerDTO> page = customerQueryService.findByCriteria(criteria, pageable);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/customers");
return ResponseEntity.ok().headers(headers).body(page.getContent());
}
/**
* GET /customers/count : count all the customers.
*
* @param criteria the criterias which the requested entities should match
* @return the ResponseEntity with status 200 (OK) and the count in body
*/
@GetMapping("/customers/count")
public ResponseEntity<Long> countCustomers(CustomerCriteria criteria) {
log.debug("REST request to count Customers by criteria: {}", criteria);
return ResponseEntity.ok().body(customerQueryService.countByCriteria(criteria));
}
/**
* GET /customers/:id : get the "id" customer.
*
* @param id the id of the customerDTO to retrieve
* @return the ResponseEntity with status 200 (OK) and with body the customerDTO, or with status 404 (Not Found)
*/
@GetMapping("/customers/{id}")
public ResponseEntity<CustomerDTO> getCustomer(@PathVariable Long id) {
log.debug("REST request to get Customer : {}", id);
Optional<CustomerDTO> customerDTO = customerService.findOne(id);
return ResponseUtil.wrapOrNotFound(customerDTO);
}
/**
* DELETE /customers/:id : delete the "id" customer.
*
* @param id the id of the customerDTO to delete
* @return the ResponseEntity with status 200 (OK)
*/
@DeleteMapping("/customers/{id}")
public ResponseEntity<Void> deleteCustomer(@PathVariable Long id) {
log.debug("REST request to delete Customer : {}", id);
customerService.delete(id);
return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();
}
}

View File

@ -0,0 +1,138 @@
package org.hostsharing.hsadminng.web.rest;
import org.hostsharing.hsadminng.service.MembershipService;
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.MembershipDTO;
import org.hostsharing.hsadminng.service.dto.MembershipCriteria;
import org.hostsharing.hsadminng.service.MembershipQueryService;
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 Membership.
*/
@RestController
@RequestMapping("/api")
public class MembershipResource {
private final Logger log = LoggerFactory.getLogger(MembershipResource.class);
private static final String ENTITY_NAME = "membership";
private final MembershipService membershipService;
private final MembershipQueryService membershipQueryService;
public MembershipResource(MembershipService membershipService, MembershipQueryService membershipQueryService) {
this.membershipService = membershipService;
this.membershipQueryService = membershipQueryService;
}
/**
* POST /memberships : Create a new membership.
*
* @param membershipDTO the membershipDTO to create
* @return the ResponseEntity with status 201 (Created) and with body the new membershipDTO, or with status 400 (Bad Request) if the membership has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/memberships")
public ResponseEntity<MembershipDTO> createMembership(@Valid @RequestBody MembershipDTO membershipDTO) throws URISyntaxException {
log.debug("REST request to save Membership : {}", membershipDTO);
if (membershipDTO.getId() != null) {
throw new BadRequestAlertException("A new membership cannot already have an ID", ENTITY_NAME, "idexists");
}
MembershipDTO result = membershipService.save(membershipDTO);
return ResponseEntity.created(new URI("/api/memberships/" + result.getId()))
.headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))
.body(result);
}
/**
* PUT /memberships : Updates an existing membership.
*
* @param membershipDTO the membershipDTO to update
* @return the ResponseEntity with status 200 (OK) and with body the updated membershipDTO,
* or with status 400 (Bad Request) if the membershipDTO is not valid,
* or with status 500 (Internal Server Error) if the membershipDTO couldn't be updated
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PutMapping("/memberships")
public ResponseEntity<MembershipDTO> updateMembership(@Valid @RequestBody MembershipDTO membershipDTO) throws URISyntaxException {
log.debug("REST request to update Membership : {}", membershipDTO);
if (membershipDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
MembershipDTO result = membershipService.save(membershipDTO);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, membershipDTO.getId().toString()))
.body(result);
}
/**
* GET /memberships : get all the memberships.
*
* @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 memberships in body
*/
@GetMapping("/memberships")
public ResponseEntity<List<MembershipDTO>> getAllMemberships(MembershipCriteria criteria, Pageable pageable) {
log.debug("REST request to get Memberships by criteria: {}", criteria);
Page<MembershipDTO> page = membershipQueryService.findByCriteria(criteria, pageable);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/memberships");
return ResponseEntity.ok().headers(headers).body(page.getContent());
}
/**
* GET /memberships/count : count all the memberships.
*
* @param criteria the criterias which the requested entities should match
* @return the ResponseEntity with status 200 (OK) and the count in body
*/
@GetMapping("/memberships/count")
public ResponseEntity<Long> countMemberships(MembershipCriteria criteria) {
log.debug("REST request to count Memberships by criteria: {}", criteria);
return ResponseEntity.ok().body(membershipQueryService.countByCriteria(criteria));
}
/**
* GET /memberships/:id : get the "id" membership.
*
* @param id the id of the membershipDTO to retrieve
* @return the ResponseEntity with status 200 (OK) and with body the membershipDTO, or with status 404 (Not Found)
*/
@GetMapping("/memberships/{id}")
public ResponseEntity<MembershipDTO> getMembership(@PathVariable Long id) {
log.debug("REST request to get Membership : {}", id);
Optional<MembershipDTO> membershipDTO = membershipService.findOne(id);
return ResponseUtil.wrapOrNotFound(membershipDTO);
}
/**
* DELETE /memberships/:id : delete the "id" membership.
*
* @param id the id of the membershipDTO to delete
* @return the ResponseEntity with status 200 (OK)
*/
@DeleteMapping("/memberships/{id}")
public ResponseEntity<Void> deleteMembership(@PathVariable Long id) {
log.debug("REST request to delete Membership : {}", id);
membershipService.delete(id);
return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();
}
}

View File

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

View File

@ -0,0 +1,138 @@
package org.hostsharing.hsadminng.web.rest;
import org.hostsharing.hsadminng.service.ShareService;
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.ShareDTO;
import org.hostsharing.hsadminng.service.dto.ShareCriteria;
import org.hostsharing.hsadminng.service.ShareQueryService;
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 Share.
*/
@RestController
@RequestMapping("/api")
public class ShareResource {
private final Logger log = LoggerFactory.getLogger(ShareResource.class);
private static final String ENTITY_NAME = "share";
private final ShareService shareService;
private final ShareQueryService shareQueryService;
public ShareResource(ShareService shareService, ShareQueryService shareQueryService) {
this.shareService = shareService;
this.shareQueryService = shareQueryService;
}
/**
* POST /shares : Create a new share.
*
* @param shareDTO the shareDTO to create
* @return the ResponseEntity with status 201 (Created) and with body the new shareDTO, or with status 400 (Bad Request) if the share has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/shares")
public ResponseEntity<ShareDTO> createShare(@Valid @RequestBody ShareDTO shareDTO) throws URISyntaxException {
log.debug("REST request to save Share : {}", shareDTO);
if (shareDTO.getId() != null) {
throw new BadRequestAlertException("A new share cannot already have an ID", ENTITY_NAME, "idexists");
}
ShareDTO result = shareService.save(shareDTO);
return ResponseEntity.created(new URI("/api/shares/" + result.getId()))
.headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))
.body(result);
}
/**
* PUT /shares : Updates an existing share.
*
* @param shareDTO the shareDTO to update
* @return the ResponseEntity with status 200 (OK) and with body the updated shareDTO,
* or with status 400 (Bad Request) if the shareDTO is not valid,
* or with status 500 (Internal Server Error) if the shareDTO couldn't be updated
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PutMapping("/shares")
public ResponseEntity<ShareDTO> updateShare(@Valid @RequestBody ShareDTO shareDTO) throws URISyntaxException {
log.debug("REST request to update Share : {}", shareDTO);
if (shareDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
ShareDTO result = shareService.save(shareDTO);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, shareDTO.getId().toString()))
.body(result);
}
/**
* GET /shares : get all the shares.
*
* @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 shares in body
*/
@GetMapping("/shares")
public ResponseEntity<List<ShareDTO>> getAllShares(ShareCriteria criteria, Pageable pageable) {
log.debug("REST request to get Shares by criteria: {}", criteria);
Page<ShareDTO> page = shareQueryService.findByCriteria(criteria, pageable);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/shares");
return ResponseEntity.ok().headers(headers).body(page.getContent());
}
/**
* GET /shares/count : count all the shares.
*
* @param criteria the criterias which the requested entities should match
* @return the ResponseEntity with status 200 (OK) and the count in body
*/
@GetMapping("/shares/count")
public ResponseEntity<Long> countShares(ShareCriteria criteria) {
log.debug("REST request to count Shares by criteria: {}", criteria);
return ResponseEntity.ok().body(shareQueryService.countByCriteria(criteria));
}
/**
* GET /shares/:id : get the "id" share.
*
* @param id the id of the shareDTO to retrieve
* @return the ResponseEntity with status 200 (OK) and with body the shareDTO, or with status 404 (Not Found)
*/
@GetMapping("/shares/{id}")
public ResponseEntity<ShareDTO> getShare(@PathVariable Long id) {
log.debug("REST request to get Share : {}", id);
Optional<ShareDTO> shareDTO = shareService.findOne(id);
return ResponseUtil.wrapOrNotFound(shareDTO);
}
/**
* DELETE /shares/:id : delete the "id" share.
*
* @param id the id of the shareDTO to delete
* @return the ResponseEntity with status 200 (OK)
*/
@DeleteMapping("/shares/{id}")
public ResponseEntity<Void> deleteShare(@PathVariable Long id) {
log.debug("REST request to delete Share : {}", id);
shareService.delete(id);
return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();
}
}