From 3dc1e3b4b248db19965669b567ed52a488fd0075 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Thu, 25 Jul 2024 10:00:25 +0200 Subject: [PATCH] amendmends after self-review --- .../hs/office/debitor/HsOfficeDebitorController.java | 7 ------- .../hsadminng/hs/office/partner/HsOfficePartnerEntity.java | 5 +++-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorController.java b/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorController.java index 10409c20..5455b99b 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorController.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorController.java @@ -5,7 +5,6 @@ import net.hostsharing.hsadminng.hs.office.generated.api.v1.api.HsOfficeDebitors import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficeDebitorInsertResource; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficeDebitorPatchResource; import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficeDebitorResource; -import net.hostsharing.hsadminng.hs.office.partner.HsOfficePartnerRepository; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationEntity; import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationRepository; import net.hostsharing.hsadminng.mapper.Mapper; @@ -38,9 +37,6 @@ public class HsOfficeDebitorController implements HsOfficeDebitorsApi { @Autowired private HsOfficeDebitorRepository debitorRepo; - @Autowired - private HsOfficePartnerRepository partnerRepo; - @Autowired private HsOfficeRelationRepository relRepo; @@ -95,9 +91,6 @@ public class HsOfficeDebitorController implements HsOfficeDebitorsApi { () -> { throw new EntityNotFoundException("ERROR: [400] debitorRelUuid not found: " + body.getDebitorRelUuid());}); } - final var relatedPartner = partnerRepo.findPartnerByPartnerPersonUuid(entityToSave.getDebitorRel().getHolder().getUuid()); - entityToSave.setPartner(relatedPartner); - final var savedEntity = debitorRepo.save(entityToSave); em.flush(); em.refresh(savedEntity); diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerEntity.java b/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerEntity.java index 6f9589f5..2ec637be 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerEntity.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerEntity.java @@ -66,11 +66,11 @@ public class HsOfficePartnerEntity implements Stringifyable, RbacObject