Compare commits
3 Commits
c98a5acb38
...
89f57f75be
Author | SHA1 | Date | |
---|---|---|---|
|
89f57f75be | ||
|
d644e9aef2 | ||
|
b6fa9606ac |
@ -118,8 +118,8 @@ openapiProcessor {
|
|||||||
springRoot {
|
springRoot {
|
||||||
processorName 'spring'
|
processorName 'spring'
|
||||||
processor 'io.openapiprocessor:openapi-processor-spring:2022.5'
|
processor 'io.openapiprocessor:openapi-processor-spring:2022.5'
|
||||||
apiPath "$projectDir/src/main/resources/api-definition.yaml"
|
apiPath "$projectDir/src/main/resources/api-definition/api-definition.yaml"
|
||||||
mapping "$projectDir/src/main/resources/api-mappings.yaml"
|
mapping "$projectDir/src/main/resources/api-definition/api-mappings.yaml"
|
||||||
targetDir "$buildDir/generated/sources/openapi-javax"
|
targetDir "$buildDir/generated/sources/openapi-javax"
|
||||||
showWarnings true
|
showWarnings true
|
||||||
openApiNullable true
|
openApiNullable true
|
||||||
|
@ -64,7 +64,7 @@ classDiagram
|
|||||||
}
|
}
|
||||||
|
|
||||||
class partner-MeierGmbH {
|
class partner-MeierGmbH {
|
||||||
+Numeric partnerNumber: 12345
|
+Numeric partnerNumber: P-12345
|
||||||
+Relation partnerRel
|
+Relation partnerRel
|
||||||
}
|
}
|
||||||
partner-MeierGmbH *-- rel-MeierGmbH
|
partner-MeierGmbH *-- rel-MeierGmbH
|
||||||
|
@ -5,8 +5,8 @@ import lombok.Builder;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import net.hostsharing.hsadminng.errors.DisplayAs;
|
import net.hostsharing.hsadminng.errors.DisplayAs;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringify;
|
import net.hostsharing.hsadminng.repr.Stringify;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringifyable;
|
import net.hostsharing.hsadminng.repr.Stringifyable;
|
||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.Entity;
|
||||||
@ -14,7 +14,7 @@ import jakarta.persistence.Id;
|
|||||||
import jakarta.persistence.Table;
|
import jakarta.persistence.Table;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import static net.hostsharing.hsadminng.stringify.Stringify.stringify;
|
import static net.hostsharing.hsadminng.repr.Stringify.stringify;
|
||||||
|
|
||||||
// a partial HsOfficeDebitorEntity to reduce the number of SQL queries to load the entity
|
// a partial HsOfficeDebitorEntity to reduce the number of SQL queries to load the entity
|
||||||
@Entity
|
@Entity
|
||||||
|
@ -15,8 +15,8 @@ import net.hostsharing.hsadminng.hs.booking.project.HsBookingProjectRealEntity;
|
|||||||
import net.hostsharing.hsadminng.hs.validation.PropertiesProvider;
|
import net.hostsharing.hsadminng.hs.validation.PropertiesProvider;
|
||||||
import net.hostsharing.hsadminng.mapper.PatchableMapWrapper;
|
import net.hostsharing.hsadminng.mapper.PatchableMapWrapper;
|
||||||
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringify;
|
import net.hostsharing.hsadminng.repr.Stringify;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringifyable;
|
import net.hostsharing.hsadminng.repr.Stringifyable;
|
||||||
import org.hibernate.annotations.Type;
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
import jakarta.persistence.CascadeType;
|
import jakarta.persistence.CascadeType;
|
||||||
@ -45,7 +45,7 @@ import static java.util.Optional.ofNullable;
|
|||||||
import static net.hostsharing.hsadminng.mapper.PostgresDateRange.lowerInclusiveFromPostgresDateRange;
|
import static net.hostsharing.hsadminng.mapper.PostgresDateRange.lowerInclusiveFromPostgresDateRange;
|
||||||
import static net.hostsharing.hsadminng.mapper.PostgresDateRange.toPostgresDateRange;
|
import static net.hostsharing.hsadminng.mapper.PostgresDateRange.toPostgresDateRange;
|
||||||
import static net.hostsharing.hsadminng.mapper.PostgresDateRange.upperInclusiveFromPostgresDateRange;
|
import static net.hostsharing.hsadminng.mapper.PostgresDateRange.upperInclusiveFromPostgresDateRange;
|
||||||
import static net.hostsharing.hsadminng.stringify.Stringify.stringify;
|
import static net.hostsharing.hsadminng.repr.Stringify.stringify;
|
||||||
|
|
||||||
@MappedSuperclass
|
@MappedSuperclass
|
||||||
@Getter
|
@Getter
|
||||||
|
@ -4,14 +4,14 @@ import lombok.*;
|
|||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
import net.hostsharing.hsadminng.hs.booking.debitor.HsBookingDebitorEntity;
|
import net.hostsharing.hsadminng.hs.booking.debitor.HsBookingDebitorEntity;
|
||||||
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringify;
|
import net.hostsharing.hsadminng.repr.Stringify;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringifyable;
|
import net.hostsharing.hsadminng.repr.Stringifyable;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import static java.util.Optional.ofNullable;
|
import static java.util.Optional.ofNullable;
|
||||||
import static net.hostsharing.hsadminng.stringify.Stringify.stringify;
|
import static net.hostsharing.hsadminng.repr.Stringify.stringify;
|
||||||
|
|
||||||
@MappedSuperclass
|
@MappedSuperclass
|
||||||
@Getter
|
@Getter
|
||||||
|
@ -15,8 +15,8 @@ import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRealEntity;
|
|||||||
import net.hostsharing.hsadminng.hs.validation.PropertiesProvider;
|
import net.hostsharing.hsadminng.hs.validation.PropertiesProvider;
|
||||||
import net.hostsharing.hsadminng.mapper.PatchableMapWrapper;
|
import net.hostsharing.hsadminng.mapper.PatchableMapWrapper;
|
||||||
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringify;
|
import net.hostsharing.hsadminng.repr.Stringify;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringifyable;
|
import net.hostsharing.hsadminng.repr.Stringifyable;
|
||||||
import org.hibernate.annotations.Type;
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
import jakarta.persistence.CascadeType;
|
import jakarta.persistence.CascadeType;
|
||||||
@ -42,7 +42,7 @@ import java.util.Optional;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import static java.util.Collections.emptyMap;
|
import static java.util.Collections.emptyMap;
|
||||||
import static net.hostsharing.hsadminng.stringify.Stringify.stringify;
|
import static net.hostsharing.hsadminng.repr.Stringify.stringify;
|
||||||
|
|
||||||
@MappedSuperclass
|
@MappedSuperclass
|
||||||
@Getter
|
@Getter
|
||||||
|
@ -5,8 +5,8 @@ import lombok.experimental.FieldNameConstants;
|
|||||||
import net.hostsharing.hsadminng.errors.DisplayAs;
|
import net.hostsharing.hsadminng.errors.DisplayAs;
|
||||||
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
||||||
import net.hostsharing.hsadminng.rbac.generator.RbacView;
|
import net.hostsharing.hsadminng.rbac.generator.RbacView;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringify;
|
import net.hostsharing.hsadminng.repr.Stringify;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringifyable;
|
import net.hostsharing.hsadminng.repr.Stringifyable;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -16,7 +16,7 @@ import static net.hostsharing.hsadminng.rbac.generator.RbacView.*;
|
|||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.Permission.*;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.Permission.*;
|
||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.RbacSubjectReference.UserRole.CREATOR;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.RbacSubjectReference.UserRole.CREATOR;
|
||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.Role.*;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.Role.*;
|
||||||
import static net.hostsharing.hsadminng.stringify.Stringify.stringify;
|
import static net.hostsharing.hsadminng.repr.Stringify.stringify;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(schema = "hs_office", name = "bankaccount_rv")
|
@Table(schema = "hs_office", name = "bankaccount_rv")
|
||||||
|
@ -12,8 +12,8 @@ import lombok.experimental.SuperBuilder;
|
|||||||
import net.hostsharing.hsadminng.errors.DisplayAs;
|
import net.hostsharing.hsadminng.errors.DisplayAs;
|
||||||
import net.hostsharing.hsadminng.mapper.PatchableMapWrapper;
|
import net.hostsharing.hsadminng.mapper.PatchableMapWrapper;
|
||||||
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringify;
|
import net.hostsharing.hsadminng.repr.Stringify;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringifyable;
|
import net.hostsharing.hsadminng.repr.Stringifyable;
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
import org.hibernate.annotations.Type;
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import static net.hostsharing.hsadminng.stringify.Stringify.stringify;
|
import static net.hostsharing.hsadminng.repr.Stringify.stringify;
|
||||||
|
|
||||||
@MappedSuperclass
|
@MappedSuperclass
|
||||||
@Getter
|
@Getter
|
||||||
|
@ -10,8 +10,8 @@ import net.hostsharing.hsadminng.errors.DisplayAs;
|
|||||||
import net.hostsharing.hsadminng.hs.office.membership.HsOfficeMembershipEntity;
|
import net.hostsharing.hsadminng.hs.office.membership.HsOfficeMembershipEntity;
|
||||||
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
||||||
import net.hostsharing.hsadminng.rbac.generator.RbacView;
|
import net.hostsharing.hsadminng.rbac.generator.RbacView;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringify;
|
import net.hostsharing.hsadminng.repr.Stringify;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringifyable;
|
import net.hostsharing.hsadminng.repr.Stringifyable;
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
@ -31,7 +31,7 @@ import static net.hostsharing.hsadminng.rbac.generator.RbacView.Role.ADMIN;
|
|||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.Role.AGENT;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.Role.AGENT;
|
||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.SQL.directlyFetchedByDependsOnColumn;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.SQL.directlyFetchedByDependsOnColumn;
|
||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.rbacViewFor;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.rbacViewFor;
|
||||||
import static net.hostsharing.hsadminng.stringify.Stringify.stringify;
|
import static net.hostsharing.hsadminng.repr.Stringify.stringify;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(schema = "hs_office", name = "coopassettx_rv")
|
@Table(schema = "hs_office", name = "coopassettx_rv")
|
||||||
|
@ -10,8 +10,8 @@ import net.hostsharing.hsadminng.hs.office.membership.HsOfficeMembershipEntity;
|
|||||||
import net.hostsharing.hsadminng.rbac.generator.RbacView;
|
import net.hostsharing.hsadminng.rbac.generator.RbacView;
|
||||||
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
||||||
import net.hostsharing.hsadminng.rbac.generator.RbacView.SQL;
|
import net.hostsharing.hsadminng.rbac.generator.RbacView.SQL;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringify;
|
import net.hostsharing.hsadminng.repr.Stringify;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringifyable;
|
import net.hostsharing.hsadminng.repr.Stringifyable;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -29,7 +29,7 @@ import static net.hostsharing.hsadminng.rbac.generator.RbacView.Role.ADMIN;
|
|||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.Role.AGENT;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.Role.AGENT;
|
||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.SQL.directlyFetchedByDependsOnColumn;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.SQL.directlyFetchedByDependsOnColumn;
|
||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.rbacViewFor;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.rbacViewFor;
|
||||||
import static net.hostsharing.hsadminng.stringify.Stringify.stringify;
|
import static net.hostsharing.hsadminng.repr.Stringify.stringify;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(schema = "hs_office", name = "coopsharetx_rv")
|
@Table(schema = "hs_office", name = "coopsharetx_rv")
|
||||||
|
@ -14,8 +14,8 @@ import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationRbacEntity;
|
|||||||
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
||||||
import net.hostsharing.hsadminng.rbac.generator.RbacView;
|
import net.hostsharing.hsadminng.rbac.generator.RbacView;
|
||||||
import net.hostsharing.hsadminng.rbac.generator.RbacView.SQL;
|
import net.hostsharing.hsadminng.rbac.generator.RbacView.SQL;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringify;
|
import net.hostsharing.hsadminng.repr.Stringify;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringifyable;
|
import net.hostsharing.hsadminng.repr.Stringifyable;
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
import org.hibernate.annotations.JoinFormula;
|
import org.hibernate.annotations.JoinFormula;
|
||||||
import org.hibernate.annotations.NotFound;
|
import org.hibernate.annotations.NotFound;
|
||||||
@ -51,7 +51,7 @@ import static net.hostsharing.hsadminng.rbac.generator.RbacView.Role.*;
|
|||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.SQL.directlyFetchedByDependsOnColumn;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.SQL.directlyFetchedByDependsOnColumn;
|
||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.SQL.fetchedBySql;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.SQL.fetchedBySql;
|
||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.rbacViewFor;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.rbacViewFor;
|
||||||
import static net.hostsharing.hsadminng.stringify.Stringify.stringify;
|
import static net.hostsharing.hsadminng.repr.Stringify.stringify;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(schema = "hs_office", name = "debitor_rv")
|
@Table(schema = "hs_office", name = "debitor_rv")
|
||||||
|
@ -13,8 +13,8 @@ import net.hostsharing.hsadminng.persistence.BaseEntity;
|
|||||||
import net.hostsharing.hsadminng.hs.office.partner.HsOfficePartnerEntity;
|
import net.hostsharing.hsadminng.hs.office.partner.HsOfficePartnerEntity;
|
||||||
import net.hostsharing.hsadminng.rbac.generator.RbacView;
|
import net.hostsharing.hsadminng.rbac.generator.RbacView;
|
||||||
import net.hostsharing.hsadminng.rbac.generator.RbacView.SQL;
|
import net.hostsharing.hsadminng.rbac.generator.RbacView.SQL;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringify;
|
import net.hostsharing.hsadminng.repr.Stringify;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringifyable;
|
import net.hostsharing.hsadminng.repr.Stringifyable;
|
||||||
import org.hibernate.annotations.Type;
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
@ -53,7 +53,7 @@ import static net.hostsharing.hsadminng.rbac.generator.RbacView.Role.OWNER;
|
|||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.Role.TENANT;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.Role.TENANT;
|
||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.SQL.fetchedBySql;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.SQL.fetchedBySql;
|
||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.rbacViewFor;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.rbacViewFor;
|
||||||
import static net.hostsharing.hsadminng.stringify.Stringify.stringify;
|
import static net.hostsharing.hsadminng.repr.Stringify.stringify;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(schema = "hs_office", name = "membership_rv")
|
@Table(schema = "hs_office", name = "membership_rv")
|
||||||
|
@ -27,6 +27,7 @@ import java.util.List;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import static net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationType.EX_PARTNER;
|
import static net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationType.EX_PARTNER;
|
||||||
|
import static net.hostsharing.hsadminng.repr.TaggedNumber.cropTag;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
|
||||||
@ -150,7 +151,7 @@ public class HsOfficePartnerController implements HsOfficePartnersApi {
|
|||||||
|
|
||||||
private HsOfficePartnerEntity createPartnerEntity(final HsOfficePartnerInsertResource body) {
|
private HsOfficePartnerEntity createPartnerEntity(final HsOfficePartnerInsertResource body) {
|
||||||
final var entityToSave = new HsOfficePartnerEntity();
|
final var entityToSave = new HsOfficePartnerEntity();
|
||||||
entityToSave.setPartnerNumber(body.getPartnerNumber());
|
entityToSave.setPartnerNumber(cropTag(HsOfficePartnerEntity.PARTNER_NUMBER_TAG, body.getPartnerNumber()));
|
||||||
entityToSave.setPartnerRel(persistPartnerRel(body.getPartnerRel()));
|
entityToSave.setPartnerRel(persistPartnerRel(body.getPartnerRel()));
|
||||||
entityToSave.setDetails(mapper.map(body.getDetails(), HsOfficePartnerDetailsEntity.class));
|
entityToSave.setDetails(mapper.map(body.getDetails(), HsOfficePartnerDetailsEntity.class));
|
||||||
return entityToSave;
|
return entityToSave;
|
||||||
|
@ -5,8 +5,8 @@ import net.hostsharing.hsadminng.errors.DisplayAs;
|
|||||||
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
||||||
import net.hostsharing.hsadminng.rbac.generator.RbacView;
|
import net.hostsharing.hsadminng.rbac.generator.RbacView;
|
||||||
import net.hostsharing.hsadminng.rbac.generator.RbacView.SQL;
|
import net.hostsharing.hsadminng.rbac.generator.RbacView.SQL;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringify;
|
import net.hostsharing.hsadminng.repr.Stringify;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringifyable;
|
import net.hostsharing.hsadminng.repr.Stringifyable;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -17,7 +17,7 @@ import static net.hostsharing.hsadminng.rbac.generator.RbacView.GLOBAL;
|
|||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.Permission.*;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.Permission.*;
|
||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.Role.*;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.Role.*;
|
||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.rbacViewFor;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.rbacViewFor;
|
||||||
import static net.hostsharing.hsadminng.stringify.Stringify.stringify;
|
import static net.hostsharing.hsadminng.repr.Stringify.stringify;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(schema = "hs_office", name = "partner_details_rv")
|
@Table(schema = "hs_office", name = "partner_details_rv")
|
||||||
|
@ -14,8 +14,8 @@ import net.hostsharing.hsadminng.persistence.BaseEntity;
|
|||||||
import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelation;
|
import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelation;
|
||||||
import net.hostsharing.hsadminng.rbac.generator.RbacView;
|
import net.hostsharing.hsadminng.rbac.generator.RbacView;
|
||||||
import net.hostsharing.hsadminng.rbac.generator.RbacView.SQL;
|
import net.hostsharing.hsadminng.rbac.generator.RbacView.SQL;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringify;
|
import net.hostsharing.hsadminng.repr.Stringify;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringifyable;
|
import net.hostsharing.hsadminng.repr.Stringifyable;
|
||||||
import org.hibernate.annotations.NotFound;
|
import org.hibernate.annotations.NotFound;
|
||||||
import org.hibernate.annotations.NotFoundAction;
|
import org.hibernate.annotations.NotFoundAction;
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ import static net.hostsharing.hsadminng.rbac.generator.RbacView.Role.*;
|
|||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.SQL.directlyFetchedByDependsOnColumn;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.SQL.directlyFetchedByDependsOnColumn;
|
||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.rbacViewFor;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.rbacViewFor;
|
||||||
import static java.util.Optional.ofNullable;
|
import static java.util.Optional.ofNullable;
|
||||||
import static net.hostsharing.hsadminng.stringify.Stringify.stringify;
|
import static net.hostsharing.hsadminng.repr.Stringify.stringify;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(schema = "hs_office", name = "partner_rv")
|
@Table(schema = "hs_office", name = "partner_rv")
|
||||||
|
@ -6,8 +6,8 @@ import net.hostsharing.hsadminng.errors.DisplayAs;
|
|||||||
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
||||||
import net.hostsharing.hsadminng.rbac.generator.RbacView;
|
import net.hostsharing.hsadminng.rbac.generator.RbacView;
|
||||||
import net.hostsharing.hsadminng.rbac.generator.RbacView.SQL;
|
import net.hostsharing.hsadminng.rbac.generator.RbacView.SQL;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringify;
|
import net.hostsharing.hsadminng.repr.Stringify;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringifyable;
|
import net.hostsharing.hsadminng.repr.Stringifyable;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
@ -19,7 +19,7 @@ import static net.hostsharing.hsadminng.rbac.generator.RbacView.Permission.*;
|
|||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.RbacSubjectReference.UserRole.CREATOR;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.RbacSubjectReference.UserRole.CREATOR;
|
||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.Role.*;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.Role.*;
|
||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.rbacViewFor;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.rbacViewFor;
|
||||||
import static net.hostsharing.hsadminng.stringify.Stringify.stringify;
|
import static net.hostsharing.hsadminng.repr.Stringify.stringify;
|
||||||
|
|
||||||
// TODO.refa: split HsOfficePersonEntity into Real+Rbac-Entity
|
// TODO.refa: split HsOfficePersonEntity into Real+Rbac-Entity
|
||||||
@Entity
|
@Entity
|
||||||
|
@ -6,14 +6,14 @@ import lombok.experimental.SuperBuilder;
|
|||||||
import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRealEntity;
|
import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactRealEntity;
|
||||||
import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity;
|
import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity;
|
||||||
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringify;
|
import net.hostsharing.hsadminng.repr.Stringify;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringifyable;
|
import net.hostsharing.hsadminng.repr.Stringifyable;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import static net.hostsharing.hsadminng.stringify.Stringify.stringify;
|
import static net.hostsharing.hsadminng.repr.Stringify.stringify;
|
||||||
|
|
||||||
@MappedSuperclass
|
@MappedSuperclass
|
||||||
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
||||||
|
@ -9,8 +9,8 @@ import net.hostsharing.hsadminng.hs.office.debitor.HsOfficeDebitorEntity;
|
|||||||
import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationRbacEntity;
|
import net.hostsharing.hsadminng.hs.office.relation.HsOfficeRelationRbacEntity;
|
||||||
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
import net.hostsharing.hsadminng.persistence.BaseEntity;
|
||||||
import net.hostsharing.hsadminng.rbac.generator.RbacView;
|
import net.hostsharing.hsadminng.rbac.generator.RbacView;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringify;
|
import net.hostsharing.hsadminng.repr.Stringify;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringifyable;
|
import net.hostsharing.hsadminng.repr.Stringifyable;
|
||||||
import org.hibernate.annotations.Type;
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
@ -30,7 +30,7 @@ import static net.hostsharing.hsadminng.rbac.generator.RbacView.RbacSubjectRefer
|
|||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.Role.*;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.Role.*;
|
||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.SQL.*;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.SQL.*;
|
||||||
import static net.hostsharing.hsadminng.rbac.generator.RbacView.rbacViewFor;
|
import static net.hostsharing.hsadminng.rbac.generator.RbacView.rbacViewFor;
|
||||||
import static net.hostsharing.hsadminng.stringify.Stringify.stringify;
|
import static net.hostsharing.hsadminng.repr.Stringify.stringify;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(schema = "hs_office", name = "sepamandate_rv")
|
@Table(schema = "hs_office", name = "sepamandate_rv")
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package net.hostsharing.hsadminng.stringify;
|
package net.hostsharing.hsadminng.repr;
|
||||||
|
|
||||||
import net.hostsharing.hsadminng.errors.DisplayAs;
|
import net.hostsharing.hsadminng.errors.DisplayAs;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package net.hostsharing.hsadminng.stringify;
|
package net.hostsharing.hsadminng.repr;
|
||||||
|
|
||||||
public interface Stringifyable {
|
public interface Stringifyable {
|
||||||
|
|
@ -0,0 +1,15 @@
|
|||||||
|
package net.hostsharing.hsadminng.repr;
|
||||||
|
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
|
||||||
|
@UtilityClass
|
||||||
|
public class TaggedNumber {
|
||||||
|
|
||||||
|
public static Integer cropTag(final String tag, final String taggedNumber) {
|
||||||
|
return taggedNumber.startsWith(tag) ? Integer.valueOf(taggedNumber.substring(tag.length())) : invalidTag(tag, taggedNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Integer invalidTag(final String tag, final String taggedNumber) {
|
||||||
|
throw new IllegalArgumentException("Expected " + tag + "... but got: " + taggedNumber);
|
||||||
|
}
|
||||||
|
}
|
@ -10,10 +10,10 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
format: uuid
|
format: uuid
|
||||||
partnerNumber:
|
partnerNumber:
|
||||||
type: integer
|
type: string
|
||||||
format: int8
|
minLength: 7
|
||||||
minimum: 10000
|
maxLength: 7
|
||||||
maximum: 99999
|
pattern: 'P-[0-9]{5}'
|
||||||
partnerRel:
|
partnerRel:
|
||||||
$ref: 'hs-office-relation-schemas.yaml#/components/schemas/HsOfficeRelation'
|
$ref: 'hs-office-relation-schemas.yaml#/components/schemas/HsOfficeRelation'
|
||||||
details:
|
details:
|
||||||
@ -86,10 +86,10 @@ components:
|
|||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
partnerNumber:
|
partnerNumber:
|
||||||
type: integer
|
type: string
|
||||||
format: int8
|
minLength: 7
|
||||||
minimum: 10000
|
maxLength: 7
|
||||||
maximum: 99999
|
pattern: 'P-[0-9]{5}'
|
||||||
partnerRel:
|
partnerRel:
|
||||||
$ref: '#/components/schemas/HsOfficePartnerRelInsert'
|
$ref: '#/components/schemas/HsOfficePartnerRelInsert'
|
||||||
details:
|
details:
|
||||||
|
@ -113,7 +113,7 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu
|
|||||||
"debitorNumber": 1000111,
|
"debitorNumber": 1000111,
|
||||||
"debitorNumberSuffix": "11",
|
"debitorNumberSuffix": "11",
|
||||||
"partner": {
|
"partner": {
|
||||||
"partnerNumber": 10001,
|
"partnerNumber": "P-10001",
|
||||||
"partnerRel": {
|
"partnerRel": {
|
||||||
"anchor": {
|
"anchor": {
|
||||||
"personType": "LEGAL_PERSON",
|
"personType": "LEGAL_PERSON",
|
||||||
@ -168,7 +168,7 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu
|
|||||||
"debitorNumber": 1000212,
|
"debitorNumber": 1000212,
|
||||||
"debitorNumberSuffix": "12",
|
"debitorNumberSuffix": "12",
|
||||||
"partner": {
|
"partner": {
|
||||||
"partnerNumber": 10002,
|
"partnerNumber": "P-10002",
|
||||||
"partnerRel": {
|
"partnerRel": {
|
||||||
"anchor": {"tradeName": "Hostsharing eG"},
|
"anchor": {"tradeName": "Hostsharing eG"},
|
||||||
"holder": {"tradeName": "Second e.K."},
|
"holder": {"tradeName": "Second e.K."},
|
||||||
@ -202,7 +202,7 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu
|
|||||||
"debitorNumber": 1000313,
|
"debitorNumber": 1000313,
|
||||||
"debitorNumberSuffix": "13",
|
"debitorNumberSuffix": "13",
|
||||||
"partner": {
|
"partner": {
|
||||||
"partnerNumber": 10003,
|
"partnerNumber": "P-10003",
|
||||||
"partnerRel": {
|
"partnerRel": {
|
||||||
"anchor": {"tradeName": "Hostsharing eG"},
|
"anchor": {"tradeName": "Hostsharing eG"},
|
||||||
"holder": {"tradeName": "Third OHG"},
|
"holder": {"tradeName": "Third OHG"},
|
||||||
@ -245,7 +245,7 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"debitorNumber": 1000212,
|
"debitorNumber": 1000212,
|
||||||
"partner": { "partnerNumber": 10002 },
|
"partner": { "partnerNumber": "P-10002" },
|
||||||
"debitorRel": {
|
"debitorRel": {
|
||||||
"contact": { "caption": "second contact" }
|
"contact": { "caption": "second contact" }
|
||||||
},
|
},
|
||||||
@ -535,7 +535,7 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu
|
|||||||
.body("", lenientlyEquals("""
|
.body("", lenientlyEquals("""
|
||||||
{
|
{
|
||||||
"debitorNumber": 1000111,
|
"debitorNumber": 1000111,
|
||||||
"partner": { "partnerNumber": 10001 },
|
"partner": { "partnerNumber": "P-10001" },
|
||||||
"debitorRel": { "contact": { "caption": "first contact" } },
|
"debitorRel": { "contact": { "caption": "first contact" } },
|
||||||
"refundBankAccount": null
|
"refundBankAccount": null
|
||||||
}
|
}
|
||||||
@ -584,7 +584,7 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu
|
|||||||
"debitorNumber": 10004${debitorNumberSuffix},
|
"debitorNumber": 10004${debitorNumberSuffix},
|
||||||
"debitorNumberSuffix": "${debitorNumberSuffix}",
|
"debitorNumberSuffix": "${debitorNumberSuffix}",
|
||||||
"partner": {
|
"partner": {
|
||||||
"partnerNumber": 10004,
|
"partnerNumber": "P-10004",
|
||||||
"partnerRel": {
|
"partnerRel": {
|
||||||
"anchor": { "tradeName": "Hostsharing eG" },
|
"anchor": { "tradeName": "Hostsharing eG" },
|
||||||
"holder": { "tradeName": "Fourth eG" },
|
"holder": { "tradeName": "Fourth eG" },
|
||||||
|
@ -77,7 +77,7 @@ class HsOfficeMembershipControllerAcceptanceTest extends ContextBasedTestWithCle
|
|||||||
.body("", lenientlyEquals("""
|
.body("", lenientlyEquals("""
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"partner": { "partnerNumber": 10001 },
|
"partner": { "partnerNumber": "P-10001" },
|
||||||
"memberNumber": 1000101,
|
"memberNumber": 1000101,
|
||||||
"memberNumberSuffix": "01",
|
"memberNumberSuffix": "01",
|
||||||
"validFrom": "2022-10-01",
|
"validFrom": "2022-10-01",
|
||||||
@ -85,7 +85,7 @@ class HsOfficeMembershipControllerAcceptanceTest extends ContextBasedTestWithCle
|
|||||||
"status": "ACTIVE"
|
"status": "ACTIVE"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"partner": { "partnerNumber": 10002 },
|
"partner": { "partnerNumber": "P-10002" },
|
||||||
"memberNumber": 1000202,
|
"memberNumber": 1000202,
|
||||||
"memberNumberSuffix": "02",
|
"memberNumberSuffix": "02",
|
||||||
"validFrom": "2022-10-01",
|
"validFrom": "2022-10-01",
|
||||||
@ -93,7 +93,7 @@ class HsOfficeMembershipControllerAcceptanceTest extends ContextBasedTestWithCle
|
|||||||
"status": "ACTIVE"
|
"status": "ACTIVE"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"partner": { "partnerNumber": 10003 },
|
"partner": { "partnerNumber": "P-10003" },
|
||||||
"memberNumber": 1000303,
|
"memberNumber": 1000303,
|
||||||
"memberNumberSuffix": "03",
|
"memberNumberSuffix": "03",
|
||||||
"validFrom": "2022-10-01",
|
"validFrom": "2022-10-01",
|
||||||
@ -124,7 +124,7 @@ class HsOfficeMembershipControllerAcceptanceTest extends ContextBasedTestWithCle
|
|||||||
.body("", lenientlyEquals("""
|
.body("", lenientlyEquals("""
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"partner": { "partnerNumber": 10001 },
|
"partner": { "partnerNumber": "P-10001" },
|
||||||
"memberNumber": 1000101,
|
"memberNumber": 1000101,
|
||||||
"memberNumberSuffix": "01",
|
"memberNumberSuffix": "01",
|
||||||
"validFrom": "2022-10-01",
|
"validFrom": "2022-10-01",
|
||||||
@ -152,7 +152,7 @@ class HsOfficeMembershipControllerAcceptanceTest extends ContextBasedTestWithCle
|
|||||||
.body("", lenientlyEquals("""
|
.body("", lenientlyEquals("""
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"partner": { "partnerNumber": 10002 },
|
"partner": { "partnerNumber": "P-10002" },
|
||||||
"memberNumber": 1000202,
|
"memberNumber": 1000202,
|
||||||
"memberNumberSuffix": "02",
|
"memberNumberSuffix": "02",
|
||||||
"validFrom": "2022-10-01",
|
"validFrom": "2022-10-01",
|
||||||
@ -195,7 +195,7 @@ class HsOfficeMembershipControllerAcceptanceTest extends ContextBasedTestWithCle
|
|||||||
.statusCode(201)
|
.statusCode(201)
|
||||||
.contentType(ContentType.JSON)
|
.contentType(ContentType.JSON)
|
||||||
.body("uuid", isUuidValid())
|
.body("uuid", isUuidValid())
|
||||||
.body("partner.partnerNumber", is(10003))
|
.body("partner.partnerNumber", is("P-10003"))
|
||||||
.body("memberNumber", is(expectedMemberNumber))
|
.body("memberNumber", is(expectedMemberNumber))
|
||||||
.body("memberNumberSuffix", is(givenMemberSuffix))
|
.body("memberNumberSuffix", is(givenMemberSuffix))
|
||||||
.body("validFrom", is("2022-10-13"))
|
.body("validFrom", is("2022-10-13"))
|
||||||
@ -230,7 +230,7 @@ class HsOfficeMembershipControllerAcceptanceTest extends ContextBasedTestWithCle
|
|||||||
.contentType("application/json")
|
.contentType("application/json")
|
||||||
.body("", lenientlyEquals("""
|
.body("", lenientlyEquals("""
|
||||||
{
|
{
|
||||||
"partner": { "partnerNumber": 10001 },
|
"partner": { "partnerNumber": "P-10001" },
|
||||||
"memberNumber": 1000101,
|
"memberNumber": 1000101,
|
||||||
"memberNumberSuffix": "01",
|
"memberNumberSuffix": "01",
|
||||||
"validFrom": "2022-10-01",
|
"validFrom": "2022-10-01",
|
||||||
@ -272,7 +272,7 @@ class HsOfficeMembershipControllerAcceptanceTest extends ContextBasedTestWithCle
|
|||||||
.contentType("application/json")
|
.contentType("application/json")
|
||||||
.body("", lenientlyEquals("""
|
.body("", lenientlyEquals("""
|
||||||
{
|
{
|
||||||
"partner": { "partnerNumber": 10003 },
|
"partner": { "partnerNumber": "P-10003" },
|
||||||
"memberNumber": 1000303,
|
"memberNumber": 1000303,
|
||||||
"memberNumberSuffix": "03",
|
"memberNumberSuffix": "03",
|
||||||
"validFrom": "2022-10-01",
|
"validFrom": "2022-10-01",
|
||||||
@ -309,7 +309,7 @@ class HsOfficeMembershipControllerAcceptanceTest extends ContextBasedTestWithCle
|
|||||||
.statusCode(200)
|
.statusCode(200)
|
||||||
.contentType(ContentType.JSON)
|
.contentType(ContentType.JSON)
|
||||||
.body("uuid", isUuidValid())
|
.body("uuid", isUuidValid())
|
||||||
.body("partner.partnerNumber", is(givenMembership.getPartner().getPartnerNumber()))
|
.body("partner.partnerNumber", is("P-" + givenMembership.getPartner().getPartnerNumber()))
|
||||||
.body("memberNumberSuffix", is(givenMembership.getMemberNumberSuffix()))
|
.body("memberNumberSuffix", is(givenMembership.getMemberNumberSuffix()))
|
||||||
.body("validFrom", is("2022-11-01"))
|
.body("validFrom", is("2022-11-01"))
|
||||||
.body("validTo", is("2023-12-31"))
|
.body("validTo", is("2023-12-31"))
|
||||||
|
@ -71,11 +71,11 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu
|
|||||||
.contentType("application/json")
|
.contentType("application/json")
|
||||||
.body("", lenientlyEquals("""
|
.body("", lenientlyEquals("""
|
||||||
[
|
[
|
||||||
{ partnerNumber: 10001 },
|
{ partnerNumber: "P-10001" },
|
||||||
{ partnerNumber: 10002 },
|
{ partnerNumber: "P-10002" },
|
||||||
{ partnerNumber: 10003 },
|
{ partnerNumber: "P-10003" },
|
||||||
{ partnerNumber: 10004 },
|
{ partnerNumber: "P-10004" },
|
||||||
{ partnerNumber: 10010 }
|
{ partnerNumber: "P-10010" }
|
||||||
]
|
]
|
||||||
"""));
|
"""));
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
@ -100,7 +100,7 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu
|
|||||||
.contentType(ContentType.JSON)
|
.contentType(ContentType.JSON)
|
||||||
.body("""
|
.body("""
|
||||||
{
|
{
|
||||||
"partnerNumber": "20002",
|
"partnerNumber": "P-20002",
|
||||||
"partnerRel": {
|
"partnerRel": {
|
||||||
"anchor.uuid": "%s",
|
"anchor.uuid": "%s",
|
||||||
"holder.uuid": "%s",
|
"holder.uuid": "%s",
|
||||||
@ -123,7 +123,7 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu
|
|||||||
.contentType(ContentType.JSON)
|
.contentType(ContentType.JSON)
|
||||||
.body("", lenientlyEquals("""
|
.body("", lenientlyEquals("""
|
||||||
{
|
{
|
||||||
"partnerNumber": 20002,
|
"partnerNumber": "P-20002",
|
||||||
"partnerRel": {
|
"partnerRel": {
|
||||||
"anchor": { "tradeName": "Hostsharing eG" },
|
"anchor": { "tradeName": "Hostsharing eG" },
|
||||||
"holder": { "tradeName": "Third OHG" },
|
"holder": { "tradeName": "Third OHG" },
|
||||||
@ -159,7 +159,7 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu
|
|||||||
.contentType(ContentType.JSON)
|
.contentType(ContentType.JSON)
|
||||||
.body("""
|
.body("""
|
||||||
{
|
{
|
||||||
"partnerNumber": "20003",
|
"partnerNumber": "P-20003",
|
||||||
"partnerRel": {
|
"partnerRel": {
|
||||||
"anchor.uuid": "%s",
|
"anchor.uuid": "%s",
|
||||||
"holder.uuid": "%s",
|
"holder.uuid": "%s",
|
||||||
@ -197,7 +197,7 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu
|
|||||||
.contentType(ContentType.JSON)
|
.contentType(ContentType.JSON)
|
||||||
.body("""
|
.body("""
|
||||||
{
|
{
|
||||||
"partnerNumber": "20004",
|
"partnerNumber": "P-20004",
|
||||||
"partnerRel": {
|
"partnerRel": {
|
||||||
"anchor.uuid": "%s",
|
"anchor.uuid": "%s",
|
||||||
"holder.uuid": "%s",
|
"holder.uuid": "%s",
|
||||||
@ -247,7 +247,7 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu
|
|||||||
.contentType("application/json")
|
.contentType("application/json")
|
||||||
.body("", lenientlyEquals("""
|
.body("", lenientlyEquals("""
|
||||||
{
|
{
|
||||||
"partnerNumber": 10001,
|
"partnerNumber": "P-10001",
|
||||||
"partnerRel": {
|
"partnerRel": {
|
||||||
"anchor": { "tradeName": "Hostsharing eG" },
|
"anchor": { "tradeName": "Hostsharing eG" },
|
||||||
"holder": { "tradeName": "First GmbH" },
|
"holder": { "tradeName": "First GmbH" },
|
||||||
@ -320,7 +320,7 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu
|
|||||||
.contentType(ContentType.JSON)
|
.contentType(ContentType.JSON)
|
||||||
.body("""
|
.body("""
|
||||||
{
|
{
|
||||||
"partnerNumber": "20011",
|
"partnerNumber": "P-20011",
|
||||||
"partnerRel.uuid": "%s",
|
"partnerRel.uuid": "%s",
|
||||||
"details": {
|
"details": {
|
||||||
"registrationOffice": "Temp Registergericht Aurich",
|
"registrationOffice": "Temp Registergericht Aurich",
|
||||||
@ -339,7 +339,7 @@ class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanu
|
|||||||
.contentType(ContentType.JSON)
|
.contentType(ContentType.JSON)
|
||||||
.body("", lenientlyEquals("""
|
.body("", lenientlyEquals("""
|
||||||
{
|
{
|
||||||
"partnerNumber": 20011,
|
"partnerNumber": "P-20011",
|
||||||
"partnerRel": {
|
"partnerRel": {
|
||||||
"anchor": { "tradeName": "Hostsharing eG" },
|
"anchor": { "tradeName": "Hostsharing eG" },
|
||||||
"holder": { "tradeName": "Third OHG" },
|
"holder": { "tradeName": "Third OHG" },
|
||||||
|
@ -99,7 +99,7 @@ class HsOfficePartnerControllerRestTest {
|
|||||||
.contentType(MediaType.APPLICATION_JSON)
|
.contentType(MediaType.APPLICATION_JSON)
|
||||||
.content("""
|
.content("""
|
||||||
{
|
{
|
||||||
"partnerNumber": "20002",
|
"partnerNumber": "P-20002",
|
||||||
"partnerRel": {
|
"partnerRel": {
|
||||||
"anchor.uuid": "%s",
|
"anchor.uuid": "%s",
|
||||||
"holder.uuid": "%s",
|
"holder.uuid": "%s",
|
||||||
@ -136,7 +136,7 @@ class HsOfficePartnerControllerRestTest {
|
|||||||
.contentType(MediaType.APPLICATION_JSON)
|
.contentType(MediaType.APPLICATION_JSON)
|
||||||
.content("""
|
.content("""
|
||||||
{
|
{
|
||||||
"partnerNumber": "20002",
|
"partnerNumber": "P-20002",
|
||||||
"partnerRel": {
|
"partnerRel": {
|
||||||
"anchor.uuid": "%s",
|
"anchor.uuid": "%s",
|
||||||
"holder.uuid": "%s",
|
"holder.uuid": "%s",
|
||||||
|
@ -58,7 +58,7 @@ class HsOfficeScenarioTests extends ScenarioTest {
|
|||||||
@Produces(explicitly = "Partner: P-31010 - Test AG", implicitly = {"Person: Test AG", "Contact: Test AG - Hamburg"})
|
@Produces(explicitly = "Partner: P-31010 - Test AG", implicitly = {"Person: Test AG", "Contact: Test AG - Hamburg"})
|
||||||
void shouldCreateLegalPersonAsPartner() {
|
void shouldCreateLegalPersonAsPartner() {
|
||||||
new CreatePartner(this)
|
new CreatePartner(this)
|
||||||
.given("partnerNumber", 31010)
|
.given("partnerNumber", "P-31010")
|
||||||
.given("personType", "LEGAL_PERSON")
|
.given("personType", "LEGAL_PERSON")
|
||||||
.given("tradeName", "Test AG")
|
.given("tradeName", "Test AG")
|
||||||
.given("contactCaption", "Test AG - Hamburg")
|
.given("contactCaption", "Test AG - Hamburg")
|
||||||
@ -80,7 +80,7 @@ class HsOfficeScenarioTests extends ScenarioTest {
|
|||||||
@Produces(explicitly = "Partner: P-31011 - Michelle Matthieu", implicitly = {"Person: Michelle Matthieu", "Contact: Michelle Matthieu"})
|
@Produces(explicitly = "Partner: P-31011 - Michelle Matthieu", implicitly = {"Person: Michelle Matthieu", "Contact: Michelle Matthieu"})
|
||||||
void shouldCreateNaturalPersonAsPartner() {
|
void shouldCreateNaturalPersonAsPartner() {
|
||||||
new CreatePartner(this)
|
new CreatePartner(this)
|
||||||
.given("partnerNumber", 31011)
|
.given("partnerNumber", "P-31011")
|
||||||
.given("personType", "NATURAL_PERSON")
|
.given("personType", "NATURAL_PERSON")
|
||||||
.given("givenName", "Michelle")
|
.given("givenName", "Michelle")
|
||||||
.given("familyName", "Matthieu")
|
.given("familyName", "Matthieu")
|
||||||
@ -148,7 +148,7 @@ class HsOfficeScenarioTests extends ScenarioTest {
|
|||||||
@Order(1090)
|
@Order(1090)
|
||||||
void shouldDeletePartner() {
|
void shouldDeletePartner() {
|
||||||
new DeletePartner(this)
|
new DeletePartner(this)
|
||||||
.given("partnerNumber", 31020)
|
.given("partnerNumber", "P-31020")
|
||||||
.doRun();
|
.doRun();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,13 +2,13 @@ package net.hostsharing.hsadminng.rbac.test;
|
|||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.FieldNameConstants;
|
import lombok.experimental.FieldNameConstants;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringify;
|
import net.hostsharing.hsadminng.repr.Stringify;
|
||||||
import net.hostsharing.hsadminng.stringify.Stringifyable;
|
import net.hostsharing.hsadminng.repr.Stringifyable;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import static net.hostsharing.hsadminng.stringify.Stringify.stringify;
|
import static net.hostsharing.hsadminng.repr.Stringify.stringify;
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
class StringifyUnitTest {
|
class StringifyUnitTest {
|
||||||
|
@ -0,0 +1,22 @@
|
|||||||
|
package net.hostsharing.hsadminng.repr;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
import static org.assertj.core.api.Assertions.catchThrowable;
|
||||||
|
|
||||||
|
class TaggedNumberUnitTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void cropsProperTag() {
|
||||||
|
assertThat(TaggedNumber.cropTag("P-", "P-12345")).isEqualTo(12345);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void throwsExceptionForImproperTag() {
|
||||||
|
final var exception = catchThrowable(() -> TaggedNumber.cropTag("P-", "X-12345"));
|
||||||
|
assertThat(exception).isInstanceOf(IllegalArgumentException.class);
|
||||||
|
assertThat(exception.getMessage()).isEqualTo("Expected P-... but got: X-12345");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user