Compare commits

..

No commits in common. "3998341a5b75c8cbb7c92cdaa51a97967ebc99c0" and "5051198e00e35d373a42859ef118b5c2cfd6556d" have entirely different histories.

7 changed files with 3 additions and 125 deletions

View File

@ -35,8 +35,6 @@ public class HsOfficePersonEntity implements RbacObject, 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);
@ -50,12 +48,6 @@ public class HsOfficePersonEntity implements RbacObject, 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;
@ -76,7 +68,7 @@ public class HsOfficePersonEntity implements RbacObject, Stringifyable {
public static RbacView rbac() {
return rbacViewFor("person", HsOfficePersonEntity.class)
.withIdentityView(SQL.projection("concat(tradeName, familyName, givenName)"))
.withUpdatableColumns("personType", "title", "salutation", "tradeName", "givenName", "familyName")
.withUpdatableColumns("personType", "tradeName", "givenName", "familyName")
.toRole("global", GUEST).grantPermission(INSERT)
.createRole(OWNER, (with) -> {

View File

@ -22,8 +22,6 @@ 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);
}

View File

@ -23,10 +23,6 @@ components:
$ref: '#/components/schemas/HsOfficePersonType'
tradeName:
type: string
salutation:
type: string
title:
type: string
givenName:
type: string
familyName:
@ -39,10 +35,6 @@ components:
$ref: '#/components/schemas/HsOfficePersonType'
tradeName:
type: string
salutation:
type: string
title:
type: string
givenName:
type: string
familyName:
@ -59,12 +51,6 @@ components:
tradeName:
type: string
nullable: true
salutation:
type: string
nullable: true
title:
type: string
nullable: true
givenName:
type: string
nullable: true

View File

@ -19,8 +19,6 @@ 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)
);

View File

@ -138,8 +138,6 @@ call generateRbacRestrictedView('hs_office_person',
$orderBy$,
$updates$
personType = new.personType,
title = new.title,
salutation = new.salutation,
tradeName = new.tradeName,
givenName = new.givenName,
familyName = new.familyName

View File

@ -23,9 +23,7 @@ class HsOfficePersonEntityPatcherUnitTest extends PatchUnitTestBase<
final var entity = new HsOfficePersonEntity();
entity.setUuid(INITIAL_PERSON_UUID);
entity.setPersonType(HsOfficePersonType.LEGAL_PERSON);
entity.setTradeName("initial trade name");
entity.setTitle("Dr. Init.");
entity.setSalutation("Herr Initial");
entity.setTradeName("initial@example.org");
entity.setFamilyName("initial postal address");
entity.setGivenName("+01 100 123456789");
return entity;
@ -56,16 +54,6 @@ class HsOfficePersonEntityPatcherUnitTest extends PatchUnitTestBase<
HsOfficePersonPatchResource::setTradeName,
"patched trade name",
HsOfficePersonEntity::setTradeName),
new JsonNullableProperty<>(
"title",
HsOfficePersonPatchResource::setTitle,
"Dr. Patch.",
HsOfficePersonEntity::setTitle),
new JsonNullableProperty<>(
"salutation",
HsOfficePersonPatchResource::setSalutation,
"Hallo Ini",
HsOfficePersonEntity::setSalutation),
new JsonNullableProperty<>(
"familyName",
HsOfficePersonPatchResource::setFamilyName,

View File

@ -60,63 +60,19 @@ class HsOfficePersonEntityUnitTest {
assertThat(actualDisplay).isEqualTo("NP some family name, some given name");
}
@Test
void toShortStringWithSalutationAndTitleReturnsSalutationAndTitle() {
final var givenPersonEntity = HsOfficePersonEntity.builder()
.personType(HsOfficePersonType.NATURAL_PERSON)
.salutation("Frau")
.title("Dr.")
.familyName("some family name")
.givenName("some given name")
.build();
final var actualDisplay = givenPersonEntity.toShortString();
assertThat(actualDisplay).isEqualTo("NP some family name, some given name");
}
@Test
void toShortStringWithSalutationAndWithoutTitleReturnsSalutation() {
final var givenPersonEntity = HsOfficePersonEntity.builder()
.personType(HsOfficePersonType.NATURAL_PERSON)
.salutation("Frau")
.familyName("some family name")
.givenName("some given name")
.build();
final var actualDisplay = givenPersonEntity.toShortString();
assertThat(actualDisplay).isEqualTo("NP Frau some family name, some given name");
}
@Test
void toShortStringWithoutSalutationAndWithTitleReturnsTitle() {
final var givenPersonEntity = HsOfficePersonEntity.builder()
.personType(HsOfficePersonType.NATURAL_PERSON)
.title("Dr. Dr.")
.familyName("some family name")
.givenName("some given name")
.build();
final var actualDisplay = givenPersonEntity.toShortString();
assertThat(actualDisplay).isEqualTo("NP some family name, some given name");
}
@Test
void toStringWithAllFieldsReturnsAllButUuid() {
final var givenPersonEntity = HsOfficePersonEntity.builder()
.uuid(UUID.randomUUID())
.personType(HsOfficePersonType.NATURAL_PERSON)
.tradeName("some trade name")
.title("Dr.")
.familyName("some family name")
.givenName("some given name")
.build();
final var actualDisplay = givenPersonEntity.toString();
assertThat(actualDisplay).isEqualTo("person(personType='NP', tradeName='some trade name', title='Dr.', familyName='some family name', givenName='some given name')");
assertThat(actualDisplay).isEqualTo("person(personType='NP', tradeName='some trade name', familyName='some family name', givenName='some given name')");
}
@Test
@ -130,42 +86,4 @@ class HsOfficePersonEntityUnitTest {
assertThat(actualDisplay).isEqualTo("person(familyName='some family name', givenName='some given name')");
}
@Test
void toStringWithSalutationAndTitleRetursSalutationAndTitle() {
final var givenPersonEntity = HsOfficePersonEntity.builder()
.salutation("Herr")
.title("Prof. Dr.")
.familyName("some family name")
.givenName("some given name")
.build();
final var actualDisplay = givenPersonEntity.toString();
assertThat(actualDisplay).isEqualTo("person(salutation='Herr', title='Prof. Dr.', familyName='some family name', givenName='some given name')");
}
@Test
void toStringWithSalutationAndWithoutTitleSkipsTitle() {
final var givenPersonEntity = HsOfficePersonEntity.builder()
.salutation("Herr")
.familyName("some family name")
.givenName("some given name")
.build();
final var actualDisplay = givenPersonEntity.toString();
assertThat(actualDisplay).isEqualTo("person(salutation='Herr', familyName='some family name', givenName='some given name')");
}
@Test
void toStringWithoutSalutationAndWithTitleSkipsSalutation() {
final var givenPersonEntity = HsOfficePersonEntity.builder()
.title("some title")
.familyName("some family name")
.givenName("some given name")
.build();
final var actualDisplay = givenPersonEntity.toString();
assertThat(actualDisplay).isEqualTo("person(title='some title', familyName='some family name', givenName='some given name')");
}
}