import title and salutation for person

This commit is contained in:
Timotheus Pokorra 2024-11-11 16:47:12 +01:00 committed by Dev und Test fuer hsadminng
commit 5f6e4da28d
50 changed files with 349 additions and 216 deletions

View File

@ -77,7 +77,6 @@ public class HsOfficeCoopAssetsTransactionController implements HsOfficeCoopAsse
@Override @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
public ResponseEntity<HsOfficeCoopAssetsTransactionResource> getCoopAssetTransactionByUuid( public ResponseEntity<HsOfficeCoopAssetsTransactionResource> getCoopAssetTransactionByUuid(
final String currentSubject, final String assumedRoles, final UUID assetTransactionUuid) { final String currentSubject, final String assumedRoles, final UUID assetTransactionUuid) {

View File

@ -34,8 +34,8 @@ public class HsOfficeMembershipController implements HsOfficeMembershipsApi {
public ResponseEntity<List<HsOfficeMembershipResource>> listMemberships( public ResponseEntity<List<HsOfficeMembershipResource>> listMemberships(
final String currentSubject, final String currentSubject,
final String assumedRoles, final String assumedRoles,
UUID partnerUuid, final UUID partnerUuid,
Integer memberNumber) { final Integer memberNumber) {
context.define(currentSubject, assumedRoles); context.define(currentSubject, assumedRoles);
final var entities = ( memberNumber != null) final var entities = ( memberNumber != null)

View File

@ -52,11 +52,11 @@ components:
HsBookingItemInsert: HsBookingItemInsert:
type: object type: object
properties: properties:
projectUuid: project.uuid:
type: string type: string
format: uuid format: uuid
nullable: false nullable: false
parentItemUuid: parentItem.uuid:
type: string type: string
format: uuid format: uuid
nullable: false nullable: false
@ -77,7 +77,7 @@ components:
$ref: '../hs-hosting/hs-hosting-asset-schemas.yaml#/components/schemas/HsHostingAssetAutoInsert' $ref: '../hs-hosting/hs-hosting-asset-schemas.yaml#/components/schemas/HsHostingAssetAutoInsert'
required: required:
- caption - caption
- projectUuid - project.uuid
- validFrom - validFrom
- resources - resources
additionalProperties: false additionalProperties: false

View File

@ -25,7 +25,7 @@ components:
HsBookingProjectInsert: HsBookingProjectInsert:
type: object type: object
properties: properties:
debitorUuid: debitor.uuid:
type: string type: string
format: uuid format: uuid
nullable: false nullable: false
@ -35,6 +35,6 @@ components:
maxLength: 80 maxLength: 80
nullable: false nullable: false
required: required:
- debitorUuid - debitor.uuid
- caption - caption
additionalProperties: false additionalProperties: false

View File

@ -54,7 +54,7 @@ components:
caption: caption:
type: string type: string
nullable: true nullable: true
alarmContactUuid: alarmContact.uuid:
type: string type: string
format: uuid format: uuid
nullable: true nullable: true
@ -64,11 +64,11 @@ components:
HsHostingAssetInsert: HsHostingAssetInsert:
type: object type: object
properties: properties:
bookingItemUuid: bookingItem.uuid:
type: string type: string
format: uuid format: uuid
nullable: true nullable: true
parentAssetUuid: parentAsset.uuid:
type: string type: string
format: uuid format: uuid
nullable: true nullable: true
@ -84,7 +84,7 @@ components:
minLength: 3 minLength: 3
maxLength: 80 maxLength: 80
nullable: false nullable: false
alarmContactUuid: alarmContact.uuid:
type: string type: string
format: uuid format: uuid
nullable: true nullable: true
@ -99,11 +99,11 @@ components:
HsHostingAssetAutoInsert: HsHostingAssetAutoInsert:
type: object type: object
properties: properties:
parentAssetUuid: parentAsset.uuid:
type: string type: string
format: uuid format: uuid
nullable: true nullable: true
assignedToAssetUuid: assignedToAsset.uuid:
type: string type: string
format: uuid format: uuid
type: type:
@ -118,7 +118,7 @@ components:
minLength: 3 minLength: 3
maxLength: 80 maxLength: 80
nullable: false nullable: false
alarmContactUuid: alarmContact.uuid:
type: string type: string
format: uuid format: uuid
nullable: true nullable: true
@ -147,10 +147,10 @@ components:
minLength: 3 minLength: 3
maxLength: 80 maxLength: 80
nullable: false nullable: false
assignedToAssetUuid: assignedToAsset.uuid:
type: string type: string
format: uuid format: uuid
alarmContactUuid: alarmContact.uuid:
type: string type: string
format: uuid format: uuid
nullable: true nullable: true

View File

@ -62,7 +62,7 @@ components:
HsOfficeCoopAssetsTransactionInsert: HsOfficeCoopAssetsTransactionInsert:
type: object type: object
properties: properties:
membershipUuid: membership.uuid:
type: string type: string
format: uuid format: uuid
nullable: false nullable: false
@ -80,11 +80,11 @@ components:
maxLength: 48 maxLength: 48
comment: comment:
type: string type: string
reverseEntryUuid: reverseEntry.uuid:
type: string type: string
format: uuid format: uuid
required: required:
- membershipUuid - membership.uuid
- transactionType - transactionType
- assetValue - assetValue
- valueDate - valueDate

View File

@ -56,7 +56,7 @@ components:
HsOfficeCoopSharesTransactionInsert: HsOfficeCoopSharesTransactionInsert:
type: object type: object
properties: properties:
membershipUuid: membership.uuid:
type: string type: string
format: uuid format: uuid
nullable: false nullable: false
@ -73,11 +73,11 @@ components:
maxLength: 48 maxLength: 48
comment: comment:
type: string type: string
adjustedShareTxUuid: adjustedShareTx.uuid:
type: string type: string
format: uuid format: uuid
required: required:
- membershipUuid - membership.uuid
- transactionType - transactionType
- shareCount - shareCount
- valueDate - valueDate

View File

@ -41,7 +41,7 @@ components:
HsOfficeDebitorPatch: HsOfficeDebitorPatch:
type: object type: object
properties: properties:
debitorRelUuid: debitorRel.uuid:
type: string type: string
format: uuid format: uuid
nullable: true nullable: true
@ -61,7 +61,7 @@ components:
vatReverseCharge: vatReverseCharge:
type: boolean type: boolean
nullable: false nullable: false
refundBankAccountUuid: refundBankAccount.uuid:
type: string type: string
format: uuid format: uuid
nullable: true nullable: true
@ -75,7 +75,7 @@ components:
properties: properties:
debitorRel: debitorRel:
$ref: 'hs-office-relation-schemas.yaml#/components/schemas/HsOfficeRelationSubInsert' $ref: 'hs-office-relation-schemas.yaml#/components/schemas/HsOfficeRelationSubInsert'
debitorRelUuid: debitorRel.uuid:
type: string type: string
format: uuid format: uuid
debitorNumberSuffix: debitorNumberSuffix:
@ -92,7 +92,7 @@ components:
type: boolean type: boolean
vatReverseCharge: vatReverseCharge:
type: boolean type: boolean
refundBankAccountUuid: refundBankAccount.uuid:
type: string type: string
format: uuid format: uuid
defaultPrefix: defaultPrefix:

View File

@ -62,7 +62,7 @@ components:
HsOfficeMembershipInsert: HsOfficeMembershipInsert:
type: object type: object
properties: properties:
partnerUuid: partner.uuid:
type: string type: string
format: uuid format: uuid
nullable: false nullable: false
@ -86,7 +86,7 @@ components:
nullable: false nullable: false
type: boolean type: boolean
required: required:
- partnerUuid - partner.uuid
- memberNumberSuffix - memberNumberSuffix
- validFrom - validFrom
- membershipFeeBillable - membershipFeeBillable

View File

@ -50,7 +50,7 @@ components:
HsOfficePartnerPatch: HsOfficePartnerPatch:
type: object type: object
properties: properties:
partnerRelUuid: partnerRel.uuid:
type: string type: string
format: uuid format: uuid
nullable: true nullable: true
@ -103,19 +103,19 @@ components:
type: object type: object
nullable: false nullable: false
properties: properties:
anchorUuid: anchor.uuid:
type: string type: string
format: uuid format: uuid
holderUuid: holder.uuid:
type: string type: string
format: uuid format: uuid
contactUuid: contact.uuid:
type: string type: string
format: uuid format: uuid
required: required:
- anchorUuid - anchor.uuid
- holderUuid - holder.uuid
- relContactUuid - relContact.uuid
HsOfficePartnerDetailsInsert: HsOfficePartnerDetailsInsert:
type: object type: object

View File

@ -37,7 +37,7 @@ components:
HsOfficeRelationPatch: HsOfficeRelationPatch:
type: object type: object
properties: properties:
contactUuid: contact.uuid:
type: string type: string
format: uuid format: uuid
nullable: true nullable: true
@ -46,10 +46,10 @@ components:
HsOfficeRelationInsert: HsOfficeRelationInsert:
type: object type: object
properties: properties:
anchorUuid: anchor.uuid:
type: string type: string
format: uuid format: uuid
holderUuid: holder.uuid:
type: string type: string
format: uuid format: uuid
type: type:
@ -58,32 +58,32 @@ components:
mark: mark:
type: string type: string
nullable: true nullable: true
contactUuid: contact.uuid:
type: string type: string
format: uuid format: uuid
required: required:
- anchorUuid - anchor.uuid
- holderUuid - holder.uuid
- type - type
- contactUuid - contact.uuid
# relation created as a sub-element with implicitly known type # relation created as a sub-element with implicitly known type
HsOfficeRelationSubInsert: HsOfficeRelationSubInsert:
type: object type: object
properties: properties:
anchorUuid: anchor.uuid:
type: string type: string
format: uuid format: uuid
holderUuid: holder.uuid:
type: string type: string
format: uuid format: uuid
mark: mark:
type: string type: string
nullable: true nullable: true
contactUuid: contact.uuid:
type: string type: string
format: uuid format: uuid
required: required:
- anchorUuid - anchor.uuid
- holderUuid - holder.uuid
- contactUuid - contact.uuid

View File

@ -48,11 +48,11 @@ components:
HsOfficeSepaMandateInsert: HsOfficeSepaMandateInsert:
type: object type: object
properties: properties:
debitorUuid: debitor.uuid:
type: string type: string
format: uuid format: uuid
nullable: false nullable: false
bankAccountUuid: bankAccount.uuid:
type: string type: string
format: uuid format: uuid
nullable: false nullable: false
@ -72,8 +72,8 @@ components:
format: date format: date
nullable: true nullable: true
required: required:
- debitorUuid - debitor.uuid
- bankAccountUuid - bankAccount.uuid
- reference - reference
- agreement - agreement
- validFrom - validFrom

View File

@ -8,21 +8,21 @@ components:
properties: properties:
grantedByRoleIdName: grantedByRoleIdName:
type: string type: string
grantedByRoleUuid: grantedByRole.uuid:
type: string type: string
format: uuid format: uuid
assumed: assumed:
type: boolean type: boolean
grantedRoleIdName: grantedRoleIdName:
type: string type: string
grantedRoleUuid: grantedRole.uuid:
type: string type: string
format: uuid format: uuid
granteeSubjectName: granteeSubjectName:
type: string type: string
granteeSubjectUuid: granteeSubject.uuid:
type: string type: string
format: uuid format: uuid
required: required:
- grantedRoleUuid - grantedRole.uuid
- granteeSubjectUuid - granteeSubject.uuid

View File

@ -9,7 +9,7 @@ components:
uuid: uuid:
type: string type: string
format: uuid format: uuid
objectUuid: object.uuid:
type: string type: string
format: uuid format: uuid
objectTable: objectTable:

View File

@ -14,7 +14,7 @@ components:
RbacSubjectPermission: RbacSubjectPermission:
type: object type: object
properties: properties:
objectUuid: object.uuid:
type: string type: string
format: uuid format: uuid
objectTable: objectTable:
@ -23,10 +23,10 @@ components:
type: string type: string
roleName: roleName:
type: string type: string
roleUuid: role.uuid:
type: string type: string
format: uuid format: uuid
permissionUuid: permission.uuid:
type: string type: string
format: uuid format: uuid
op: op:

View File

@ -150,7 +150,7 @@ class HsBookingItemControllerAcceptanceTest extends ContextBasedTestWithCleanup
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"projectUuid": "{projectUuid}", "project.uuid": "{projectUuid}",
"type": "MANAGED_SERVER", "type": "MANAGED_SERVER",
"caption": "some new booking", "caption": "some new booking",
"validTo": "{validTo}", "validTo": "{validTo}",
@ -200,8 +200,8 @@ class HsBookingItemControllerAcceptanceTest extends ContextBasedTestWithCleanup
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"projectUuid": "{projectUuid}", "project.uuid": "{projectUuid}",
"parentItemUuid": "{managedServerUuid}", "parentItem.uuid": "{managedServerUuid}",
"type": "MANAGED_WEBSPACE", "type": "MANAGED_WEBSPACE",
"caption": "some managed webspace", "caption": "some managed webspace",
"resources": { "resources": {
@ -270,7 +270,7 @@ class HsBookingItemControllerAcceptanceTest extends ContextBasedTestWithCleanup
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"projectUuid": "{projectUuid}", "project.uuid": "{projectUuid}",
"type": "DOMAIN_SETUP", "type": "DOMAIN_SETUP",
"caption": "Domain-Setup for example.org", "caption": "Domain-Setup for example.org",
"resources": { "resources": {
@ -285,7 +285,7 @@ class HsBookingItemControllerAcceptanceTest extends ContextBasedTestWithCleanup
}, },
{ {
"type": "DOMAIN_HTTP_SETUP", "type": "DOMAIN_HTTP_SETUP",
"assignedToAssetUuid": "{unixUserUuid}" "assignedToAsset.uuid": "{unixUserUuid}"
}, },
{ {
"type": "DOMAIN_MBOX_SETUP" "type": "DOMAIN_MBOX_SETUP"
@ -360,7 +360,7 @@ class HsBookingItemControllerAcceptanceTest extends ContextBasedTestWithCleanup
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"projectUuid": "{projectUuid}", "project.uuid": "{projectUuid}",
"type": "DOMAIN_SETUP", "type": "DOMAIN_SETUP",
"caption": "some new domain-setup booking", "caption": "some new domain-setup booking",
"resources": { "resources": {
@ -375,7 +375,7 @@ class HsBookingItemControllerAcceptanceTest extends ContextBasedTestWithCleanup
}, },
{ {
"type": "DOMAIN_HTTP_SETUP", "type": "DOMAIN_HTTP_SETUP",
"assignedToAssetUuid": "{unixUserUuid}" "assignedToAsset.uuid": "{unixUserUuid}"
}, },
{ {
"type": "DOMAIN_MBOX_SETUP" "type": "DOMAIN_MBOX_SETUP"

View File

@ -105,7 +105,7 @@ class HsBookingItemControllerRestTest {
.contentType(MediaType.APPLICATION_JSON) .contentType(MediaType.APPLICATION_JSON)
.content(""" .content("""
{ {
"projectUuid": "{projectUuid}", "project.uuid": "{projectUuid}",
"type": "MANAGED_SERVER", "type": "MANAGED_SERVER",
"caption": "some new booking", "caption": "some new booking",
"validTo": "{validTo}", "validTo": "{validTo}",
@ -155,7 +155,7 @@ class HsBookingItemControllerRestTest {
.contentType(MediaType.APPLICATION_JSON) .contentType(MediaType.APPLICATION_JSON)
.content(""" .content("""
{ {
"projectUuid": "{projectUuid}", "project.uuid": "{projectUuid}",
"type": "MANAGED_SERVER", "type": "MANAGED_SERVER",
"caption": "some new booking", "caption": "some new booking",
"validFrom": "{validFrom}", "validFrom": "{validFrom}",

View File

@ -92,7 +92,7 @@ class HsBookingProjectControllerAcceptanceTest extends ContextBasedTestWithClean
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"debitorUuid": "%s", "debitor.uuid": "%s",
"caption": "some new project" "caption": "some new project"
} }
""".formatted(givenDebitor.getUuid())) """.formatted(givenDebitor.getUuid()))

View File

@ -165,10 +165,10 @@ class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"bookingItemUuid": "%s", "bookingItem.uuid": "%s",
"type": "MANAGED_WEBSPACE", "type": "MANAGED_WEBSPACE",
"identifier": "fir10", "identifier": "fir10",
"parentAssetUuid": "%s", "parentAsset.uuid": "%s",
"caption": "some separate ManagedWebspace HA", "caption": "some separate ManagedWebspace HA",
"config": {} "config": {}
} }
@ -227,7 +227,7 @@ class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"parentAssetUuid": "%s", "parentAsset.uuid": "%s",
"type": "UNIX_USER", "type": "UNIX_USER",
"identifier": "fir01-temp", "identifier": "fir01-temp",
"caption": "some new UnixUser in client's ManagedWebspace", "caption": "some new UnixUser in client's ManagedWebspace",
@ -280,7 +280,7 @@ class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"bookingItemUuid": "%s", "bookingItem.uuid": "%s",
"type": "DOMAIN_SETUP", "type": "DOMAIN_SETUP",
"identifier": "example.com", "identifier": "example.com",
"caption": "some unrelated domain-setup", "caption": "some unrelated domain-setup",
@ -326,7 +326,7 @@ class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"bookingItemUuid": "%s", "bookingItem.uuid": "%s",
"type": "MANAGED_SERVER", "type": "MANAGED_SERVER",
"identifier": "vm1400", "identifier": "vm1400",
"caption": "some new ManagedServer", "caption": "some new ManagedServer",
@ -381,7 +381,7 @@ class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"parentAssetUuid": "%s", "parentAsset.uuid": "%s",
"type": "UNIX_USER", "type": "UNIX_USER",
"identifier": "fir01-extra", "identifier": "fir01-extra",
"caption": "some extra UnixUser", "caption": "some extra UnixUser",
@ -508,7 +508,7 @@ class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"alarmContactUuid": "%s", "alarmContact.uuid": "%s",
"config": { "config": {
"monit_max_ssd_usage": 85, "monit_max_ssd_usage": 85,
"monit_max_hdd_usage": null, "monit_max_hdd_usage": null,

View File

@ -83,7 +83,7 @@ class DomainSetupHostingAssetFactoryUnitTest {
"subHostingAssets": [ "subHostingAssets": [
{ {
"type": "DOMAIN_HTTP_SETUP", "type": "DOMAIN_HTTP_SETUP",
"assignedToAssetUuid": "{unixUserHostingAssetUuid}" "assignedToAsset.uuid": "{unixUserHostingAssetUuid}"
}, },
{ {
"type": "DOMAIN_DNS_SETUP" "type": "DOMAIN_DNS_SETUP"
@ -124,7 +124,7 @@ class DomainSetupHostingAssetFactoryUnitTest {
"subHostingAssets": [ "subHostingAssets": [
{ {
"type": "DOMAIN_HTTP_SETUP", "type": "DOMAIN_HTTP_SETUP",
"assignedToAssetUuid": "{unixUserHostingAssetUuid}" "assignedToAsset.uuid": "{unixUserHostingAssetUuid}"
}, },
{ {
"type": "DOMAIN_DNS_SETUP" "type": "DOMAIN_DNS_SETUP"
@ -164,7 +164,7 @@ class DomainSetupHostingAssetFactoryUnitTest {
"subHostingAssets": [ "subHostingAssets": [
{ {
"type": "DOMAIN_HTTP_SETUP", "type": "DOMAIN_HTTP_SETUP",
"assignedToAssetUuid": "{unixUserHostingAssetUuid}" "assignedToAsset.uuid": "{unixUserHostingAssetUuid}"
}, },
{ {
"type": "DOMAIN_DNS_SETUP" "type": "DOMAIN_DNS_SETUP"
@ -206,7 +206,7 @@ class DomainSetupHostingAssetFactoryUnitTest {
"subHostingAssets": [ "subHostingAssets": [
{ {
"type": "DOMAIN_HTTP_SETUP", "type": "DOMAIN_HTTP_SETUP",
"assignedToAssetUuid": "{unixUserHostingAssetUuid}" "assignedToAsset.uuid": "{unixUserHostingAssetUuid}"
}, },
{ {
"type": "DOMAIN_DNS_SETUP" "type": "DOMAIN_DNS_SETUP"

View File

@ -1065,11 +1065,11 @@ public abstract class BaseOfficeDataImport extends CsvDataImport {
} }
private HsOfficePersonEntity addPerson(final HsOfficePersonEntity person, final Record contactRecord) { private HsOfficePersonEntity addPerson(final HsOfficePersonEntity person, final Record contactRecord) {
person.setSalutation(contactRecord.getString("salut").trim()); person.setSalutation(contactRecord.getString("salut"));
person.setTitle(contactRecord.getString("title").trim()); person.setTitle(contactRecord.getString("title"));
person.setGivenName(contactRecord.getString("first_name").trim()); person.setGivenName(contactRecord.getString("first_name"));
person.setFamilyName(contactRecord.getString("last_name").trim()); person.setFamilyName(contactRecord.getString("last_name"));
person.setTradeName(contactRecord.getString("firma").trim()); person.setTradeName(contactRecord.getString("firma"));
person.setPersonType(determinePersonType(contactRecord)); person.setPersonType(determinePersonType(contactRecord));
persons.put(contactRecord.getInteger("contact_id"), person); persons.put(contactRecord.getInteger("contact_id"), person);

View File

@ -180,7 +180,7 @@ class HsOfficeCoopAssetsTransactionControllerAcceptanceTest extends ContextBased
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"membershipUuid": "%s", "membership.uuid": "%s",
"transactionType": "DEPOSIT", "transactionType": "DEPOSIT",
"assetValue": 1024.00, "assetValue": 1024.00,
"valueDate": "2022-10-13", "valueDate": "2022-10-13",
@ -237,13 +237,13 @@ class HsOfficeCoopAssetsTransactionControllerAcceptanceTest extends ContextBased
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"membershipUuid": "%s", "membership.uuid": "%s",
"transactionType": "ADJUSTMENT", "transactionType": "ADJUSTMENT",
"assetValue": %s, "assetValue": %s,
"valueDate": "2022-10-30", "valueDate": "2022-10-30",
"reference": "test ref adjustment", "reference": "test ref adjustment",
"comment": "some coop assets adjustment transaction", "comment": "some coop assets adjustment transaction",
"reverseEntryUuid": "%s" "reverseEntry.uuid": "%s"
} }
""".formatted( """.formatted(
givenMembership.getUuid(), givenMembership.getUuid(),
@ -270,7 +270,7 @@ class HsOfficeCoopAssetsTransactionControllerAcceptanceTest extends ContextBased
"reference": "test ref" "reference": "test ref"
} }
} }
""".formatted(givenTransaction.getUuid()))) """))
.header("Location", startsWith("http://localhost")) .header("Location", startsWith("http://localhost"))
.extract().header("Location"); // @formatter:on .extract().header("Location"); // @formatter:on
@ -293,7 +293,7 @@ class HsOfficeCoopAssetsTransactionControllerAcceptanceTest extends ContextBased
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"membershipUuid": "%s", "membership.uuid": "%s",
"transactionType": "DISBURSAL", "transactionType": "DISBURSAL",
"assetValue": -10240.00, "assetValue": -10240.00,
"valueDate": "2022-10-13", "valueDate": "2022-10-13",

View File

@ -37,7 +37,7 @@ class HsOfficeCoopAssetsTransactionControllerRestTest {
static final String VALID_INSERT_REQUEST_BODY = """ static final String VALID_INSERT_REQUEST_BODY = """
{ {
"membershipUuid": "%s", "membership.uuid": "%s",
"transactionType": "DEPOSIT", "transactionType": "DEPOSIT",
"assetValue": 128.00, "assetValue": 128.00,
"valueDate": "2022-10-13", "valueDate": "2022-10-13",
@ -48,8 +48,8 @@ class HsOfficeCoopAssetsTransactionControllerRestTest {
enum BadRequestTestCases { enum BadRequestTestCases {
MEMBERSHIP_UUID_MISSING( MEMBERSHIP_UUID_MISSING(
requestBody -> requestBody.without("membershipUuid"), requestBody -> requestBody.without("membership.uuid"),
"[membershipUuid must not be null but is \"null\"]"), "[membershipUuid must not be null but is \"null\"]"), // TODO.impl: should be membership.uuid, Spring validation-problem?
TRANSACTION_TYPE_MISSING( TRANSACTION_TYPE_MISSING(
requestBody -> requestBody.without("transactionType"), requestBody -> requestBody.without("transactionType"),
@ -121,10 +121,10 @@ class HsOfficeCoopAssetsTransactionControllerRestTest {
.accept(MediaType.APPLICATION_JSON)) .accept(MediaType.APPLICATION_JSON))
// then // then
.andExpect(status().is4xxClientError()) .andExpect(jsonPath("message", is("ERROR: [400] " + testCase.expectedErrorMessage)))
.andExpect(jsonPath("statusCode", is(400))) .andExpect(jsonPath("statusCode", is(400)))
.andExpect(jsonPath("statusPhrase", is("Bad Request"))) .andExpect(jsonPath("statusPhrase", is("Bad Request")))
.andExpect(jsonPath("message", is("ERROR: [400] " + testCase.expectedErrorMessage))); .andExpect(status().is4xxClientError());
} }
} }

View File

@ -168,7 +168,7 @@ class HsOfficeCoopSharesTransactionControllerAcceptanceTest extends ContextBased
final var location = RestAssured // @formatter:off final var location = RestAssured // @formatter:off
.given().header("current-subject", "superuser-alex@hostsharing.net").contentType(ContentType.JSON).body(""" .given().header("current-subject", "superuser-alex@hostsharing.net").contentType(ContentType.JSON).body("""
{ {
"membershipUuid": "%s", "membership.uuid": "%s",
"transactionType": "SUBSCRIPTION", "transactionType": "SUBSCRIPTION",
"shareCount": 8, "shareCount": 8,
"valueDate": "2022-10-13", "valueDate": "2022-10-13",
@ -214,13 +214,13 @@ class HsOfficeCoopSharesTransactionControllerAcceptanceTest extends ContextBased
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"membershipUuid": "%s", "membership.uuid": "%s",
"transactionType": "ADJUSTMENT", "transactionType": "ADJUSTMENT",
"shareCount": %s, "shareCount": %s,
"valueDate": "2022-10-30", "valueDate": "2022-10-30",
"reference": "test ref adjustment", "reference": "test ref adjustment",
"comment": "some coop shares adjustment transaction", "comment": "some coop shares adjustment transaction",
"adjustedShareTxUuid": "%s" "adjustedShareTx.uuid": "%s"
} }
""".formatted( """.formatted(
givenMembership.getUuid(), givenMembership.getUuid(),
@ -267,7 +267,7 @@ class HsOfficeCoopSharesTransactionControllerAcceptanceTest extends ContextBased
RestAssured // @formatter:off RestAssured // @formatter:off
.given().header("current-subject", "superuser-alex@hostsharing.net").contentType(ContentType.JSON).body(""" .given().header("current-subject", "superuser-alex@hostsharing.net").contentType(ContentType.JSON).body("""
{ {
"membershipUuid": "%s", "membership.uuid": "%s",
"transactionType": "CANCELLATION", "transactionType": "CANCELLATION",
"shareCount": -80, "shareCount": -80,
"valueDate": "2022-10-13", "valueDate": "2022-10-13",

View File

@ -37,7 +37,7 @@ class HsOfficeCoopSharesTransactionControllerRestTest {
static final String VALID_INSERT_REQUEST_BODY = """ static final String VALID_INSERT_REQUEST_BODY = """
{ {
"membershipUuid": "%s", "membership.uuid": "%s",
"transactionType": "SUBSCRIPTION", "transactionType": "SUBSCRIPTION",
"shareCount": 8, "shareCount": 8,
"valueDate": "2022-10-13", "valueDate": "2022-10-13",
@ -48,7 +48,7 @@ class HsOfficeCoopSharesTransactionControllerRestTest {
enum BadRequestTestCases { enum BadRequestTestCases {
MEMBERSHIP_UUID_MISSING( MEMBERSHIP_UUID_MISSING(
requestBody -> requestBody.without("membershipUuid"), requestBody -> requestBody.without("membership.uuid"),
"[membershipUuid must not be null but is \"null\"]"), "[membershipUuid must not be null but is \"null\"]"),
TRANSACTION_TYPE_MISSING( TRANSACTION_TYPE_MISSING(

View File

@ -287,14 +287,14 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"debitorRelUuid": "%s", "debitorRel.uuid": "%s",
"debitorNumberSuffix": "%s", "debitorNumberSuffix": "%s",
"billable": "true", "billable": "true",
"vatId": "VAT123456", "vatId": "VAT123456",
"vatCountryCode": "DE", "vatCountryCode": "DE",
"vatBusiness": true, "vatBusiness": true,
"vatReverseCharge": "false", "vatReverseCharge": "false",
"refundBankAccountUuid": "%s", "refundBankAccount.uuid": "%s",
"defaultPrefix": "for" "defaultPrefix": "for"
} }
""".formatted( givenDebitorRelUUid, ++nextDebitorSuffix, givenBankAccount.getUuid())) """.formatted( givenDebitorRelUUid, ++nextDebitorSuffix, givenBankAccount.getUuid()))
@ -333,9 +333,9 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu
.body(""" .body("""
{ {
"debitorRel": { "debitorRel": {
"anchorUuid": "%s", "anchor.uuid": "%s",
"holderUuid": "%s", "holder.uuid": "%s",
"contactUuid": "%s" "contact.uuid": "%s"
}, },
"debitorNumberSuffix": "%s", "debitorNumberSuffix": "%s",
"defaultPrefix": "for", "defaultPrefix": "for",
@ -384,9 +384,9 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu
.body(""" .body("""
{ {
"debitorRel": { "debitorRel": {
"anchorUuid": "%s", "anchor.uuid": "%s",
"holderUuid": "%s", "holder.uuid": "%s",
"contactUuid": "%s" "contact.uuid": "%s"
}, },
"debitorNumberSuffix": "%s", "debitorNumberSuffix": "%s",
"defaultPrefix": "for", "defaultPrefix": "for",
@ -418,7 +418,7 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"debitorRelUuid": "%s", "debitorRel.uuid": "%s",
"debitorNumberSuffix": "%s", "debitorNumberSuffix": "%s",
"defaultPrefix": "for", "defaultPrefix": "for",
"billable": "true", "billable": "true",

View File

@ -182,7 +182,7 @@ class HsOfficeMembershipControllerAcceptanceTest extends ContextBasedTestWithCle
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"partnerUuid": "%s", "partner.uuid": "%s",
"memberNumberSuffix": "%s", "memberNumberSuffix": "%s",
"validFrom": "2022-10-13", "validFrom": "2022-10-13",
"membershipFeeBillable": "true" "membershipFeeBillable": "true"

View File

@ -56,12 +56,12 @@ public class HsOfficeMembershipControllerRestTest {
.contentType(MediaType.APPLICATION_JSON) .contentType(MediaType.APPLICATION_JSON)
.content(""" .content("""
{ {
"partnerUuid": null, "partner.uuid": null,
"memberNumberSuffix": "01", "memberNumberSuffix": "01",
"validFrom": "2022-10-13", "validFrom": "2022-10-13",
"membershipFeeBillable": "true" "membershipFeeBillable": "true"
} }
""".formatted(UUID.randomUUID())) """)
.accept(MediaType.APPLICATION_JSON)) .accept(MediaType.APPLICATION_JSON))
// then // then
@ -86,7 +86,7 @@ public class HsOfficeMembershipControllerRestTest {
.contentType(MediaType.APPLICATION_JSON) .contentType(MediaType.APPLICATION_JSON)
.content(""" .content("""
{ {
"partnerUuid": "%s", "partner.uuid": "%s",
"memberNumberSuffix": "01", "memberNumberSuffix": "01",
"validFrom": "2022-10-13", "validFrom": "2022-10-13",
"membershipFeeBillable": "true" "membershipFeeBillable": "true"
@ -112,7 +112,7 @@ public class HsOfficeMembershipControllerRestTest {
.contentType(MediaType.APPLICATION_JSON) .contentType(MediaType.APPLICATION_JSON)
.content(""" .content("""
{ {
"partnerUuid": "%s", "partner.uuid": "%s",
%s %s
"validFrom": "2022-10-13", "validFrom": "2022-10-13",
"membershipFeeBillable": "true" "membershipFeeBillable": "true"

View File

@ -102,9 +102,9 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu
{ {
"partnerNumber": "20002", "partnerNumber": "20002",
"partnerRel": { "partnerRel": {
"anchorUuid": "%s", "anchor.uuid": "%s",
"holderUuid": "%s", "holder.uuid": "%s",
"contactUuid": "%s" "contact.uuid": "%s"
}, },
"details": { "details": {
"registrationOffice": "Temp Registergericht Aurich", "registrationOffice": "Temp Registergericht Aurich",
@ -161,12 +161,12 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu
{ {
"partnerNumber": "20003", "partnerNumber": "20003",
"partnerRel": { "partnerRel": {
"anchorUuid": "%s", "anchor.uuid": "%s",
"holderUuid": "%s", "holder.uuid": "%s",
"contactUuid": "%s" "contact.uuid": "%s"
}, },
"personUuid": "%s", "person.uuid": "%s",
"contactUuid": "%s", "contact.uuid": "%s",
"details": {} "details": {}
} }
""".formatted( """.formatted(
@ -199,12 +199,12 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu
{ {
"partnerNumber": "20004", "partnerNumber": "20004",
"partnerRel": { "partnerRel": {
"anchorUuid": "%s", "anchor.uuid": "%s",
"holderUuid": "%s", "holder.uuid": "%s",
"contactUuid": "%s" "contact.uuid": "%s"
}, },
"personUuid": "%s", "person.uuid": "%s",
"contactUuid": "%s", "contact.uuid": "%s",
"details": {} "details": {}
} }
""".formatted( """.formatted(
@ -321,7 +321,7 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu
.body(""" .body("""
{ {
"partnerNumber": "20011", "partnerNumber": "20011",
"partnerRelUuid": "%s", "partnerRel.uuid": "%s",
"details": { "details": {
"registrationOffice": "Temp Registergericht Aurich", "registrationOffice": "Temp Registergericht Aurich",
"registrationNumber": "222222", "registrationNumber": "222222",
@ -387,7 +387,7 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"partnerRelUuid": "%s" "partnerRel.uuid": "%s"
} }
""".formatted(givenPartnerRel.getUuid())) """.formatted(givenPartnerRel.getUuid()))
.port(port) .port(port)

View File

@ -101,12 +101,12 @@ class HsOfficePartnerControllerRestTest {
{ {
"partnerNumber": "20002", "partnerNumber": "20002",
"partnerRel": { "partnerRel": {
"anchorUuid": "%s", "anchor.uuid": "%s",
"holderUuid": "%s", "holder.uuid": "%s",
"contactUuid": "%s" "contact.uuid": "%s"
}, },
"personUuid": "%s", "person.uuid": "%s",
"contactUuid": "%s", "contact.uuid": "%s",
"details": { "details": {
"registrationOffice": "Temp Registergericht Aurich", "registrationOffice": "Temp Registergericht Aurich",
"registrationNumber": "111111" "registrationNumber": "111111"
@ -138,12 +138,12 @@ class HsOfficePartnerControllerRestTest {
{ {
"partnerNumber": "20002", "partnerNumber": "20002",
"partnerRel": { "partnerRel": {
"anchorUuid": "%s", "anchor.uuid": "%s",
"holderUuid": "%s", "holder.uuid": "%s",
"contactUuid": "%s" "contact.uuid": "%s"
}, },
"personUuid": "%s", "person.uuid": "%s",
"contactUuid": "%s", "contact.uuid": "%s",
"details": { "details": {
"registrationOffice": "Temp Registergericht Aurich", "registrationOffice": "Temp Registergericht Aurich",
"registrationNumber": "111111" "registrationNumber": "111111"

View File

@ -235,9 +235,9 @@ class HsOfficeRelationControllerAcceptanceTest extends ContextBasedTestWithClean
{ {
"type": "%s", "type": "%s",
"mark": "%s", "mark": "%s",
"anchorUuid": "%s", "anchor.uuid": "%s",
"holderUuid": "%s", "holder.uuid": "%s",
"contactUuid": "%s" "contact.uuid": "%s"
} }
""".formatted( """.formatted(
HsOfficeRelationTypeResource.SUBSCRIBER, HsOfficeRelationTypeResource.SUBSCRIBER,
@ -281,9 +281,9 @@ class HsOfficeRelationControllerAcceptanceTest extends ContextBasedTestWithClean
.body(""" .body("""
{ {
"type": "%s", "type": "%s",
"anchorUuid": "%s", "anchor.uuid": "%s",
"holderUuid": "%s", "holder.uuid": "%s",
"contactUuid": "%s" "contact.uuid": "%s"
} }
""".formatted( """.formatted(
HsOfficeRelationTypeResource.DEBITOR, HsOfficeRelationTypeResource.DEBITOR,
@ -313,9 +313,9 @@ class HsOfficeRelationControllerAcceptanceTest extends ContextBasedTestWithClean
.body(""" .body("""
{ {
"type": "%s", "type": "%s",
"anchorUuid": "%s", "anchor.uuid": "%s",
"holderUuid": "%s", "holder.uuid": "%s",
"contactUuid": "%s" "contact.uuid": "%s"
} }
""".formatted( """.formatted(
HsOfficeRelationTypeResource.DEBITOR, HsOfficeRelationTypeResource.DEBITOR,
@ -346,9 +346,9 @@ class HsOfficeRelationControllerAcceptanceTest extends ContextBasedTestWithClean
.body(""" .body("""
{ {
"type": "%s", "type": "%s",
"anchorUuid": "%s", "anchor.uuid": "%s",
"holderUuid": "%s", "holder.uuid": "%s",
"contactUuid": "%s" "contact.uuid": "%s"
} }
""".formatted( """.formatted(
HsOfficeRelationTypeResource.DEBITOR, HsOfficeRelationTypeResource.DEBITOR,
@ -461,7 +461,7 @@ class HsOfficeRelationControllerAcceptanceTest extends ContextBasedTestWithClean
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"contactUuid": "%s" "contact.uuid": "%s"
} }
""".formatted(givenContact.getUuid())) """.formatted(givenContact.getUuid()))
.port(port) .port(port)

View File

@ -11,12 +11,14 @@ import net.hostsharing.hsadminng.hs.office.scenarios.debitor.CreateSepaMandateFo
import net.hostsharing.hsadminng.hs.office.scenarios.debitor.FinallyDeleteSepaMandateForDebitor; import net.hostsharing.hsadminng.hs.office.scenarios.debitor.FinallyDeleteSepaMandateForDebitor;
import net.hostsharing.hsadminng.hs.office.scenarios.debitor.DontDeleteDefaultDebitor; import net.hostsharing.hsadminng.hs.office.scenarios.debitor.DontDeleteDefaultDebitor;
import net.hostsharing.hsadminng.hs.office.scenarios.debitor.InvalidateSepaMandateForDebitor; import net.hostsharing.hsadminng.hs.office.scenarios.debitor.InvalidateSepaMandateForDebitor;
import net.hostsharing.hsadminng.hs.office.scenarios.membership.CancelMembership;
import net.hostsharing.hsadminng.hs.office.scenarios.membership.CreateMembership; import net.hostsharing.hsadminng.hs.office.scenarios.membership.CreateMembership;
import net.hostsharing.hsadminng.hs.office.scenarios.partner.AddOperationsContactToPartner; import net.hostsharing.hsadminng.hs.office.scenarios.partner.AddOperationsContactToPartner;
import net.hostsharing.hsadminng.hs.office.scenarios.partner.CreatePartner; import net.hostsharing.hsadminng.hs.office.scenarios.partner.CreatePartner;
import net.hostsharing.hsadminng.hs.office.scenarios.debitor.DeleteDebitor; import net.hostsharing.hsadminng.hs.office.scenarios.debitor.DeleteDebitor;
import net.hostsharing.hsadminng.hs.office.scenarios.partner.DeletePartner; import net.hostsharing.hsadminng.hs.office.scenarios.partner.DeletePartner;
import net.hostsharing.hsadminng.hs.office.scenarios.partner.AddRepresentativeToPartner; import net.hostsharing.hsadminng.hs.office.scenarios.partner.AddRepresentativeToPartner;
import net.hostsharing.hsadminng.hs.office.scenarios.person.ShouldUpdatePersonData;
import net.hostsharing.hsadminng.hs.office.scenarios.subscription.RemoveOperationsContactFromPartner; import net.hostsharing.hsadminng.hs.office.scenarios.subscription.RemoveOperationsContactFromPartner;
import net.hostsharing.hsadminng.hs.office.scenarios.subscription.SubscribeToMailinglist; import net.hostsharing.hsadminng.hs.office.scenarios.subscription.SubscribeToMailinglist;
import net.hostsharing.hsadminng.hs.office.scenarios.subscription.UnsubscribeFromMailinglist; import net.hostsharing.hsadminng.hs.office.scenarios.subscription.UnsubscribeFromMailinglist;
@ -197,6 +199,16 @@ class HsOfficeScenarioTests extends ScenarioTest {
.doRun(); .doRun();
} }
@Test
@Order(1201)
@Requires("Partner: Michelle Matthieu")
void shouldUpdatePersonData() {
new ShouldUpdatePersonData(this)
.given("oldFamilyName", "Matthieu")
.given("newFamilyName", "Matthieu-Zhang")
.doRun();
}
@Test @Test
@Order(2010) @Order(2010)
@Requires("Partner: Test AG") @Requires("Partner: Test AG")
@ -302,12 +314,26 @@ class HsOfficeScenarioTests extends ScenarioTest {
@Test @Test
@Order(4000) @Order(4000)
@Requires("Partner: Test AG") @Requires("Partner: Test AG")
@Produces("Membership: Test AG 00")
void shouldCreateMembershipForPartner() { void shouldCreateMembershipForPartner() {
new CreateMembership(this) new CreateMembership(this)
.given("partnerName", "Test AG") .given("partnerName", "Test AG")
.given("memberNumberSuffix", "00") .given("memberNumberSuffix", "00")
.given("validFrom", "2024-10-15") .given("validFrom", "2024-10-15")
.given("newStatus", "ACTIVE")
.given("membershipFeeBillable", "true") .given("membershipFeeBillable", "true")
.doRun()
.keep();
}
@Test
@Order(4900)
@Requires("Membership: Test AG 00")
void shouldCancelMembershipOfPartner() {
new CancelMembership(this)
.given("memberNumber", "3101000")
.given("validTo", "2025-12-30")
.given("newStatus", "CANCELLED")
.doRun(); .doRun();
} }

View File

@ -86,13 +86,13 @@ public abstract class UseCase<T extends UseCase<?>> {
}) })
); );
final var response = run(); final var response = run();
verify(); verify(response);
return response; return response;
} }
protected abstract HttpResponse run(); protected abstract HttpResponse run();
protected void verify() { protected void verify(final HttpResponse response) {
} }
public final UseCase<T> given(final String propName, final Object propValue) { public final UseCase<T> given(final String propName, final Object propValue) {
@ -233,6 +233,7 @@ public abstract class UseCase<T extends UseCase<?>> {
@Getter @Getter
private final HttpStatus status; private final HttpStatus status;
@Getter
private UUID locationUuid; private UUID locationUuid;
@SneakyThrows @SneakyThrows

View File

@ -40,7 +40,7 @@ public class AddPhoneNumberToContactData extends UseCase<AddPhoneNumberToContact
} }
@Override @Override
protected void verify() { protected void verify(final UseCase<AddPhoneNumberToContactData>.HttpResponse response) {
verify( verify(
"Verify if the New Phone Number Got Added", "Verify if the New Phone Number Got Added",
() -> httpGet("/api/hs/office/relations?relationType=PARTNER&personData=" + uriEncoded("%{partnerName}")) () -> httpGet("/api/hs/office/relations?relationType=PARTNER&personData=" + uriEncoded("%{partnerName}"))

View File

@ -39,7 +39,7 @@ public class RemovePhoneNumberFromContactData extends UseCase<RemovePhoneNumberF
} }
@Override @Override
protected void verify() { protected void verify(final UseCase<RemovePhoneNumberFromContactData>.HttpResponse response) {
verify( verify(
"Verify if the New Phone Number Got Added", "Verify if the New Phone Number Got Added",
() -> httpGet("/api/hs/office/relations?relationType=PARTNER&personData=" + uriEncoded("%{partnerName}")) () -> httpGet("/api/hs/office/relations?relationType=PARTNER&personData=" + uriEncoded("%{partnerName}"))

View File

@ -47,7 +47,7 @@ public class ReplaceContactData extends UseCase<ReplaceContactData> {
withTitle("Replace the Contact-Reference in the Partner-Relation", () -> withTitle("Replace the Contact-Reference in the Partner-Relation", () ->
httpPatch("/api/hs/office/relations/%{partnerRelationUuid}", usingJsonBody(""" httpPatch("/api/hs/office/relations/%{partnerRelationUuid}", usingJsonBody("""
{ {
"contactUuid": ${Contact: %{newContactCaption}} "contact.uuid": ${Contact: %{newContactCaption}}
} }
""")) """))
.expecting(OK) .expecting(OK)
@ -57,7 +57,7 @@ public class ReplaceContactData extends UseCase<ReplaceContactData> {
} }
@Override @Override
protected void verify() { protected void verify(final UseCase<ReplaceContactData>.HttpResponse response) {
verify( verify(
"Verify if the Contact-Relation Got Replaced in the Partner-Relation", "Verify if the Contact-Relation Got Replaced in the Partner-Relation",
() -> httpGet("/api/hs/office/relations?relationType=PARTNER&personData=" + uriEncoded("%{partnerName}")) () -> httpGet("/api/hs/office/relations?relationType=PARTNER&personData=" + uriEncoded("%{partnerName}"))

View File

@ -55,9 +55,9 @@ public class CreateExternalDebitorForPartner extends UseCase<CreateExternalDebit
return httpPost("/api/hs/office/debitors", usingJsonBody(""" return httpPost("/api/hs/office/debitors", usingJsonBody("""
{ {
"debitorRel": { "debitorRel": {
"anchorUuid": ${Person: %{partnerPersonTradeName}}, "anchor.uuid": ${Person: %{partnerPersonTradeName}},
"holderUuid": ${Person: Billing GmbH}, "holder.uuid": ${Person: Billing GmbH},
"contactUuid": ${Contact: Billing GmbH - Test AG billing} "contact.uuid": ${Contact: Billing GmbH - Test AG billing}
}, },
"debitorNumberSuffix": ${debitorNumberSuffix}, "debitorNumberSuffix": ${debitorNumberSuffix},
"billable": ${billable}, "billable": ${billable},
@ -65,7 +65,7 @@ public class CreateExternalDebitorForPartner extends UseCase<CreateExternalDebit
"vatCountryCode": ${vatCountryCode}, "vatCountryCode": ${vatCountryCode},
"vatBusiness": ${vatBusiness}, "vatBusiness": ${vatBusiness},
"vatReverseCharge": ${vatReverseCharge}, "vatReverseCharge": ${vatReverseCharge},
"refundBankAccountUuid": ${BankAccount: Billing GmbH - refund bank account}, "refundBankAccount.uuid": ${BankAccount: Billing GmbH - refund bank account},
"defaultPrefix": ${defaultPrefix} "defaultPrefix": ${defaultPrefix}
} }
""")) """))

View File

@ -48,9 +48,9 @@ public class CreateSelfDebitorForPartner extends UseCase<CreateSelfDebitorForPar
return httpPost("/api/hs/office/debitors", usingJsonBody(""" return httpPost("/api/hs/office/debitors", usingJsonBody("""
{ {
"debitorRel": { "debitorRel": {
"anchorUuid": ${partnerPersonUuid}, "anchor.uuid": ${partnerPersonUuid},
"holderUuid": ${partnerPersonUuid}, "holder.uuid": ${partnerPersonUuid},
"contactUuid": ${Contact: Test AG - billing department} "contact.uuid": ${Contact: Test AG - billing department}
}, },
"debitorNumberSuffix": ${debitorNumberSuffix}, "debitorNumberSuffix": ${debitorNumberSuffix},
"billable": ${billable}, "billable": ${billable},
@ -58,7 +58,7 @@ public class CreateSelfDebitorForPartner extends UseCase<CreateSelfDebitorForPar
"vatCountryCode": ${vatCountryCode}, "vatCountryCode": ${vatCountryCode},
"vatBusiness": ${vatBusiness}, "vatBusiness": ${vatBusiness},
"vatReverseCharge": ${vatReverseCharge}, "vatReverseCharge": ${vatReverseCharge},
"refundBankAccountUuid": ${BankAccount: Test AG - refund bank account}, "refundBankAccount.uuid": ${BankAccount: Test AG - refund bank account},
"defaultPrefix": ${defaultPrefix} "defaultPrefix": ${defaultPrefix}
} }
""")) """))

View File

@ -35,8 +35,8 @@ public class CreateSepaMandateForDebitor extends UseCase<CreateSepaMandateForDeb
return httpPost("/api/hs/office/sepamandates", usingJsonBody(""" return httpPost("/api/hs/office/sepamandates", usingJsonBody("""
{ {
"debitorUuid": ${Debitor: Test AG - main debitor}, "debitor.uuid": ${Debitor: Test AG - main debitor},
"bankAccountUuid": ${BankAccount: Test AG - debit bank account}, "bankAccount.uuid": ${BankAccount: Test AG - debit bank account},
"reference": ${mandateReference}, "reference": ${mandateReference},
"agreement": ${mandateAgreement}, "agreement": ${mandateAgreement},
"validFrom": ${mandateValidFrom} "validFrom": ${mandateValidFrom}

View File

@ -0,0 +1,47 @@
package net.hostsharing.hsadminng.hs.office.scenarios.membership;
import io.restassured.http.ContentType;
import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.office.scenarios.UseCase;
import org.springframework.http.HttpStatus;
import static io.restassured.http.ContentType.JSON;
import static org.springframework.http.HttpStatus.OK;
public class CancelMembership extends UseCase<CancelMembership> {
public CancelMembership(final ScenarioTest testSuite) {
super(testSuite);
}
@Override
protected HttpResponse run() {
obtain("Membership: %{memberNumber}", () ->
httpGet("/api/hs/office/memberships?memberNumber=%{memberNumber}")
.expectArrayElements(1),
response -> response.expectArrayElements(1).getFromBody("[0].uuid")
);
return withTitle("Patch the New Status Into the Membership", () ->
httpPatch("/api/hs/office/memberships/%{Membership: %{memberNumber}}", usingJsonBody("""
{
"validTo": ${validTo},
"status": ${newStatus}
}
"""))
.expecting(HttpStatus.OK).expecting(ContentType.JSON)
);
}
@Override
protected void verify(final UseCase<CancelMembership>.HttpResponse response) {
verify(
"Verify That the Membership Got Cancelled",
() -> httpGet("/api/hs/office/memberships/%{Membership: %{memberNumber}}")
.expecting(OK).expecting(JSON),
path("validTo").contains("%{validTo}"),
path("status").contains("CANCELLED")
);
}
}

View File

@ -5,6 +5,9 @@ import net.hostsharing.hsadminng.hs.office.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest; import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import static io.restassured.http.ContentType.JSON;
import static org.springframework.http.HttpStatus.OK;
public class CreateMembership extends UseCase<CreateMembership> { public class CreateMembership extends UseCase<CreateMembership> {
public CreateMembership(final ScenarioTest testSuite) { public CreateMembership(final ScenarioTest testSuite) {
@ -13,17 +16,26 @@ public class CreateMembership extends UseCase<CreateMembership> {
@Override @Override
protected HttpResponse run() { protected HttpResponse run() {
obtain("Membership: %{partnerName} 00", () -> return httpPost("/api/hs/office/memberships", usingJsonBody("""
httpPost("/api/hs/office/memberships", usingJsonBody("""
{ {
"partnerUuid": ${Partner: Test AG}, "partner.uuid": ${Partner: Test AG},
"memberNumberSuffix": ${memberNumberSuffix}, "memberNumberSuffix": ${memberNumberSuffix},
"status": "ACTIVE",
"validFrom": ${validFrom}, "validFrom": ${validFrom},
"membershipFeeBillable": ${membershipFeeBillable} "membershipFeeBillable": ${membershipFeeBillable}
} }
""")) """))
.expecting(HttpStatus.CREATED).expecting(ContentType.JSON) .expecting(HttpStatus.CREATED).expecting(ContentType.JSON);
}
@Override
protected void verify(final UseCase<CreateMembership>.HttpResponse response) {
verify(
"Verify That the Membership Got Created",
() -> httpGet("/api/hs/office/memberships/" + response.getLocationUuid())
.expecting(OK).expecting(JSON),
path("validFrom").contains("%{validFrom}"),
path("status").contains("ACTIVE")
); );
return null;
} }
} }

View File

@ -57,16 +57,16 @@ public class AddOperationsContactToPartner extends UseCase<AddOperationsContactT
return httpPost("/api/hs/office/relations", usingJsonBody(""" return httpPost("/api/hs/office/relations", usingJsonBody("""
{ {
"type": "OPERATIONS", "type": "OPERATIONS",
"anchorUuid": ${Person: %{partnerPersonTradeName}}, "anchor.uuid": ${Person: %{partnerPersonTradeName}},
"holderUuid": ${Person: %{operationsContactGivenName} %{operationsContactFamilyName}}, "holder.uuid": ${Person: %{operationsContactGivenName} %{operationsContactFamilyName}},
"contactUuid": ${Contact: %{operationsContactGivenName} %{operationsContactFamilyName}} "contact.uuid": ${Contact: %{operationsContactGivenName} %{operationsContactFamilyName}}
} }
""")) """))
.expecting(CREATED).expecting(JSON); .expecting(CREATED).expecting(JSON);
} }
@Override @Override
protected void verify() { protected void verify(final UseCase<AddOperationsContactToPartner>.HttpResponse response) {
verify( verify(
"Verify the New OPERATIONS Relation", "Verify the New OPERATIONS Relation",
() -> httpGet("/api/hs/office/relations?relationType=OPERATIONS&personData=" + uriEncoded( () -> httpGet("/api/hs/office/relations?relationType=OPERATIONS&personData=" + uriEncoded(

View File

@ -60,16 +60,16 @@ public class AddRepresentativeToPartner extends UseCase<AddRepresentativeToPartn
return httpPost("/api/hs/office/relations", usingJsonBody(""" return httpPost("/api/hs/office/relations", usingJsonBody("""
{ {
"type": "REPRESENTATIVE", "type": "REPRESENTATIVE",
"anchorUuid": ${Person: %{partnerPersonTradeName}}, "anchor.uuid": ${Person: %{partnerPersonTradeName}},
"holderUuid": ${Person: %{representativeGivenName} %{representativeFamilyName}}, "holder.uuid": ${Person: %{representativeGivenName} %{representativeFamilyName}},
"contactUuid": ${Contact: %{representativeGivenName} %{representativeFamilyName}} "contact.uuid": ${Contact: %{representativeGivenName} %{representativeFamilyName}}
} }
""")) """))
.expecting(CREATED).expecting(JSON); .expecting(CREATED).expecting(JSON);
} }
@Override @Override
protected void verify() { protected void verify(final UseCase<AddRepresentativeToPartner>.HttpResponse response) {
verify( verify(
"Verify the REPRESENTATIVE Relation Got Removed", "Verify the REPRESENTATIVE Relation Got Removed",
() -> httpGet("/api/hs/office/relations?relationType=REPRESENTATIVE&personData=" + uriEncoded("%{representativeFamilyName}")) () -> httpGet("/api/hs/office/relations?relationType=REPRESENTATIVE&personData=" + uriEncoded("%{representativeFamilyName}"))

View File

@ -62,9 +62,9 @@ public class CreatePartner extends UseCase<CreatePartner> {
{ {
"partnerNumber": ${partnerNumber}, "partnerNumber": ${partnerNumber},
"partnerRel": { "partnerRel": {
"anchorUuid": ${Person: Hostsharing eG}, "anchor.uuid": ${Person: Hostsharing eG},
"holderUuid": ${Person: %{%{tradeName???}???%{givenName???} %{familyName???}}}, "holder.uuid": ${Person: %{%{tradeName???}???%{givenName???} %{familyName???}}},
"contactUuid": ${Contact: %{contactCaption}} "contact.uuid": ${Contact: %{contactCaption}}
}, },
"details": { "details": {
"registrationOffice": "Registergericht Hamburg", "registrationOffice": "Registergericht Hamburg",
@ -76,7 +76,7 @@ public class CreatePartner extends UseCase<CreatePartner> {
} }
@Override @Override
protected void verify() { protected void verify(final UseCase<CreatePartner>.HttpResponse response) {
verify( verify(
"Verify the New Partner Relation", "Verify the New Partner Relation",
() -> httpGet("/api/hs/office/relations?relationType=PARTNER&contactData=&{contactCaption}") () -> httpGet("/api/hs/office/relations?relationType=PARTNER&contactData=&{contactCaption}")

View File

@ -0,0 +1,48 @@
package net.hostsharing.hsadminng.hs.office.scenarios.person;
import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.office.scenarios.UseCase;
import org.springframework.http.HttpStatus;
import static io.restassured.http.ContentType.JSON;
import static org.springframework.http.HttpStatus.OK;
public class ShouldUpdatePersonData extends UseCase<ShouldUpdatePersonData> {
public ShouldUpdatePersonData(final ScenarioTest testSuite) {
super(testSuite);
}
@Override
protected HttpResponse run() {
obtain(
"personUuid",
() -> httpGet("/api/hs/office/persons?name=" + uriEncoded("%{oldFamilyName}"))
.expecting(OK).expecting(JSON),
response -> response.expectArrayElements(1).getFromBody("[0].uuid"),
"In production, data this query could result in multiple outputs. In that case, you have to find out which is the right one."
);
withTitle("Patch the Additional Phone-Number into the Person", () ->
httpPatch("/api/hs/office/persons/%{personUuid}", usingJsonBody("""
{
"familyName": ${newFamilyName}
}
"""))
.expecting(HttpStatus.OK)
);
return null;
}
@Override
protected void verify(final UseCase<ShouldUpdatePersonData>.HttpResponse response) {
verify(
"Verify that the Family Name Got Amended",
() -> httpGet("/api/hs/office/persons/%{personUuid}")
.expecting(OK).expecting(JSON),
path("familyName").contains("%{newFamilyName}")
);
}
}

View File

@ -33,7 +33,7 @@ public class RemoveOperationsContactFromPartner extends UseCase<RemoveOperations
} }
@Override @Override
protected void verify() { protected void verify(final UseCase<RemoveOperationsContactFromPartner>.HttpResponse response) {
verify( verify(
"Verify the New OPERATIONS Relation", "Verify the New OPERATIONS Relation",
() -> httpGet("/api/hs/office/relations/&{Operations-Contact: %{operationsContactPerson}}") () -> httpGet("/api/hs/office/relations/&{Operations-Contact: %{operationsContactPerson}}")

View File

@ -52,9 +52,9 @@ public class SubscribeToMailinglist extends UseCase<SubscribeToMailinglist> {
{ {
"type": "SUBSCRIBER", "type": "SUBSCRIBER",
"mark": ${mailingList}, "mark": ${mailingList},
"anchorUuid": ${Person: %{partnerPersonTradeName}}, "anchor.uuid": ${Person: %{partnerPersonTradeName}},
"holderUuid": ${Person: %{subscriberGivenName} %{subscriberFamilyName}}, "holder.uuid": ${Person: %{subscriberGivenName} %{subscriberFamilyName}},
"contactUuid": ${Contact: %{subscriberGivenName} %{subscriberFamilyName}} "contact.uuid": ${Contact: %{subscriberGivenName} %{subscriberFamilyName}}
} }
""")) """))
.expecting(CREATED).expecting(JSON); .expecting(CREATED).expecting(JSON);

View File

@ -144,8 +144,8 @@ class HsOfficeSepaMandateControllerAcceptanceTest extends ContextBasedTestWithCl
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"debitorUuid": "%s", "debitor.uuid": "%s",
"bankAccountUuid": "%s", "bankAccount.uuid": "%s",
"reference": "temp ref CAT A", "reference": "temp ref CAT A",
"agreement": "2020-01-02", "agreement": "2020-01-02",
"validFrom": "2022-10-13" "validFrom": "2022-10-13"
@ -186,7 +186,7 @@ class HsOfficeSepaMandateControllerAcceptanceTest extends ContextBasedTestWithCl
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"bankAccountUuid": "%s", "bankAccount.uuid": "%s",
"reference": "temp ref CAT B", "reference": "temp ref CAT B",
"validFrom": "2022-10-13" "validFrom": "2022-10-13"
} }
@ -211,8 +211,8 @@ class HsOfficeSepaMandateControllerAcceptanceTest extends ContextBasedTestWithCl
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"debitorUuid": "%s", "debitor.uuid": "%s",
"bankAccountUuid": "%s", "bankAccount.uuid": "%s",
"reference": "temp ref CAT C", "reference": "temp ref CAT C",
"agreement": "2022-10-12", "agreement": "2022-10-12",
"validFrom": "2022-10-13", "validFrom": "2022-10-13",
@ -241,8 +241,8 @@ class HsOfficeSepaMandateControllerAcceptanceTest extends ContextBasedTestWithCl
.contentType(ContentType.JSON) .contentType(ContentType.JSON)
.body(""" .body("""
{ {
"debitorUuid": "%s", "debitor.uuid": "%s",
"bankAccountUuid": "%s", "bankAccount.uuid": "%s",
"reference": "temp refCAT D", "reference": "temp refCAT D",
"agreement": "2022-10-12", "agreement": "2022-10-12",
"validFrom": "2022-10-13", "validFrom": "2022-10-13",

View File

@ -388,8 +388,8 @@ class RbacGrantControllerAcceptanceTest extends ContextBasedTest {
.body(""" .body("""
{ {
"assumed": true, "assumed": true,
"grantedRoleUuid": "%s", "grantedRole.uuid": "%s",
"granteeSubjectUuid": "%s" "granteeSubject.uuid": "%s"
} }
""".formatted( """.formatted(
grantedRole.getUuid(), grantedRole.getUuid(),
@ -424,8 +424,8 @@ class RbacGrantControllerAcceptanceTest extends ContextBasedTest {
.body(""" .body("""
{ {
"assumed": true, "assumed": true,
"grantedRoleUuid": "%s", "grantedRole.uuid": "%s",
"granteeSubjectUuid": "%s" "granteeSubject.uuid": "%s"
} }
""".formatted( """.formatted(
grantedRole.getUuid(), grantedRole.getUuid(),

View File

@ -76,8 +76,8 @@ class RbacRoleControllerRestTest {
.andExpect(jsonPath("$[1].roleName", is("rbactest.customer#xxx:OWNER"))) .andExpect(jsonPath("$[1].roleName", is("rbactest.customer#xxx:OWNER")))
.andExpect(jsonPath("$[2].roleName", is("rbactest.customer#xxx:ADMIN"))) .andExpect(jsonPath("$[2].roleName", is("rbactest.customer#xxx:ADMIN")))
.andExpect(jsonPath("$[2].uuid", is(customerXxxAdmin.getUuid().toString()))) .andExpect(jsonPath("$[2].uuid", is(customerXxxAdmin.getUuid().toString())))
.andExpect(jsonPath("$[2].objectUuid", is(customerXxxAdmin.getObjectUuid().toString()))) .andExpect(jsonPath("$[2].['object.uuid']", is(customerXxxAdmin.getObjectUuid().toString())))
.andExpect(jsonPath("$[2].objectTable", is(customerXxxAdmin.getObjectTable().toString()))) .andExpect(jsonPath("$[2].objectTable", is(customerXxxAdmin.getObjectTable())))
.andExpect(jsonPath("$[2].objectIdName", is(customerXxxAdmin.getObjectIdName().toString()))); .andExpect(jsonPath("$[2].objectIdName", is(customerXxxAdmin.getObjectIdName())));
} }
} }