Commit a50c8682 by Antti Tönkyrä

cardstate added to printedcard, see sql alter from wiki

1 parent 0dd8c8a6
......@@ -14,6 +14,8 @@ import javax.faces.model.ListDataModel;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
......@@ -26,6 +28,8 @@ import javax.persistence.UniqueConstraint;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
import fi.codecrew.moya.enums.CardState;
/**
*
*/
......@@ -74,6 +78,10 @@ public class PrintedCard extends GenericEntity {
@ManyToOne(optional = false)
private CardTemplate template;
@Column(name="card_state", nullable=false)
@Enumerated(EnumType.STRING)
private CardState cardState = CardState.PENDING_VALIDATION;
public PrintedCard(EventUser usr, CardTemplate templ, Calendar printTime, boolean cardEnabled) {
super();
this.event = templ.getEvent();
......@@ -196,6 +204,14 @@ public class PrintedCard extends GenericEntity {
return gamepoints;
}
public CardState getCardState() {
return cardState;
}
public void setCardState(CardState cardState) {
this.cardState = cardState;
}
@Transient
private transient ListDataModel<ReaderEvent> revents;
......
package fi.codecrew.moya.enums;
public enum CardState {
PENDING_VALIDATION,
REJECTED,
VALIDATED,
PENDING_PRINT,
PRINTING_IN_PROGRESS,
PRINTED
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!