1
0

added name+address+salutation to customer

This commit is contained in:
Michael Hoennig
2019-04-04 09:19:50 +02:00
parent 1e7b801e22
commit d787544ebf
16 changed files with 723 additions and 9 deletions

View File

@ -36,6 +36,28 @@ public class Customer implements Serializable {
@Column(name = "prefix", nullable = false, unique = true)
private String prefix;
@NotNull
@Size(max = 80)
@Column(name = "name", length = 80, nullable = false)
private String name;
@NotNull
@Size(max = 400)
@Column(name = "contractual_address", length = 400, nullable = false)
private String contractualAddress;
@Size(max = 80)
@Column(name = "contractual_salutation", length = 80)
private String contractualSalutation;
@Size(max = 400)
@Column(name = "billing_address", length = 400)
private String billingAddress;
@Size(max = 80)
@Column(name = "billing_salutation", length = 80)
private String billingSalutation;
@OneToMany(mappedBy = "customer")
private Set<Membership> memberships = new HashSet<>();
@OneToMany(mappedBy = "customer")
@ -75,6 +97,71 @@ public class Customer implements Serializable {
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 String getContractualAddress() {
return contractualAddress;
}
public Customer contractualAddress(String contractualAddress) {
this.contractualAddress = contractualAddress;
return this;
}
public void setContractualAddress(String contractualAddress) {
this.contractualAddress = contractualAddress;
}
public String getContractualSalutation() {
return contractualSalutation;
}
public Customer contractualSalutation(String contractualSalutation) {
this.contractualSalutation = contractualSalutation;
return this;
}
public void setContractualSalutation(String contractualSalutation) {
this.contractualSalutation = contractualSalutation;
}
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 getBillingSalutation() {
return billingSalutation;
}
public Customer billingSalutation(String billingSalutation) {
this.billingSalutation = billingSalutation;
return this;
}
public void setBillingSalutation(String billingSalutation) {
this.billingSalutation = billingSalutation;
}
public Set<Membership> getMemberships() {
return memberships;
}
@ -152,6 +239,11 @@ public class Customer implements Serializable {
"id=" + getId() +
", number=" + getNumber() +
", prefix='" + getPrefix() + "'" +
", name='" + getName() + "'" +
", contractualAddress='" + getContractualAddress() + "'" +
", contractualSalutation='" + getContractualSalutation() + "'" +
", billingAddress='" + getBillingAddress() + "'" +
", billingSalutation='" + getBillingSalutation() + "'" +
"}";
}
}

View File

@ -95,6 +95,21 @@ public class CustomerQueryService extends QueryService<Customer> {
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.getContractualAddress() != null) {
specification = specification.and(buildStringSpecification(criteria.getContractualAddress(), Customer_.contractualAddress));
}
if (criteria.getContractualSalutation() != null) {
specification = specification.and(buildStringSpecification(criteria.getContractualSalutation(), Customer_.contractualSalutation));
}
if (criteria.getBillingAddress() != null) {
specification = specification.and(buildStringSpecification(criteria.getBillingAddress(), Customer_.billingAddress));
}
if (criteria.getBillingSalutation() != null) {
specification = specification.and(buildStringSpecification(criteria.getBillingSalutation(), Customer_.billingSalutation));
}
if (criteria.getMembershipId() != null) {
specification = specification.and(buildSpecification(criteria.getMembershipId(),
root -> root.join(Customer_.memberships, JoinType.LEFT).get(Membership_.id)));

View File

@ -28,6 +28,16 @@ public class CustomerCriteria implements Serializable {
private StringFilter prefix;
private StringFilter name;
private StringFilter contractualAddress;
private StringFilter contractualSalutation;
private StringFilter billingAddress;
private StringFilter billingSalutation;
private LongFilter membershipId;
private LongFilter roleId;
@ -56,6 +66,46 @@ public class CustomerCriteria implements Serializable {
this.prefix = prefix;
}
public StringFilter getName() {
return name;
}
public void setName(StringFilter name) {
this.name = name;
}
public StringFilter getContractualAddress() {
return contractualAddress;
}
public void setContractualAddress(StringFilter contractualAddress) {
this.contractualAddress = contractualAddress;
}
public StringFilter getContractualSalutation() {
return contractualSalutation;
}
public void setContractualSalutation(StringFilter contractualSalutation) {
this.contractualSalutation = contractualSalutation;
}
public StringFilter getBillingAddress() {
return billingAddress;
}
public void setBillingAddress(StringFilter billingAddress) {
this.billingAddress = billingAddress;
}
public StringFilter getBillingSalutation() {
return billingSalutation;
}
public void setBillingSalutation(StringFilter billingSalutation) {
this.billingSalutation = billingSalutation;
}
public LongFilter getMembershipId() {
return membershipId;
}
@ -86,6 +136,11 @@ public class CustomerCriteria implements Serializable {
Objects.equals(id, that.id) &&
Objects.equals(number, that.number) &&
Objects.equals(prefix, that.prefix) &&
Objects.equals(name, that.name) &&
Objects.equals(contractualAddress, that.contractualAddress) &&
Objects.equals(contractualSalutation, that.contractualSalutation) &&
Objects.equals(billingAddress, that.billingAddress) &&
Objects.equals(billingSalutation, that.billingSalutation) &&
Objects.equals(membershipId, that.membershipId) &&
Objects.equals(roleId, that.roleId);
}
@ -96,6 +151,11 @@ public class CustomerCriteria implements Serializable {
id,
number,
prefix,
name,
contractualAddress,
contractualSalutation,
billingAddress,
billingSalutation,
membershipId,
roleId
);
@ -107,6 +167,11 @@ public class CustomerCriteria implements Serializable {
(id != null ? "id=" + id + ", " : "") +
(number != null ? "number=" + number + ", " : "") +
(prefix != null ? "prefix=" + prefix + ", " : "") +
(name != null ? "name=" + name + ", " : "") +
(contractualAddress != null ? "contractualAddress=" + contractualAddress + ", " : "") +
(contractualSalutation != null ? "contractualSalutation=" + contractualSalutation + ", " : "") +
(billingAddress != null ? "billingAddress=" + billingAddress + ", " : "") +
(billingSalutation != null ? "billingSalutation=" + billingSalutation + ", " : "") +
(membershipId != null ? "membershipId=" + membershipId + ", " : "") +
(roleId != null ? "roleId=" + roleId + ", " : "") +
"}";

View File

@ -19,6 +19,23 @@ public class CustomerDTO implements Serializable {
@Pattern(regexp = "[a-z][a-z0-9]+")
private String prefix;
@NotNull
@Size(max = 80)
private String name;
@NotNull
@Size(max = 400)
private String contractualAddress;
@Size(max = 80)
private String contractualSalutation;
@Size(max = 400)
private String billingAddress;
@Size(max = 80)
private String billingSalutation;
public Long getId() {
return id;
@ -44,6 +61,46 @@ public class CustomerDTO implements Serializable {
this.prefix = prefix;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getContractualAddress() {
return contractualAddress;
}
public void setContractualAddress(String contractualAddress) {
this.contractualAddress = contractualAddress;
}
public String getContractualSalutation() {
return contractualSalutation;
}
public void setContractualSalutation(String contractualSalutation) {
this.contractualSalutation = contractualSalutation;
}
public String getBillingAddress() {
return billingAddress;
}
public void setBillingAddress(String billingAddress) {
this.billingAddress = billingAddress;
}
public String getBillingSalutation() {
return billingSalutation;
}
public void setBillingSalutation(String billingSalutation) {
this.billingSalutation = billingSalutation;
}
@Override
public boolean equals(Object o) {
if (this == o) {
@ -71,6 +128,11 @@ public class CustomerDTO implements Serializable {
"id=" + getId() +
", number=" + getNumber() +
", prefix='" + getPrefix() + "'" +
", name='" + getName() + "'" +
", contractualAddress='" + getContractualAddress() + "'" +
", contractualSalutation='" + getContractualSalutation() + "'" +
", billingAddress='" + getBillingAddress() + "'" +
", billingSalutation='" + getBillingSalutation() + "'" +
"}";
}
}

View File

@ -6,6 +6,11 @@ paginate all with infinite-scroll
entity Customer {
number Integer required unique min(10000) max(99999),
prefix String required unique pattern(/[a-z][a-z0-9]+/),
name String required maxlength(80),
contractualAddress String required maxlength(400),
contractualSalutation String maxlength(80),
billingAddress String maxlength(400),
billingSalutation String maxlength(80)
}
entity Contact {
@ -14,7 +19,6 @@ entity Contact {
email String required maxlength(80)
}
enum CustomerContactRole {
CONTRACTUAL,
TECHNICAL,

View File

@ -29,6 +29,26 @@
<constraints nullable="false" unique="true" uniqueConstraintName="ux_customer_prefix" />
</column>
<column name="name" type="varchar(80)">
<constraints nullable="false" />
</column>
<column name="contractual_address" type="varchar(400)">
<constraints nullable="false" />
</column>
<column name="contractual_salutation" type="varchar(80)">
<constraints nullable="true" />
</column>
<column name="billing_address" type="varchar(400)">
<constraints nullable="true" />
</column>
<column name="billing_salutation" type="varchar(80)">
<constraints nullable="true" />
</column>
<!-- jhipster-needle-liquibase-add-column - JHipster will add columns here, do not remove-->
</createTable>

View File

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

View File

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

View File

@ -17,6 +17,11 @@
<th jhiSortBy="id"><span jhiTranslate="global.field.id">ID</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th jhiSortBy="number"><span jhiTranslate="hsadminNgApp.customer.number">Number</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th jhiSortBy="prefix"><span jhiTranslate="hsadminNgApp.customer.prefix">Prefix</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th jhiSortBy="name"><span jhiTranslate="hsadminNgApp.customer.name">Name</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th jhiSortBy="contractualAddress"><span jhiTranslate="hsadminNgApp.customer.contractualAddress">Contractual Address</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th jhiSortBy="contractualSalutation"><span jhiTranslate="hsadminNgApp.customer.contractualSalutation">Contractual Salutation</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th jhiSortBy="billingAddress"><span jhiTranslate="hsadminNgApp.customer.billingAddress">Billing Address</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th jhiSortBy="billingSalutation"><span jhiTranslate="hsadminNgApp.customer.billingSalutation">Billing Salutation</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th></th>
</tr>
</thead>
@ -25,6 +30,11 @@
<td><a [routerLink]="['/customer', customer.id, 'view' ]">{{customer.id}}</a></td>
<td>{{customer.number}}</td>
<td>{{customer.prefix}}</td>
<td>{{customer.name}}</td>
<td>{{customer.contractualAddress}}</td>
<td>{{customer.contractualSalutation}}</td>
<td>{{customer.billingAddress}}</td>
<td>{{customer.billingSalutation}}</td>
<td class="text-right">
<div class="btn-group flex-btn-group-container">
<button type="submit"

View File

@ -27,6 +27,14 @@ import { RouterModule } from '@angular/router';
{
path: 'asset',
loadChildren: './asset/asset.module#HsadminNgAssetModule'
},
{
path: 'customer',
loadChildren: './customer/customer.module#HsadminNgCustomerModule'
},
{
path: 'customer',
loadChildren: './customer/customer.module#HsadminNgCustomerModule'
}
/* jhipster-needle-add-entity-route - JHipster will add entity modules routes here */
])

View File

@ -5,6 +5,11 @@ export interface ICustomer {
id?: number;
number?: number;
prefix?: string;
name?: string;
contractualAddress?: string;
contractualSalutation?: string;
billingAddress?: string;
billingSalutation?: string;
memberships?: IMembership[];
roles?: ICustomerContact[];
}
@ -14,6 +19,11 @@ export class Customer implements ICustomer {
public id?: number,
public number?: number,
public prefix?: string,
public name?: string,
public contractualAddress?: string,
public contractualSalutation?: string,
public billingAddress?: string,
public billingSalutation?: string,
public memberships?: IMembership[],
public roles?: ICustomerContact[]
) {}

View File

@ -17,6 +17,11 @@
},
"number": "Number",
"prefix": "Prefix",
"name": "Name",
"contractualAddress": "Contractual Address",
"contractualSalutation": "Contractual Salutation",
"billingAddress": "Billing Address",
"billingSalutation": "Billing Salutation",
"membership": "Membership",
"role": "Role"
}

View File

@ -17,6 +17,11 @@
},
"number": "Number",
"prefix": "Prefix",
"name": "Name",
"contractualAddress": "Contractual Address",
"contractualSalutation": "Contractual Salutation",
"billingAddress": "Billing Address",
"billingSalutation": "Billing Salutation",
"membership": "Membership",
"role": "Role"
}