introduce booking-item-type and check (#51)
Co-authored-by: Michael Hoennig <michael@hoennig.de> Reviewed-on: https://dev.hostsharing.net/hostsharing/hs.hsadmin.ng/pulls/51 Reviewed-by: Marc Sandlus <marc.sandlus@hostsharing.net>
This commit is contained in:
@ -21,6 +21,8 @@ import org.hibernate.annotations.Type;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.EnumType;
|
||||
import jakarta.persistence.Enumerated;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
@ -66,7 +68,8 @@ import static net.hostsharing.hsadminng.stringify.Stringify.stringify;
|
||||
public class HsBookingItemEntity implements Stringifyable, RbacObject {
|
||||
|
||||
private static Stringify<HsBookingItemEntity> stringify = stringify(HsBookingItemEntity.class)
|
||||
.withProp(e -> e.getDebitor().toShortString())
|
||||
.withProp(HsBookingItemEntity::getDebitor)
|
||||
.withProp(HsBookingItemEntity::getType)
|
||||
.withProp(e -> e.getValidity().asString())
|
||||
.withProp(HsBookingItemEntity::getCaption)
|
||||
.withProp(HsBookingItemEntity::getResources)
|
||||
@ -83,6 +86,10 @@ public class HsBookingItemEntity implements Stringifyable, RbacObject {
|
||||
@JoinColumn(name = "debitoruuid")
|
||||
private HsOfficeDebitorEntity debitor;
|
||||
|
||||
@Column(name = "type")
|
||||
@Enumerated(EnumType.STRING)
|
||||
private HsBookingItemType type;
|
||||
|
||||
@Builder.Default
|
||||
@Type(PostgreSQLRangeType.class)
|
||||
@Column(name = "validity", columnDefinition = "daterange")
|
||||
|
@ -0,0 +1,8 @@
|
||||
package net.hostsharing.hsadminng.hs.booking.item;
|
||||
|
||||
public enum HsBookingItemType {
|
||||
PRIVATE_CLOUD,
|
||||
CLOUD_SERVER,
|
||||
MANAGED_SERVER,
|
||||
MANAGED_WEBSPACE
|
||||
}
|
Reference in New Issue
Block a user