add-salut-and-title-to-person #25
@ -27,6 +27,8 @@ public class HsOfficePersonEntity implements HasUuid, Stringifyable {
|
||||
private static Stringify<HsOfficePersonEntity> toString = stringify(HsOfficePersonEntity.class, "person")
|
||||
.withProp(Fields.personType, HsOfficePersonEntity::getPersonType)
|
||||
.withProp(Fields.tradeName, HsOfficePersonEntity::getTradeName)
|
||||
.withProp(Fields.salutation, HsOfficePersonEntity::getSalutation)
|
||||
.withProp(Fields.title, HsOfficePersonEntity::getTitle)
|
||||
.withProp(Fields.familyName, HsOfficePersonEntity::getFamilyName)
|
||||
.withProp(Fields.givenName, HsOfficePersonEntity::getGivenName);
|
||||
|
||||
@ -40,6 +42,12 @@ public class HsOfficePersonEntity implements HasUuid, Stringifyable {
|
||||
@Column(name = "tradename")
|
||||
private String tradeName;
|
||||
|
||||
@Column(name = "salutation")
|
||||
private String salutation;
|
||||
|
||||
@Column(name = "title")
|
||||
private String title;
|
||||
|
||||
@Column(name = "familyname")
|
||||
private String familyName;
|
||||
|
||||
@ -54,6 +62,6 @@ public class HsOfficePersonEntity implements HasUuid, Stringifyable {
|
||||
@Override
|
||||
public String toShortString() {
|
||||
return personType + " " +
|
||||
(!StringUtils.isEmpty(tradeName) ? tradeName : (familyName + ", " + givenName));
|
||||
(!StringUtils.isEmpty(tradeName) ? tradeName : (StringUtils.isEmpty(salutation) ? "" : salutation + " ") + (familyName + ", " + givenName));
|
||||
hsh-michaelhoennig marked this conversation as resolved
Outdated
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,8 @@ class HsOfficePersonEntityPatcher implements EntityPatcher<HsOfficePersonPatchRe
|
||||
.map(HsOfficePersonType::valueOf)
|
||||
.ifPresent(entity::setPersonType);
|
||||
OptionalFromJson.of(resource.getTradeName()).ifPresent(entity::setTradeName);
|
||||
OptionalFromJson.of(resource.getSalutation()).ifPresent(entity::setSalutation);
|
||||
OptionalFromJson.of(resource.getTitle()).ifPresent(entity::setTitle);
|
||||
OptionalFromJson.of(resource.getFamilyName()).ifPresent(entity::setFamilyName);
|
||||
OptionalFromJson.of(resource.getGivenName()).ifPresent(entity::setGivenName);
|
||||
}
|
||||
|
@ -23,6 +23,10 @@ components:
|
||||
$ref: '#/components/schemas/HsOfficePersonType'
|
||||
tradeName:
|
||||
type: string
|
||||
salutation:
|
||||
type: string
|
||||
title:
|
||||
type: string
|
||||
givenName:
|
||||
type: string
|
||||
familyName:
|
||||
@ -35,6 +39,10 @@ components:
|
||||
$ref: '#/components/schemas/HsOfficePersonType'
|
||||
tradeName:
|
||||
type: string
|
||||
salutation:
|
||||
type: string
|
||||
title:
|
||||
type: string
|
||||
givenName:
|
||||
type: string
|
||||
familyName:
|
||||
@ -51,6 +59,12 @@ components:
|
||||
tradeName:
|
||||
type: string
|
||||
nullable: true
|
||||
salutation:
|
||||
type: string
|
||||
nullable: true
|
||||
title:
|
||||
type: string
|
||||
nullable: true
|
||||
givenName:
|
||||
type: string
|
||||
nullable: true
|
||||
|
@ -19,6 +19,8 @@ create table if not exists hs_office_person
|
||||
uuid uuid unique references RbacObject (uuid) initially deferred,
|
||||
personType HsOfficePersonType not null,
|
||||
tradeName varchar(96),
|
||||
salutation varchar(30),
|
||||
title varchar(20),
|
||||
givenName varchar(48),
|
||||
familyName varchar(48)
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user
hier nicht, der soll so kurz wie möglich sein