1
0

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:
Michael Hoennig
2024-05-02 13:53:53 +02:00
parent e09a09cf92
commit c953b815d5
11 changed files with 125 additions and 30 deletions

View File

@ -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")

View File

@ -0,0 +1,8 @@
package net.hostsharing.hsadminng.hs.booking.item;
public enum HsBookingItemType {
PRIVATE_CLOUD,
CLOUD_SERVER,
MANAGED_SERVER,
MANAGED_WEBSPACE
}