Compare commits

..

No commits in common. "6d4ba9b094ef63e602f443c117a8cd9d396c17de" and "5d298a498f773d51fbdedfce160f08375add15ba" have entirely different histories.

11 changed files with 18 additions and 40 deletions

View File

@ -58,7 +58,7 @@ function importOfficeData() {
./gradlew importOfficeData
}
alias gw-importOfficeData=importOfficeData
alias import-office-data=importOfficeData
alias podman-start='systemctl --user enable --now podman.socket && systemctl --user status podman.socket && ls -la /run/user/$UID/podman/podman.sock'
alias podman-stop='systemctl --user disable --now podman.socket && systemctl --user status podman.socket && ls -la /run/user/$UID/podman/podman.sock'

View File

@ -309,6 +309,7 @@ tasks.register('importOfficeData', Test) {
group 'verification'
description 'run the import jobs as tests'
}
test.dependsOn tasks.importOfficeData
// pitest mutation testing

View File

@ -59,8 +59,8 @@ public class HsOfficeMembershipEntity implements HasUuid, Stringifyable {
@Type(PostgreSQLRangeType.class)
private Range<LocalDate> validity;
@Column(name = "membershipfeebillable", nullable = false)
private Boolean membershipFeeBillable; // not primitive to force setting the value
@Column(name = "membership_fee_billable")
private boolean membershipFeeBillable;
@Column(name = "reasonfortermination")
@Enumerated(EnumType.STRING)

View File

@ -37,8 +37,6 @@ public class HsOfficeMembershipEntityPatcher implements EntityPatcher<HsOfficeMe
Optional.ofNullable(resource.getReasonForTermination())
.map(v -> mapper.map(v, HsOfficeReasonForTermination.class))
.ifPresent(entity::setReasonForTermination);
OptionalFromJson.of(resource.getMembershipFeeBillable()).ifPresent(
entity::setMembershipFeeBillable);
}
private void verifyNotNull(final UUID newValue, final String propertyName) {

View File

@ -33,8 +33,6 @@ components:
format: date
reasonForTermination:
$ref: '#/components/schemas/HsOfficeReasonForTermination'
membershipFeeBillable:
type: boolean
HsOfficeMembershipPatch:
type: object
@ -50,9 +48,6 @@ components:
reasonForTermination:
nullable: true
$ref: '#/components/schemas/HsOfficeReasonForTermination'
membershipFeeBillable:
nullable: true
type: boolean
additionalProperties: false
HsOfficeMembershipInsert:
@ -79,12 +74,8 @@ components:
nullable: true
reasonForTermination:
$ref: '#/components/schemas/HsOfficeReasonForTermination'
membershipFeeBillable:
nullable: false
type: boolean
required:
- partnerUuid
- mainDebitorUuid
- validFrom
- membershipFeeBillable
additionalProperties: false

View File

@ -16,7 +16,7 @@ create table if not exists hs_office_membership
memberNumber numeric(5) not null unique,
validity daterange not null,
reasonForTermination HsOfficeReasonForTermination not null default 'NONE',
membershipFeeBillable boolean not null default true
membership_fee_billable boolean not null default true
);
--//

View File

@ -106,7 +106,7 @@ call generateRbacRestrictedView('hs_office_membership',
columnUpdates => $updates$
validity = new.validity,
reasonForTermination = new.reasonForTermination,
membershipFeeBillable = new.membershipFeeBillable
membership_fee_billable = new.membership_fee_billable
$updates$);
--//

View File

@ -131,8 +131,7 @@ class HsOfficeMembershipControllerAcceptanceTest {
"partnerUuid": "%s",
"mainDebitorUuid": "%s",
"memberNumber": 20001,
"validFrom": "2022-10-13",
"membershipFeeBillable": "true"
"validFrom": "2022-10-13"
}
""".formatted(givenPartner.getUuid(), givenDebitor.getUuid()))
.port(port)
@ -447,7 +446,6 @@ class HsOfficeMembershipControllerAcceptanceTest {
.memberNumber(++tempMemberNumber)
.validity(Range.closedInfinite(LocalDate.parse("2022-11-01")))
.reasonForTermination(NONE)
.membershipFeeBillable(true)
.build();
return membershipRepo.save(newMembership);

View File

@ -72,8 +72,7 @@ public class HsOfficeMembershipControllerRestTest {
"partnerUuid": null,
"mainDebitorUuid": "%s",
"memberNumber": 20001,
"validFrom": "2022-10-13",
"membershipFeeBillable": "true"
"validFrom": "2022-10-13"
}
""".formatted(UUID.randomUUID()))
.accept(MediaType.APPLICATION_JSON))
@ -98,8 +97,7 @@ public class HsOfficeMembershipControllerRestTest {
"partnerUuid": "%s",
"mainDebitorUuid": null,
"memberNumber": 20001,
"validFrom": "2022-10-13",
"membershipFeeBillable": "true"
"validFrom": "2022-10-13"
}
""".formatted(UUID.randomUUID()))
.accept(MediaType.APPLICATION_JSON))
@ -130,8 +128,7 @@ public class HsOfficeMembershipControllerRestTest {
"partnerUuid": "%s",
"mainDebitorUuid": "%s",
"memberNumber": 20001,
"validFrom": "2022-10-13",
"membershipFeeBillable": "true"
"validFrom": "2022-10-13"
}
""".formatted(givenPartnerUuid, givenMainDebitorUuid))
.accept(MediaType.APPLICATION_JSON))
@ -162,8 +159,7 @@ public class HsOfficeMembershipControllerRestTest {
"partnerUuid": "%s",
"mainDebitorUuid": "%s",
"memberNumber": 20001,
"validFrom": "2022-10-13",
"membershipFeeBillable": "true"
"validFrom": "2022-10-13"
}
""".formatted(givenPartnerUuid, givenMainDebitorUuid))
.accept(MediaType.APPLICATION_JSON))

View File

@ -36,9 +36,6 @@ class HsOfficeMembershipEntityPatcherUnitTest extends PatchUnitTestBase<
private static final LocalDate GIVEN_VALID_FROM = LocalDate.parse("2020-04-15");
private static final LocalDate PATCHED_VALID_TO = LocalDate.parse("2022-12-31");
private static final Boolean GIVEN_MEMBERSHIP_FEE_BILLABLE = true;
private static final Boolean PATCHED_MEMBERSHIP_FEE_BILLABLE = false;
@Mock
private EntityManager em;
@ -59,7 +56,6 @@ class HsOfficeMembershipEntityPatcherUnitTest extends PatchUnitTestBase<
entity.setMainDebitor(TEST_DEBITOR);
entity.setPartner(TEST_PARTNER);
entity.setValidity(Range.closedInfinite(GIVEN_VALID_FROM));
entity.setMembershipFeeBillable(GIVEN_MEMBERSHIP_FEE_BILLABLE);
return entity;
}
@ -94,12 +90,7 @@ class HsOfficeMembershipEntityPatcherUnitTest extends PatchUnitTestBase<
HsOfficeReasonForTerminationResource.CANCELLATION,
HsOfficeMembershipEntity::setReasonForTermination,
HsOfficeReasonForTermination.CANCELLATION)
.notNullable(),
new JsonNullableProperty<>(
"membershipFeeBillable",
HsOfficeMembershipPatchResource::setMembershipFeeBillable,
PATCHED_MEMBERSHIP_FEE_BILLABLE,
HsOfficeMembershipEntity::setMembershipFeeBillable)
.notNullable()
);
}
@ -108,4 +99,10 @@ class HsOfficeMembershipEntityPatcherUnitTest extends PatchUnitTestBase<
newDebitor.setUuid(uuid);
return newDebitor;
}
private HsOfficeMembershipEntity newMembership(final UUID uuid) {
final var newMembership = new HsOfficeMembershipEntity();
newMembership.setUuid(uuid);
return newMembership;
}
}

View File

@ -81,7 +81,6 @@ class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTest {
.partner(givenPartner)
.mainDebitor(givenDebitor)
.validity(Range.closedInfinite(LocalDate.parse("2020-01-01")))
.membershipFeeBillable(true)
.build());
return membershipRepo.save(newMembership);
});
@ -112,7 +111,6 @@ class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTest {
.partner(givenPartner)
.mainDebitor(givenDebitor)
.validity(Range.closedInfinite(LocalDate.parse("2020-01-01")))
.membershipFeeBillable(true)
.build());
return membershipRepo.save(newMembership);
});
@ -418,7 +416,6 @@ class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTest {
.partner(givenPartner)
.mainDebitor(givenDebitor)
.validity(Range.closedInfinite(LocalDate.parse("2020-01-01")))
.membershipFeeBillable(true)
.build();
toCleanup(newMembership);